@commercetools/nimbus 0.0.2 → 0.0.3-alpha.3

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 (302) hide show
  1. package/dist/index.d.ts +1412 -0
  2. package/dist/index.js +11183 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.umd.cjs +27 -0
  5. package/dist/index.umd.cjs.map +1 -0
  6. package/package.json +42 -11
  7. package/.storybook/apca-check/index.ts +0 -150
  8. package/.storybook/main.ts +0 -64
  9. package/.storybook/preview.tsx +0 -92
  10. package/.storybook/vitest.setup.ts +0 -13
  11. package/docs/architecture-decisions/adr-0001-consumer-component-apis.md +0 -177
  12. package/docs/architecture-decisions/adr-0002-compound-component-extraction.md +0 -82
  13. package/src/components/accordion/accordion-context.tsx +0 -17
  14. package/src/components/accordion/accordion.mdx +0 -172
  15. package/src/components/accordion/accordion.recipe.tsx +0 -98
  16. package/src/components/accordion/accordion.slots.tsx +0 -39
  17. package/src/components/accordion/accordion.stories.tsx +0 -188
  18. package/src/components/accordion/accordion.tsx +0 -16
  19. package/src/components/accordion/accordion.types.tsx +0 -54
  20. package/src/components/accordion/components/accordion-content.tsx +0 -28
  21. package/src/components/accordion/components/accordion-group.tsx +0 -27
  22. package/src/components/accordion/components/accordion-header.tsx +0 -63
  23. package/src/components/accordion/components/accordion-item.tsx +0 -87
  24. package/src/components/accordion/index.ts +0 -2
  25. package/src/components/alert/alert.mdx +0 -92
  26. package/src/components/alert/alert.recipe.tsx +0 -65
  27. package/src/components/alert/alert.slots.tsx +0 -46
  28. package/src/components/alert/alert.stories.tsx +0 -308
  29. package/src/components/alert/alert.tsx +0 -18
  30. package/src/components/alert/alert.types.tsx +0 -70
  31. package/src/components/alert/components/alert.actions.tsx +0 -27
  32. package/src/components/alert/components/alert.description.tsx +0 -27
  33. package/src/components/alert/components/alert.dismiss-button.tsx +0 -41
  34. package/src/components/alert/components/alert.root.tsx +0 -92
  35. package/src/components/alert/components/alert.title.tsx +0 -29
  36. package/src/components/alert/index.ts +0 -2
  37. package/src/components/avatar/avatar.mdx +0 -80
  38. package/src/components/avatar/avatar.recipe.tsx +0 -36
  39. package/src/components/avatar/avatar.slots.tsx +0 -16
  40. package/src/components/avatar/avatar.stories.tsx +0 -136
  41. package/src/components/avatar/avatar.tsx +0 -34
  42. package/src/components/avatar/avatar.types.ts +0 -33
  43. package/src/components/avatar/index.ts +0 -2
  44. package/src/components/badge/badge.mdx +0 -91
  45. package/src/components/badge/badge.recipe.tsx +0 -72
  46. package/src/components/badge/badge.slots.tsx +0 -8
  47. package/src/components/badge/badge.stories.tsx +0 -124
  48. package/src/components/badge/badge.tsx +0 -35
  49. package/src/components/badge/badge.types.tsx +0 -40
  50. package/src/components/badge/index.ts +0 -2
  51. package/src/components/bleed/bleed.tsx +0 -1
  52. package/src/components/bleed/index.ts +0 -1
  53. package/src/components/box/box.mdx +0 -115
  54. package/src/components/box/box.stories.tsx +0 -71
  55. package/src/components/box/box.tsx +0 -11
  56. package/src/components/box/index.ts +0 -1
  57. package/src/components/button/button.mdx +0 -169
  58. package/src/components/button/button.recipe.ts +0 -185
  59. package/src/components/button/button.slots.tsx +0 -45
  60. package/src/components/button/button.stories.tsx +0 -369
  61. package/src/components/button/button.tsx +0 -37
  62. package/src/components/button/button.types.ts +0 -14
  63. package/src/components/button/index.ts +0 -2
  64. package/src/components/card/card.mdx +0 -92
  65. package/src/components/card/card.recipe.tsx +0 -71
  66. package/src/components/card/card.slots.tsx +0 -50
  67. package/src/components/card/card.stories.tsx +0 -175
  68. package/src/components/card/card.tsx +0 -9
  69. package/src/components/card/card.types.ts +0 -22
  70. package/src/components/card/components/card.content.tsx +0 -29
  71. package/src/components/card/components/card.header.tsx +0 -28
  72. package/src/components/card/components/card.root.tsx +0 -62
  73. package/src/components/card/index.ts +0 -2
  74. package/src/components/checkbox/checkbox.mdx +0 -78
  75. package/src/components/checkbox/checkbox.recipe.tsx +0 -116
  76. package/src/components/checkbox/checkbox.slots.tsx +0 -33
  77. package/src/components/checkbox/checkbox.stories.tsx +0 -200
  78. package/src/components/checkbox/checkbox.tsx +0 -77
  79. package/src/components/checkbox/checkbox.types.tsx +0 -22
  80. package/src/components/checkbox/index.ts +0 -2
  81. package/src/components/code/code.mdx +0 -17
  82. package/src/components/code/code.recipe.ts +0 -63
  83. package/src/components/code/code.tsx +0 -1
  84. package/src/components/code/index.ts +0 -1
  85. package/src/components/dialog/dialog.mdx +0 -20
  86. package/src/components/dialog/dialog.recipe.ts +0 -254
  87. package/src/components/dialog/dialog.tsx +0 -61
  88. package/src/components/dialog/index.ts +0 -1
  89. package/src/components/em/em.mdx +0 -17
  90. package/src/components/em/em.tsx +0 -1
  91. package/src/components/em/index.ts +0 -1
  92. package/src/components/flex/flex.mdx +0 -41
  93. package/src/components/flex/flex.tsx +0 -1
  94. package/src/components/flex/index.ts +0 -1
  95. package/src/components/grid/grid.mdx +0 -156
  96. package/src/components/grid/grid.stories.tsx +0 -151
  97. package/src/components/grid/grid.tsx +0 -29
  98. package/src/components/grid/index.ts +0 -1
  99. package/src/components/heading/heading.mdx +0 -23
  100. package/src/components/heading/heading.recipe.ts +0 -49
  101. package/src/components/heading/heading.tsx +0 -1
  102. package/src/components/heading/index.ts +0 -1
  103. package/src/components/highlight/highlight.mdx +0 -18
  104. package/src/components/highlight/highlight.tsx +0 -1
  105. package/src/components/highlight/index.ts +0 -1
  106. package/src/components/icon-button/icon-button.mdx +0 -98
  107. package/src/components/icon-button/icon-button.stories.tsx +0 -188
  108. package/src/components/icon-button/icon-button.tsx +0 -21
  109. package/src/components/icon-button/icon-button.types.tsx +0 -10
  110. package/src/components/icon-button/index.ts +0 -2
  111. package/src/components/index.ts +0 -33
  112. package/src/components/input/index.ts +0 -1
  113. package/src/components/input/input.mdx +0 -20
  114. package/src/components/input/input.recipe.ts +0 -95
  115. package/src/components/input/input.tsx +0 -1
  116. package/src/components/input-group/index.ts +0 -1
  117. package/src/components/input-group/input-group.mdx +0 -20
  118. package/src/components/input-group/input-group.tsx +0 -44
  119. package/src/components/kbd/index.ts +0 -1
  120. package/src/components/kbd/kbd.mdx +0 -18
  121. package/src/components/kbd/kbd.recipe.ts +0 -57
  122. package/src/components/kbd/kbd.tsx +0 -1
  123. package/src/components/link/index.ts +0 -2
  124. package/src/components/link/link.mdx +0 -77
  125. package/src/components/link/link.recipe.ts +0 -52
  126. package/src/components/link/link.slots.tsx +0 -29
  127. package/src/components/link/link.stories.tsx +0 -204
  128. package/src/components/link/link.tsx +0 -38
  129. package/src/components/link/link.types.tsx +0 -26
  130. package/src/components/list/index.ts +0 -1
  131. package/src/components/list/list.mdx +0 -18
  132. package/src/components/list/list.recipe.ts +0 -68
  133. package/src/components/list/list.tsx +0 -9
  134. package/src/components/loading-spinner/index.ts +0 -2
  135. package/src/components/loading-spinner/loading-spinner.mdx +0 -92
  136. package/src/components/loading-spinner/loading-spinner.recipe.tsx +0 -70
  137. package/src/components/loading-spinner/loading-spinner.slots.tsx +0 -38
  138. package/src/components/loading-spinner/loading-spinner.stories.tsx +0 -97
  139. package/src/components/loading-spinner/loading-spinner.tsx +0 -50
  140. package/src/components/loading-spinner/loading-spinner.types.tsx +0 -21
  141. package/src/components/nimbus-provider/color-mode.tsx +0 -32
  142. package/src/components/nimbus-provider/index.ts +0 -2
  143. package/src/components/nimbus-provider/nimbus-provider.mdx +0 -21
  144. package/src/components/nimbus-provider/nimbus-provider.tsx +0 -51
  145. package/src/components/select/components/select.clear-button.tsx +0 -31
  146. package/src/components/select/components/select.option-group.tsx +0 -48
  147. package/src/components/select/components/select.option.tsx +0 -21
  148. package/src/components/select/components/select.options.tsx +0 -23
  149. package/src/components/select/components/select.root.tsx +0 -81
  150. package/src/components/select/index.ts +0 -2
  151. package/src/components/select/select.mdx +0 -170
  152. package/src/components/select/select.recipe.tsx +0 -216
  153. package/src/components/select/select.slots.tsx +0 -58
  154. package/src/components/select/select.stories.tsx +0 -841
  155. package/src/components/select/select.tsx +0 -18
  156. package/src/components/select/select.types.tsx +0 -37
  157. package/src/components/simple-grid/index.ts +0 -1
  158. package/src/components/simple-grid/simple-grid.mdx +0 -133
  159. package/src/components/simple-grid/simple-grid.stories.tsx +0 -143
  160. package/src/components/simple-grid/simple-grid.tsx +0 -31
  161. package/src/components/stack/index.ts +0 -1
  162. package/src/components/stack/stack.mdx +0 -88
  163. package/src/components/stack/stack.stories.tsx +0 -82
  164. package/src/components/stack/stack.tsx +0 -15
  165. package/src/components/table/index.ts +0 -1
  166. package/src/components/table/table.mdx +0 -23
  167. package/src/components/table/table.recipe.ts +0 -170
  168. package/src/components/table/table.tsx +0 -43
  169. package/src/components/text/index.ts +0 -1
  170. package/src/components/text/text.mdx +0 -244
  171. package/src/components/text/text.tsx +0 -23
  172. package/src/components/text-input/index.ts +0 -2
  173. package/src/components/text-input/text-input.mdx +0 -118
  174. package/src/components/text-input/text-input.recipe.tsx +0 -68
  175. package/src/components/text-input/text-input.slots.tsx +0 -24
  176. package/src/components/text-input/text-input.stories.tsx +0 -282
  177. package/src/components/text-input/text-input.tsx +0 -39
  178. package/src/components/text-input/text-input.types.ts +0 -7
  179. package/src/components/toggle-button-group/components/toggle-button-group.button.tsx +0 -14
  180. package/src/components/toggle-button-group/components/toggle-button-group.root.tsx +0 -15
  181. package/src/components/toggle-button-group/index.ts +0 -2
  182. package/src/components/toggle-button-group/toggle-button-group.mdx +0 -94
  183. package/src/components/toggle-button-group/toggle-button-group.recipe.tsx +0 -64
  184. package/src/components/toggle-button-group/toggle-button-group.slots.tsx +0 -26
  185. package/src/components/toggle-button-group/toggle-button-group.stories.tsx +0 -311
  186. package/src/components/toggle-button-group/toggle-button-group.tsx +0 -12
  187. package/src/components/toggle-button-group/toggle-button-group.types.tsx +0 -62
  188. package/src/components/tooltip/index.ts +0 -4
  189. package/src/components/tooltip/make-element-focusable.stories.tsx +0 -56
  190. package/src/components/tooltip/make-element-focusable.tsx +0 -57
  191. package/src/components/tooltip/tooltip-trigger.stories.tsx +0 -157
  192. package/src/components/tooltip/tooltip-trigger.tsx +0 -15
  193. package/src/components/tooltip/tooltip.mdx +0 -48
  194. package/src/components/tooltip/tooltip.recipe.ts +0 -26
  195. package/src/components/tooltip/tooltip.slots.ts +0 -35
  196. package/src/components/tooltip/tooltip.stories.tsx +0 -139
  197. package/src/components/tooltip/tooltip.tsx +0 -31
  198. package/src/components/tooltip/tooltip.types.ts +0 -44
  199. package/src/components/visually-hidden/index.ts +0 -1
  200. package/src/components/visually-hidden/visually-hidden.mdx +0 -61
  201. package/src/components/visually-hidden/visually-hidden.stories.tsx +0 -124
  202. package/src/components/visually-hidden/visually-hidden.tsx +0 -18
  203. package/src/docs/accessibility.mdx +0 -21
  204. package/src/docs/background.mdx +0 -154
  205. package/src/docs/border.mdx +0 -226
  206. package/src/docs/changelog.mdx +0 -17
  207. package/src/docs/components-layout.mdx +0 -22
  208. package/src/docs/components.mdx +0 -17
  209. package/src/docs/data-display.mdx +0 -23
  210. package/src/docs/display.mdx +0 -55
  211. package/src/docs/effects.mdx +0 -73
  212. package/src/docs/feedback.mdx +0 -22
  213. package/src/docs/filters.mdx +0 -268
  214. package/src/docs/flex-and-grid.mdx +0 -445
  215. package/src/docs/forms.mdx +0 -22
  216. package/src/docs/generated/index.mdx +0 -16
  217. package/src/docs/getting-started.mdx +0 -17
  218. package/src/docs/home.mdx +0 -56
  219. package/src/docs/hooks.mdx +0 -16
  220. package/src/docs/inputs.mdx +0 -21
  221. package/src/docs/installation.mdx +0 -60
  222. package/src/docs/interactivity.mdx +0 -278
  223. package/src/docs/known-issues.mdx +0 -19
  224. package/src/docs/layout.mdx +0 -301
  225. package/src/docs/list.mdx +0 -82
  226. package/src/docs/markdown.mdx +0 -234
  227. package/src/docs/media.mdx +0 -22
  228. package/src/docs/naivgation.mdx +0 -22
  229. package/src/docs/playground.mdx +0 -16
  230. package/src/docs/rfcs-component-structure-rfcs.mdx +0 -17
  231. package/src/docs/rfcs-component-structure.mdx +0 -74
  232. package/src/docs/rfcs-hook-structure.mdx +0 -59
  233. package/src/docs/sizing.mdx +0 -210
  234. package/src/docs/spacing.mdx +0 -193
  235. package/src/docs/style-props-typography.mdx +0 -373
  236. package/src/docs/style-props.mdx +0 -15
  237. package/src/docs/svg.mdx +0 -58
  238. package/src/docs/tables.mdx +0 -95
  239. package/src/docs/toc.mdx +0 -39
  240. package/src/docs/tokens/animations.mdx +0 -68
  241. package/src/docs/tokens/aspect-ratios.mdx +0 -21
  242. package/src/docs/tokens/blurs.mdx +0 -20
  243. package/src/docs/tokens/borders.mdx +0 -25
  244. package/src/docs/tokens/breakpoints.mdx +0 -35
  245. package/src/docs/tokens/colors.mdx +0 -86
  246. package/src/docs/tokens/cursors.mdx +0 -21
  247. package/src/docs/tokens/radii.mdx +0 -23
  248. package/src/docs/tokens/shadows.mdx +0 -21
  249. package/src/docs/tokens/sizes.mdx +0 -54
  250. package/src/docs/tokens/spacing.mdx +0 -35
  251. package/src/docs/tokens/typography.mdx +0 -61
  252. package/src/docs/tokens/z-indices.mdx +0 -23
  253. package/src/docs/tokens-other.mdx +0 -17
  254. package/src/docs/tokens.mdx +0 -16
  255. package/src/docs/transforms.mdx +0 -150
  256. package/src/docs/transitions.mdx +0 -164
  257. package/src/docs/typography.mdx +0 -17
  258. package/src/docs/utilities.mdx +0 -17
  259. package/src/hooks/index.ts +0 -2
  260. package/src/hooks/use-copy-to-clipboard/use-copy-to-clipboard.mdx +0 -54
  261. package/src/hooks/use-copy-to-clipboard/use-copy-to-clipboard.ts +0 -1
  262. package/src/hooks/use-hotkeys/use-hotkeys.mdx +0 -48
  263. package/src/hooks/use-hotkeys/use-hotkeys.stories.tsx +0 -69
  264. package/src/hooks/use-hotkeys/use-hotkeys.ts +0 -1
  265. package/src/index.ts +0 -3
  266. package/src/test/utils.tsx +0 -20
  267. package/src/theme/animation-styles.ts +0 -52
  268. package/src/theme/breakpoints.ts +0 -32
  269. package/src/theme/global-css.ts +0 -53
  270. package/src/theme/index.ts +0 -35
  271. package/src/theme/keyframes.ts +0 -192
  272. package/src/theme/layer-styles.ts +0 -12
  273. package/src/theme/recipes/index.ts +0 -21
  274. package/src/theme/semantic-tokens/colors.ts +0 -55
  275. package/src/theme/semantic-tokens/index.ts +0 -9
  276. package/src/theme/semantic-tokens/radii.ts +0 -3
  277. package/src/theme/semantic-tokens/shadows.ts +0 -4
  278. package/src/theme/slot-recipes/index.ts +0 -15
  279. package/src/theme/text-styles.ts +0 -8
  280. package/src/theme/tokens/animations.ts +0 -4
  281. package/src/theme/tokens/aspect-ratios.ts +0 -5
  282. package/src/theme/tokens/blurs.ts +0 -5
  283. package/src/theme/tokens/borders.ts +0 -4
  284. package/src/theme/tokens/colors.ts +0 -8
  285. package/src/theme/tokens/cursor.ts +0 -4
  286. package/src/theme/tokens/durations.ts +0 -4
  287. package/src/theme/tokens/easings.ts +0 -4
  288. package/src/theme/tokens/font-sizes.ts +0 -4
  289. package/src/theme/tokens/font-weights.ts +0 -4
  290. package/src/theme/tokens/fonts.ts +0 -4
  291. package/src/theme/tokens/index.ts +0 -57
  292. package/src/theme/tokens/letter-spacings.ts +0 -24
  293. package/src/theme/tokens/line-heights.ts +0 -4
  294. package/src/theme/tokens/radii.ts +0 -4
  295. package/src/theme/tokens/sizes.ts +0 -120
  296. package/src/theme/tokens/spacing.ts +0 -4
  297. package/src/theme/tokens/z-index.ts +0 -4
  298. package/src/utils/extractStyleProps.ts +0 -26
  299. package/src/utils/fixedForwardRef.ts +0 -17
  300. package/tsconfig.json +0 -38
  301. package/vite.config.ts +0 -54
  302. package/vitest.config.ts +0 -50
@@ -1,268 +0,0 @@
1
- ---
2
- id: Style Props-Filters
3
- title: Filters
4
- description: JSX style props for applying various filters to elements.
5
- documentState: InitialDraft
6
- order: 999
7
- menu:
8
- - Style Props
9
- - Filters
10
- tags:
11
- - document
12
- ---
13
-
14
- # Filters
15
-
16
- JSX style props for applying various filters to elements.
17
-
18
- ## Filter
19
-
20
- Use the `filter` prop to apply visual effects like blur or color shift to an
21
- element.
22
-
23
- ```jsx
24
- <Box filter="blur(5px)" />
25
- <Box filter="grayscale(80%)" />
26
- ```
27
-
28
- | Prop | CSS Property | Token Category |
29
- | -------- | ------------ | -------------- |
30
- | `filter` | `filter` | - |
31
-
32
- ## Blur
33
-
34
- Use the `blur` prop to apply a blur effect to an element. The requirement for
35
- this prop is to set the `filter` prop to `auto`.
36
-
37
- ```jsx
38
- // hardcoded value
39
- <Box filter="auto" blur="5px" />
40
-
41
- // token value
42
- <Box filter="auto" blur="sm" />
43
- ```
44
-
45
- | Prop | CSS Property | Token Category |
46
- | ------ | ------------ | -------------- |
47
- | `blur` | `--blur` | `blurs` |
48
-
49
- ## Contrast
50
-
51
- Use the `contrast` prop to apply a contrast effect to an element. The
52
- requirement for this prop is to use the `filter` prop and set it to `auto`.
53
-
54
- ```jsx
55
- <Box filter="auto" contrast="0.3" />
56
- ```
57
-
58
- | Prop | CSS Property | Token Category |
59
- | ---------- | ------------ | -------------- |
60
- | `contrast` | `--contrast` | - |
61
-
62
- ## Drop Shadow
63
-
64
- Use the `dropShadow` prop to apply a drop shadow effect to an element. The
65
- requirement for this prop is to use the `filter` prop and set it to `auto`.
66
-
67
- ```jsx
68
- <Box filter="auto" dropShadow="0px 0px 10px rgba(0, 0, 0, 0.5)" />
69
- ```
70
-
71
- | Prop | CSS Property | Token Category |
72
- | ------------ | --------------- | -------------- |
73
- | `dropShadow` | `--drop-shadow` | - |
74
-
75
- ## Grayscale
76
-
77
- Use the `grayscale` prop to apply a grayscale effect to an element. The
78
- requirement for this prop is to use the `filter` prop and set it to `auto`.
79
-
80
- ```jsx
81
- <Box filter="auto" grayscale="64%" />
82
- ```
83
-
84
- | Prop | CSS Property | Token Category |
85
- | ----------- | ------------- | -------------- |
86
- | `grayscale` | `--grayscale` | - |
87
-
88
- ## Hue Rotate
89
-
90
- Use the `hueRotate` prop to apply a hue rotate effect to an element. The
91
- requirement for this prop is to use the `filter` prop and set it to `auto`.
92
-
93
- ```jsx
94
- <Box filter="auto" hueRotate="30deg" />
95
- ```
96
-
97
- | Prop | CSS Property | Token Category |
98
- | ----------- | -------------- | -------------- |
99
- | `hueRotate` | `--hue-rotate` | - |
100
-
101
- ## Invert
102
-
103
- Use the `invert` prop to apply an invert effect to an element. The requirement
104
- for this prop is to use the `filter` prop and set it to `auto`.
105
-
106
- ```jsx
107
- <Box filter="auto" invert="40%" />
108
- ```
109
-
110
- | Prop | CSS Property | Token Category |
111
- | -------- | ------------ | -------------- |
112
- | `invert` | `--invert` | - |
113
-
114
- ## Saturate
115
-
116
- Use the `saturate` prop to apply a saturate effect to an element. The
117
- requirement for this prop is to use the `filter` prop and set it to `auto`.
118
-
119
- ```jsx
120
- <Box filter="auto" saturate="0.4" />
121
- ```
122
-
123
- | Prop | CSS Property | Token Category |
124
- | ---------- | ------------ | -------------- |
125
- | `saturate` | `--saturate` | - |
126
-
127
- ## Sepia
128
-
129
- Use the `sepia` prop to apply a sepia effect to an element. The requirement for
130
- this prop is to use the `filter` prop and set it to `auto`.
131
-
132
- ```jsx
133
- <Box filter="auto" sepia="0.4" />
134
- ```
135
-
136
- | Prop | CSS Property | Token Category |
137
- | ------- | ------------ | -------------- |
138
- | `sepia` | `--sepia` | - |
139
-
140
- ## Backdrop Filter
141
-
142
- Use the `backdropFilter` prop to apply visual effects like blur or color shift
143
- to the area behind an element. This creates a translucent effect.
144
-
145
- ```jsx
146
- <Box backdropFilter="blur(5px)" />
147
- <Box backdropFilter="grayscale(80%)" />
148
- ```
149
-
150
- | Prop | CSS Property | Token Category |
151
- | ---------------- | ----------------- | -------------- |
152
- | `backdropFilter` | `backdrop-filter` | - |
153
-
154
- ## Backdrop Blur
155
-
156
- Use the `backdropBlur` prop to apply a blur effect to the area behind an
157
- element. The requirement for this prop is to set the `backdropFilter` prop to
158
- `auto`.
159
-
160
- ```jsx
161
- // hardcoded value
162
- <Box backdropFilter="auto" backdropBlur="5px" />
163
-
164
- // token value
165
- <Box backdropFilter="auto" backdropBlur="sm" />
166
- ```
167
-
168
- | Prop | CSS Property | Token Category |
169
- | -------------- | ----------------- | -------------- |
170
- | `backdropBlur` | `--backdrop-blur` | `blurs` |
171
-
172
- ## Backdrop Contrast
173
-
174
- Use the `backdropContrast` prop to apply a contrast effect to the area behind an
175
- element. The requirement for this prop is to use the `backdropFilter` prop and
176
- set it to `auto`.
177
-
178
- ```jsx
179
- <Box backdropFilter="auto" backdropContrast="0.3" />
180
- ```
181
-
182
- | Prop | CSS Property | Token Category |
183
- | ------------------ | --------------------- | -------------- |
184
- | `backdropContrast` | `--backdrop-contrast` | - |
185
-
186
- ## Backdrop Grayscale
187
-
188
- Use the `backdropGrayscale` prop to apply a grayscale effect to the area behind
189
- an element. The requirement for this prop is to use the `backdropFilter` prop
190
- and set it to `auto`.
191
-
192
- ```jsx
193
- <Box backdropFilter="auto" backdropGrayscale="64%" />
194
- ```
195
-
196
- | Prop | CSS Property | Token Category |
197
- | ------------------- | ---------------------- | -------------- |
198
- | `backdropGrayscale` | `--backdrop-grayscale` | - |
199
-
200
- ## Backdrop Hue Rotate
201
-
202
- Use the `backdropHueRotate` prop to apply a hue rotate effect to the area behind
203
- an element. The requirement for this prop is to use the `backdropFilter` prop
204
- and set it to `auto`.
205
-
206
- ```jsx
207
- <Box backdropFilter="auto" backdropHueRotate="30deg" />
208
- ```
209
-
210
- | Prop | CSS Property | Token Category |
211
- | ------------------- | ----------------------- | -------------- |
212
- | `backdropHueRotate` | `--backdrop-hue-rotate` | - |
213
-
214
- ## Backdrop Invert
215
-
216
- Use the `backdropInvert` prop to apply an invert effect to the area behind an
217
- element. The requirement for this prop is to use the `backdropFilter` prop and
218
- set it to `auto`.
219
-
220
- ```jsx
221
- <Box backdropFilter="auto" backdropInvert="40%" />
222
- ```
223
-
224
- | Prop | CSS Property | Token Category |
225
- | ---------------- | ------------------- | -------------- |
226
- | `backdropInvert` | `--backdrop-invert` | - |
227
-
228
- ## Backdrop Opacity
229
-
230
- Use the `backdropOpacity` prop to apply an opacity effect to the area behind an
231
- element. The requirement for this prop is to use the `backdropFilter` prop and
232
- set it to `auto`.
233
-
234
- ```jsx
235
- <Box backdropFilter="auto" backdropOpacity="0.4" />
236
- ```
237
-
238
- | Prop | CSS Property | Token Category |
239
- | ----------------- | -------------------- | -------------- |
240
- | `backdropOpacity` | `--backdrop-opacity` | - |
241
-
242
- ## Backdrop Saturate
243
-
244
- Use the `backdropSaturate` prop to apply a saturate effect to the area behind an
245
- element. The requirement for this prop is to use the `backdropFilter` prop and
246
- set it to `auto`.
247
-
248
- ```jsx
249
- <Box backdropFilter="auto" backdropSaturate="0.4" />
250
- ```
251
-
252
- | Prop | CSS Property | Token Category |
253
- | ------------------ | --------------------- | -------------- |
254
- | `backdropSaturate` | `--backdrop-saturate` | - |
255
-
256
- ## Backdrop Sepia
257
-
258
- Use the `backdropSepia` prop to apply a sepia effect to the area behind an
259
- element. The requirement for this prop is to use the `backdropFilter` prop and
260
- set it to `auto`.
261
-
262
- ```jsx
263
- <Box backdropFilter="auto" backdropSepia="0.4" />
264
- ```
265
-
266
- | Prop | CSS Property | Token Category |
267
- | --------------- | ------------------ | -------------- |
268
- | `backdropSepia` | `--backdrop-sepia` | - |
@@ -1,445 +0,0 @@
1
- ---
2
- id: Style Props-Flex and Grid
3
- title: Flex and Grid
4
- description: JSX style props to control flex and grid layouts
5
- documentState: InitialDraft
6
- order: 999
7
- menu:
8
- - Style Props
9
- - Flex and Grid
10
- tags:
11
- - document
12
- ---
13
-
14
- # Flex and Grid
15
-
16
- JSX style props to control flex and grid layouts
17
-
18
- ## Flex Basis
19
-
20
- Use the `flexBasis` prop to set the initial main size of a flex item.
21
-
22
- ```jsx
23
- <Flex>
24
- <Box flexBasis="25%" />
25
- <Box flexBasis="25%" />
26
- <Box flexBasis="50%" />
27
- </Flex>
28
- ```
29
-
30
- | Prop | CSS Property | Token Category |
31
- | ----------- | ------------ | -------------- |
32
- | `flexBasis` | `flex-basis` | - |
33
-
34
- ## Flex Direction
35
-
36
- Use the `flexDir` or `flexDirection` prop to set the direction of the main axis
37
- in a flex container.
38
-
39
- ```jsx
40
- <Box display="flex" flexDirection="column">
41
- <Box>Item 1</Box>
42
- <Box>Item 2</Box>
43
- <Box>Item 3</Box>
44
- </Box>
45
- ```
46
-
47
- When using `Flex` component, the `direction` prop is aliased to `flexDirection`.
48
-
49
- ```jsx
50
- <Flex direction="column">
51
- <Box>Item 1</Box>
52
- <Box>Item 2</Box>
53
- <Box>Item 3</Box>
54
- </Flex>
55
- ```
56
-
57
- | Prop | CSS Property | Token Category |
58
- | -------------------------- | ---------------- | -------------- |
59
- | `flexDir`, `flexDirection` | `flex-direction` | - |
60
-
61
- ## Flex Wrap
62
-
63
- Use the `flexWrap` prop to set whether flex items are forced onto one line or
64
- can wrap onto multiple lines.
65
-
66
- ```jsx
67
- <Box display="flex" flexWrap="wrap">
68
- <Box>Item 1</Box>
69
- <Box>Item 2</Box>
70
- <Box>Item 3</Box>
71
- </Box>
72
- ```
73
-
74
- When using `Flex` component, the `wrap` prop is aliased to `flexWrap`.
75
-
76
- ```jsx
77
- <Flex wrap="wrap">
78
- <Box>Item 1</Box>
79
- <Box>Item 2</Box>
80
- <Box>Item 3</Box>
81
- </Flex>
82
- ```
83
-
84
- | Prop | CSS Property | Token Category |
85
- | ---------- | ------------ | -------------- |
86
- | `flexWrap` | `flex-wrap` | - |
87
-
88
- ## Flex
89
-
90
- Use the `flex` prop to define the flexibility of a flex container or item.
91
-
92
- ```jsx
93
- <Flex>
94
- <Box flex="1" />
95
- <Box />
96
- </Flex>
97
- ```
98
-
99
- | Prop | CSS Property | Token Category |
100
- | ------ | ------------ | -------------- |
101
- | `flex` | `flex` | - |
102
-
103
- ## Flex Grow
104
-
105
- Use the `flexGrow` prop to set the flex grow factor of a flex item.
106
-
107
- ```jsx
108
- <Flex>
109
- <Box flexGrow="0" />
110
- <Box flexGrow="1" />
111
- </Flex>
112
- ```
113
-
114
- | Prop | CSS Property | Token Category |
115
- | ---------- | ------------ | -------------- |
116
- | `flexGrow` | `flex-grow` | - |
117
-
118
- ## Flex Shrink
119
-
120
- Use the `flexShrink` prop to set the flex shrink factor of a flex item.
121
-
122
- ```jsx
123
- <Flex>
124
- <Box flexShrink="0" />
125
- <Box flexShrink="1" />
126
- </Flex>
127
- ```
128
-
129
- | Prop | CSS Property | Token Category |
130
- | ------------ | ------------- | -------------- |
131
- | `flexShrink` | `flex-shrink` | - |
132
-
133
- ## Order
134
-
135
- Use the `order` prop to set the order of a flex item.
136
-
137
- ```jsx
138
- <Flex>
139
- <Box order="0" />
140
- <Box order="1" />
141
- </Flex>
142
- ```
143
-
144
- | Prop | CSS Property | Token Category |
145
- | ------- | ------------ | -------------- |
146
- | `order` | `order` | - |
147
-
148
- ## Gap
149
-
150
- Use the `gap` prop to set the gap between items in a flex or grid container.
151
-
152
- ```jsx
153
- <Flex>
154
- <Box>Item 1</Box>
155
- <Box>Item 2</Box>
156
- <Box>Item 3</Box>
157
- </Flex>
158
- ```
159
-
160
- | Prop | CSS Property | Token Category |
161
- | ----- | ------------ | -------------- |
162
- | `gap` | `gap` | `spacing` |
163
-
164
- ## Grid Template Columns
165
-
166
- Use the `gridTemplateColumns` prop to define the columns of a grid container.
167
-
168
- ```jsx
169
- <Box display="grid" gridTemplateColumns="repeat(3, minmax(0, 1fr))">
170
- <Box>Item 1</Box>
171
- <Box>Item 2</Box>
172
- <Box>Item 3</Box>
173
- </Box>
174
- ```
175
-
176
- When using `Grid` component, the `templateColumns` prop is aliased to
177
- `gridTemplateColumns`.
178
-
179
- ```jsx
180
- <Grid templateColumns="repeat(3, minmax(0, 1fr))">
181
- <Box>Item 1</Box>
182
- <Box>Item 2</Box>
183
- <Box>Item 3</Box>
184
- </Grid>
185
- ```
186
-
187
- ## Grid Template Start/End
188
-
189
- Use the `gridTemplateStart` and `gridTemplateEnd` props to define the start and
190
- end of a grid container.
191
-
192
- ```jsx
193
- <Box display="grid" gridTemplateColumns="repeat(3, minmax(0, 1fr))">
194
- <Box>Item 1</Box>
195
- <Box gridColumn="span 2 / span 2">Item 2</Box>
196
- <Box>Item 3</Box>
197
- </Box>
198
- ```
199
-
200
- | Prop | CSS Property | Token Category |
201
- | ------------------- | --------------------- | -------------- |
202
- | `gridTemplateStart` | `grid-template-start` | - |
203
- | `gridTemplateEnd` | `grid-template-end` | - |
204
-
205
- ## Grid Template Rows
206
-
207
- Use the `gridTemplateRows` prop to define the rows of a grid container.
208
-
209
- ```jsx
210
- <Box display="grid" gridTemplateRows="repeat(3, minmax(0, 1fr))">
211
- <Box>Item 1</Box>
212
- <Box>Item 2</Box>
213
- <Box>Item 3</Box>
214
- </Box>
215
- ```
216
-
217
- | Prop | CSS Property | Token Category |
218
- | ------------------ | -------------------- | -------------- |
219
- | `gridTemplateRows` | `grid-template-rows` | - |
220
-
221
- ## Grid Row Start/End
222
-
223
- Use the `gridRowStart` and `gridRowEnd` props to define the start and end of a
224
- grid item.
225
-
226
- ```jsx
227
- <Box display="grid" gridTemplateRows="repeat(3, minmax(0, 1fr))">
228
- <Box gridRowStart="1" gridRowEnd="3">
229
- Item 1
230
- </Box>
231
- <Box>Item 2</Box>
232
- <Box>Item 3</Box>
233
- </Box>
234
- ```
235
-
236
- | Prop | CSS Property | Token Category |
237
- | -------------- | ---------------- | -------------- |
238
- | `gridRowStart` | `grid-row-start` | - |
239
- | `gridRowEnd` | `grid-row-end` | - |
240
-
241
- ## Grid Autoflow
242
-
243
- Use the `gridAutoFlow` prop to define how auto-placed items get flowed into the
244
- grid.
245
-
246
- ```jsx
247
- <Box display="grid" gridAutoFlow="row">
248
- <Box>Item 1</Box>
249
- <Box>Item 2</Box>
250
- <Box>Item 3</Box>
251
- </Box>
252
- ```
253
-
254
- | Prop | CSS Property | Token Category |
255
- | -------------- | ---------------- | -------------- |
256
- | `gridAutoFlow` | `grid-auto-flow` | - |
257
-
258
- ## Grid Auto Columns
259
-
260
- Use the `gridAutoColumns` prop to specify the size of the grid columns that were
261
- created without an explicit size.
262
-
263
- ```jsx
264
- <Box display="grid" gridAutoColumns="120px">
265
- <Box>Item 1</Box>
266
- <Box>Item 2</Box>
267
- <Box>Item 3</Box>
268
- </Box>
269
- ```
270
-
271
- | Prop | CSS Property | Token Category |
272
- | ----------------- | ------------------- | -------------- |
273
- | `gridAutoColumns` | `grid-auto-columns` | - |
274
-
275
- ## Grid Auto Rows
276
-
277
- Use the `gridAutoRows` prop to specify the size of the grid rows that were
278
- created without an explicit size.
279
-
280
- ```jsx
281
- <Box display="grid" gridTemplateRows="200px" gridAutoRows="120px">
282
- <Box>Item 1</Box>
283
- <Box>Item 2</Box>
284
- <Box>Item 3</Box>
285
- </Box>
286
- ```
287
-
288
- | Prop | CSS Property | Token Category |
289
- | -------------- | ---------------- | -------------- |
290
- | `gridAutoRows` | `grid-auto-rows` | - |
291
-
292
- ## Justify Content
293
-
294
- Use the `justifyContent` prop to align items along the main axis of a flex
295
- container.
296
-
297
- ```jsx
298
- <Box display="flex" justifyContent="center">
299
- <Box>Item 1</Box>
300
- <Box>Item 2</Box>
301
- <Box>Item 3</Box>
302
- </Box>
303
- ```
304
-
305
- When using the `Flex` component, the `justify` prop is aliased to
306
- `justifyContent`.
307
-
308
- ```jsx
309
- <Flex justify="center">
310
- <Box>Item 1</Box>
311
- <Box>Item 2</Box>
312
- <Box>Item 3</Box>
313
- </Flex>
314
- ```
315
-
316
- | Prop | CSS Property | Token Category |
317
- | ---------------- | ----------------- | -------------- |
318
- | `justifyContent` | `justify-content` | - |
319
-
320
- ## Justify Items
321
-
322
- Use the `justifyItems` prop to control the alignment of grid items within their
323
- scope.
324
-
325
- ```jsx
326
- <Box display="grid" justifyItems="center">
327
- <Box>Item 1</Box>
328
- <Box>Item 2</Box>
329
- <Box>Item 3</Box>
330
- </Box>
331
- ```
332
-
333
- | Prop | CSS Property | Token Category |
334
- | -------------- | --------------- | -------------- |
335
- | `justifyItems` | `justify-items` | - |
336
-
337
- ## Align Content
338
-
339
- Use the `alignContent` prop to align rows of content along the cross axis of a
340
- flex container when there's extra space.
341
-
342
- ```jsx
343
- <Box display="flex" alignContent="center">
344
- <Box>Item 1</Box>
345
- <Box>Item 2</Box>
346
- <Box>Item 3</Box>
347
- </Box>
348
- ```
349
-
350
- When using the `Flex` component, the `align` prop is aliased to `alignContent`.
351
-
352
- ```jsx
353
- <Flex align="center">
354
- <Box>Item 1</Box>
355
- <Box>Item 2</Box>
356
- <Box>Item 3</Box>
357
- </Flex>
358
- ```
359
-
360
- | Prop | CSS Property | Token Category |
361
- | -------------- | --------------- | -------------- |
362
- | `alignContent` | `align-content` | - |
363
-
364
- ## Align Items
365
-
366
- Use the `alignItems` prop to control the alignment of grid items within their
367
- scope.
368
-
369
- ```jsx
370
- <Box display="grid" alignItems="center">
371
- <Box>Item 1</Box>
372
- <Box>Item 2</Box>
373
- <Box>Item 3</Box>
374
- </Box>
375
- ```
376
-
377
- ## Align Self
378
-
379
- Use the `alignSelf` prop to control the alignment of a grid item within its
380
- scope.
381
-
382
- ```jsx
383
- <Box display="grid">
384
- <Box alignSelf="center">Item 1</Box>
385
- <Box>Item 2</Box>
386
- <Box>Item 3</Box>
387
- </Box>
388
- ```
389
-
390
- | Prop | CSS Property | Token Category |
391
- | ----------- | ------------ | -------------- |
392
- | `alignSelf` | `align-self` | - |
393
-
394
- ## Place Content
395
-
396
- Use the `placeContent` prop to align content along both the block and inline
397
- directions at once. It works like `justifyContent` and `alignContent` combined,
398
- and can be used in flex and grid containers.
399
-
400
- ```jsx
401
- <Flex placeContent="center">
402
- <Box>Item 1</Box>
403
- <Box>Item 2</Box>
404
- <Box>Item 3</Box>
405
- </Flex>
406
- ```
407
-
408
- | Prop | CSS Property | Token Category |
409
- | -------------- | --------------- | -------------- |
410
- | `placeContent` | `place-content` | - |
411
-
412
- ## Place Items
413
-
414
- Use the `placeItems` prop to align items along both the block and inline
415
- directions at once. It works like `justifyItems` and `alignItems` combined, and
416
- can be used in flex and grid containers.
417
-
418
- ```jsx
419
- <Box display="grid" placeItems="center">
420
- <Box>Item 1</Box>
421
- <Box>Item 2</Box>
422
- <Box>Item 3</Box>
423
- </Box>
424
- ```
425
-
426
- | Prop | CSS Property | Token Category |
427
- | ------------ | ------------- | -------------- |
428
- | `placeItems` | `place-items` | - |
429
-
430
- ## Place Self
431
-
432
- Use the `placeSelf` prop to align a grid item along both the block and inline
433
- directions at once.
434
-
435
- ```jsx
436
- <Box display="grid">
437
- <Box placeSelf="center">Item 1</Box>
438
- <Box>Item 2</Box>
439
- <Box>Item 3</Box>
440
- </Box>
441
- ```
442
-
443
- | Prop | CSS Property | Token Category |
444
- | ----------- | ------------ | -------------- |
445
- | `placeSelf` | `place-self` | - |