@bitrise/bitkit 10.36.2 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/package.json +17 -38
  2. package/src/Components/Menu/MenuItem.tsx +1 -1
  3. package/tsconfig.json +0 -5
  4. package/src/Components/Accordion/Accordion.stories.tsx +0 -63
  5. package/src/Components/Accordion/Accordion.test.tsx +0 -34
  6. package/src/Components/AspectRatio/AspectRatio.stories.tsx +0 -24
  7. package/src/Components/Avatar/Avatar.stories.tsx +0 -15
  8. package/src/Components/Badge/Badge.stories.tsx +0 -13
  9. package/src/Components/Box/Box.stories.tsx +0 -20
  10. package/src/Components/Breadcrumb/Breadcrumb.stories.tsx +0 -49
  11. package/src/Components/Button/Button.stories.tsx +0 -25
  12. package/src/Components/ButtonGroup/ButtonGroup.stories.tsx +0 -21
  13. package/src/Components/Card/Card.stories.tsx +0 -44
  14. package/src/Components/ColorButton/ColorButton.stories.tsx +0 -30
  15. package/src/Components/DatePicker/DatePicker.stories.tsx +0 -16
  16. package/src/Components/DatePicker/DatePicker.test.tsx +0 -94
  17. package/src/Components/Dialog/Dialog.stories.tsx +0 -82
  18. package/src/Components/Divider/Divider.stories.tsx +0 -18
  19. package/src/Components/Dot/Dot.stories.tsx +0 -15
  20. package/src/Components/Dropdown/Dropdown.stories.tsx +0 -154
  21. package/src/Components/Dropdown/Dropdown.test.tsx +0 -626
  22. package/src/Components/EmptyState/EmptyState.stories.tsx +0 -18
  23. package/src/Components/Fade/Fade.stories.tsx +0 -5
  24. package/src/Components/Form/Checkbox/Checkbox.stories.tsx +0 -43
  25. package/src/Components/Form/Input/Input.stories.tsx +0 -71
  26. package/src/Components/Form/Radio/Radio.stories.tsx +0 -35
  27. package/src/Components/Form/Textarea/Textarea.stories.tsx +0 -20
  28. package/src/Components/Form/Textarea/Textarea.test.tsx +0 -35
  29. package/src/Components/Icon/Icon.stories.tsx +0 -10
  30. package/src/Components/IconButton/IconButton.stories.tsx +0 -27
  31. package/src/Components/Icons/index.stories.tsx +0 -60
  32. package/src/Components/Image/Image.stories.tsx +0 -15
  33. package/src/Components/LightBox/LightBox.stories.tsx +0 -39
  34. package/src/Components/Link/Link.stories.tsx +0 -28
  35. package/src/Components/List/List.stories.tsx +0 -24
  36. package/src/Components/Menu/Menu.stories.tsx +0 -90
  37. package/src/Components/Notification/Notification.stories.tsx +0 -84
  38. package/src/Components/OverflowMenu/OverflowMenu.stories.tsx +0 -30
  39. package/src/Components/Popover/Popover.stories.tsx +0 -19
  40. package/src/Components/ProgressBar/ProgressBar.stories.tsx +0 -11
  41. package/src/Components/ProgressBitbot/ProgressBitbot.stories.tsx +0 -12
  42. package/src/Components/ProgressSpinner/ProgressSpinner.stories.tsx +0 -12
  43. package/src/Components/Ribbon/Ribbon.stories.tsx +0 -35
  44. package/src/Components/Select/Select.stories.tsx +0 -100
  45. package/src/Components/Select/Select.test.tsx +0 -96
  46. package/src/Components/Skeleton/Skeleton.stories.tsx +0 -18
  47. package/src/Components/Table/Table.stories.tsx +0 -216
  48. package/src/Components/Tabs/Tabs.stories.tsx +0 -65
  49. package/src/Components/Tabs/Tabs.test.tsx +0 -36
  50. package/src/Components/Text/Text.stories.tsx +0 -22
  51. package/src/Components/Toast/Toast.stories.tsx +0 -30
  52. package/src/Components/Toggle/Toggle.stories.tsx +0 -19
  53. package/src/Foundations/Colors/Colors.stories.mdx +0 -9
  54. package/src/Foundations/Radii/Radii.examples.tsx +0 -25
  55. package/src/Foundations/Radii/Radii.stories.mdx +0 -6
  56. package/src/Foundations/Responsive/Responsive.examples.tsx +0 -95
  57. package/src/Foundations/Responsive/Responsive.stories.mdx +0 -6
  58. package/src/Foundations/Shadows/Shadows.examples.tsx +0 -24
  59. package/src/Foundations/Shadows/Shadows.stories.mdx +0 -6
  60. package/src/Foundations/Sizes/Sizes.examples.tsx +0 -25
  61. package/src/Foundations/Sizes/Sizes.stories.mdx +0 -6
  62. package/src/Foundations/Typography/Typography.examples.tsx +0 -63
  63. package/src/Foundations/Typography/Typography.stories.mdx +0 -8
  64. package/src/tsconfig.tsbuildinfo +0 -1
@@ -1,35 +0,0 @@
1
- import { ComponentMeta, ComponentStoryFn } from '@storybook/react';
2
- import { action } from '@storybook/addon-actions';
3
- import Ribbon from './Ribbon';
4
-
5
- export default {
6
- title: 'Components/Ribbon',
7
- component: Ribbon,
8
- argTypes: {
9
- children: { type: 'string' },
10
- action: {
11
- control: 'inline-radio',
12
- options: ['unset', 'link', 'action'],
13
- mapping: {
14
- unset: undefined,
15
- link: { label: 'link', href: '#' },
16
- action: { label: 'action', onClick: action('action') },
17
- },
18
- },
19
- onClose: {
20
- control: 'inline-radio',
21
- options: ['unset', 'action'],
22
- mapping: {
23
- unset: undefined,
24
- action: action('onClose'),
25
- },
26
- },
27
- },
28
- args: {
29
- children: 'text',
30
- colorScheme: 'blue',
31
- action: undefined,
32
- },
33
- } as ComponentMeta<typeof Ribbon>;
34
-
35
- export const Default: ComponentStoryFn<typeof Ribbon> = (args) => <Ribbon {...args} />;
@@ -1,100 +0,0 @@
1
- import { useState } from 'react';
2
- import { ComponentStory, ComponentMeta } from '@storybook/react';
3
- import { useForm } from 'react-hook-form';
4
- import { sortObjectByKey } from '../../utils/storyUtils';
5
- import Select from './Select';
6
-
7
- export default {
8
- title: 'Components/Select',
9
- component: Select,
10
- args: {
11
- isLoading: false,
12
- errorText: 'Error text',
13
- helperText: 'Helpher text',
14
- label: 'Label',
15
- name: 'Name',
16
- },
17
- argTypes: {
18
- onChange: {
19
- action: 'onChange event',
20
- },
21
- },
22
- } as ComponentMeta<typeof Select>;
23
-
24
- const args = {
25
- ...Select.defaultProps,
26
- isDisabled: false,
27
- isInvalid: false,
28
- isRequired: false,
29
- };
30
-
31
- const children = (
32
- <>
33
- <option value="all">All status</option>
34
- <option value="successful">Successful</option>
35
- <option value="failed">Failed</option>
36
- <option value="aborted">Aborted</option>
37
- <option value="on_hold">On hold</option>
38
- </>
39
- );
40
-
41
- const Template: ComponentStory<typeof Select> = (props) => <Select {...props}>{children}</Select>;
42
-
43
- export const WithProps = Template.bind({});
44
- WithProps.args = sortObjectByKey({
45
- ...args,
46
- placeholder: 'Select build status',
47
- });
48
-
49
- export const Controlled = () => {
50
- const [value, setValue] = useState<string | undefined>(undefined);
51
- return (
52
- <Select w="300px" placeholder="Test holder" value={value} onChange={({ target: { value: val } }) => setValue(val)}>
53
- {children}
54
- </Select>
55
- );
56
- };
57
-
58
- export const ControlledWithReactHookForm = () => {
59
- const form = useForm({
60
- defaultValues: {
61
- field: undefined,
62
- },
63
- });
64
-
65
- const props = form.register('field');
66
-
67
- return (
68
- <Select w="300px" placeholder="Test holder" {...props} isRequired>
69
- {children}
70
- </Select>
71
- );
72
- };
73
-
74
- export const WithLoading = () => (
75
- <>
76
- <Select w="300px" isDisabled placeholder="Test holder">
77
- {children}
78
- </Select>
79
- <Select w="300px" isLoading>
80
- {children}
81
- </Select>
82
- </>
83
- );
84
-
85
- export const WithLoadingOnChange = () => {
86
- const [loading, setLoading] = useState(false);
87
-
88
- return (
89
- <Select
90
- w="240px"
91
- isLoading={loading}
92
- onChange={() => {
93
- setLoading(true);
94
- setTimeout(() => setLoading(false), 3000);
95
- }}
96
- >
97
- {children}
98
- </Select>
99
- );
100
- };
@@ -1,96 +0,0 @@
1
- import { render, screen } from '@testing-library/react';
2
- import userEvent from '@testing-library/user-event';
3
- import { useForm } from 'react-hook-form';
4
- import Select from './Select';
5
-
6
- const WithReactHookForm = ({ placeholder }: { placeholder?: string }) => {
7
- const form = useForm({ defaultValues: { rating: undefined } });
8
- const props = form.register('rating');
9
-
10
- return (
11
- <Select placeholder={placeholder} {...props}>
12
- <option value="bad">Bad</option>
13
- <option value="good">Good</option>
14
- </Select>
15
- );
16
- };
17
-
18
- const placeholder = 'What was your impression?';
19
-
20
- describe('Select', () => {
21
- it('renders placeholder option', async () => {
22
- render(
23
- <Select placeholder={placeholder}>
24
- <option value="bad">Bad</option>
25
- <option value="good">Good</option>
26
- </Select>,
27
- );
28
-
29
- const placeholderOption = screen.queryByRole('option', { name: placeholder });
30
- expect(placeholderOption).toBeInTheDocument();
31
- });
32
-
33
- it('renders placeholder option as disabled', async () => {
34
- render(
35
- <Select placeholder={placeholder}>
36
- <option value="bad">Bad</option>
37
- <option value="good">Good</option>
38
- </Select>,
39
- );
40
-
41
- const placeholderOption = screen.queryByRole('option', { name: placeholder });
42
- expect(placeholderOption).toBeDisabled();
43
- });
44
-
45
- it('placeholder option is selected if no value is set', async () => {
46
- render(
47
- <Select placeholder={placeholder}>
48
- <option value="bad">Bad</option>
49
- <option value="good">Good</option>
50
- </Select>,
51
- );
52
-
53
- const select = await screen.findByRole<HTMLInputElement>('combobox');
54
- expect(select).toHaveValue('');
55
- });
56
-
57
- it('updates selected option without placeholder', async () => {
58
- render(<WithReactHookForm />);
59
-
60
- const select = await screen.findByRole<HTMLInputElement>('combobox');
61
- await userEvent.selectOptions(select, 'good');
62
- expect(select).toHaveValue('good');
63
- });
64
-
65
- it('updates selected option with placeholder', async () => {
66
- render(<WithReactHookForm placeholder="What was your impression?" />);
67
-
68
- const select = await screen.findByRole<HTMLInputElement>('combobox');
69
- await userEvent.selectOptions(select, 'good');
70
- expect(select).toHaveValue('good');
71
- });
72
-
73
- it('handles defaultValue correctly without placeholder', async () => {
74
- render(
75
- <Select defaultValue="good">
76
- <option value="bad">Bad</option>
77
- <option value="good">Good</option>
78
- </Select>,
79
- );
80
-
81
- const select = await screen.findByRole<HTMLInputElement>('combobox');
82
- expect(select).toHaveValue('good');
83
- });
84
-
85
- it('handles defaultValue correctly with placeholder', async () => {
86
- render(
87
- <Select placeholder="What was your impression?" defaultValue="good">
88
- <option value="bad">Bad</option>
89
- <option value="good">Good</option>
90
- </Select>,
91
- );
92
-
93
- const select = await screen.findByRole<HTMLInputElement>('combobox');
94
- expect(select).toHaveValue('good');
95
- });
96
- });
@@ -1,18 +0,0 @@
1
- import Skeleton, { SkeletonProps } from './Skeleton';
2
- import SkeletonBox from './SkeletonBox';
3
-
4
- export default {
5
- component: Skeleton,
6
- subComponents: [SkeletonBox],
7
- };
8
-
9
- export const WithProps = {
10
- args: {
11
- isActive: false,
12
- },
13
- render: (args: SkeletonProps) => (
14
- <Skeleton display="flex" flexDirection="column" gap="8" padding="8" {...args}>
15
- <SkeletonBox height="32" /> <SkeletonBox height="32" /> <SkeletonBox height="32" />
16
- </Skeleton>
17
- ),
18
- };
@@ -1,216 +0,0 @@
1
- import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import Box from '../Box/Box';
3
- import Table from './Table';
4
- import TableContainer from './TableContainer';
5
- import Th from './Th';
6
- import Thead from './Thead';
7
- import Tbody from './Tbody';
8
- import Tr from './Tr';
9
- import Td from './Td';
10
- import TableCaption from './TableCaption';
11
-
12
- export default {
13
- title: 'Components/Table',
14
- component: Table,
15
- args: {
16
- isFixed: false,
17
- },
18
- } as ComponentMeta<typeof Table>;
19
-
20
- const Template: ComponentStory<typeof Table> = (props) => (
21
- <TableContainer>
22
- <Table {...props} />
23
- </TableContainer>
24
- );
25
-
26
- export const BasicVersion = Template.bind({});
27
- BasicVersion.args = {
28
- children: (
29
- <>
30
- <TableCaption description="Table decription">Basic Table</TableCaption>
31
- <Thead>
32
- <Tr>
33
- <Th>To convert</Th>
34
- <Th>into</Th>
35
- <Th textAlign="right">multiply by</Th>
36
- </Tr>
37
- </Thead>
38
- <Tbody>
39
- <Tr>
40
- <Td>inches</Td>
41
- <Td>millimetres (mm)</Td>
42
- <Td textAlign="right">25.4</Td>
43
- </Tr>
44
- <Tr>
45
- <Td colSpan={3} textAlign="right" variant="separator">
46
- Separator
47
- </Td>
48
- </Tr>
49
- <Tr>
50
- <Td>feet</Td>
51
- <Td>centimetres (cm)</Td>
52
- <Td textAlign="right">30.48</Td>
53
- </Tr>
54
- <Tr>
55
- <Td>yards</Td>
56
- <Td>metres (m)</Td>
57
- <Td textAlign="right">0.91444</Td>
58
- </Tr>
59
- </Tbody>
60
- </>
61
- ),
62
- };
63
-
64
- export const SortableColumns = Template.bind({});
65
- SortableColumns.args = {
66
- children: (
67
- <>
68
- <TableCaption description="You have to implelement the logic">Sortable columns</TableCaption>
69
- <Thead>
70
- <Tr>
71
- <Th isSortable>isSortable: true</Th>
72
- <Th isSortable sortedBy="ascending">
73
- sortedBy: ascending
74
- </Th>
75
- <Th isSortable sortedBy="descending">
76
- sortedBy: descending
77
- </Th>
78
- <Th>isSortable: false</Th>
79
- </Tr>
80
- </Thead>
81
- <Tbody>
82
- <Tr>
83
- <Td>1</Td>
84
- <Td>foo</Td>
85
- <Td>bar</Td>
86
- <Td>baz</Td>
87
- </Tr>
88
- <Tr>
89
- <Td>2</Td>
90
- <Td>foo</Td>
91
- <Td>bar</Td>
92
- <Td>baz</Td>
93
- </Tr>
94
- </Tbody>
95
- </>
96
- ),
97
- };
98
-
99
- export const ColumnsWithTooltip = Template.bind({});
100
- ColumnsWithTooltip.args = {
101
- children: (
102
- <>
103
- <TableCaption description="You have to implelement the logic">Columns with tooltip</TableCaption>
104
- <Thead>
105
- <Tr>
106
- <Th>Name</Th>
107
- <Th
108
- isSortable
109
- tooltip={{
110
- label:
111
- 'How long successful builds typically take to run. We calculate this using the 50th percentile aggregation.',
112
- }}
113
- >
114
- Typical build time (P50)
115
- </Th>
116
- <Th
117
- isSortable
118
- sortedBy="descending"
119
- tooltip={{
120
- label:
121
- 'How long slowest successful builds take to run. We calculate this using the 90th percentile aggregation.',
122
- }}
123
- >
124
- Typical build time (P90)
125
- </Th>
126
- <Th
127
- isSortable
128
- tooltip={{ label: 'The total amount of time spent running builds of this app during the selected period.' }}
129
- >
130
- Build usage
131
- </Th>
132
- <Th isSortable tooltip={{ label: 'The total number of builds during the selected period.' }}>
133
- Build count
134
- </Th>
135
- <Th isSortable tooltip={{ label: 'The percentage of completed builds that passed.' }}>
136
- Success rate
137
- </Th>
138
- </Tr>
139
- </Thead>
140
- <Tbody>
141
- <Tr>
142
- <Td>bitrise-website</Td>
143
- <Td>3m 36s</Td>
144
- <Td>4m 10s</Td>
145
- <Td>2d 13h 13s</Td>
146
- <Td>21,433</Td>
147
- <Td>54.43%</Td>
148
- </Tr>
149
- </Tbody>
150
- </>
151
- ),
152
- };
153
-
154
- const onRowClick = () => {};
155
-
156
- export const ClickableRows = Template.bind({});
157
- ClickableRows.args = {
158
- children: (
159
- <>
160
- <TableCaption description="You can add onClick to the Tr">
161
- Clickable rows - This is a temporary solution, please use it only when it really necessary
162
- </TableCaption>
163
- <Thead>
164
- <Tr>
165
- <Th>Workflow</Th>
166
- </Tr>
167
- </Thead>
168
- <Tbody>
169
- <Tr onClick={onRowClick}>
170
- <Td>ci-rspec-apps</Td>
171
- </Tr>
172
- <Tr onClick={onRowClick}>
173
- <Td>ci-rspes</Td>
174
- </Tr>
175
- <Tr onClick={onRowClick}>
176
- <Td>ci-be-lint</Td>
177
- </Tr>
178
- </Tbody>
179
- </>
180
- ),
181
- };
182
-
183
- export const ExpandableRows = Template.bind({});
184
- ExpandableRows.args = {
185
- children: (
186
- <>
187
- <TableCaption description="Click on a row">Expandable rows</TableCaption>
188
- <Thead>
189
- <Tr>
190
- <Th />
191
- <Th>ID</Th>
192
- <Th>Status</Th>
193
- <Th>Time</Th>
194
- </Tr>
195
- </Thead>
196
- <Tbody>
197
- <Tr expandableContent={<Box paddingY="12">😎</Box>} defaultIsExpanded>
198
- <Td>f6963af857c8f2fe</Td>
199
- <Td>Success</Td>
200
- <Td>May 29, 2022 10:11:32am</Td>
201
- </Tr>
202
- <Tr expandableContent={<Box paddingY="12">🥳</Box>}>
203
- <Td>f6963af857c8f2fe</Td>
204
- <Td>Aborted</Td>
205
- <Td>May 29, 2022 9:12:50am</Td>
206
- </Tr>
207
- <Tr>
208
- <Td />
209
- <Td>f6963af857c8f2fe</Td>
210
- <Td>Failed</Td>
211
- <Td>May 29, 2022 10:11:32am</Td>
212
- </Tr>
213
- </Tbody>
214
- </>
215
- ),
216
- };
@@ -1,65 +0,0 @@
1
- import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import Tabs from './Tabs';
3
- import TabList from './TabList';
4
- import Tab from './Tab';
5
- import TabPanels from './TabPanels';
6
- import TabPanel from './TabPanel';
7
-
8
- export default {
9
- title: 'Components/Tabs',
10
- component: Tabs,
11
- subcomponents: { Tab },
12
- argTypes: {
13
- onChange: {
14
- action: 'onChange event',
15
- },
16
- },
17
- } as ComponentMeta<typeof Tabs>;
18
-
19
- const badge = {
20
- backgroundColor: 'yellow.80',
21
- children: 'new',
22
- color: 'neutral.10',
23
- };
24
-
25
- export const WithDefaults: ComponentStory<typeof Tabs> = (props) => {
26
- return (
27
- <Tabs defaultTab="selected-as-default" {...props}>
28
- <TabList>
29
- <Tab id="basic">Basic</Tab>
30
- <Tab id="selected-as-default">Selected as default</Tab>
31
- <Tab id="with-left-icon" leftIconName="Bell">
32
- With left icon
33
- </Tab>
34
- <Tab id="with-badge" badge={badge}>
35
- With badge
36
- </Tab>
37
- <Tab id="disabled" isDisabled>
38
- Disabled
39
- </Tab>
40
- <Tab id="with-right-icon" rightIconName="ArrowForward">
41
- With right icon
42
- </Tab>
43
- </TabList>
44
-
45
- <TabPanels>
46
- <TabPanel paddingTop="16">
47
- <p>
48
- You can add any style prop to <code>TabPanel</code>, like padding.
49
- <br />
50
- But doesn't have any default style.
51
- </p>
52
- </TabPanel>
53
- <TabPanel paddingTop="16">You can use defaultIndex for this</TabPanel>
54
- <TabPanel paddingTop="16">You can add icon to tab</TabPanel>
55
- <TabPanel paddingTop="16">Or Badge</TabPanel>
56
- <TabPanel paddingTop="16">This panel is disabled</TabPanel>
57
- <TabPanel paddingTop="16">You can add icon to tab</TabPanel>
58
- </TabPanels>
59
- </Tabs>
60
- );
61
- };
62
-
63
- WithDefaults.args = {
64
- withHistory: true,
65
- };
@@ -1,36 +0,0 @@
1
- import { render, screen } from '@testing-library/react';
2
- import userEvent from '@testing-library/user-event';
3
- import Tabs from './Tabs';
4
- import TabList from './TabList';
5
- import Tab from './Tab';
6
- import TabPanels from './TabPanels';
7
- import TabPanel from './TabPanel';
8
-
9
- describe('Tabs', () => {
10
- it('calls the onChange handler with the proper id if TabList has a conditionally not rendered item', async () => {
11
- const thirdTabId = 'third-tab';
12
- const thirdTabTitle = 'Third tab';
13
-
14
- const handleChange = jest.fn();
15
-
16
- render(
17
- <Tabs onChange={handleChange}>
18
- <TabList>
19
- <Tab id="first-tab">First tab</Tab>
20
- {false && <Tab id="second-tab">Second tab</Tab>}
21
- <Tab id={thirdTabId}>{thirdTabTitle}</Tab>
22
- </TabList>
23
- <TabPanels>
24
- <TabPanel>First content</TabPanel>
25
- {false && <TabPanel>Second content</TabPanel>}
26
- <TabPanel>Third content</TabPanel>
27
- </TabPanels>
28
- </Tabs>,
29
- );
30
-
31
- const thirdTab = await screen.findByText(thirdTabTitle);
32
- await userEvent.click(thirdTab);
33
-
34
- expect(handleChange).toHaveBeenCalledWith(1, thirdTabId);
35
- });
36
- });
@@ -1,22 +0,0 @@
1
- import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import { sortObjectByKey } from '../../utils/storyUtils';
3
- import Text from './Text';
4
-
5
- export default {
6
- title: 'Components/Text',
7
- component: Text,
8
- } as ComponentMeta<typeof Text>;
9
-
10
- const Template: ComponentStory<typeof Text> = (props) => <Text {...props} />;
11
-
12
- export const WithProps = Template.bind({});
13
- WithProps.args = sortObjectByKey({
14
- ...Text.defaultProps,
15
- align: 'left',
16
- className: '',
17
- children: 'The quick brown fox jumps over the lazy dog.',
18
- fontWeight: 'normal',
19
- letterSpacing: 'normal',
20
- size: ['5', '3'],
21
- textTransform: 'none',
22
- });
@@ -1,30 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { Meta } from '@storybook/react';
3
- import NotificationStories from '../Notification/Notification.stories';
4
- import useToast, { ToastOptions } from './Toast';
5
-
6
- export default {
7
- title: 'Components/Toast',
8
- argTypes: {
9
- isClosable: { type: 'boolean', defaultValue: true },
10
- showTimestamp: { type: 'boolean', defaultValue: true },
11
- action: NotificationStories.argTypes?.action,
12
- title: { type: 'string', defaultValue: 'the title' },
13
- description: { type: 'string', defaultValue: 'some description' },
14
- duration: { control: { type: 'range', min: 0, max: 10000, step: 1000 } },
15
- status: {
16
- control: 'inline-radio',
17
- defaultValue: 'success',
18
- options: ['success', 'info', 'error', 'warning', 'progress'],
19
- },
20
- },
21
- } as Meta;
22
-
23
- export const Default = ({ duration, ...props }: ToastOptions) => {
24
- const toast = useToast();
25
- useEffect(() => {
26
- toast({ duration: duration || null, ...props });
27
- }, [duration, props]);
28
-
29
- return <div />;
30
- };
@@ -1,19 +0,0 @@
1
- import { ComponentMeta } from '@storybook/react';
2
- import Toggle from './Toggle';
3
-
4
- export default {
5
- title: 'Components/Toggle',
6
- component: Toggle,
7
- } as ComponentMeta<typeof Toggle>;
8
-
9
- export const WithProps = {
10
- args: {
11
- defaultChecked: false,
12
- errorText: '',
13
- helperText:
14
- 'Inline help. Maecenas a turpis tortor. Nunc vitae libero tempor, ullamcorper purus quis, mattis tellus.',
15
- isDisabled: false,
16
- isLoading: false,
17
- label: 'Toggle the toggle',
18
- },
19
- };
@@ -1,9 +0,0 @@
1
- import { Meta } from '@storybook/addon-docs';
2
- import DesignTokens from './DesignTokens';
3
- import Palette from './Palette';
4
-
5
- <Meta title="Foundations/Colors" />
6
-
7
- <DesignTokens />
8
-
9
- <Palette />
@@ -1,25 +0,0 @@
1
- import { HStack, VStack } from '@chakra-ui/react';
2
- import Box from '../../Components/Box/Box';
3
- import Card from '../../Components/Card/Card';
4
- import CardContent from '../../Components/Card/CardContent';
5
- import Provider from '../../Components/Provider/Provider';
6
- import Text from '../../Components/Text/Text';
7
- import radii from './Radii';
8
-
9
- export const Radii = () => (
10
- <Provider>
11
- <Text as="h2" size="8">
12
- Radii (round corners)
13
- </Text>
14
- <Card boxShadow="medium" marginTop="24">
15
- <HStack as={CardContent} padding="24" spacing="24">
16
- {Object.keys(radii).map((size) => (
17
- <VStack key={size}>
18
- <Box border="0.1875rem solid" borderColor="brand.primary" borderRadius={size} height="64" width="64" />
19
- <Text>{size}</Text>
20
- </VStack>
21
- ))}
22
- </HStack>
23
- </Card>
24
- </Provider>
25
- );
@@ -1,6 +0,0 @@
1
- import { Meta } from '@storybook/addon-docs';
2
- import { Radii } from './Radii.examples';
3
-
4
- <Meta title="Foundations/Radii (round corners)" />
5
-
6
- <Radii />