@commercetools/nimbus 0.0.1 → 0.0.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 +33 -6
  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,170 +0,0 @@
1
- import { defineSlotRecipe } from "@chakra-ui/react";
2
-
3
- export const tableSlotRecipe = defineSlotRecipe({
4
- className: "chakra-table",
5
- slots: [
6
- "root",
7
- "header",
8
- "body",
9
- "row",
10
- "columnHeader",
11
- "cell",
12
- "footer",
13
- "caption",
14
- ],
15
- base: {
16
- root: {
17
- fontVariantNumeric: "lining-nums tabular-nums",
18
- borderCollapse: "collapse",
19
- width: "full",
20
- textAlign: "start",
21
- verticalAlign: "top",
22
- },
23
- row: {
24
- _selected: {
25
- bg: "colorPalette.subtle",
26
- },
27
- },
28
- cell: {
29
- textAlign: "start",
30
- alignItems: "center",
31
- },
32
- columnHeader: {
33
- fontWeight: "medium",
34
- textAlign: "start",
35
- color: "fg",
36
- },
37
- caption: {
38
- fontWeight: "medium",
39
- textStyle: "xs",
40
- },
41
- footer: {
42
- fontWeight: "medium",
43
- },
44
- },
45
- variants: {
46
- interactive: {
47
- true: {
48
- body: {
49
- "& tr": {
50
- _hover: {
51
- bg: "colorPalette.subtle",
52
- },
53
- },
54
- },
55
- },
56
- },
57
- stickyHeader: {
58
- true: {
59
- header: {
60
- "& :where(tr)": {
61
- top: "var(--table-sticky-offset, 0)",
62
- position: "sticky",
63
- zIndex: 1,
64
- },
65
- },
66
- },
67
- },
68
- striped: {
69
- true: {
70
- row: {
71
- "&:nth-of-type(odd) td": {
72
- bg: "bg.muted",
73
- },
74
- },
75
- },
76
- },
77
- showColumnBorder: {
78
- true: {
79
- columnHeader: {
80
- "&:not(:last-of-type)": {
81
- borderInlineEndWidth: "1px",
82
- },
83
- },
84
- cell: {
85
- "&:not(:last-of-type)": {
86
- borderInlineEndWidth: "1px",
87
- },
88
- },
89
- },
90
- },
91
- variant: {
92
- line: {
93
- columnHeader: {
94
- borderBottomWidth: "1px",
95
- },
96
- cell: {
97
- borderBottomWidth: "1px",
98
- },
99
- row: {
100
- bg: "bg",
101
- },
102
- },
103
- outline: {
104
- root: {
105
- boxShadow: "0 0 0 1px {colors.border}",
106
- overflow: "hidden",
107
- },
108
- columnHeader: {
109
- borderBottomWidth: "1px",
110
- },
111
- header: {
112
- bg: "bg.muted",
113
- },
114
- row: {
115
- "&:not(:last-of-type)": {
116
- borderBottomWidth: "1px",
117
- },
118
- },
119
- footer: {
120
- borderTopWidth: "1px",
121
- },
122
- },
123
- },
124
- size: {
125
- sm: {
126
- root: {
127
- textStyle: "sm",
128
- },
129
- columnHeader: {
130
- px: "200",
131
- py: "200",
132
- },
133
- cell: {
134
- px: "200",
135
- py: "200",
136
- },
137
- },
138
- md: {
139
- root: {
140
- textStyle: "sm",
141
- },
142
- columnHeader: {
143
- px: "300",
144
- py: "300",
145
- },
146
- cell: {
147
- px: "300",
148
- py: "300",
149
- },
150
- },
151
- lg: {
152
- root: {
153
- textStyle: "md",
154
- },
155
- columnHeader: {
156
- px: "400",
157
- py: "300",
158
- },
159
- cell: {
160
- px: "400",
161
- py: "300",
162
- },
163
- },
164
- },
165
- },
166
- defaultVariants: {
167
- variant: "line",
168
- size: "md",
169
- },
170
- });
@@ -1,43 +0,0 @@
1
- import { Table } from "@chakra-ui/react";
2
-
3
- // Extracting props types from subcomponents
4
- export type TableRootProps = React.ComponentProps<typeof Table.Root>;
5
- export type TableColumnGroupProps = React.ComponentProps<
6
- typeof Table.ColumnGroup
7
- >;
8
- export type TableColumnProps = React.ComponentProps<typeof Table.Column>;
9
- export type TableHeaderProps = React.ComponentProps<typeof Table.Header>;
10
- export type TableFooterProps = React.ComponentProps<typeof Table.Footer>;
11
- export type TableRowProps = React.ComponentProps<typeof Table.Row>;
12
- export type TableCellProps = React.ComponentProps<typeof Table.Cell>;
13
- export type TableBodyProps = React.ComponentProps<typeof Table.Body>;
14
- export type TableColumnHeaderProps = React.ComponentProps<
15
- typeof Table.ColumnHeader
16
- >;
17
-
18
- const TableRoot = (props: TableRootProps) => <Table.Root {...props} />;
19
- const TableColumnGroup = (props: TableColumnGroupProps) => (
20
- <Table.ColumnGroup {...props} />
21
- );
22
- const TableColumn = (props: TableColumnProps) => <Table.Column {...props} />;
23
- const TableHeader = (props: TableHeaderProps) => <Table.Header {...props} />;
24
- const TableFooter = (props: TableFooterProps) => <Table.Footer {...props} />;
25
- const TableRow = (props: TableRowProps) => <Table.Row {...props} />;
26
- const TableCell = (props: TableCellProps) => <Table.Cell {...props} />;
27
- const TableBody = (props: TableBodyProps) => <Table.Body {...props} />;
28
- const TableColumnHeader = (props: TableColumnHeaderProps) => (
29
- <Table.ColumnHeader {...props} />
30
- );
31
-
32
- export {
33
- Table,
34
- TableRoot,
35
- TableColumnGroup,
36
- TableColumn,
37
- TableHeader,
38
- TableFooter,
39
- TableRow,
40
- TableCell,
41
- TableBody,
42
- TableColumnHeader,
43
- };
@@ -1 +0,0 @@
1
- export * from "./text.tsx";
@@ -1,244 +0,0 @@
1
- ---
2
- id: Text
3
- title: Text
4
- description: the Text component is used to display text
5
- documentState: InitialDraft
6
- order: 1
7
- menu:
8
- - Components
9
- - Typography
10
- - Text
11
- tags:
12
- - text
13
- - typography
14
- ---
15
-
16
- # Text
17
-
18
- The `<Text>` component is a foundational element for displaying text content. It
19
- provides a simple and flexible way to style text with consistent design tokens
20
- and responsive behavior.
21
-
22
- > [!NOTE] If you need to render **large, bold text with a semantic meaning** you
23
- > may want to use the [`Heading`](/components/typography/heading) component
24
- > instead.
25
-
26
- `<Text>` is designed to:
27
-
28
- - Display inline or block-level text content.
29
- - apply consistent typography styles via `textStyles`
30
- - customize text appearance with style-props
31
- - support responsive styling
32
-
33
- ## Basic Example
34
-
35
- Without any configuration, Text will simply render a paragraph element `<p>`
36
- without adding styling, solely relying on the cascade (**C**SS), inheriting
37
- existing styles:
38
-
39
- ```jsx-live
40
- import { Text } from "@commercetools/nimbus";
41
-
42
- const App = () => <Text>I am a plain old paragraph.</Text>;
43
- ```
44
-
45
- ## Changing the HTML tag (semantics)
46
-
47
- If you need to render a different HTML element than a `<p>` tag, you can use the
48
- `as` prop to change the html-tag that used to render the text to the DOM:
49
-
50
- ```jsx-live
51
- import { Text } from "@commercetools/nimbus";
52
-
53
- const App = () => (
54
- <>
55
- <Text as="div">We look the same, but</Text>
56
- <Text as="span">we use different semantics.</Text>
57
- </>
58
- );
59
- ```
60
-
61
- _Alternatively_, if you need Text to render as another element which may even
62
- need it's own configuration, you can use the `asChild` prop to keep the props
63
- separated:
64
-
65
- ```jsx-live
66
- import { Text } from "@commercetools/nimbus";
67
-
68
- const App = () => (
69
- <Text textStyle="2xl" asChild>
70
- <button onClick={()=>alert('Click!')}>
71
- Amazing. A native html-button.
72
- </button>
73
- </Text>
74
- );
75
- ```
76
-
77
- ## Predefined Text-Styles
78
-
79
- Apply predefined text styles via the `textStyle` prop. No further configuration
80
- apart from the `textStyle` prop is needed.
81
-
82
- Text-styles can and usually do set a bunch of typographic css-rules in order to
83
- achieve the desired look.
84
-
85
- A `textStyle` can be a simple as a combination of font-size & line-height or
86
- more complex, containing capitalisation rules etc.
87
-
88
- > [!NOTE] A list of available text-styles
89
- > [can be found here](/tokens/typography)
90
-
91
- ```jsx-live
92
- import { Text } from "@commercetools/nimbus";
93
-
94
- const App = () => (
95
- <Text textStyle="xl">Extra Large Text</Text>
96
- );
97
- ```
98
-
99
- ## Custom CSS / styling
100
-
101
- Technically, you can set any css-property on the text-component via the
102
- available [style props](/style-props), here are the most common ones for
103
- changing text appearance:
104
-
105
- ### Text Alignment
106
-
107
- ```jsx-live
108
- const App = () => (
109
- <>
110
- <Text textAlign="left">left aligned text</Text>
111
- <Text textAlign="right">right aligned text</Text>
112
- <Text textAlign="center">centered text</Text>
113
- </>
114
- )
115
- ```
116
-
117
- ### Font Size
118
-
119
- #### The recommended way
120
-
121
- Basic `textStyle` 's are available and set the size of the text and an
122
- appropriate line-height for this size at the same time.
123
-
124
- ```jsx-live
125
- const App = () => (
126
- <Flex flexDirection="column">
127
- {["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl","5xl","6xl","7xl"].map((size) => (
128
- <Text key={size} asChild textStyle={size}>
129
- <span>Displays text in `{size}` size</span>
130
- </Text>
131
- ))}
132
- </Flex>
133
- )
134
- ```
135
-
136
- #### The escape hatch
137
-
138
- If you need to set the font-size manually and independent from the line-height,
139
- use `fontSize` and a font-size token. Be cautious as this may affect layout and
140
- readability.
141
-
142
- > [!NOTE] The list of available font-sizes
143
- > [can be found here](/tokens/typography#font-sizes)
144
-
145
- ```jsx-live
146
- const App = () => (
147
- <Flex flexDirection="column">
148
- {["250", "300", "350", "400", "450", "500", "600"].map((size) => (
149
- <Text key={size} fontSize={size}>
150
- Displays text in `{size}` size
151
- </Text>
152
- ))}
153
- </Flex>
154
- )
155
- ```
156
-
157
- ### Text Color
158
-
159
- Use the `color` prop to change the color of the text.
160
-
161
- ```jsx-live
162
- import { Stack, Text } from "@commercetools/nimbus"
163
-
164
- const App = () => (
165
- <Stack>
166
- <Text color="primary.11">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
167
- <Text color="info.11">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
168
- <Text color="success.11">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
169
- <Text color="danger.11">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
170
- <Text color="error.11">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
171
- </Stack>
172
- )
173
- ```
174
-
175
- ### Font Weight
176
-
177
- Make text bolder or lighter by setting the `fontWeight` prop.
178
-
179
- ```jsx-live
180
- const App = () => {
181
- return (
182
- <Stack>
183
- <Text fontWeight="100">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
184
- <Text fontWeight="200">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
185
- <Text fontWeight="300">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
186
- <Text fontWeight="400">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
187
- <Text fontWeight="500">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
188
- <Text fontWeight="600">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
189
- <Text fontWeight="700">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
190
- <Text fontWeight="800">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
191
- <Text fontWeight="900">Franz jagt im komplett verwahrlosten Taxi quer durch Bayern</Text>
192
- </Stack>
193
- )
194
- }
195
- ```
196
-
197
- ## Truncate Text
198
-
199
- Use the `truncate` prop to truncate the text after a single line.
200
-
201
- ```jsx-live
202
- import { Flex, Text } from "@commercetools/nimbus"
203
-
204
- const App = () => (
205
- <Flex maxW="300px">
206
- <Text truncate>
207
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
208
- </Text>
209
- </Flex>
210
- )
211
- ```
212
-
213
- ## Clamp Lines
214
-
215
- Use the `lineClamp` prop to truncate the text after a certain number of lines.
216
-
217
- ```jsx-live
218
- import { Flex, Text } from "@commercetools/nimbus"
219
-
220
- const App = () => (
221
- <Flex maxW="300px">
222
- <Text lineClamp="2">
223
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
224
- tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
225
- veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
226
- commodo consequat.
227
- </Text>
228
- </Flex>
229
- )
230
- ```
231
-
232
- ## Additional Style Props
233
-
234
- The `Text` component supports all style-props that are available as
235
- [style-Props](/style-props). Here are some more common text-related ones:
236
-
237
- | Prop Name | Description |
238
- | ---------------- | ------------------------------------ |
239
- | `textDecoration` | Set the text-decoration of the text. |
240
- | `textTransform` | Set the text-transform of the text. |
241
- | `letterSpacing` | Set the letter-spacing of the text. |
242
- | `lineHeight` | Set the line-height of the text. |
243
- | `whiteSpace` | Set the white-space of the text. |
244
- | ... | ... |
@@ -1,23 +0,0 @@
1
- import {
2
- Text as ChakraText,
3
- type TextProps as ChakraTextProps,
4
- } from "@chakra-ui/react";
5
- import { forwardRef } from "react";
6
-
7
- export interface TextProps extends ChakraTextProps {}
8
-
9
- /**
10
- * Render Text
11
- *
12
- * Use this component to render text. Various props can be passed to customize the text.
13
- * Check the documentation for more information.
14
- *
15
- * @see https://DOMAIN/components/typography/text
16
- */
17
- export const Text = forwardRef<HTMLParagraphElement, TextProps>(
18
- (props, ref) => {
19
- return <ChakraText ref={ref} {...props} />;
20
- }
21
- );
22
-
23
- Text.displayName = "Text";
@@ -1,2 +0,0 @@
1
- export * from "./text-input";
2
- export * from "./text-input.types";
@@ -1,118 +0,0 @@
1
- ---
2
- id: Components-TextInput
3
- title: TextInput
4
- description: An input component that takes in a text as input
5
- documentState: InitialDraft
6
- order: 999
7
- menu:
8
- - Components
9
- - Inputs
10
- - TextInput
11
- tags:
12
- - component
13
- ---
14
-
15
- # TextInput
16
-
17
- The TextInput component is a form control that allows users to enter text into
18
- an input field. It provides a clean, accessible interface for text input with
19
- support for different states and variants.
20
-
21
- ## Features
22
-
23
- - **Accessible:** Built with ARIA attributes for screen reader support
24
- - **Customizable:** Supports different sizes and visual variants
25
- - **State Management:** Handles disabled, invalid, and focus states
26
-
27
- ## Basic Usage
28
-
29
- The TextInput component is used to create form input fields where users can enter text. It supports various states and can be customized using props.
30
-
31
- ```jsx-live
32
- const App = () => <TextInput placeholder="basic text input"/>
33
- ```
34
-
35
- ### Sizes
36
-
37
- Available sizes.
38
-
39
- ```jsx-live
40
- const App = () => {
41
-
42
- const sizes = ['md', 'sm',];
43
-
44
- return (
45
- <Stack direction="horizontal" alignItems="center">
46
- {sizes.map(size => (
47
- <TextInput key={size} size={size} placeholder={size}/>
48
- ))}
49
- </Stack>
50
- )
51
- }
52
- ```
53
-
54
- ### Variants
55
-
56
- There are two variants currently:
57
- - **Solid:** The default variant with a solid background.
58
- - **Ghost:** A minimal variant without background.
59
-
60
-
61
- ```jsx-live
62
- const App = () => {
63
-
64
- const variants = ['solid','ghost',];
65
-
66
- return (
67
- <Stack direction="horizontal">
68
- {variants.map(variant => (
69
- <TextInput key={variant} variant={variant} placeholder={variant} />
70
- ))}
71
- </Stack>
72
- )
73
- }
74
- ```
75
-
76
- ## States
77
-
78
- ### Disabled
79
-
80
- When interaction is not allowed.
81
-
82
- ```jsx-live
83
- const App = () => {
84
-
85
- const variants = ['solid','ghost',];
86
-
87
- return (
88
- <Stack direction="horizontal">
89
- {variants.map(variant => (
90
- <TextInput key={variant} variant={variant} placeholder={variant} disabled/>
91
- ))}
92
- </Stack>
93
- )
94
- }
95
- ```
96
-
97
- ### Invalid
98
-
99
- For showing error states in forms.
100
-
101
- ```jsx-live
102
- const App = () => {
103
-
104
- const variants = ['solid','ghost',];
105
-
106
- return (
107
- <Stack direction="horizontal">
108
- {variants.map(variant => (
109
- <TextInput key={variant} variant={variant} placeholder={variant} isInvalid/>
110
- ))}
111
- </Stack>
112
- )
113
- }
114
- ```
115
-
116
- ## Props
117
-
118
- <PropTable id="TextInput" />
@@ -1,68 +0,0 @@
1
- import { defineRecipe } from "@chakra-ui/react";
2
-
3
- /**
4
- * Recipe configuration for the TextInput component.
5
- * Defines the styling variants and base styles using Chakra UI's recipe system.
6
- */
7
- export const textInputRecipe = defineRecipe({
8
- // Unique class name prefix for the component
9
- className: "nimbus-text-input",
10
-
11
- // Base styles applied to all instances of the component
12
- base: {
13
- display: "block",
14
- borderRadius: "200",
15
- colorPalette: "neutral",
16
- focusVisibleRing: "outside",
17
- bg: "transparent",
18
- outline: "none",
19
- boxShadow: "inset 0 0 0 var(--border-width) var(--border-color)",
20
- _placeholder: {
21
- opacity: 0.5,
22
- color: "currentColor",
23
- },
24
- _disabled: {
25
- layerStyle: "disabled",
26
- },
27
- "&[data-invalid='true']": {
28
- "--border-color": "colors.error.7",
29
- color: "error.11",
30
- },
31
- },
32
-
33
- variants: {
34
- size: {
35
- sm: {
36
- h: 800,
37
- textStyle: "sm",
38
- px: 300,
39
- },
40
- md: {
41
- h: 1000,
42
- textStyle: "md",
43
- px: 400,
44
- },
45
- },
46
-
47
- variant: {
48
- solid: {
49
- "--border-width": "sizes.25",
50
- "--border-color": "colors.neutral.7",
51
- backgroundColor: "neutral.1",
52
- _hover: {
53
- backgroundColor: "primary.2",
54
- },
55
- },
56
- ghost: {
57
- _hover: {
58
- backgroundColor: "primary.2",
59
- },
60
- },
61
- },
62
- },
63
-
64
- defaultVariants: {
65
- size: "md",
66
- variant: "solid",
67
- },
68
- });
@@ -1,24 +0,0 @@
1
- import {
2
- type HTMLChakraProps,
3
- type RecipeVariantProps,
4
- type UnstyledProp,
5
- createRecipeContext,
6
- } from "@chakra-ui/react";
7
-
8
- import { textInputRecipe } from "./text-input.recipe";
9
-
10
- export interface TextInputRecipeProps
11
- extends RecipeVariantProps<typeof textInputRecipe>,
12
- UnstyledProp {}
13
-
14
- export type TextInputRootProps = HTMLChakraProps<"input", TextInputRecipeProps>;
15
-
16
- const { withContext } = createRecipeContext({ recipe: textInputRecipe });
17
-
18
- /**
19
- * Root component that provides the styling context for the TextInput component.
20
- * Uses Chakra UI's recipe context system for consistent styling across instances.
21
- */
22
- export const TextInputRoot = withContext<HTMLInputElement, TextInputRootProps>(
23
- "input"
24
- );