reshaped 3.3.11 → 3.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/bundle.css +1 -1
  3. package/dist/bundle.d.ts +1 -1
  4. package/dist/bundle.js +16 -17
  5. package/dist/cjs/themes/_generator/utilities/generateColors.d.ts +1 -1
  6. package/dist/cjs/themes/_generator/utilities/generateColors.js +3 -2
  7. package/dist/cjs/themes/_generator/utilities/tests/color.test.js +32 -31
  8. package/dist/cjs/themes/slate/theme.css +1 -1
  9. package/dist/components/Accordion/tests/Accordion.stories.d.ts +30 -8
  10. package/dist/components/Accordion/tests/Accordion.stories.js +172 -119
  11. package/dist/components/ActionBar/tests/ActionBar.stories.d.ts +12 -3
  12. package/dist/components/ActionBar/tests/ActionBar.stories.js +51 -36
  13. package/dist/components/ActionBar/tests/ActionBar.test.stories.d.ts +15 -0
  14. package/dist/components/ActionBar/tests/ActionBar.test.stories.js +26 -0
  15. package/dist/components/Actionable/Actionable.js +1 -1
  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/tests/Card.stories.d.ts +0 -1
  55. package/dist/components/Card/tests/Card.stories.js +0 -11
  56. package/dist/components/Card/tests/Card.test.stories.d.ts +35 -0
  57. package/dist/components/Card/tests/Card.test.stories.js +54 -0
  58. package/dist/components/Carousel/Carousel.js +52 -4
  59. package/dist/components/Carousel/Carousel.types.d.ts +4 -0
  60. package/dist/components/Carousel/CarouselControl.js +1 -1
  61. package/dist/components/Carousel/tests/Carousel.stories.d.ts +23 -4
  62. package/dist/components/Carousel/tests/Carousel.stories.js +199 -102
  63. package/dist/components/Checkbox/tests/Checkbox.test.stories.d.ts +25 -0
  64. package/dist/components/Checkbox/tests/Checkbox.test.stories.js +104 -0
  65. package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.d.ts +22 -0
  66. package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.js +78 -0
  67. package/dist/components/Container/tests/Container.stories.d.ts +12 -3
  68. package/dist/components/Container/tests/Container.stories.js +50 -31
  69. package/dist/components/Container/tests/Container.test.stories.d.ts +15 -0
  70. package/dist/components/Container/tests/Container.test.stories.js +26 -0
  71. package/dist/components/ContextMenu/ContextMenu.js +13 -9
  72. package/dist/components/ContextMenu/tests/ContextMenu.stories.js +2 -3
  73. package/dist/components/ContextMenu/tests/ContextMenu.test.stories.d.ts +26 -0
  74. package/dist/components/ContextMenu/tests/ContextMenu.test.stories.js +53 -0
  75. package/dist/components/Dismissible/Dismissible.js +1 -1
  76. package/dist/components/Dismissible/tests/Dismissible.stories.d.ts +10 -3
  77. package/dist/components/Dismissible/tests/Dismissible.stories.js +51 -34
  78. package/dist/components/Dismissible/tests/Dismissible.test.stories.d.ts +19 -0
  79. package/dist/components/Dismissible/tests/Dismissible.test.stories.js +42 -0
  80. package/dist/components/Divider/tests/Divider.test.stories.d.ts +18 -0
  81. package/dist/components/Divider/tests/Divider.test.stories.js +47 -0
  82. package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.d.ts +37 -0
  83. package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.js +117 -0
  84. package/dist/components/FileUpload/tests/FileUpload.test.stories.d.ts +22 -0
  85. package/dist/components/FileUpload/tests/FileUpload.test.stories.js +52 -0
  86. package/dist/components/FormControl/FormControlCaption.js +1 -1
  87. package/dist/components/FormControl/FormControlLabel.js +1 -1
  88. package/dist/components/FormControl/tests/FormControl.stories.d.ts +11 -5
  89. package/dist/components/FormControl/tests/FormControl.stories.js +78 -73
  90. package/dist/components/FormControl/tests/FormControl.test.stories.d.ts +20 -0
  91. package/dist/components/FormControl/tests/FormControl.test.stories.js +49 -0
  92. package/dist/components/Grid/tests/Grid.stories.d.ts +20 -5
  93. package/dist/components/Grid/tests/Grid.stories.js +164 -149
  94. package/dist/components/Grid/tests/Grid.test.stories.d.ts +19 -0
  95. package/dist/components/Grid/tests/Grid.test.stories.js +42 -0
  96. package/dist/components/Hidden/tests/Hidden.stories.d.ts +4 -1
  97. package/dist/components/Hidden/tests/Hidden.stories.js +28 -25
  98. package/dist/components/Hidden/tests/Hidden.test.stories.d.ts +15 -0
  99. package/dist/components/Hidden/tests/Hidden.test.stories.js +20 -0
  100. package/dist/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +4 -1
  101. package/dist/components/HiddenVisually/tests/HiddenVisually.stories.js +8 -5
  102. package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.d.ts +15 -0
  103. package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.js +20 -0
  104. package/dist/components/Hotkey/tests/Hotkey.test.stories.d.ts +15 -0
  105. package/dist/components/Hotkey/tests/Hotkey.test.stories.js +26 -0
  106. package/dist/components/Icon/tests/Icon.stories.d.ts +12 -3
  107. package/dist/components/Icon/tests/Icon.stories.js +69 -60
  108. package/dist/components/Icon/tests/Icon.test.stories.d.ts +16 -0
  109. package/dist/components/Icon/tests/Icon.test.stories.js +35 -0
  110. package/dist/components/Image/tests/Image.stories.d.ts +24 -5
  111. package/dist/components/Image/tests/Image.stories.js +95 -75
  112. package/dist/components/Image/tests/Image.test.stories.d.ts +25 -0
  113. package/dist/components/Image/tests/Image.test.stories.js +80 -0
  114. package/dist/components/Link/tests/Link.test.stories.d.ts +29 -0
  115. package/dist/components/Link/tests/Link.test.stories.js +87 -0
  116. package/dist/components/Loader/Loader.js +1 -1
  117. package/dist/components/Loader/Loader.types.d.ts +1 -0
  118. package/dist/components/Loader/tests/Loader.stories.js +8 -8
  119. package/dist/components/Loader/tests/Loader.test.stories.d.ts +16 -0
  120. package/dist/components/Loader/tests/Loader.test.stories.js +32 -0
  121. package/dist/components/MenuItem/tests/MenuItem.test.stories.d.ts +26 -0
  122. package/dist/components/MenuItem/tests/MenuItem.test.stories.js +100 -0
  123. package/dist/components/Modal/tests/Modal.test.stories.d.ts +32 -0
  124. package/dist/components/Modal/tests/Modal.test.stories.js +149 -0
  125. package/dist/components/Overlay/tests/Overlay.stories.d.ts +4 -2
  126. package/dist/components/Overlay/tests/Overlay.stories.js +53 -53
  127. package/dist/components/Overlay/tests/Overlay.test.stories.d.ts +28 -0
  128. package/dist/components/Overlay/tests/Overlay.test.stories.js +146 -0
  129. package/dist/components/Pagination/tests/Pagination.test.stories.d.ts +23 -0
  130. package/dist/components/Pagination/tests/Pagination.test.stories.js +86 -0
  131. package/dist/components/PinField/tests/PinField.stories.d.ts +0 -1
  132. package/dist/components/PinField/tests/PinField.stories.js +10 -19
  133. package/dist/components/PinField/tests/PinField.test.stories.d.ts +29 -0
  134. package/dist/components/PinField/tests/PinField.test.stories.js +177 -0
  135. package/dist/components/Popover/tests/Popover.test.stories.d.ts +40 -0
  136. package/dist/components/Popover/tests/Popover.test.stories.js +167 -0
  137. package/dist/components/Progress/Progress.js +2 -2
  138. package/dist/components/Progress/Progress.types.d.ts +1 -0
  139. package/dist/components/Progress/tests/Progress.stories.js +10 -10
  140. package/dist/components/Progress/tests/Progress.test.stories.d.ts +16 -0
  141. package/dist/components/Progress/tests/Progress.test.stories.js +35 -0
  142. package/dist/components/Radio/tests/Radio.test.stories.d.ts +30 -0
  143. package/dist/components/Radio/tests/Radio.test.stories.js +118 -0
  144. package/dist/components/RadioGroup/tests/RadioGroup.test.stories.d.ts +22 -0
  145. package/dist/components/RadioGroup/tests/RadioGroup.test.stories.js +78 -0
  146. package/dist/components/Reshaped/tests/Reshaped.stories.d.ts +33 -0
  147. package/dist/components/Reshaped/tests/Reshaped.stories.js +88 -0
  148. package/dist/components/Resizable/Resizable.js +1 -0
  149. package/dist/components/Resizable/tests/Resizable.stories.d.ts +3 -0
  150. package/dist/components/Resizable/tests/Resizable.stories.js +4 -0
  151. package/dist/components/Resizable/tests/Resizable.test.stories.d.ts +19 -0
  152. package/dist/components/Resizable/tests/Resizable.test.stories.js +25 -0
  153. package/dist/components/Scrim/tests/Scrim.test.stories.d.ts +15 -0
  154. package/dist/components/Scrim/tests/Scrim.test.stories.js +25 -0
  155. package/dist/components/ScrollArea/ScrollArea.js +1 -1
  156. package/dist/components/ScrollArea/ScrollArea.module.css +1 -1
  157. package/dist/components/ScrollArea/tests/ScrollArea.stories.d.ts +17 -4
  158. package/dist/components/ScrollArea/tests/ScrollArea.stories.js +114 -139
  159. package/dist/components/ScrollArea/tests/ScrollArea.test.stories.d.ts +23 -0
  160. package/dist/components/ScrollArea/tests/ScrollArea.test.stories.js +66 -0
  161. package/dist/components/Select/tests/Select.stories.d.ts +1 -1
  162. package/dist/components/Select/tests/Select.stories.js +5 -12
  163. package/dist/components/Select/tests/Select.test.stories.d.ts +27 -0
  164. package/dist/components/Select/tests/Select.test.stories.js +132 -0
  165. package/dist/components/Skeleton/tests/Skeleton.test.stories.d.ts +15 -0
  166. package/dist/components/Skeleton/tests/Skeleton.test.stories.js +23 -0
  167. package/dist/components/Slider/tests/Slider.stories.d.ts +0 -1
  168. package/dist/components/Slider/tests/Slider.stories.js +8 -9
  169. package/dist/components/Slider/tests/Slider.test.stories.d.ts +38 -0
  170. package/dist/components/Slider/tests/Slider.test.stories.js +150 -0
  171. package/dist/components/Stepper/Stepper.js +1 -1
  172. package/dist/components/Stepper/tests/Stepper.stories.js +0 -3
  173. package/dist/components/Stepper/tests/Stepper.test.stories.d.ts +18 -0
  174. package/dist/components/Stepper/tests/Stepper.test.stories.js +28 -0
  175. package/dist/components/Switch/tests/Switch.test.stories.d.ts +23 -0
  176. package/dist/components/Switch/tests/Switch.test.stories.js +79 -0
  177. package/dist/components/Table/index.d.ts +1 -1
  178. package/dist/components/Table/tests/Table.stories.d.ts +5 -5
  179. package/dist/components/Table/tests/Table.test.stories.d.ts +25 -0
  180. package/dist/components/Table/tests/Table.test.stories.js +93 -0
  181. package/dist/components/Tabs/tests/Tabs.stories.js +4 -4
  182. package/dist/components/Tabs/tests/Tabs.test.stories.d.ts +28 -0
  183. package/dist/components/Tabs/tests/Tabs.test.stories.js +128 -0
  184. package/dist/components/Text/tests/Text.stories.d.ts +28 -7
  185. package/dist/components/Text/tests/Text.stories.js +148 -125
  186. package/dist/components/Text/tests/Text.test.stories.d.ts +18 -0
  187. package/dist/components/Text/tests/Text.test.stories.js +49 -0
  188. package/dist/components/TextArea/TextArea.module.css +1 -1
  189. package/dist/components/TextArea/tests/TextArea.stories.js +1 -1
  190. package/dist/components/TextArea/tests/TextArea.test.stories.d.ts +29 -0
  191. package/dist/components/TextArea/tests/TextArea.test.stories.js +99 -0
  192. package/dist/components/TextField/tests/TextField.stories.js +1 -1
  193. package/dist/components/TextField/tests/TextField.test.stories.d.ts +29 -0
  194. package/dist/components/TextField/tests/TextField.test.stories.js +99 -0
  195. package/dist/components/Theme/tests/Theme.test.stories.d.ts +24 -0
  196. package/dist/components/Theme/tests/Theme.test.stories.js +133 -0
  197. package/dist/components/Timeline/tests/Timeline.test.stories.d.ts +18 -0
  198. package/dist/components/Timeline/tests/Timeline.test.stories.js +32 -0
  199. package/dist/components/Toast/tests/Toast.test.stories.d.ts +16 -0
  200. package/dist/components/Toast/tests/Toast.test.stories.js +101 -0
  201. package/dist/components/Tooltip/tests/Tooltip.stories.js +0 -14
  202. package/dist/components/Tooltip/tests/Tooltip.test.stories.d.ts +19 -0
  203. package/dist/components/Tooltip/tests/Tooltip.test.stories.js +40 -0
  204. package/dist/components/View/View.js +1 -2
  205. package/dist/components/View/tests/View.stories.d.ts +112 -28
  206. package/dist/components/View/tests/View.stories.js +1092 -1012
  207. package/dist/components/View/tests/View.test.stories.d.ts +20 -0
  208. package/dist/components/View/tests/View.test.stories.js +50 -0
  209. package/dist/components/_private/Flyout/FlyoutContent.js +1 -1
  210. package/dist/components/_private/Flyout/tests/Flyout.stories.js +4 -4
  211. package/dist/components/_private/Flyout/tests/Flyout.test.stories.d.ts +28 -0
  212. package/dist/components/_private/Flyout/tests/Flyout.test.stories.js +205 -0
  213. package/dist/components/_private/Portal/tests/Portal.stories.js +1 -1
  214. package/dist/hooks/_private/useSingletonHotkeys.d.ts +3 -3
  215. package/dist/hooks/_private/useSingletonHotkeys.js +1 -1
  216. package/dist/hooks/tests/useDrag.stories.js +1 -0
  217. package/dist/hooks/tests/useDrag.test.stories.d.ts +26 -0
  218. package/dist/hooks/tests/useDrag.test.stories.js +120 -0
  219. package/dist/hooks/tests/useElementId.stories.d.ts +6 -0
  220. package/dist/hooks/tests/useElementId.stories.js +19 -0
  221. package/dist/hooks/tests/useHotkeys.test.stories.d.ts +39 -0
  222. package/dist/hooks/tests/useHotkeys.test.stories.js +119 -0
  223. package/dist/hooks/tests/useRTL.stories.d.ts +6 -0
  224. package/dist/hooks/tests/useRTL.stories.js +25 -0
  225. package/dist/hooks/tests/useResponsiveClientValue.stories.d.ts +9 -1
  226. package/dist/hooks/tests/useResponsiveClientValue.stories.js +22 -9
  227. package/dist/hooks/tests/useScrollLock.stories.d.ts +6 -0
  228. package/dist/hooks/tests/useScrollLock.stories.js +22 -0
  229. package/dist/hooks/tests/useToggle.stories.d.ts +8 -0
  230. package/dist/hooks/tests/useToggle.stories.js +54 -0
  231. package/dist/hooks/useHotkeys.js +0 -2
  232. package/dist/hooks/useScrollLock.d.ts +1 -0
  233. package/dist/hooks/useScrollLock.js +7 -3
  234. package/dist/index.d.ts +1 -1
  235. package/dist/tests/ShadowDOM.stories.js +1 -1
  236. package/dist/themes/_generator/tests/themes.stories.d.ts +3 -0
  237. package/dist/themes/_generator/tests/themes.stories.js +7 -11
  238. package/dist/themes/_generator/utilities/generateColors.d.ts +1 -1
  239. package/dist/themes/_generator/utilities/generateColors.js +3 -2
  240. package/dist/themes/slate/theme.css +1 -1
  241. package/dist/utilities/helpers.d.ts +1 -0
  242. package/dist/utilities/helpers.js +3 -0
  243. package/dist/utilities/scroll/lock.d.ts +1 -0
  244. package/dist/utilities/scroll/lock.js +3 -3
  245. package/dist/utilities/scroll/lockSafari.d.ts +1 -1
  246. package/dist/utilities/scroll/lockSafari.js +4 -5
  247. package/dist/utilities/scroll/lockStandard.d.ts +4 -1
  248. package/dist/utilities/scroll/lockStandard.js +7 -2
  249. package/dist/utilities/storybook/Example.js +1 -2
  250. package/package.json +42 -41
  251. package/dist/components/Theme/tests/Theme.stories.d.ts +0 -13
  252. package/dist/components/Theme/tests/Theme.stories.js +0 -80
  253. package/dist/utilities/storybook/Example.module.css +0 -1
@@ -16,1091 +16,1171 @@ export default {
16
16
  },
17
17
  },
18
18
  };
19
- export const padding = () => (<Example title="Border is used to highlight the padding value">
20
- <Example.Item title="padding: 4">
21
- <View padding={4} borderColor="neutral">
22
- <Placeholder />
23
- </View>
24
- </Example.Item>
25
- <Example.Item title="padding: 6">
26
- <View padding={6} borderColor="neutral">
27
- <Placeholder />
28
- </View>
29
- </Example.Item>
30
- <Example.Item title="padding: 0">
31
- <View padding={0} borderColor="neutral">
32
- <Placeholder />
33
- </View>
34
- </Example.Item>
35
- <Example.Item title="padding: vertical 2, horizontal 4">
36
- <View paddingInline={4} paddingBlock={2} borderColor="neutral">
37
- <Placeholder />
38
- </View>
39
- </Example.Item>
40
- <Example.Item title="paddingTop: 4">
41
- <View paddingTop={4} borderColor="neutral">
42
- <Placeholder />
43
- </View>
44
- </Example.Item>
45
- <Example.Item title="paddingBottom: 4">
46
- <View paddingBottom={4} borderColor="neutral">
47
- <Placeholder />
48
- </View>
49
- </Example.Item>
50
- <Example.Item title="paddingStart: 4">
51
- <View paddingStart={4} borderColor="neutral">
52
- <Placeholder />
53
- </View>
54
- </Example.Item>
55
- <Example.Item title="paddingEnd: 4">
56
- <View paddingEnd={4} borderColor="neutral">
57
- <Placeholder />
58
- </View>
59
- </Example.Item>
60
- <Example.Item title={[
61
- "responsive padding:",
62
- "[s] vertical 2, horizontal 4",
63
- "[m+] vertical 4, horizontal 8",
64
- ]}>
65
- <View paddingInline={{ s: 4, m: 8 }} paddingBlock={{ s: 2, m: 4 }} borderColor="neutral">
66
- <Placeholder />
67
- </View>
68
- </Example.Item>
69
- <Example.Item title={["responsive padding:", "[s] top 2, bottom 4", "[m+] top 4, bottom 0, start: 8"]}>
70
- <View paddingTop={{ s: 2, m: 4 }} paddingBottom={{ s: 4, m: 0 }} paddingStart={{ s: 0, m: 8 }} borderColor="neutral">
71
- <Placeholder />
72
- </View>
73
- </Example.Item>
74
- <Example.Item title="nested padding, child view should have no horizontal padding">
75
- <View paddingStart={4} borderColor="neutral">
76
- <View borderColor="primary" paddingBlock={4}>
19
+ export const padding = {
20
+ name: "padding",
21
+ render: () => (<Example title="Border is used to highlight the padding value">
22
+ <Example.Item title="padding: 4">
23
+ <View padding={4} borderColor="neutral">
77
24
  <Placeholder />
78
25
  </View>
79
- </View>
80
- </Example.Item>
81
- </Example>);
82
- export const direction = () => (<Example title="Item 1 is another component, Item 2 is View.Item, Item 3 is text">
83
- <Example.Item title="direction: column as default">
84
- <View gap={3}>
85
- <Placeholder>Item 1</Placeholder>
86
- <View.Item>
26
+ </Example.Item>
27
+ <Example.Item title="padding: 6">
28
+ <View padding={6} borderColor="neutral">
29
+ <Placeholder />
30
+ </View>
31
+ </Example.Item>
32
+ <Example.Item title="padding: 0">
33
+ <View padding={0} borderColor="neutral">
34
+ <Placeholder />
35
+ </View>
36
+ </Example.Item>
37
+ <Example.Item title="padding: vertical 2, horizontal 4">
38
+ <View paddingInline={4} paddingBlock={2} borderColor="neutral">
39
+ <Placeholder />
40
+ </View>
41
+ </Example.Item>
42
+ <Example.Item title="paddingTop: 4">
43
+ <View paddingTop={4} borderColor="neutral">
44
+ <Placeholder />
45
+ </View>
46
+ </Example.Item>
47
+ <Example.Item title="paddingBottom: 4">
48
+ <View paddingBottom={4} borderColor="neutral">
49
+ <Placeholder />
50
+ </View>
51
+ </Example.Item>
52
+ <Example.Item title="paddingStart: 4">
53
+ <View paddingStart={4} borderColor="neutral">
54
+ <Placeholder />
55
+ </View>
56
+ </Example.Item>
57
+ <Example.Item title="paddingEnd: 4">
58
+ <View paddingEnd={4} borderColor="neutral">
59
+ <Placeholder />
60
+ </View>
61
+ </Example.Item>
62
+ <Example.Item title={[
63
+ "responsive padding:",
64
+ "[s] vertical 2, horizontal 4",
65
+ "[m+] vertical 4, horizontal 8",
66
+ ]}>
67
+ <View paddingInline={{ s: 4, m: 8 }} paddingBlock={{ s: 2, m: 4 }} borderColor="neutral">
68
+ <Placeholder />
69
+ </View>
70
+ </Example.Item>
71
+ <Example.Item title={["responsive padding:", "[s] top 2, bottom 4", "[m+] top 4, bottom 0, start: 8"]}>
72
+ <View paddingTop={{ s: 2, m: 4 }} paddingBottom={{ s: 4, m: 0 }} paddingStart={{ s: 0, m: 8 }} borderColor="neutral">
73
+ <Placeholder />
74
+ </View>
75
+ </Example.Item>
76
+ <Example.Item title="nested padding, child view should have no horizontal padding">
77
+ <View paddingStart={4} borderColor="neutral">
78
+ <View borderColor="primary" paddingBlock={4}>
79
+ <Placeholder />
80
+ </View>
81
+ </View>
82
+ </Example.Item>
83
+ </Example>),
84
+ };
85
+ export const direction = {
86
+ name: "direction",
87
+ render: () => (<Example title="Item 1 is another component, Item 2 is View.Item, Item 3 is text">
88
+ <Example.Item title="direction: column as default">
89
+ <View gap={3}>
90
+ <Placeholder>Item 1</Placeholder>
91
+ <View.Item>
92
+ <Placeholder>Item 2</Placeholder>
93
+ </View.Item>
94
+ Text item 3
95
+ </View>
96
+ </Example.Item>
97
+ <Example.Item title="direction: column">
98
+ <View gap={3} direction="column">
99
+ <Placeholder>Item 1</Placeholder>
100
+ <View.Item>
101
+ <Placeholder>Item 2</Placeholder>
102
+ </View.Item>
103
+ Text item 3
104
+ </View>
105
+ </Example.Item>
106
+ <Example.Item title="direction: column-reverse">
107
+ <View gap={3} direction="column-reverse">
108
+ <Placeholder>Item 1</Placeholder>
109
+ <View.Item>
110
+ <Placeholder>Item 2</Placeholder>
111
+ </View.Item>
112
+ Text item 3
113
+ </View>
114
+ </Example.Item>
115
+ <Example.Item title="direction: row">
116
+ <View gap={3} direction="row">
117
+ <Placeholder>Item 1</Placeholder>
118
+ <View.Item>
119
+ <Placeholder>Item 2</Placeholder>
120
+ </View.Item>
121
+ Text item 3
122
+ </View>
123
+ </Example.Item>
124
+ <Example.Item title="direction: row-reverse">
125
+ <View gap={3} direction="row-reverse">
126
+ <Placeholder>Item 1</Placeholder>
127
+ <View.Item>
128
+ <Placeholder>Item 2</Placeholder>
129
+ </View.Item>
130
+ Text item 3
131
+ </View>
132
+ </Example.Item>
133
+ <Example.Item title={["responsive direction", "[s] column-reverse", "[m] row-reverse", "[l+] row"]}>
134
+ <View direction={{ s: "column-reverse", m: "row-reverse", l: "row" }} gap={3}>
135
+ <Placeholder>Item 1</Placeholder>
87
136
  <Placeholder>Item 2</Placeholder>
88
- </View.Item>
89
- Text item 3
90
- </View>
91
- </Example.Item>
92
- <Example.Item title="direction: column">
93
- <View gap={3} direction="column">
94
- <Placeholder>Item 1</Placeholder>
95
- <View.Item>
137
+ </View>
138
+ </Example.Item>
139
+ </Example>),
140
+ };
141
+ export const gap = {
142
+ name: "gap",
143
+ render: () => (<Example>
144
+ <Example.Item title="gap: 4, direction: row">
145
+ <View direction="row" gap={4} divided>
146
+ <Placeholder>Item 1</Placeholder>
96
147
  <Placeholder>Item 2</Placeholder>
97
- </View.Item>
98
- Text item 3
99
- </View>
100
- </Example.Item>
101
- <Example.Item title="direction: column-reverse">
102
- <View gap={3} direction="column-reverse">
103
- <Placeholder>Item 1</Placeholder>
104
- <View.Item>
148
+ <Placeholder>Item 3</Placeholder>
149
+ </View>
150
+ </Example.Item>
151
+ <Example.Item title="gap: 0, direction: row">
152
+ <View direction="row" gap={0}>
153
+ <Placeholder>Item 1</Placeholder>
105
154
  <Placeholder>Item 2</Placeholder>
106
- </View.Item>
107
- Text item 3
108
- </View>
109
- </Example.Item>
110
- <Example.Item title="direction: row">
111
- <View gap={3} direction="row">
112
- <Placeholder>Item 1</Placeholder>
113
- <View.Item>
155
+ </View>
156
+ </Example.Item>
157
+ <Example.Item title={["responsive gap, direction: row", "[s] 4", "[m+] 8"]}>
158
+ <View direction="row" gap={{ s: 4, m: 8 }}>
159
+ <Placeholder>Item 1</Placeholder>
114
160
  <Placeholder>Item 2</Placeholder>
115
- </View.Item>
116
- Text item 3
117
- </View>
118
- </Example.Item>
119
- <Example.Item title="direction: row-reverse">
120
- <View gap={3} direction="row-reverse">
121
- <Placeholder>Item 1</Placeholder>
122
- <View.Item>
161
+ </View>
162
+ </Example.Item>
163
+ <Example.Item title="gap: 4, direction: column">
164
+ <View gap={4}>
165
+ <Placeholder>Item 1</Placeholder>
123
166
  <Placeholder>Item 2</Placeholder>
124
- </View.Item>
125
- Text item 3
126
- </View>
127
- </Example.Item>
128
- <Example.Item title={["responsive direction", "[s] column-reverse", "[m] row-reverse", "[l+] row"]}>
129
- <View direction={{ s: "column-reverse", m: "row-reverse", l: "row" }} gap={3}>
130
- <Placeholder>Item 1</Placeholder>
131
- <Placeholder>Item 2</Placeholder>
132
- </View>
133
- </Example.Item>
134
- </Example>);
135
- export const gap = () => (<Example>
136
- <Example.Item title="gap: 4, direction: row">
137
- <View direction="row" gap={4} divided>
138
- <Placeholder>Item 1</Placeholder>
139
- <Placeholder>Item 2</Placeholder>
140
- <Placeholder>Item 3</Placeholder>
141
- </View>
142
- </Example.Item>
143
- <Example.Item title="gap: 0, direction: row">
144
- <View direction="row" gap={0}>
145
- <Placeholder>Item 1</Placeholder>
146
- <Placeholder>Item 2</Placeholder>
147
- </View>
148
- </Example.Item>
149
- <Example.Item title={["responsive gap, direction: row", "[s] 4", "[m+] 8"]}>
150
- <View direction="row" gap={{ s: 4, m: 8 }}>
151
- <Placeholder>Item 1</Placeholder>
152
- <Placeholder>Item 2</Placeholder>
153
- </View>
154
- </Example.Item>
155
- <Example.Item title="gap: 4, direction: column">
156
- <View gap={4}>
157
- <Placeholder>Item 1</Placeholder>
158
- <Placeholder>Item 2</Placeholder>
159
- </View>
160
- </Example.Item>
161
- <Example.Item title="gap: 0, direction: column">
162
- <View gap={0}>
163
- <Placeholder>Item 1</Placeholder>
164
- <Placeholder>Item 2</Placeholder>
165
- </View>
166
- </Example.Item>
167
- <Example.Item title={["responsive gap, direction: column", "[s] 4", "[m+] 8"]}>
168
- <View gap={{ s: 4, m: 8 }}>
169
- <Placeholder>Item 1</Placeholder>
170
- <Placeholder>Item 2</Placeholder>
171
- </View>
172
- </Example.Item>
173
- </Example>);
174
- export const divided = () => (<Example>
175
- <Example.Item title="direction: row">
176
- <View divided direction="row" gap={3}>
177
- <Placeholder>Item 1</Placeholder>
178
- <Placeholder>Item 2</Placeholder>
179
- </View>
180
- </Example.Item>
181
- <Example.Item title="direction: column">
182
- <View divided gap={3}>
183
- <Placeholder>Item 1</Placeholder>
184
- <Placeholder>Item 2</Placeholder>
185
- </View>
186
- </Example.Item>
187
- <Example.Item title={["responsive divided", "[s] direction: row", "[m+] direction: column"]}>
188
- <View divided direction={{ s: "row", m: "column" }} gap={3}>
189
- <Placeholder />
190
- <Placeholder />
191
- </View>
192
- </Example.Item>
193
- <Example.Item title="direction: row, columns">
194
- <View divided gap={3} direction="row">
195
- <View.Item columns={2}>
167
+ </View>
168
+ </Example.Item>
169
+ <Example.Item title="gap: 0, direction: column">
170
+ <View gap={0}>
196
171
  <Placeholder>Item 1</Placeholder>
197
- </View.Item>
198
- <View.Item columns={8}>
199
172
  <Placeholder>Item 2</Placeholder>
200
- </View.Item>
201
- <View.Item columns={2}>
202
- <Placeholder>Item 3</Placeholder>
203
- </View.Item>
204
- </View>
205
- </Example.Item>
206
- <Example.Item title="with React.Fragment">
207
- <View direction="row" gap={4} divided>
208
- <Placeholder>Item 1</Placeholder>
209
- <>
173
+ </View>
174
+ </Example.Item>
175
+ <Example.Item title={["responsive gap, direction: column", "[s] 4", "[m+] 8"]}>
176
+ <View gap={{ s: 4, m: 8 }}>
177
+ <Placeholder>Item 1</Placeholder>
210
178
  <Placeholder>Item 2</Placeholder>
211
- <Placeholder>Item 3</Placeholder>
212
- </>
213
- </View>
214
- </Example.Item>
215
- </Example>);
216
- export const bleed = () => (<Example title="Removes side borders and border radius when applied">
217
- <Example.Item title="bleed: 4">
218
- <View bleed={4} padding={4} borderColor="neutral">
219
- <Placeholder />
220
- </View>
221
- </Example.Item>
222
- <Example.Item title={["responsive bleed", "[s] 4", "[m+] 0"]}>
223
- <View bleed={{ s: 4, m: 0 }} padding={4} borderRadius="small" borderColor="neutral">
224
- <Placeholder />
225
- </View>
226
- </Example.Item>
227
- </Example>);
228
- export const wrap = () => (<Example>
229
- <Example.Item title="wrap: false">
230
- <View direction="row" wrap={false} gap={3}>
231
- <Placeholder w={600} h={100}/>
232
- <Placeholder w={600} h={100}/>
233
- </View>
234
- </Example.Item>
235
- </Example>);
236
- export const align = () => (<Example>
237
- <Example.Item title="align: start, direction: row">
238
- <View align="start" direction="row" gap={3}>
239
- <Placeholder />
240
- <Placeholder h={100}/>
241
- </View>
242
- </Example.Item>
243
- <Example.Item title="align: center, direction: row">
244
- <View align="center" direction="row" gap={3}>
245
- <Placeholder />
246
- <Placeholder h={100}/>
247
- </View>
248
- </Example.Item>
249
- <Example.Item title="align: end, direction: row">
250
- <View align="end" direction="row" gap={3}>
251
- <Placeholder />
252
- <Placeholder h={100}/>
253
- </View>
254
- </Example.Item>
255
- <Example.Item title={[
256
- "align: stretch, direction: row",
257
- "2nd item is stretched based on the 1st item height",
258
- ]}>
259
- <View align="stretch" direction="row" gap={3}>
260
- <Placeholder h={100}/>
261
- <Placeholder h="auto"/>
262
- </View>
263
- </Example.Item>
264
- <Example.Item title="align: baseline, direction: row">
265
- <View align="baseline" direction="row" gap={3}>
266
- <Placeholder />
267
- <Text variant="title-6">Content</Text>
268
- </View>
269
- </Example.Item>
270
-
271
- <Example.Item title="align: start, direction: column">
272
- <View align="start" direction="column" gap={3}>
273
- <Placeholder />
274
- <Placeholder w={100}/>
275
- </View>
276
- </Example.Item>
277
- <Example.Item title="align: center, direction: column">
278
- <View align="center" direction="column" gap={3}>
279
- <Placeholder />
280
- <Placeholder w={100}/>
281
- </View>
282
- </Example.Item>
283
- <Example.Item title="align: end, direction: row">
284
- <View align="end" direction="column" gap={3}>
285
- <Placeholder />
286
- <Placeholder w={100}/>
287
- </View>
288
- </Example.Item>
289
- <Example.Item title={[
290
- "align: stretch, direction: column",
291
- "1st item uses its own width, 2nd item is stretched to full width",
292
- ]}>
293
- <View align="stretch" direction="column" gap={3}>
294
- <Placeholder w={100}/>
295
- <Placeholder w="auto"/>
296
- </View>
297
- </Example.Item>
298
- </Example>);
299
- export const justify = () => (<Example>
300
- <Example.Item title="justify: start, direction: row">
301
- <View justify="start" direction="row" gap={3}>
302
- <Placeholder />
303
- <Placeholder />
304
- </View>
305
- </Example.Item>
306
- <Example.Item title="justify: center, direction: row">
307
- <View justify="center" direction="row" gap={3}>
308
- <Placeholder />
309
- <Placeholder />
310
- </View>
311
- </Example.Item>
312
- <Example.Item title="justify: end, direction: row">
313
- <View justify="end" direction="row" gap={3}>
314
- <Placeholder />
315
- <Placeholder />
316
- </View>
317
- </Example.Item>
318
- <Example.Item title="justify: space-between, direction: row">
319
- <View justify="space-between" direction="row" gap={3}>
320
- <Placeholder />
321
- <Placeholder />
322
- </View>
323
- </Example.Item>
324
-
325
- <Example.Item title="justify: start, direction: column, height: 200px">
326
- <View height="200px" justify="start" direction="column" gap={3}>
327
- <Placeholder />
328
- <Placeholder />
329
- </View>
330
- </Example.Item>
331
- <Example.Item title="justify: center, direction: column, height: 200px">
332
- <View height="200px" justify="center" direction="column" gap={3}>
333
- <Placeholder />
334
- <Placeholder />
335
- </View>
336
- </Example.Item>
337
- <Example.Item title="justify: end, direction: column, height: 200px">
338
- <View justify="end" height="200px" direction="column" gap={3}>
339
- <Placeholder />
340
- <Placeholder />
341
- </View>
342
- </Example.Item>
343
- <Example.Item title="justify: space-between, direction: column, height: 200px">
344
- <View justify="space-between" height="200px" direction="column" gap={3}>
345
- <Placeholder />
346
- <Placeholder />
347
- </View>
348
- </Example.Item>
349
- </Example>);
350
- export const textAlign = () => (<Example>
351
- <Example.Item title="textAlign: start">
352
- <View textAlign="start">Content</View>
353
- </Example.Item>
179
+ </View>
180
+ </Example.Item>
181
+ </Example>),
182
+ };
183
+ export const divided = {
184
+ name: "divided",
185
+ render: () => (<Example>
186
+ <Example.Item title="direction: row">
187
+ <View divided direction="row" gap={3}>
188
+ <Placeholder>Item 1</Placeholder>
189
+ <Placeholder>Item 2</Placeholder>
190
+ </View>
191
+ </Example.Item>
192
+ <Example.Item title="direction: column">
193
+ <View divided gap={3}>
194
+ <Placeholder>Item 1</Placeholder>
195
+ <Placeholder>Item 2</Placeholder>
196
+ </View>
197
+ </Example.Item>
198
+ <Example.Item title={["responsive divided", "[s] direction: row", "[m+] direction: column"]}>
199
+ <View divided direction={{ s: "row", m: "column" }} gap={3}>
200
+ <Placeholder />
201
+ <Placeholder />
202
+ </View>
203
+ </Example.Item>
204
+ <Example.Item title="direction: row, columns">
205
+ <View divided gap={3} direction="row">
206
+ <View.Item columns={2}>
207
+ <Placeholder>Item 1</Placeholder>
208
+ </View.Item>
209
+ <View.Item columns={8}>
210
+ <Placeholder>Item 2</Placeholder>
211
+ </View.Item>
212
+ <View.Item columns={2}>
213
+ <Placeholder>Item 3</Placeholder>
214
+ </View.Item>
215
+ </View>
216
+ </Example.Item>
217
+ <Example.Item title="with React.Fragment">
218
+ <View direction="row" gap={4} divided>
219
+ <Placeholder>Item 1</Placeholder>
220
+ <>
221
+ <Placeholder>Item 2</Placeholder>
222
+ <Placeholder>Item 3</Placeholder>
223
+ </>
224
+ </View>
225
+ </Example.Item>
226
+ </Example>),
227
+ };
228
+ export const bleed = {
229
+ name: "bleed",
230
+ render: () => (<Example title="Removes side borders and border radius when applied">
231
+ <Example.Item title="bleed: 4">
232
+ <View bleed={4} padding={4} borderColor="neutral">
233
+ <Placeholder />
234
+ </View>
235
+ </Example.Item>
236
+ <Example.Item title={["responsive bleed", "[s] 4", "[m+] 0"]}>
237
+ <View bleed={{ s: 4, m: 0 }} padding={4} borderRadius="small" borderColor="neutral">
238
+ <Placeholder />
239
+ </View>
240
+ </Example.Item>
241
+ </Example>),
242
+ };
243
+ export const wrap = {
244
+ name: "wrap",
245
+ render: () => (<Example>
246
+ <Example.Item title="wrap: false">
247
+ <View direction="row" wrap={false} gap={3}>
248
+ <Placeholder w={600} h={100}/>
249
+ <Placeholder w={600} h={100}/>
250
+ </View>
251
+ </Example.Item>
252
+ </Example>),
253
+ };
254
+ export const align = {
255
+ name: "align",
256
+ render: () => (<Example>
257
+ <Example.Item title="align: start, direction: row">
258
+ <View align="start" direction="row" gap={3}>
259
+ <Placeholder />
260
+ <Placeholder h={100}/>
261
+ </View>
262
+ </Example.Item>
263
+ <Example.Item title="align: center, direction: row">
264
+ <View align="center" direction="row" gap={3}>
265
+ <Placeholder />
266
+ <Placeholder h={100}/>
267
+ </View>
268
+ </Example.Item>
269
+ <Example.Item title="align: end, direction: row">
270
+ <View align="end" direction="row" gap={3}>
271
+ <Placeholder />
272
+ <Placeholder h={100}/>
273
+ </View>
274
+ </Example.Item>
275
+ <Example.Item title={[
276
+ "align: stretch, direction: row",
277
+ "2nd item is stretched based on the 1st item height",
278
+ ]}>
279
+ <View align="stretch" direction="row" gap={3}>
280
+ <Placeholder h={100}/>
281
+ <Placeholder h="auto"/>
282
+ </View>
283
+ </Example.Item>
284
+ <Example.Item title="align: baseline, direction: row">
285
+ <View align="baseline" direction="row" gap={3}>
286
+ <Placeholder />
287
+ <Text variant="title-6">Content</Text>
288
+ </View>
289
+ </Example.Item>
354
290
 
355
- <Example.Item title="textAlign: center">
356
- <View textAlign="center">Content</View>
357
- </Example.Item>
291
+ <Example.Item title="align: start, direction: column">
292
+ <View align="start" direction="column" gap={3}>
293
+ <Placeholder />
294
+ <Placeholder w={100}/>
295
+ </View>
296
+ </Example.Item>
297
+ <Example.Item title="align: center, direction: column">
298
+ <View align="center" direction="column" gap={3}>
299
+ <Placeholder />
300
+ <Placeholder w={100}/>
301
+ </View>
302
+ </Example.Item>
303
+ <Example.Item title="align: end, direction: row">
304
+ <View align="end" direction="column" gap={3}>
305
+ <Placeholder />
306
+ <Placeholder w={100}/>
307
+ </View>
308
+ </Example.Item>
309
+ <Example.Item title={[
310
+ "align: stretch, direction: column",
311
+ "1st item uses its own width, 2nd item is stretched to full width",
312
+ ]}>
313
+ <View align="stretch" direction="column" gap={3}>
314
+ <Placeholder w={100}/>
315
+ <Placeholder w="auto"/>
316
+ </View>
317
+ </Example.Item>
318
+ </Example>),
319
+ };
320
+ export const justify = {
321
+ name: "justify",
322
+ render: () => (<Example>
323
+ <Example.Item title="justify: start, direction: row">
324
+ <View justify="start" direction="row" gap={3}>
325
+ <Placeholder />
326
+ <Placeholder />
327
+ </View>
328
+ </Example.Item>
329
+ <Example.Item title="justify: center, direction: row">
330
+ <View justify="center" direction="row" gap={3}>
331
+ <Placeholder />
332
+ <Placeholder />
333
+ </View>
334
+ </Example.Item>
335
+ <Example.Item title="justify: end, direction: row">
336
+ <View justify="end" direction="row" gap={3}>
337
+ <Placeholder />
338
+ <Placeholder />
339
+ </View>
340
+ </Example.Item>
341
+ <Example.Item title="justify: space-between, direction: row">
342
+ <View justify="space-between" direction="row" gap={3}>
343
+ <Placeholder />
344
+ <Placeholder />
345
+ </View>
346
+ </Example.Item>
358
347
 
359
- <Example.Item title="textAlign: end">
360
- <View textAlign="end">Content</View>
361
- </Example.Item>
348
+ <Example.Item title="justify: start, direction: column, height: 200px">
349
+ <View height="200px" justify="start" direction="column" gap={3}>
350
+ <Placeholder />
351
+ <Placeholder />
352
+ </View>
353
+ </Example.Item>
354
+ <Example.Item title="justify: center, direction: column, height: 200px">
355
+ <View height="200px" justify="center" direction="column" gap={3}>
356
+ <Placeholder />
357
+ <Placeholder />
358
+ </View>
359
+ </Example.Item>
360
+ <Example.Item title="justify: end, direction: column, height: 200px">
361
+ <View justify="end" height="200px" direction="column" gap={3}>
362
+ <Placeholder />
363
+ <Placeholder />
364
+ </View>
365
+ </Example.Item>
366
+ <Example.Item title="justify: space-between, direction: column, height: 200px">
367
+ <View justify="space-between" height="200px" direction="column" gap={3}>
368
+ <Placeholder />
369
+ <Placeholder />
370
+ </View>
371
+ </Example.Item>
372
+ </Example>),
373
+ };
374
+ export const textAlign = {
375
+ name: "textAlign",
376
+ render: () => (<Example>
377
+ <Example.Item title="textAlign: start">
378
+ <View textAlign="start">Content</View>
379
+ </Example.Item>
362
380
 
363
- <Example.Item title="textAlign: [s] start, [m+] end">
364
- <View textAlign={{ s: "start", m: "end" }}>Content</View>
365
- </Example.Item>
366
- </Example>);
367
- export const size = () => (<Example>
368
- <Example.Item title="height: 100px, width: 100px">
369
- <View backgroundColor="neutral-faded" height="100px" width="100px"/>
370
- </Example.Item>
371
- <Example.Item title="height: 25, width: 25">
372
- <View backgroundColor="neutral-faded" height={25} width={25}/>
373
- </Example.Item>
374
- <Example.Item title={[
375
- "responsive height and width",
376
- "[s] height: 25, width: 25",
377
- "[m+] height: 200px, width: 200px",
378
- ]}>
379
- <View backgroundColor="neutral-faded" height={{ s: 25, m: "200px" }} width={{ s: 25, m: "200px" }}/>
380
- </Example.Item>
381
- </Example>);
382
- export const ratio = () => (<Example>
383
- <Example.Item title="ratio: 16 / 9">
384
- <View backgroundColor="neutral-faded" aspectRatio={16 / 9} width="200px"/>
385
- </Example.Item>
386
- <Example.Item title={["responsive ratio", "[s] 1/1", "[m+] 16/9"]}>
387
- <View backgroundColor="neutral-faded" aspectRatio={{ s: 1, m: 16 / 9 }} width="200px"/>
388
- </Example.Item>
389
- </Example>);
390
- export const maxSize = () => (<Example>
391
- <Example.Item title="maxHeight: 150px, maxWidth: 150px, height: 300px">
392
- <View backgroundColor="neutral-faded" maxHeight="150px" maxWidth="150px" height="300px"/>
393
- </Example.Item>
394
- <Example.Item title="maxHeight: 25, maxWidth: 25, height: 50">
395
- <View backgroundColor="neutral-faded" maxHeight={25} maxWidth={25} height={50}/>
396
- </Example.Item>
397
- <Example.Item title={[
398
- "responsive maxHeight and maxWidth, height: 300",
399
- "[s] maxHeight: 25, maxWidth: 25",
400
- "[m+] maxHeight: 200px, maxWidth: 200px",
401
- ]}>
402
- <View backgroundColor="neutral-faded" maxHeight={{ s: 25, m: "200px" }} maxWidth={{ s: 25, m: "200px" }} height="300px"/>
403
- </Example.Item>
404
- </Example>);
405
- export const minSize = () => (<Example>
406
- <Example.Item title="minHeight: 150px, minWidth: 150px, height: 50px, width: 50px">
407
- <View backgroundColor="neutral-faded" minHeight="150px" minWidth="150px" height="50px" width="50px"/>
408
- </Example.Item>
409
- <Example.Item title="minHeight: 25, minWidth: 25, height: 5, width: 5">
410
- <View backgroundColor="neutral-faded" minHeight={25} minWidth={25} height={5} width={5}/>
411
- </Example.Item>
412
- <Example.Item title={[
413
- "responsive minHeight and minWidth, height: 50px, width: 50px",
414
- "[s] minHeight: 25, minWidth: 25",
415
- "[m+] minHeight: 200px, minWidth: 200px",
416
- ]}>
417
- <View backgroundColor="neutral-faded" minHeight={{ s: 25, m: "200px" }} minWidth={{ s: 25, m: "200px" }} height="50px" width="50px"/>
418
- </Example.Item>
419
- </Example>);
420
- export const background = () => (<Example title="border is used to highlight the backround value when it's similar to the page background, text color changes based on the background">
421
- <Example.Item title="bg: page">
422
- <View backgroundColor="page" borderColor="neutral" padding={4}>
423
- Content
424
- </View>
425
- </Example.Item>
426
- <Example.Item title="bg: page-faded">
427
- <View backgroundColor="page-faded" padding={4}>
428
- Content
429
- </View>
430
- </Example.Item>
431
- <Example.Item title="bg: disabled">
432
- <View backgroundColor="disabled" padding={4}>
433
- Content
434
- </View>
435
- </Example.Item>
436
- <Example.Item title="bg: disabled-faded">
437
- <View backgroundColor="disabled-faded" padding={4}>
438
- Content
439
- </View>
440
- </Example.Item>
441
- <Example.Item title="bg: elevation-base">
442
- <View backgroundColor="elevation-base" borderColor="neutral" padding={4}>
443
- Content
444
- </View>
445
- </Example.Item>
446
- <Example.Item title="bg: elevation-raised">
447
- <View backgroundColor="elevation-raised" borderColor="neutral" padding={4}>
448
- Content
449
- </View>
450
- </Example.Item>
451
- <Example.Item title="bg: elevation-overlay">
452
- <View backgroundColor="elevation-overlay" borderColor="neutral" padding={4}>
453
- Content
454
- </View>
455
- </Example.Item>
456
- <Example.Item title="bg: neutral">
457
- <View backgroundColor="neutral" padding={4}>
458
- Content
459
- </View>
460
- </Example.Item>
461
- <Example.Item title="bg: neutral-faded">
462
- <View backgroundColor="neutral-faded" padding={4}>
463
- Content
464
- </View>
465
- </Example.Item>
466
- <Example.Item title="bg: primary">
467
- <View backgroundColor="primary" padding={4}>
468
- Content
469
- </View>
470
- </Example.Item>
471
- <Example.Item title="bg: primary-faded">
472
- <View backgroundColor="primary-faded" padding={4}>
473
- Content
474
- </View>
475
- </Example.Item>
476
- <Example.Item title="bg: critical">
477
- <View backgroundColor="critical" padding={4}>
478
- Content
479
- </View>
480
- </Example.Item>
481
- <Example.Item title="bg: critical-faded">
482
- <View backgroundColor="critical-faded" padding={4}>
483
- Content
484
- </View>
485
- </Example.Item>
486
- <Example.Item title="bg: warning">
487
- <View backgroundColor="warning" padding={4}>
488
- Content
489
- </View>
490
- </Example.Item>
491
- <Example.Item title="bg: warning-faded">
492
- <View backgroundColor="warning-faded" padding={4}>
493
- Content
494
- </View>
495
- </Example.Item>
496
- <Example.Item title="bg: positive">
497
- <View backgroundColor="positive" padding={4}>
498
- Content
499
- </View>
500
- </Example.Item>
501
- <Example.Item title="bg: positive-faded">
502
- <View backgroundColor="positive-faded" padding={4}>
503
- Content
504
- </View>
505
- </Example.Item>
506
- </Example>);
507
- export const border = () => (<Example>
508
- <Example.Item title="border: neutral">
509
- <View borderColor="neutral" padding={4}>
510
- Content
511
- </View>
512
- </Example.Item>
381
+ <Example.Item title="textAlign: center">
382
+ <View textAlign="center">Content</View>
383
+ </Example.Item>
513
384
 
514
- <Example.Item title="border: neutral-faded">
515
- <View borderColor="neutral-faded" padding={4}>
516
- Content
517
- </View>
518
- </Example.Item>
385
+ <Example.Item title="textAlign: end">
386
+ <View textAlign="end">Content</View>
387
+ </Example.Item>
519
388
 
520
- <Example.Item title="border: primary">
521
- <View borderColor="primary" padding={4}>
522
- Content
523
- </View>
524
- </Example.Item>
389
+ <Example.Item title="textAlign: [s] start, [m+] end">
390
+ <View textAlign={{ s: "start", m: "end" }}>Content</View>
391
+ </Example.Item>
392
+ </Example>),
393
+ };
394
+ export const size = {
395
+ name: "size",
396
+ render: () => (<Example>
397
+ <Example.Item title="height: 100px, width: 100px">
398
+ <View backgroundColor="neutral-faded" height="100px" width="100px"/>
399
+ </Example.Item>
400
+ <Example.Item title="height: 25, width: 25">
401
+ <View backgroundColor="neutral-faded" height={25} width={25}/>
402
+ </Example.Item>
403
+ <Example.Item title={[
404
+ "responsive height and width",
405
+ "[s] height: 25, width: 25",
406
+ "[m+] height: 200px, width: 200px",
407
+ ]}>
408
+ <View backgroundColor="neutral-faded" height={{ s: 25, m: "200px" }} width={{ s: 25, m: "200px" }}/>
409
+ </Example.Item>
410
+ </Example>),
411
+ };
412
+ export const ratio = {
413
+ name: "aspectRatio",
414
+ render: () => (<Example>
415
+ <Example.Item title="ratio: 16 / 9">
416
+ <View backgroundColor="neutral-faded" aspectRatio={16 / 9} width="200px"/>
417
+ </Example.Item>
418
+ <Example.Item title={["responsive ratio", "[s] 1/1", "[m+] 16/9"]}>
419
+ <View backgroundColor="neutral-faded" aspectRatio={{ s: 1, m: 16 / 9 }} width="200px"/>
420
+ </Example.Item>
421
+ </Example>),
422
+ };
423
+ export const maxSize = {
424
+ name: "width, height, maxWidth, maxHeight",
425
+ render: () => (<Example>
426
+ <Example.Item title="maxHeight: 150px, maxWidth: 150px, height: 300px">
427
+ <View backgroundColor="neutral-faded" maxHeight="150px" maxWidth="150px" height="300px"/>
428
+ </Example.Item>
429
+ <Example.Item title="maxHeight: 25, maxWidth: 25, height: 50">
430
+ <View backgroundColor="neutral-faded" maxHeight={25} maxWidth={25} height={50}/>
431
+ </Example.Item>
432
+ <Example.Item title={[
433
+ "responsive maxHeight and maxWidth, height: 300",
434
+ "[s] maxHeight: 25, maxWidth: 25",
435
+ "[m+] maxHeight: 200px, maxWidth: 200px",
436
+ ]}>
437
+ <View backgroundColor="neutral-faded" maxHeight={{ s: 25, m: "200px" }} maxWidth={{ s: 25, m: "200px" }} height="300px"/>
438
+ </Example.Item>
439
+ </Example>),
440
+ };
441
+ export const minSize = {
442
+ name: "width, height, minWidth, minHeight",
443
+ render: () => (<Example>
444
+ <Example.Item title="minHeight: 150px, minWidth: 150px, height: 50px, width: 50px">
445
+ <View backgroundColor="neutral-faded" minHeight="150px" minWidth="150px" height="50px" width="50px"/>
446
+ </Example.Item>
447
+ <Example.Item title="minHeight: 25, minWidth: 25, height: 5, width: 5">
448
+ <View backgroundColor="neutral-faded" minHeight={25} minWidth={25} height={5} width={5}/>
449
+ </Example.Item>
450
+ <Example.Item title={[
451
+ "responsive minHeight and minWidth, height: 50px, width: 50px",
452
+ "[s] minHeight: 25, minWidth: 25",
453
+ "[m+] minHeight: 200px, minWidth: 200px",
454
+ ]}>
455
+ <View backgroundColor="neutral-faded" minHeight={{ s: 25, m: "200px" }} minWidth={{ s: 25, m: "200px" }} height="50px" width="50px"/>
456
+ </Example.Item>
457
+ </Example>),
458
+ };
459
+ export const background = {
460
+ name: "backgroundColor",
461
+ render: () => (<Example title="border is used to highlight the backround value when it's similar to the page background, text color changes based on the background">
462
+ <Example.Item title="bg: page">
463
+ <View backgroundColor="page" borderColor="neutral" padding={4}>
464
+ Content
465
+ </View>
466
+ </Example.Item>
467
+ <Example.Item title="bg: page-faded">
468
+ <View backgroundColor="page-faded" padding={4}>
469
+ Content
470
+ </View>
471
+ </Example.Item>
472
+ <Example.Item title="bg: disabled">
473
+ <View backgroundColor="disabled" padding={4}>
474
+ Content
475
+ </View>
476
+ </Example.Item>
477
+ <Example.Item title="bg: disabled-faded">
478
+ <View backgroundColor="disabled-faded" padding={4}>
479
+ Content
480
+ </View>
481
+ </Example.Item>
482
+ <Example.Item title="bg: elevation-base">
483
+ <View backgroundColor="elevation-base" borderColor="neutral" padding={4}>
484
+ Content
485
+ </View>
486
+ </Example.Item>
487
+ <Example.Item title="bg: elevation-raised">
488
+ <View backgroundColor="elevation-raised" borderColor="neutral" padding={4}>
489
+ Content
490
+ </View>
491
+ </Example.Item>
492
+ <Example.Item title="bg: elevation-overlay">
493
+ <View backgroundColor="elevation-overlay" borderColor="neutral" padding={4}>
494
+ Content
495
+ </View>
496
+ </Example.Item>
497
+ <Example.Item title="bg: neutral">
498
+ <View backgroundColor="neutral" padding={4}>
499
+ Content
500
+ </View>
501
+ </Example.Item>
502
+ <Example.Item title="bg: neutral-faded">
503
+ <View backgroundColor="neutral-faded" padding={4}>
504
+ Content
505
+ </View>
506
+ </Example.Item>
507
+ <Example.Item title="bg: primary">
508
+ <View backgroundColor="primary" padding={4}>
509
+ Content
510
+ </View>
511
+ </Example.Item>
512
+ <Example.Item title="bg: primary-faded">
513
+ <View backgroundColor="primary-faded" padding={4}>
514
+ Content
515
+ </View>
516
+ </Example.Item>
517
+ <Example.Item title="bg: critical">
518
+ <View backgroundColor="critical" padding={4}>
519
+ Content
520
+ </View>
521
+ </Example.Item>
522
+ <Example.Item title="bg: critical-faded">
523
+ <View backgroundColor="critical-faded" padding={4}>
524
+ Content
525
+ </View>
526
+ </Example.Item>
527
+ <Example.Item title="bg: warning">
528
+ <View backgroundColor="warning" padding={4}>
529
+ Content
530
+ </View>
531
+ </Example.Item>
532
+ <Example.Item title="bg: warning-faded">
533
+ <View backgroundColor="warning-faded" padding={4}>
534
+ Content
535
+ </View>
536
+ </Example.Item>
537
+ <Example.Item title="bg: positive">
538
+ <View backgroundColor="positive" padding={4}>
539
+ Content
540
+ </View>
541
+ </Example.Item>
542
+ <Example.Item title="bg: positive-faded">
543
+ <View backgroundColor="positive-faded" padding={4}>
544
+ Content
545
+ </View>
546
+ </Example.Item>
547
+ </Example>),
548
+ };
549
+ export const border = {
550
+ name: "borderColor",
551
+ render: () => (<Example>
552
+ <Example.Item title="border: neutral">
553
+ <View borderColor="neutral" padding={4}>
554
+ Content
555
+ </View>
556
+ </Example.Item>
525
557
 
526
- <Example.Item title="border: primary-faded">
527
- <View borderColor="primary-faded" padding={4}>
528
- Content
529
- </View>
530
- </Example.Item>
558
+ <Example.Item title="border: neutral-faded">
559
+ <View borderColor="neutral-faded" padding={4}>
560
+ Content
561
+ </View>
562
+ </Example.Item>
531
563
 
532
- <Example.Item title="border: critical">
533
- <View borderColor="critical" padding={4}>
534
- Content
535
- </View>
536
- </Example.Item>
564
+ <Example.Item title="border: primary">
565
+ <View borderColor="primary" padding={4}>
566
+ Content
567
+ </View>
568
+ </Example.Item>
537
569
 
538
- <Example.Item title="border: critical-faded">
539
- <View borderColor="critical-faded" padding={4}>
540
- Content
541
- </View>
542
- </Example.Item>
570
+ <Example.Item title="border: primary-faded">
571
+ <View borderColor="primary-faded" padding={4}>
572
+ Content
573
+ </View>
574
+ </Example.Item>
543
575
 
544
- <Example.Item title="border: warning">
545
- <View borderColor="warning" padding={4}>
546
- Content
547
- </View>
548
- </Example.Item>
576
+ <Example.Item title="border: critical">
577
+ <View borderColor="critical" padding={4}>
578
+ Content
579
+ </View>
580
+ </Example.Item>
549
581
 
550
- <Example.Item title="border: warning-faded">
551
- <View borderColor="warning-faded" padding={4}>
552
- Content
553
- </View>
554
- </Example.Item>
582
+ <Example.Item title="border: critical-faded">
583
+ <View borderColor="critical-faded" padding={4}>
584
+ Content
585
+ </View>
586
+ </Example.Item>
555
587
 
556
- <Example.Item title="border: positive">
557
- <View borderColor="positive" padding={4}>
558
- Content
559
- </View>
560
- </Example.Item>
588
+ <Example.Item title="border: warning">
589
+ <View borderColor="warning" padding={4}>
590
+ Content
591
+ </View>
592
+ </Example.Item>
561
593
 
562
- <Example.Item title="border: positive-faded">
563
- <View borderColor="positive-faded" padding={4}>
564
- Content
565
- </View>
566
- </Example.Item>
594
+ <Example.Item title="border: warning-faded">
595
+ <View borderColor="warning-faded" padding={4}>
596
+ Content
597
+ </View>
598
+ </Example.Item>
567
599
 
568
- <Example.Item title="border: transparent, background: primary-faded">
569
- <View borderColor="transparent" backgroundColor="primary-faded" padding={4}>
570
- Content
571
- </View>
572
- </Example.Item>
600
+ <Example.Item title="border: positive">
601
+ <View borderColor="positive" padding={4}>
602
+ Content
603
+ </View>
604
+ </Example.Item>
573
605
 
574
- <Example.Item title={["responsive", "[s] primary", "[m+] neutral"]}>
575
- <View borderColor={{ s: "primary", m: "neutral" }} padding={4}>
576
- Content
577
- </View>
578
- </Example.Item>
579
- </Example>);
580
- export const radius = () => (<Example>
581
- <Example.Item title="radius: small">
582
- <View borderRadius="small" borderColor="neutral" padding={4}>
583
- Content
584
- </View>
585
- </Example.Item>
606
+ <Example.Item title="border: positive-faded">
607
+ <View borderColor="positive-faded" padding={4}>
608
+ Content
609
+ </View>
610
+ </Example.Item>
586
611
 
587
- <Example.Item title="radius: medium">
588
- <View borderRadius="medium" borderColor="neutral" padding={4}>
589
- Content
590
- </View>
591
- </Example.Item>
612
+ <Example.Item title="border: transparent, background: primary-faded">
613
+ <View borderColor="transparent" backgroundColor="primary-faded" padding={4}>
614
+ Content
615
+ </View>
616
+ </Example.Item>
592
617
 
593
- <Example.Item title="radius: large">
594
- <View borderRadius="large" borderColor="neutral" padding={4}>
595
- Content
596
- </View>
597
- </Example.Item>
618
+ <Example.Item title={["responsive", "[s] primary", "[m+] neutral"]}>
619
+ <View borderColor={{ s: "primary", m: "neutral" }} padding={4}>
620
+ Content
621
+ </View>
622
+ </Example.Item>
623
+ </Example>),
624
+ };
625
+ export const radius = {
626
+ name: "borderRadius",
627
+ render: () => (<Example>
628
+ <Example.Item title="radius: small">
629
+ <View borderRadius="small" borderColor="neutral" padding={4}>
630
+ Content
631
+ </View>
632
+ </Example.Item>
598
633
 
599
- <Example.Item title="radius: circular">
600
- <View borderRadius="circular" borderColor="neutral" padding={4}>
601
- Content
602
- </View>
603
- </Example.Item>
604
- </Example>);
605
- export const shadow = () => (<Example>
606
- <Example.Item title="shadow: raised, radius: medium">
607
- <View height="100px" width="100px" shadow="raised" borderRadius="medium" backgroundColor="elevation-raised"/>
608
- </Example.Item>
609
- <Example.Item title="shadow: overlay, radius: medium">
610
- <View height="100px" width="100px" shadow="overlay" borderRadius="medium" backgroundColor="elevation-overlay"/>
611
- </Example.Item>
612
- </Example>);
613
- export const overflow = () => (<Example>
614
- <Example.Item title={["overflow: hidden, radius: medium", "child background should have radius"]}>
615
- <View height="100px" width="100px" shadow="raised" borderRadius="medium" overflow="hidden">
616
- <View backgroundColor="primary" height="100%" width="100%"/>
617
- </View>
618
- </Example.Item>
619
- </Example>);
620
- export const position = () => (<Example>
621
- <Example.Item title="position: relative + absolute">
622
- <View borderColor="neutral" position="relative">
623
- <Placeholder />
624
- <View position="absolute" insetTop={0} insetEnd={0} backgroundColor="critical" zIndex={5}>
625
- top
626
- </View>
627
- <View position="absolute" insetTop={0} insetEnd={0} backgroundColor="primary">
628
- below
629
- </View>
630
- </View>
631
- </Example.Item>
634
+ <Example.Item title="radius: medium">
635
+ <View borderRadius="medium" borderColor="neutral" padding={4}>
636
+ Content
637
+ </View>
638
+ </Example.Item>
632
639
 
633
- <Example.Item title="position: sticky">
634
- <div style={{ overflow: "auto", height: 100 }}>
635
- <View position="sticky" borderColor="primary" insetTop={0}>
640
+ <Example.Item title="radius: large">
641
+ <View borderRadius="large" borderColor="neutral" padding={4}>
636
642
  Content
637
643
  </View>
638
- <Placeholder h={1000}/>
639
- </div>
640
- </Example.Item>
644
+ </Example.Item>
641
645
 
642
- <Example.Item title={["responsive", "[s] position: absolute", "[m+]: position: relative"]}>
643
- <div style={{ overflow: "auto", height: 100, position: "relative" }}>
644
- <View position={{ s: "absolute", m: "relative" }} borderColor="primary" insetTop={0}>
646
+ <Example.Item title="radius: circular">
647
+ <View borderRadius="circular" borderColor="neutral" padding={4}>
645
648
  Content
646
649
  </View>
647
- <Placeholder h={1000}/>
648
- </div>
649
- </Example.Item>
650
- </Example>);
651
- export const inset = () => (<Example>
652
- <Example.Item title="inset: 4">
653
- <View backgroundColor="neutral-faded" width={25} height={25}>
654
- <View backgroundColor="neutral" position="absolute" inset={4}/>
655
- </View>
656
- </Example.Item>
650
+ </Example.Item>
651
+ </Example>),
652
+ };
653
+ export const shadow = {
654
+ name: "shadow",
655
+ render: () => (<Example>
656
+ <Example.Item title="shadow: raised, radius: medium">
657
+ <View height="100px" width="100px" shadow="raised" borderRadius="medium" backgroundColor="elevation-raised"/>
658
+ </Example.Item>
659
+ <Example.Item title="shadow: overlay, radius: medium">
660
+ <View height="100px" width="100px" shadow="overlay" borderRadius="medium" backgroundColor="elevation-overlay"/>
661
+ </Example.Item>
662
+ </Example>),
663
+ };
664
+ export const overflow = {
665
+ name: "overflow",
666
+ render: () => (<Example>
667
+ <Example.Item title={["overflow: hidden, radius: medium", "child background should have radius"]}>
668
+ <View height="100px" width="100px" shadow="raised" borderRadius="medium" overflow="hidden">
669
+ <View backgroundColor="primary" height="100%" width="100%"/>
670
+ </View>
671
+ </Example.Item>
672
+ </Example>),
673
+ };
674
+ export const positioning = {
675
+ name: "position",
676
+ render: () => (<Example>
677
+ <Example.Item title="position: relative + absolute">
678
+ <View borderColor="neutral" position="relative">
679
+ <Placeholder />
680
+ <View position="absolute" insetTop={0} insetEnd={0} backgroundColor="critical" zIndex={5} height={10} width={10}/>
681
+ <View position="absolute" insetTop={0} insetEnd={0} backgroundColor="primary" height={15} width={15}/>
682
+ </View>
683
+ </Example.Item>
657
684
 
658
- <Example.Item title="insetTop: 4">
659
- <View backgroundColor="neutral-faded" width={25} height={25}>
660
- <View backgroundColor="neutral" position="absolute" insetTop={4} height={10} width={10}/>
661
- </View>
662
- </Example.Item>
685
+ <Example.Item title="position: sticky">
686
+ <div style={{ overflow: "auto", height: 100 }} tabIndex={0}>
687
+ <View position="sticky" borderColor="primary" insetTop={0}>
688
+ Content
689
+ </View>
690
+ <Placeholder h={1000}/>
691
+ </div>
692
+ </Example.Item>
663
693
 
664
- <Example.Item title="insetStart: 4">
665
- <View backgroundColor="neutral-faded" width={25} height={25}>
666
- <View backgroundColor="neutral" position="absolute" insetStart={4} height={10} width={10}/>
667
- </View>
668
- </Example.Item>
694
+ <Example.Item title={["responsive", "[s] position: absolute", "[m+]: position: relative"]}>
695
+ <div style={{ overflow: "auto", height: 100, position: "relative" }} tabIndex={0}>
696
+ <View position={{ s: "absolute", m: "relative" }} borderColor="primary" insetTop={0}>
697
+ Content
698
+ </View>
699
+ <Placeholder h={1000}/>
700
+ </div>
701
+ </Example.Item>
702
+ </Example>),
703
+ };
704
+ export const inset = {
705
+ name: "inset",
706
+ render: () => (<Example>
707
+ <Example.Item title="inset: 4">
708
+ <View backgroundColor="neutral-faded" width={25} height={25}>
709
+ <View backgroundColor="neutral" position="absolute" inset={4}/>
710
+ </View>
711
+ </Example.Item>
669
712
 
670
- <Example.Item title="insetEnd: 4">
671
- <View backgroundColor="neutral-faded" width={25} height={25}>
672
- <View backgroundColor="neutral" position="absolute" insetEnd={4} height={10} width={10}/>
673
- </View>
674
- </Example.Item>
713
+ <Example.Item title="insetTop: 4">
714
+ <View backgroundColor="neutral-faded" width={25} height={25}>
715
+ <View backgroundColor="neutral" position="absolute" insetTop={4} height={10} width={10}/>
716
+ </View>
717
+ </Example.Item>
675
718
 
676
- <Example.Item title="insetBottom: 4">
677
- <View backgroundColor="neutral-faded" width={25} height={25}>
678
- <View backgroundColor="neutral" position="absolute" insetBottom={4} height={10} width={10}/>
679
- </View>
680
- </Example.Item>
719
+ <Example.Item title="insetStart: 4">
720
+ <View backgroundColor="neutral-faded" width={25} height={25}>
721
+ <View backgroundColor="neutral" position="absolute" insetStart={4} height={10} width={10}/>
722
+ </View>
723
+ </Example.Item>
681
724
 
682
- <Example.Item title="responsive, [s] insetBottom: 4 [m+] insetEnd: 4">
683
- <View backgroundColor="neutral-faded" width={25} height={25}>
684
- <View backgroundColor="neutral" position="absolute" insetBottom={{ s: 4, m: "auto" }} insetEnd={{ s: "auto", m: 4 }} height={10} width={10}/>
685
- </View>
686
- </Example.Item>
687
- </Example>);
688
- const Animated = () => {
689
- const [background, setBackground] = React.useState("neutral");
690
- return (<View gap={3} align="start">
691
- <Button onClick={() => setBackground((prev) => (prev === "neutral" ? "primary" : "neutral"))}>
692
- Change background
693
- </Button>
694
- <View height="100px" width="100px" backgroundColor={background} align="center" justify="center" animated>
695
- Content
696
- </View>
697
- </View>);
725
+ <Example.Item title="insetEnd: 4">
726
+ <View backgroundColor="neutral-faded" width={25} height={25}>
727
+ <View backgroundColor="neutral" position="absolute" insetEnd={4} height={10} width={10}/>
728
+ </View>
729
+ </Example.Item>
730
+
731
+ <Example.Item title="insetBottom: 4">
732
+ <View backgroundColor="neutral-faded" width={25} height={25}>
733
+ <View backgroundColor="neutral" position="absolute" insetBottom={4} height={10} width={10}/>
734
+ </View>
735
+ </Example.Item>
736
+
737
+ <Example.Item title="responsive, [s] insetBottom: 4 [m+] insetEnd: 4">
738
+ <View backgroundColor="neutral-faded" width={25} height={25}>
739
+ <View backgroundColor="neutral" position="absolute" insetBottom={{ s: 4, m: "auto" }} insetEnd={{ s: "auto", m: 4 }} height={10} width={10}/>
740
+ </View>
741
+ </Example.Item>
742
+ </Example>),
698
743
  };
699
- export const animated = () => <Animated />;
700
- export const itemGapBefore = () => (<Example>
701
- <Example.Item title={["gap: 4, 3rd item gapBefore: 10, direction: row", "increased gap"]}>
702
- <View direction="row" gap={4}>
703
- <Placeholder />
704
- <Placeholder />
705
- <View.Item gapBefore={10}>
744
+ export const animated = {
745
+ name: "animated",
746
+ render: () => {
747
+ const [background, setBackground] = React.useState("neutral");
748
+ return (<View gap={3} align="start">
749
+ <Button onClick={() => setBackground((prev) => (prev === "neutral" ? "primary" : "neutral"))}>
750
+ Change background
751
+ </Button>
752
+ <View height="100px" width="100px" backgroundColor={background} align="center" justify="center" animated>
753
+ Content
754
+ </View>
755
+ </View>);
756
+ },
757
+ };
758
+ export const itemGapBefore = {
759
+ name: "item, gapBefore",
760
+ render: () => (<Example>
761
+ <Example.Item title={["gap: 4, 3rd item gapBefore: 10, direction: row", "increased gap"]}>
762
+ <View direction="row" gap={4}>
763
+ <Placeholder />
764
+ <Placeholder />
765
+ <View.Item gapBefore={10}>
766
+ <Placeholder />
767
+ </View.Item>
768
+ </View>
769
+ </Example.Item>
770
+ <Example.Item title={["gap: 10, 3rd item gapBefore: 4, direction: row", "reduced gap"]}>
771
+ <View direction="row" gap={10}>
706
772
  <Placeholder />
707
- </View.Item>
708
- </View>
709
- </Example.Item>
710
- <Example.Item title={["gap: 10, 3rd item gapBefore: 4, direction: row", "reduced gap"]}>
711
- <View direction="row" gap={10}>
712
- <Placeholder />
713
- <Placeholder />
714
- <View.Item gapBefore={4}>
715
773
  <Placeholder />
716
- </View.Item>
717
- </View>
718
- </Example.Item>
719
- <Example.Item title={["gap: 10, 3rd item gapBefore: 0, direction: row", "removed gap"]}>
720
- <View direction="row" gap={10}>
721
- <Placeholder />
722
- <Placeholder />
723
- <View.Item gapBefore={0}>
774
+ <View.Item gapBefore={4}>
775
+ <Placeholder />
776
+ </View.Item>
777
+ </View>
778
+ </Example.Item>
779
+ <Example.Item title={["gap: 10, 3rd item gapBefore: 0, direction: row", "removed gap"]}>
780
+ <View direction="row" gap={10}>
724
781
  <Placeholder />
725
- </View.Item>
726
- </View>
727
- </Example.Item>
728
-
729
- <Example.Item title="gap: 4, direction: row, 2nd item gap: auto">
730
- <View direction="row" gap={4}>
731
- <Placeholder w={200}/>
732
- <View.Item gapBefore="auto">
733
782
  <Placeholder />
734
- </View.Item>
735
- </View>
736
- </Example.Item>
783
+ <View.Item gapBefore={0}>
784
+ <Placeholder />
785
+ </View.Item>
786
+ </View>
787
+ </Example.Item>
788
+
789
+ <Example.Item title="gap: 4, direction: row, 2nd item gap: auto">
790
+ <View direction="row" gap={4}>
791
+ <Placeholder w={200}/>
792
+ <View.Item gapBefore="auto">
793
+ <Placeholder />
794
+ </View.Item>
795
+ </View>
796
+ </Example.Item>
737
797
 
738
- <Example.Item title={["gap: 4, 3rd item gapBefore: 10, direction: column", "increased gap"]}>
739
- <View direction="column" gap={4}>
740
- <Placeholder />
741
- <Placeholder />
742
- <View.Item gapBefore={10}>
798
+ <Example.Item title={["gap: 4, 3rd item gapBefore: 10, direction: column", "increased gap"]}>
799
+ <View direction="column" gap={4}>
800
+ <Placeholder />
801
+ <Placeholder />
802
+ <View.Item gapBefore={10}>
803
+ <Placeholder />
804
+ </View.Item>
805
+ </View>
806
+ </Example.Item>
807
+ <Example.Item title={["gap: 10, 3rd item gapBefore: 4, direction: column", "reduced gap"]}>
808
+ <View direction="column" gap={10}>
809
+ <Placeholder />
743
810
  <Placeholder />
744
- </View.Item>
745
- </View>
746
- </Example.Item>
747
- <Example.Item title={["gap: 10, 3rd item gapBefore: 4, direction: column", "reduced gap"]}>
748
- <View direction="column" gap={10}>
749
- <Placeholder />
750
- <Placeholder />
751
- <View.Item gapBefore={4}>
811
+ <View.Item gapBefore={4}>
812
+ <Placeholder />
813
+ </View.Item>
814
+ </View>
815
+ </Example.Item>
816
+ <Example.Item title={["gap: 10, 3rd item gapBefore: 0, direction: column", "removed gap"]}>
817
+ <View direction="column" gap={10}>
752
818
  <Placeholder />
753
- </View.Item>
754
- </View>
755
- </Example.Item>
756
- <Example.Item title={["gap: 10, 3rd item gapBefore: 0, direction: column", "removed gap"]}>
757
- <View direction="column" gap={10}>
758
- <Placeholder />
759
- <Placeholder />
760
- <View.Item gapBefore={0}>
761
819
  <Placeholder />
762
- </View.Item>
763
- </View>
764
- </Example.Item>
820
+ <View.Item gapBefore={0}>
821
+ <Placeholder />
822
+ </View.Item>
823
+ </View>
824
+ </Example.Item>
765
825
 
766
- <Example.Item title="gap: 4, direction: column, height: 200px, 2nd item gap: auto">
767
- <View height="200px" gap={4}>
768
- <Placeholder />
769
- <View.Item gapBefore="auto">
826
+ <Example.Item title="gap: 4, direction: column, height: 200px, 2nd item gap: auto">
827
+ <View height="200px" gap={4}>
770
828
  <Placeholder />
771
- </View.Item>
772
- </View>
773
- </Example.Item>
829
+ <View.Item gapBefore="auto">
830
+ <Placeholder />
831
+ </View.Item>
832
+ </View>
833
+ </Example.Item>
774
834
 
775
- <Example.Item title={[
776
- "responsive item gap",
777
- "gap: 4, direction: row",
778
- "[s] 3rd item gapBefore: 10",
779
- "[m+] 3rd item gapBefore: 0",
780
- ]}>
781
- <View direction="row" gap={4}>
782
- <Placeholder />
783
- <Placeholder />
784
- <View.Item gapBefore={{ s: 10, m: 0 }}>
835
+ <Example.Item title={[
836
+ "responsive item gap",
837
+ "gap: 4, direction: row",
838
+ "[s] 3rd item gapBefore: 10",
839
+ "[m+] 3rd item gapBefore: 0",
840
+ ]}>
841
+ <View direction="row" gap={4}>
785
842
  <Placeholder />
786
- </View.Item>
787
- </View>
788
- </Example.Item>
789
- </Example>);
790
- export const itemGrow = () => (<Example>
791
- <Example.Item title="direction: row, 2nd item grow">
792
- <View direction="row" gap={3}>
793
- <Placeholder w={200}/>
794
- <View.Item grow>
795
843
  <Placeholder />
796
- </View.Item>
797
- </View>
798
- </Example.Item>
799
- <Example.Item title="direction: column, height: 200px, 2nd item grow">
800
- <View direction="column" gap={3} height="200px">
801
- <Placeholder />
802
- <View.Item grow>
803
- <Placeholder h="100%"/>
804
- </View.Item>
805
- </View>
806
- </Example.Item>
807
- <Example.Item title="direction: row, 2nd item grow, applied to View">
808
- <View direction="row" gap={3}>
809
- <Placeholder w={200}/>
810
- <View grow>
844
+ <View.Item gapBefore={{ s: 10, m: 0 }}>
845
+ <Placeholder />
846
+ </View.Item>
847
+ </View>
848
+ </Example.Item>
849
+ </Example>),
850
+ };
851
+ export const itemGrow = {
852
+ name: "item, grow",
853
+ render: () => (<Example>
854
+ <Example.Item title="direction: row, 2nd item grow">
855
+ <View direction="row" gap={3}>
856
+ <Placeholder w={200}/>
857
+ <View.Item grow>
858
+ <Placeholder />
859
+ </View.Item>
860
+ </View>
861
+ </Example.Item>
862
+ <Example.Item title="direction: column, height: 200px, 2nd item grow">
863
+ <View direction="column" gap={3} height="200px">
811
864
  <Placeholder />
865
+ <View.Item grow>
866
+ <Placeholder h="100%"/>
867
+ </View.Item>
868
+ </View>
869
+ </Example.Item>
870
+ <Example.Item title="direction: row, 2nd item grow, applied to View">
871
+ <View direction="row" gap={3}>
872
+ <Placeholder w={200}/>
873
+ <View grow>
874
+ <Placeholder />
875
+ </View>
876
+ </View>
877
+ </Example.Item>
878
+ <Example.Item title={[
879
+ "responsive item grow, direction: row",
880
+ "[s] 2nd item grow",
881
+ "[m+] 2nd item doesn't grow",
882
+ ]}>
883
+ <View direction="row" gap={3}>
884
+ <Placeholder w={200}/>
885
+ <View.Item grow={{ s: true, m: false }}>
886
+ <Placeholder />
887
+ </View.Item>
812
888
  </View>
813
- </View>
814
- </Example.Item>
815
- <Example.Item title={[
816
- "responsive item grow, direction: row",
817
- "[s] 2nd item grow",
818
- "[m+] 2nd item doesn't grow",
819
- ]}>
820
- <View direction="row" gap={3}>
821
- <Placeholder w={200}/>
822
- <View.Item grow={{ s: true, m: false }}>
889
+ </Example.Item>
890
+ <Example.Item title={[
891
+ "responsive item grow, direction: column, height: 200px",
892
+ "[s] 2nd item grow",
893
+ "[m+] 2nd item doesn't grow",
894
+ ]}>
895
+ <View direction="column" gap={3} height="200px">
823
896
  <Placeholder />
824
- </View.Item>
825
- </View>
826
- </Example.Item>
827
- <Example.Item title={[
828
- "responsive item grow, direction: column, height: 200px",
829
- "[s] 2nd item grow",
830
- "[m+] 2nd item doesn't grow",
831
- ]}>
832
- <View direction="column" gap={3} height="200px">
833
- <Placeholder />
834
- <View.Item grow={{ s: true, m: false }}>
835
- <Placeholder h="100%"/>
836
- </View.Item>
837
- </View>
838
- </Example.Item>
839
- </Example>);
840
- export const itemColumns = () => (<Example>
841
- <Example.Item title="columns 6, 6, gap: 0">
842
- <View direction="row">
843
- <View.Item columns={6}>
844
- <Placeholder>Item 1</Placeholder>
845
- </View.Item>
846
- <View.Item columns={6}>
847
- <Placeholder>Item 2</Placeholder>
848
- </View.Item>
849
- </View>
850
- </Example.Item>
897
+ <View.Item grow={{ s: true, m: false }}>
898
+ <Placeholder h="100%"/>
899
+ </View.Item>
900
+ </View>
901
+ </Example.Item>
902
+ </Example>),
903
+ };
904
+ export const itemColumns = {
905
+ name: "item, columns",
906
+ render: () => (<Example>
907
+ <Example.Item title="columns 6, 6, gap: 0">
908
+ <View direction="row">
909
+ <View.Item columns={6}>
910
+ <Placeholder>Item 1</Placeholder>
911
+ </View.Item>
912
+ <View.Item columns={6}>
913
+ <Placeholder>Item 2</Placeholder>
914
+ </View.Item>
915
+ </View>
916
+ </Example.Item>
851
917
 
852
- <Example.Item title="columns 6, 6, gap: 4">
853
- <View direction="row" gap={4}>
854
- <View.Item columns={6}>
855
- <Placeholder>Item 1</Placeholder>
856
- </View.Item>
857
- <View.Item columns={6}>
858
- <Placeholder>Item 2</Placeholder>
859
- </View.Item>
860
- </View>
861
- </Example.Item>
918
+ <Example.Item title="columns 6, 6, gap: 4">
919
+ <View direction="row" gap={4}>
920
+ <View.Item columns={6}>
921
+ <Placeholder>Item 1</Placeholder>
922
+ </View.Item>
923
+ <View.Item columns={6}>
924
+ <Placeholder>Item 2</Placeholder>
925
+ </View.Item>
926
+ </View>
927
+ </Example.Item>
862
928
 
863
- <Example.Item title="columns 3, 9, gap: 4">
864
- <View direction="row" gap={4}>
865
- <View.Item columns={3}>
866
- <Placeholder>Item 1</Placeholder>
867
- </View.Item>
868
- <View.Item columns={9}>
869
- <Placeholder>Item 2</Placeholder>
870
- </View.Item>
871
- </View>
872
- </Example.Item>
929
+ <Example.Item title="columns 3, 9, gap: 4">
930
+ <View direction="row" gap={4}>
931
+ <View.Item columns={3}>
932
+ <Placeholder>Item 1</Placeholder>
933
+ </View.Item>
934
+ <View.Item columns={9}>
935
+ <Placeholder>Item 2</Placeholder>
936
+ </View.Item>
937
+ </View>
938
+ </Example.Item>
873
939
 
874
- <Example.Item title="columns 6, 6, 9, gap: 4">
875
- <View direction="row" gap={4}>
876
- <View.Item columns={6}>
877
- <Placeholder>Item 1</Placeholder>
878
- </View.Item>
879
- <View.Item columns={6}>
880
- <Placeholder>Item 2</Placeholder>
881
- </View.Item>
882
- <View.Item columns={9}>
883
- <Placeholder>Item 3</Placeholder>
884
- </View.Item>
885
- </View>
886
- </Example.Item>
940
+ <Example.Item title="columns 6, 6, 9, gap: 4">
941
+ <View direction="row" gap={4}>
942
+ <View.Item columns={6}>
943
+ <Placeholder>Item 1</Placeholder>
944
+ </View.Item>
945
+ <View.Item columns={6}>
946
+ <Placeholder>Item 2</Placeholder>
947
+ </View.Item>
948
+ <View.Item columns={9}>
949
+ <Placeholder>Item 3</Placeholder>
950
+ </View.Item>
951
+ </View>
952
+ </Example.Item>
887
953
 
888
- <Example.Item title={["responsive columns", "[s] columns 6, 6, 12, gap: 4", "[m+]: 4, 4, 4"]}>
889
- <View direction="row" gap={4}>
890
- <View.Item columns={{ s: 6, m: 4 }}>
891
- <Placeholder>Item 1</Placeholder>
892
- </View.Item>
893
- <View.Item columns={{ s: 6, m: 4 }}>
894
- <Placeholder>Item 2</Placeholder>
895
- </View.Item>
896
- <View.Item columns={{ s: 12, m: 4 }}>
897
- <Placeholder>Item 3</Placeholder>
898
- </View.Item>
899
- </View>
900
- </Example.Item>
954
+ <Example.Item title={["responsive columns", "[s] columns 6, 6, 12, gap: 4", "[m+]: 4, 4, 4"]}>
955
+ <View direction="row" gap={4}>
956
+ <View.Item columns={{ s: 6, m: 4 }}>
957
+ <Placeholder>Item 1</Placeholder>
958
+ </View.Item>
959
+ <View.Item columns={{ s: 6, m: 4 }}>
960
+ <Placeholder>Item 2</Placeholder>
961
+ </View.Item>
962
+ <View.Item columns={{ s: 12, m: 4 }}>
963
+ <Placeholder>Item 3</Placeholder>
964
+ </View.Item>
965
+ </View>
966
+ </Example.Item>
901
967
 
902
- <Example.Item title="columns 6, 6, 9, gap: 4, 2nd item gapBefore: 20">
903
- <View direction="row" gap={4}>
904
- <View.Item columns={6}>
905
- <Placeholder>Item 1</Placeholder>
906
- </View.Item>
907
- <View.Item columns={6} gapBefore={20}>
908
- <Placeholder>Item 2</Placeholder>
909
- </View.Item>
910
- <View.Item columns={9}>
911
- <Placeholder>Item 3</Placeholder>
912
- </View.Item>
913
- </View>
914
- </Example.Item>
915
- </Example>);
916
- export const itemOrder = () => (<Example>
917
- <Example.Item title="order: 1 3 2">
918
- <View direction="row" gap={4}>
919
- <View.Item columns={4}>
920
- <Placeholder>Item 1</Placeholder>
921
- </View.Item>
922
- <View.Item columns={4} order={1}>
923
- <Placeholder>Item 2</Placeholder>
924
- </View.Item>
925
- <View.Item columns={4}>
926
- <Placeholder>Item 3</Placeholder>
927
- </View.Item>
928
- </View>
929
- </Example.Item>
930
- <Example.Item title={["responsive order", "[s] 1 2 3", "[m+] 1 3 2"]}>
931
- <View direction="row" gap={4}>
932
- <View.Item columns={4}>
933
- <Placeholder>Item 1</Placeholder>
934
- </View.Item>
935
- <View.Item columns={4} order={{ s: 0, m: 1 }}>
936
- <Placeholder>Item 2</Placeholder>
937
- </View.Item>
938
- <View.Item columns={4}>
939
- <Placeholder>Item 3</Placeholder>
940
- </View.Item>
941
- </View>
942
- </Example.Item>
943
- <Example.Item title={[
944
- "responsive order",
945
- "[s]: 1 3 2, 2 is full width on second row",
946
- "[m+]: 1 2 3, 2 has grow in the center of the first row",
947
- ]}>
948
- <View direction="row" gap={3}>
949
- <View.Item columns={{ s: 6, m: "auto" }}>
950
- <Placeholder>Item 1</Placeholder>
951
- </View.Item>
952
- <View.Item grow={{ s: false, m: true }} order={{ s: 1, m: 0 }} columns={{ s: 12, m: "auto" }}>
953
- <Placeholder>Item 2</Placeholder>
954
- </View.Item>
955
- <View.Item columns={{ s: 6, m: "auto" }}>
956
- <Placeholder>Item 3</Placeholder>
957
- </View.Item>
958
- </View>
959
- </Example.Item>
960
- </Example>);
961
- export const testHiddenItem = () => (<Example>
962
- <Example.Item title={[
963
- "[s] 2nd item: visible, grow, 3rd item: !grow",
964
- "[m+] 2nd item: hidden, 2nd item divider: hidden, 3rd item: grow",
965
- ]}>
966
- <View direction="row" divided gap={3}>
967
- <Placeholder />
968
- <Hidden hide={{ s: false, m: true }}>
969
- <View.Item grow key="3">
970
- <Placeholder />
968
+ <Example.Item title="columns 6, 6, 9, gap: 4, 2nd item gapBefore: 20">
969
+ <View direction="row" gap={4}>
970
+ <View.Item columns={6}>
971
+ <Placeholder>Item 1</Placeholder>
972
+ </View.Item>
973
+ <View.Item columns={6} gapBefore={20}>
974
+ <Placeholder>Item 2</Placeholder>
975
+ </View.Item>
976
+ <View.Item columns={9}>
977
+ <Placeholder>Item 3</Placeholder>
978
+ </View.Item>
979
+ </View>
980
+ </Example.Item>
981
+ </Example>),
982
+ };
983
+ export const itemOrder = {
984
+ name: "item, order",
985
+ render: () => (<Example>
986
+ <Example.Item title="order: 1 3 2">
987
+ <View direction="row" gap={4}>
988
+ <View.Item columns={4}>
989
+ <Placeholder>Item 1</Placeholder>
990
+ </View.Item>
991
+ <View.Item columns={4} order={1}>
992
+ <Placeholder>Item 2</Placeholder>
993
+ </View.Item>
994
+ <View.Item columns={4}>
995
+ <Placeholder>Item 3</Placeholder>
996
+ </View.Item>
997
+ </View>
998
+ </Example.Item>
999
+ <Example.Item title={["responsive order", "[s] 1 2 3", "[m+] 1 3 2"]}>
1000
+ <View direction="row" gap={4}>
1001
+ <View.Item columns={4}>
1002
+ <Placeholder>Item 1</Placeholder>
1003
+ </View.Item>
1004
+ <View.Item columns={4} order={{ s: 0, m: 1 }}>
1005
+ <Placeholder>Item 2</Placeholder>
971
1006
  </View.Item>
972
- </Hidden>
973
- <View.Item grow={{ s: false, m: true }}>
1007
+ <View.Item columns={4}>
1008
+ <Placeholder>Item 3</Placeholder>
1009
+ </View.Item>
1010
+ </View>
1011
+ </Example.Item>
1012
+ <Example.Item title={[
1013
+ "responsive order",
1014
+ "[s]: 1 3 2, 2 is full width on second row",
1015
+ "[m+]: 1 2 3, 2 has grow in the center of the first row",
1016
+ ]}>
1017
+ <View direction="row" gap={3}>
1018
+ <View.Item columns={{ s: 6, m: "auto" }}>
1019
+ <Placeholder>Item 1</Placeholder>
1020
+ </View.Item>
1021
+ <View.Item grow={{ s: false, m: true }} order={{ s: 1, m: 0 }} columns={{ s: 12, m: "auto" }}>
1022
+ <Placeholder>Item 2</Placeholder>
1023
+ </View.Item>
1024
+ <View.Item columns={{ s: 6, m: "auto" }}>
1025
+ <Placeholder>Item 3</Placeholder>
1026
+ </View.Item>
1027
+ </View>
1028
+ </Example.Item>
1029
+ </Example>),
1030
+ };
1031
+ export const hiddenItem = {
1032
+ name: "composition, Hidden item",
1033
+ render: () => (<Example>
1034
+ <Example.Item title={[
1035
+ "[s] 2nd item: visible, grow, 3rd item: !grow",
1036
+ "[m+] 2nd item: hidden, 2nd item divider: hidden, 3rd item: grow",
1037
+ ]}>
1038
+ <View direction="row" divided gap={3}>
974
1039
  <Placeholder />
975
- </View.Item>
976
- </View>
977
- </Example.Item>
978
-
979
- <Example.Item title={[
980
- "[s] 2nd item: visible, grow, 3rd item: !grow",
981
- "[m+] 2nd item: hidden, 2nd item: grow doesn't push 3rd item, 3rd item: grow",
982
- ]}>
983
- <View direction="row" gap={3}>
984
- <Placeholder />
985
- <Hidden hide={{ s: false, m: true }}>
986
- <View.Item grow>
1040
+ <Hidden hide={{ s: false, m: true }}>
1041
+ <View.Item grow key="3">
1042
+ <Placeholder />
1043
+ </View.Item>
1044
+ </Hidden>
1045
+ <View.Item grow={{ s: false, m: true }}>
987
1046
  <Placeholder />
988
1047
  </View.Item>
989
- </Hidden>
990
- <View.Item grow={{ s: false, m: true }}>
991
- <Placeholder />
992
- </View.Item>
993
- </View>
994
- </Example.Item>
995
- </Example>);
996
- export const testNestedGaps = () => (<Example>
997
- <Example.Item title={[
998
- "direction: column, gap: 10",
999
- "Child 1: direction: column, gap: 2",
1000
- "Child 2: direction column, gap: 6",
1001
- "Child 3: gapBefore: 0",
1002
- "Child 3 view: direction: row, gap: 2",
1003
- ]}>
1004
- <View gap={10}>
1005
- <View gap={2}>
1006
- <Placeholder>Child 1</Placeholder>
1007
- <Placeholder>Child 1</Placeholder>
1008
1048
  </View>
1049
+ </Example.Item>
1009
1050
 
1010
- <View gap={6}>
1011
- <Placeholder>Child 2</Placeholder>
1012
- <Placeholder>Child 2</Placeholder>
1051
+ <Example.Item title={[
1052
+ "[s] 2nd item: visible, grow, 3rd item: !grow",
1053
+ "[m+] 2nd item: hidden, 2nd item: grow doesn't push 3rd item, 3rd item: grow",
1054
+ ]}>
1055
+ <View direction="row" gap={3}>
1056
+ <Placeholder />
1057
+ <Hidden hide={{ s: false, m: true }}>
1058
+ <View.Item grow>
1059
+ <Placeholder />
1060
+ </View.Item>
1061
+ </Hidden>
1062
+ <View.Item grow={{ s: false, m: true }}>
1063
+ <Placeholder />
1064
+ </View.Item>
1013
1065
  </View>
1066
+ </Example.Item>
1067
+ </Example>),
1068
+ };
1069
+ export const nestedGaps = {
1070
+ name: "composition, nested gap",
1071
+ render: () => (<Example>
1072
+ <Example.Item title={[
1073
+ "direction: column, gap: 10",
1074
+ "Child 1: direction: column, gap: 2",
1075
+ "Child 2: direction column, gap: 6",
1076
+ "Child 3: gapBefore: 0",
1077
+ "Child 3 view: direction: row, gap: 2",
1078
+ ]}>
1079
+ <View gap={10}>
1080
+ <View gap={2}>
1081
+ <Placeholder>Child 1</Placeholder>
1082
+ <Placeholder>Child 1</Placeholder>
1083
+ </View>
1014
1084
 
1015
- <View.Item gapBefore={0}>
1016
- <View direction="row" gap={2}>
1017
- <Placeholder>Child 3, very long text</Placeholder>
1018
- <Placeholder>Child 3, very long text</Placeholder>
1019
- <Placeholder>Child 3, very long text</Placeholder>
1020
- <Placeholder>Child 3, very long text</Placeholder>
1021
- <Placeholder>Child 3, very long text</Placeholder>
1022
- <Placeholder>Child 3, very long text</Placeholder>
1085
+ <View gap={6}>
1086
+ <Placeholder>Child 2</Placeholder>
1087
+ <Placeholder>Child 2</Placeholder>
1023
1088
  </View>
1024
- </View.Item>
1025
- </View>
1026
- </Example.Item>
1027
- </Example>);
1028
- export const testComposition = () => (<Example>
1029
- <Example.Item title={[
1030
- "View.Item, MenuItem, Aspect ratio",
1031
- "ratio should increase height on viewport change",
1032
- ]}>
1033
- <View direction="row" gap={3}>
1034
- <View.Item>
1089
+
1090
+ <View.Item gapBefore={0}>
1091
+ <View direction="row" gap={2}>
1092
+ <Placeholder>Child 3, very long text</Placeholder>
1093
+ <Placeholder>Child 3, very long text</Placeholder>
1094
+ <Placeholder>Child 3, very long text</Placeholder>
1095
+ <Placeholder>Child 3, very long text</Placeholder>
1096
+ <Placeholder>Child 3, very long text</Placeholder>
1097
+ <Placeholder>Child 3, very long text</Placeholder>
1098
+ </View>
1099
+ </View.Item>
1100
+ </View>
1101
+ </Example.Item>
1102
+ </Example>),
1103
+ };
1104
+ export const testComposition = {
1105
+ name: "composition, edge cases",
1106
+ render: () => (<Example>
1107
+ <Example.Item title={[
1108
+ "View.Item, MenuItem, Aspect ratio",
1109
+ "ratio should increase height on viewport change",
1110
+ ]}>
1111
+ <View direction="row" gap={3}>
1112
+ <View.Item>
1113
+ <Placeholder />
1114
+ </View.Item>
1115
+ <MenuItem selected roundedCorners>
1116
+ Menu
1117
+ </MenuItem>
1118
+ <View.Item grow>
1119
+ <View aspectRatio={16 / 9}>
1120
+ <Placeholder h="100%"/>
1121
+ </View>
1122
+ </View.Item>
1123
+ </View>
1124
+ </Example.Item>
1125
+ <Example.Item title="Scrollable tabs inside View.Item with grow">
1126
+ <View gap={3}>
1035
1127
  <Placeholder />
1036
- </View.Item>
1037
- <MenuItem selected roundedCorners>
1038
- Menu
1039
- </MenuItem>
1040
- <View.Item grow>
1041
- <View aspectRatio={16 / 9}>
1042
- <Placeholder h="100%"/>
1128
+ <View direction="row" align="center" gap={3}>
1129
+ <Placeholder />
1130
+ <View.Item grow>
1131
+ <View padding={0} align="center">
1132
+ <Tabs variant="pills">
1133
+ <Tabs.List>
1134
+ <Tabs.Item value="1">Very long item</Tabs.Item>
1135
+ <Tabs.Item value="2">Very long item</Tabs.Item>
1136
+ <Tabs.Item value="3">Very long item</Tabs.Item>
1137
+ <Tabs.Item value="4">Very long item</Tabs.Item>
1138
+ <Tabs.Item value="5">Very long item</Tabs.Item>
1139
+ <Tabs.Item value="6">Very long item</Tabs.Item>
1140
+ </Tabs.List>
1141
+ {[1, 2, 3, 5, 6].map((i) => (<Tabs.Panel key={i} value={i.toString()}/>))}
1142
+ </Tabs>
1143
+ </View>
1144
+ </View.Item>
1145
+ <Placeholder />
1043
1146
  </View>
1044
- </View.Item>
1045
- </View>
1046
- </Example.Item>
1047
- <Example.Item title="Scrollable tabs inside View.Item with grow">
1048
- <View gap={3}>
1049
- <Placeholder />
1050
- <View direction="row" align="center" gap={3}>
1051
- <Placeholder />
1147
+ </View>
1148
+ </Example.Item>
1149
+ <Example.Item title="2nd item has grow, Avatar stays circle">
1150
+ <View direction="row" gap={3}>
1151
+ <Avatar initials="DB"/>
1052
1152
  <View.Item grow>
1053
- <View padding={0} align="center">
1054
- <Tabs variant="pills">
1055
- <Tabs.List>
1056
- <Tabs.Item value="1">Very long item</Tabs.Item>
1057
- <Tabs.Item value="2">Very long item</Tabs.Item>
1058
- <Tabs.Item value="3">Very long item</Tabs.Item>
1059
- <Tabs.Item value="4">Very long item</Tabs.Item>
1060
- <Tabs.Item value="5">Very long item</Tabs.Item>
1061
- <Tabs.Item value="6">Very long item</Tabs.Item>
1062
- </Tabs.List>
1063
- </Tabs>
1153
+ Veggies sunt bona vobis, proinde vos postulo esse magis grape pea sprouts horseradish
1154
+ courgette maize spinach prairie turnip jícama coriander quandong gourd broccoli seakale
1155
+ gumbo. Parsley corn lentil zucchini radicchio maize burdock avocado sea lettuce.
1156
+ Garbanzo tigernut earthnut pea fennel.
1157
+ </View.Item>
1158
+ </View>
1159
+ </Example.Item>
1160
+ <Example.Item title={[
1161
+ "item gapBefore from parent doesn't affect the child view",
1162
+ "columns should take full width",
1163
+ ]}>
1164
+ <View>
1165
+ <View.Item gapBefore={20}>
1166
+ <View direction="row" gap={4}>
1167
+ <View.Item columns={6}>
1168
+ <Placeholder />
1169
+ </View.Item>
1170
+ <View.Item columns={6}>
1171
+ <Placeholder />
1172
+ </View.Item>
1064
1173
  </View>
1065
1174
  </View.Item>
1066
- <Placeholder />
1067
1175
  </View>
1068
- </View>
1069
- </Example.Item>
1070
- <Example.Item title="2nd item has grow, Avatar stays circle">
1071
- <View direction="row" gap={3}>
1072
- <Avatar initials="DB"/>
1073
- <View.Item grow>
1074
- Veggies sunt bona vobis, proinde vos postulo esse magis grape pea sprouts horseradish
1075
- courgette maize spinach prairie turnip jícama coriander quandong gourd broccoli seakale
1076
- gumbo. Parsley corn lentil zucchini radicchio maize burdock avocado sea lettuce. Garbanzo
1077
- tigernut earthnut pea fennel.
1078
- </View.Item>
1079
- </View>
1080
- </Example.Item>
1081
- <Example.Item title={[
1082
- "item gapBefore from parent doesn't affect the child view",
1083
- "columns should take full width",
1084
- ]}>
1085
- <View>
1086
- <View.Item gapBefore={20}>
1087
- <View direction="row" gap={4}>
1088
- <View.Item columns={6}>
1089
- <Placeholder />
1090
- </View.Item>
1091
- <View.Item columns={6}>
1092
- <Placeholder />
1093
- </View.Item>
1176
+ </Example.Item>
1177
+ <Example.Item title="View becomes flexbox if there is a child with grow">
1178
+ <View height="300px" borderColor="neutral-faded">
1179
+ <View height="50px"/>
1180
+ <View grow backgroundColor="neutral-faded" padding={4}>
1181
+ Grow
1094
1182
  </View>
1095
- </View.Item>
1096
- </View>
1097
- </Example.Item>
1098
- <Example.Item title="View becomes flexbox if there is a child with grow">
1099
- <View height="300px" borderColor="neutral-faded">
1100
- <View height="50px"/>
1101
- <View grow backgroundColor="neutral-faded" padding={4}>
1102
- Grow
1103
- </View>
1104
- </View>
1105
- </Example.Item>
1106
- </Example>);
1183
+ </View>
1184
+ </Example.Item>
1185
+ </Example>),
1186
+ };