-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nemobot
committed
Feb 14, 2022
1 parent
7b32879
commit 1b83564
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { NumberField } from "../"; | ||
import { createComponentStories, fieldArgTypes, formatMessage, textArgType } from "../util"; | ||
|
||
const { defaultExport, createControlledStory } = createComponentStories({ | ||
component: NumberField, | ||
args: { | ||
name: "applications", | ||
label: formatMessage("Applications"), | ||
placeholder: formatMessage("Number of target applications"), | ||
assistiveText: formatMessage("The number of applications this campaign is targeting"), | ||
}, | ||
argTypes: { | ||
...fieldArgTypes, | ||
placeholder: textArgType, | ||
}, | ||
}); | ||
|
||
export default defaultExport; | ||
|
||
export const Default = createControlledStory<number | undefined>(undefined, {}); | ||
|
||
export const Disabled = createControlledStory(0, { | ||
disabled: true, | ||
}); | ||
|
||
export const Error = createControlledStory(0, { | ||
issues: [formatMessage("Please insert a number greater than 2")], | ||
}); | ||
|
||
export const Currency = createControlledStory(0, { | ||
kind: "currency", | ||
currency: "EUR", | ||
}); | ||
|
||
export const Percentage = createControlledStory(0, { | ||
kind: "percentage", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters