-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(FormField): add boldLabel prop for InputPromo (#1495)
- Loading branch information
1 parent
34efe9a
commit df33d0d
Showing
3 changed files
with
22 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ import { Info } from '@livechat/design-system-icons'; | |
import { Meta, StoryFn } from '@storybook/react'; | ||
|
||
import { Icon } from '../Icon'; | ||
import { Input } from '../Input'; | ||
import { Input, InputPromo } from '../Input'; | ||
import { IInputProps } from '../Input/types'; | ||
|
||
import { FormField as FormFieldComponent, FormFieldProps } from './FormField'; | ||
|
@@ -23,13 +23,21 @@ export default { | |
labelRightNode: { | ||
control: false, | ||
}, | ||
parameters: { | ||
controls: { | ||
exclude: ['boldLabel'], | ||
}, | ||
}, | ||
}, | ||
} as Meta<typeof FormFieldComponent>; | ||
|
||
const ExampleIcon = () => <Icon source={Info} />; | ||
const ExampleInput = ({ ...args }: IInputProps) => ( | ||
<Input placeholder="Placeholder text" {...args} /> | ||
); | ||
const ExampleInputPromo = ({ ...args }: IInputProps) => ( | ||
<InputPromo placeholder="Placeholder text" {...args} /> | ||
); | ||
const LabelText = 'Email'; | ||
const DescriptionText = 'Enter your email address'; | ||
const PlaceholderText = 'e.g., [email protected]'; | ||
|
@@ -93,3 +101,9 @@ export const TextFieldWithError: StoryFn<FormFieldProps> = () => ( | |
<ExampleInput error /> | ||
</FormFieldComponent> | ||
); | ||
|
||
export const BoldLabelWithPromoInput: StoryFn<FormFieldProps> = () => ( | ||
<FormFieldComponent labelText="Username" boldLabel> | ||
<ExampleInputPromo /> | ||
</FormFieldComponent> | ||
); |
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