-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCheckbox.stories.tsx
More file actions
67 lines (58 loc) · 1.41 KB
/
Checkbox.stories.tsx
File metadata and controls
67 lines (58 loc) · 1.41 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
import { baseProps } from '../../../stories/lists/baseProps';
import {
IS_INDETERMINATE_ARG,
IS_SELECTED_ARG,
} from '../../../stories/FormFieldArgs';
import { Flow } from '../../layout/Flow';
import { Checkbox } from './Checkbox';
export default {
title: 'Forms/Checkbox',
component: Checkbox,
parameters: {
controls: {
exclude: baseProps,
},
},
argTypes: {
...IS_SELECTED_ARG,
...IS_INDETERMINATE_ARG,
},
};
const Template = (props) => {
return (
<Flow gap="2x">
<Checkbox
aria-label="Checkbox"
{...props}
defaultSelected={true}
onChange={(query) => console.log('onChange event', query)}
/>
<Checkbox
aria-label="Checkbox"
{...props}
defaultSelected={false}
onChange={(query) => console.log('onChange event', query)}
/>
</Flow>
);
};
export const Default = Template.bind({});
Default.args = { children: 'Checkbox' };
export const WithLabel = Template.bind({});
WithLabel.args = { label: 'Checkbox' };
export const WithoutLabel = Template.bind({});
WithoutLabel.args = {};
export const Intermediate = Template.bind({});
Intermediate.args = {
isIndeterminate: true,
};
export const Disabled = Template.bind({});
Disabled.args = {
isDisabled: true,
children: 'Checkbox',
};
export const Invalid = Template.bind({});
Invalid.args = {
validationState: 'invalid',
children: 'Checkbox',
};