reshaped 3.8.8 → 3.9.0-canary.1
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/dist/bundle.css +1 -1
- package/dist/bundle.js +11 -11
- package/dist/components/Button/Button.module.css +1 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Divider/Divider.js +3 -3
- package/dist/components/Divider/Divider.module.css +1 -1
- package/dist/components/Divider/Divider.types.d.ts +6 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +1 -1
- package/dist/components/Flyout/Flyout.constants.d.ts +1 -3
- package/dist/components/Flyout/Flyout.constants.js +1 -3
- package/dist/components/Flyout/Flyout.types.d.ts +2 -0
- package/dist/components/Flyout/FlyoutControlled.js +10 -11
- package/dist/components/Flyout/utilities/cooldown.js +1 -2
- package/dist/components/Icon/Icon.module.css +1 -1
- package/dist/components/Popover/Popover.types.d.ts +1 -1
- package/dist/components/Progress/Progress.module.css +1 -1
- package/dist/components/Select/Select.module.css +1 -1
- package/dist/components/Select/Select.types.d.ts +16 -11
- package/dist/components/Select/SelectCustomControlled.js +27 -10
- package/dist/components/Select/SelectGroup.d.ts +4 -0
- package/dist/components/Select/SelectGroup.js +10 -0
- package/dist/components/Select/SelectTrigger.js +1 -1
- package/dist/components/Select/index.d.ts +3 -2
- package/dist/components/Select/index.js +3 -2
- package/dist/components/Tabs/TabsContext.d.ts +1 -1
- package/dist/components/TextArea/TextArea.module.css +1 -1
- package/dist/components/TextArea/TextArea.types.d.ts +1 -1
- package/dist/components/TextField/TextField.module.css +1 -1
- package/dist/components/TextField/TextField.types.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.types.d.ts +1 -1
- package/dist/config/tailwind.d.ts +1 -1
- package/package.json +31 -30
- package/dist/components/Accordion/tests/Accordion.stories.d.ts +0 -44
- package/dist/components/Accordion/tests/Accordion.stories.js +0 -204
- package/dist/components/ActionBar/tests/ActionBar.stories.d.ts +0 -40
- package/dist/components/ActionBar/tests/ActionBar.stories.js +0 -223
- package/dist/components/Actionable/tests/Actionable.stories.d.ts +0 -41
- package/dist/components/Actionable/tests/Actionable.stories.js +0 -220
- package/dist/components/Alert/tests/Alert.stories.d.ts +0 -24
- package/dist/components/Alert/tests/Alert.stories.js +0 -78
- package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +0 -32
- package/dist/components/Autocomplete/tests/Autocomplete.stories.js +0 -246
- package/dist/components/Avatar/tests/Avatar.stories.d.ts +0 -31
- package/dist/components/Avatar/tests/Avatar.stories.js +0 -176
- package/dist/components/Badge/tests/Badge.stories.d.ts +0 -55
- package/dist/components/Badge/tests/Badge.stories.js +0 -328
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.d.ts +0 -40
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.js +0 -187
- package/dist/components/Button/tests/Button.stories.d.ts +0 -79
- package/dist/components/Button/tests/Button.stories.js +0 -789
- package/dist/components/Calendar/tests/Calendar.stories.d.ts +0 -29
- package/dist/components/Calendar/tests/Calendar.stories.js +0 -255
- package/dist/components/Card/tests/Card.stories.d.ts +0 -52
- package/dist/components/Card/tests/Card.stories.js +0 -125
- package/dist/components/Carousel/tests/Carousel.stories.d.ts +0 -34
- package/dist/components/Carousel/tests/Carousel.stories.js +0 -224
- package/dist/components/Checkbox/tests/Checkbox.stories.d.ts +0 -30
- package/dist/components/Checkbox/tests/Checkbox.stories.js +0 -171
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.d.ts +0 -19
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.js +0 -83
- package/dist/components/Container/tests/Container.stories.d.ts +0 -24
- package/dist/components/Container/tests/Container.stories.js +0 -75
- package/dist/components/ContextMenu/tests/ContextMenu.stories.d.ts +0 -26
- package/dist/components/ContextMenu/tests/ContextMenu.stories.js +0 -70
- package/dist/components/Dismissible/tests/Dismissible.stories.d.ts +0 -25
- package/dist/components/Dismissible/tests/Dismissible.stories.js +0 -97
- package/dist/components/Divider/tests/Divider.stories.d.ts +0 -18
- package/dist/components/Divider/tests/Divider.stories.js +0 -94
- package/dist/components/DropdownMenu/tests/DropdownMenu.stories.d.ts +0 -53
- package/dist/components/DropdownMenu/tests/DropdownMenu.stories.js +0 -278
- package/dist/components/FileUpload/tests/FileUpload.stories.d.ts +0 -31
- package/dist/components/FileUpload/tests/FileUpload.stories.js +0 -140
- package/dist/components/Flyout/tests/Flyout.stories.d.ts +0 -102
- package/dist/components/Flyout/tests/Flyout.stories.js +0 -708
- package/dist/components/FormControl/tests/FormControl.stories.d.ts +0 -31
- package/dist/components/FormControl/tests/FormControl.stories.js +0 -143
- package/dist/components/Grid/tests/Grid.stories.d.ts +0 -38
- package/dist/components/Grid/tests/Grid.stories.js +0 -245
- package/dist/components/Hidden/tests/Hidden.stories.d.ts +0 -16
- package/dist/components/Hidden/tests/Hidden.stories.js +0 -48
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +0 -16
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.js +0 -28
- package/dist/components/Hotkey/tests/Hotkey.stories.d.ts +0 -13
- package/dist/components/Hotkey/tests/Hotkey.stories.js +0 -53
- package/dist/components/Icon/tests/Icon.stories.d.ts +0 -25
- package/dist/components/Icon/tests/Icon.stories.js +0 -113
- package/dist/components/Image/tests/Image.stories.d.ts +0 -41
- package/dist/components/Image/tests/Image.stories.js +0 -196
- package/dist/components/Link/tests/Link.stories.d.ts +0 -42
- package/dist/components/Link/tests/Link.stories.js +0 -155
- package/dist/components/Loader/tests/Loader.stories.d.ts +0 -21
- package/dist/components/Loader/tests/Loader.stories.js +0 -68
- package/dist/components/MenuItem/tests/MenuItem.stories.d.ts +0 -59
- package/dist/components/MenuItem/tests/MenuItem.stories.js +0 -236
- package/dist/components/Modal/tests/Modal.stories.d.ts +0 -64
- package/dist/components/Modal/tests/Modal.stories.js +0 -410
- package/dist/components/NumberField/tests/NumberField.stories.d.ts +0 -28
- package/dist/components/NumberField/tests/NumberField.stories.js +0 -258
- package/dist/components/Overlay/tests/Overlay.stories.d.ts +0 -28
- package/dist/components/Overlay/tests/Overlay.stories.js +0 -202
- package/dist/components/Pagination/tests/Pagination.stories.d.ts +0 -24
- package/dist/components/Pagination/tests/Pagination.stories.js +0 -105
- package/dist/components/PinField/tests/PinField.stories.d.ts +0 -34
- package/dist/components/PinField/tests/PinField.stories.js +0 -209
- package/dist/components/Popover/tests/Popover.stories.d.ts +0 -69
- package/dist/components/Popover/tests/Popover.stories.js +0 -340
- package/dist/components/Progress/tests/Progress.stories.d.ts +0 -30
- package/dist/components/Progress/tests/Progress.stories.js +0 -102
- package/dist/components/ProgressIndicator/tests/ProgressIndicator.stories.d.ts +0 -19
- package/dist/components/ProgressIndicator/tests/ProgressIndicator.stories.js +0 -92
- package/dist/components/Radio/tests/Radio.stories.d.ts +0 -35
- package/dist/components/Radio/tests/Radio.stories.js +0 -162
- package/dist/components/RadioGroup/tests/RadioGroup.stories.d.ts +0 -19
- package/dist/components/RadioGroup/tests/RadioGroup.stories.js +0 -77
- package/dist/components/Reshaped/tests/Reshaped.stories.d.ts +0 -34
- package/dist/components/Reshaped/tests/Reshaped.stories.js +0 -108
- package/dist/components/Resizable/tests/Resizable.stories.d.ts +0 -38
- package/dist/components/Resizable/tests/Resizable.stories.js +0 -185
- package/dist/components/Scrim/tests/Scrim.stories.d.ts +0 -20
- package/dist/components/Scrim/tests/Scrim.stories.js +0 -67
- package/dist/components/ScrollArea/tests/ScrollArea.stories.d.ts +0 -37
- package/dist/components/ScrollArea/tests/ScrollArea.stories.js +0 -244
- package/dist/components/Select/SelectOptionGroup.d.ts +0 -4
- package/dist/components/Select/SelectOptionGroup.js +0 -9
- package/dist/components/Select/tests/Select.stories.d.ts +0 -47
- package/dist/components/Select/tests/Select.stories.js +0 -520
- package/dist/components/Skeleton/tests/Skeleton.stories.d.ts +0 -20
- package/dist/components/Skeleton/tests/Skeleton.stories.js +0 -63
- package/dist/components/Slider/tests/Slider.stories.d.ts +0 -47
- package/dist/components/Slider/tests/Slider.stories.js +0 -279
- package/dist/components/Stepper/tests/Stepper.stories.d.ts +0 -31
- package/dist/components/Stepper/tests/Stepper.stories.js +0 -135
- package/dist/components/Switch/tests/Switch.stories.d.ts +0 -22
- package/dist/components/Switch/tests/Switch.stories.js +0 -137
- package/dist/components/Switch/tests/Switch.test.stories.d.ts +0 -13
- package/dist/components/Switch/tests/Switch.test.stories.js +0 -11
- package/dist/components/Table/tests/Table.stories.d.ts +0 -42
- package/dist/components/Table/tests/Table.stories.js +0 -348
- package/dist/components/Tabs/tests/Tabs.stories.d.ts +0 -62
- package/dist/components/Tabs/tests/Tabs.stories.js +0 -539
- package/dist/components/Text/tests/Text.stories.d.ts +0 -48
- package/dist/components/Text/tests/Text.stories.js +0 -201
- package/dist/components/TextArea/tests/TextArea.stories.d.ts +0 -53
- package/dist/components/TextArea/tests/TextArea.stories.js +0 -200
- package/dist/components/TextField/tests/TextField.stories.d.ts +0 -53
- package/dist/components/TextField/tests/TextField.stories.js +0 -237
- package/dist/components/Theme/tests/Theme.stories.d.ts +0 -25
- package/dist/components/Theme/tests/Theme.stories.js +0 -171
- package/dist/components/Timeline/tests/Timeline.stories.d.ts +0 -22
- package/dist/components/Timeline/tests/Timeline.stories.js +0 -86
- package/dist/components/Toast/tests/Toast.stories.d.ts +0 -41
- package/dist/components/Toast/tests/Toast.stories.js +0 -432
- package/dist/components/ToggleButton/tests/ToggleButton.stories.d.ts +0 -27
- package/dist/components/ToggleButton/tests/ToggleButton.stories.js +0 -97
- package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.d.ts +0 -27
- package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.js +0 -169
- package/dist/components/Tooltip/tests/Tooltip.stories.d.ts +0 -28
- package/dist/components/Tooltip/tests/Tooltip.stories.js +0 -182
- package/dist/components/View/tests/View.stories.d.ts +0 -141
- package/dist/components/View/tests/View.stories.js +0 -1329
- package/dist/components/_private/Portal/tests/Portal.stories.d.ts +0 -6
- package/dist/components/_private/Portal/tests/Portal.stories.js +0 -17
- package/dist/hooks/tests/useDrag.stories.d.ts +0 -31
- package/dist/hooks/tests/useDrag.stories.js +0 -147
- package/dist/hooks/tests/useElementId.stories.d.ts +0 -11
- package/dist/hooks/tests/useElementId.stories.js +0 -23
- package/dist/hooks/tests/useHandlerRef.stories.d.ts +0 -14
- package/dist/hooks/tests/useHandlerRef.stories.js +0 -44
- package/dist/hooks/tests/useHotkeys.stories.d.ts +0 -43
- package/dist/hooks/tests/useHotkeys.stories.js +0 -158
- package/dist/hooks/tests/useKeyboardArrowNavigation.stories.d.ts +0 -15
- package/dist/hooks/tests/useKeyboardArrowNavigation.stories.js +0 -128
- package/dist/hooks/tests/useKeyboardMode.stories.d.ts +0 -11
- package/dist/hooks/tests/useKeyboardMode.stories.js +0 -42
- package/dist/hooks/tests/useOnClickOutside.stories.d.ts +0 -23
- package/dist/hooks/tests/useOnClickOutside.stories.js +0 -111
- package/dist/hooks/tests/useRTL.stories.d.ts +0 -11
- package/dist/hooks/tests/useRTL.stories.js +0 -23
- package/dist/hooks/tests/useResponsiveClientValue.stories.d.ts +0 -18
- package/dist/hooks/tests/useResponsiveClientValue.stories.js +0 -30
- package/dist/hooks/tests/useScrollLock.stories.d.ts +0 -14
- package/dist/hooks/tests/useScrollLock.stories.js +0 -97
- package/dist/hooks/tests/useToggle.stories.d.ts +0 -13
- package/dist/hooks/tests/useToggle.stories.js +0 -59
- package/dist/tests/ShadowDOM.stories.d.ts +0 -6
- package/dist/tests/ShadowDOM.stories.js +0 -110
- package/dist/tests/themes.stories.d.ts +0 -16
- package/dist/tests/themes.stories.js +0 -327
- package/dist/utilities/a11y/tests/TrapFocus.stories.d.ts +0 -14
- package/dist/utilities/a11y/tests/TrapFocus.stories.js +0 -615
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { expect } from "storybook/test";
|
|
2
|
-
import { Placeholder, Example } from "../../../utilities/storybook/index.js";
|
|
3
|
-
import ActionBar from "../index.js";
|
|
4
|
-
import View from "../../View/index.js";
|
|
5
|
-
import Button from "../../Button/index.js";
|
|
6
|
-
import useToggle from "../../../hooks/useToggle.js";
|
|
7
|
-
export default {
|
|
8
|
-
title: "Components/ActionBar",
|
|
9
|
-
component: ActionBar,
|
|
10
|
-
parameters: {
|
|
11
|
-
iframe: {
|
|
12
|
-
url: "https://reshaped.so/docs/components/action-bar",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
const Fixtures = {
|
|
17
|
-
Container: (props) => (<View backgroundColor="neutral-faded" height="160px" overflow="hidden" borderRadius="medium">
|
|
18
|
-
{props.children}
|
|
19
|
-
</View>),
|
|
20
|
-
Actions: () => (<View direction="row" gap={2}>
|
|
21
|
-
<Button onClick={() => { }}>Action</Button>
|
|
22
|
-
<Button onClick={() => { }} variant="outline">
|
|
23
|
-
Action
|
|
24
|
-
</Button>
|
|
25
|
-
</View>),
|
|
26
|
-
};
|
|
27
|
-
export const positionRelative = {
|
|
28
|
-
name: "position, positionType: relative",
|
|
29
|
-
render: () => (<Example>
|
|
30
|
-
<Example.Item title="position: top">
|
|
31
|
-
<ActionBar position="top">
|
|
32
|
-
<Placeholder />
|
|
33
|
-
</ActionBar>
|
|
34
|
-
</Example.Item>
|
|
35
|
-
|
|
36
|
-
<Example.Item title="position: bottom">
|
|
37
|
-
<ActionBar position="bottom">
|
|
38
|
-
<Placeholder />
|
|
39
|
-
</ActionBar>
|
|
40
|
-
</Example.Item>
|
|
41
|
-
</Example>),
|
|
42
|
-
};
|
|
43
|
-
export const positionAbsolute = {
|
|
44
|
-
name: "position, positionType: absolute",
|
|
45
|
-
render: () => (<Example>
|
|
46
|
-
<Example.Item title="position: top-start">
|
|
47
|
-
<Fixtures.Container>
|
|
48
|
-
<ActionBar padding={2} position="top-start" positionType="absolute">
|
|
49
|
-
<Fixtures.Actions />
|
|
50
|
-
</ActionBar>
|
|
51
|
-
</Fixtures.Container>
|
|
52
|
-
</Example.Item>
|
|
53
|
-
|
|
54
|
-
<Example.Item title="position: top">
|
|
55
|
-
<Fixtures.Container>
|
|
56
|
-
<ActionBar padding={2} position="top" positionType="absolute">
|
|
57
|
-
<Fixtures.Actions />
|
|
58
|
-
</ActionBar>
|
|
59
|
-
</Fixtures.Container>
|
|
60
|
-
</Example.Item>
|
|
61
|
-
|
|
62
|
-
<Example.Item title="position: top-end">
|
|
63
|
-
<Fixtures.Container>
|
|
64
|
-
<ActionBar padding={2} position="top-end" positionType="absolute">
|
|
65
|
-
<Fixtures.Actions />
|
|
66
|
-
</ActionBar>
|
|
67
|
-
</Fixtures.Container>
|
|
68
|
-
</Example.Item>
|
|
69
|
-
|
|
70
|
-
<Example.Item title="position: bottom-start">
|
|
71
|
-
<Fixtures.Container>
|
|
72
|
-
<ActionBar padding={2} position="bottom-start" positionType="absolute">
|
|
73
|
-
<Fixtures.Actions />
|
|
74
|
-
</ActionBar>
|
|
75
|
-
</Fixtures.Container>
|
|
76
|
-
</Example.Item>
|
|
77
|
-
|
|
78
|
-
<Example.Item title="position: bottom">
|
|
79
|
-
<Fixtures.Container>
|
|
80
|
-
<ActionBar padding={2} position="bottom" positionType="absolute">
|
|
81
|
-
<Fixtures.Actions />
|
|
82
|
-
</ActionBar>
|
|
83
|
-
</Fixtures.Container>
|
|
84
|
-
</Example.Item>
|
|
85
|
-
|
|
86
|
-
<Example.Item title="position: bottom-end">
|
|
87
|
-
<Fixtures.Container>
|
|
88
|
-
<ActionBar padding={2} position="bottom-end" positionType="absolute">
|
|
89
|
-
<Fixtures.Actions />
|
|
90
|
-
</ActionBar>
|
|
91
|
-
</Fixtures.Container>
|
|
92
|
-
</Example.Item>
|
|
93
|
-
</Example>),
|
|
94
|
-
};
|
|
95
|
-
export const positionFixed = {
|
|
96
|
-
name: "position, positionType: fixed",
|
|
97
|
-
render: () => (<>
|
|
98
|
-
<ActionBar padding={2} position="top-start" positionType="fixed">
|
|
99
|
-
<Fixtures.Actions />
|
|
100
|
-
</ActionBar>
|
|
101
|
-
|
|
102
|
-
<ActionBar padding={2} position="top" positionType="fixed">
|
|
103
|
-
<Fixtures.Actions />
|
|
104
|
-
</ActionBar>
|
|
105
|
-
|
|
106
|
-
<ActionBar padding={2} position="top-end" positionType="fixed">
|
|
107
|
-
<Fixtures.Actions />
|
|
108
|
-
</ActionBar>
|
|
109
|
-
|
|
110
|
-
<ActionBar padding={2} position="bottom-start" positionType="fixed">
|
|
111
|
-
<Fixtures.Actions />
|
|
112
|
-
</ActionBar>
|
|
113
|
-
|
|
114
|
-
<ActionBar padding={2} position="bottom" positionType="fixed">
|
|
115
|
-
<Fixtures.Actions />
|
|
116
|
-
</ActionBar>
|
|
117
|
-
|
|
118
|
-
<ActionBar padding={2} position="bottom-end" positionType="fixed">
|
|
119
|
-
<Fixtures.Actions />
|
|
120
|
-
</ActionBar>
|
|
121
|
-
|
|
122
|
-
<div style={{ height: 2000 }}/>
|
|
123
|
-
</>),
|
|
124
|
-
};
|
|
125
|
-
export const elevated = {
|
|
126
|
-
name: "elevated",
|
|
127
|
-
render: () => (<Example>
|
|
128
|
-
<Example.Item title="elevated, position: top">
|
|
129
|
-
<ActionBar position="top" elevated>
|
|
130
|
-
<Placeholder />
|
|
131
|
-
</ActionBar>
|
|
132
|
-
</Example.Item>
|
|
133
|
-
|
|
134
|
-
<Example.Item title="elevated, position: bottom">
|
|
135
|
-
<ActionBar elevated>
|
|
136
|
-
<Placeholder />
|
|
137
|
-
</ActionBar>
|
|
138
|
-
</Example.Item>
|
|
139
|
-
|
|
140
|
-
<Example.Item title="auto elevated, position: bottom">
|
|
141
|
-
<Fixtures.Container>
|
|
142
|
-
<ActionBar position="bottom-end">
|
|
143
|
-
<Fixtures.Actions />
|
|
144
|
-
</ActionBar>
|
|
145
|
-
</Fixtures.Container>
|
|
146
|
-
</Example.Item>
|
|
147
|
-
</Example>),
|
|
148
|
-
};
|
|
149
|
-
export const offset = {
|
|
150
|
-
name: "offset",
|
|
151
|
-
render: () => (<Example>
|
|
152
|
-
<Example.Item title="offset 2, position: top">
|
|
153
|
-
<Fixtures.Container>
|
|
154
|
-
<ActionBar position="top" positionType="absolute" offset={2}>
|
|
155
|
-
<Fixtures.Actions />
|
|
156
|
-
</ActionBar>
|
|
157
|
-
</Fixtures.Container>
|
|
158
|
-
</Example.Item>
|
|
159
|
-
|
|
160
|
-
<Example.Item title="offset 2, position: bottom-end">
|
|
161
|
-
<Fixtures.Container>
|
|
162
|
-
<ActionBar position="bottom-end" offset={2}>
|
|
163
|
-
<Fixtures.Actions />
|
|
164
|
-
</ActionBar>
|
|
165
|
-
</Fixtures.Container>
|
|
166
|
-
</Example.Item>
|
|
167
|
-
|
|
168
|
-
<Example.Item title="offset s: 2, m: 4, position: bottom-end">
|
|
169
|
-
<Fixtures.Container>
|
|
170
|
-
<ActionBar position="bottom-end" offset={{ s: 2, m: 4 }}>
|
|
171
|
-
<Fixtures.Actions />
|
|
172
|
-
</ActionBar>
|
|
173
|
-
</Fixtures.Container>
|
|
174
|
-
</Example.Item>
|
|
175
|
-
</Example>),
|
|
176
|
-
};
|
|
177
|
-
export const active = {
|
|
178
|
-
name: "active",
|
|
179
|
-
render: () => {
|
|
180
|
-
const barToggle = useToggle();
|
|
181
|
-
return (<>
|
|
182
|
-
<Button onClick={() => barToggle.toggle()}>Toggle</Button>
|
|
183
|
-
<ActionBar active={barToggle.active} positionType="fixed" position="top-end">
|
|
184
|
-
<Fixtures.Actions />
|
|
185
|
-
</ActionBar>
|
|
186
|
-
</>);
|
|
187
|
-
},
|
|
188
|
-
};
|
|
189
|
-
export const padding = {
|
|
190
|
-
name: "padding, paddingBlock, paddingInline",
|
|
191
|
-
render: () => (<Example>
|
|
192
|
-
<Example.Item title="padding: 6">
|
|
193
|
-
<ActionBar padding={6}>
|
|
194
|
-
<Placeholder />
|
|
195
|
-
</ActionBar>
|
|
196
|
-
</Example.Item>
|
|
197
|
-
|
|
198
|
-
<Example.Item title="paddingBlock: 2, paddingInline: 4">
|
|
199
|
-
<ActionBar paddingBlock={2} paddingInline={4}>
|
|
200
|
-
<Placeholder />
|
|
201
|
-
</ActionBar>
|
|
202
|
-
</Example.Item>
|
|
203
|
-
|
|
204
|
-
<Example.Item title="padding: [s] 4, [m+] 6">
|
|
205
|
-
<ActionBar padding={{ s: 4, m: 6 }}>
|
|
206
|
-
<Placeholder />
|
|
207
|
-
</ActionBar>
|
|
208
|
-
</Example.Item>
|
|
209
|
-
</Example>),
|
|
210
|
-
};
|
|
211
|
-
export const className = {
|
|
212
|
-
name: "className, attributes",
|
|
213
|
-
render: () => (<div data-testid="root">
|
|
214
|
-
<ActionBar className="test-classname" attributes={{ id: "test-id" }}>
|
|
215
|
-
<Placeholder />
|
|
216
|
-
</ActionBar>
|
|
217
|
-
</div>),
|
|
218
|
-
play: async ({ canvas }) => {
|
|
219
|
-
const root = canvas.getByTestId("root").firstChild;
|
|
220
|
-
expect(root).toHaveClass("test-classname");
|
|
221
|
-
expect(root).toHaveAttribute("id", "test-id");
|
|
222
|
-
},
|
|
223
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { fn } from "storybook/test";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: import("react").ForwardRefExoticComponent<import("./..").ActionableProps & import("react").RefAttributes<import("./..").ActionableRef>>;
|
|
6
|
-
parameters: {
|
|
7
|
-
iframe: {
|
|
8
|
-
url: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
|
13
|
-
export declare const base: StoryObj<{
|
|
14
|
-
handleClick: ReturnType<typeof fn>;
|
|
15
|
-
handleSecondClick: ReturnType<typeof fn>;
|
|
16
|
-
}>;
|
|
17
|
-
export declare const disabled: StoryObj;
|
|
18
|
-
export declare const fullWidth: StoryObj;
|
|
19
|
-
export declare const insetFocus: {
|
|
20
|
-
name: string;
|
|
21
|
-
render: () => import("react").JSX.Element;
|
|
22
|
-
play: () => Promise<void>;
|
|
23
|
-
};
|
|
24
|
-
export declare const disableFocusRing: {
|
|
25
|
-
name: string;
|
|
26
|
-
render: () => import("react").JSX.Element;
|
|
27
|
-
play: () => Promise<void>;
|
|
28
|
-
};
|
|
29
|
-
export declare const borderRadius: {
|
|
30
|
-
name: string;
|
|
31
|
-
render: () => import("react").JSX.Element;
|
|
32
|
-
play: () => Promise<void>;
|
|
33
|
-
};
|
|
34
|
-
export declare const type: StoryObj<{
|
|
35
|
-
handleSubmit: ReturnType<typeof fn>;
|
|
36
|
-
}>;
|
|
37
|
-
export declare const as: StoryObj;
|
|
38
|
-
export declare const stopPropagation: StoryObj<{
|
|
39
|
-
handleParentClick: ReturnType<typeof fn>;
|
|
40
|
-
}>;
|
|
41
|
-
export declare const className: StoryObj;
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { userEvent, expect, fn } from "storybook/test";
|
|
2
|
-
import { Example } from "../../../utilities/storybook/index.js";
|
|
3
|
-
import Actionable from "../index.js";
|
|
4
|
-
import View from "../../View/index.js";
|
|
5
|
-
export default {
|
|
6
|
-
title: "Utility components/Actionable",
|
|
7
|
-
component: Actionable,
|
|
8
|
-
parameters: {
|
|
9
|
-
iframe: {
|
|
10
|
-
url: "https://reshaped.so/docs/utilities/actionable",
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
export const base = {
|
|
15
|
-
name: "href, onClick",
|
|
16
|
-
args: {
|
|
17
|
-
handleClick: fn(),
|
|
18
|
-
handleSecondClick: fn(),
|
|
19
|
-
},
|
|
20
|
-
render: (args) => (<Example>
|
|
21
|
-
<Example.Item title="span">
|
|
22
|
-
<Actionable>Span</Actionable>
|
|
23
|
-
</Example.Item>
|
|
24
|
-
<Example.Item title="onClick">
|
|
25
|
-
<Actionable onClick={args.handleClick}>Button</Actionable>
|
|
26
|
-
</Example.Item>
|
|
27
|
-
<Example.Item title="href">
|
|
28
|
-
<Actionable href="https://reshaped.so" attributes={{ target: "_blank" }}>
|
|
29
|
-
Link
|
|
30
|
-
</Actionable>
|
|
31
|
-
</Example.Item>
|
|
32
|
-
|
|
33
|
-
<Example.Item title="attributes.href">
|
|
34
|
-
<Actionable attributes={{ href: "https://reshaped.so" }}>Link with attributes</Actionable>
|
|
35
|
-
</Example.Item>
|
|
36
|
-
|
|
37
|
-
<Example.Item title="href, onClick">
|
|
38
|
-
<Actionable onClick={(e) => {
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
args.handleSecondClick(e);
|
|
41
|
-
}} href="https://reshaped.so">
|
|
42
|
-
Link with onClick
|
|
43
|
-
</Actionable>
|
|
44
|
-
</Example.Item>
|
|
45
|
-
</Example>),
|
|
46
|
-
play: async ({ canvas, args }) => {
|
|
47
|
-
const span = canvas.getByText("Span");
|
|
48
|
-
const link = canvas.getByText("Link");
|
|
49
|
-
const button = canvas.getByText("Button");
|
|
50
|
-
const linkWithAttributes = canvas.getByText("Link with attributes");
|
|
51
|
-
const linkWithOnClick = canvas.getByText("Link with onClick");
|
|
52
|
-
expect(span).toBeInTheDocument();
|
|
53
|
-
expect(span.tagName).toBe("SPAN");
|
|
54
|
-
expect(link).toBeInTheDocument();
|
|
55
|
-
expect(link).toHaveRole("link");
|
|
56
|
-
expect(link).toHaveAttribute("href", "https://reshaped.so");
|
|
57
|
-
await userEvent.click(button);
|
|
58
|
-
expect(button).toBeInTheDocument();
|
|
59
|
-
expect(button).toHaveRole("button");
|
|
60
|
-
expect(button).toHaveAttribute("type", "button");
|
|
61
|
-
expect(args.handleClick).toHaveBeenCalledTimes(1);
|
|
62
|
-
expect(args.handleClick).toHaveBeenCalledWith(expect.objectContaining({ target: button }));
|
|
63
|
-
expect(linkWithAttributes).toBeInTheDocument();
|
|
64
|
-
expect(linkWithAttributes).toHaveRole("link");
|
|
65
|
-
expect(linkWithAttributes).toHaveAttribute("href", "https://reshaped.so");
|
|
66
|
-
await userEvent.click(linkWithOnClick);
|
|
67
|
-
expect(linkWithOnClick).toBeInTheDocument();
|
|
68
|
-
expect(linkWithOnClick).toHaveRole("link");
|
|
69
|
-
expect(linkWithOnClick).toHaveAttribute("href", "https://reshaped.so");
|
|
70
|
-
expect(args.handleSecondClick).toHaveBeenCalledTimes(1);
|
|
71
|
-
expect(args.handleSecondClick).toHaveBeenCalledWith(expect.objectContaining({ target: linkWithOnClick }));
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
export const disabled = {
|
|
75
|
-
name: "disabled",
|
|
76
|
-
render: () => (<Example>
|
|
77
|
-
<Example.Item title="disabled, button">
|
|
78
|
-
<Actionable disabled onClick={() => { }}>
|
|
79
|
-
Button
|
|
80
|
-
</Actionable>
|
|
81
|
-
</Example.Item>
|
|
82
|
-
<Example.Item title="disabled, link">
|
|
83
|
-
<Actionable disabled href="https://reshaped.so">
|
|
84
|
-
Link
|
|
85
|
-
</Actionable>
|
|
86
|
-
</Example.Item>
|
|
87
|
-
</Example>),
|
|
88
|
-
play: ({ canvas }) => {
|
|
89
|
-
const button = canvas.getAllByRole("button")[0];
|
|
90
|
-
const link = canvas.getByText("Link");
|
|
91
|
-
expect(button).toBeDisabled();
|
|
92
|
-
expect(link).not.toHaveAttribute("href");
|
|
93
|
-
expect(link).not.toHaveRole("link");
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
export const fullWidth = {
|
|
97
|
-
name: "fullWidth",
|
|
98
|
-
render: () => (<Example>
|
|
99
|
-
<Example.Item title="fullWidth">
|
|
100
|
-
<Actionable fullWidth href="https://reshaped.so">
|
|
101
|
-
Actionable
|
|
102
|
-
</Actionable>
|
|
103
|
-
</Example.Item>
|
|
104
|
-
</Example>),
|
|
105
|
-
play: async () => {
|
|
106
|
-
await userEvent.keyboard("{Tab/}");
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
export const insetFocus = {
|
|
110
|
-
name: "insetFocus",
|
|
111
|
-
render: () => (<Example>
|
|
112
|
-
<Example.Item title="insetFocus">
|
|
113
|
-
<Actionable insetFocus onClick={() => { }}>
|
|
114
|
-
Actionable
|
|
115
|
-
</Actionable>
|
|
116
|
-
</Example.Item>
|
|
117
|
-
</Example>),
|
|
118
|
-
play: async () => {
|
|
119
|
-
await userEvent.keyboard("{Tab/}");
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
export const disableFocusRing = {
|
|
123
|
-
name: "disableFocusRing",
|
|
124
|
-
render: () => (<Example>
|
|
125
|
-
<Example.Item title="disableFocusRing">
|
|
126
|
-
<Actionable disableFocusRing onClick={() => { }}>
|
|
127
|
-
Actionable
|
|
128
|
-
</Actionable>
|
|
129
|
-
</Example.Item>
|
|
130
|
-
</Example>),
|
|
131
|
-
play: async () => {
|
|
132
|
-
await userEvent.keyboard("{Tab/}");
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
export const borderRadius = {
|
|
136
|
-
name: "borderRadius",
|
|
137
|
-
render: () => (<Example>
|
|
138
|
-
<Example.Item title="borderRadius: inherit">
|
|
139
|
-
<Actionable borderRadius="inherit" onClick={() => { }}>
|
|
140
|
-
<View borderRadius="large">Actionable</View>
|
|
141
|
-
</Actionable>
|
|
142
|
-
</Example.Item>
|
|
143
|
-
</Example>),
|
|
144
|
-
play: async () => {
|
|
145
|
-
await userEvent.keyboard("{Tab/}");
|
|
146
|
-
},
|
|
147
|
-
};
|
|
148
|
-
export const type = {
|
|
149
|
-
name: "type",
|
|
150
|
-
args: {
|
|
151
|
-
handleSubmit: fn(),
|
|
152
|
-
},
|
|
153
|
-
render: (args) => (<Example>
|
|
154
|
-
<Example.Item title="type: submit">
|
|
155
|
-
<form onSubmit={(e) => {
|
|
156
|
-
e.preventDefault();
|
|
157
|
-
args.handleSubmit();
|
|
158
|
-
}}>
|
|
159
|
-
<Actionable onClick={() => { }} type="submit">
|
|
160
|
-
Submit
|
|
161
|
-
</Actionable>
|
|
162
|
-
</form>
|
|
163
|
-
</Example.Item>
|
|
164
|
-
</Example>),
|
|
165
|
-
play: async ({ canvas, args }) => {
|
|
166
|
-
const button = canvas.getAllByRole("button")[0];
|
|
167
|
-
await userEvent.click(button);
|
|
168
|
-
expect(args.handleSubmit).toHaveBeenCalledTimes(1);
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
export const as = {
|
|
172
|
-
name: "as, render",
|
|
173
|
-
render: () => (<Example>
|
|
174
|
-
<Example.Item title="as: span">
|
|
175
|
-
<Actionable onClick={() => { }} as="span">
|
|
176
|
-
Trigger
|
|
177
|
-
</Actionable>
|
|
178
|
-
</Example.Item>
|
|
179
|
-
<Example.Item title="render, disabled">
|
|
180
|
-
<Actionable disabled onClick={() => { }} render={(props) => <section {...props}/>}>
|
|
181
|
-
Trigger
|
|
182
|
-
</Actionable>
|
|
183
|
-
</Example.Item>
|
|
184
|
-
</Example>),
|
|
185
|
-
play: ({ canvas }) => {
|
|
186
|
-
const [asEl, renderEl] = canvas.getAllByText("Trigger");
|
|
187
|
-
expect(asEl.tagName).toBe("SPAN");
|
|
188
|
-
expect(renderEl.tagName).toBe("SECTION");
|
|
189
|
-
expect(renderEl).toHaveAttribute("aria-disabled", "true");
|
|
190
|
-
},
|
|
191
|
-
};
|
|
192
|
-
export const stopPropagation = {
|
|
193
|
-
name: "stopPropagation",
|
|
194
|
-
args: {
|
|
195
|
-
handleParentClick: fn(),
|
|
196
|
-
},
|
|
197
|
-
render: (args) => (<div onClick={args.handleParentClick}>
|
|
198
|
-
<Actionable stopPropagation onClick={() => { }}>
|
|
199
|
-
Trigger
|
|
200
|
-
</Actionable>
|
|
201
|
-
</div>),
|
|
202
|
-
play: async ({ canvas, args }) => {
|
|
203
|
-
const button = canvas.getAllByRole("button")[0];
|
|
204
|
-
await userEvent.click(button);
|
|
205
|
-
expect(args.handleParentClick).not.toHaveBeenCalled();
|
|
206
|
-
},
|
|
207
|
-
};
|
|
208
|
-
export const className = {
|
|
209
|
-
name: "className, attributes",
|
|
210
|
-
render: () => (<div data-testid="root">
|
|
211
|
-
<Actionable className="test-classname" attributes={{ id: "test-id" }}>
|
|
212
|
-
Trigger
|
|
213
|
-
</Actionable>
|
|
214
|
-
</div>),
|
|
215
|
-
play: async ({ canvas }) => {
|
|
216
|
-
const root = canvas.getByTestId("root").firstChild;
|
|
217
|
-
expect(root).toHaveClass("test-classname");
|
|
218
|
-
expect(root).toHaveAttribute("id", "test-id");
|
|
219
|
-
},
|
|
220
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: import("react").FC<import("./..").AlertProps>;
|
|
5
|
-
parameters: {
|
|
6
|
-
iframe: {
|
|
7
|
-
url: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export default _default;
|
|
12
|
-
export declare const color: {
|
|
13
|
-
name: string;
|
|
14
|
-
render: () => import("react").JSX.Element;
|
|
15
|
-
};
|
|
16
|
-
export declare const inline: {
|
|
17
|
-
name: string;
|
|
18
|
-
render: () => import("react").JSX.Element;
|
|
19
|
-
};
|
|
20
|
-
export declare const bleed: {
|
|
21
|
-
name: string;
|
|
22
|
-
render: () => import("react").JSX.Element;
|
|
23
|
-
};
|
|
24
|
-
export declare const className: StoryObj;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Example, Placeholder } from "../../../utilities/storybook/index.js";
|
|
2
|
-
import Alert from "../index.js";
|
|
3
|
-
import Link from "../../Link/index.js";
|
|
4
|
-
import IconZap from "../../../icons/Zap.js";
|
|
5
|
-
import { expect } from "storybook/test";
|
|
6
|
-
export default {
|
|
7
|
-
title: "Components/Alert",
|
|
8
|
-
component: Alert,
|
|
9
|
-
parameters: {
|
|
10
|
-
iframe: {
|
|
11
|
-
url: "https://reshaped.so/docs/components/alert",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
export const color = {
|
|
16
|
-
name: "color",
|
|
17
|
-
render: () => (<Example>
|
|
18
|
-
{["neutral", "primary", "critical", "positive", "warning"].map((color) => (<Example.Item title={`color: ${color}`} key={color}>
|
|
19
|
-
<Alert color={color} title="Alert title goes here" icon={IconZap} actionsSlot={<>
|
|
20
|
-
<Link variant="plain" color={color === "neutral" ? "primary" : color} onClick={() => { }}>
|
|
21
|
-
View now
|
|
22
|
-
</Link>
|
|
23
|
-
<Link variant="plain" color={color === "neutral" ? "primary" : color} onClick={() => { }}>
|
|
24
|
-
Dismiss
|
|
25
|
-
</Link>
|
|
26
|
-
</>}>
|
|
27
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
|
|
28
|
-
has been the industry's standard
|
|
29
|
-
</Alert>
|
|
30
|
-
</Example.Item>))}
|
|
31
|
-
</Example>),
|
|
32
|
-
};
|
|
33
|
-
export const inline = {
|
|
34
|
-
name: "inline",
|
|
35
|
-
render: () => (<Example>
|
|
36
|
-
<Example.Item title="inline: true">
|
|
37
|
-
<Alert inline title="Alert title goes here" icon={IconZap} actionsSlot={<>
|
|
38
|
-
<Link variant="plain" onClick={() => { }}>
|
|
39
|
-
View now
|
|
40
|
-
</Link>
|
|
41
|
-
<Link variant="plain" onClick={() => { }}>
|
|
42
|
-
Dismiss
|
|
43
|
-
</Link>
|
|
44
|
-
</>}>
|
|
45
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
|
46
|
-
been the industry's standard
|
|
47
|
-
</Alert>
|
|
48
|
-
</Example.Item>
|
|
49
|
-
</Example>),
|
|
50
|
-
};
|
|
51
|
-
export const bleed = {
|
|
52
|
-
name: "bleed",
|
|
53
|
-
render: () => (<Example>
|
|
54
|
-
<Example.Item title="bleed: 4">
|
|
55
|
-
<Alert bleed={4} icon={IconZap}>
|
|
56
|
-
Content
|
|
57
|
-
</Alert>
|
|
58
|
-
</Example.Item>
|
|
59
|
-
<Example.Item title="bleed: [s] 4, [m+] 0">
|
|
60
|
-
<Alert bleed={{ s: 4, m: 0 }} icon={IconZap}>
|
|
61
|
-
Content
|
|
62
|
-
</Alert>
|
|
63
|
-
</Example.Item>
|
|
64
|
-
</Example>),
|
|
65
|
-
};
|
|
66
|
-
export const className = {
|
|
67
|
-
name: "className, attributes",
|
|
68
|
-
render: () => (<div data-testid="root">
|
|
69
|
-
<Alert className="test-classname" attributes={{ id: "test-id" }}>
|
|
70
|
-
<Placeholder />
|
|
71
|
-
</Alert>
|
|
72
|
-
</div>),
|
|
73
|
-
play: async ({ canvas }) => {
|
|
74
|
-
const root = canvas.getByTestId("root").firstChild;
|
|
75
|
-
expect(root).toHaveClass("test-classname");
|
|
76
|
-
expect(root).toHaveAttribute("id", "test-id");
|
|
77
|
-
},
|
|
78
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StoryObj } from "@storybook/react-vite";
|
|
3
|
-
import { Mock } from "storybook/test";
|
|
4
|
-
declare const _default: {
|
|
5
|
-
title: string;
|
|
6
|
-
component: React.FC<import("./..").AutocompleteProps> & {
|
|
7
|
-
Item: typeof import("../Autocomplete").AutocompleteItem;
|
|
8
|
-
};
|
|
9
|
-
parameters: {
|
|
10
|
-
iframe: {
|
|
11
|
-
url: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
|
16
|
-
export declare const active: StoryObj<{
|
|
17
|
-
handleOpen: Mock;
|
|
18
|
-
handleClose: Mock;
|
|
19
|
-
}>;
|
|
20
|
-
export declare const base: StoryObj<{
|
|
21
|
-
handleInput: Mock;
|
|
22
|
-
handleItemSelect: Mock;
|
|
23
|
-
handleBackspace: Mock;
|
|
24
|
-
}>;
|
|
25
|
-
export declare const itemData: StoryObj<{
|
|
26
|
-
handleItemSelect: Mock;
|
|
27
|
-
}>;
|
|
28
|
-
export declare const itemDisabled: StoryObj;
|
|
29
|
-
export declare const multiselect: {
|
|
30
|
-
name: string;
|
|
31
|
-
render: () => React.JSX.Element;
|
|
32
|
-
};
|