reshaped 3.3.11 → 3.3.13
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.
- package/CHANGELOG.md +12 -0
- package/dist/bundle.css +1 -1
- package/dist/bundle.d.ts +1 -1
- package/dist/bundle.js +16 -17
- package/dist/cjs/themes/_generator/utilities/generateColors.d.ts +1 -1
- package/dist/cjs/themes/_generator/utilities/generateColors.js +3 -2
- package/dist/cjs/themes/_generator/utilities/tests/color.test.js +32 -31
- package/dist/cjs/themes/slate/theme.css +1 -1
- package/dist/components/Accordion/tests/Accordion.stories.d.ts +30 -8
- package/dist/components/Accordion/tests/Accordion.stories.js +172 -119
- package/dist/components/ActionBar/tests/ActionBar.stories.d.ts +12 -3
- package/dist/components/ActionBar/tests/ActionBar.stories.js +51 -36
- package/dist/components/ActionBar/tests/ActionBar.test.stories.d.ts +15 -0
- package/dist/components/ActionBar/tests/ActionBar.test.stories.js +26 -0
- package/dist/components/Actionable/Actionable.js +1 -1
- package/dist/components/Actionable/tests/Actionable.stories.d.ts +19 -5
- package/dist/components/Actionable/tests/Actionable.stories.js +88 -63
- package/dist/components/Actionable/tests/Actionable.test.stories.d.ts +32 -0
- package/dist/components/Actionable/tests/Actionable.test.stories.js +130 -0
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/Alert/tests/Alert.stories.d.ts +12 -3
- package/dist/components/Alert/tests/Alert.stories.js +51 -86
- package/dist/components/Alert/tests/Alert.test.stories.d.ts +15 -0
- package/dist/components/Alert/tests/Alert.test.stories.js +26 -0
- package/dist/components/Autocomplete/Autocomplete.js +9 -2
- package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +6 -2
- package/dist/components/Autocomplete/tests/Autocomplete.stories.js +94 -111
- package/dist/components/Autocomplete/tests/Autocomplete.test.stories.d.ts +23 -0
- package/dist/components/Autocomplete/tests/Autocomplete.test.stories.js +86 -0
- package/dist/components/Avatar/Avatar.js +1 -1
- package/dist/components/Avatar/tests/Avatar.stories.d.ts +14 -4
- package/dist/components/Avatar/tests/Avatar.stories.js +94 -80
- package/dist/components/Avatar/tests/Avatar.test.stories.d.ts +17 -0
- package/dist/components/Avatar/tests/Avatar.test.stories.js +39 -0
- package/dist/components/Badge/tests/Badge.stories.d.ts +33 -8
- package/dist/components/Badge/tests/Badge.stories.js +238 -212
- package/dist/components/Badge/tests/Badge.test.stories.d.ts +20 -0
- package/dist/components/Badge/tests/Badge.test.stories.js +44 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +1 -0
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.d.ts +24 -5
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.js +114 -95
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.test.stories.d.ts +23 -0
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.test.stories.js +76 -0
- package/dist/components/Button/Button.js +5 -2
- package/dist/components/Button/Button.module.css +1 -1
- package/dist/components/Button/Button.types.d.ts +1 -0
- package/dist/components/Button/tests/Button.stories.d.ts +2 -2
- package/dist/components/Button/tests/Button.stories.js +77 -74
- package/dist/components/Button/tests/Button.test.stories.d.ts +27 -0
- package/dist/components/Button/tests/Button.test.stories.js +112 -0
- package/dist/components/Calendar/tests/Calendar.test.stories.d.ts +26 -0
- package/dist/components/Calendar/tests/Calendar.test.stories.js +161 -0
- package/dist/components/Card/tests/Card.stories.d.ts +0 -1
- package/dist/components/Card/tests/Card.stories.js +0 -11
- package/dist/components/Card/tests/Card.test.stories.d.ts +35 -0
- package/dist/components/Card/tests/Card.test.stories.js +54 -0
- package/dist/components/Carousel/Carousel.js +52 -4
- package/dist/components/Carousel/Carousel.types.d.ts +4 -0
- package/dist/components/Carousel/CarouselControl.js +1 -1
- package/dist/components/Carousel/tests/Carousel.stories.d.ts +23 -4
- package/dist/components/Carousel/tests/Carousel.stories.js +199 -102
- package/dist/components/Checkbox/tests/Checkbox.test.stories.d.ts +25 -0
- package/dist/components/Checkbox/tests/Checkbox.test.stories.js +104 -0
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.d.ts +22 -0
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.js +78 -0
- package/dist/components/Container/tests/Container.stories.d.ts +12 -3
- package/dist/components/Container/tests/Container.stories.js +50 -31
- package/dist/components/Container/tests/Container.test.stories.d.ts +15 -0
- package/dist/components/Container/tests/Container.test.stories.js +26 -0
- package/dist/components/ContextMenu/ContextMenu.js +13 -9
- package/dist/components/ContextMenu/tests/ContextMenu.stories.js +2 -3
- package/dist/components/ContextMenu/tests/ContextMenu.test.stories.d.ts +26 -0
- package/dist/components/ContextMenu/tests/ContextMenu.test.stories.js +53 -0
- package/dist/components/Dismissible/Dismissible.js +1 -1
- package/dist/components/Dismissible/tests/Dismissible.stories.d.ts +10 -3
- package/dist/components/Dismissible/tests/Dismissible.stories.js +51 -34
- package/dist/components/Dismissible/tests/Dismissible.test.stories.d.ts +19 -0
- package/dist/components/Dismissible/tests/Dismissible.test.stories.js +42 -0
- package/dist/components/Divider/tests/Divider.test.stories.d.ts +18 -0
- package/dist/components/Divider/tests/Divider.test.stories.js +47 -0
- package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.d.ts +37 -0
- package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.js +117 -0
- package/dist/components/FileUpload/tests/FileUpload.test.stories.d.ts +22 -0
- package/dist/components/FileUpload/tests/FileUpload.test.stories.js +52 -0
- package/dist/components/FormControl/FormControlCaption.js +1 -1
- package/dist/components/FormControl/FormControlLabel.js +1 -1
- package/dist/components/FormControl/tests/FormControl.stories.d.ts +11 -5
- package/dist/components/FormControl/tests/FormControl.stories.js +78 -73
- package/dist/components/FormControl/tests/FormControl.test.stories.d.ts +20 -0
- package/dist/components/FormControl/tests/FormControl.test.stories.js +49 -0
- package/dist/components/Grid/tests/Grid.stories.d.ts +20 -5
- package/dist/components/Grid/tests/Grid.stories.js +164 -149
- package/dist/components/Grid/tests/Grid.test.stories.d.ts +19 -0
- package/dist/components/Grid/tests/Grid.test.stories.js +42 -0
- package/dist/components/Hidden/tests/Hidden.stories.d.ts +4 -1
- package/dist/components/Hidden/tests/Hidden.stories.js +28 -25
- package/dist/components/Hidden/tests/Hidden.test.stories.d.ts +15 -0
- package/dist/components/Hidden/tests/Hidden.test.stories.js +20 -0
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +4 -1
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.js +8 -5
- package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.d.ts +15 -0
- package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.js +20 -0
- package/dist/components/Hotkey/tests/Hotkey.test.stories.d.ts +15 -0
- package/dist/components/Hotkey/tests/Hotkey.test.stories.js +26 -0
- package/dist/components/Icon/tests/Icon.stories.d.ts +12 -3
- package/dist/components/Icon/tests/Icon.stories.js +69 -60
- package/dist/components/Icon/tests/Icon.test.stories.d.ts +16 -0
- package/dist/components/Icon/tests/Icon.test.stories.js +35 -0
- package/dist/components/Image/tests/Image.stories.d.ts +24 -5
- package/dist/components/Image/tests/Image.stories.js +95 -75
- package/dist/components/Image/tests/Image.test.stories.d.ts +25 -0
- package/dist/components/Image/tests/Image.test.stories.js +80 -0
- package/dist/components/Link/tests/Link.test.stories.d.ts +29 -0
- package/dist/components/Link/tests/Link.test.stories.js +87 -0
- package/dist/components/Loader/Loader.js +1 -1
- package/dist/components/Loader/Loader.types.d.ts +1 -0
- package/dist/components/Loader/tests/Loader.stories.js +8 -8
- package/dist/components/Loader/tests/Loader.test.stories.d.ts +16 -0
- package/dist/components/Loader/tests/Loader.test.stories.js +32 -0
- package/dist/components/MenuItem/tests/MenuItem.test.stories.d.ts +26 -0
- package/dist/components/MenuItem/tests/MenuItem.test.stories.js +100 -0
- package/dist/components/Modal/tests/Modal.test.stories.d.ts +32 -0
- package/dist/components/Modal/tests/Modal.test.stories.js +149 -0
- package/dist/components/Overlay/tests/Overlay.stories.d.ts +4 -2
- package/dist/components/Overlay/tests/Overlay.stories.js +53 -53
- package/dist/components/Overlay/tests/Overlay.test.stories.d.ts +28 -0
- package/dist/components/Overlay/tests/Overlay.test.stories.js +146 -0
- package/dist/components/Pagination/tests/Pagination.test.stories.d.ts +23 -0
- package/dist/components/Pagination/tests/Pagination.test.stories.js +86 -0
- package/dist/components/PinField/tests/PinField.stories.d.ts +0 -1
- package/dist/components/PinField/tests/PinField.stories.js +10 -19
- package/dist/components/PinField/tests/PinField.test.stories.d.ts +29 -0
- package/dist/components/PinField/tests/PinField.test.stories.js +177 -0
- package/dist/components/Popover/tests/Popover.test.stories.d.ts +40 -0
- package/dist/components/Popover/tests/Popover.test.stories.js +167 -0
- package/dist/components/Progress/Progress.js +2 -2
- package/dist/components/Progress/Progress.types.d.ts +1 -0
- package/dist/components/Progress/tests/Progress.stories.js +10 -10
- package/dist/components/Progress/tests/Progress.test.stories.d.ts +16 -0
- package/dist/components/Progress/tests/Progress.test.stories.js +35 -0
- package/dist/components/Radio/tests/Radio.test.stories.d.ts +30 -0
- package/dist/components/Radio/tests/Radio.test.stories.js +118 -0
- package/dist/components/RadioGroup/tests/RadioGroup.test.stories.d.ts +22 -0
- package/dist/components/RadioGroup/tests/RadioGroup.test.stories.js +78 -0
- package/dist/components/Reshaped/tests/Reshaped.stories.d.ts +33 -0
- package/dist/components/Reshaped/tests/Reshaped.stories.js +88 -0
- package/dist/components/Resizable/Resizable.js +1 -0
- package/dist/components/Resizable/tests/Resizable.stories.d.ts +3 -0
- package/dist/components/Resizable/tests/Resizable.stories.js +4 -0
- package/dist/components/Resizable/tests/Resizable.test.stories.d.ts +19 -0
- package/dist/components/Resizable/tests/Resizable.test.stories.js +25 -0
- package/dist/components/Scrim/tests/Scrim.test.stories.d.ts +15 -0
- package/dist/components/Scrim/tests/Scrim.test.stories.js +25 -0
- package/dist/components/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/ScrollArea/ScrollArea.module.css +1 -1
- package/dist/components/ScrollArea/tests/ScrollArea.stories.d.ts +17 -4
- package/dist/components/ScrollArea/tests/ScrollArea.stories.js +114 -139
- package/dist/components/ScrollArea/tests/ScrollArea.test.stories.d.ts +23 -0
- package/dist/components/ScrollArea/tests/ScrollArea.test.stories.js +66 -0
- package/dist/components/Select/tests/Select.stories.d.ts +1 -1
- package/dist/components/Select/tests/Select.stories.js +5 -12
- package/dist/components/Select/tests/Select.test.stories.d.ts +27 -0
- package/dist/components/Select/tests/Select.test.stories.js +132 -0
- package/dist/components/Skeleton/tests/Skeleton.test.stories.d.ts +15 -0
- package/dist/components/Skeleton/tests/Skeleton.test.stories.js +23 -0
- package/dist/components/Slider/tests/Slider.stories.d.ts +0 -1
- package/dist/components/Slider/tests/Slider.stories.js +8 -9
- package/dist/components/Slider/tests/Slider.test.stories.d.ts +38 -0
- package/dist/components/Slider/tests/Slider.test.stories.js +150 -0
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/tests/Stepper.stories.js +0 -3
- package/dist/components/Stepper/tests/Stepper.test.stories.d.ts +18 -0
- package/dist/components/Stepper/tests/Stepper.test.stories.js +28 -0
- package/dist/components/Switch/tests/Switch.test.stories.d.ts +23 -0
- package/dist/components/Switch/tests/Switch.test.stories.js +79 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/tests/Table.stories.d.ts +5 -5
- package/dist/components/Table/tests/Table.test.stories.d.ts +25 -0
- package/dist/components/Table/tests/Table.test.stories.js +93 -0
- package/dist/components/Tabs/tests/Tabs.stories.js +4 -4
- package/dist/components/Tabs/tests/Tabs.test.stories.d.ts +28 -0
- package/dist/components/Tabs/tests/Tabs.test.stories.js +128 -0
- package/dist/components/Text/tests/Text.stories.d.ts +28 -7
- package/dist/components/Text/tests/Text.stories.js +148 -125
- package/dist/components/Text/tests/Text.test.stories.d.ts +18 -0
- package/dist/components/Text/tests/Text.test.stories.js +49 -0
- package/dist/components/TextArea/TextArea.module.css +1 -1
- package/dist/components/TextArea/tests/TextArea.stories.js +1 -1
- package/dist/components/TextArea/tests/TextArea.test.stories.d.ts +29 -0
- package/dist/components/TextArea/tests/TextArea.test.stories.js +99 -0
- package/dist/components/TextField/tests/TextField.stories.js +1 -1
- package/dist/components/TextField/tests/TextField.test.stories.d.ts +29 -0
- package/dist/components/TextField/tests/TextField.test.stories.js +99 -0
- package/dist/components/Theme/tests/Theme.test.stories.d.ts +24 -0
- package/dist/components/Theme/tests/Theme.test.stories.js +133 -0
- package/dist/components/Timeline/tests/Timeline.test.stories.d.ts +18 -0
- package/dist/components/Timeline/tests/Timeline.test.stories.js +32 -0
- package/dist/components/Toast/tests/Toast.test.stories.d.ts +16 -0
- package/dist/components/Toast/tests/Toast.test.stories.js +101 -0
- package/dist/components/Tooltip/tests/Tooltip.stories.js +0 -14
- package/dist/components/Tooltip/tests/Tooltip.test.stories.d.ts +19 -0
- package/dist/components/Tooltip/tests/Tooltip.test.stories.js +40 -0
- package/dist/components/View/View.js +1 -2
- package/dist/components/View/tests/View.stories.d.ts +112 -28
- package/dist/components/View/tests/View.stories.js +1092 -1012
- package/dist/components/View/tests/View.test.stories.d.ts +20 -0
- package/dist/components/View/tests/View.test.stories.js +50 -0
- package/dist/components/_private/Flyout/FlyoutContent.js +1 -1
- package/dist/components/_private/Flyout/tests/Flyout.stories.js +4 -4
- package/dist/components/_private/Flyout/tests/Flyout.test.stories.d.ts +28 -0
- package/dist/components/_private/Flyout/tests/Flyout.test.stories.js +205 -0
- package/dist/components/_private/Portal/tests/Portal.stories.js +1 -1
- package/dist/hooks/_private/useSingletonHotkeys.d.ts +3 -3
- package/dist/hooks/_private/useSingletonHotkeys.js +1 -1
- package/dist/hooks/tests/useDrag.stories.js +1 -0
- package/dist/hooks/tests/useDrag.test.stories.d.ts +26 -0
- package/dist/hooks/tests/useDrag.test.stories.js +120 -0
- package/dist/hooks/tests/useElementId.stories.d.ts +6 -0
- package/dist/hooks/tests/useElementId.stories.js +19 -0
- package/dist/hooks/tests/useHotkeys.test.stories.d.ts +39 -0
- package/dist/hooks/tests/useHotkeys.test.stories.js +119 -0
- package/dist/hooks/tests/useRTL.stories.d.ts +6 -0
- package/dist/hooks/tests/useRTL.stories.js +25 -0
- package/dist/hooks/tests/useResponsiveClientValue.stories.d.ts +9 -1
- package/dist/hooks/tests/useResponsiveClientValue.stories.js +22 -9
- package/dist/hooks/tests/useScrollLock.stories.d.ts +6 -0
- package/dist/hooks/tests/useScrollLock.stories.js +22 -0
- package/dist/hooks/tests/useToggle.stories.d.ts +8 -0
- package/dist/hooks/tests/useToggle.stories.js +54 -0
- package/dist/hooks/useHotkeys.js +0 -2
- package/dist/hooks/useScrollLock.d.ts +1 -0
- package/dist/hooks/useScrollLock.js +7 -3
- package/dist/index.d.ts +1 -1
- package/dist/tests/ShadowDOM.stories.js +1 -1
- package/dist/themes/_generator/tests/themes.stories.d.ts +3 -0
- package/dist/themes/_generator/tests/themes.stories.js +7 -11
- package/dist/themes/_generator/utilities/generateColors.d.ts +1 -1
- package/dist/themes/_generator/utilities/generateColors.js +3 -2
- package/dist/themes/slate/theme.css +1 -1
- package/dist/utilities/helpers.d.ts +1 -0
- package/dist/utilities/helpers.js +3 -0
- package/dist/utilities/scroll/lock.d.ts +1 -0
- package/dist/utilities/scroll/lock.js +3 -3
- package/dist/utilities/scroll/lockSafari.d.ts +1 -1
- package/dist/utilities/scroll/lockSafari.js +4 -5
- package/dist/utilities/scroll/lockStandard.d.ts +4 -1
- package/dist/utilities/scroll/lockStandard.js +7 -2
- package/dist/utilities/storybook/Example.js +1 -2
- package/package.json +42 -41
- package/dist/components/Theme/tests/Theme.stories.d.ts +0 -13
- package/dist/components/Theme/tests/Theme.stories.js +0 -80
- package/dist/utilities/storybook/Example.module.css +0 -1
@@ -10,161 +10,176 @@ export default {
|
|
10
10
|
},
|
11
11
|
},
|
12
12
|
};
|
13
|
-
export const base =
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<View backgroundColor="neutral-faded" borderRadius="medium" padding={8}>
|
27
|
-
2
|
28
|
-
</View>
|
29
|
-
</Grid>
|
30
|
-
</Example.Item>
|
31
|
-
<Example.Item title="justify: center">
|
32
|
-
<Grid gap={2} columns="200px 200px" justify="center">
|
33
|
-
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
|
34
|
-
1
|
35
|
-
</View>
|
36
|
-
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
|
37
|
-
2
|
38
|
-
</View>
|
39
|
-
</Grid>
|
40
|
-
</Example.Item>
|
41
|
-
</Example>);
|
42
|
-
export const layout = () => (<Example>
|
43
|
-
<Example.Item title="simple: 2 rows, 3 columns">
|
44
|
-
<Grid gap={4} columns={3} rows={2}>
|
45
|
-
{[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
46
|
-
{i}
|
47
|
-
</View>))}
|
48
|
-
</Grid>
|
49
|
-
</Example.Item>
|
50
|
-
<Example.Item title="columns template, 1fr 2fr 1fr">
|
51
|
-
<Grid gap={4} columns="1fr 2fr 1fr" rows={2}>
|
52
|
-
{[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
53
|
-
{i}
|
54
|
-
</View>))}
|
55
|
-
</Grid>
|
56
|
-
</Example.Item>
|
57
|
-
<Example.Item title="rows template, 1fr 2fr">
|
58
|
-
<Grid gap={4} columns={3} rows="1fr 2fr">
|
59
|
-
{[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
60
|
-
{i}
|
61
|
-
</View>))}
|
62
|
-
</Grid>
|
63
|
-
</Example.Item>
|
64
|
-
<Example.Item title="responsive">
|
65
|
-
<Grid gap={4} columns={{ s: 3, m: "1fr 2fr 1fr" }} rows={{ s: 2, m: "1fr 2fr" }}>
|
66
|
-
{[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
67
|
-
{i}
|
68
|
-
</View>))}
|
69
|
-
</Grid>
|
70
|
-
</Example.Item>
|
71
|
-
</Example>);
|
72
|
-
export const itemLayout = () => (<Example>
|
73
|
-
<Example.Item title="column, start 1, end 3">
|
74
|
-
<Grid gap={4} columns={3} rows={2}>
|
75
|
-
<Grid.Item colStart={1} colEnd={3}>
|
76
|
-
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
13
|
+
export const base = {
|
14
|
+
name: "gap, align, justify",
|
15
|
+
render: () => (<Example>
|
16
|
+
<Example.Item title="gap: 2">
|
17
|
+
<Grid gap={2} columns={2}>
|
18
|
+
{[1, 2].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
19
|
+
{i}
|
20
|
+
</View>))}
|
21
|
+
</Grid>
|
22
|
+
</Example.Item>
|
23
|
+
<Example.Item title="align: center">
|
24
|
+
<Grid gap={2} columns={2} align="center">
|
25
|
+
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
|
77
26
|
1
|
78
27
|
</View>
|
79
|
-
|
80
|
-
|
81
|
-
{i}
|
82
|
-
</View>))}
|
83
|
-
</Grid>
|
84
|
-
</Example.Item>
|
85
|
-
<Example.Item title="column, start 1, span 2">
|
86
|
-
<Grid gap={4} columns={3} rows={2}>
|
87
|
-
<Grid.Item colStart={1} colSpan={2}>
|
88
|
-
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
89
|
-
1
|
28
|
+
<View backgroundColor="neutral-faded" borderRadius="medium" padding={8}>
|
29
|
+
2
|
90
30
|
</View>
|
91
|
-
</Grid
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
</Example.Item>
|
97
|
-
|
98
|
-
<Example.Item title="row, start 1, end 3">
|
99
|
-
<Grid gap={4} columns={3} rows={2}>
|
100
|
-
<Grid.Item rowStart={1} rowEnd={3}>
|
101
|
-
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
31
|
+
</Grid>
|
32
|
+
</Example.Item>
|
33
|
+
<Example.Item title="justify: center">
|
34
|
+
<Grid gap={2} columns="200px 200px" justify="center">
|
35
|
+
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
|
102
36
|
1
|
103
37
|
</View>
|
104
|
-
|
105
|
-
|
106
|
-
{i}
|
107
|
-
</View>))}
|
108
|
-
</Grid>
|
109
|
-
</Example.Item>
|
110
|
-
|
111
|
-
<Example.Item title="row, start 1, span 2">
|
112
|
-
<Grid gap={4} columns={3} rows={2}>
|
113
|
-
<Grid.Item rowStart={1} rowSpan={2}>
|
114
|
-
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
115
|
-
1
|
38
|
+
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
|
39
|
+
2
|
116
40
|
</View>
|
117
|
-
</Grid
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
41
|
+
</Grid>
|
42
|
+
</Example.Item>
|
43
|
+
</Example>),
|
44
|
+
};
|
45
|
+
export const layout = {
|
46
|
+
name: "rows, columns",
|
47
|
+
render: () => (<Example>
|
48
|
+
<Example.Item title="simple: 2 rows, 3 columns">
|
49
|
+
<Grid gap={4} columns={3} rows={2}>
|
50
|
+
{[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
51
|
+
{i}
|
52
|
+
</View>))}
|
53
|
+
</Grid>
|
54
|
+
</Example.Item>
|
55
|
+
<Example.Item title="columns template, 1fr 2fr 1fr">
|
56
|
+
<Grid gap={4} columns="1fr 2fr 1fr" rows={2}>
|
57
|
+
{[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
58
|
+
{i}
|
59
|
+
</View>))}
|
60
|
+
</Grid>
|
61
|
+
</Example.Item>
|
62
|
+
<Example.Item title="rows template, 1fr 2fr">
|
63
|
+
<Grid gap={4} columns={3} rows="1fr 2fr">
|
64
|
+
{[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
65
|
+
{i}
|
66
|
+
</View>))}
|
67
|
+
</Grid>
|
68
|
+
</Example.Item>
|
69
|
+
<Example.Item title="responsive">
|
70
|
+
<Grid gap={4} columns={{ s: 3, m: "1fr 2fr 1fr" }} rows={{ s: 2, m: "1fr 2fr" }}>
|
71
|
+
{[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
72
|
+
{i}
|
73
|
+
</View>))}
|
74
|
+
</Grid>
|
75
|
+
</Example.Item>
|
76
|
+
</Example>),
|
77
|
+
};
|
78
|
+
export const itemLayout = {
|
79
|
+
name: "colStart, colEnd, rowStart, rowEnd",
|
80
|
+
render: () => (<Example>
|
81
|
+
<Example.Item title="column, start 1, end 3">
|
82
|
+
<Grid gap={4} columns={3} rows={2}>
|
83
|
+
<Grid.Item colStart={1} colEnd={3}>
|
84
|
+
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
85
|
+
1
|
86
|
+
</View>
|
87
|
+
</Grid.Item>
|
88
|
+
{[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
89
|
+
{i}
|
90
|
+
</View>))}
|
91
|
+
</Grid>
|
92
|
+
</Example.Item>
|
93
|
+
<Example.Item title="column, start 1, span 2">
|
94
|
+
<Grid gap={4} columns={3} rows={2}>
|
95
|
+
<Grid.Item colStart={1} colSpan={2}>
|
96
|
+
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
97
|
+
1
|
98
|
+
</View>
|
99
|
+
</Grid.Item>
|
100
|
+
{[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
101
|
+
{i}
|
102
|
+
</View>))}
|
103
|
+
</Grid>
|
104
|
+
</Example.Item>
|
123
105
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
106
|
+
<Example.Item title="row, start 1, end 3">
|
107
|
+
<Grid gap={4} columns={3} rows={2}>
|
108
|
+
<Grid.Item rowStart={1} rowEnd={3}>
|
109
|
+
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
110
|
+
1
|
111
|
+
</View>
|
112
|
+
</Grid.Item>
|
113
|
+
{[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
114
|
+
{i}
|
115
|
+
</View>))}
|
116
|
+
</Grid>
|
117
|
+
</Example.Item>
|
118
|
+
|
119
|
+
<Example.Item title="row, start 1, span 2">
|
120
|
+
<Grid gap={4} columns={3} rows={2}>
|
121
|
+
<Grid.Item rowStart={1} rowSpan={2}>
|
122
|
+
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
123
|
+
1
|
124
|
+
</View>
|
125
|
+
</Grid.Item>
|
126
|
+
{[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
127
|
+
{i}
|
128
|
+
</View>))}
|
129
|
+
</Grid>
|
130
|
+
</Example.Item>
|
131
|
+
|
132
|
+
<Example.Item title="responsive">
|
133
|
+
<Grid gap={4} columns={3} rows={2}>
|
134
|
+
<Grid.Item rowStart={1} rowSpan={{ s: 1, m: 2 }} colStart={1} colSpan={{ s: 1, m: 2 }}>
|
141
135
|
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
142
|
-
|
136
|
+
1
|
143
137
|
</View>
|
144
|
-
</Grid.Item>
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
138
|
+
</Grid.Item>
|
139
|
+
{[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
140
|
+
{i}
|
141
|
+
</View>))}
|
142
|
+
</Grid>
|
143
|
+
</Example.Item>
|
144
|
+
</Example>),
|
145
|
+
};
|
146
|
+
export const areas = {
|
147
|
+
name: "areas",
|
148
|
+
render: () => (<Example>
|
149
|
+
<Example.Item title="simple: 2 rows, 3 columns">
|
150
|
+
<Grid gap={4} rows={2} areas={["a .", "a b"]}>
|
151
|
+
{["a", "b"].map((area) => (<Grid.Item area={area} key={area}>
|
152
|
+
<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
|
153
|
+
{area}
|
154
|
+
</View>
|
155
|
+
</Grid.Item>))}
|
156
|
+
</Grid>
|
157
|
+
</Example.Item>
|
158
|
+
</Example>),
|
159
|
+
};
|
160
|
+
export const auto = {
|
161
|
+
name: "autoFlow, autoColumns, autoRows",
|
162
|
+
render: () => (<Example>
|
163
|
+
<Example.Item title="auto flow: column">
|
164
|
+
<Grid gap={4} autoFlow="column" rows={2} columns={2}>
|
165
|
+
{[1, 2, 3].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
166
|
+
{i}
|
167
|
+
</View>))}
|
168
|
+
</Grid>
|
169
|
+
</Example.Item>
|
170
|
+
<Example.Item title="auto rows">
|
171
|
+
<Grid gap={4} autoRows="100px" columns={2}>
|
172
|
+
{[1, 2, 3].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
173
|
+
{i}
|
174
|
+
</View>))}
|
175
|
+
</Grid>
|
176
|
+
</Example.Item>
|
177
|
+
<Example.Item title="auto columns">
|
178
|
+
<Grid gap={4} autoColumns="100px" autoFlow="column">
|
179
|
+
{[1, 2, 3].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
|
180
|
+
{i}
|
181
|
+
</View>))}
|
182
|
+
</Grid>
|
183
|
+
</Example.Item>
|
184
|
+
</Example>),
|
185
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
component: {
|
5
|
+
<As extends keyof React.JSX.IntrinsicElements = "div">(props: import("./..").GridProps<As>): import("react").JSX.Element;
|
6
|
+
Item: <As extends keyof React.JSX.IntrinsicElements = "div">(props: import("./..").GridItemProps<As>) => import("react").JSX.Element;
|
7
|
+
};
|
8
|
+
parameters: {
|
9
|
+
iframe: {
|
10
|
+
url: string;
|
11
|
+
};
|
12
|
+
chromatic: {
|
13
|
+
disableSnapshot: boolean;
|
14
|
+
};
|
15
|
+
};
|
16
|
+
};
|
17
|
+
export default _default;
|
18
|
+
export declare const as: StoryObj;
|
19
|
+
export declare const className: StoryObj;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { expect } from "@storybook/test";
|
2
|
+
import Grid from "../index.js";
|
3
|
+
export default {
|
4
|
+
title: "Utilities/Grid/tests",
|
5
|
+
component: Grid,
|
6
|
+
parameters: {
|
7
|
+
iframe: {
|
8
|
+
url: "https://reshaped.so/docs/utilities/grid",
|
9
|
+
},
|
10
|
+
chromatic: { disableSnapshot: true },
|
11
|
+
},
|
12
|
+
};
|
13
|
+
export const as = {
|
14
|
+
name: "as",
|
15
|
+
render: () => (<Grid as="ul">
|
16
|
+
<Grid.Item as="li">Content</Grid.Item>
|
17
|
+
</Grid>),
|
18
|
+
play: ({ canvas }) => {
|
19
|
+
const ul = canvas.getByRole("list");
|
20
|
+
const li = canvas.getByRole("listitem");
|
21
|
+
expect(ul).toBeInTheDocument();
|
22
|
+
expect(li).toBeInTheDocument();
|
23
|
+
},
|
24
|
+
};
|
25
|
+
export const className = {
|
26
|
+
name: "className, attributes",
|
27
|
+
render: () => (<div data-testid="root">
|
28
|
+
<Grid className="test-class" attributes={{ id: "test-id" }}>
|
29
|
+
<Grid.Item className="test-item-class" attributes={{ id: "test-item-id" }}>
|
30
|
+
Content
|
31
|
+
</Grid.Item>
|
32
|
+
</Grid>
|
33
|
+
</div>),
|
34
|
+
play: async ({ canvas }) => {
|
35
|
+
const root = canvas.getByTestId("root").firstChild;
|
36
|
+
const item = root?.firstChild;
|
37
|
+
expect(root).toHaveAttribute("id", "test-id");
|
38
|
+
expect(root).toHaveClass("test-class");
|
39
|
+
expect(item).toHaveAttribute("id", "test-item-id");
|
40
|
+
expect(item).toHaveClass("test-item-class");
|
41
|
+
},
|
42
|
+
};
|
@@ -9,28 +9,31 @@ export default {
|
|
9
9
|
},
|
10
10
|
},
|
11
11
|
};
|
12
|
-
export const visibility =
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
12
|
+
export const visibility = {
|
13
|
+
name: "visibility",
|
14
|
+
render: () => (<Example>
|
15
|
+
<Example.Item title="hide: always">
|
16
|
+
<Hidden hide={true}>Content</Hidden>
|
17
|
+
</Example.Item>
|
18
|
+
<Example.Item title="shown on s">
|
19
|
+
<Hidden hide={{ s: false, m: true }}>Content</Hidden>
|
20
|
+
</Example.Item>
|
21
|
+
<Example.Item title="shown on l/xl">
|
22
|
+
<Hidden hide={{ s: true, l: false }}>Content</Hidden>
|
23
|
+
</Example.Item>
|
24
|
+
<Example.Item title="shown on m/l/xl">
|
25
|
+
<Hidden hide={{ s: true, m: false }}>Content</Hidden>
|
26
|
+
</Example.Item>
|
27
|
+
<Example.Item title="shown on m">
|
28
|
+
<Hidden hide={{ s: true, m: false, l: true }}>Content</Hidden>
|
29
|
+
</Example.Item>
|
30
|
+
<Example.Item title="shown on s/xl">
|
31
|
+
<Hidden hide={{ s: false, m: true, xl: false }}>Content</Hidden>
|
32
|
+
</Example.Item>
|
33
|
+
<Example.Item title="hide: always, visibility">
|
34
|
+
<Hidden hide visibility>
|
35
|
+
Content
|
36
|
+
</Hidden>
|
37
|
+
</Example.Item>
|
38
|
+
</Example>),
|
39
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
component: (props: import("./..").HiddenProps) => import("react").JSX.Element;
|
5
|
+
parameters: {
|
6
|
+
iframe: {
|
7
|
+
url: string;
|
8
|
+
};
|
9
|
+
chromatic: {
|
10
|
+
disableSnapshot: boolean;
|
11
|
+
};
|
12
|
+
};
|
13
|
+
};
|
14
|
+
export default _default;
|
15
|
+
export declare const as: StoryObj;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { expect } from "@storybook/test";
|
2
|
+
import Hidden from "../index.js";
|
3
|
+
export default {
|
4
|
+
title: "Utilities/Hidden/tests",
|
5
|
+
component: Hidden,
|
6
|
+
parameters: {
|
7
|
+
iframe: {
|
8
|
+
url: "https://reshaped.so/docs/utilities/hidden",
|
9
|
+
},
|
10
|
+
chromatic: { disableSnapshot: true },
|
11
|
+
},
|
12
|
+
};
|
13
|
+
export const as = {
|
14
|
+
name: "as",
|
15
|
+
render: () => <Hidden as="span">Content</Hidden>,
|
16
|
+
play: ({ canvas }) => {
|
17
|
+
const el = canvas.getByText("Content");
|
18
|
+
expect(el.tagName).toEqual("SPAN");
|
19
|
+
},
|
20
|
+
};
|
@@ -9,8 +9,11 @@ export default {
|
|
9
9
|
},
|
10
10
|
},
|
11
11
|
};
|
12
|
-
export const visibility =
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
export const visibility = {
|
13
|
+
name: "visibility",
|
14
|
+
render: () => (<Example>
|
15
|
+
<Example.Item title="pronounced by screen readers">
|
16
|
+
<HiddenVisually>Screen-reader only</HiddenVisually>
|
17
|
+
</Example.Item>
|
18
|
+
</Example>),
|
19
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
component: (props: import("./..").HiddenVisuallyProps) => import("react").JSX.Element;
|
5
|
+
parameters: {
|
6
|
+
iframe: {
|
7
|
+
url: string;
|
8
|
+
};
|
9
|
+
chromatic: {
|
10
|
+
disableSnapshot: boolean;
|
11
|
+
};
|
12
|
+
};
|
13
|
+
};
|
14
|
+
export default _default;
|
15
|
+
export declare const children: StoryObj;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { expect } from "@storybook/test";
|
2
|
+
import HiddenVisually from "../index.js";
|
3
|
+
export default {
|
4
|
+
title: "Utilities/HiddenVisually/tests",
|
5
|
+
component: HiddenVisually,
|
6
|
+
parameters: {
|
7
|
+
iframe: {
|
8
|
+
url: "https://reshaped.so/docs/utilities/hidden-visually",
|
9
|
+
},
|
10
|
+
chromatic: { disableSnapshot: true },
|
11
|
+
},
|
12
|
+
};
|
13
|
+
export const children = {
|
14
|
+
name: "children",
|
15
|
+
render: () => <HiddenVisually>Content</HiddenVisually>,
|
16
|
+
play: ({ canvas }) => {
|
17
|
+
const el = canvas.getByText("Content");
|
18
|
+
expect(el).toBeInTheDocument();
|
19
|
+
},
|
20
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
component: (props: import("..").HotkeyProps) => import("react").JSX.Element;
|
5
|
+
parameters: {
|
6
|
+
iframe: {
|
7
|
+
url: string;
|
8
|
+
};
|
9
|
+
chromatic: {
|
10
|
+
disableSnapshot: boolean;
|
11
|
+
};
|
12
|
+
};
|
13
|
+
};
|
14
|
+
export default _default;
|
15
|
+
export declare const className: StoryObj;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { expect } from "@storybook/test";
|
2
|
+
import Hotkey from "../Hotkey.js";
|
3
|
+
export default {
|
4
|
+
title: "Components/Hotkey/tests",
|
5
|
+
component: Hotkey,
|
6
|
+
parameters: {
|
7
|
+
iframe: {
|
8
|
+
url: "https://reshaped.so/docs/components/hotkey",
|
9
|
+
},
|
10
|
+
chromatic: { disableSnapshot: true },
|
11
|
+
},
|
12
|
+
};
|
13
|
+
export const className = {
|
14
|
+
name: "className, attributes",
|
15
|
+
render: () => (<div data-testid="root">
|
16
|
+
<Hotkey className="test-classname" attributes={{ id: "test-id" }}>
|
17
|
+
⌘K
|
18
|
+
</Hotkey>
|
19
|
+
</div>),
|
20
|
+
play: async ({ canvas }) => {
|
21
|
+
const root = canvas.getByTestId("root").firstChild;
|
22
|
+
expect(root).toHaveClass("test-classname");
|
23
|
+
expect(root).toHaveAttribute("id", "test-id");
|
24
|
+
expect(root?.tagName).toBe("KBD");
|
25
|
+
},
|
26
|
+
};
|
@@ -8,6 +8,15 @@ declare const _default: {
|
|
8
8
|
};
|
9
9
|
};
|
10
10
|
export default _default;
|
11
|
-
export declare const size:
|
12
|
-
|
13
|
-
|
11
|
+
export declare const size: {
|
12
|
+
name: string;
|
13
|
+
render: () => import("react").JSX.Element;
|
14
|
+
};
|
15
|
+
export declare const color: {
|
16
|
+
name: string;
|
17
|
+
render: () => import("react").JSX.Element;
|
18
|
+
};
|
19
|
+
export declare const autoWidth: {
|
20
|
+
name: string;
|
21
|
+
render: () => import("react").JSX.Element;
|
22
|
+
};
|