forked from coingaming/moon-design
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckbox.tsx
82 lines (80 loc) · 2.46 KB
/
checkbox.tsx
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
81
82
import Preview from '../../components/codePreview/Preview';
import ComponentPageDescription from '../../components/ComponentPageDescription';
import DeprecationWarning from '../../components/facing/DeprecationWarning';
import PropsTable from '../../components/PropsTable';
import Checked from '../../public/examples/checkbox/Checked';
import Default from '../../public/examples/checkbox/Default';
import Disabled from '../../public/examples/checkbox/Disabled';
import NoLabel from '../../public/examples/checkbox/NoLabel';
import Readonly from '../../public/examples/checkbox/Readonly';
import useExamples from '../../utils/useExamples';
const PageAccordion = () => {
const examples = useExamples('checkbox');
return (
<>
<ComponentPageDescription title="Checkbox">
<DeprecationWarning href="/core/checkbox" name="Checkbox" />
</ComponentPageDescription>
<Preview
title="Checkbox"
preview={<Default />}
code={examples ? examples.Default : 'Loading'}
/>
<Preview
title="Checked"
preview={<Checked />}
code={examples ? examples.Checked : 'Loading'}
/>
<Preview
title="No label"
preview={<NoLabel />}
code={examples ? examples.NoLabel : 'Loading'}
/>
<Preview
title="Disabled"
preview={<Disabled />}
code={examples ? examples.Disabled : 'Loading'}
/>
<Preview
title="Readonly"
preview={<Readonly />}
code={examples ? examples.Readonly : 'Loading'}
/>
<PropsTable
title="Props"
data={[
{
name: 'checked',
type: 'boolean',
required: false,
default: 'false',
description: 'Preset value for checkbox state',
},
{
name: 'disabled',
type: 'boolean',
required: false,
default: 'false',
description: 'Checkbox disabled state',
},
{
name: 'readOnly',
type: 'boolean',
required: false,
default: 'false',
description:
"Checkbox isn't disabled but its value can't be changed",
},
{
name: 'label',
type: 'string',
required: false,
default: '-',
description: 'Label that describes checkbox purpose',
},
]}
/>
</>
);
};
export default PageAccordion;