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
@@ -10,161 +10,176 @@ export default {
10
10
  },
11
11
  },
12
12
  };
13
- export const base = () => (<Example>
14
- <Example.Item title="gap: 2">
15
- <Grid gap={2} columns={2}>
16
- {[1, 2].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
17
- {i}
18
- </View>))}
19
- </Grid>
20
- </Example.Item>
21
- <Example.Item title="align: center">
22
- <Grid gap={2} columns={2} align="center">
23
- <View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
24
- 1
25
- </View>
26
- <View backgroundColor="neutral-faded" borderRadius="medium" padding={8}>
27
- 2
28
- </View>
29
- </Grid>
30
- </Example.Item>
31
- <Example.Item title="justify: center">
32
- <Grid gap={2} columns="200px 200px" justify="center">
33
- <View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
34
- 1
35
- </View>
36
- <View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
37
- 2
38
- </View>
39
- </Grid>
40
- </Example.Item>
41
- </Example>);
42
- export const layout = () => (<Example>
43
- <Example.Item title="simple: 2 rows, 3 columns">
44
- <Grid gap={4} columns={3} rows={2}>
45
- {[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
46
- {i}
47
- </View>))}
48
- </Grid>
49
- </Example.Item>
50
- <Example.Item title="columns template, 1fr 2fr 1fr">
51
- <Grid gap={4} columns="1fr 2fr 1fr" rows={2}>
52
- {[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
53
- {i}
54
- </View>))}
55
- </Grid>
56
- </Example.Item>
57
- <Example.Item title="rows template, 1fr 2fr">
58
- <Grid gap={4} columns={3} rows="1fr 2fr">
59
- {[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
60
- {i}
61
- </View>))}
62
- </Grid>
63
- </Example.Item>
64
- <Example.Item title="responsive">
65
- <Grid gap={4} columns={{ s: 3, m: "1fr 2fr 1fr" }} rows={{ s: 2, m: "1fr 2fr" }}>
66
- {[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
67
- {i}
68
- </View>))}
69
- </Grid>
70
- </Example.Item>
71
- </Example>);
72
- export const itemLayout = () => (<Example>
73
- <Example.Item title="column, start 1, end 3">
74
- <Grid gap={4} columns={3} rows={2}>
75
- <Grid.Item colStart={1} colEnd={3}>
76
- <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
13
+ export const base = {
14
+ name: "gap, align, justify",
15
+ render: () => (<Example>
16
+ <Example.Item title="gap: 2">
17
+ <Grid gap={2} columns={2}>
18
+ {[1, 2].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
19
+ {i}
20
+ </View>))}
21
+ </Grid>
22
+ </Example.Item>
23
+ <Example.Item title="align: center">
24
+ <Grid gap={2} columns={2} align="center">
25
+ <View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
77
26
  1
78
27
  </View>
79
- </Grid.Item>
80
- {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
81
- {i}
82
- </View>))}
83
- </Grid>
84
- </Example.Item>
85
- <Example.Item title="column, start 1, span 2">
86
- <Grid gap={4} columns={3} rows={2}>
87
- <Grid.Item colStart={1} colSpan={2}>
88
- <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
89
- 1
28
+ <View backgroundColor="neutral-faded" borderRadius="medium" padding={8}>
29
+ 2
90
30
  </View>
91
- </Grid.Item>
92
- {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
93
- {i}
94
- </View>))}
95
- </Grid>
96
- </Example.Item>
97
-
98
- <Example.Item title="row, start 1, end 3">
99
- <Grid gap={4} columns={3} rows={2}>
100
- <Grid.Item rowStart={1} rowEnd={3}>
101
- <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
31
+ </Grid>
32
+ </Example.Item>
33
+ <Example.Item title="justify: center">
34
+ <Grid gap={2} columns="200px 200px" justify="center">
35
+ <View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
102
36
  1
103
37
  </View>
104
- </Grid.Item>
105
- {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
106
- {i}
107
- </View>))}
108
- </Grid>
109
- </Example.Item>
110
-
111
- <Example.Item title="row, start 1, span 2">
112
- <Grid gap={4} columns={3} rows={2}>
113
- <Grid.Item rowStart={1} rowSpan={2}>
114
- <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
115
- 1
38
+ <View backgroundColor="neutral-faded" borderRadius="medium" padding={4}>
39
+ 2
116
40
  </View>
117
- </Grid.Item>
118
- {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
119
- {i}
120
- </View>))}
121
- </Grid>
122
- </Example.Item>
41
+ </Grid>
42
+ </Example.Item>
43
+ </Example>),
44
+ };
45
+ export const layout = {
46
+ name: "rows, columns",
47
+ render: () => (<Example>
48
+ <Example.Item title="simple: 2 rows, 3 columns">
49
+ <Grid gap={4} columns={3} rows={2}>
50
+ {[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
51
+ {i}
52
+ </View>))}
53
+ </Grid>
54
+ </Example.Item>
55
+ <Example.Item title="columns template, 1fr 2fr 1fr">
56
+ <Grid gap={4} columns="1fr 2fr 1fr" rows={2}>
57
+ {[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
58
+ {i}
59
+ </View>))}
60
+ </Grid>
61
+ </Example.Item>
62
+ <Example.Item title="rows template, 1fr 2fr">
63
+ <Grid gap={4} columns={3} rows="1fr 2fr">
64
+ {[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
65
+ {i}
66
+ </View>))}
67
+ </Grid>
68
+ </Example.Item>
69
+ <Example.Item title="responsive">
70
+ <Grid gap={4} columns={{ s: 3, m: "1fr 2fr 1fr" }} rows={{ s: 2, m: "1fr 2fr" }}>
71
+ {[1, 2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
72
+ {i}
73
+ </View>))}
74
+ </Grid>
75
+ </Example.Item>
76
+ </Example>),
77
+ };
78
+ export const itemLayout = {
79
+ name: "colStart, colEnd, rowStart, rowEnd",
80
+ render: () => (<Example>
81
+ <Example.Item title="column, start 1, end 3">
82
+ <Grid gap={4} columns={3} rows={2}>
83
+ <Grid.Item colStart={1} colEnd={3}>
84
+ <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
85
+ 1
86
+ </View>
87
+ </Grid.Item>
88
+ {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
89
+ {i}
90
+ </View>))}
91
+ </Grid>
92
+ </Example.Item>
93
+ <Example.Item title="column, start 1, span 2">
94
+ <Grid gap={4} columns={3} rows={2}>
95
+ <Grid.Item colStart={1} colSpan={2}>
96
+ <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
97
+ 1
98
+ </View>
99
+ </Grid.Item>
100
+ {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
101
+ {i}
102
+ </View>))}
103
+ </Grid>
104
+ </Example.Item>
123
105
 
124
- <Example.Item title="responsive">
125
- <Grid gap={4} columns={3} rows={2}>
126
- <Grid.Item rowStart={1} rowSpan={{ s: 1, m: 2 }} colStart={1} colSpan={{ s: 1, m: 2 }}>
127
- <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
128
- 1
129
- </View>
130
- </Grid.Item>
131
- {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
132
- {i}
133
- </View>))}
134
- </Grid>
135
- </Example.Item>
136
- </Example>);
137
- export const areas = () => (<Example>
138
- <Example.Item title="simple: 2 rows, 3 columns">
139
- <Grid gap={4} rows={2} areas={["a .", "a b"]}>
140
- {["a", "b"].map((area) => (<Grid.Item area={area} key={area}>
106
+ <Example.Item title="row, start 1, end 3">
107
+ <Grid gap={4} columns={3} rows={2}>
108
+ <Grid.Item rowStart={1} rowEnd={3}>
109
+ <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
110
+ 1
111
+ </View>
112
+ </Grid.Item>
113
+ {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
114
+ {i}
115
+ </View>))}
116
+ </Grid>
117
+ </Example.Item>
118
+
119
+ <Example.Item title="row, start 1, span 2">
120
+ <Grid gap={4} columns={3} rows={2}>
121
+ <Grid.Item rowStart={1} rowSpan={2}>
122
+ <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
123
+ 1
124
+ </View>
125
+ </Grid.Item>
126
+ {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
127
+ {i}
128
+ </View>))}
129
+ </Grid>
130
+ </Example.Item>
131
+
132
+ <Example.Item title="responsive">
133
+ <Grid gap={4} columns={3} rows={2}>
134
+ <Grid.Item rowStart={1} rowSpan={{ s: 1, m: 2 }} colStart={1} colSpan={{ s: 1, m: 2 }}>
141
135
  <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
142
- {area}
136
+ 1
143
137
  </View>
144
- </Grid.Item>))}
145
- </Grid>
146
- </Example.Item>
147
- </Example>);
148
- export const auto = () => (<Example>
149
- <Example.Item title="auto flow: column">
150
- <Grid gap={4} autoFlow="column" rows={2} columns={2}>
151
- {[1, 2, 3].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
152
- {i}
153
- </View>))}
154
- </Grid>
155
- </Example.Item>
156
- <Example.Item title="auto rows">
157
- <Grid gap={4} autoRows="100px" columns={2}>
158
- {[1, 2, 3].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
159
- {i}
160
- </View>))}
161
- </Grid>
162
- </Example.Item>
163
- <Example.Item title="auto columns">
164
- <Grid gap={4} autoColumns="100px" autoFlow="column">
165
- {[1, 2, 3].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
166
- {i}
167
- </View>))}
168
- </Grid>
169
- </Example.Item>
170
- </Example>);
138
+ </Grid.Item>
139
+ {[2, 3, 4, 5].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
140
+ {i}
141
+ </View>))}
142
+ </Grid>
143
+ </Example.Item>
144
+ </Example>),
145
+ };
146
+ export const areas = {
147
+ name: "areas",
148
+ render: () => (<Example>
149
+ <Example.Item title="simple: 2 rows, 3 columns">
150
+ <Grid gap={4} rows={2} areas={["a .", "a b"]}>
151
+ {["a", "b"].map((area) => (<Grid.Item area={area} key={area}>
152
+ <View backgroundColor="neutral-faded" borderRadius="medium" padding={4} height="100%">
153
+ {area}
154
+ </View>
155
+ </Grid.Item>))}
156
+ </Grid>
157
+ </Example.Item>
158
+ </Example>),
159
+ };
160
+ export const auto = {
161
+ name: "autoFlow, autoColumns, autoRows",
162
+ render: () => (<Example>
163
+ <Example.Item title="auto flow: column">
164
+ <Grid gap={4} autoFlow="column" rows={2} columns={2}>
165
+ {[1, 2, 3].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
166
+ {i}
167
+ </View>))}
168
+ </Grid>
169
+ </Example.Item>
170
+ <Example.Item title="auto rows">
171
+ <Grid gap={4} autoRows="100px" columns={2}>
172
+ {[1, 2, 3].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
173
+ {i}
174
+ </View>))}
175
+ </Grid>
176
+ </Example.Item>
177
+ <Example.Item title="auto columns">
178
+ <Grid gap={4} autoColumns="100px" autoFlow="column">
179
+ {[1, 2, 3].map((i) => (<View backgroundColor="neutral-faded" borderRadius="medium" padding={4} key={i}>
180
+ {i}
181
+ </View>))}
182
+ </Grid>
183
+ </Example.Item>
184
+ </Example>),
185
+ };
@@ -0,0 +1,19 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ component: {
5
+ <As extends keyof React.JSX.IntrinsicElements = "div">(props: import("./..").GridProps<As>): import("react").JSX.Element;
6
+ Item: <As extends keyof React.JSX.IntrinsicElements = "div">(props: import("./..").GridItemProps<As>) => import("react").JSX.Element;
7
+ };
8
+ parameters: {
9
+ iframe: {
10
+ url: string;
11
+ };
12
+ chromatic: {
13
+ disableSnapshot: boolean;
14
+ };
15
+ };
16
+ };
17
+ export default _default;
18
+ export declare const as: StoryObj;
19
+ export declare const className: StoryObj;
@@ -0,0 +1,42 @@
1
+ import { expect } from "@storybook/test";
2
+ import Grid from "../index.js";
3
+ export default {
4
+ title: "Utilities/Grid/tests",
5
+ component: Grid,
6
+ parameters: {
7
+ iframe: {
8
+ url: "https://reshaped.so/docs/utilities/grid",
9
+ },
10
+ chromatic: { disableSnapshot: true },
11
+ },
12
+ };
13
+ export const as = {
14
+ name: "as",
15
+ render: () => (<Grid as="ul">
16
+ <Grid.Item as="li">Content</Grid.Item>
17
+ </Grid>),
18
+ play: ({ canvas }) => {
19
+ const ul = canvas.getByRole("list");
20
+ const li = canvas.getByRole("listitem");
21
+ expect(ul).toBeInTheDocument();
22
+ expect(li).toBeInTheDocument();
23
+ },
24
+ };
25
+ export const className = {
26
+ name: "className, attributes",
27
+ render: () => (<div data-testid="root">
28
+ <Grid className="test-class" attributes={{ id: "test-id" }}>
29
+ <Grid.Item className="test-item-class" attributes={{ id: "test-item-id" }}>
30
+ Content
31
+ </Grid.Item>
32
+ </Grid>
33
+ </div>),
34
+ play: async ({ canvas }) => {
35
+ const root = canvas.getByTestId("root").firstChild;
36
+ const item = root?.firstChild;
37
+ expect(root).toHaveAttribute("id", "test-id");
38
+ expect(root).toHaveClass("test-class");
39
+ expect(item).toHaveAttribute("id", "test-item-id");
40
+ expect(item).toHaveClass("test-item-class");
41
+ },
42
+ };
@@ -3,6 +3,6 @@ import type * as G from "../../types/global";
3
3
  export type Props = {
4
4
  hide?: G.Responsive<boolean>;
5
5
  visibility?: boolean;
6
- as?: keyof JSX.IntrinsicElements;
6
+ as?: keyof React.JSX.IntrinsicElements;
7
7
  children: React.ReactNode;
8
8
  };
@@ -8,4 +8,7 @@ declare const _default: {
8
8
  };
9
9
  };
10
10
  export default _default;
11
- export declare const visibility: () => import("react").JSX.Element;
11
+ export declare const visibility: {
12
+ name: string;
13
+ render: () => import("react").JSX.Element;
14
+ };
@@ -9,28 +9,31 @@ export default {
9
9
  },
10
10
  },
11
11
  };
12
- export const visibility = () => (<Example>
13
- <Example.Item title="hide: always">
14
- <Hidden hide={true}>Content</Hidden>
15
- </Example.Item>
16
- <Example.Item title="shown on s">
17
- <Hidden hide={{ s: false, m: true }}>Content</Hidden>
18
- </Example.Item>
19
- <Example.Item title="shown on l/xl">
20
- <Hidden hide={{ s: true, l: false }}>Content</Hidden>
21
- </Example.Item>
22
- <Example.Item title="shown on m/l/xl">
23
- <Hidden hide={{ s: true, m: false }}>Content</Hidden>
24
- </Example.Item>
25
- <Example.Item title="shown on m">
26
- <Hidden hide={{ s: true, m: false, l: true }}>Content</Hidden>
27
- </Example.Item>
28
- <Example.Item title="shown on s/xl">
29
- <Hidden hide={{ s: false, m: true, xl: false }}>Content</Hidden>
30
- </Example.Item>
31
- <Example.Item title="hide: always, visibility">
32
- <Hidden hide visibility>
33
- Content
34
- </Hidden>
35
- </Example.Item>
36
- </Example>);
12
+ export const visibility = {
13
+ name: "visibility",
14
+ render: () => (<Example>
15
+ <Example.Item title="hide: always">
16
+ <Hidden hide={true}>Content</Hidden>
17
+ </Example.Item>
18
+ <Example.Item title="shown on s">
19
+ <Hidden hide={{ s: false, m: true }}>Content</Hidden>
20
+ </Example.Item>
21
+ <Example.Item title="shown on l/xl">
22
+ <Hidden hide={{ s: true, l: false }}>Content</Hidden>
23
+ </Example.Item>
24
+ <Example.Item title="shown on m/l/xl">
25
+ <Hidden hide={{ s: true, m: false }}>Content</Hidden>
26
+ </Example.Item>
27
+ <Example.Item title="shown on m">
28
+ <Hidden hide={{ s: true, m: false, l: true }}>Content</Hidden>
29
+ </Example.Item>
30
+ <Example.Item title="shown on s/xl">
31
+ <Hidden hide={{ s: false, m: true, xl: false }}>Content</Hidden>
32
+ </Example.Item>
33
+ <Example.Item title="hide: always, visibility">
34
+ <Hidden hide visibility>
35
+ Content
36
+ </Hidden>
37
+ </Example.Item>
38
+ </Example>),
39
+ };
@@ -0,0 +1,15 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ component: (props: import("./..").HiddenProps) => import("react").JSX.Element;
5
+ parameters: {
6
+ iframe: {
7
+ url: string;
8
+ };
9
+ chromatic: {
10
+ disableSnapshot: boolean;
11
+ };
12
+ };
13
+ };
14
+ export default _default;
15
+ export declare const as: StoryObj;
@@ -0,0 +1,20 @@
1
+ import { expect } from "@storybook/test";
2
+ import Hidden from "../index.js";
3
+ export default {
4
+ title: "Utilities/Hidden/tests",
5
+ component: Hidden,
6
+ parameters: {
7
+ iframe: {
8
+ url: "https://reshaped.so/docs/utilities/hidden",
9
+ },
10
+ chromatic: { disableSnapshot: true },
11
+ },
12
+ };
13
+ export const as = {
14
+ name: "as",
15
+ render: () => <Hidden as="span">Content</Hidden>,
16
+ play: ({ canvas }) => {
17
+ const el = canvas.getByText("Content");
18
+ expect(el.tagName).toEqual("SPAN");
19
+ },
20
+ };
@@ -8,4 +8,7 @@ declare const _default: {
8
8
  };
9
9
  };
10
10
  export default _default;
11
- export declare const visibility: () => import("react").JSX.Element;
11
+ export declare const visibility: {
12
+ name: string;
13
+ render: () => import("react").JSX.Element;
14
+ };
@@ -9,8 +9,11 @@ export default {
9
9
  },
10
10
  },
11
11
  };
12
- export const visibility = () => (<Example>
13
- <Example.Item title="pronounced by screen readers">
14
- <HiddenVisually>Screen-reader only</HiddenVisually>
15
- </Example.Item>
16
- </Example>);
12
+ export const visibility = {
13
+ name: "visibility",
14
+ render: () => (<Example>
15
+ <Example.Item title="pronounced by screen readers">
16
+ <HiddenVisually>Screen-reader only</HiddenVisually>
17
+ </Example.Item>
18
+ </Example>),
19
+ };
@@ -0,0 +1,15 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ component: (props: import("./..").HiddenVisuallyProps) => import("react").JSX.Element;
5
+ parameters: {
6
+ iframe: {
7
+ url: string;
8
+ };
9
+ chromatic: {
10
+ disableSnapshot: boolean;
11
+ };
12
+ };
13
+ };
14
+ export default _default;
15
+ export declare const children: StoryObj;
@@ -0,0 +1,20 @@
1
+ import { expect } from "@storybook/test";
2
+ import HiddenVisually from "../index.js";
3
+ export default {
4
+ title: "Utilities/HiddenVisually/tests",
5
+ component: HiddenVisually,
6
+ parameters: {
7
+ iframe: {
8
+ url: "https://reshaped.so/docs/utilities/hidden-visually",
9
+ },
10
+ chromatic: { disableSnapshot: true },
11
+ },
12
+ };
13
+ export const children = {
14
+ name: "children",
15
+ render: () => <HiddenVisually>Content</HiddenVisually>,
16
+ play: ({ canvas }) => {
17
+ const el = canvas.getByText("Content");
18
+ expect(el).toBeInTheDocument();
19
+ },
20
+ };
@@ -0,0 +1,15 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ declare const _default: {
3
+ title: string;
4
+ component: (props: import("..").HotkeyProps) => import("react").JSX.Element;
5
+ parameters: {
6
+ iframe: {
7
+ url: string;
8
+ };
9
+ chromatic: {
10
+ disableSnapshot: boolean;
11
+ };
12
+ };
13
+ };
14
+ export default _default;
15
+ export declare const className: StoryObj;
@@ -0,0 +1,26 @@
1
+ import { expect } from "@storybook/test";
2
+ import Hotkey from "../Hotkey.js";
3
+ export default {
4
+ title: "Components/Hotkey/tests",
5
+ component: Hotkey,
6
+ parameters: {
7
+ iframe: {
8
+ url: "https://reshaped.so/docs/components/hotkey",
9
+ },
10
+ chromatic: { disableSnapshot: true },
11
+ },
12
+ };
13
+ export const className = {
14
+ name: "className, attributes",
15
+ render: () => (<div data-testid="root">
16
+ <Hotkey className="test-classname" attributes={{ id: "test-id" }}>
17
+ ⌘K
18
+ </Hotkey>
19
+ </div>),
20
+ play: async ({ canvas }) => {
21
+ const root = canvas.getByTestId("root").firstChild;
22
+ expect(root).toHaveClass("test-classname");
23
+ expect(root).toHaveAttribute("id", "test-id");
24
+ expect(root?.tagName).toBe("KBD");
25
+ },
26
+ };
@@ -8,6 +8,15 @@ declare const _default: {
8
8
  };
9
9
  };
10
10
  export default _default;
11
- export declare const size: () => import("react").JSX.Element;
12
- export declare const color: () => import("react").JSX.Element;
13
- export declare const autoWidth: () => import("react").JSX.Element;
11
+ export declare const size: {
12
+ name: string;
13
+ render: () => import("react").JSX.Element;
14
+ };
15
+ export declare const color: {
16
+ name: string;
17
+ render: () => import("react").JSX.Element;
18
+ };
19
+ export declare const autoWidth: {
20
+ name: string;
21
+ render: () => import("react").JSX.Element;
22
+ };