@fabio.caffarello/react-design-system 1.7.0 → 1.8.0

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 (460) hide show
  1. package/README.md +48 -3
  2. package/dist/docs/components/ComponentStatusTable.d.ts +11 -0
  3. package/dist/ui/atoms/Accordion/Accordion.d.ts +34 -0
  4. package/dist/ui/atoms/Accordion/Accordion.stories.d.ts +11 -0
  5. package/dist/ui/atoms/Accordion/Accordion.test.d.ts +1 -0
  6. package/dist/ui/atoms/Accordion/index.d.ts +2 -0
  7. package/dist/ui/atoms/Avatar/Avatar.d.ts +30 -0
  8. package/dist/ui/atoms/Avatar/Avatar.stories.d.ts +13 -0
  9. package/dist/ui/atoms/Avatar/Avatar.test.d.ts +1 -0
  10. package/dist/ui/atoms/Avatar/AvatarGroup.d.ts +26 -0
  11. package/dist/ui/atoms/Avatar/index.d.ts +9 -0
  12. package/dist/ui/atoms/Badge/Badge.d.ts +14 -6
  13. package/dist/ui/atoms/Badge/Badge.stories.d.ts +8 -9
  14. package/dist/ui/atoms/BoxWrapper/BoxWrapper.d.ts +3 -3
  15. package/dist/ui/atoms/BoxWrapper/BoxWrapper.test.d.ts +1 -0
  16. package/dist/ui/atoms/Button/Button.d.ts +32 -10
  17. package/dist/ui/atoms/Button/Button.stories.d.ts +7 -0
  18. package/dist/ui/atoms/Button/Button.test.d.ts +1 -0
  19. package/dist/ui/atoms/Checkbox/Checkbox.d.ts +2 -1
  20. package/dist/ui/atoms/Collapsible/Collapsible.stories.d.ts +2 -0
  21. package/dist/ui/atoms/Info/Info.d.ts +2 -3
  22. package/dist/ui/atoms/Info/Info.test.d.ts +1 -0
  23. package/dist/ui/atoms/Input/Input.d.ts +14 -4
  24. package/dist/ui/atoms/Input/Input.stories.d.ts +6 -0
  25. package/dist/ui/atoms/Popover/Popover.d.ts +35 -0
  26. package/dist/ui/atoms/Popover/Popover.stories.d.ts +11 -0
  27. package/dist/ui/atoms/Popover/Popover.test.d.ts +1 -0
  28. package/dist/ui/atoms/Popover/index.d.ts +2 -0
  29. package/dist/ui/atoms/Progress/Progress.d.ts +33 -0
  30. package/dist/ui/atoms/Progress/Progress.stories.d.ts +12 -0
  31. package/dist/ui/atoms/Progress/Progress.test.d.ts +1 -0
  32. package/dist/ui/atoms/Select/Select.d.ts +18 -6
  33. package/dist/ui/atoms/Select/Select.stories.d.ts +11 -8
  34. package/dist/ui/atoms/Separator/Separator.d.ts +23 -0
  35. package/dist/ui/atoms/Separator/Separator.stories.d.ts +10 -0
  36. package/dist/ui/atoms/Separator/Separator.test.d.ts +1 -0
  37. package/dist/ui/atoms/Separator/index.d.ts +2 -0
  38. package/dist/ui/atoms/Skeleton/Skeleton.d.ts +1 -1
  39. package/dist/ui/atoms/Skeleton/Skeleton.stories.d.ts +24 -0
  40. package/dist/ui/atoms/Slider/Slider.d.ts +45 -0
  41. package/dist/ui/atoms/Slider/Slider.stories.d.ts +13 -0
  42. package/dist/ui/atoms/Slider/Slider.test.d.ts +1 -0
  43. package/dist/ui/atoms/Slider/index.d.ts +2 -0
  44. package/dist/ui/atoms/Spinner/Spinner.d.ts +22 -0
  45. package/dist/ui/atoms/Spinner/Spinner.stories.d.ts +9 -0
  46. package/dist/ui/atoms/Spinner/Spinner.test.d.ts +1 -0
  47. package/dist/ui/atoms/Switch/Switch.d.ts +28 -0
  48. package/dist/ui/atoms/Switch/Switch.stories.d.ts +11 -0
  49. package/dist/ui/atoms/Switch/Switch.test.d.ts +1 -0
  50. package/dist/ui/atoms/Switch/index.d.ts +2 -0
  51. package/dist/ui/atoms/Tooltip/Tooltip.d.ts +2 -1
  52. package/dist/ui/atoms/Tooltip/Tooltip.stories.d.ts +17 -0
  53. package/dist/ui/atoms/index.d.ts +20 -3
  54. package/dist/ui/index.d.ts +6 -1
  55. package/dist/ui/molecules/Card/Card.d.ts +6 -2
  56. package/dist/ui/molecules/Card/Card.stories.d.ts +2 -0
  57. package/dist/ui/molecules/ColorPicker/ColorPicker.d.ts +28 -0
  58. package/dist/ui/molecules/ColorPicker/ColorPicker.stories.d.ts +12 -0
  59. package/dist/ui/molecules/ColorPicker/ColorPicker.test.d.ts +1 -0
  60. package/dist/ui/molecules/ColorPicker/index.d.ts +2 -0
  61. package/dist/ui/molecules/DatePicker/DatePicker.d.ts +74 -0
  62. package/dist/ui/molecules/DatePicker/DatePicker.stories.d.ts +12 -0
  63. package/dist/ui/molecules/DatePicker/DatePicker.test.d.ts +1 -0
  64. package/dist/ui/molecules/DatePicker/DatePickerCalendar.d.ts +6 -0
  65. package/dist/ui/molecules/DatePicker/DatePickerContext.d.ts +28 -0
  66. package/dist/ui/molecules/DatePicker/DatePickerInput.d.ts +9 -0
  67. package/dist/ui/molecules/DatePicker/DatePickerProvider.d.ts +23 -0
  68. package/dist/ui/molecules/DatePicker/index.d.ts +14 -0
  69. package/dist/ui/molecules/Dropdown/Dropdown.d.ts +2 -1
  70. package/dist/ui/molecules/Dropdown/Dropdown.stories.d.ts +13 -0
  71. package/dist/ui/molecules/EmptyState/EmptyState.stories.d.ts +22 -0
  72. package/dist/ui/molecules/FileUpload/FileUpload.d.ts +37 -0
  73. package/dist/ui/molecules/FileUpload/FileUpload.stories.d.ts +12 -0
  74. package/dist/ui/molecules/FileUpload/FileUpload.test.d.ts +1 -0
  75. package/dist/ui/molecules/FileUpload/index.d.ts +2 -0
  76. package/dist/ui/molecules/Form/Form.d.ts +29 -4
  77. package/dist/ui/molecules/Form/Form.stories.d.ts +2 -0
  78. package/dist/ui/molecules/Form/FormContext.d.ts +17 -0
  79. package/dist/ui/molecules/Form/FormField.d.ts +36 -0
  80. package/dist/ui/molecules/Form/FormProvider.d.ts +14 -0
  81. package/dist/ui/molecules/Form/index.d.ts +13 -0
  82. package/dist/ui/molecules/Form/useFormFieldArray.d.ts +28 -0
  83. package/dist/ui/molecules/InputWithLabel/InputWithLabel.test.d.ts +1 -0
  84. package/dist/ui/molecules/Rating/Rating.d.ts +33 -0
  85. package/dist/ui/molecules/Rating/Rating.stories.d.ts +13 -0
  86. package/dist/ui/molecules/Rating/Rating.test.d.ts +1 -0
  87. package/dist/ui/molecules/Rating/index.d.ts +2 -0
  88. package/dist/ui/molecules/SearchInput/SearchInput.d.ts +24 -0
  89. package/dist/ui/molecules/SearchInput/SearchInput.stories.d.ts +10 -0
  90. package/dist/ui/molecules/SearchInput/SearchInput.test.d.ts +1 -0
  91. package/dist/ui/molecules/SearchInput/index.d.ts +2 -0
  92. package/dist/ui/molecules/SidebarHeader/SidebarHeader.test.d.ts +1 -0
  93. package/dist/ui/molecules/TableActions/TableActions.d.ts +31 -0
  94. package/dist/ui/molecules/TableActions/TableActions.stories.d.ts +7 -0
  95. package/dist/ui/molecules/TableActions/TableActions.test.d.ts +1 -0
  96. package/dist/ui/molecules/TableFilters/TableFilters.d.ts +37 -0
  97. package/dist/ui/molecules/TableFilters/TableFilters.stories.d.ts +7 -0
  98. package/dist/ui/molecules/TableFilters/TableFilters.test.d.ts +1 -0
  99. package/dist/ui/molecules/TablePagination/TablePagination.d.ts +29 -0
  100. package/dist/ui/molecules/TablePagination/TablePagination.stories.d.ts +8 -0
  101. package/dist/ui/molecules/TablePagination/TablePagination.test.d.ts +1 -0
  102. package/dist/ui/molecules/Tabs/Tabs.d.ts +15 -0
  103. package/dist/ui/molecules/Tabs/Tabs.stories.d.ts +10 -0
  104. package/dist/ui/molecules/Tabs/Tabs.test.d.ts +1 -0
  105. package/dist/ui/molecules/Tabs/TabsContent.d.ts +14 -0
  106. package/dist/ui/molecules/Tabs/TabsContext.d.ts +18 -0
  107. package/dist/ui/molecules/Tabs/TabsList.d.ts +12 -0
  108. package/dist/ui/molecules/Tabs/TabsProvider.d.ts +16 -0
  109. package/dist/ui/molecules/Tabs/TabsTrigger.d.ts +13 -0
  110. package/dist/ui/molecules/Tabs/index.d.ts +17 -0
  111. package/dist/ui/molecules/TimePicker/TimePicker.d.ts +29 -0
  112. package/dist/ui/molecules/TimePicker/TimePicker.stories.d.ts +12 -0
  113. package/dist/ui/molecules/TimePicker/TimePicker.test.d.ts +1 -0
  114. package/dist/ui/molecules/TimePicker/index.d.ts +2 -0
  115. package/dist/ui/molecules/index.d.ts +13 -5
  116. package/dist/ui/organisms/CommandPalette/CommandPalette.d.ts +37 -0
  117. package/dist/ui/organisms/CommandPalette/CommandPalette.stories.d.ts +11 -0
  118. package/dist/ui/organisms/CommandPalette/CommandPalette.test.d.ts +1 -0
  119. package/dist/ui/organisms/CommandPalette/index.d.ts +2 -0
  120. package/dist/ui/organisms/DataGrid/DataGrid.d.ts +84 -0
  121. package/dist/ui/organisms/DataGrid/DataGrid.stories.d.ts +14 -0
  122. package/dist/ui/organisms/DataGrid/DataGrid.test.d.ts +1 -0
  123. package/dist/ui/organisms/DataGrid/index.d.ts +2 -0
  124. package/dist/ui/organisms/Dialog/AlertDialog.d.ts +34 -0
  125. package/dist/ui/organisms/Dialog/Dialog.d.ts +58 -0
  126. package/dist/ui/organisms/Dialog/Dialog.stories.d.ts +13 -0
  127. package/dist/ui/organisms/Dialog/Dialog.test.d.ts +1 -0
  128. package/dist/ui/organisms/Dialog/DialogClose.d.ts +8 -0
  129. package/dist/ui/organisms/Dialog/DialogContent.d.ts +8 -0
  130. package/dist/ui/organisms/Dialog/DialogContext.d.ts +10 -0
  131. package/dist/ui/organisms/Dialog/DialogDescription.d.ts +4 -0
  132. package/dist/ui/organisms/Dialog/DialogFooter.d.ts +5 -0
  133. package/dist/ui/organisms/Dialog/DialogHeader.d.ts +5 -0
  134. package/dist/ui/organisms/Dialog/DialogProvider.d.ts +10 -0
  135. package/dist/ui/organisms/Dialog/DialogTitle.d.ts +5 -0
  136. package/dist/ui/organisms/Dialog/DialogTrigger.d.ts +6 -0
  137. package/dist/ui/organisms/Dialog/index.d.ts +22 -0
  138. package/dist/ui/organisms/Sidebar/Sidebar.d.ts +7 -4
  139. package/dist/ui/organisms/Sidebar/SidebarGroup/SidebarGroup.d.ts +27 -0
  140. package/dist/ui/organisms/Sidebar/SidebarGroup/SidebarGroup.stories.d.ts +11 -0
  141. package/dist/ui/organisms/Sidebar/SidebarGroup/SidebarGroup.test.d.ts +1 -0
  142. package/dist/ui/organisms/Sidebar/SidebarHeader/SidebarHeader.d.ts +19 -0
  143. package/dist/ui/organisms/Sidebar/SidebarHeader/SidebarHeader.test.d.ts +1 -0
  144. package/dist/ui/organisms/Sidebar/SidebarItem/SidebarItem.d.ts +23 -0
  145. package/dist/ui/organisms/Sidebar/SidebarItem/SidebarItem.stories.d.ts +10 -0
  146. package/dist/ui/organisms/Sidebar/SidebarItem/SidebarItem.test.d.ts +1 -0
  147. package/dist/ui/organisms/Sidebar/index.d.ts +8 -0
  148. package/dist/ui/organisms/Stepper/Stepper.d.ts +40 -0
  149. package/dist/ui/organisms/Stepper/Stepper.stories.d.ts +12 -0
  150. package/dist/ui/organisms/Stepper/Stepper.test.d.ts +1 -0
  151. package/dist/ui/organisms/Stepper/index.d.ts +2 -0
  152. package/dist/ui/organisms/Table/Table.d.ts +84 -16
  153. package/dist/ui/organisms/Table/Table.stories.d.ts +15 -0
  154. package/dist/ui/organisms/Table/TableActions/TableActions.d.ts +31 -0
  155. package/dist/ui/organisms/Table/TableActions/TableActions.stories.d.ts +7 -0
  156. package/dist/ui/organisms/Table/TableActions/TableActions.test.d.ts +1 -0
  157. package/dist/ui/organisms/Table/TableActions.d.ts +13 -0
  158. package/dist/ui/organisms/Table/TableBody.d.ts +12 -0
  159. package/dist/ui/organisms/Table/TableCell.d.ts +14 -0
  160. package/dist/ui/organisms/Table/TableContext.d.ts +75 -0
  161. package/dist/ui/organisms/Table/TableEmptyState.d.ts +11 -0
  162. package/dist/ui/organisms/Table/TableFilters/TableFilters.d.ts +37 -0
  163. package/dist/ui/organisms/Table/TableFilters/TableFilters.stories.d.ts +7 -0
  164. package/dist/ui/organisms/Table/TableFilters/TableFilters.test.d.ts +1 -0
  165. package/dist/ui/organisms/Table/TableFilters.d.ts +12 -0
  166. package/dist/ui/organisms/Table/TableHeader.d.ts +10 -0
  167. package/dist/ui/organisms/Table/TableHeaderCell.d.ts +18 -0
  168. package/dist/ui/organisms/Table/TableHeaderRow.d.ts +10 -0
  169. package/dist/ui/organisms/Table/TablePagination/TablePagination.d.ts +29 -0
  170. package/dist/ui/organisms/Table/TablePagination/TablePagination.stories.d.ts +8 -0
  171. package/dist/ui/organisms/Table/TablePagination/TablePagination.test.d.ts +1 -0
  172. package/dist/ui/organisms/Table/TablePagination.d.ts +14 -0
  173. package/dist/ui/organisms/Table/TableProvider.d.ts +55 -0
  174. package/dist/ui/organisms/Table/TableRow.d.ts +14 -0
  175. package/dist/ui/organisms/Table/TableTypes.d.ts +8 -0
  176. package/dist/ui/organisms/Table/index.d.ts +30 -0
  177. package/dist/ui/organisms/Table/useColumnResizing.d.ts +39 -0
  178. package/dist/ui/organisms/Table/useVirtualScrolling.d.ts +35 -0
  179. package/dist/ui/organisms/Timeline/Timeline.d.ts +34 -0
  180. package/dist/ui/organisms/Timeline/Timeline.stories.d.ts +12 -0
  181. package/dist/ui/organisms/Timeline/Timeline.test.d.ts +1 -0
  182. package/dist/ui/organisms/Timeline/index.d.ts +2 -0
  183. package/dist/ui/organisms/Toast/Toast.d.ts +8 -0
  184. package/dist/ui/organisms/Toast/Toast.stories.d.ts +14 -0
  185. package/dist/ui/organisms/Toast/Toast.test.d.ts +1 -0
  186. package/dist/ui/organisms/Toast/ToastContainer.d.ts +5 -0
  187. package/dist/ui/organisms/Toast/ToastContext.d.ts +21 -0
  188. package/dist/ui/organisms/Toast/ToastProvider.d.ts +7 -0
  189. package/dist/ui/organisms/Toast/index.d.ts +15 -0
  190. package/dist/ui/organisms/Toast/useToast.d.ts +35 -0
  191. package/dist/ui/organisms/index.d.ts +12 -2
  192. package/dist/ui/providers/AdvancedThemeProvider.d.ts +52 -0
  193. package/dist/ui/providers/index.d.ts +9 -0
  194. package/dist/ui/themes/ThemeBuilder.d.ts +28 -0
  195. package/dist/ui/themes/ThemeRegistry.d.ts +55 -0
  196. package/dist/ui/themes/index.d.ts +9 -0
  197. package/dist/ui/themes/types.d.ts +48 -0
  198. package/dist/ui/themes/utils.d.ts +21 -0
  199. package/dist/ui/tokens/TokenVisualizations.d.ts +41 -0
  200. package/dist/ui/tokens/animations.d.ts +65 -0
  201. package/dist/ui/tokens/borders.d.ts +61 -0
  202. package/dist/ui/tokens/gradients.d.ts +55 -0
  203. package/dist/ui/tokens/index.d.ts +31 -0
  204. package/dist/ui/tokens/opacity.d.ts +51 -0
  205. package/dist/ui/tokens/radius.d.ts +45 -0
  206. package/dist/ui/tokens/shadows.d.ts +42 -0
  207. package/dist/ui/tokens/themes/dark.d.ts +26 -26
  208. package/dist/ui/tokens/themes/light.d.ts +26 -26
  209. package/dist/ui/tokens/tokens.factory.d.ts +42 -0
  210. package/dist/ui/tokens/z-index.d.ts +44 -0
  211. package/dist/ui/utils/index.d.ts +6 -0
  212. package/package.json +50 -6
  213. package/src/docs/Accessibility.mdx +402 -0
  214. package/src/docs/BestPractices.mdx +315 -0
  215. package/src/docs/ComponentComposition.mdx +381 -0
  216. package/src/docs/ComponentStatus.mdx +177 -0
  217. package/src/docs/DesignSystem.mdx +121 -0
  218. package/src/docs/GettingStarted.mdx +284 -0
  219. package/src/docs/MigrationGuide.mdx +297 -0
  220. package/src/docs/Performance.mdx +206 -0
  221. package/src/docs/components/ComponentStatusTable.tsx +184 -0
  222. package/src/setupTests.ts +32 -0
  223. package/src/ui/atoms/Accordion/Accordion.stories.tsx +147 -0
  224. package/src/ui/atoms/Accordion/Accordion.test.tsx +86 -0
  225. package/src/ui/atoms/Accordion/Accordion.tsx +147 -0
  226. package/src/ui/atoms/Accordion/index.ts +2 -0
  227. package/src/ui/atoms/Avatar/Avatar.stories.tsx +226 -0
  228. package/src/ui/atoms/Avatar/Avatar.test.tsx +233 -0
  229. package/src/ui/atoms/Avatar/Avatar.tsx +128 -0
  230. package/src/ui/atoms/Avatar/AvatarGroup.tsx +96 -0
  231. package/src/ui/atoms/Avatar/index.ts +11 -0
  232. package/src/ui/atoms/Badge/Badge.stories.tsx +65 -56
  233. package/src/ui/atoms/Badge/Badge.test.tsx +27 -50
  234. package/src/ui/atoms/Badge/Badge.tsx +70 -27
  235. package/src/ui/atoms/BoxWrapper/BoxWrapper.stories.tsx +1 -1
  236. package/src/ui/atoms/BoxWrapper/BoxWrapper.test.tsx +27 -0
  237. package/src/ui/atoms/BoxWrapper/BoxWrapper.tsx +5 -2
  238. package/src/ui/atoms/Button/Button.stories.tsx +130 -1
  239. package/src/ui/atoms/Button/Button.test.tsx +233 -0
  240. package/src/ui/atoms/Button/Button.tsx +160 -53
  241. package/src/ui/atoms/Checkbox/Checkbox.tsx +14 -1
  242. package/src/ui/atoms/Collapsible/Collapsible.stories.tsx +47 -1
  243. package/src/ui/atoms/Collapsible/Collapsible.test.tsx +36 -24
  244. package/src/ui/atoms/Collapsible/Collapsible.tsx +9 -1
  245. package/src/ui/atoms/ErrorMessage/ErrorMessage.stories.tsx +1 -1
  246. package/src/ui/atoms/Info/Info.stories.tsx +1 -1
  247. package/src/ui/atoms/Info/Info.test.tsx +45 -0
  248. package/src/ui/atoms/Info/Info.tsx +2 -2
  249. package/src/ui/atoms/Input/Input.stories.tsx +80 -0
  250. package/src/ui/atoms/Input/Input.test.tsx +190 -36
  251. package/src/ui/atoms/Input/Input.tsx +144 -25
  252. package/src/ui/atoms/Label/Label.stories.tsx +1 -1
  253. package/src/ui/atoms/NavLink/NavLink.stories.tsx +1 -1
  254. package/src/ui/atoms/Popover/Popover.stories.tsx +157 -0
  255. package/src/ui/atoms/Popover/Popover.test.tsx +80 -0
  256. package/src/ui/atoms/Popover/Popover.tsx +256 -0
  257. package/src/ui/atoms/Popover/index.ts +2 -0
  258. package/src/ui/atoms/Progress/Progress.css +17 -0
  259. package/src/ui/atoms/Progress/Progress.stories.tsx +170 -0
  260. package/src/ui/atoms/Progress/Progress.test.tsx +134 -0
  261. package/src/ui/atoms/Progress/Progress.tsx +138 -0
  262. package/src/ui/atoms/Radio/Radio.tsx +1 -1
  263. package/src/ui/atoms/Select/Select.stories.tsx +93 -58
  264. package/src/ui/atoms/Select/Select.test.tsx +162 -46
  265. package/src/ui/atoms/Select/Select.tsx +142 -44
  266. package/src/ui/atoms/Separator/Separator.stories.tsx +88 -0
  267. package/src/ui/atoms/Separator/Separator.test.tsx +34 -0
  268. package/src/ui/atoms/Separator/Separator.tsx +81 -0
  269. package/src/ui/atoms/Separator/index.ts +2 -0
  270. package/src/ui/atoms/Skeleton/Skeleton.stories.tsx +62 -0
  271. package/src/ui/atoms/Skeleton/Skeleton.tsx +19 -2
  272. package/src/ui/atoms/Slider/Slider.stories.tsx +205 -0
  273. package/src/ui/atoms/Slider/Slider.test.tsx +53 -0
  274. package/src/ui/atoms/Slider/Slider.tsx +307 -0
  275. package/src/ui/atoms/Slider/index.ts +2 -0
  276. package/src/ui/atoms/Spinner/Spinner.stories.tsx +56 -0
  277. package/src/ui/atoms/Spinner/Spinner.test.tsx +35 -0
  278. package/src/ui/atoms/Spinner/Spinner.tsx +88 -0
  279. package/src/ui/atoms/Switch/Switch.stories.tsx +182 -0
  280. package/src/ui/atoms/Switch/Switch.test.tsx +90 -0
  281. package/src/ui/atoms/Switch/Switch.tsx +181 -0
  282. package/src/ui/atoms/Switch/index.ts +2 -0
  283. package/src/ui/atoms/Text/Text.stories.tsx +1 -1
  284. package/src/ui/atoms/Text/Text.test.tsx +48 -32
  285. package/src/ui/atoms/Textarea/Textarea.stories.tsx +1 -1
  286. package/src/ui/atoms/Tooltip/Tooltip.stories.tsx +44 -0
  287. package/src/ui/atoms/Tooltip/Tooltip.tsx +94 -6
  288. package/src/ui/atoms/index.ts +27 -4
  289. package/src/ui/index.ts +6 -1
  290. package/src/ui/molecules/Breadcrumb/Breadcrumb.stories.tsx +1 -1
  291. package/src/ui/molecules/Breadcrumb/Breadcrumb.tsx +1 -1
  292. package/src/ui/molecules/Card/Card.stories.tsx +49 -1
  293. package/src/ui/molecules/Card/Card.tsx +40 -5
  294. package/src/ui/molecules/ColorPicker/ColorPicker.stories.tsx +156 -0
  295. package/src/ui/molecules/ColorPicker/ColorPicker.test.tsx +47 -0
  296. package/src/ui/molecules/ColorPicker/ColorPicker.tsx +271 -0
  297. package/src/ui/molecules/ColorPicker/index.ts +2 -0
  298. package/src/ui/molecules/DatePicker/DatePicker.mdx +150 -0
  299. package/src/ui/molecules/DatePicker/DatePicker.stories.tsx +188 -0
  300. package/src/ui/molecules/DatePicker/DatePicker.test.tsx +381 -0
  301. package/src/ui/molecules/DatePicker/DatePicker.tsx +231 -0
  302. package/src/ui/molecules/DatePicker/DatePickerCalendar.tsx +277 -0
  303. package/src/ui/molecules/DatePicker/DatePickerContext.tsx +39 -0
  304. package/src/ui/molecules/DatePicker/DatePickerInput.tsx +147 -0
  305. package/src/ui/molecules/DatePicker/DatePickerProvider.tsx +100 -0
  306. package/src/ui/molecules/DatePicker/index.ts +16 -0
  307. package/src/ui/molecules/Dropdown/Dropdown.stories.tsx +50 -8
  308. package/src/ui/molecules/Dropdown/Dropdown.test.tsx +272 -12
  309. package/src/ui/molecules/Dropdown/Dropdown.tsx +176 -10
  310. package/src/ui/molecules/EmptyState/EmptyState.stories.tsx +24 -2
  311. package/src/ui/molecules/EmptyState/EmptyState.tsx +9 -3
  312. package/src/ui/molecules/FileUpload/FileUpload.stories.tsx +177 -0
  313. package/src/ui/molecules/FileUpload/FileUpload.test.tsx +114 -0
  314. package/src/ui/molecules/FileUpload/FileUpload.tsx +312 -0
  315. package/src/ui/molecules/FileUpload/index.ts +2 -0
  316. package/src/ui/molecules/Form/Form.mdx +145 -0
  317. package/src/ui/molecules/Form/Form.stories.tsx +121 -1
  318. package/src/ui/molecules/Form/Form.test.tsx +1 -3
  319. package/src/ui/molecules/Form/Form.tsx +95 -15
  320. package/src/ui/molecules/Form/FormContext.tsx +35 -0
  321. package/src/ui/molecules/Form/FormField.tsx +83 -0
  322. package/src/ui/molecules/Form/FormProvider.tsx +34 -0
  323. package/src/ui/molecules/Form/index.ts +21 -0
  324. package/src/ui/molecules/Form/useFormFieldArray.ts +46 -0
  325. package/src/ui/molecules/InputWithLabel/InputWithLabel.stories.tsx +1 -1
  326. package/src/ui/molecules/InputWithLabel/InputWithLabel.test.tsx +44 -0
  327. package/src/ui/molecules/InputWithLabel/InputWithLabel.tsx +3 -1
  328. package/src/ui/molecules/NavbarGroup/NavbarGroup.stories.tsx +1 -1
  329. package/src/ui/molecules/Pagination/Pagination.stories.tsx +1 -1
  330. package/src/ui/molecules/Rating/Rating.stories.tsx +206 -0
  331. package/src/ui/molecules/Rating/Rating.test.tsx +60 -0
  332. package/src/ui/molecules/Rating/Rating.tsx +173 -0
  333. package/src/ui/molecules/Rating/index.ts +2 -0
  334. package/src/ui/molecules/SearchInput/SearchInput.stories.tsx +146 -0
  335. package/src/ui/molecules/SearchInput/SearchInput.test.tsx +82 -0
  336. package/src/ui/molecules/SearchInput/SearchInput.tsx +133 -0
  337. package/src/ui/molecules/SearchInput/index.ts +2 -0
  338. package/src/ui/molecules/Tabs/Tabs.stories.tsx +229 -0
  339. package/src/ui/molecules/Tabs/Tabs.test.tsx +497 -0
  340. package/src/ui/molecules/Tabs/Tabs.tsx +58 -0
  341. package/src/ui/molecules/Tabs/TabsContent.tsx +50 -0
  342. package/src/ui/molecules/Tabs/TabsContext.tsx +36 -0
  343. package/src/ui/molecules/Tabs/TabsList.tsx +98 -0
  344. package/src/ui/molecules/Tabs/TabsProvider.tsx +53 -0
  345. package/src/ui/molecules/Tabs/TabsTrigger.tsx +111 -0
  346. package/src/ui/molecules/Tabs/index.ts +23 -0
  347. package/src/ui/molecules/TimePicker/TimePicker.stories.tsx +145 -0
  348. package/src/ui/molecules/TimePicker/TimePicker.test.tsx +41 -0
  349. package/src/ui/molecules/TimePicker/TimePicker.tsx +264 -0
  350. package/src/ui/molecules/TimePicker/index.ts +2 -0
  351. package/src/ui/molecules/index.ts +20 -7
  352. package/src/ui/organisms/CommandPalette/CommandPalette.stories.tsx +218 -0
  353. package/src/ui/organisms/CommandPalette/CommandPalette.test.tsx +85 -0
  354. package/src/ui/organisms/CommandPalette/CommandPalette.tsx +333 -0
  355. package/src/ui/organisms/CommandPalette/index.ts +2 -0
  356. package/src/ui/organisms/DataGrid/DataGrid.stories.tsx +196 -0
  357. package/src/ui/organisms/DataGrid/DataGrid.test.tsx +53 -0
  358. package/src/ui/organisms/DataGrid/DataGrid.tsx +294 -0
  359. package/src/ui/organisms/DataGrid/index.ts +2 -0
  360. package/src/ui/organisms/Dialog/AlertDialog.tsx +92 -0
  361. package/src/ui/organisms/Dialog/Dialog.mdx +200 -0
  362. package/src/ui/organisms/Dialog/Dialog.stories.tsx +226 -0
  363. package/src/ui/organisms/Dialog/Dialog.test.tsx +435 -0
  364. package/src/ui/organisms/Dialog/Dialog.tsx +79 -0
  365. package/src/ui/organisms/Dialog/DialogClose.tsx +45 -0
  366. package/src/ui/organisms/Dialog/DialogContent.tsx +149 -0
  367. package/src/ui/organisms/Dialog/DialogContext.tsx +25 -0
  368. package/src/ui/organisms/Dialog/DialogDescription.tsx +28 -0
  369. package/src/ui/organisms/Dialog/DialogFooter.tsx +18 -0
  370. package/src/ui/organisms/Dialog/DialogHeader.tsx +18 -0
  371. package/src/ui/organisms/Dialog/DialogProvider.tsx +73 -0
  372. package/src/ui/organisms/Dialog/DialogTitle.tsx +31 -0
  373. package/src/ui/organisms/Dialog/DialogTrigger.tsx +34 -0
  374. package/src/ui/organisms/Dialog/index.ts +24 -0
  375. package/src/ui/organisms/LoginBox/LoginBox.stories.tsx +1 -1
  376. package/src/ui/organisms/Modal/Modal.stories.tsx +2 -2
  377. package/src/ui/organisms/Modal/Modal.test.tsx +1 -1
  378. package/src/ui/organisms/Sidebar/Sidebar.stories.tsx +1 -1
  379. package/src/ui/organisms/Sidebar/Sidebar.test.tsx +5 -3
  380. package/src/ui/organisms/Sidebar/Sidebar.tsx +21 -6
  381. package/src/ui/{molecules → organisms/Sidebar}/SidebarGroup/SidebarGroup.stories.tsx +2 -2
  382. package/src/ui/{molecules → organisms/Sidebar}/SidebarGroup/SidebarGroup.test.tsx +32 -9
  383. package/src/ui/{molecules → organisms/Sidebar}/SidebarGroup/SidebarGroup.tsx +7 -7
  384. package/src/ui/organisms/Sidebar/SidebarHeader/SidebarHeader.test.tsx +66 -0
  385. package/src/ui/{molecules → organisms/Sidebar}/SidebarHeader/SidebarHeader.tsx +1 -2
  386. package/src/ui/{atoms → organisms/Sidebar}/SidebarItem/SidebarItem.stories.tsx +1 -1
  387. package/src/ui/{atoms → organisms/Sidebar}/SidebarItem/SidebarItem.test.tsx +9 -8
  388. package/src/ui/{atoms → organisms/Sidebar}/SidebarItem/SidebarItem.tsx +9 -3
  389. package/src/ui/organisms/Sidebar/index.ts +13 -0
  390. package/src/ui/organisms/Stepper/Stepper.stories.tsx +253 -0
  391. package/src/ui/organisms/Stepper/Stepper.test.tsx +76 -0
  392. package/src/ui/organisms/Stepper/Stepper.tsx +323 -0
  393. package/src/ui/organisms/Stepper/index.ts +2 -0
  394. package/src/ui/organisms/Table/Table.mdx +154 -0
  395. package/src/ui/organisms/Table/Table.stories.tsx +614 -4
  396. package/src/ui/organisms/Table/Table.test.tsx +86 -4
  397. package/src/ui/organisms/Table/Table.tsx +215 -99
  398. package/src/ui/organisms/Table/TableActions/TableActions.stories.tsx +88 -0
  399. package/src/ui/organisms/Table/TableActions/TableActions.test.tsx +64 -0
  400. package/src/ui/organisms/Table/TableActions/TableActions.tsx +71 -0
  401. package/src/ui/organisms/Table/TableActions.tsx +46 -0
  402. package/src/ui/organisms/Table/TableBody.tsx +137 -0
  403. package/src/ui/organisms/Table/TableCell.tsx +36 -0
  404. package/src/ui/organisms/Table/TableContext.tsx +111 -0
  405. package/src/ui/organisms/Table/TableEmptyState.tsx +51 -0
  406. package/src/ui/organisms/Table/TableFilters/TableFilters.stories.tsx +111 -0
  407. package/src/ui/organisms/Table/TableFilters/TableFilters.test.tsx +104 -0
  408. package/src/ui/organisms/Table/TableFilters/TableFilters.tsx +191 -0
  409. package/src/ui/organisms/Table/TableFilters.tsx +39 -0
  410. package/src/ui/organisms/Table/TableHeader.tsx +29 -0
  411. package/src/ui/organisms/Table/TableHeaderCell.tsx +142 -0
  412. package/src/ui/organisms/Table/TableHeaderRow.tsx +72 -0
  413. package/src/ui/organisms/Table/TablePagination/TablePagination.stories.tsx +87 -0
  414. package/src/ui/organisms/Table/TablePagination/TablePagination.test.tsx +90 -0
  415. package/src/ui/organisms/Table/TablePagination/TablePagination.tsx +207 -0
  416. package/src/ui/organisms/Table/TablePagination.tsx +48 -0
  417. package/src/ui/organisms/Table/TableProvider.tsx +429 -0
  418. package/src/ui/organisms/Table/TableRow.tsx +85 -0
  419. package/src/ui/organisms/Table/TableTypes.ts +11 -0
  420. package/src/ui/organisms/Table/index.ts +55 -0
  421. package/src/ui/organisms/Table/useColumnResizing.ts +134 -0
  422. package/src/ui/organisms/Table/useVirtualScrolling.ts +116 -0
  423. package/src/ui/organisms/Timeline/Timeline.stories.tsx +230 -0
  424. package/src/ui/organisms/Timeline/Timeline.test.tsx +47 -0
  425. package/src/ui/organisms/Timeline/Timeline.tsx +179 -0
  426. package/src/ui/organisms/Timeline/index.ts +2 -0
  427. package/src/ui/organisms/Toast/Toast.stories.tsx +169 -0
  428. package/src/ui/organisms/Toast/Toast.test.tsx +537 -0
  429. package/src/ui/organisms/Toast/Toast.tsx +144 -0
  430. package/src/ui/organisms/Toast/ToastContainer.tsx +54 -0
  431. package/src/ui/organisms/Toast/ToastContext.tsx +38 -0
  432. package/src/ui/organisms/Toast/ToastProvider.tsx +56 -0
  433. package/src/ui/organisms/Toast/index.ts +17 -0
  434. package/src/ui/organisms/Toast/useToast.ts +70 -0
  435. package/src/ui/organisms/index.ts +17 -2
  436. package/src/ui/providers/AdvancedThemeProvider.tsx +229 -0
  437. package/src/ui/providers/index.ts +14 -0
  438. package/src/ui/themes/README.md +281 -0
  439. package/src/ui/themes/ThemeBuilder.ts +149 -0
  440. package/src/ui/themes/ThemeRegistry.ts +187 -0
  441. package/src/ui/themes/index.ts +20 -0
  442. package/src/ui/themes/types.ts +53 -0
  443. package/src/ui/themes/utils.ts +70 -0
  444. package/src/ui/tokens/README.md +212 -0
  445. package/src/ui/tokens/TokenVisualizations.tsx +273 -0
  446. package/src/ui/tokens/Tokens.mdx +348 -0
  447. package/src/ui/tokens/animations.ts +157 -0
  448. package/src/ui/tokens/borders.ts +121 -0
  449. package/src/ui/tokens/gradients.ts +154 -0
  450. package/src/ui/tokens/index.ts +57 -0
  451. package/src/ui/tokens/opacity.ts +107 -0
  452. package/src/ui/tokens/radius.ts +107 -0
  453. package/src/ui/tokens/shadows.ts +92 -0
  454. package/src/ui/tokens/tokens.factory.ts +124 -0
  455. package/src/ui/tokens/z-index.ts +113 -0
  456. package/src/ui/utils/index.ts +10 -0
  457. package/src/App.css +0 -42
  458. package/src/App.tsx +0 -35
  459. package/src/index.css +0 -68
  460. package/src/main.tsx +0 -15
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Gradient Tokens
3
+ *
4
+ * Centralized gradient system for consistent color gradients.
5
+ * Uses Factory Pattern for type-safe token creation.
6
+ */
7
+
8
+ import { COLOR_TOKENS_LIGHT } from './colors';
9
+
10
+ export type GradientDirection = 'to-r' | 'to-l' | 'to-t' | 'to-b' | 'to-tr' | 'to-tl' | 'to-br' | 'to-bl';
11
+ export type GradientRole = 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
12
+
13
+ export interface GradientToken {
14
+ value: string;
15
+ tailwind: string;
16
+ description: string;
17
+ from: string;
18
+ via?: string;
19
+ to: string;
20
+ }
21
+
22
+ /**
23
+ * Gradient Token Factory
24
+ * Creates gradient tokens with consistent color schemes
25
+ */
26
+ export class GradientTokenFactory {
27
+ /**
28
+ * Create a gradient token
29
+ */
30
+ static create(
31
+ role: GradientRole,
32
+ direction: GradientDirection = 'to-r'
33
+ ): GradientToken {
34
+ const colorMap: Record<GradientRole, { from: string; via?: string; to: string; description: string }> = {
35
+ primary: {
36
+ from: COLOR_TOKENS_LIGHT.primary.light.hex,
37
+ via: COLOR_TOKENS_LIGHT.primary.DEFAULT.hex,
38
+ to: COLOR_TOKENS_LIGHT.primary.dark.hex,
39
+ description: 'Primary color gradient',
40
+ },
41
+ secondary: {
42
+ from: COLOR_TOKENS_LIGHT.secondary.light.hex,
43
+ via: COLOR_TOKENS_LIGHT.secondary.DEFAULT.hex,
44
+ to: COLOR_TOKENS_LIGHT.secondary.dark.hex,
45
+ description: 'Secondary color gradient',
46
+ },
47
+ success: {
48
+ from: COLOR_TOKENS_LIGHT.success.light.hex,
49
+ to: COLOR_TOKENS_LIGHT.success.dark.hex,
50
+ description: 'Success color gradient',
51
+ },
52
+ error: {
53
+ from: COLOR_TOKENS_LIGHT.error.light.hex,
54
+ to: COLOR_TOKENS_LIGHT.error.dark.hex,
55
+ description: 'Error color gradient',
56
+ },
57
+ info: {
58
+ from: COLOR_TOKENS_LIGHT.info.light.hex,
59
+ to: COLOR_TOKENS_LIGHT.info.dark.hex,
60
+ description: 'Info color gradient',
61
+ },
62
+ warning: {
63
+ from: COLOR_TOKENS_LIGHT.warning.light.hex,
64
+ to: COLOR_TOKENS_LIGHT.warning.dark.hex,
65
+ description: 'Warning color gradient',
66
+ },
67
+ };
68
+
69
+ const colors = colorMap[role];
70
+ const directionMap: Record<GradientDirection, string> = {
71
+ 'to-r': 'to right',
72
+ 'to-l': 'to left',
73
+ 'to-t': 'to top',
74
+ 'to-b': 'to bottom',
75
+ 'to-tr': 'to top right',
76
+ 'to-tl': 'to top left',
77
+ 'to-br': 'to bottom right',
78
+ 'to-bl': 'to bottom left',
79
+ };
80
+
81
+ // Build CSS gradient value
82
+ let gradientValue = `linear-gradient(${directionMap[direction]}, ${colors.from}`;
83
+ if (colors.via) {
84
+ gradientValue += `, ${colors.via}`;
85
+ }
86
+ gradientValue += `, ${colors.to})`;
87
+
88
+ // Build Tailwind classes
89
+ const tailwindParts: string[] = [];
90
+
91
+ // Direction class
92
+ tailwindParts.push(`bg-gradient-${direction.replace('to-', '')}`);
93
+
94
+ // Color classes (using from-*, via-*, to-* syntax)
95
+ // Note: We'll use arbitrary values for custom colors
96
+ tailwindParts.push(`from-[${colors.from}]`);
97
+ if (colors.via) {
98
+ tailwindParts.push(`via-[${colors.via}]`);
99
+ }
100
+ tailwindParts.push(`to-[${colors.to}]`);
101
+
102
+ return {
103
+ value: gradientValue,
104
+ tailwind: tailwindParts.join(' '),
105
+ description: colors.description,
106
+ from: colors.from,
107
+ via: colors.via,
108
+ to: colors.to,
109
+ };
110
+ }
111
+
112
+ /**
113
+ * Convert hex color to approximate Tailwind color class
114
+ * This is a helper for documentation, actual implementation uses arbitrary values
115
+ */
116
+ private static hexToTailwindColor(hex: string): string {
117
+ // This is a simplified mapping for documentation purposes
118
+ // In practice, we use arbitrary values like from-[#hex]
119
+ return hex;
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Pre-defined gradient tokens
125
+ */
126
+ export const GRADIENT_TOKENS = {
127
+ primary: GradientTokenFactory.create('primary'),
128
+ secondary: GradientTokenFactory.create('secondary'),
129
+ success: GradientTokenFactory.create('success'),
130
+ error: GradientTokenFactory.create('error'),
131
+ info: GradientTokenFactory.create('info'),
132
+ warning: GradientTokenFactory.create('warning'),
133
+
134
+ // Common directions
135
+ 'primary-to-r': GradientTokenFactory.create('primary', 'to-r'),
136
+ 'primary-to-b': GradientTokenFactory.create('primary', 'to-b'),
137
+ 'secondary-to-r': GradientTokenFactory.create('secondary', 'to-r'),
138
+ 'success-to-r': GradientTokenFactory.create('success', 'to-r'),
139
+ 'error-to-r': GradientTokenFactory.create('error', 'to-r'),
140
+ } as const;
141
+
142
+ /**
143
+ * Helper function to get gradient token
144
+ */
145
+ export function getGradient(role: GradientRole, direction?: GradientDirection): GradientToken {
146
+ return GradientTokenFactory.create(role, direction);
147
+ }
148
+
149
+ /**
150
+ * Helper function to get gradient as Tailwind classes
151
+ */
152
+ export function getGradientClass(role: GradientRole, direction: GradientDirection = 'to-r'): string {
153
+ return GradientTokenFactory.create(role, direction).tailwind;
154
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Design Tokens Index
3
+ *
4
+ * Centralized exports for all design tokens.
5
+ */
6
+
7
+ // Colors
8
+ export * from './colors';
9
+ export { COLOR_TOKENS, COLOR_TOKENS_LIGHT, COLOR_TOKENS_DARK, getColor, getColorClass } from './colors';
10
+
11
+ // Spacing
12
+ export * from './spacing';
13
+ export { SPACING_TOKENS, getSpacing, getSpacingClass } from './spacing';
14
+
15
+ // Typography
16
+ export * from './typography';
17
+ export { TYPOGRAPHY_TOKENS, FONT_FAMILY_TOKENS, FONT_WEIGHT_TOKENS, getTypography, getTypographyClasses } from './typography';
18
+
19
+ // Shadows
20
+ export * from './shadows';
21
+ export { SHADOW_TOKENS, getShadow, getShadowClass } from './shadows';
22
+
23
+ // Radius
24
+ export * from './radius';
25
+ export { RADIUS_TOKENS, getRadius, getRadiusClass } from './radius';
26
+
27
+ // Borders
28
+ export * from './borders';
29
+ export { BORDER_TOKENS, getBorder, getBorderWidthClass, getBorderStyleClass, getBorderClasses } from './borders';
30
+
31
+ // Breakpoints
32
+ export * from './breakpoints';
33
+ export { BREAKPOINT_TOKENS, getBreakpoint, getMediaQuery } from './breakpoints';
34
+
35
+ // Animations
36
+ export * from './animations';
37
+ export { ANIMATION_TOKENS, getAnimation, getAnimationClass, getTransitionClass } from './animations';
38
+
39
+ // Z-Index
40
+ export * from './z-index';
41
+ export { Z_INDEX_TOKENS, getZIndex, getZIndexClass } from './z-index';
42
+
43
+ // Opacity
44
+ export * from './opacity';
45
+ export { OPACITY_TOKENS, getOpacity, getOpacityClass } from './opacity';
46
+
47
+ // Gradients
48
+ export * from './gradients';
49
+ export { GRADIENT_TOKENS, getGradient, getGradientClass } from './gradients';
50
+
51
+ // Sidebar (specific tokens)
52
+ export * from './sidebar';
53
+ export { SIDEBAR_TOKENS, getNestedIndentClass } from './sidebar';
54
+
55
+ // Tokens Factory
56
+ export * from './tokens.factory';
57
+ export { TokensFactory, defaultTokensFactory, createTokenSet } from './tokens.factory';
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Opacity Tokens
3
+ *
4
+ * Centralized opacity system for consistent transparency values.
5
+ * Uses Factory Pattern for type-safe token creation.
6
+ */
7
+
8
+ export type OpacityValue = 0 | 5 | 10 | 20 | 25 | 30 | 40 | 50 | 60 | 70 | 75 | 80 | 90 | 95 | 100;
9
+
10
+ export interface OpacityToken {
11
+ value: OpacityValue;
12
+ decimal: number;
13
+ tailwind: string;
14
+ description: string;
15
+ }
16
+
17
+ /**
18
+ * Opacity Token Factory
19
+ * Creates opacity tokens with consistent values
20
+ */
21
+ export class OpacityTokenFactory {
22
+ /**
23
+ * Create an opacity token
24
+ */
25
+ static create(value: OpacityValue): OpacityToken {
26
+ const decimal = value / 100;
27
+
28
+ const descriptionMap: Record<OpacityValue, string> = {
29
+ 0: 'Fully transparent',
30
+ 5: 'Very light overlay',
31
+ 10: 'Light overlay',
32
+ 20: 'Subtle overlay',
33
+ 25: 'Quarter opacity',
34
+ 30: 'Light background',
35
+ 40: 'Semi-transparent',
36
+ 50: 'Half opacity',
37
+ 60: 'Semi-opaque',
38
+ 70: 'Mostly opaque',
39
+ 75: 'Three-quarter opacity',
40
+ 80: 'High opacity',
41
+ 90: 'Very high opacity',
42
+ 95: 'Nearly opaque',
43
+ 100: 'Fully opaque',
44
+ };
45
+
46
+ // Map to Tailwind classes
47
+ const tailwindMap: Record<OpacityValue, string> = {
48
+ 0: 'opacity-0',
49
+ 5: 'opacity-5',
50
+ 10: 'opacity-10',
51
+ 20: 'opacity-20',
52
+ 25: 'opacity-25',
53
+ 30: 'opacity-30',
54
+ 40: 'opacity-40',
55
+ 50: 'opacity-50',
56
+ 60: 'opacity-60',
57
+ 70: 'opacity-70',
58
+ 75: 'opacity-75',
59
+ 80: 'opacity-80',
60
+ 90: 'opacity-90',
61
+ 95: 'opacity-95',
62
+ 100: 'opacity-100',
63
+ };
64
+
65
+ return {
66
+ value,
67
+ decimal,
68
+ tailwind: tailwindMap[value],
69
+ description: descriptionMap[value],
70
+ };
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Pre-defined opacity tokens
76
+ */
77
+ export const OPACITY_TOKENS = {
78
+ transparent: OpacityTokenFactory.create(0),
79
+ '5': OpacityTokenFactory.create(5),
80
+ '10': OpacityTokenFactory.create(10),
81
+ '20': OpacityTokenFactory.create(20),
82
+ '25': OpacityTokenFactory.create(25),
83
+ '30': OpacityTokenFactory.create(30),
84
+ '40': OpacityTokenFactory.create(40),
85
+ '50': OpacityTokenFactory.create(50),
86
+ '60': OpacityTokenFactory.create(60),
87
+ '70': OpacityTokenFactory.create(70),
88
+ '75': OpacityTokenFactory.create(75),
89
+ '80': OpacityTokenFactory.create(80),
90
+ '90': OpacityTokenFactory.create(90),
91
+ '95': OpacityTokenFactory.create(95),
92
+ opaque: OpacityTokenFactory.create(100),
93
+ } as const;
94
+
95
+ /**
96
+ * Helper function to get opacity token
97
+ */
98
+ export function getOpacity(value: OpacityValue): OpacityToken {
99
+ return OpacityTokenFactory.create(value);
100
+ }
101
+
102
+ /**
103
+ * Helper function to get opacity as Tailwind class
104
+ */
105
+ export function getOpacityClass(value: OpacityValue): string {
106
+ return OpacityTokenFactory.create(value).tailwind;
107
+ }
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Border Radius Tokens
3
+ *
4
+ * Centralized border radius system for consistent rounded corners.
5
+ * Uses Factory Pattern for type-safe token creation.
6
+ */
7
+
8
+ export type RadiusSize = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';
9
+
10
+ export interface RadiusToken {
11
+ value: number;
12
+ rem: string;
13
+ px: string;
14
+ tailwind: string;
15
+ description: string;
16
+ }
17
+
18
+ /**
19
+ * Radius Token Factory
20
+ * Creates radius tokens with consistent values
21
+ */
22
+ export class RadiusTokenFactory {
23
+ /**
24
+ * Create a radius token
25
+ */
26
+ static create(size: RadiusSize): RadiusToken {
27
+ const radiusMap: Record<RadiusSize, { px: number; tailwind: string; description: string }> = {
28
+ none: {
29
+ px: 0,
30
+ tailwind: 'rounded-none',
31
+ description: 'No border radius',
32
+ },
33
+ sm: {
34
+ px: 2,
35
+ tailwind: 'rounded-sm',
36
+ description: 'Small radius (2px) for subtle rounding',
37
+ },
38
+ md: {
39
+ px: 6,
40
+ tailwind: 'rounded-md',
41
+ description: 'Medium radius (6px) for buttons and inputs',
42
+ },
43
+ lg: {
44
+ px: 8,
45
+ tailwind: 'rounded-lg',
46
+ description: 'Large radius (8px) for cards and containers',
47
+ },
48
+ xl: {
49
+ px: 12,
50
+ tailwind: 'rounded-xl',
51
+ description: 'Extra large radius (12px) for prominent elements',
52
+ },
53
+ '2xl': {
54
+ px: 16,
55
+ tailwind: 'rounded-2xl',
56
+ description: '2X large radius (16px) for large containers',
57
+ },
58
+ '3xl': {
59
+ px: 24,
60
+ tailwind: 'rounded-3xl',
61
+ description: '3X large radius (24px) for very large containers',
62
+ },
63
+ full: {
64
+ px: 9999,
65
+ tailwind: 'rounded-full',
66
+ description: 'Full radius for circular elements',
67
+ },
68
+ };
69
+
70
+ const config = radiusMap[size];
71
+ return {
72
+ value: config.px,
73
+ rem: `${config.px / 16}rem`,
74
+ px: `${config.px}px`,
75
+ tailwind: config.tailwind,
76
+ description: config.description,
77
+ };
78
+ }
79
+ }
80
+
81
+ /**
82
+ * Pre-defined radius tokens
83
+ */
84
+ export const RADIUS_TOKENS = {
85
+ none: RadiusTokenFactory.create('none'),
86
+ sm: RadiusTokenFactory.create('sm'),
87
+ md: RadiusTokenFactory.create('md'),
88
+ lg: RadiusTokenFactory.create('lg'),
89
+ xl: RadiusTokenFactory.create('xl'),
90
+ '2xl': RadiusTokenFactory.create('2xl'),
91
+ '3xl': RadiusTokenFactory.create('3xl'),
92
+ full: RadiusTokenFactory.create('full'),
93
+ } as const;
94
+
95
+ /**
96
+ * Helper function to get radius token
97
+ */
98
+ export function getRadius(size: keyof typeof RADIUS_TOKENS): RadiusToken {
99
+ return RADIUS_TOKENS[size];
100
+ }
101
+
102
+ /**
103
+ * Helper function to get radius as Tailwind class
104
+ */
105
+ export function getRadiusClass(size: keyof typeof RADIUS_TOKENS): string {
106
+ return RADIUS_TOKENS[size].tailwind;
107
+ }
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Shadow Tokens
3
+ *
4
+ * Centralized shadow system for consistent elevation and depth.
5
+ * Uses Factory Pattern for type-safe token creation.
6
+ */
7
+
8
+ export type ShadowSize = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'inner';
9
+
10
+ export interface ShadowToken {
11
+ value: string;
12
+ tailwind: string;
13
+ description: string;
14
+ }
15
+
16
+ /**
17
+ * Shadow Token Factory
18
+ * Creates shadow tokens with consistent values
19
+ */
20
+ export class ShadowTokenFactory {
21
+ /**
22
+ * Create a shadow token
23
+ */
24
+ static create(size: ShadowSize): ShadowToken {
25
+ const shadowMap: Record<ShadowSize, { value: string; tailwind: string; description: string }> = {
26
+ none: {
27
+ value: 'none',
28
+ tailwind: 'shadow-none',
29
+ description: 'No shadow',
30
+ },
31
+ sm: {
32
+ value: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
33
+ tailwind: 'shadow-sm',
34
+ description: 'Small shadow for subtle elevation',
35
+ },
36
+ md: {
37
+ value: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',
38
+ tailwind: 'shadow-md',
39
+ description: 'Medium shadow for cards and elevated elements',
40
+ },
41
+ lg: {
42
+ value: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
43
+ tailwind: 'shadow-lg',
44
+ description: 'Large shadow for modals and dropdowns',
45
+ },
46
+ xl: {
47
+ value: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
48
+ tailwind: 'shadow-xl',
49
+ description: 'Extra large shadow for prominent modals',
50
+ },
51
+ '2xl': {
52
+ value: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',
53
+ tailwind: 'shadow-2xl',
54
+ description: '2X large shadow for maximum elevation',
55
+ },
56
+ inner: {
57
+ value: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',
58
+ tailwind: 'shadow-inner',
59
+ description: 'Inner shadow for inset elements',
60
+ },
61
+ };
62
+
63
+ return shadowMap[size];
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Pre-defined shadow tokens
69
+ */
70
+ export const SHADOW_TOKENS = {
71
+ none: ShadowTokenFactory.create('none'),
72
+ sm: ShadowTokenFactory.create('sm'),
73
+ md: ShadowTokenFactory.create('md'),
74
+ lg: ShadowTokenFactory.create('lg'),
75
+ xl: ShadowTokenFactory.create('xl'),
76
+ '2xl': ShadowTokenFactory.create('2xl'),
77
+ inner: ShadowTokenFactory.create('inner'),
78
+ } as const;
79
+
80
+ /**
81
+ * Helper function to get shadow token
82
+ */
83
+ export function getShadow(size: keyof typeof SHADOW_TOKENS): ShadowToken {
84
+ return SHADOW_TOKENS[size];
85
+ }
86
+
87
+ /**
88
+ * Helper function to get shadow as Tailwind class
89
+ */
90
+ export function getShadowClass(size: keyof typeof SHADOW_TOKENS): string {
91
+ return SHADOW_TOKENS[size].tailwind;
92
+ }
@@ -9,6 +9,13 @@ import { SpacingTokenFactory, type SpacingScale, type SpacingToken } from './spa
9
9
  import { TypographyTokenFactory, type TypographyToken, type FontSize, type LineHeight, type FontWeight } from './typography';
10
10
  import { ColorTokenFactory, type ColorRole, type SemanticColor, LightColorStrategy, DarkColorStrategy } from './colors';
11
11
  import { BreakpointTokenFactory, type BreakpointName, type BreakpointToken } from './breakpoints';
12
+ import { ShadowTokenFactory, type ShadowSize, type ShadowToken } from './shadows';
13
+ import { RadiusTokenFactory, type RadiusSize, type RadiusToken } from './radius';
14
+ import { BorderTokenFactory, type BorderWidth, type BorderToken } from './borders';
15
+ import { AnimationTokenFactory, type AnimationDuration, type EasingFunction, type AnimationToken } from './animations';
16
+ import { ZIndexTokenFactory, type ZIndexLayer, type ZIndexToken } from './z-index';
17
+ import { OpacityTokenFactory, type OpacityValue, type OpacityToken } from './opacity';
18
+ import { GradientTokenFactory, type GradientRole, type GradientDirection, type GradientToken } from './gradients';
12
19
 
13
20
  export type ThemeMode = 'light' | 'dark';
14
21
 
@@ -17,6 +24,13 @@ export interface TokenSet {
17
24
  typography: Record<string, TypographyToken>;
18
25
  colors: Record<ColorRole, SemanticColor>;
19
26
  breakpoints: Record<BreakpointName, BreakpointToken>;
27
+ shadows: Record<string, ShadowToken>;
28
+ radius: Record<string, RadiusToken>;
29
+ borders: Record<string, BorderToken>;
30
+ animations: Record<string, AnimationToken>;
31
+ zIndex: Record<string, ZIndexToken>;
32
+ opacity: Record<string, OpacityToken>;
33
+ gradients: Record<string, GradientToken>;
20
34
  }
21
35
 
22
36
  /**
@@ -59,6 +73,55 @@ export class TokensFactory {
59
73
  return BreakpointTokenFactory.create(name);
60
74
  }
61
75
 
76
+ /**
77
+ * Create shadow token
78
+ */
79
+ createShadow(size: ShadowSize): ShadowToken {
80
+ return ShadowTokenFactory.create(size);
81
+ }
82
+
83
+ /**
84
+ * Create radius token
85
+ */
86
+ createRadius(size: RadiusSize): RadiusToken {
87
+ return RadiusTokenFactory.create(size);
88
+ }
89
+
90
+ /**
91
+ * Create border token
92
+ */
93
+ createBorder(width: BorderWidth): BorderToken {
94
+ return BorderTokenFactory.create(width);
95
+ }
96
+
97
+ /**
98
+ * Create animation token
99
+ */
100
+ createAnimation(duration: AnimationDuration, easing?: EasingFunction): AnimationToken {
101
+ return AnimationTokenFactory.create(duration, easing);
102
+ }
103
+
104
+ /**
105
+ * Create z-index token
106
+ */
107
+ createZIndex(layer: ZIndexLayer): ZIndexToken {
108
+ return ZIndexTokenFactory.create(layer);
109
+ }
110
+
111
+ /**
112
+ * Create opacity token
113
+ */
114
+ createOpacity(value: OpacityValue): OpacityToken {
115
+ return OpacityTokenFactory.create(value);
116
+ }
117
+
118
+ /**
119
+ * Create gradient token
120
+ */
121
+ createGradient(role: GradientRole, direction?: GradientDirection): GradientToken {
122
+ return GradientTokenFactory.create(role, direction);
123
+ }
124
+
62
125
  /**
63
126
  * Create complete token set for a theme
64
127
  */
@@ -91,6 +154,67 @@ export class TokensFactory {
91
154
  xl: this.createBreakpoint('xl'),
92
155
  '2xl': this.createBreakpoint('2xl'),
93
156
  },
157
+ shadows: {
158
+ none: this.createShadow('none'),
159
+ sm: this.createShadow('sm'),
160
+ md: this.createShadow('md'),
161
+ lg: this.createShadow('lg'),
162
+ xl: this.createShadow('xl'),
163
+ '2xl': this.createShadow('2xl'),
164
+ inner: this.createShadow('inner'),
165
+ },
166
+ radius: {
167
+ none: this.createRadius('none'),
168
+ sm: this.createRadius('sm'),
169
+ md: this.createRadius('md'),
170
+ lg: this.createRadius('lg'),
171
+ xl: this.createRadius('xl'),
172
+ '2xl': this.createRadius('2xl'),
173
+ '3xl': this.createRadius('3xl'),
174
+ full: this.createRadius('full'),
175
+ },
176
+ borders: {
177
+ none: this.createBorder('none'),
178
+ thin: this.createBorder('thin'),
179
+ base: this.createBorder('base'),
180
+ medium: this.createBorder('medium'),
181
+ thick: this.createBorder('thick'),
182
+ },
183
+ animations: {
184
+ fast: this.createAnimation('fast'),
185
+ base: this.createAnimation('base'),
186
+ slow: this.createAnimation('slow'),
187
+ slower: this.createAnimation('slower'),
188
+ },
189
+ zIndex: {
190
+ base: this.createZIndex('base'),
191
+ dropdown: this.createZIndex('dropdown'),
192
+ sticky: this.createZIndex('sticky'),
193
+ fixed: this.createZIndex('fixed'),
194
+ 'modal-backdrop': this.createZIndex('modal-backdrop'),
195
+ modal: this.createZIndex('modal'),
196
+ popover: this.createZIndex('popover'),
197
+ tooltip: this.createZIndex('tooltip'),
198
+ toast: this.createZIndex('toast'),
199
+ },
200
+ opacity: {
201
+ transparent: this.createOpacity(0),
202
+ '5': this.createOpacity(5),
203
+ '10': this.createOpacity(10),
204
+ '25': this.createOpacity(25),
205
+ '50': this.createOpacity(50),
206
+ '75': this.createOpacity(75),
207
+ '90': this.createOpacity(90),
208
+ opaque: this.createOpacity(100),
209
+ },
210
+ gradients: {
211
+ primary: this.createGradient('primary'),
212
+ secondary: this.createGradient('secondary'),
213
+ success: this.createGradient('success'),
214
+ error: this.createGradient('error'),
215
+ info: this.createGradient('info'),
216
+ warning: this.createGradient('warning'),
217
+ },
94
218
  };
95
219
  }
96
220