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.
Files changed (191) hide show
  1. package/dist/bundle.css +1 -1
  2. package/dist/bundle.js +11 -11
  3. package/dist/components/Button/Button.module.css +1 -1
  4. package/dist/components/Card/Card.d.ts +1 -1
  5. package/dist/components/Divider/Divider.js +3 -3
  6. package/dist/components/Divider/Divider.module.css +1 -1
  7. package/dist/components/Divider/Divider.types.d.ts +6 -0
  8. package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
  9. package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +1 -1
  10. package/dist/components/Flyout/Flyout.constants.d.ts +1 -3
  11. package/dist/components/Flyout/Flyout.constants.js +1 -3
  12. package/dist/components/Flyout/Flyout.types.d.ts +2 -0
  13. package/dist/components/Flyout/FlyoutControlled.js +10 -11
  14. package/dist/components/Flyout/utilities/cooldown.js +1 -2
  15. package/dist/components/Icon/Icon.module.css +1 -1
  16. package/dist/components/Popover/Popover.types.d.ts +1 -1
  17. package/dist/components/Progress/Progress.module.css +1 -1
  18. package/dist/components/Select/Select.module.css +1 -1
  19. package/dist/components/Select/Select.types.d.ts +16 -11
  20. package/dist/components/Select/SelectCustomControlled.js +27 -10
  21. package/dist/components/Select/SelectGroup.d.ts +4 -0
  22. package/dist/components/Select/SelectGroup.js +10 -0
  23. package/dist/components/Select/SelectTrigger.js +1 -1
  24. package/dist/components/Select/index.d.ts +3 -2
  25. package/dist/components/Select/index.js +3 -2
  26. package/dist/components/Tabs/TabsContext.d.ts +1 -1
  27. package/dist/components/TextArea/TextArea.module.css +1 -1
  28. package/dist/components/TextArea/TextArea.types.d.ts +1 -1
  29. package/dist/components/TextField/TextField.module.css +1 -1
  30. package/dist/components/TextField/TextField.types.d.ts +1 -1
  31. package/dist/components/Tooltip/Tooltip.types.d.ts +1 -1
  32. package/dist/config/tailwind.d.ts +1 -1
  33. package/package.json +31 -30
  34. package/dist/components/Accordion/tests/Accordion.stories.d.ts +0 -44
  35. package/dist/components/Accordion/tests/Accordion.stories.js +0 -204
  36. package/dist/components/ActionBar/tests/ActionBar.stories.d.ts +0 -40
  37. package/dist/components/ActionBar/tests/ActionBar.stories.js +0 -223
  38. package/dist/components/Actionable/tests/Actionable.stories.d.ts +0 -41
  39. package/dist/components/Actionable/tests/Actionable.stories.js +0 -220
  40. package/dist/components/Alert/tests/Alert.stories.d.ts +0 -24
  41. package/dist/components/Alert/tests/Alert.stories.js +0 -78
  42. package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +0 -32
  43. package/dist/components/Autocomplete/tests/Autocomplete.stories.js +0 -246
  44. package/dist/components/Avatar/tests/Avatar.stories.d.ts +0 -31
  45. package/dist/components/Avatar/tests/Avatar.stories.js +0 -176
  46. package/dist/components/Badge/tests/Badge.stories.d.ts +0 -55
  47. package/dist/components/Badge/tests/Badge.stories.js +0 -328
  48. package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.d.ts +0 -40
  49. package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.js +0 -187
  50. package/dist/components/Button/tests/Button.stories.d.ts +0 -79
  51. package/dist/components/Button/tests/Button.stories.js +0 -789
  52. package/dist/components/Calendar/tests/Calendar.stories.d.ts +0 -29
  53. package/dist/components/Calendar/tests/Calendar.stories.js +0 -255
  54. package/dist/components/Card/tests/Card.stories.d.ts +0 -52
  55. package/dist/components/Card/tests/Card.stories.js +0 -125
  56. package/dist/components/Carousel/tests/Carousel.stories.d.ts +0 -34
  57. package/dist/components/Carousel/tests/Carousel.stories.js +0 -224
  58. package/dist/components/Checkbox/tests/Checkbox.stories.d.ts +0 -30
  59. package/dist/components/Checkbox/tests/Checkbox.stories.js +0 -171
  60. package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.d.ts +0 -19
  61. package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.js +0 -83
  62. package/dist/components/Container/tests/Container.stories.d.ts +0 -24
  63. package/dist/components/Container/tests/Container.stories.js +0 -75
  64. package/dist/components/ContextMenu/tests/ContextMenu.stories.d.ts +0 -26
  65. package/dist/components/ContextMenu/tests/ContextMenu.stories.js +0 -70
  66. package/dist/components/Dismissible/tests/Dismissible.stories.d.ts +0 -25
  67. package/dist/components/Dismissible/tests/Dismissible.stories.js +0 -97
  68. package/dist/components/Divider/tests/Divider.stories.d.ts +0 -18
  69. package/dist/components/Divider/tests/Divider.stories.js +0 -94
  70. package/dist/components/DropdownMenu/tests/DropdownMenu.stories.d.ts +0 -53
  71. package/dist/components/DropdownMenu/tests/DropdownMenu.stories.js +0 -278
  72. package/dist/components/FileUpload/tests/FileUpload.stories.d.ts +0 -31
  73. package/dist/components/FileUpload/tests/FileUpload.stories.js +0 -140
  74. package/dist/components/Flyout/tests/Flyout.stories.d.ts +0 -102
  75. package/dist/components/Flyout/tests/Flyout.stories.js +0 -708
  76. package/dist/components/FormControl/tests/FormControl.stories.d.ts +0 -31
  77. package/dist/components/FormControl/tests/FormControl.stories.js +0 -143
  78. package/dist/components/Grid/tests/Grid.stories.d.ts +0 -38
  79. package/dist/components/Grid/tests/Grid.stories.js +0 -245
  80. package/dist/components/Hidden/tests/Hidden.stories.d.ts +0 -16
  81. package/dist/components/Hidden/tests/Hidden.stories.js +0 -48
  82. package/dist/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +0 -16
  83. package/dist/components/HiddenVisually/tests/HiddenVisually.stories.js +0 -28
  84. package/dist/components/Hotkey/tests/Hotkey.stories.d.ts +0 -13
  85. package/dist/components/Hotkey/tests/Hotkey.stories.js +0 -53
  86. package/dist/components/Icon/tests/Icon.stories.d.ts +0 -25
  87. package/dist/components/Icon/tests/Icon.stories.js +0 -113
  88. package/dist/components/Image/tests/Image.stories.d.ts +0 -41
  89. package/dist/components/Image/tests/Image.stories.js +0 -196
  90. package/dist/components/Link/tests/Link.stories.d.ts +0 -42
  91. package/dist/components/Link/tests/Link.stories.js +0 -155
  92. package/dist/components/Loader/tests/Loader.stories.d.ts +0 -21
  93. package/dist/components/Loader/tests/Loader.stories.js +0 -68
  94. package/dist/components/MenuItem/tests/MenuItem.stories.d.ts +0 -59
  95. package/dist/components/MenuItem/tests/MenuItem.stories.js +0 -236
  96. package/dist/components/Modal/tests/Modal.stories.d.ts +0 -64
  97. package/dist/components/Modal/tests/Modal.stories.js +0 -410
  98. package/dist/components/NumberField/tests/NumberField.stories.d.ts +0 -28
  99. package/dist/components/NumberField/tests/NumberField.stories.js +0 -258
  100. package/dist/components/Overlay/tests/Overlay.stories.d.ts +0 -28
  101. package/dist/components/Overlay/tests/Overlay.stories.js +0 -202
  102. package/dist/components/Pagination/tests/Pagination.stories.d.ts +0 -24
  103. package/dist/components/Pagination/tests/Pagination.stories.js +0 -105
  104. package/dist/components/PinField/tests/PinField.stories.d.ts +0 -34
  105. package/dist/components/PinField/tests/PinField.stories.js +0 -209
  106. package/dist/components/Popover/tests/Popover.stories.d.ts +0 -69
  107. package/dist/components/Popover/tests/Popover.stories.js +0 -340
  108. package/dist/components/Progress/tests/Progress.stories.d.ts +0 -30
  109. package/dist/components/Progress/tests/Progress.stories.js +0 -102
  110. package/dist/components/ProgressIndicator/tests/ProgressIndicator.stories.d.ts +0 -19
  111. package/dist/components/ProgressIndicator/tests/ProgressIndicator.stories.js +0 -92
  112. package/dist/components/Radio/tests/Radio.stories.d.ts +0 -35
  113. package/dist/components/Radio/tests/Radio.stories.js +0 -162
  114. package/dist/components/RadioGroup/tests/RadioGroup.stories.d.ts +0 -19
  115. package/dist/components/RadioGroup/tests/RadioGroup.stories.js +0 -77
  116. package/dist/components/Reshaped/tests/Reshaped.stories.d.ts +0 -34
  117. package/dist/components/Reshaped/tests/Reshaped.stories.js +0 -108
  118. package/dist/components/Resizable/tests/Resizable.stories.d.ts +0 -38
  119. package/dist/components/Resizable/tests/Resizable.stories.js +0 -185
  120. package/dist/components/Scrim/tests/Scrim.stories.d.ts +0 -20
  121. package/dist/components/Scrim/tests/Scrim.stories.js +0 -67
  122. package/dist/components/ScrollArea/tests/ScrollArea.stories.d.ts +0 -37
  123. package/dist/components/ScrollArea/tests/ScrollArea.stories.js +0 -244
  124. package/dist/components/Select/SelectOptionGroup.d.ts +0 -4
  125. package/dist/components/Select/SelectOptionGroup.js +0 -9
  126. package/dist/components/Select/tests/Select.stories.d.ts +0 -47
  127. package/dist/components/Select/tests/Select.stories.js +0 -520
  128. package/dist/components/Skeleton/tests/Skeleton.stories.d.ts +0 -20
  129. package/dist/components/Skeleton/tests/Skeleton.stories.js +0 -63
  130. package/dist/components/Slider/tests/Slider.stories.d.ts +0 -47
  131. package/dist/components/Slider/tests/Slider.stories.js +0 -279
  132. package/dist/components/Stepper/tests/Stepper.stories.d.ts +0 -31
  133. package/dist/components/Stepper/tests/Stepper.stories.js +0 -135
  134. package/dist/components/Switch/tests/Switch.stories.d.ts +0 -22
  135. package/dist/components/Switch/tests/Switch.stories.js +0 -137
  136. package/dist/components/Switch/tests/Switch.test.stories.d.ts +0 -13
  137. package/dist/components/Switch/tests/Switch.test.stories.js +0 -11
  138. package/dist/components/Table/tests/Table.stories.d.ts +0 -42
  139. package/dist/components/Table/tests/Table.stories.js +0 -348
  140. package/dist/components/Tabs/tests/Tabs.stories.d.ts +0 -62
  141. package/dist/components/Tabs/tests/Tabs.stories.js +0 -539
  142. package/dist/components/Text/tests/Text.stories.d.ts +0 -48
  143. package/dist/components/Text/tests/Text.stories.js +0 -201
  144. package/dist/components/TextArea/tests/TextArea.stories.d.ts +0 -53
  145. package/dist/components/TextArea/tests/TextArea.stories.js +0 -200
  146. package/dist/components/TextField/tests/TextField.stories.d.ts +0 -53
  147. package/dist/components/TextField/tests/TextField.stories.js +0 -237
  148. package/dist/components/Theme/tests/Theme.stories.d.ts +0 -25
  149. package/dist/components/Theme/tests/Theme.stories.js +0 -171
  150. package/dist/components/Timeline/tests/Timeline.stories.d.ts +0 -22
  151. package/dist/components/Timeline/tests/Timeline.stories.js +0 -86
  152. package/dist/components/Toast/tests/Toast.stories.d.ts +0 -41
  153. package/dist/components/Toast/tests/Toast.stories.js +0 -432
  154. package/dist/components/ToggleButton/tests/ToggleButton.stories.d.ts +0 -27
  155. package/dist/components/ToggleButton/tests/ToggleButton.stories.js +0 -97
  156. package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.d.ts +0 -27
  157. package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.js +0 -169
  158. package/dist/components/Tooltip/tests/Tooltip.stories.d.ts +0 -28
  159. package/dist/components/Tooltip/tests/Tooltip.stories.js +0 -182
  160. package/dist/components/View/tests/View.stories.d.ts +0 -141
  161. package/dist/components/View/tests/View.stories.js +0 -1329
  162. package/dist/components/_private/Portal/tests/Portal.stories.d.ts +0 -6
  163. package/dist/components/_private/Portal/tests/Portal.stories.js +0 -17
  164. package/dist/hooks/tests/useDrag.stories.d.ts +0 -31
  165. package/dist/hooks/tests/useDrag.stories.js +0 -147
  166. package/dist/hooks/tests/useElementId.stories.d.ts +0 -11
  167. package/dist/hooks/tests/useElementId.stories.js +0 -23
  168. package/dist/hooks/tests/useHandlerRef.stories.d.ts +0 -14
  169. package/dist/hooks/tests/useHandlerRef.stories.js +0 -44
  170. package/dist/hooks/tests/useHotkeys.stories.d.ts +0 -43
  171. package/dist/hooks/tests/useHotkeys.stories.js +0 -158
  172. package/dist/hooks/tests/useKeyboardArrowNavigation.stories.d.ts +0 -15
  173. package/dist/hooks/tests/useKeyboardArrowNavigation.stories.js +0 -128
  174. package/dist/hooks/tests/useKeyboardMode.stories.d.ts +0 -11
  175. package/dist/hooks/tests/useKeyboardMode.stories.js +0 -42
  176. package/dist/hooks/tests/useOnClickOutside.stories.d.ts +0 -23
  177. package/dist/hooks/tests/useOnClickOutside.stories.js +0 -111
  178. package/dist/hooks/tests/useRTL.stories.d.ts +0 -11
  179. package/dist/hooks/tests/useRTL.stories.js +0 -23
  180. package/dist/hooks/tests/useResponsiveClientValue.stories.d.ts +0 -18
  181. package/dist/hooks/tests/useResponsiveClientValue.stories.js +0 -30
  182. package/dist/hooks/tests/useScrollLock.stories.d.ts +0 -14
  183. package/dist/hooks/tests/useScrollLock.stories.js +0 -97
  184. package/dist/hooks/tests/useToggle.stories.d.ts +0 -13
  185. package/dist/hooks/tests/useToggle.stories.js +0 -59
  186. package/dist/tests/ShadowDOM.stories.d.ts +0 -6
  187. package/dist/tests/ShadowDOM.stories.js +0 -110
  188. package/dist/tests/themes.stories.d.ts +0 -16
  189. package/dist/tests/themes.stories.js +0 -327
  190. package/dist/utilities/a11y/tests/TrapFocus.stories.d.ts +0 -14
  191. package/dist/utilities/a11y/tests/TrapFocus.stories.js +0 -615
@@ -1,38 +0,0 @@
1
- import { StoryObj } from "@storybook/react-vite";
2
- declare const _default: {
3
- title: string;
4
- component: import("react").FC<import("./..").ResizableProps> & {
5
- Item: typeof import("../Resizable").ResizableItem;
6
- Handle: import("react").FC<import("./..").ResizableHandleProps>;
7
- };
8
- parameters: {
9
- iframe: {
10
- url: string;
11
- };
12
- a11y: {
13
- disable: boolean;
14
- };
15
- };
16
- };
17
- export default _default;
18
- export declare const direction: {
19
- name: string;
20
- render: () => import("react").JSX.Element;
21
- };
22
- export declare const children: {
23
- name: string;
24
- render: () => import("react").JSX.Element;
25
- };
26
- export declare const variant: {
27
- name: string;
28
- render: () => import("react").JSX.Element;
29
- };
30
- export declare const size: {
31
- name: string;
32
- render: () => import("react").JSX.Element;
33
- };
34
- export declare const layout: {
35
- name: string;
36
- render: () => import("react").JSX.Element;
37
- };
38
- export declare const className: StoryObj;
@@ -1,185 +0,0 @@
1
- import { expect } from "storybook/test";
2
- import { Example } from "../../../utilities/storybook/index.js";
3
- import Resizable from "../index.js";
4
- import View from "../../View/index.js";
5
- import Button from "../../Button/index.js";
6
- export default {
7
- title: "Components/Resizable",
8
- component: Resizable,
9
- parameters: {
10
- iframe: {
11
- url: "https://reshaped.so/docs/utilities/resizable",
12
- },
13
- // Skip because of the aria-hidden applied to buttons, they're not needed for the screen reader navigation
14
- a11y: {
15
- disable: true,
16
- },
17
- },
18
- };
19
- const Panel = (props) => (<View backgroundColor="neutral-faded" borderRadius="medium" align="center" justify="center" height={props.height ?? "100%"}>
20
- Panel
21
- </View>);
22
- const Handle = () => {
23
- return (<Resizable.Handle>
24
- {(attributes, props) => (<View backgroundColor={props.status === "dragging" ? "primary" : "primary-faded"} padding={props.direction === "column" ? 1 : 8} height="100%" align="center" justify="center" borderRadius="small" animated>
25
- <Button attributes={attributes} type="button">
26
- Drag me
27
- </Button>
28
- </View>)}
29
- </Resizable.Handle>);
30
- };
31
- export const direction = {
32
- name: "direction",
33
- render: () => {
34
- return (<Example>
35
- <Example.Item title="row">
36
- <Resizable height="200px">
37
- <Resizable.Item>
38
- <Panel />
39
- </Resizable.Item>
40
- <Resizable.Handle />
41
- <Resizable.Item>
42
- <Panel />
43
- </Resizable.Item>
44
- <Resizable.Handle />
45
- <Resizable.Item>
46
- <Panel />
47
- </Resizable.Item>
48
- </Resizable>
49
- </Example.Item>
50
- <Example.Item title="column">
51
- <Resizable height="400px" direction="column">
52
- <Resizable.Item>
53
- <Panel />
54
- </Resizable.Item>
55
- <Resizable.Handle />
56
- <Resizable.Item>
57
- <Panel />
58
- </Resizable.Item>
59
- <Resizable.Handle />
60
- <Resizable.Item>
61
- <Panel />
62
- </Resizable.Item>
63
- </Resizable>
64
- </Example.Item>
65
-
66
- {/* Test that page doesn't scroll on dragging */}
67
- <div style={{ height: 2000 }}/>
68
- </Example>);
69
- },
70
- };
71
- export const children = {
72
- name: "children",
73
- render: () => {
74
- return (<Example>
75
- <Example.Item title="render props, row">
76
- <Resizable height="200px">
77
- <Resizable.Item>
78
- <Panel />
79
- </Resizable.Item>
80
- <Resizable.Handle />
81
- <Resizable.Item>
82
- <Panel />
83
- </Resizable.Item>
84
- <Handle />
85
- <Resizable.Item>
86
- <Panel />
87
- </Resizable.Item>
88
- </Resizable>
89
- </Example.Item>
90
- <Example.Item title="render props, column">
91
- <Resizable height="400px" direction="column">
92
- <Resizable.Item>
93
- <Panel />
94
- </Resizable.Item>
95
- <Resizable.Handle />
96
- <Resizable.Item>
97
- <Panel />
98
- </Resizable.Item>
99
- <Handle />
100
- <Resizable.Item>
101
- <Panel />
102
- </Resizable.Item>
103
- </Resizable>
104
- </Example.Item>
105
- </Example>);
106
- },
107
- };
108
- export const variant = {
109
- name: "variant",
110
- render: () => (<Example>
111
- <Example.Item title="bordered, row">
112
- <Resizable height="200px" variant="bordered">
113
- <Resizable.Item>
114
- <Panel />
115
- </Resizable.Item>
116
- <Resizable.Handle />
117
- <Resizable.Item>
118
- <Panel />
119
- </Resizable.Item>
120
- <Resizable.Handle />
121
- <Resizable.Item>
122
- <Panel />
123
- </Resizable.Item>
124
- </Resizable>
125
- </Example.Item>
126
- <Example.Item title="bordered, column">
127
- <Resizable height="400px" direction="column" variant="bordered">
128
- <Resizable.Item>
129
- <Panel />
130
- </Resizable.Item>
131
- <Resizable.Handle />
132
- <Resizable.Item>
133
- <Panel />
134
- </Resizable.Item>
135
- <Resizable.Handle />
136
- <Resizable.Item>
137
- <Panel />
138
- </Resizable.Item>
139
- </Resizable>
140
- </Example.Item>
141
- </Example>),
142
- };
143
- export const size = {
144
- name: "minSize, maxSize, defaultSize",
145
- render: () => (<Resizable className="test-classname" attributes={{ id: "test-id" }} height="200px">
146
- <Resizable.Item>
147
- <Panel />
148
- </Resizable.Item>
149
- <Resizable.Handle />
150
- <Resizable.Item minSize="200px" maxSize="500px" defaultSize="300px">
151
- <Panel />
152
- </Resizable.Item>
153
- </Resizable>),
154
- };
155
- export const layout = {
156
- name: "height, gap",
157
- render: () => (<Resizable height="100px" gap={8}>
158
- <Resizable.Item>
159
- <Panel />
160
- </Resizable.Item>
161
- <Resizable.Handle />
162
- <Resizable.Item>
163
- <Panel />
164
- </Resizable.Item>
165
- </Resizable>),
166
- };
167
- export const className = {
168
- name: "className, attributes",
169
- render: () => (<div data-testid="root">
170
- <Resizable className="test-classname" attributes={{ id: "test-id" }} height="200px">
171
- <Resizable.Item>
172
- <Panel />
173
- </Resizable.Item>
174
- <Resizable.Handle />
175
- <Resizable.Item>
176
- <Panel />
177
- </Resizable.Item>
178
- </Resizable>
179
- </div>),
180
- play: async ({ canvas }) => {
181
- const root = canvas.getByTestId("root").firstChild;
182
- expect(root).toHaveClass("test-classname");
183
- expect(root).toHaveAttribute("id", "test-id");
184
- },
185
- };
@@ -1,20 +0,0 @@
1
- import { StoryObj } from "@storybook/react-vite";
2
- declare const _default: {
3
- title: string;
4
- component: import("react").FC<import("./..").ScrimProps>;
5
- parameters: {
6
- iframe: {
7
- url: string;
8
- };
9
- };
10
- };
11
- export default _default;
12
- export declare const position: {
13
- name: string;
14
- render: () => import("react").JSX.Element;
15
- };
16
- export declare const className: StoryObj;
17
- export declare const composition: {
18
- name: string;
19
- render: () => import("react").JSX.Element;
20
- };
@@ -1,67 +0,0 @@
1
- import { Example, Placeholder } from "../../../utilities/storybook/index.js";
2
- import Scrim from "../index.js";
3
- import { expect } from "storybook/test";
4
- export default {
5
- title: "Components/Scrim",
6
- component: Scrim,
7
- parameters: {
8
- iframe: {
9
- url: "https://reshaped.so/docs/components/scrim",
10
- },
11
- },
12
- };
13
- export const position = {
14
- name: "position",
15
- render: () => (<Example>
16
- <Example.Item title="position: center">
17
- <Scrim backgroundSlot={<Placeholder h={200}/>}>Scrim</Scrim>
18
- </Example.Item>
19
-
20
- <Example.Item title="position: bottom">
21
- <Scrim position="bottom" backgroundSlot={<Placeholder h={200}/>}>
22
- Scrim
23
- </Scrim>
24
- </Example.Item>
25
-
26
- <Example.Item title="position: top">
27
- <Scrim position="top" backgroundSlot={<Placeholder h={200}/>}>
28
- Scrim
29
- </Scrim>
30
- </Example.Item>
31
-
32
- <Example.Item title="position: start">
33
- <Scrim position="start" backgroundSlot={<Placeholder h={200}/>}>
34
- Scrim
35
- </Scrim>
36
- </Example.Item>
37
-
38
- <Example.Item title="position: end">
39
- <Scrim position="end" backgroundSlot={<Placeholder h={200}/>}>
40
- Scrim
41
- </Scrim>
42
- </Example.Item>
43
- </Example>),
44
- };
45
- export const className = {
46
- name: "className, attributes",
47
- render: () => (<div data-testid="root">
48
- <Scrim className="test-classname" attributes={{ id: "test-id" }}>
49
- Content
50
- </Scrim>
51
- </div>),
52
- play: async ({ canvas }) => {
53
- const root = canvas.getByTestId("root").firstChild;
54
- expect(root).toHaveClass("test-classname");
55
- expect(root).toHaveAttribute("id", "test-id");
56
- },
57
- };
58
- export const composition = {
59
- name: "test: composition",
60
- render: () => (<Example>
61
- <Example.Item title="without backgroundSlot, size is based on the parent component">
62
- <div style={{ height: 300, position: "relative" }}>
63
- <Scrim>Text</Scrim>
64
- </div>
65
- </Example.Item>
66
- </Example>),
67
- };
@@ -1,37 +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.ForwardRefExoticComponent<import("./..").ScrollAreaProps & React.RefAttributes<HTMLDivElement>>;
7
- parameters: {
8
- iframe: {
9
- url: string;
10
- };
11
- a11y: {
12
- disable: boolean;
13
- };
14
- };
15
- };
16
- export default _default;
17
- export declare const base: {
18
- name: string;
19
- render: () => React.JSX.Element;
20
- };
21
- export declare const scrollbarDisplay: {
22
- name: string;
23
- render: () => React.JSX.Element;
24
- };
25
- export declare const height: {
26
- name: string;
27
- render: () => React.JSX.Element;
28
- };
29
- export declare const onScroll: StoryObj<{
30
- handleScroll: Mock;
31
- }>;
32
- export declare const className: StoryObj;
33
- export declare const testNested: {
34
- name: string;
35
- render: () => React.JSX.Element;
36
- };
37
- export declare const testDynamicHeight: StoryObj;
@@ -1,244 +0,0 @@
1
- import React from "react";
2
- import { userEvent, expect, waitFor, fn } from "storybook/test";
3
- import { Example } from "../../../utilities/storybook/index.js";
4
- import ScrollArea from "../index.js";
5
- import View from "../../View/index.js";
6
- import Button from "../../Button/index.js";
7
- export default {
8
- title: "Utility components/ScrollArea",
9
- component: ScrollArea,
10
- parameters: {
11
- iframe: {
12
- url: "https://reshaped.so/docs/utilities/scroll-area",
13
- },
14
- // Skip because axe core incorrectly reports contrast issues
15
- a11y: {
16
- disable: true,
17
- },
18
- },
19
- };
20
- export const base = {
21
- name: "base",
22
- render: () => (<Example>
23
- <Example.Item title="vertical scroll">
24
- <ScrollArea height="100px" scrollbarDisplay="visible">
25
- <View backgroundColor="elevation-base" padding={4}>
26
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
27
- has been the industry's standard dummy text ever since the 1500s, when an unknown
28
- printer took a galley of type and scrambled it to make a type specimen book. It has
29
- survived not only five centuries, but also the leap into electronic typesetting,
30
- remaining essentially unchanged. It was popularised in the 1960s with the release of
31
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
32
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
33
- </View>
34
- </ScrollArea>
35
- </Example.Item>
36
-
37
- <Example.Item title="horizontal scroll">
38
- <ScrollArea height="100px" scrollbarDisplay="visible">
39
- <View backgroundColor="elevation-base" padding={4} width="150%" height="100px">
40
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
41
- has been the industry's standard dummy text ever since the 1500s
42
- </View>
43
- </ScrollArea>
44
- </Example.Item>
45
-
46
- <Example.Item title="horizontal and vertical scroll">
47
- <ScrollArea height="100px" scrollbarDisplay="visible">
48
- <View backgroundColor="elevation-base" padding={4} width="150%">
49
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
50
- has been the industry's standard dummy text ever since the 1500s, when an unknown
51
- printer took a galley of type and scrambled it to make a type specimen book. It has
52
- survived not only five centuries, but also the leap into electronic typesetting,
53
- remaining essentially unchanged. It was popularised in the 1960s with the release of
54
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
55
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
56
- </View>
57
- </ScrollArea>
58
- </Example.Item>
59
- </Example>),
60
- };
61
- export const scrollbarDisplay = {
62
- name: "scrollbarDisplay",
63
- render: () => (<Example>
64
- <Example.Item title="scrollbarDisplay: hover">
65
- <ScrollArea height="100px">
66
- <View backgroundColor="elevation-base" padding={4} width="150%">
67
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
68
- has been the industry's standard dummy text ever since the 1500s, when an unknown
69
- printer took a galley of type and scrambled it to make a type specimen book. It has
70
- survived not only five centuries, but also the leap into electronic typesetting,
71
- remaining essentially unchanged. It was popularised in the 1960s with the release of
72
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
73
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
74
- </View>
75
- </ScrollArea>
76
- </Example.Item>
77
-
78
- <Example.Item title="scrollbarDisplay: hidden">
79
- <ScrollArea height="100px" scrollbarDisplay="hidden">
80
- <View backgroundColor="elevation-base" padding={4} width="150%">
81
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
82
- has been the industry's standard dummy text ever since the 1500s, when an unknown
83
- printer took a galley of type and scrambled it to make a type specimen book. It has
84
- survived not only five centuries, but also the leap into electronic typesetting,
85
- remaining essentially unchanged. It was popularised in the 1960s with the release of
86
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
87
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
88
- </View>
89
- </ScrollArea>
90
- </Example.Item>
91
-
92
- <Example.Item title="scrollbarDisplay: visible">
93
- <ScrollArea height="100px" scrollbarDisplay="visible">
94
- <View backgroundColor="elevation-base" padding={4} width="150%">
95
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
96
- has been the industry's standard dummy text ever since the 1500s, when an unknown
97
- printer took a galley of type and scrambled it to make a type specimen book. It has
98
- survived not only five centuries, but also the leap into electronic typesetting,
99
- remaining essentially unchanged. It was popularised in the 1960s with the release of
100
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
101
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
102
- </View>
103
- </ScrollArea>
104
- </Example.Item>
105
- </Example>),
106
- };
107
- export const height = {
108
- name: "height, maxHeight",
109
- render: () => (<Example>
110
- <Example.Item title="height: 80px">
111
- <ScrollArea height="80px">
112
- <View backgroundColor="elevation-base" padding={4}>
113
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
114
- has been the industry's standard dummy text ever since the 1500s, when an unknown
115
- printer took a galley of type and scrambled it to make a type specimen book. It has
116
- survived not only five centuries, but also the leap into electronic typesetting,
117
- remaining essentially unchanged. It was popularised in the 1960s with the release of
118
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
119
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
120
- </View>
121
- </ScrollArea>
122
- </Example.Item>
123
-
124
- <Example.Item title="responsive height: s 80px, m: 120px">
125
- <ScrollArea height={{ s: "80px", m: "120px" }}>
126
- <View backgroundColor="elevation-base" padding={4}>
127
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
128
- has been the industry's standard dummy text ever since the 1500s, when an unknown
129
- printer took a galley of type and scrambled it to make a type specimen book. It has
130
- survived not only five centuries, but also the leap into electronic typesetting,
131
- remaining essentially unchanged. It was popularised in the 1960s with the release of
132
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
133
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
134
- </View>
135
- </ScrollArea>
136
- </Example.Item>
137
-
138
- <Example.Item title="maxHeight: 80px">
139
- <ScrollArea maxHeight="80px">
140
- <View backgroundColor="elevation-base" padding={4}>
141
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
142
- has been the industry's standard dummy text ever since the 1500s, when an unknown
143
- printer took a galley of type and scrambled it to make a type specimen book. It has
144
- survived not only five centuries, but also the leap into electronic typesetting,
145
- remaining essentially unchanged. It was popularised in the 1960s with the release of
146
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
147
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
148
- </View>
149
- </ScrollArea>
150
- </Example.Item>
151
-
152
- <Example.Item title="responsive max height: s 80px, m: 200px">
153
- <ScrollArea maxHeight={{ s: "80px", m: "200px" }}>
154
- <View backgroundColor="elevation-base" padding={4}>
155
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
156
- has been the industry's standard dummy text ever since the 1500s, when an unknown
157
- printer took a galley of type and scrambled it to make a type specimen book. It has
158
- survived not only five centuries, but also the leap into electronic typesetting,
159
- remaining essentially unchanged. It was popularised in the 1960s with the release of
160
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
161
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
162
- </View>
163
- </ScrollArea>
164
- </Example.Item>
165
- </Example>),
166
- };
167
- export const onScroll = {
168
- name: "ref, onScroll",
169
- args: {
170
- handleScroll: fn(),
171
- },
172
- render: (args) => {
173
- const ref = React.useRef(null);
174
- return (<View gap={4}>
175
- <View.Item>
176
- <Button onClick={() => ref.current?.scrollBy({ top: 50, left: 50 })}>Scroll</Button>
177
- </View.Item>
178
- <ScrollArea height="100px" ref={ref} scrollbarDisplay="visible" onScroll={args.handleScroll}>
179
- <View backgroundColor="neutral-faded" padding={4} width="1000px" height="200px">
180
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
181
- has been the industry's standard dummy text ever since the 1500s, when an unknown
182
- printer took a galley of type and scrambled it to make a type specimen book. It has
183
- survived not only five centuries, but also the leap into electronic typesetting,
184
- remaining essentially unchanged. It was popularised in the 1960s with the release of
185
- Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
186
- publishing software like Aldus PageMaker including versions of Lorem Ipsum.
187
- </View>
188
- </ScrollArea>
189
- </View>);
190
- },
191
- play: async ({ canvas, args }) => {
192
- const trigger = canvas.getAllByRole("button")[0];
193
- await userEvent.click(trigger);
194
- await waitFor(() => {
195
- expect(args.handleScroll).toHaveBeenCalledTimes(1);
196
- // x value is flaky, so only testing y here
197
- expect(args.handleScroll).toHaveBeenCalledWith(expect.objectContaining({ y: 0.5 }));
198
- });
199
- },
200
- };
201
- export const className = {
202
- name: "className, attributes",
203
- render: () => (<div data-testid="root">
204
- <ScrollArea className="test-classname" attributes={{ id: "test-id" }}>
205
- Content
206
- </ScrollArea>
207
- </div>),
208
- play: async ({ canvas }) => {
209
- const root = canvas.getByTestId("root").firstChild;
210
- expect(root).toHaveClass("test-classname");
211
- expect(root).toHaveAttribute("id", "test-id");
212
- },
213
- };
214
- export const testNested = {
215
- name: "test: nested",
216
- render: () => (<ScrollArea height="100px" scrollbarDisplay="visible">
217
- <View padding={4} paddingInline={16}>
218
- <ScrollArea height="200px" scrollbarDisplay="visible">
219
- {Array(20)
220
- .fill("")
221
- .map((_, index) => {
222
- return <div key={index}>Item {index + 1}</div>;
223
- })}
224
- </ScrollArea>
225
- </View>
226
- </ScrollArea>),
227
- };
228
- export const testDynamicHeight = {
229
- name: "test: dynamic height change",
230
- render: () => {
231
- const [count, setCount] = React.useState(10);
232
- return (<View gap={4}>
233
- <View.Item>
234
- <Button onClick={() => setCount((prev) => prev + 10)}>Add more items</Button>
235
- </View.Item>
236
-
237
- <ScrollArea height="200px" scrollbarDisplay="visible">
238
- <View gap={2}>
239
- {new Array(count).fill("").map((_, i) => (<View.Item key={i}>Item {i + 1}</View.Item>))}
240
- </View>
241
- </ScrollArea>
242
- </View>);
243
- },
244
- };
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import type * as T from "./Select.types";
3
- declare const SelectOptionGroup: React.FC<T.OptionGroupProps>;
4
- export default SelectOptionGroup;
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import View from "../View/index.js";
3
- import Text from "../Text/index.js";
4
- const SelectOptionGroup = (props) => {
5
- const { label, children } = props;
6
- return (_jsxs(View, { attributes: { role: "group" }, gap: 1, children: [_jsx(View, { paddingInline: 3, paddingTop: 3, children: _jsx(Text, { variant: "caption-1", color: "neutral-faded", children: label }) }), _jsx(View.Item, { children: children })] }));
7
- };
8
- SelectOptionGroup.displayName = "Select.OptionGroup";
9
- export default SelectOptionGroup;
@@ -1,47 +0,0 @@
1
- import React from "react";
2
- import { Mock } from "storybook/test";
3
- import { StoryObj } from "@storybook/react-vite";
4
- declare const _default: {
5
- title: string;
6
- component: React.FC<import("../Select.types").NativeProps> & {
7
- Custom: React.FC<import("../Select.types").CustomProps>;
8
- Option: React.FC<import("../Select.types").OptionProps>;
9
- OptionGroup: React.FC<import("../Select.types").OptionGroupProps>;
10
- };
11
- parameters: {
12
- iframe: {
13
- url: string;
14
- };
15
- };
16
- };
17
- export default _default;
18
- export declare const nativeRender: StoryObj;
19
- export declare const customRender: StoryObj;
20
- export declare const nativeHandlers: StoryObj<{
21
- handleChange: Mock;
22
- handleControlledChange: Mock;
23
- handleFocus: Mock;
24
- handleBlur: Mock;
25
- handleClick: Mock;
26
- }>;
27
- export declare const customHandlers: StoryObj<{
28
- handleChange: Mock;
29
- handleControlledChange: Mock;
30
- handleFocus: Mock;
31
- handleBlur: Mock;
32
- handleClick: Mock;
33
- }>;
34
- export declare const triggerOnly: StoryObj<{
35
- handleClick: Mock;
36
- }>;
37
- export declare const multiple: StoryObj<{
38
- handleChange: Mock;
39
- }>;
40
- export declare const variant: StoryObj;
41
- export declare const size: StoryObj;
42
- export declare const startSlot: StoryObj;
43
- export declare const error: StoryObj;
44
- export declare const disabled: StoryObj;
45
- export declare const className: StoryObj;
46
- export declare const fallback: StoryObj;
47
- export declare const formControl: StoryObj;