This repository has been archived by the owner on Feb 9, 2021. It is now read-only.
/
index.story.tsx
74 lines (68 loc) · 1.57 KB
/
index.story.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
import * as React from 'react';
import { IconToggle, LabelPlacement } from '../';
import Examples from './examples.tsx';
import {
header,
api,
divider,
importExample,
playground,
tab,
tabs,
testkit,
title,
} from 'wix-storybook-utils/Sections';
import { ReactComponent as StarIcon } from '../../../assets/icons/Star.svg';
import { ReactComponent as HeartIcon } from '../../../assets/icons/Heart.svg';
StarIcon.displayName = 'Star';
HeartIcon.displayName = 'Heart';
const iconExamples = [
{
label: 'Star',
value: <StarIcon />,
},
{
label: 'Heart',
value: <HeartIcon />,
},
];
export default {
category: 'Components',
storyName: 'IconToggle',
component: IconToggle,
componentPath: '../IconToggle.tsx',
componentProps: () => ({
'data-hook': 'storybook-IconToggle',
icon: iconExamples[0].value,
label: '0',
labelPlacement: LabelPlacement.END,
checked: false,
disabled: false,
}),
exampleProps: {
icon: iconExamples,
labelPlacement: Object.values(LabelPlacement),
},
dataHook: 'storybook-IconToggle',
sections: [
header(),
tabs([
tab({
title: 'Usage',
sections: [
importExample({
source: `import { IconToggle } from 'wix-ui-tpa/IconToggle';`,
}),
divider(),
title('Examples'),
],
}),
...[
{ title: 'API', sections: [api()] },
{ title: 'TestKit', sections: [testkit()] },
{ title: 'Playground', sections: [playground()] },
].map(tab),
]),
],
examples: <Examples />,
};