@jordan-mace/chaser-design-system 1.2.2 → 1.2.4

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 (514) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +2 -2
  2. package/dist/components/Accordion/Accordion.js +26 -91
  3. package/dist/components/Accordion/index.js +1 -2
  4. package/dist/components/Accordion/styles.css.js +65 -14
  5. package/dist/components/Alert/Alert.d.ts +1 -1
  6. package/dist/components/Alert/Alert.js +8 -28
  7. package/dist/components/Alert/index.js +1 -2
  8. package/dist/components/Alert/styles.css.js +54 -13
  9. package/dist/components/AspectRatio/AspectRatio.js +9 -24
  10. package/dist/components/AspectRatio/index.js +1 -2
  11. package/dist/components/Avatar/Avatar.d.ts +1 -1
  12. package/dist/components/Avatar/Avatar.js +10 -24
  13. package/dist/components/Avatar/index.js +1 -2
  14. package/dist/components/Avatar/styles.css.js +151 -19
  15. package/dist/components/Badge/Badge.d.ts +1 -1
  16. package/dist/components/Badge/Badge.js +8 -13
  17. package/dist/components/Badge/index.js +1 -2
  18. package/dist/components/Badge/styles.css.js +77 -23
  19. package/dist/components/Box/Box.js +18 -17
  20. package/dist/components/Box/index.js +1 -2
  21. package/dist/components/Box/reset.css.js +15 -3
  22. package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -2
  23. package/dist/components/Breadcrumb/Breadcrumb.js +8 -66
  24. package/dist/components/Breadcrumb/index.js +1 -2
  25. package/dist/components/Breadcrumb/styles.css.js +50 -10
  26. package/dist/components/Button/Button.d.ts +1 -1
  27. package/dist/components/Button/Button.js +8 -15
  28. package/dist/components/Button/index.js +1 -2
  29. package/dist/components/Button/styles.css.js +30 -9
  30. package/dist/components/Card/Card.d.ts +1 -1
  31. package/dist/components/Card/Card.js +8 -15
  32. package/dist/components/Card/index.js +1 -2
  33. package/dist/components/Card/styles.css.js +25 -10
  34. package/dist/components/Checkbox/Checkbox.js +20 -45
  35. package/dist/components/Checkbox/index.js +1 -2
  36. package/dist/components/Checkbox/styles.css.js +31 -7
  37. package/dist/components/Collapse/Collapse.d.ts +1 -1
  38. package/dist/components/Collapse/Collapse.js +40 -42
  39. package/dist/components/Collapse/index.js +1 -2
  40. package/dist/components/Collapse/styles.css.js +36 -8
  41. package/dist/components/Combobox/Combobox.d.ts +1 -1
  42. package/dist/components/Combobox/Combobox.js +62 -129
  43. package/dist/components/Combobox/index.js +1 -2
  44. package/dist/components/Combobox/styles.css.js +142 -20
  45. package/dist/components/Container/Container.js +9 -19
  46. package/dist/components/Container/index.js +1 -2
  47. package/dist/components/Divider/Divider.d.ts +1 -1
  48. package/dist/components/Divider/Divider.js +8 -14
  49. package/dist/components/Divider/index.js +1 -2
  50. package/dist/components/Divider/styles.css.js +41 -19
  51. package/dist/components/Drawer/Drawer.d.ts +1 -1
  52. package/dist/components/Drawer/Drawer.js +37 -85
  53. package/dist/components/Drawer/index.js +1 -2
  54. package/dist/components/Drawer/styles.css.js +125 -17
  55. package/dist/components/DropdownMenu/DropdownMenu.d.ts +1 -1
  56. package/dist/components/DropdownMenu/DropdownMenu.js +33 -88
  57. package/dist/components/DropdownMenu/index.js +1 -2
  58. package/dist/components/DropdownMenu/styles.css.d.ts +1 -1
  59. package/dist/components/DropdownMenu/styles.css.js +93 -22
  60. package/dist/components/EmptyState/EmptyState.d.ts +1 -1
  61. package/dist/components/EmptyState/EmptyState.js +8 -32
  62. package/dist/components/EmptyState/index.js +1 -2
  63. package/dist/components/EmptyState/styles.css.js +30 -9
  64. package/dist/components/FileUpload/FileUpload.d.ts +1 -1
  65. package/dist/components/FileUpload/FileUpload.js +63 -175
  66. package/dist/components/FileUpload/index.js +1 -2
  67. package/dist/components/FileUpload/styles.css.js +145 -32
  68. package/dist/components/Form/Form.d.ts +1 -1
  69. package/dist/components/Form/Form.js +8 -15
  70. package/dist/components/Form/FormInput.d.ts +1 -1
  71. package/dist/components/Form/FormInput.js +9 -15
  72. package/dist/components/Form/index.js +2 -3
  73. package/dist/components/Form/styles.css.js +11 -4
  74. package/dist/components/Grid/Grid.js +14 -19
  75. package/dist/components/Grid/index.js +1 -2
  76. package/dist/components/Icon/Icon.d.ts +1 -1
  77. package/dist/components/Icon/Icon.js +12 -20
  78. package/dist/components/Icon/index.js +1 -2
  79. package/dist/components/Icon/styles.css.js +9 -3
  80. package/dist/components/Input/Input.d.ts +1 -1
  81. package/dist/components/Input/Input.js +9 -38
  82. package/dist/components/Input/index.js +1 -2
  83. package/dist/components/Input/styles.css.js +8 -4
  84. package/dist/components/Kbd/Kbd.d.ts +1 -1
  85. package/dist/components/Kbd/Kbd.js +6 -10
  86. package/dist/components/Kbd/index.js +1 -2
  87. package/dist/components/Kbd/styles.css.js +16 -5
  88. package/dist/components/List/List.d.ts +1 -1
  89. package/dist/components/List/List.js +7 -11
  90. package/dist/components/List/ListItem.d.ts +1 -1
  91. package/dist/components/List/ListItem.js +7 -11
  92. package/dist/components/List/index.js +2 -3
  93. package/dist/components/List/styles.css.js +11 -6
  94. package/dist/components/Modal/Modal.d.ts +1 -1
  95. package/dist/components/Modal/Modal.js +21 -57
  96. package/dist/components/Modal/index.js +1 -2
  97. package/dist/components/Modal/styles.css.js +92 -16
  98. package/dist/components/Navbar/Navbar.d.ts +1 -1
  99. package/dist/components/Navbar/Navbar.js +8 -16
  100. package/dist/components/Navbar/NavbarItem.d.ts +1 -1
  101. package/dist/components/Navbar/NavbarItem.js +8 -12
  102. package/dist/components/Navbar/index.js +2 -3
  103. package/dist/components/Navbar/styles.css.js +3 -4
  104. package/dist/components/NumberInput/NumberInput.d.ts +1 -1
  105. package/dist/components/NumberInput/NumberInput.js +25 -94
  106. package/dist/components/NumberInput/index.js +1 -2
  107. package/dist/components/NumberInput/styles.css.js +117 -17
  108. package/dist/components/Pagination/Pagination.d.ts +1 -2
  109. package/dist/components/Pagination/Pagination.js +34 -57
  110. package/dist/components/Pagination/index.js +1 -2
  111. package/dist/components/Pagination/styles.css.js +44 -11
  112. package/dist/components/Popover/Popover.d.ts +1 -1
  113. package/dist/components/Popover/Popover.js +43 -93
  114. package/dist/components/Popover/index.js +1 -2
  115. package/dist/components/Popover/styles.css.d.ts +2 -2
  116. package/dist/components/Popover/styles.css.js +185 -33
  117. package/dist/components/Progress/Progress.d.ts +1 -2
  118. package/dist/components/Progress/Progress.js +8 -54
  119. package/dist/components/Progress/index.js +1 -2
  120. package/dist/components/Progress/styles.css.js +71 -18
  121. package/dist/components/Radio/Radio.d.ts +2 -2
  122. package/dist/components/Radio/Radio.js +17 -52
  123. package/dist/components/Radio/index.js +1 -2
  124. package/dist/components/Radio/styles.css.js +42 -9
  125. package/dist/components/ScrollArea/ScrollArea.d.ts +1 -1
  126. package/dist/components/ScrollArea/ScrollArea.js +8 -18
  127. package/dist/components/ScrollArea/index.js +1 -2
  128. package/dist/components/ScrollArea/styles.css.js +25 -11
  129. package/dist/components/Select/Select.js +9 -35
  130. package/dist/components/Select/index.js +1 -2
  131. package/dist/components/Select/styles.css.js +82 -11
  132. package/dist/components/Separator/Separator.d.ts +1 -2
  133. package/dist/components/Separator/Separator.js +8 -13
  134. package/dist/components/Separator/index.js +1 -2
  135. package/dist/components/Separator/styles.css.js +28 -15
  136. package/dist/components/Skeleton/Skeleton.d.ts +1 -1
  137. package/dist/components/Skeleton/Skeleton.js +9 -24
  138. package/dist/components/Skeleton/index.js +1 -2
  139. package/dist/components/Skeleton/styles.css.js +56 -20
  140. package/dist/components/Spinner/Spinner.d.ts +1 -1
  141. package/dist/components/Spinner/Spinner.js +8 -14
  142. package/dist/components/Spinner/index.js +1 -2
  143. package/dist/components/Spinner/styles.css.d.ts +1 -1
  144. package/dist/components/Spinner/styles.css.js +55 -19
  145. package/dist/components/Stack/Stack.js +10 -25
  146. package/dist/components/Stack/index.js +1 -2
  147. package/dist/components/Stepper/Stepper.d.ts +1 -1
  148. package/dist/components/Stepper/Stepper.js +19 -64
  149. package/dist/components/Stepper/index.js +1 -2
  150. package/dist/components/Stepper/styles.css.js +104 -22
  151. package/dist/components/Table/Table.d.ts +7 -7
  152. package/dist/components/Table/Table.js +30 -56
  153. package/dist/components/Table/index.js +1 -2
  154. package/dist/components/Table/styles.css.js +49 -15
  155. package/dist/components/Tabs/Tabs.d.ts +4 -4
  156. package/dist/components/Tabs/Tabs.js +33 -52
  157. package/dist/components/Tabs/index.js +1 -2
  158. package/dist/components/Tabs/styles.css.js +100 -14
  159. package/dist/components/Tag/Tag.d.ts +2 -2
  160. package/dist/components/Tag/Tag.js +16 -38
  161. package/dist/components/Tag/index.js +1 -2
  162. package/dist/components/Tag/styles.css.d.ts +1 -1
  163. package/dist/components/Tag/styles.css.js +93 -14
  164. package/dist/components/Text/Header.d.ts +1 -1
  165. package/dist/components/Text/Header.js +8 -12
  166. package/dist/components/Text/P.d.ts +1 -1
  167. package/dist/components/Text/P.js +8 -12
  168. package/dist/components/Text/index.js +2 -3
  169. package/dist/components/Text/styles.css.js +13 -6
  170. package/dist/components/TextArea/TextArea.d.ts +1 -1
  171. package/dist/components/TextArea/TextArea.js +9 -38
  172. package/dist/components/TextArea/index.js +1 -2
  173. package/dist/components/TextArea/styles.css.js +10 -4
  174. package/dist/components/Toast/Toast.d.ts +3 -3
  175. package/dist/components/Toast/Toast.js +85 -144
  176. package/dist/components/Toast/index.js +1 -2
  177. package/dist/components/Toast/styles.css.d.ts +1 -1
  178. package/dist/components/Toast/styles.css.js +192 -32
  179. package/dist/components/Toggle/Toggle.d.ts +1 -1
  180. package/dist/components/Toggle/Toggle.js +12 -57
  181. package/dist/components/Toggle/index.js +1 -2
  182. package/dist/components/Toggle/styles.css.js +118 -24
  183. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  184. package/dist/components/Tooltip/Tooltip.js +12 -37
  185. package/dist/components/Tooltip/index.js +1 -2
  186. package/dist/components/Tooltip/styles.css.js +86 -17
  187. package/dist/components/VisuallyHidden/VisuallyHidden.js +7 -6
  188. package/dist/components/VisuallyHidden/index.js +1 -2
  189. package/dist/components/VisuallyHidden/styles.css.js +12 -3
  190. package/dist/components/index.js +47 -48
  191. package/dist/index.js +1 -1
  192. package/dist/styles/layers.css.js +3 -4
  193. package/dist/styles/sprinkles.css.d.ts +115 -115
  194. package/dist/styles/sprinkles.css.js +72 -2219
  195. package/dist/styles/theme.css.js +48 -38
  196. package/dist/styles/utils.js +7 -8
  197. package/package.json +12 -16
  198. package/src/components/Accordion/Accordion.stories.tsx +73 -0
  199. package/src/components/Accordion/Accordion.test.tsx +54 -0
  200. package/src/components/Accordion/Accordion.tsx +146 -0
  201. package/src/components/Accordion/index.ts +1 -0
  202. package/src/components/Accordion/styles.css.ts +72 -0
  203. package/src/components/Alert/Alert.stories.tsx +82 -0
  204. package/src/components/Alert/Alert.test.tsx +58 -0
  205. package/src/components/Alert/Alert.tsx +48 -0
  206. package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-dismissible-alert-correctly-1-chromium-linux.png +0 -0
  207. package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-error-alert-correctly-1-chromium-linux.png +0 -0
  208. package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-info-alert-correctly-1-chromium-linux.png +0 -0
  209. package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-success-alert-correctly-1-chromium-linux.png +0 -0
  210. package/src/components/Alert/__screenshots__/Alert.test.tsx/Alert-renders-warning-alert-correctly-1-chromium-linux.png +0 -0
  211. package/src/components/Alert/index.ts +1 -0
  212. package/src/components/Alert/styles.css.ts +58 -0
  213. package/src/components/AspectRatio/AspectRatio.stories.tsx +85 -0
  214. package/src/components/AspectRatio/AspectRatio.test.tsx +50 -0
  215. package/src/components/AspectRatio/AspectRatio.tsx +42 -0
  216. package/src/components/AspectRatio/index.ts +2 -0
  217. package/src/components/Avatar/Avatar.stories.tsx +82 -0
  218. package/src/components/Avatar/Avatar.test.tsx +45 -0
  219. package/src/components/Avatar/Avatar.tsx +51 -0
  220. package/src/components/Avatar/index.ts +1 -0
  221. package/src/components/Avatar/styles.css.ts +155 -0
  222. package/src/components/Badge/Badge.stories.tsx +141 -0
  223. package/src/components/Badge/Badge.test.tsx +74 -0
  224. package/src/components/Badge/Badge.tsx +46 -0
  225. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-does-not-render-children-when-dot-is-true-1.png +0 -0
  226. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-default-badge-correctly-1-chromium-linux.png +0 -0
  227. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-dot-badge-correctly-1-chromium-linux.png +0 -0
  228. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-dot-with-size-correctly-1-chromium-linux.png +0 -0
  229. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-dot-with-variant-correctly-1-chromium-linux.png +0 -0
  230. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-error-badge-correctly-1-chromium-linux.png +0 -0
  231. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-info-badge-correctly-1-chromium-linux.png +0 -0
  232. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-large-badge-correctly-1-chromium-linux.png +0 -0
  233. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-medium-badge-correctly-1-chromium-linux.png +0 -0
  234. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-small-badge-correctly-1-chromium-linux.png +0 -0
  235. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-span-element-with-proper-attributes-1.png +0 -0
  236. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-success-badge-correctly-1-chromium-linux.png +0 -0
  237. package/src/components/Badge/__screenshots__/Badge.test.tsx/Badge-renders-warning-badge-correctly-1-chromium-linux.png +0 -0
  238. package/src/components/Badge/index.ts +2 -0
  239. package/src/components/Badge/styles.css.ts +82 -0
  240. package/src/components/Box/Box.stories.tsx +183 -0
  241. package/src/components/Box/Box.test.tsx +63 -0
  242. package/src/components/Box/Box.tsx +72 -0
  243. package/src/components/Box/index.ts +2 -0
  244. package/src/components/Box/reset.css.ts +16 -0
  245. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +55 -0
  246. package/src/components/Breadcrumb/Breadcrumb.test.tsx +44 -0
  247. package/src/components/Breadcrumb/Breadcrumb.tsx +102 -0
  248. package/src/components/Breadcrumb/index.ts +1 -0
  249. package/src/components/Breadcrumb/styles.css.ts +56 -0
  250. package/src/components/Button/Button.stories.tsx +60 -0
  251. package/src/components/Button/Button.test.tsx +26 -0
  252. package/src/components/Button/Button.tsx +31 -0
  253. package/src/components/Button/__screenshots__/Button.test.tsx/Button-renders-correctly-1-chromium-win32.png +0 -0
  254. package/src/components/Button/__screenshots__/Button.test.tsx/Button-renders-primary-button-correctly-1-chromium-linux.png +0 -0
  255. package/src/components/Button/__screenshots__/Button.test.tsx/Button-renders-primary-button-correctly-1-chromium-win32.png +0 -0
  256. package/src/components/Button/index.ts +1 -0
  257. package/src/components/Button/styles.css.ts +32 -0
  258. package/src/components/Card/Card.stories.tsx +85 -0
  259. package/src/components/Card/Card.test.tsx +43 -0
  260. package/src/components/Card/Card.tsx +34 -0
  261. package/src/components/Card/__screenshots__/Card.test.tsx/Card-renders-elevated-card-correctly-1-chromium-linux.png +0 -0
  262. package/src/components/Card/__screenshots__/Card.test.tsx/Card-renders-filled-card-correctly-1-chromium-linux.png +0 -0
  263. package/src/components/Card/__screenshots__/Card.test.tsx/Card-renders-outlined-card-correctly-1-chromium-linux.png +0 -0
  264. package/src/components/Card/__screenshots__/Card.test.tsx/Card-renders-with-no-padding-1-chromium-linux.png +0 -0
  265. package/src/components/Card/index.ts +1 -0
  266. package/src/components/Card/styles.css.ts +27 -0
  267. package/src/components/Checkbox/Checkbox.stories.tsx +61 -0
  268. package/src/components/Checkbox/Checkbox.test.tsx +40 -0
  269. package/src/components/Checkbox/Checkbox.tsx +58 -0
  270. package/src/components/Checkbox/index.ts +1 -0
  271. package/src/components/Checkbox/styles.css.ts +34 -0
  272. package/src/components/Collapse/Collapse.stories.tsx +63 -0
  273. package/src/components/Collapse/Collapse.test.tsx +24 -0
  274. package/src/components/Collapse/Collapse.tsx +97 -0
  275. package/src/components/Collapse/index.ts +2 -0
  276. package/src/components/Collapse/styles.css.ts +42 -0
  277. package/src/components/Combobox/Combobox.stories.tsx +100 -0
  278. package/src/components/Combobox/Combobox.test.tsx +49 -0
  279. package/src/components/Combobox/Combobox.tsx +266 -0
  280. package/src/components/Combobox/index.ts +2 -0
  281. package/src/components/Combobox/styles.css.ts +155 -0
  282. package/src/components/Container/Container.stories.tsx +69 -0
  283. package/src/components/Container/Container.test.tsx +42 -0
  284. package/src/components/Container/Container.tsx +47 -0
  285. package/src/components/Container/index.ts +2 -0
  286. package/src/components/Divider/Divider.stories.tsx +121 -0
  287. package/src/components/Divider/Divider.test.tsx +56 -0
  288. package/src/components/Divider/Divider.tsx +40 -0
  289. package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-applies-orientation-correctly-1.png +0 -0
  290. package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-horizontal-divider-correctly-1-chromium-linux.png +0 -0
  291. package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-hr-element-with-proper-attributes-1.png +0 -0
  292. package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-large-divider-correctly-1-chromium-linux.png +0 -0
  293. package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-medium-divider-correctly-1-chromium-linux.png +0 -0
  294. package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-small-divider-correctly-1-chromium-linux.png +0 -0
  295. package/src/components/Divider/__screenshots__/Divider.test.tsx/Divider-renders-vertical-divider-correctly-1-chromium-linux.png +0 -0
  296. package/src/components/Divider/index.ts +2 -0
  297. package/src/components/Divider/styles.css.ts +45 -0
  298. package/src/components/Drawer/Drawer.stories.tsx +99 -0
  299. package/src/components/Drawer/Drawer.test.tsx +51 -0
  300. package/src/components/Drawer/Drawer.tsx +148 -0
  301. package/src/components/Drawer/index.ts +2 -0
  302. package/src/components/Drawer/styles.css.ts +138 -0
  303. package/src/components/DropdownMenu/DropdownMenu.stories.tsx +72 -0
  304. package/src/components/DropdownMenu/DropdownMenu.test.tsx +43 -0
  305. package/src/components/DropdownMenu/DropdownMenu.tsx +156 -0
  306. package/src/components/DropdownMenu/index.ts +2 -0
  307. package/src/components/DropdownMenu/styles.css.ts +102 -0
  308. package/src/components/EmptyState/EmptyState.stories.tsx +47 -0
  309. package/src/components/EmptyState/EmptyState.test.tsx +25 -0
  310. package/src/components/EmptyState/EmptyState.tsx +53 -0
  311. package/src/components/EmptyState/index.ts +2 -0
  312. package/src/components/EmptyState/styles.css.ts +36 -0
  313. package/src/components/FileUpload/FileUpload.stories.tsx +138 -0
  314. package/src/components/FileUpload/FileUpload.test.tsx +56 -0
  315. package/src/components/FileUpload/FileUpload.tsx +269 -0
  316. package/src/components/FileUpload/index.ts +2 -0
  317. package/src/components/FileUpload/styles.css.ts +164 -0
  318. package/src/components/Form/Form.stories.tsx +51 -0
  319. package/src/components/Form/Form.test.tsx +41 -0
  320. package/src/components/Form/Form.tsx +28 -0
  321. package/src/components/Form/FormInput.tsx +16 -0
  322. package/src/components/Form/__screenshots__/Form.test.tsx/Form-can-submit-1.png +0 -0
  323. package/src/components/Form/__screenshots__/Form.test.tsx/Form-renders-correctly-1-chromium-win32.png +0 -0
  324. package/src/components/Form/__screenshots__/Form.test.tsx/Form-renders-form-correctly-1-chromium-linux.png +0 -0
  325. package/src/components/Form/__screenshots__/Form.test.tsx/Form-renders-form-correctly-1-chromium-win32.png +0 -0
  326. package/src/components/Form/index.ts +2 -0
  327. package/src/components/Form/styles.css.ts +13 -0
  328. package/src/components/Grid/Grid.stories.tsx +134 -0
  329. package/src/components/Grid/Grid.test.tsx +41 -0
  330. package/src/components/Grid/Grid.tsx +48 -0
  331. package/src/components/Grid/index.ts +2 -0
  332. package/src/components/Icon/Icon.tsx +43 -0
  333. package/src/components/Icon/index.ts +1 -0
  334. package/src/components/Icon/styles.css.ts +11 -0
  335. package/src/components/Input/Input.stories.tsx +38 -0
  336. package/src/components/Input/Input.test.tsx +16 -0
  337. package/src/components/Input/Input.tsx +43 -0
  338. package/src/components/Input/__screenshots__/Input.test.tsx/Input-renders-correctly-with-label-1-chromium-linux.png +0 -0
  339. package/src/components/Input/__screenshots__/Input.test.tsx/Input-renders-correctly-with-label-1-chromium-win32.png +0 -0
  340. package/src/components/Input/__screenshots__/Input.test.tsx/Input-renders-correctly-without-label-1-chromium-linux.png +0 -0
  341. package/src/components/Input/__screenshots__/Input.test.tsx/Input-renders-correctly-without-label-1-chromium-win32.png +0 -0
  342. package/src/components/Input/index.ts +1 -0
  343. package/src/components/Input/styles.css.ts +10 -0
  344. package/src/components/Kbd/Kbd.stories.tsx +53 -0
  345. package/src/components/Kbd/Kbd.test.tsx +22 -0
  346. package/src/components/Kbd/Kbd.tsx +17 -0
  347. package/src/components/Kbd/index.ts +2 -0
  348. package/src/components/Kbd/styles.css.ts +18 -0
  349. package/src/components/List/List.test.tsx +18 -0
  350. package/src/components/List/List.tsx +13 -0
  351. package/src/components/List/ListItem.tsx +13 -0
  352. package/src/components/List/__screenshots__/List.test.tsx/List-renders-correctly-1-chromium-win32.png +0 -0
  353. package/src/components/List/__screenshots__/List.test.tsx/List-renders-list-correctly-1-chromium-linux.png +0 -0
  354. package/src/components/List/__screenshots__/List.test.tsx/List-renders-list-correctly-1-chromium-win32.png +0 -0
  355. package/src/components/List/index.ts +2 -0
  356. package/src/components/List/styles.css.ts +13 -0
  357. package/src/components/Modal/Modal.stories.tsx +202 -0
  358. package/src/components/Modal/Modal.test.tsx +168 -0
  359. package/src/components/Modal/Modal.tsx +109 -0
  360. package/src/components/Modal/__screenshots__/Modal.test.tsx/Modal-displays-title-correctly-1.png +0 -0
  361. package/src/components/Modal/__screenshots__/Modal.test.tsx/Modal-handles-backdrop-click-to-close-1.png +0 -0
  362. package/src/components/Modal/index.ts +2 -0
  363. package/src/components/Modal/styles.css.ts +99 -0
  364. package/src/components/Navbar/Navbar.stories.tsx +49 -0
  365. package/src/components/Navbar/Navbar.test.tsx +18 -0
  366. package/src/components/Navbar/Navbar.tsx +27 -0
  367. package/src/components/Navbar/NavbarItem.tsx +14 -0
  368. package/src/components/Navbar/__screenshots__/Navbar.test.tsx/Navbar-renders-correctly-1-chromium-win32.png +0 -0
  369. package/src/components/Navbar/__screenshots__/Navbar.test.tsx/Navbar-renders-navbar-correctly-1-chromium-linux.png +0 -0
  370. package/src/components/Navbar/__screenshots__/Navbar.test.tsx/Navbar-renders-navbar-correctly-1-chromium-win32.png +0 -0
  371. package/src/components/Navbar/index.ts +2 -0
  372. package/src/components/Navbar/styles.css.ts +5 -0
  373. package/src/components/NumberInput/NumberInput.stories.tsx +101 -0
  374. package/src/components/NumberInput/NumberInput.test.tsx +39 -0
  375. package/src/components/NumberInput/NumberInput.tsx +161 -0
  376. package/src/components/NumberInput/index.ts +2 -0
  377. package/src/components/NumberInput/styles.css.ts +127 -0
  378. package/src/components/Pagination/Pagination.stories.tsx +63 -0
  379. package/src/components/Pagination/Pagination.test.tsx +27 -0
  380. package/src/components/Pagination/Pagination.tsx +138 -0
  381. package/src/components/Pagination/index.ts +2 -0
  382. package/src/components/Pagination/styles.css.ts +48 -0
  383. package/src/components/Popover/Popover.stories.tsx +80 -0
  384. package/src/components/Popover/Popover.test.tsx +47 -0
  385. package/src/components/Popover/Popover.tsx +171 -0
  386. package/src/components/Popover/index.ts +2 -0
  387. package/src/components/Popover/styles.css.ts +197 -0
  388. package/src/components/Progress/Progress.stories.tsx +73 -0
  389. package/src/components/Progress/Progress.test.tsx +53 -0
  390. package/src/components/Progress/Progress.tsx +66 -0
  391. package/src/components/Progress/index.ts +1 -0
  392. package/src/components/Progress/styles.css.ts +75 -0
  393. package/src/components/Radio/Radio.stories.tsx +75 -0
  394. package/src/components/Radio/Radio.test.tsx +54 -0
  395. package/src/components/Radio/Radio.tsx +104 -0
  396. package/src/components/Radio/index.ts +1 -0
  397. package/src/components/Radio/styles.css.ts +47 -0
  398. package/src/components/ScrollArea/ScrollArea.stories.tsx +63 -0
  399. package/src/components/ScrollArea/ScrollArea.test.tsx +24 -0
  400. package/src/components/ScrollArea/ScrollArea.tsx +50 -0
  401. package/src/components/ScrollArea/index.ts +2 -0
  402. package/src/components/ScrollArea/styles.css.ts +28 -0
  403. package/src/components/Select/Select.stories.tsx +94 -0
  404. package/src/components/Select/Select.test.tsx +57 -0
  405. package/src/components/Select/Select.tsx +60 -0
  406. package/src/components/Select/index.ts +1 -0
  407. package/src/components/Select/styles.css.ts +86 -0
  408. package/src/components/Separator/Separator.stories.tsx +49 -0
  409. package/src/components/Separator/Separator.test.tsx +22 -0
  410. package/src/components/Separator/Separator.tsx +37 -0
  411. package/src/components/Separator/index.ts +2 -0
  412. package/src/components/Separator/styles.css.ts +32 -0
  413. package/src/components/Skeleton/Skeleton.stories.tsx +78 -0
  414. package/src/components/Skeleton/Skeleton.test.tsx +36 -0
  415. package/src/components/Skeleton/Skeleton.tsx +67 -0
  416. package/src/components/Skeleton/index.ts +2 -0
  417. package/src/components/Skeleton/styles.css.ts +62 -0
  418. package/src/components/Spinner/Spinner.stories.tsx +123 -0
  419. package/src/components/Spinner/Spinner.test.tsx +73 -0
  420. package/src/components/Spinner/Spinner.tsx +41 -0
  421. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-div-element-with-proper-attributes-1.png +0 -0
  422. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-error-color-correctly-1-chromium-linux.png +0 -0
  423. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-info-color-correctly-1-chromium-linux.png +0 -0
  424. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-large-spinner-correctly-1-chromium-linux.png +0 -0
  425. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-medium-spinner-correctly-1-chromium-linux.png +0 -0
  426. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-primary-spinner-correctly-1-chromium-linux.png +0 -0
  427. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-secondary-color-correctly-1-chromium-linux.png +0 -0
  428. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-small-spinner-correctly-1-chromium-linux.png +0 -0
  429. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-success-color-correctly-1-chromium-linux.png +0 -0
  430. package/src/components/Spinner/__screenshots__/Spinner.test.tsx/Spinner-renders-warning-color-correctly-1-chromium-linux.png +0 -0
  431. package/src/components/Spinner/index.ts +2 -0
  432. package/src/components/Spinner/styles.css.ts +59 -0
  433. package/src/components/Stack/Stack.stories.tsx +123 -0
  434. package/src/components/Stack/Stack.test.tsx +48 -0
  435. package/src/components/Stack/Stack.tsx +60 -0
  436. package/src/components/Stack/index.ts +2 -0
  437. package/src/components/Stepper/Stepper.stories.tsx +85 -0
  438. package/src/components/Stepper/Stepper.test.tsx +47 -0
  439. package/src/components/Stepper/Stepper.tsx +133 -0
  440. package/src/components/Stepper/index.ts +2 -0
  441. package/src/components/Stepper/styles.css.ts +118 -0
  442. package/src/components/Table/Table.stories.tsx +147 -0
  443. package/src/components/Table/Table.test.tsx +104 -0
  444. package/src/components/Table/Table.tsx +131 -0
  445. package/src/components/Table/index.ts +1 -0
  446. package/src/components/Table/styles.css.ts +57 -0
  447. package/src/components/Tabs/Tabs.stories.tsx +104 -0
  448. package/src/components/Tabs/Tabs.test.tsx +52 -0
  449. package/src/components/Tabs/Tabs.tsx +147 -0
  450. package/src/components/Tabs/index.ts +1 -0
  451. package/src/components/Tabs/styles.css.ts +106 -0
  452. package/src/components/Tag/Tag.stories.tsx +72 -0
  453. package/src/components/Tag/Tag.test.tsx +49 -0
  454. package/src/components/Tag/Tag.tsx +72 -0
  455. package/src/components/Tag/index.ts +1 -0
  456. package/src/components/Tag/styles.css.ts +96 -0
  457. package/src/components/Text/Header.stories.tsx +45 -0
  458. package/src/components/Text/Header.tsx +20 -0
  459. package/src/components/Text/P.stories.tsx +24 -0
  460. package/src/components/Text/P.tsx +19 -0
  461. package/src/components/Text/Text.test.tsx +32 -0
  462. package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h1-correctly-1-chromium-linux.png +0 -0
  463. package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h1-correctly-1-chromium-win32.png +0 -0
  464. package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h2-correctly-1-chromium-linux.png +0 -0
  465. package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h2-correctly-1-chromium-win32.png +0 -0
  466. package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h3-correctly-1-chromium-linux.png +0 -0
  467. package/src/components/Text/__screenshots__/Text.test.tsx/Header-renders-h3-correctly-1-chromium-win32.png +0 -0
  468. package/src/components/Text/__screenshots__/Text.test.tsx/P-renders-correctly-1-chromium-win32.png +0 -0
  469. package/src/components/Text/__screenshots__/Text.test.tsx/P-renders-p-correctly-1-chromium-linux.png +0 -0
  470. package/src/components/Text/__screenshots__/Text.test.tsx/P-renders-p-correctly-1-chromium-win32.png +0 -0
  471. package/src/components/Text/index.ts +2 -0
  472. package/src/components/Text/styles.css.ts +15 -0
  473. package/src/components/TextArea/TextArea.stories.tsx +40 -0
  474. package/src/components/TextArea/TextArea.test.tsx +16 -0
  475. package/src/components/TextArea/TextArea.tsx +43 -0
  476. package/src/components/TextArea/index.ts +2 -0
  477. package/src/components/TextArea/styles.css.ts +12 -0
  478. package/src/components/Toast/Toast.tsx +342 -0
  479. package/src/components/Toast/index.ts +9 -0
  480. package/src/components/Toast/styles.css.ts +213 -0
  481. package/src/components/Toggle/Toggle.stories.tsx +190 -0
  482. package/src/components/Toggle/Toggle.test.tsx +85 -0
  483. package/src/components/Toggle/Toggle.tsx +94 -0
  484. package/src/components/Toggle/index.ts +2 -0
  485. package/src/components/Toggle/styles.css.ts +130 -0
  486. package/src/components/Tooltip/Tooltip.stories.tsx +111 -0
  487. package/src/components/Tooltip/Tooltip.test.tsx +93 -0
  488. package/src/components/Tooltip/Tooltip.tsx +72 -0
  489. package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-has-proper-role-attribute-1.png +0 -0
  490. package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-bottom-tooltip-correctly-1-chromium-linux.png +0 -0
  491. package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-left-tooltip-correctly-1-chromium-linux.png +0 -0
  492. package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-right-tooltip-correctly-1-chromium-linux.png +0 -0
  493. package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-tooltip-without-arrow-1-chromium-linux.png +0 -0
  494. package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-top-tooltip-correctly-1-chromium-linux.png +0 -0
  495. package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-renders-with-tooltip-content-1.png +0 -0
  496. package/src/components/Tooltip/__screenshots__/Tooltip.test.tsx/Tooltip-shows-tooltip-on-hover-1.png +0 -0
  497. package/src/components/Tooltip/index.ts +2 -0
  498. package/src/components/Tooltip/styles.css.ts +94 -0
  499. package/src/components/VisuallyHidden/VisuallyHidden.stories.tsx +42 -0
  500. package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +20 -0
  501. package/src/components/VisuallyHidden/VisuallyHidden.tsx +26 -0
  502. package/src/components/VisuallyHidden/index.ts +2 -0
  503. package/src/components/VisuallyHidden/styles.css.ts +14 -0
  504. package/src/components/index.ts +68 -0
  505. package/src/index.ts +1 -0
  506. package/src/styles/layers.css.ts +3 -0
  507. package/src/styles/reset.css.ts +79 -0
  508. package/src/styles/sprinkles.css.ts +177 -0
  509. package/src/styles/theme.css.ts +55 -0
  510. package/src/styles/utils.ts +9 -0
  511. package/dist/layers.css.js +0 -4
  512. package/dist/reset.css.js +0 -1
  513. package/dist/styles/reset.css.js +0 -1
  514. package/dist/theme.css.js +0 -41
@@ -0,0 +1,41 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { render } from 'vitest-browser-react';
3
+ import Form from './Form';
4
+ import React from 'react';
5
+ import { P } from '../Text';
6
+ import { Input } from '../Input';
7
+ import { Button } from '../Button';
8
+
9
+ describe('Form', () => {
10
+ it('renders form correctly', async () => {
11
+ const { container } = await render(
12
+ <Form>
13
+ <P>Test Form</P>
14
+ <Input label="Name" id="name" />
15
+ <Input label="Email" id="email" />
16
+ <Input label="Message" id="message" />
17
+ </Form>,
18
+ );
19
+ expect(container).toMatchScreenshot();
20
+ });
21
+
22
+ it('can submit', async () => {
23
+ let submitted = false;
24
+ const handleSubmit = (e: React.FormEvent) => {
25
+ e.preventDefault();
26
+ submitted = true;
27
+ };
28
+ const { getByText } = await render(
29
+ <Form onSubmit={handleSubmit}>
30
+ <P>Test Form</P>
31
+ <Input label="Name" id="name" />
32
+ <Input label="Email" id="email" />
33
+ <Input label="Message" id="message" />
34
+ <Button type="submit" label="Submit" variant="primary" />
35
+ </Form>,
36
+ );
37
+ const button = getByText('Submit');
38
+ await button.click();
39
+ expect(submitted).toBe(true);
40
+ });
41
+ });
@@ -0,0 +1,28 @@
1
+ import clsx from 'clsx';
2
+ import React from 'react';
3
+ import { formStyle } from './styles.css';
4
+ import Box from '../Box';
5
+
6
+ type FormProps = React.FormHTMLAttributes<HTMLFormElement> & {
7
+ className?: string;
8
+ children?: React.ReactNode;
9
+ };
10
+
11
+ const Form = (props: FormProps) => {
12
+ return (
13
+ <Box
14
+ as="form"
15
+ gap="medium"
16
+ paddingX="large"
17
+ className={clsx(
18
+ formStyle,
19
+ props.className,
20
+ )}
21
+ {...props}
22
+ >
23
+ {props.children}
24
+ </Box>
25
+ );
26
+ };
27
+
28
+ export default Form;
@@ -0,0 +1,16 @@
1
+ import clsx from 'clsx';
2
+ import React from 'react';
3
+ import { formInputStyle } from './styles.css';
4
+ import { Input } from '../..';
5
+ import { InputProps } from '../Input/Input';
6
+ import Box from '../Box';
7
+
8
+ type FormInputProps = React.InputHTMLAttributes<HTMLInputElement> & InputProps;
9
+
10
+ const FormInput = (props: FormInputProps) => {
11
+ return (
12
+ <Box as={Input} padding="small" className={clsx(formInputStyle, props.className)} label={props.label} {...props} />
13
+ );
14
+ };
15
+
16
+ export default FormInput;
@@ -0,0 +1,2 @@
1
+ export { default as Form } from './Form';
2
+ export { default as FormInput } from './FormInput';
@@ -0,0 +1,13 @@
1
+ import { styleWithLayer } from '../../styles/utils';
2
+
3
+ export const formStyle = styleWithLayer({
4
+ display: 'grid',
5
+ gridTemplateRows: 'min-content 1fr min-content',
6
+ });
7
+
8
+ export const formInputStyle = styleWithLayer({
9
+ display: 'flex',
10
+ flexDirection: 'row',
11
+ justifyContent: 'space-between',
12
+ alignItems: 'center',
13
+ });
@@ -0,0 +1,134 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import React from 'react';
3
+ import { Grid } from '.';
4
+ import { Box } from '../Box';
5
+
6
+ const meta = {
7
+ title: 'Components/Grid',
8
+ component: Grid,
9
+ parameters: {
10
+ layout: 'centered',
11
+ },
12
+ tags: ['autodocs'],
13
+ } satisfies Meta<typeof Grid>;
14
+
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+
18
+ const DemoBox = ({ children }: { children: React.ReactNode }) => (
19
+ <Box
20
+ padding="medium"
21
+ background="c2-200"
22
+ style={{ textAlign: 'center' }}
23
+ >
24
+ {children}
25
+ </Box>
26
+ );
27
+
28
+ export const TwoColumns: Story = {
29
+ args: {
30
+ columns: 2,
31
+ gap: 'medium',
32
+ children: (
33
+ <>
34
+ <DemoBox>Item 1</DemoBox>
35
+ <DemoBox>Item 2</DemoBox>
36
+ <DemoBox>Item 3</DemoBox>
37
+ <DemoBox>Item 4</DemoBox>
38
+ </>
39
+ ),
40
+ },
41
+ };
42
+
43
+ export const ThreeColumns: Story = {
44
+ args: {
45
+ columns: 3,
46
+ gap: 'medium',
47
+ children: (
48
+ <>
49
+ <DemoBox>Item 1</DemoBox>
50
+ <DemoBox>Item 2</DemoBox>
51
+ <DemoBox>Item 3</DemoBox>
52
+ </>
53
+ ),
54
+ },
55
+ };
56
+
57
+ export const FourColumns: Story = {
58
+ args: {
59
+ columns: 4,
60
+ gap: 'small',
61
+ children: (
62
+ <>
63
+ <DemoBox>1</DemoBox>
64
+ <DemoBox>2</DemoBox>
65
+ <DemoBox>3</DemoBox>
66
+ <DemoBox>4</DemoBox>
67
+ </>
68
+ ),
69
+ },
70
+ };
71
+
72
+ export const AutoFit: Story = {
73
+ args: {
74
+ minChildWidth: '120px',
75
+ gap: 'medium',
76
+ children: (
77
+ <>
78
+ <DemoBox>Auto 1</DemoBox>
79
+ <DemoBox>Auto 2</DemoBox>
80
+ <DemoBox>Auto 3</DemoBox>
81
+ <DemoBox>Auto 4</DemoBox>
82
+ <DemoBox>Auto 5</DemoBox>
83
+ </>
84
+ ),
85
+ },
86
+ };
87
+
88
+ export const DifferentGaps: Story = {
89
+ args: {
90
+ columns: 3,
91
+ children: (
92
+ <>
93
+ <Grid columns={3} gap="small">
94
+ <DemoBox>Small</DemoBox>
95
+ <DemoBox>Gap</DemoBox>
96
+ <DemoBox>Grid</DemoBox>
97
+ </Grid>
98
+ <Grid columns={3} gap="medium" style={{ marginTop: '1rem' }}>
99
+ <DemoBox>Medium</DemoBox>
100
+ <DemoBox>Gap</DemoBox>
101
+ <DemoBox>Grid</DemoBox>
102
+ </Grid>
103
+ <Grid columns={3} gap="large" style={{ marginTop: '1rem' }}>
104
+ <DemoBox>Large</DemoBox>
105
+ <DemoBox>Gap</DemoBox>
106
+ <DemoBox>Grid</DemoBox>
107
+ </Grid>
108
+ </>
109
+ ),
110
+ },
111
+ };
112
+
113
+ export const TwelveColumns: Story = {
114
+ args: {
115
+ columns: 12,
116
+ gap: 'small',
117
+ children: (
118
+ <>
119
+ <DemoBox>1</DemoBox>
120
+ <DemoBox>2</DemoBox>
121
+ <DemoBox>3</DemoBox>
122
+ <DemoBox>4</DemoBox>
123
+ <DemoBox>5</DemoBox>
124
+ <DemoBox>6</DemoBox>
125
+ <DemoBox>7</DemoBox>
126
+ <DemoBox>8</DemoBox>
127
+ <DemoBox>9</DemoBox>
128
+ <DemoBox>10</DemoBox>
129
+ <DemoBox>11</DemoBox>
130
+ <DemoBox>12</DemoBox>
131
+ </>
132
+ ),
133
+ },
134
+ };
@@ -0,0 +1,41 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { render } from 'vitest-browser-react';
3
+ import Grid from './Grid';
4
+ import React from 'react';
5
+
6
+ describe('Grid', () => {
7
+ it('renders with 2 columns', async () => {
8
+ const { container } = await render(
9
+ <Grid columns={2} gap="medium">
10
+ <div>Item 1</div>
11
+ <div>Item 2</div>
12
+ <div>Item 3</div>
13
+ <div>Item 4</div>
14
+ </Grid>
15
+ );
16
+ expect(container).toMatchScreenshot();
17
+ });
18
+
19
+ it('renders with 3 columns', async () => {
20
+ const { container } = await render(
21
+ <Grid columns={3} gap="small">
22
+ <div>Item 1</div>
23
+ <div>Item 2</div>
24
+ <div>Item 3</div>
25
+ </Grid>
26
+ );
27
+ expect(container).toMatchScreenshot();
28
+ });
29
+
30
+ it('renders with auto-fit min width', async () => {
31
+ const { container } = await render(
32
+ <Grid minChildWidth="150px" gap="large">
33
+ <div>Item 1</div>
34
+ <div>Item 2</div>
35
+ <div>Item 3</div>
36
+ <div>Item 4</div>
37
+ </Grid>
38
+ );
39
+ expect(container).toMatchScreenshot();
40
+ });
41
+ });
@@ -0,0 +1,48 @@
1
+ import React, { forwardRef } from 'react';
2
+ import Box from '../Box';
3
+
4
+ export type GridColumns = 1 | 2 | 3 | 4 | 5 | 6 | 12;
5
+ export type GridGap = 'none' | 'small' | 'medium' | 'large';
6
+
7
+ export interface GridProps {
8
+ columns?: GridColumns;
9
+ gap?: GridGap;
10
+ minChildWidth?: string;
11
+ children?: React.ReactNode;
12
+ className?: string;
13
+ style?: React.CSSProperties;
14
+ }
15
+
16
+ const gapMap: Record<GridGap, string> = {
17
+ none: '0',
18
+ small: '0.5rem',
19
+ medium: '1rem',
20
+ large: '2rem',
21
+ };
22
+
23
+ const Grid = forwardRef<HTMLElement, GridProps>(
24
+ ({ columns, gap = 'medium', minChildWidth, children, className, style }, ref) => {
25
+ const gapValue: GridGap = gap;
26
+
27
+ const gridStyle: React.CSSProperties = {
28
+ display: 'grid',
29
+ gap: gapMap[gapValue],
30
+ };
31
+
32
+ if (minChildWidth) {
33
+ gridStyle.gridTemplateColumns = `repeat(auto-fit, minmax(${minChildWidth}, 1fr))`;
34
+ } else if (columns) {
35
+ gridStyle.gridTemplateColumns = `repeat(${columns}, 1fr)`;
36
+ }
37
+
38
+ return (
39
+ <Box ref={ref} className={className} style={{ ...gridStyle, ...style }}>
40
+ {children}
41
+ </Box>
42
+ );
43
+ }
44
+ );
45
+
46
+ Grid.displayName = 'Grid';
47
+
48
+ export default Grid;
@@ -0,0 +1,2 @@
1
+ export { default as Grid } from './Grid';
2
+ export type { GridProps, GridColumns, GridGap } from './Grid';
@@ -0,0 +1,43 @@
1
+ import clsx from 'clsx';
2
+ import React from 'react';
3
+ import { icon } from './styles.css';
4
+ import Box from '../Box';
5
+
6
+ type IconProps = {
7
+ name?: string;
8
+ children?: React.ReactNode;
9
+ className?: string;
10
+ color?: string;
11
+ };
12
+
13
+ const IconComponent = ({ name, children, className, color }: IconProps) => {
14
+ const iconMap: Record<string, string> = {
15
+ check: '✓',
16
+ error: '✗',
17
+ warning: '⚠',
18
+ info: 'i',
19
+ success: '✓',
20
+ close: '×',
21
+ };
22
+
23
+ const displayContent = children || (name ? iconMap[name] : undefined);
24
+
25
+ if (!displayContent) {
26
+ return null;
27
+ }
28
+
29
+ return (
30
+ <Box
31
+ as="span"
32
+ className={clsx(icon, className)}
33
+ style={{ color }}
34
+ aria-hidden="true"
35
+ >
36
+ {displayContent}
37
+ </Box>
38
+ );
39
+ };
40
+
41
+ IconComponent.displayName = 'Icon';
42
+
43
+ export default IconComponent;
@@ -0,0 +1 @@
1
+ export { default as Icon } from './Icon';
@@ -0,0 +1,11 @@
1
+ import { style } from '@vanilla-extract/css';
2
+ import { styleWithLayer } from '../../styles/utils';
3
+
4
+ export const icon = styleWithLayer({
5
+ display: 'inline-flex',
6
+ alignItems: 'center',
7
+ justifyContent: 'center',
8
+ fontSize: '16px',
9
+ lineHeight: '1',
10
+ userSelect: 'none',
11
+ });
@@ -0,0 +1,38 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+
3
+ import { fn } from 'storybook/test';
4
+ import React from 'react';
5
+
6
+ import { Input } from '.';
7
+
8
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
9
+ const meta = {
10
+ title: 'Components/Input',
11
+ component: Input,
12
+ parameters: {
13
+ // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
14
+ layout: 'centered',
15
+ },
16
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
17
+ tags: ['autodocs'],
18
+ // More on argTypes: https://storybook.js.org/docs/api/argtypes
19
+ // argTypes: {
20
+ // backgroundColor: { control: 'color' },
21
+ // },
22
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
23
+ args: { onClick: fn() },
24
+ } satisfies Meta<typeof Input>;
25
+
26
+ export default meta;
27
+ type Story = StoryObj<typeof meta>;
28
+
29
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
30
+ export const WithLabel: Story = {
31
+ args: {
32
+ label: 'Username',
33
+ },
34
+ };
35
+
36
+ export const WithoutLabel: Story = {
37
+ args: {},
38
+ };
@@ -0,0 +1,16 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { render } from 'vitest-browser-react';
3
+ import Input from './Input';
4
+ import React from 'react';
5
+
6
+ describe('Input', () => {
7
+ it('renders correctly with label', async () => {
8
+ const { container } = await render(<Input label={'Hello'} />);
9
+ expect(container).toMatchScreenshot();
10
+ });
11
+
12
+ it('renders correctly without label', async () => {
13
+ const { container } = await render(<Input />);
14
+ expect(container).toMatchScreenshot();
15
+ });
16
+ });
@@ -0,0 +1,43 @@
1
+ import clsx from 'clsx';
2
+ import React from 'react';
3
+ import { inputStyle, label } from './styles.css';
4
+ import { text } from '../Text/styles.css';
5
+ import Box from '../Box';
6
+
7
+ export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
8
+ label?: string;
9
+ fullWidth?: boolean;
10
+ };
11
+
12
+ const Input = (props: InputProps) => {
13
+ return (
14
+ <Box
15
+ display="flex"
16
+ flexDirection={{ mobile: 'column', tablet: 'row' }}
17
+ gap="small"
18
+ >
19
+ {props.label && (
20
+ <Box
21
+ as="label"
22
+ className={clsx(
23
+ text,
24
+ label,
25
+ )}
26
+ marginX={{ mobile: 'auto', tablet: 'none' }}
27
+ marginY={{ mobile: 'none', tablet: 'auto' }}
28
+ htmlFor={props.id}
29
+ >
30
+ {props.label}
31
+ </Box>
32
+ )}
33
+ <Box
34
+ as="input"
35
+ className={clsx(inputStyle, props.className)}
36
+ width={props.fullWidth ? '100%' : undefined}
37
+ {...props}
38
+ />
39
+ </Box>
40
+ );
41
+ };
42
+
43
+ export default Input;
@@ -0,0 +1 @@
1
+ export { default as Input } from './Input';
@@ -0,0 +1,10 @@
1
+ import { styleWithLayer } from '../../styles/utils';
2
+
3
+ export const inputStyle = styleWithLayer({
4
+ padding: '0.5rem 1rem',
5
+ borderRadius: '0.5rem',
6
+ });
7
+
8
+ export const label = styleWithLayer({
9
+ paddingRight: '0.5rem',
10
+ });
@@ -0,0 +1,53 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import React from 'react';
3
+ import { Kbd } from '.';
4
+
5
+ const meta = {
6
+ title: 'Components/Kbd',
7
+ component: Kbd,
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ tags: ['autodocs'],
12
+ } satisfies Meta<typeof Kbd>;
13
+
14
+ export default meta;
15
+ type Story = StoryObj<typeof meta>;
16
+
17
+ export const SingleKey: Story = {
18
+ args: {
19
+ children: '⌘',
20
+ },
21
+ };
22
+
23
+ export const MultipleKeys: Story = {
24
+ render: () => (
25
+ <span>
26
+ <Kbd>Ctrl</Kbd> + <Kbd>C</Kbd>
27
+ </span>
28
+ ),
29
+ };
30
+
31
+ export const ComplexShortcut: Story = {
32
+ render: () => (
33
+ <span>
34
+ Press <Kbd>⌘</Kbd> + <Kbd>Shift</Kbd> + <Kbd>P</Kbd> to open command palette
35
+ </span>
36
+ ),
37
+ };
38
+
39
+ export const InContext: Story = {
40
+ render: () => (
41
+ <div style={{ lineHeight: '1.6' }}>
42
+ <p>
43
+ Use <Kbd>Tab</Kbd> to navigate between fields.
44
+ </p>
45
+ <p>
46
+ Press <Kbd>Enter</Kbd> to submit the form.
47
+ </p>
48
+ <p>
49
+ Press <Kbd>Esc</Kbd> to cancel.
50
+ </p>
51
+ </div>
52
+ ),
53
+ };
@@ -0,0 +1,22 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { render } from 'vitest-browser-react';
3
+ import Kbd from './Kbd';
4
+ import React from 'react';
5
+
6
+ describe('Kbd', () => {
7
+ it('renders keyboard shortcut', async () => {
8
+ const { container } = await render(
9
+ <Kbd>Ctrl</Kbd>
10
+ );
11
+ expect(container).toMatchScreenshot();
12
+ });
13
+
14
+ it('renders multi-key shortcut', async () => {
15
+ const { container } = await render(
16
+ <span>
17
+ <Kbd>Ctrl</Kbd> + <Kbd>C</Kbd>
18
+ </span>
19
+ );
20
+ expect(container).toMatchScreenshot();
21
+ });
22
+ });
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { kbd } from './styles.css';
3
+
4
+ export interface KbdProps {
5
+ children: React.ReactNode;
6
+ className?: string;
7
+ }
8
+
9
+ const Kbd = ({ children, className, ...props }: KbdProps) => {
10
+ return (
11
+ <kbd className={`${kbd} ${className || ''}`} {...props}>
12
+ {children}
13
+ </kbd>
14
+ );
15
+ };
16
+
17
+ export default Kbd;
@@ -0,0 +1,2 @@
1
+ export { default as Kbd } from './Kbd';
2
+ export type { KbdProps } from './Kbd';
@@ -0,0 +1,18 @@
1
+ import { style } from '@vanilla-extract/css';
2
+ import { vars } from '../../styles/theme.css';
3
+ import { styleWithLayer } from '../../styles/utils';
4
+
5
+ export const kbd = styleWithLayer({
6
+ display: 'inline-block',
7
+ padding: '0.125rem 0.375rem',
8
+ fontFamily: 'monospace',
9
+ fontSize: '0.85em',
10
+ fontWeight: '600',
11
+ lineHeight: '1.5',
12
+ color: vars.colors.textPrimary,
13
+ backgroundColor: vars.colors.backgroundMuted,
14
+ border: `1px solid ${vars.colors.borderDefault}`,
15
+ borderRadius: '4px',
16
+ boxShadow: '0 2px 0 rgba(0, 0, 0, 0.1)',
17
+ whiteSpace: 'nowrap',
18
+ });
@@ -0,0 +1,18 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { render } from 'vitest-browser-react';
3
+ import List from './List';
4
+ import React from 'react';
5
+ import ListItem from './ListItem';
6
+
7
+ describe('List', () => {
8
+ it('renders list correctly', async () => {
9
+ const { container } = await render(
10
+ <List>
11
+ <ListItem>Item 1</ListItem>
12
+ <ListItem>Item 2</ListItem>
13
+ <ListItem>Item 3</ListItem>
14
+ </List>,
15
+ );
16
+ expect(container).toMatchScreenshot();
17
+ });
18
+ });