reshaped 3.3.10 → 3.3.12

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 (284) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/bundle.css +1 -1
  3. package/dist/bundle.js +10 -10
  4. package/dist/cjs/themes/_generator/utilities/generateColors.d.ts +1 -1
  5. package/dist/cjs/themes/_generator/utilities/generateColors.js +3 -2
  6. package/dist/cjs/themes/_generator/utilities/tests/color.test.js +32 -31
  7. package/dist/cjs/themes/slate/theme.css +1 -1
  8. package/dist/components/Accordion/tests/Accordion.stories.d.ts +30 -8
  9. package/dist/components/Accordion/tests/Accordion.stories.js +172 -119
  10. package/dist/components/ActionBar/tests/ActionBar.stories.d.ts +12 -3
  11. package/dist/components/ActionBar/tests/ActionBar.stories.js +51 -36
  12. package/dist/components/ActionBar/tests/ActionBar.test.stories.d.ts +15 -0
  13. package/dist/components/ActionBar/tests/ActionBar.test.stories.js +26 -0
  14. package/dist/components/Actionable/Actionable.js +1 -1
  15. package/dist/components/Actionable/Actionable.types.d.ts +3 -3
  16. package/dist/components/Actionable/tests/Actionable.stories.d.ts +19 -5
  17. package/dist/components/Actionable/tests/Actionable.stories.js +88 -63
  18. package/dist/components/Actionable/tests/Actionable.test.stories.d.ts +32 -0
  19. package/dist/components/Actionable/tests/Actionable.test.stories.js +130 -0
  20. package/dist/components/Alert/Alert.js +1 -1
  21. package/dist/components/Alert/tests/Alert.stories.d.ts +12 -3
  22. package/dist/components/Alert/tests/Alert.stories.js +51 -86
  23. package/dist/components/Alert/tests/Alert.test.stories.d.ts +15 -0
  24. package/dist/components/Alert/tests/Alert.test.stories.js +26 -0
  25. package/dist/components/Autocomplete/Autocomplete.js +9 -2
  26. package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +6 -2
  27. package/dist/components/Autocomplete/tests/Autocomplete.stories.js +94 -111
  28. package/dist/components/Autocomplete/tests/Autocomplete.test.stories.d.ts +23 -0
  29. package/dist/components/Autocomplete/tests/Autocomplete.test.stories.js +86 -0
  30. package/dist/components/Avatar/Avatar.js +1 -1
  31. package/dist/components/Avatar/tests/Avatar.stories.d.ts +14 -4
  32. package/dist/components/Avatar/tests/Avatar.stories.js +94 -80
  33. package/dist/components/Avatar/tests/Avatar.test.stories.d.ts +17 -0
  34. package/dist/components/Avatar/tests/Avatar.test.stories.js +39 -0
  35. package/dist/components/Badge/tests/Badge.stories.d.ts +33 -8
  36. package/dist/components/Badge/tests/Badge.stories.js +238 -212
  37. package/dist/components/Badge/tests/Badge.test.stories.d.ts +20 -0
  38. package/dist/components/Badge/tests/Badge.test.stories.js +44 -0
  39. package/dist/components/Breadcrumbs/Breadcrumbs.js +2 -2
  40. package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +1 -0
  41. package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.d.ts +24 -5
  42. package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.js +114 -95
  43. package/dist/components/Breadcrumbs/tests/Breadcrumbs.test.stories.d.ts +23 -0
  44. package/dist/components/Breadcrumbs/tests/Breadcrumbs.test.stories.js +76 -0
  45. package/dist/components/Button/Button.js +5 -2
  46. package/dist/components/Button/Button.module.css +1 -1
  47. package/dist/components/Button/Button.types.d.ts +1 -0
  48. package/dist/components/Button/tests/Button.stories.d.ts +2 -2
  49. package/dist/components/Button/tests/Button.stories.js +77 -74
  50. package/dist/components/Button/tests/Button.test.stories.d.ts +27 -0
  51. package/dist/components/Button/tests/Button.test.stories.js +112 -0
  52. package/dist/components/Calendar/tests/Calendar.test.stories.d.ts +26 -0
  53. package/dist/components/Calendar/tests/Calendar.test.stories.js +161 -0
  54. package/dist/components/Card/Card.d.ts +3 -3
  55. package/dist/components/Card/Card.types.d.ts +1 -1
  56. package/dist/components/Card/tests/Card.stories.d.ts +3 -4
  57. package/dist/components/Card/tests/Card.stories.js +0 -11
  58. package/dist/components/Card/tests/Card.test.stories.d.ts +35 -0
  59. package/dist/components/Card/tests/Card.test.stories.js +54 -0
  60. package/dist/components/Carousel/Carousel.types.d.ts +1 -1
  61. package/dist/components/Carousel/CarouselControl.js +1 -1
  62. package/dist/components/Carousel/tests/Carousel.stories.d.ts +3 -0
  63. package/dist/components/Carousel/tests/Carousel.stories.js +5 -1
  64. package/dist/components/Carousel/tests/Carousel.test.stories.d.ts +17 -0
  65. package/dist/components/Carousel/tests/Carousel.test.stories.js +52 -0
  66. package/dist/components/Checkbox/tests/Checkbox.test.stories.d.ts +25 -0
  67. package/dist/components/Checkbox/tests/Checkbox.test.stories.js +104 -0
  68. package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.d.ts +22 -0
  69. package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.js +78 -0
  70. package/dist/components/Container/Container.module.css +1 -1
  71. package/dist/components/Container/tests/Container.stories.d.ts +12 -3
  72. package/dist/components/Container/tests/Container.stories.js +50 -31
  73. package/dist/components/Container/tests/Container.test.stories.d.ts +15 -0
  74. package/dist/components/Container/tests/Container.test.stories.js +26 -0
  75. package/dist/components/ContextMenu/ContextMenu.js +13 -9
  76. package/dist/components/ContextMenu/tests/ContextMenu.stories.js +2 -3
  77. package/dist/components/ContextMenu/tests/ContextMenu.test.stories.d.ts +26 -0
  78. package/dist/components/ContextMenu/tests/ContextMenu.test.stories.js +53 -0
  79. package/dist/components/Dismissible/Dismissible.js +1 -1
  80. package/dist/components/Dismissible/tests/Dismissible.stories.d.ts +10 -3
  81. package/dist/components/Dismissible/tests/Dismissible.stories.js +51 -34
  82. package/dist/components/Dismissible/tests/Dismissible.test.stories.d.ts +19 -0
  83. package/dist/components/Dismissible/tests/Dismissible.test.stories.js +42 -0
  84. package/dist/components/Divider/tests/Divider.test.stories.d.ts +18 -0
  85. package/dist/components/Divider/tests/Divider.test.stories.js +47 -0
  86. package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
  87. package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.d.ts +37 -0
  88. package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.js +117 -0
  89. package/dist/components/FileUpload/tests/FileUpload.test.stories.d.ts +22 -0
  90. package/dist/components/FileUpload/tests/FileUpload.test.stories.js +52 -0
  91. package/dist/components/FormControl/FormControl.context.d.ts +12 -0
  92. package/dist/components/FormControl/FormControlCaption.js +1 -1
  93. package/dist/components/FormControl/FormControlLabel.js +1 -1
  94. package/dist/components/FormControl/tests/FormControl.stories.d.ts +11 -5
  95. package/dist/components/FormControl/tests/FormControl.stories.js +78 -73
  96. package/dist/components/FormControl/tests/FormControl.test.stories.d.ts +20 -0
  97. package/dist/components/FormControl/tests/FormControl.test.stories.js +49 -0
  98. package/dist/components/Grid/Grid.d.ts +2 -2
  99. package/dist/components/Grid/Grid.types.d.ts +3 -2
  100. package/dist/components/Grid/tests/Grid.stories.d.ts +22 -7
  101. package/dist/components/Grid/tests/Grid.stories.js +164 -149
  102. package/dist/components/Grid/tests/Grid.test.stories.d.ts +19 -0
  103. package/dist/components/Grid/tests/Grid.test.stories.js +42 -0
  104. package/dist/components/Hidden/Hidden.types.d.ts +1 -1
  105. package/dist/components/Hidden/tests/Hidden.stories.d.ts +4 -1
  106. package/dist/components/Hidden/tests/Hidden.stories.js +28 -25
  107. package/dist/components/Hidden/tests/Hidden.test.stories.d.ts +15 -0
  108. package/dist/components/Hidden/tests/Hidden.test.stories.js +20 -0
  109. package/dist/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +4 -1
  110. package/dist/components/HiddenVisually/tests/HiddenVisually.stories.js +8 -5
  111. package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.d.ts +15 -0
  112. package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.js +20 -0
  113. package/dist/components/Hotkey/tests/Hotkey.test.stories.d.ts +15 -0
  114. package/dist/components/Hotkey/tests/Hotkey.test.stories.js +26 -0
  115. package/dist/components/Icon/tests/Icon.stories.d.ts +12 -3
  116. package/dist/components/Icon/tests/Icon.stories.js +69 -60
  117. package/dist/components/Icon/tests/Icon.test.stories.d.ts +16 -0
  118. package/dist/components/Icon/tests/Icon.test.stories.js +35 -0
  119. package/dist/components/Image/tests/Image.stories.d.ts +24 -5
  120. package/dist/components/Image/tests/Image.stories.js +95 -75
  121. package/dist/components/Image/tests/Image.test.stories.d.ts +25 -0
  122. package/dist/components/Image/tests/Image.test.stories.js +80 -0
  123. package/dist/components/Link/tests/Link.test.stories.d.ts +29 -0
  124. package/dist/components/Link/tests/Link.test.stories.js +87 -0
  125. package/dist/components/Loader/Loader.js +1 -1
  126. package/dist/components/Loader/Loader.types.d.ts +1 -0
  127. package/dist/components/Loader/tests/Loader.stories.js +8 -8
  128. package/dist/components/Loader/tests/Loader.test.stories.d.ts +16 -0
  129. package/dist/components/Loader/tests/Loader.test.stories.js +32 -0
  130. package/dist/components/MenuItem/tests/MenuItem.test.stories.d.ts +26 -0
  131. package/dist/components/MenuItem/tests/MenuItem.test.stories.js +100 -0
  132. package/dist/components/Modal/Modal.types.d.ts +1 -1
  133. package/dist/components/Modal/tests/Modal.test.stories.d.ts +32 -0
  134. package/dist/components/Modal/tests/Modal.test.stories.js +149 -0
  135. package/dist/components/Overlay/Overlay.types.d.ts +1 -1
  136. package/dist/components/Overlay/tests/Overlay.stories.d.ts +4 -2
  137. package/dist/components/Overlay/tests/Overlay.stories.js +53 -53
  138. package/dist/components/Overlay/tests/Overlay.test.stories.d.ts +28 -0
  139. package/dist/components/Overlay/tests/Overlay.test.stories.js +146 -0
  140. package/dist/components/Pagination/tests/Pagination.test.stories.d.ts +23 -0
  141. package/dist/components/Pagination/tests/Pagination.test.stories.js +86 -0
  142. package/dist/components/PinField/tests/PinField.stories.d.ts +0 -1
  143. package/dist/components/PinField/tests/PinField.stories.js +10 -19
  144. package/dist/components/PinField/tests/PinField.test.stories.d.ts +29 -0
  145. package/dist/components/PinField/tests/PinField.test.stories.js +177 -0
  146. package/dist/components/Popover/tests/Popover.test.stories.d.ts +40 -0
  147. package/dist/components/Popover/tests/Popover.test.stories.js +167 -0
  148. package/dist/components/Progress/Progress.js +2 -2
  149. package/dist/components/Progress/Progress.types.d.ts +1 -0
  150. package/dist/components/Progress/tests/Progress.stories.js +10 -10
  151. package/dist/components/Progress/tests/Progress.test.stories.d.ts +16 -0
  152. package/dist/components/Progress/tests/Progress.test.stories.js +35 -0
  153. package/dist/components/Radio/tests/Radio.test.stories.d.ts +30 -0
  154. package/dist/components/Radio/tests/Radio.test.stories.js +118 -0
  155. package/dist/components/RadioGroup/tests/RadioGroup.test.stories.d.ts +22 -0
  156. package/dist/components/RadioGroup/tests/RadioGroup.test.stories.js +78 -0
  157. package/dist/components/Reshaped/tests/Reshaped.stories.d.ts +33 -0
  158. package/dist/components/Reshaped/tests/Reshaped.stories.js +88 -0
  159. package/dist/components/Resizable/Resizable.js +4 -1
  160. package/dist/components/Resizable/Resizable.types.d.ts +2 -2
  161. package/dist/components/Resizable/tests/Resizable.stories.d.ts +3 -0
  162. package/dist/components/Resizable/tests/Resizable.stories.js +4 -0
  163. package/dist/components/Resizable/tests/Resizable.test.stories.d.ts +19 -0
  164. package/dist/components/Resizable/tests/Resizable.test.stories.js +25 -0
  165. package/dist/components/Scrim/tests/Scrim.test.stories.d.ts +15 -0
  166. package/dist/components/Scrim/tests/Scrim.test.stories.js +25 -0
  167. package/dist/components/ScrollArea/ScrollArea.js +1 -1
  168. package/dist/components/ScrollArea/ScrollArea.module.css +1 -1
  169. package/dist/components/ScrollArea/tests/ScrollArea.stories.d.ts +17 -4
  170. package/dist/components/ScrollArea/tests/ScrollArea.stories.js +114 -139
  171. package/dist/components/ScrollArea/tests/ScrollArea.test.stories.d.ts +23 -0
  172. package/dist/components/ScrollArea/tests/ScrollArea.test.stories.js +66 -0
  173. package/dist/components/Select/tests/Select.stories.d.ts +1 -1
  174. package/dist/components/Select/tests/Select.stories.js +5 -12
  175. package/dist/components/Select/tests/Select.test.stories.d.ts +27 -0
  176. package/dist/components/Select/tests/Select.test.stories.js +132 -0
  177. package/dist/components/Skeleton/tests/Skeleton.test.stories.d.ts +15 -0
  178. package/dist/components/Skeleton/tests/Skeleton.test.stories.js +23 -0
  179. package/dist/components/Slider/Slider.types.d.ts +1 -1
  180. package/dist/components/Slider/tests/Slider.stories.d.ts +0 -1
  181. package/dist/components/Slider/tests/Slider.stories.js +8 -9
  182. package/dist/components/Slider/tests/Slider.test.stories.d.ts +38 -0
  183. package/dist/components/Slider/tests/Slider.test.stories.js +150 -0
  184. package/dist/components/Stepper/Stepper.js +1 -1
  185. package/dist/components/Stepper/tests/Stepper.stories.js +0 -3
  186. package/dist/components/Stepper/tests/Stepper.test.stories.d.ts +18 -0
  187. package/dist/components/Stepper/tests/Stepper.test.stories.js +28 -0
  188. package/dist/components/Switch/tests/Switch.test.stories.d.ts +23 -0
  189. package/dist/components/Switch/tests/Switch.test.stories.js +79 -0
  190. package/dist/components/Table/tests/Table.test.stories.d.ts +25 -0
  191. package/dist/components/Table/tests/Table.test.stories.js +93 -0
  192. package/dist/components/Tabs/Tabs.types.d.ts +3 -3
  193. package/dist/components/Tabs/TabsContext.d.ts +3 -3
  194. package/dist/components/Tabs/TabsItem.js +1 -1
  195. package/dist/components/Tabs/tests/Tabs.stories.js +4 -4
  196. package/dist/components/Tabs/tests/Tabs.test.stories.d.ts +28 -0
  197. package/dist/components/Tabs/tests/Tabs.test.stories.js +128 -0
  198. package/dist/components/Text/Text.d.ts +1 -1
  199. package/dist/components/Text/Text.types.d.ts +1 -1
  200. package/dist/components/Text/tests/Text.stories.d.ts +29 -8
  201. package/dist/components/Text/tests/Text.stories.js +148 -125
  202. package/dist/components/Text/tests/Text.test.stories.d.ts +18 -0
  203. package/dist/components/Text/tests/Text.test.stories.js +49 -0
  204. package/dist/components/TextArea/TextArea.module.css +1 -1
  205. package/dist/components/TextArea/tests/TextArea.stories.js +1 -1
  206. package/dist/components/TextArea/tests/TextArea.test.stories.d.ts +29 -0
  207. package/dist/components/TextArea/tests/TextArea.test.stories.js +99 -0
  208. package/dist/components/TextField/TextField.js +3 -1
  209. package/dist/components/TextField/tests/TextField.stories.js +1 -1
  210. package/dist/components/TextField/tests/TextField.test.stories.d.ts +29 -0
  211. package/dist/components/TextField/tests/TextField.test.stories.js +99 -0
  212. package/dist/components/Theme/Theme.types.d.ts +2 -2
  213. package/dist/components/Theme/tests/Theme.test.stories.d.ts +24 -0
  214. package/dist/components/Theme/tests/Theme.test.stories.js +133 -0
  215. package/dist/components/Timeline/tests/Timeline.test.stories.d.ts +18 -0
  216. package/dist/components/Timeline/tests/Timeline.test.stories.js +32 -0
  217. package/dist/components/Toast/ToastContainer.js +1 -1
  218. package/dist/components/Toast/tests/Toast.test.stories.d.ts +16 -0
  219. package/dist/components/Toast/tests/Toast.test.stories.js +101 -0
  220. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  221. package/dist/components/Tooltip/tests/Tooltip.stories.d.ts +1 -1
  222. package/dist/components/Tooltip/tests/Tooltip.stories.js +0 -14
  223. package/dist/components/Tooltip/tests/Tooltip.test.stories.d.ts +19 -0
  224. package/dist/components/Tooltip/tests/Tooltip.test.stories.js +40 -0
  225. package/dist/components/View/View.d.ts +2 -2
  226. package/dist/components/View/View.js +4 -4
  227. package/dist/components/View/View.types.d.ts +2 -2
  228. package/dist/components/View/tests/View.stories.d.ts +114 -30
  229. package/dist/components/View/tests/View.stories.js +1092 -1012
  230. package/dist/components/View/tests/View.test.stories.d.ts +20 -0
  231. package/dist/components/View/tests/View.test.stories.js +50 -0
  232. package/dist/components/_private/Flyout/Flyout.types.d.ts +6 -6
  233. package/dist/components/_private/Flyout/FlyoutContent.js +1 -1
  234. package/dist/components/_private/Flyout/FlyoutControlled.js +5 -3
  235. package/dist/components/_private/Flyout/tests/Flyout.stories.js +5 -5
  236. package/dist/components/_private/Flyout/tests/Flyout.test.stories.d.ts +28 -0
  237. package/dist/components/_private/Flyout/tests/Flyout.test.stories.js +205 -0
  238. package/dist/components/_private/Flyout/useFlyout.d.ts +3 -3
  239. package/dist/components/_private/Portal/Portal.types.d.ts +3 -3
  240. package/dist/components/_private/Portal/tests/Portal.stories.js +1 -1
  241. package/dist/hooks/_private/useIsDismissible.d.ts +1 -1
  242. package/dist/hooks/_private/useOnClickOutside.d.ts +1 -1
  243. package/dist/hooks/_private/useSingletonHotkeys.d.ts +3 -3
  244. package/dist/hooks/_private/useSingletonHotkeys.js +1 -1
  245. package/dist/hooks/tests/useDrag.stories.js +1 -0
  246. package/dist/hooks/tests/useDrag.test.stories.d.ts +26 -0
  247. package/dist/hooks/tests/useDrag.test.stories.js +120 -0
  248. package/dist/hooks/tests/useElementId.stories.d.ts +6 -0
  249. package/dist/hooks/tests/useElementId.stories.js +19 -0
  250. package/dist/hooks/tests/useHotkeys.test.stories.d.ts +39 -0
  251. package/dist/hooks/tests/useHotkeys.test.stories.js +119 -0
  252. package/dist/hooks/tests/useRTL.stories.d.ts +6 -0
  253. package/dist/hooks/tests/useRTL.stories.js +25 -0
  254. package/dist/hooks/tests/useResponsiveClientValue.stories.d.ts +9 -1
  255. package/dist/hooks/tests/useResponsiveClientValue.stories.js +22 -9
  256. package/dist/hooks/tests/useScrollLock.stories.d.ts +6 -0
  257. package/dist/hooks/tests/useScrollLock.stories.js +22 -0
  258. package/dist/hooks/tests/useToggle.stories.d.ts +8 -0
  259. package/dist/hooks/tests/useToggle.stories.js +54 -0
  260. package/dist/hooks/useDrag.d.ts +3 -3
  261. package/dist/hooks/useHotkeys.d.ts +2 -2
  262. package/dist/hooks/useHotkeys.js +3 -1
  263. package/dist/hooks/useScrollLock.d.ts +2 -1
  264. package/dist/hooks/useScrollLock.js +7 -3
  265. package/dist/tests/ShadowDOM.stories.js +1 -1
  266. package/dist/themes/_generator/tests/themes.stories.d.ts +3 -0
  267. package/dist/themes/_generator/tests/themes.stories.js +7 -11
  268. package/dist/themes/_generator/utilities/generateColors.d.ts +1 -1
  269. package/dist/themes/_generator/utilities/generateColors.js +3 -2
  270. package/dist/themes/slate/theme.css +1 -1
  271. package/dist/types/global.d.ts +1 -1
  272. package/dist/utilities/helpers.d.ts +1 -0
  273. package/dist/utilities/helpers.js +3 -0
  274. package/dist/utilities/scroll/lock.d.ts +1 -0
  275. package/dist/utilities/scroll/lock.js +3 -3
  276. package/dist/utilities/scroll/lockSafari.d.ts +1 -1
  277. package/dist/utilities/scroll/lockSafari.js +4 -5
  278. package/dist/utilities/scroll/lockStandard.d.ts +4 -1
  279. package/dist/utilities/scroll/lockStandard.js +7 -2
  280. package/dist/utilities/storybook/Example.js +1 -2
  281. package/package.json +22 -21
  282. package/dist/components/Theme/tests/Theme.stories.d.ts +0 -13
  283. package/dist/components/Theme/tests/Theme.stories.js +0 -80
  284. package/dist/utilities/storybook/Example.module.css +0 -1
@@ -0,0 +1,6 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const id: StoryObj;
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { expect, waitFor } from "@storybook/test";
3
+ import useElementId from "../useElementId.js";
4
+ export default { title: "Hooks/useElementId" };
5
+ const Component = (props) => {
6
+ const id = useElementId(props.id);
7
+ return <div id={id}>{id}</div>;
8
+ };
9
+ export const id = {
10
+ name: "passed id",
11
+ render: () => {
12
+ return <Component id="hey"/>;
13
+ },
14
+ play: async () => {
15
+ waitFor(() => {
16
+ expect(document.querySelector("#hey")).toBeTruthy();
17
+ });
18
+ },
19
+ };
@@ -0,0 +1,39 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ import { fn } from "@storybook/test";
3
+ declare const _default: {
4
+ title: string;
5
+ parameters: {
6
+ chromatic: {
7
+ disableSnapshot: boolean;
8
+ };
9
+ };
10
+ };
11
+ export default _default;
12
+ export declare const singleKey: StoryObj<{
13
+ handleHotkey: ReturnType<typeof fn>;
14
+ }>;
15
+ export declare const modKey: StoryObj<{
16
+ handleHotkey: ReturnType<typeof fn>;
17
+ }>;
18
+ export declare const modKeyHold: StoryObj<{
19
+ handleHotkey: ReturnType<typeof fn>;
20
+ }>;
21
+ export declare const keyList: StoryObj<{
22
+ handleHotkey: ReturnType<typeof fn>;
23
+ }>;
24
+ export declare const keyCombination: StoryObj<{
25
+ handleHotkey: ReturnType<typeof fn>;
26
+ }>;
27
+ export declare const keyCombinationFormat: StoryObj<{
28
+ handleHotkey: ReturnType<typeof fn>;
29
+ }>;
30
+ export declare const keyCombinationOrder: StoryObj<{
31
+ handleHotkey: ReturnType<typeof fn>;
32
+ }>;
33
+ export declare const keyCombinationMoreThanRequired: StoryObj<{
34
+ handleHotkey: ReturnType<typeof fn>;
35
+ }>;
36
+ export declare const optionModified: StoryObj<{
37
+ handleHotkey: ReturnType<typeof fn>;
38
+ handleHotkeyModified: ReturnType<typeof fn>;
39
+ }>;
@@ -0,0 +1,119 @@
1
+ import { expect, fn, userEvent } from "@storybook/test";
2
+ import useHotkeys from "../useHotkeys.js";
3
+ export default {
4
+ title: "Hooks/useHotkeys/tests",
5
+ parameters: {
6
+ chromatic: { disableSnapshot: true },
7
+ },
8
+ };
9
+ const Component = (props) => {
10
+ const { hotkeys } = props;
11
+ useHotkeys(hotkeys);
12
+ return <div />;
13
+ };
14
+ export const singleKey = {
15
+ name: "single key",
16
+ args: {
17
+ handleHotkey: fn(),
18
+ },
19
+ render: (args) => <Component hotkeys={{ a: args.handleHotkey }}/>,
20
+ play: async ({ args }) => {
21
+ await userEvent.keyboard("a");
22
+ await userEvent.keyboard("b");
23
+ expect(args.handleHotkey).toHaveBeenCalledTimes(1);
24
+ },
25
+ };
26
+ export const modKey = {
27
+ name: "mod key",
28
+ args: {
29
+ handleHotkey: fn(),
30
+ },
31
+ render: (args) => <Component hotkeys={{ mod: args.handleHotkey }}/>,
32
+ play: async ({ args }) => {
33
+ await userEvent.keyboard("{Meta/}");
34
+ expect(args.handleHotkey).toHaveBeenCalledTimes(1);
35
+ },
36
+ };
37
+ export const modKeyHold = {
38
+ name: "mod key on hold",
39
+ args: {
40
+ handleHotkey: fn(),
41
+ },
42
+ render: (args) => <Component hotkeys={{ "Meta + b": args.handleHotkey }}/>,
43
+ play: async ({ args }) => {
44
+ await userEvent.keyboard("{Meta>}bb{/Meta}");
45
+ expect(args.handleHotkey).toHaveBeenCalledTimes(2);
46
+ },
47
+ };
48
+ export const keyList = {
49
+ name: "key list",
50
+ args: {
51
+ handleHotkey: fn(),
52
+ },
53
+ render: (args) => <Component hotkeys={{ "a,b": args.handleHotkey }}/>,
54
+ play: async ({ args }) => {
55
+ await userEvent.keyboard("a");
56
+ expect(args.handleHotkey).toHaveBeenCalledTimes(1);
57
+ await userEvent.keyboard("b");
58
+ expect(args.handleHotkey).toHaveBeenCalledTimes(2);
59
+ },
60
+ };
61
+ export const keyCombination = {
62
+ name: "key combination",
63
+ args: {
64
+ handleHotkey: fn(),
65
+ },
66
+ render: (args) => <Component hotkeys={{ "a+b": args.handleHotkey }}/>,
67
+ play: async ({ args }) => {
68
+ await userEvent.keyboard("{a>}b{/a}");
69
+ expect(args.handleHotkey).toHaveBeenCalledTimes(1);
70
+ },
71
+ };
72
+ export const keyCombinationFormat = {
73
+ name: "key combination without formatting",
74
+ args: {
75
+ handleHotkey: fn(),
76
+ },
77
+ render: (args) => <Component hotkeys={{ "A + b": args.handleHotkey }}/>,
78
+ play: async ({ args }) => {
79
+ await userEvent.keyboard("{a>}b{/a}");
80
+ expect(args.handleHotkey).toHaveBeenCalledTimes(1);
81
+ },
82
+ };
83
+ export const keyCombinationOrder = {
84
+ name: "key combination without order",
85
+ args: {
86
+ handleHotkey: fn(),
87
+ },
88
+ render: (args) => <Component hotkeys={{ "b+a": args.handleHotkey }}/>,
89
+ play: async ({ args }) => {
90
+ await userEvent.keyboard("{a>}b{/a}");
91
+ expect(args.handleHotkey).toHaveBeenCalledTimes(1);
92
+ },
93
+ };
94
+ export const keyCombinationMoreThanRequired = {
95
+ name: "key combination, more keys pressed",
96
+ args: {
97
+ handleHotkey: fn(),
98
+ },
99
+ render: (args) => <Component hotkeys={{ "z + x": args.handleHotkey }}/>,
100
+ play: async ({ args }) => {
101
+ await userEvent.keyboard("{z>}{x>}c{/x}{/z}");
102
+ // When c is pressed, it doesn't trigger a+b for the second time
103
+ expect(args.handleHotkey).toHaveBeenCalledTimes(1);
104
+ },
105
+ };
106
+ export const optionModified = {
107
+ name: "modified with alt/option",
108
+ args: {
109
+ handleHotkey: fn(),
110
+ handleHotkeyModified: fn(),
111
+ },
112
+ render: (args) => (<Component hotkeys={{ "alt+n": args.handleHotkeyModified, "alt+shift": args.handleHotkey }}/>),
113
+ play: async ({ args }) => {
114
+ await userEvent.keyboard("{Alt>}n{/Alt}");
115
+ expect(args.handleHotkeyModified).toHaveBeenCalledTimes(1);
116
+ await userEvent.keyboard("{Alt>}{Shift}{/Alt}");
117
+ expect(args.handleHotkey).toHaveBeenCalledTimes(1);
118
+ },
119
+ };
@@ -0,0 +1,6 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const setRTL: StoryObj;
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { expect, waitFor } from "@storybook/test";
3
+ import Reshaped from "../../components/Reshaped/index.js";
4
+ import useRTL from "../useRTL.js";
5
+ export default { title: "Hooks/useRTL" };
6
+ const Component = () => {
7
+ const [rtl, setRTL] = useRTL();
8
+ React.useEffect(() => {
9
+ setRTL(true);
10
+ }, [setRTL]);
11
+ return <div>{rtl ? "RTL" : "LTR"}</div>;
12
+ };
13
+ export const setRTL = {
14
+ name: "setRTL",
15
+ render: () => {
16
+ return (<Reshaped theme="reshaped">
17
+ <Component />
18
+ </Reshaped>);
19
+ },
20
+ play: async () => {
21
+ waitFor(() => {
22
+ expect(document.documentElement).toHaveAttribute("dir", "rtl");
23
+ });
24
+ },
25
+ };
@@ -2,4 +2,12 @@ declare const _default: {
2
2
  title: string;
3
3
  };
4
4
  export default _default;
5
- export declare const base: () => import("react").JSX.Element;
5
+ export declare const base: {
6
+ name: string;
7
+ render: () => import("react").JSX.Element;
8
+ };
9
+ export declare const boolean: {
10
+ name: string;
11
+ describe: string;
12
+ render: () => import("react").JSX.Element;
13
+ };
@@ -1,12 +1,25 @@
1
1
  import useResponsiveClientValue from "../useResponsiveClientValue.js";
2
2
  import View from "../../components/View/index.js";
3
3
  export default { title: "Hooks/useResponsiveClientValue" };
4
- function Example() {
5
- const value = useResponsiveClientValue({
6
- s: "neutral",
7
- m: "critical",
8
- l: "positive",
9
- });
10
- return <View width={25} height={25} backgroundColor={value}/>;
11
- }
12
- export const base = () => <Example />;
4
+ export const base = {
5
+ name: "base",
6
+ render: () => {
7
+ const value = useResponsiveClientValue({
8
+ s: "neutral",
9
+ m: "critical",
10
+ l: "positive",
11
+ });
12
+ return <View width={25} height={25} backgroundColor={value}/>;
13
+ },
14
+ };
15
+ export const boolean = {
16
+ name: "boolean",
17
+ describe: "works with boolean properties",
18
+ render: () => {
19
+ const value = useResponsiveClientValue({
20
+ s: true,
21
+ l: false,
22
+ });
23
+ return <div>{value?.toString()}</div>;
24
+ },
25
+ };
@@ -0,0 +1,6 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const base: StoryObj;
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { expect, userEvent } from "@storybook/test";
3
+ import Button from "../../components/Button/index.js";
4
+ import useScrollLock from "../useScrollLock.js";
5
+ export default { title: "Hooks/useScrollLock" };
6
+ export const base = {
7
+ name: "base",
8
+ render: () => {
9
+ const { lockScroll, unlockScroll, scrollLocked } = useScrollLock();
10
+ return (<React.Fragment>
11
+ <Button onClick={scrollLocked ? unlockScroll : lockScroll}>Toggle</Button>
12
+ <div style={{ height: "150vh" }}/>
13
+ </React.Fragment>);
14
+ },
15
+ play: async ({ canvas }) => {
16
+ const button = canvas.getAllByRole("button")[0];
17
+ await userEvent.click(button);
18
+ expect(document.body).toHaveStyle("overflow: hidden");
19
+ await userEvent.click(button);
20
+ expect(document.body).not.toHaveStyle("overflow: hidden");
21
+ },
22
+ };
@@ -0,0 +1,8 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const toggle: StoryObj;
7
+ export declare const activate: StoryObj;
8
+ export declare const deactivate: StoryObj;
@@ -0,0 +1,54 @@
1
+ import React from "react";
2
+ import { expect, userEvent } from "@storybook/test";
3
+ import Button from "../../components/Button/index.js";
4
+ import useToggle from "../useToggle.js";
5
+ export default { title: "Hooks/useToggle" };
6
+ export const toggle = {
7
+ name: "toggle",
8
+ render: () => {
9
+ const { toggle, active } = useToggle();
10
+ return (<Button onClick={toggle} attributes={{ "data-active": active }}>
11
+ {active ? "Deactivate" : "Activate"}
12
+ </Button>);
13
+ },
14
+ play: async ({ canvas }) => {
15
+ const button = canvas.getAllByRole("button")[0];
16
+ expect(button.getAttribute("data-active")).toBe("false");
17
+ await userEvent.click(button);
18
+ expect(button.getAttribute("data-active")).toBe("true");
19
+ await userEvent.click(button);
20
+ expect(button.getAttribute("data-active")).toBe("false");
21
+ },
22
+ };
23
+ export const activate = {
24
+ name: "activate",
25
+ render: () => {
26
+ const { activate, active } = useToggle();
27
+ return (<React.Fragment>
28
+ <Button onClick={activate} attributes={{ "data-active": active }}>
29
+ Activate
30
+ </Button>
31
+ </React.Fragment>);
32
+ },
33
+ play: async ({ canvas }) => {
34
+ const button = canvas.getAllByRole("button")[0];
35
+ expect(button.getAttribute("data-active")).toBe("false");
36
+ await userEvent.click(button);
37
+ expect(button.getAttribute("data-active")).toBe("true");
38
+ },
39
+ };
40
+ export const deactivate = {
41
+ name: "deactivate",
42
+ render: () => {
43
+ const { deactivate, active } = useToggle(true);
44
+ return (<Button onClick={deactivate} attributes={{ "data-active": active }}>
45
+ Deactivate
46
+ </Button>);
47
+ },
48
+ play: async ({ canvas }) => {
49
+ const button = canvas.getAllByRole("button")[0];
50
+ expect(button.getAttribute("data-active")).toBe("true");
51
+ await userEvent.click(button);
52
+ expect(button.getAttribute("data-active")).toBe("false");
53
+ },
54
+ };
@@ -7,11 +7,11 @@ export type UseDragCallbackArgs = {
7
7
  };
8
8
  declare const useDrag: <TriggerElement extends HTMLElement = HTMLButtonElement, ContainerElement extends HTMLElement = HTMLDivElement>(cb: (args: UseDragCallbackArgs) => void, options?: {
9
9
  disabled?: boolean;
10
- containerRef?: React.RefObject<ContainerElement>;
10
+ containerRef?: React.RefObject<ContainerElement | null>;
11
11
  orientation?: "horizontal" | "vertical" | "all";
12
12
  }) => {
13
- ref: React.RefObject<TriggerElement>;
14
- containerRef: React.RefObject<ContainerElement>;
13
+ ref: React.RefObject<TriggerElement | null>;
14
+ containerRef: React.RefObject<ContainerElement | null>;
15
15
  active: boolean;
16
16
  };
17
17
  export default useDrag;
@@ -1,11 +1,11 @@
1
1
  import React from "react";
2
2
  import { type Hotkeys } from "./_private/useSingletonHotkeys";
3
3
  declare const useHotkeys: <Element extends HTMLElement>(hotkeys: Hotkeys, deps?: unknown[], options?: {
4
- ref?: React.RefObject<Element>;
4
+ ref?: React.RefObject<Element | null>;
5
5
  disabled?: boolean;
6
6
  preventDefault?: boolean;
7
7
  }) => {
8
- ref: React.RefObject<Element>;
8
+ ref: React.RefObject<Element | null>;
9
9
  checkHotkeyState: (key: string) => boolean;
10
10
  };
11
11
  export default useHotkeys;
@@ -8,7 +8,9 @@ const useHotkeys = (hotkeys, deps = [], options) => {
8
8
  React.useEffect(() => {
9
9
  if (options?.disabled)
10
10
  return;
11
- const remove = addHotkeys(hotkeys, elementRef, { preventDefault: options?.preventDefault });
11
+ const remove = addHotkeys(hotkeys, elementRef, {
12
+ preventDefault: options?.preventDefault,
13
+ });
12
14
  return () => remove?.();
13
15
  // eslint-disable-next-line react-hooks/exhaustive-deps
14
16
  }, [
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  declare const useScrollLock: (props?: {
3
- containerRef?: React.RefObject<HTMLElement>;
3
+ containerRef?: React.RefObject<HTMLElement | null>;
4
+ originRef?: React.RefObject<HTMLElement | null>;
4
5
  }) => {
5
6
  scrollLocked: boolean;
6
7
  lockScroll: () => void;
@@ -2,11 +2,15 @@
2
2
  import React from "react";
3
3
  import { lockScroll, unlockScroll } from "../utilities/scroll/index.js";
4
4
  const useScrollLock = (props) => {
5
- const { containerRef } = props || {};
5
+ const { containerRef, originRef } = props || {};
6
6
  const [locked, setLocked] = React.useState(false);
7
7
  const handleLockScroll = React.useCallback(() => {
8
- lockScroll({ containerEl: containerRef?.current, cb: () => setLocked(true) });
9
- }, [containerRef]);
8
+ lockScroll({
9
+ containerEl: containerRef?.current,
10
+ originEl: originRef?.current,
11
+ cb: () => setLocked(true),
12
+ });
13
+ }, [containerRef, originRef]);
10
14
  const handleUnlockScroll = React.useCallback(() => {
11
15
  unlockScroll(() => setLocked(false));
12
16
  }, []);
@@ -77,7 +77,7 @@ const Component = () => {
77
77
  return (<View paddingBottom={50}>
78
78
  <ShadowDiv>
79
79
  <View gap={4} direction="row" wrap={false}>
80
- <Autocomplete name="fruit-shadow" placeholder="Pick your food" value={valueAutoShadow} onChange={handleChangeAutoShadow}>
80
+ <Autocomplete name="fruit-shadow" placeholder="Pick your food" value={valueAutoShadow} onChange={handleChangeAutoShadow} inputAttributes={{ "aria-label": "Label" }}>
81
81
  {optionsAuto.map((option) => (<Autocomplete.Item key={option} value={option} onClick={() => handleChangeAutoShadow({ value: option, name: "fruit-auto" })}>
82
82
  {option}
83
83
  </Autocomplete.Item>))}
@@ -5,6 +5,9 @@ declare const _default: {
5
5
  iframe: {
6
6
  url: string;
7
7
  };
8
+ a11y: {
9
+ disable: boolean;
10
+ };
8
11
  };
9
12
  };
10
13
  export default _default;
@@ -17,6 +17,10 @@ export default {
17
17
  title: "Meta/Themes",
18
18
  parameters: {
19
19
  iframe: { url: "https://reshaped.so/docs/tokens/theming/runtime-theming" },
20
+ a11y: {
21
+ // This option disables all a11y checks on this story
22
+ disable: true,
23
+ },
20
24
  },
21
25
  };
22
26
  const css = getThemeCSS("green", {
@@ -37,10 +41,6 @@ const cssGenerated = getThemeCSS("generated", {
37
41
  primary: "#0369a1" /*"#5a58f2"*/ /* "#2563eb" */,
38
42
  }),
39
43
  });
40
- const cssGenerated2 = getThemeCSS("generated2", {
41
- ...baseThemeDefinition,
42
- color: generateThemeColors({ primary: "#2383e2" }),
43
- });
44
44
  const componentExamples = (<View gap={4} padding={6} backgroundColor="page">
45
45
  <Text variant="featured-2">Hello world</Text>
46
46
  <Text color="neutral-faded" variant="featured-2">
@@ -215,14 +215,10 @@ export const base = () => (<Example>
215
215
  </Theme>
216
216
  </Example.Item>
217
217
  </Example>);
218
- export const generation = () => (<React.Fragment>
219
- <style>
220
- {cssGenerated}
221
- {cssGenerated2}
222
- </style>
218
+ export const generation = () => (<div>
219
+ <style>{cssGenerated}</style>
223
220
  <Theme name="generated">{componentExamples}</Theme>
224
- {/* <Theme name="generated2">{componentExamples}</Theme> */}
225
- </React.Fragment>);
221
+ </div>);
226
222
  const onColorsCss = getThemeCSS("on-color", {
227
223
  color: {
228
224
  backgroundPrimary: { hex: "#1abc9c", hexDark: "#16a085" },
@@ -6,6 +6,6 @@ declare const generate: (args?: {
6
6
  warning?: Color;
7
7
  positive?: Color;
8
8
  neutral?: Color;
9
- brand?: string;
9
+ brand?: Color;
10
10
  }) => ThemeDefinition["color"];
11
11
  export default generate;
@@ -158,16 +158,17 @@ const generate = (args = {}) => {
158
158
  return generateColorValues({
159
159
  key,
160
160
  hex: validateHexColor(typeof color === "string" ? color : color.hex),
161
- hexDark: typeof color !== "string" ? validateHexColor(color.hexDark) : undefined,
161
+ hexDark: validateHexColor(typeof color === "string" ? color : (color.hexDark ?? color.hex)),
162
162
  });
163
163
  };
164
+ const brandColor = brand || primary;
164
165
  return {
165
166
  ...generateFor("primary", primary),
166
167
  ...generateFor("critical", critical),
167
168
  ...generateFor("warning", warning),
168
169
  ...generateFor("positive", positive),
169
170
  ...generateFor("neutral", neutral),
170
- brand: { hex: brand || primary },
171
+ brand: typeof brandColor === "string" ? { hex: brandColor } : brandColor,
171
172
  white: { hex: "#ffffff" },
172
173
  black: { hex: "#000000" },
173
174
  };
@@ -1 +1 @@
1
- [data-rs-theme=slate]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-extrabold:800;--rs-font-weight-black:900;--rs-font-size-title-1:6rem;--rs-line-height-title-1:6.25rem;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-1:normal;--rs-font-size-title-2:5rem;--rs-line-height-title-2:5.25rem;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-2:normal;--rs-font-size-title-3:4rem;--rs-line-height-title-3:4.25rem;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-3:normal;--rs-font-size-title-4:3.5rem;--rs-line-height-title-4:3.75rem;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-bold);--rs-letter-spacing-title-4:normal;--rs-font-size-title-5:3rem;--rs-line-height-title-5:3.25rem;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-bold);--rs-letter-spacing-title-5:normal;--rs-font-size-title-6:2.25rem;--rs-line-height-title-6:2.5rem;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-bold);--rs-letter-spacing-title-6:normal;--rs-font-size-featured-1:2rem;--rs-line-height-featured-1:2.5rem;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-letter-spacing-featured-1:normal;--rs-font-size-featured-2:1.5rem;--rs-line-height-featured-2:2rem;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-letter-spacing-featured-2:normal;--rs-font-size-featured-3:1.25rem;--rs-line-height-featured-3:1.75rem;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-letter-spacing-featured-3:normal;--rs-font-size-body-1:1.125rem;--rs-line-height-body-1:1.75rem;--rs-font-family-body-1:var(--rs-font-family-body);--rs-letter-spacing-body-1:normal;--rs-font-size-body-2:1rem;--rs-line-height-body-2:1.5rem;--rs-font-family-body-2:var(--rs-font-family-body);--rs-letter-spacing-body-2:normal;--rs-font-size-body-3:0.875rem;--rs-line-height-body-3:1.25rem;--rs-font-family-body-3:var(--rs-font-family-body);--rs-letter-spacing-body-3:normal;--rs-font-size-caption-1:0.75rem;--rs-line-height-caption-1:1rem;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-letter-spacing-caption-1:normal;--rs-font-size-caption-2:0.625rem;--rs-line-height-caption-2:0.75rem;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-letter-spacing-caption-2:normal;--rs-unit-base:4px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-radius-small:4px;--rs-radius-medium:8px;--rs-radius-large:12px;--rs-color-brand:#2563eb;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-warning:#000;--rs-color-on-background-positive:#fff;--rs-color-on-brand:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-rapid:100ms;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 1px 5px -4px rgba(0,0,0,.5),0px 4px 8px 0px rgba(0,0,0,.05);--rs-shadow-overlay:0px 5px 10px 0px rgba(0,0,0,.05),0px 15px 25px 0px rgba(0,0,0,.07);--rs-viewport-m-min:660;--rs-viewport-l-min:900;--rs-viewport-xl-min:1280}[data-rs-theme=slate][data-rs-color-mode=light]{--rs-color-background-primary:#2563eb;--rs-color-background-primary-faded:#e8f0ff;--rs-color-border-primary:#1e5ce5;--rs-color-border-primary-faded:#d0ddf4;--rs-color-foreground-primary:#1e5ce5;--rs-color-background-critical:#e22c2c;--rs-color-background-critical-faded:#fff1ef;--rs-color-border-critical:#c22022;--rs-color-border-critical-faded:#f3dad6;--rs-color-foreground-critical:#c22022;--rs-color-background-warning:#facc15;--rs-color-background-warning-faded:#fff6dd;--rs-color-border-warning:#816802;--rs-color-border-warning-faded:#ece2c4;--rs-color-foreground-warning:#816802;--rs-color-background-positive:#118850;--rs-color-background-positive-faded:#ebfff1;--rs-color-border-positive:#0f7f4a;--rs-color-border-positive-faded:#d2eddb;--rs-color-foreground-positive:#0f7f4a;--rs-color-background-neutral:#e3e4e8;--rs-color-background-neutral-faded:#f3f3f5;--rs-color-border-neutral:#0000001f;--rs-color-border-neutral-faded:#00000014;--rs-color-foreground-neutral:#2c2e34;--rs-color-foreground-neutral-faded:#676a75;--rs-color-background-disabled:#edeeef;--rs-color-background-disabled-faded:#f6f6f7;--rs-color-border-disabled:#e2e2e4;--rs-color-foreground-disabled:#cbcccf;--rs-color-background-elevation-base:#fff;--rs-color-background-elevation-raised:#fff;--rs-color-background-elevation-overlay:#fff;--rs-color-background-page:#fff;--rs-color-background-page-faded:#fafbfb;--rs-color-rgb-background-primary:37,99,235;--rs-color-rgb-background-primary-faded:232,240,255;--rs-color-rgb-background-critical:226,44,44;--rs-color-rgb-background-critical-faded:255,241,239;--rs-color-rgb-background-warning:250,204,21;--rs-color-rgb-background-warning-faded:255,246,221;--rs-color-rgb-background-positive:17,136,80;--rs-color-rgb-background-positive-faded:235,255,241;--rs-color-on-background-neutral:#000;--rs-color-rgb-background-neutral:227,228,232;--rs-color-rgb-background-neutral-faded:243,243,245;--rs-color-rgb-background-disabled:237,238,239;--rs-color-rgb-background-disabled-faded:246,246,247;--rs-color-rgb-background-elevation-base:255,255,255;--rs-color-rgb-background-elevation-raised:255,255,255;--rs-color-rgb-background-elevation-overlay:255,255,255;--rs-color-rgb-background-page:255,255,255;--rs-color-rgb-background-page-faded:250,251,251}[data-rs-theme=slate][data-rs-color-mode=dark]{--rs-color-background-primary:#2563eb;--rs-color-background-primary-faded:#17243d;--rs-color-border-primary:#7199e5;--rs-color-border-primary-faded:#293b60;--rs-color-foreground-primary:#7199e5;--rs-color-background-critical:#d72828;--rs-color-background-critical-faded:#391b18;--rs-color-border-critical:#e68075;--rs-color-border-critical-faded:#5a2e29;--rs-color-foreground-critical:#e68075;--rs-color-background-warning:#d7ae06;--rs-color-background-warning-faded:#2b2410;--rs-color-border-warning:#eed58a;--rs-color-border-warning-faded:#453c1e;--rs-color-foreground-warning:#eed58a;--rs-color-background-positive:#118850;--rs-color-background-positive-faded:#152a1d;--rs-color-border-positive:#57b17c;--rs-color-border-positive-faded:#264431;--rs-color-foreground-positive:#57b17c;--rs-color-background-neutral:#393a42;--rs-color-background-neutral-faded:#212227;--rs-color-border-neutral:#ffffff24;--rs-color-border-neutral-faded:#ffffff14;--rs-color-foreground-neutral:#f3f3f5;--rs-color-foreground-neutral-faded:#c7c9d1;--rs-color-background-disabled:#242527;--rs-color-background-disabled-faded:#1b1b1d;--rs-color-border-disabled:#262729;--rs-color-foreground-disabled:#494a4e;--rs-color-background-elevation-base:#161617;--rs-color-background-elevation-raised:#18191a;--rs-color-background-elevation-overlay:#1d1d1f;--rs-color-background-page:#0e0e0f;--rs-color-background-page-faded:#131414;--rs-color-rgb-background-primary:37,99,235;--rs-color-rgb-background-primary-faded:23,36,61;--rs-color-rgb-background-critical:215,40,40;--rs-color-rgb-background-critical-faded:57,27,24;--rs-color-rgb-background-warning:215,174,6;--rs-color-rgb-background-warning-faded:43,36,16;--rs-color-rgb-background-positive:17,136,80;--rs-color-rgb-background-positive-faded:21,42,29;--rs-color-on-background-neutral:#fff;--rs-color-rgb-background-neutral:57,58,66;--rs-color-rgb-background-neutral-faded:33,34,39;--rs-color-rgb-background-disabled:36,37,39;--rs-color-rgb-background-disabled-faded:27,27,29;--rs-color-rgb-background-elevation-base:22,22,23;--rs-color-rgb-background-elevation-raised:24,25,26;--rs-color-rgb-background-elevation-overlay:29,29,31;--rs-color-rgb-background-page:14,14,15;--rs-color-rgb-background-page-faded:19,20,20}
1
+ [data-rs-theme=slate]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-extrabold:800;--rs-font-weight-black:900;--rs-font-size-title-1:6rem;--rs-line-height-title-1:6.25rem;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-1:normal;--rs-font-size-title-2:5rem;--rs-line-height-title-2:5.25rem;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-2:normal;--rs-font-size-title-3:4rem;--rs-line-height-title-3:4.25rem;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-extrabold);--rs-letter-spacing-title-3:normal;--rs-font-size-title-4:3.5rem;--rs-line-height-title-4:3.75rem;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-bold);--rs-letter-spacing-title-4:normal;--rs-font-size-title-5:3rem;--rs-line-height-title-5:3.25rem;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-bold);--rs-letter-spacing-title-5:normal;--rs-font-size-title-6:2.25rem;--rs-line-height-title-6:2.5rem;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-bold);--rs-letter-spacing-title-6:normal;--rs-font-size-featured-1:2rem;--rs-line-height-featured-1:2.5rem;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-letter-spacing-featured-1:normal;--rs-font-size-featured-2:1.5rem;--rs-line-height-featured-2:2rem;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-letter-spacing-featured-2:normal;--rs-font-size-featured-3:1.25rem;--rs-line-height-featured-3:1.75rem;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-letter-spacing-featured-3:normal;--rs-font-size-body-1:1.125rem;--rs-line-height-body-1:1.75rem;--rs-font-family-body-1:var(--rs-font-family-body);--rs-letter-spacing-body-1:normal;--rs-font-size-body-2:1rem;--rs-line-height-body-2:1.5rem;--rs-font-family-body-2:var(--rs-font-family-body);--rs-letter-spacing-body-2:normal;--rs-font-size-body-3:0.875rem;--rs-line-height-body-3:1.25rem;--rs-font-family-body-3:var(--rs-font-family-body);--rs-letter-spacing-body-3:normal;--rs-font-size-caption-1:0.75rem;--rs-line-height-caption-1:1rem;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-letter-spacing-caption-1:normal;--rs-font-size-caption-2:0.625rem;--rs-line-height-caption-2:0.75rem;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-letter-spacing-caption-2:normal;--rs-unit-base:4px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-radius-small:4px;--rs-radius-medium:8px;--rs-radius-large:12px;--rs-color-brand:#2563eb;--rs-color-white:#fff;--rs-color-black:#000;--rs-color-on-background-primary:#fff;--rs-color-on-background-critical:#fff;--rs-color-on-background-warning:#000;--rs-color-on-background-positive:#fff;--rs-color-on-brand:#fff;--rs-color-rgb-white:255,255,255;--rs-color-rgb-black:0,0,0;--rs-duration-rapid:100ms;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 1px 5px -4px rgba(0,0,0,.5),0px 4px 8px 0px rgba(0,0,0,.05);--rs-shadow-overlay:0px 5px 10px 0px rgba(0,0,0,.05),0px 15px 25px 0px rgba(0,0,0,.07);--rs-viewport-m-min:660;--rs-viewport-l-min:900;--rs-viewport-xl-min:1280}[data-rs-theme=slate][data-rs-color-mode=light]{--rs-color-background-primary:#2563eb;--rs-color-background-primary-faded:#e8f0ff;--rs-color-border-primary:#1e5ce5;--rs-color-border-primary-faded:#d0ddf4;--rs-color-foreground-primary:#1e5ce5;--rs-color-background-critical:#e22c2c;--rs-color-background-critical-faded:#fff1ef;--rs-color-border-critical:#c22022;--rs-color-border-critical-faded:#f3dad6;--rs-color-foreground-critical:#c22022;--rs-color-background-warning:#facc15;--rs-color-background-warning-faded:#fff6dd;--rs-color-border-warning:#816802;--rs-color-border-warning-faded:#ece2c4;--rs-color-foreground-warning:#816802;--rs-color-background-positive:#118850;--rs-color-background-positive-faded:#ebfff1;--rs-color-border-positive:#0f7f4a;--rs-color-border-positive-faded:#d2eddb;--rs-color-foreground-positive:#0f7f4a;--rs-color-background-neutral:#e3e4e8;--rs-color-background-neutral-faded:#f3f3f5;--rs-color-border-neutral:#0000001f;--rs-color-border-neutral-faded:#00000014;--rs-color-foreground-neutral:#2c2e34;--rs-color-foreground-neutral-faded:#676a75;--rs-color-background-disabled:#edeeef;--rs-color-background-disabled-faded:#f6f6f7;--rs-color-border-disabled:#e2e2e4;--rs-color-foreground-disabled:#cbcccf;--rs-color-background-elevation-base:#fff;--rs-color-background-elevation-raised:#fff;--rs-color-background-elevation-overlay:#fff;--rs-color-background-page:#fff;--rs-color-background-page-faded:#fafbfb;--rs-color-rgb-background-primary:37,99,235;--rs-color-rgb-background-primary-faded:232,240,255;--rs-color-rgb-background-critical:226,44,44;--rs-color-rgb-background-critical-faded:255,241,239;--rs-color-rgb-background-warning:250,204,21;--rs-color-rgb-background-warning-faded:255,246,221;--rs-color-rgb-background-positive:17,136,80;--rs-color-rgb-background-positive-faded:235,255,241;--rs-color-on-background-neutral:#000;--rs-color-rgb-background-neutral:227,228,232;--rs-color-rgb-background-neutral-faded:243,243,245;--rs-color-rgb-background-disabled:237,238,239;--rs-color-rgb-background-disabled-faded:246,246,247;--rs-color-rgb-background-elevation-base:255,255,255;--rs-color-rgb-background-elevation-raised:255,255,255;--rs-color-rgb-background-elevation-overlay:255,255,255;--rs-color-rgb-background-page:255,255,255;--rs-color-rgb-background-page-faded:250,251,251}[data-rs-theme=slate][data-rs-color-mode=dark]{--rs-color-background-primary:#2563eb;--rs-color-background-primary-faded:#17243d;--rs-color-border-primary:#7199e5;--rs-color-border-primary-faded:#293b60;--rs-color-foreground-primary:#7199e5;--rs-color-background-critical:#e22c2c;--rs-color-background-critical-faded:#391b18;--rs-color-border-critical:#e9887d;--rs-color-border-critical-faded:#5a2e29;--rs-color-foreground-critical:#e9887d;--rs-color-background-warning:#facc15;--rs-color-background-warning-faded:#2b2410;--rs-color-border-warning:#fbf3db;--rs-color-border-warning-faded:#453c1e;--rs-color-foreground-warning:#fbf3db;--rs-color-background-positive:#118850;--rs-color-background-positive-faded:#152a1d;--rs-color-border-positive:#57b17c;--rs-color-border-positive-faded:#264431;--rs-color-foreground-positive:#57b17c;--rs-color-background-neutral:#393a42;--rs-color-background-neutral-faded:#212227;--rs-color-border-neutral:#ffffff24;--rs-color-border-neutral-faded:#ffffff14;--rs-color-foreground-neutral:#f3f3f5;--rs-color-foreground-neutral-faded:#c7c9d1;--rs-color-background-disabled:#242527;--rs-color-background-disabled-faded:#1b1b1d;--rs-color-border-disabled:#262729;--rs-color-foreground-disabled:#494a4e;--rs-color-background-elevation-base:#161617;--rs-color-background-elevation-raised:#18191a;--rs-color-background-elevation-overlay:#1d1d1f;--rs-color-background-page:#0e0e0f;--rs-color-background-page-faded:#131414;--rs-color-rgb-background-primary:37,99,235;--rs-color-rgb-background-primary-faded:23,36,61;--rs-color-rgb-background-critical:226,44,44;--rs-color-rgb-background-critical-faded:57,27,24;--rs-color-rgb-background-warning:250,204,21;--rs-color-rgb-background-warning-faded:43,36,16;--rs-color-rgb-background-positive:17,136,80;--rs-color-rgb-background-positive-faded:21,42,29;--rs-color-on-background-neutral:#fff;--rs-color-rgb-background-neutral:57,58,66;--rs-color-rgb-background-neutral-faded:33,34,39;--rs-color-rgb-background-disabled:36,37,39;--rs-color-rgb-background-disabled-faded:27,27,29;--rs-color-rgb-background-elevation-base:22,22,23;--rs-color-rgb-background-elevation-raised:24,25,26;--rs-color-rgb-background-elevation-overlay:29,29,31;--rs-color-rgb-background-page:14,14,15;--rs-color-rgb-background-page-faded:19,20,20}
@@ -4,7 +4,7 @@ export type ClassName = ClassNameValue | ClassNameValue[] | ClassName[];
4
4
  export type CSSVariable = `--${string}`;
5
5
  export type StyleAttribute = React.CSSProperties | (React.CSSProperties & Record<CSSVariable, string | number | undefined>);
6
6
  type DataAttributes = {} | Record<`data-${string}`, string | boolean>;
7
- export type Attributes<TagName extends keyof JSX.IntrinsicElements = "div"> = JSX.IntrinsicElements[TagName] & DataAttributes & {
7
+ export type Attributes<TagName extends keyof React.JSX.IntrinsicElements = "div"> = React.JSX.IntrinsicElements[TagName] & DataAttributes & {
8
8
  style?: StyleAttribute;
9
9
  };
10
10
  export type Viewport = "s" | "m" | "l" | "xl";
@@ -1,4 +1,5 @@
1
1
  import type * as G from "../types/global";
2
+ export declare const sleep: (milliseconds: number) => Promise<unknown>;
2
3
  export declare const range: (start: number, end: number) => number[];
3
4
  export declare const debounce: <T extends Function>(cb: T, wait?: number) => T;
4
5
  export declare function debounceHandler<T extends React.SyntheticEvent | Event>(handler: (event: T) => void, timeout: number): (event: T) => void;
@@ -1,3 +1,6 @@
1
+ export const sleep = (milliseconds) => {
2
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
3
+ };
1
4
  export const range = (start, end) => {
2
5
  if (start > end)
3
6
  return [];
@@ -1,5 +1,6 @@
1
1
  export declare const lockScroll: (args: {
2
2
  containerEl?: HTMLElement | null;
3
+ originEl?: HTMLElement | null;
3
4
  cb?: () => void;
4
5
  }) => void;
5
6
  export declare const unlockScroll: (cb?: () => void) => void;
@@ -7,11 +7,11 @@ export const lockScroll = (args) => {
7
7
  lockedCount += 1;
8
8
  if (lockedCount > 1)
9
9
  return;
10
- if (isIOS()) {
11
- reset = lockSafariScroll(args.containerEl);
10
+ if (isIOS() && !args.containerEl && !args.originEl) {
11
+ reset = lockSafariScroll();
12
12
  }
13
13
  else {
14
- reset = lockStandardScroll(args.containerEl);
14
+ reset = lockStandardScroll({ containerEl: args.containerEl, originEl: args.originEl });
15
15
  }
16
16
  args.cb?.();
17
17
  };
@@ -1,2 +1,2 @@
1
- declare const lockSafariScroll: (containerEl?: HTMLElement | null) => () => void;
1
+ declare const lockSafariScroll: () => () => void;
2
2
  export default lockSafariScroll;
@@ -1,12 +1,11 @@
1
1
  import { StyleCache } from "../css.js";
2
2
  const styleCache = new StyleCache();
3
- const lockSafariScroll = (containerEl) => {
4
- const viewport = containerEl || window.visualViewport;
3
+ const lockSafariScroll = () => {
4
+ const viewport = window.visualViewport;
5
5
  const offsetLeft = viewport?.offsetLeft || 0;
6
6
  const offsetTop = viewport?.offsetTop || 0;
7
- const scrollX = containerEl?.scrollLeft ?? window.scrollX;
8
- const scrollY = containerEl?.scrollTop ?? window.scrollY;
9
- styleCache.set(containerEl || document.body, {
7
+ const { scrollX, scrollY } = window;
8
+ styleCache.set(document.body, {
10
9
  position: "fixed",
11
10
  top: `${-(scrollY - Math.floor(offsetTop))}px`,
12
11
  left: `${-(scrollX - Math.floor(offsetLeft))}px`,