-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathInput.stories.tsx
More file actions
61 lines (51 loc) · 1.24 KB
/
Input.stories.tsx
File metadata and controls
61 lines (51 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { ComponentProps } from 'react';
import { Story } from '@storybook/react';
import { polyIcons } from '../../theme';
import { Input } from './Input';
export default {
title: 'Polyblocks/Input',
component: Input,
};
const Template: Story<ComponentProps<typeof Input>> = (props: any) => (
<Input {...props} />
);
export const Basic = Template.bind({});
Basic.args = {
variant: 'basic',
};
export const Labeled = Template.bind({});
Labeled.args = {
variant: 'basic',
label: 'Texbox with a label',
tooltip: 'Some helpful imformation about this feild.',
};
export const Unit = Template.bind({});
Unit.args = {
variant: 'basic',
label: 'Texbox with a unit',
unit: 'POLYX',
};
export const Icon = Template.bind({});
Icon.args = {
variant: 'basic',
label: 'Texbox with an icon',
icon: polyIcons.PolyBull,
};
export const Amount = Template.bind({});
Amount.args = {
variant: 'amount',
label: 'Texbox with amount formatting',
};
export const Phone = Template.bind({});
Phone.args = {
variant: 'amount',
type: 'phone',
countryCode: '+1',
label: 'Texbox with phone number formatting',
};
export const Error = Template.bind({});
Error.args = {
variant: 'basic',
label: 'Texbox with error state',
error: 'Enter valid value',
};