-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathInput.stories.tsx
More file actions
80 lines (68 loc) · 1.69 KB
/
Input.stories.tsx
File metadata and controls
80 lines (68 loc) · 1.69 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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.',
placeholder: 'Input some text',
};
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 Error = Template.bind({});
Error.args = {
variant: 'basic',
label: 'Texbox with error state',
error: 'Enter valid value',
};
export const Disabled = Template.bind({});
Disabled.args = {
variant: 'basic',
label: 'Disabled texbox',
placeholder: "Can't type here",
disabled: true,
};
export const ReadOnly = Template.bind({});
ReadOnly.args = {
variant: 'basic',
label: 'Read only texbox',
value: 'Read only value',
placeholder: "Can't type here",
readOnly: true,
};
export const CustomWidth = Template.bind({});
CustomWidth.args = {
variant: 'basic',
label: 'Texbox with a label',
tooltip: 'Some helpful imformation about this feild.',
placeholder: 'Input some text',
width: '300px'
};