@shohojdhara/atomix 0.3.14 → 0.4.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 (343) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/build-tools/EXAMPLES.md +372 -0
  3. package/build-tools/README.md +242 -0
  4. package/build-tools/__tests__/error-handler.test.js +230 -0
  5. package/build-tools/__tests__/index.test.js +141 -0
  6. package/build-tools/__tests__/rollup-plugin.test.js +194 -0
  7. package/build-tools/__tests__/utils.test.js +161 -0
  8. package/build-tools/__tests__/vite-plugin.test.js +129 -0
  9. package/build-tools/__tests__/webpack-loader.test.js +190 -0
  10. package/build-tools/error-handler.js +308 -0
  11. package/build-tools/index.d.ts +44 -0
  12. package/build-tools/index.js +88 -0
  13. package/build-tools/package.json +50 -0
  14. package/build-tools/rollup-plugin.js +236 -0
  15. package/build-tools/types.d.ts +163 -0
  16. package/build-tools/utils.js +203 -0
  17. package/build-tools/vite-plugin.js +161 -0
  18. package/build-tools/webpack-loader.js +123 -0
  19. package/dist/atomix.css +21044 -2618
  20. package/dist/atomix.css.map +1 -1
  21. package/dist/atomix.min.css +77 -3
  22. package/dist/atomix.min.css.map +1 -1
  23. package/dist/build-tools/EXAMPLES.md +372 -0
  24. package/dist/build-tools/README.md +242 -0
  25. package/dist/build-tools/__tests__/error-handler.test.js +230 -0
  26. package/dist/build-tools/__tests__/index.test.js +141 -0
  27. package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
  28. package/dist/build-tools/__tests__/utils.test.js +161 -0
  29. package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
  30. package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
  31. package/dist/build-tools/error-handler.js +308 -0
  32. package/dist/build-tools/index.d.ts +44 -0
  33. package/dist/build-tools/index.js +88 -0
  34. package/dist/build-tools/package.json +50 -0
  35. package/dist/build-tools/rollup-plugin.js +236 -0
  36. package/dist/build-tools/types.d.ts +163 -0
  37. package/dist/build-tools/utils.js +203 -0
  38. package/dist/build-tools/vite-plugin.js +161 -0
  39. package/dist/build-tools/webpack-loader.js +123 -0
  40. package/dist/charts.d.ts +1 -1
  41. package/dist/charts.js +86 -57
  42. package/dist/charts.js.map +1 -1
  43. package/dist/core.d.ts +1 -1
  44. package/dist/core.js +136 -112
  45. package/dist/core.js.map +1 -1
  46. package/dist/forms.d.ts +2 -5
  47. package/dist/forms.js +140 -128
  48. package/dist/forms.js.map +1 -1
  49. package/dist/heavy.d.ts +1 -1
  50. package/dist/heavy.js +136 -112
  51. package/dist/heavy.js.map +1 -1
  52. package/dist/index.d.ts +152 -78
  53. package/dist/index.esm.js +346 -340
  54. package/dist/index.esm.js.map +1 -1
  55. package/dist/index.js +359 -353
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.min.js +1 -1
  58. package/dist/index.min.js.map +1 -1
  59. package/dist/layout.js.map +1 -1
  60. package/dist/theme.d.ts +9 -9
  61. package/dist/theme.js.map +1 -1
  62. package/package.json +23 -8
  63. package/scripts/atomix-cli.js +170 -73
  64. package/scripts/cli/__tests__/README.md +81 -0
  65. package/scripts/cli/__tests__/basic.test.js +115 -0
  66. package/scripts/cli/__tests__/component-generator.test.js +332 -0
  67. package/scripts/cli/__tests__/integration.test.js +327 -0
  68. package/scripts/cli/__tests__/test-setup.js +133 -0
  69. package/scripts/cli/__tests__/token-manager.test.js +251 -0
  70. package/scripts/cli/__tests__/utils.test.js +161 -0
  71. package/scripts/cli/component-generator.js +253 -299
  72. package/scripts/cli/dependency-checker.js +355 -0
  73. package/scripts/cli/interactive-init.js +46 -5
  74. package/scripts/cli/template-manager.js +0 -2
  75. package/scripts/cli/templates/common-templates.js +636 -0
  76. package/scripts/cli/templates/composable-templates.js +148 -126
  77. package/scripts/cli/templates/index.js +23 -16
  78. package/scripts/cli/templates/project-templates.js +151 -23
  79. package/scripts/cli/templates/react-templates.js +280 -210
  80. package/scripts/cli/templates/scss-templates.js +90 -91
  81. package/scripts/cli/templates/testing-templates.js +206 -27
  82. package/scripts/cli/templates/testing-utils.js +278 -0
  83. package/scripts/cli/templates/types-templates.js +70 -56
  84. package/scripts/cli/theme-bridge.js +8 -2
  85. package/scripts/cli/token-manager.js +318 -206
  86. package/scripts/cli/utils.js +0 -1
  87. package/src/components/Accordion/Accordion.stories.tsx +358 -850
  88. package/src/components/Accordion/Accordion.test.tsx +70 -50
  89. package/src/components/Accordion/Accordion.tsx +99 -94
  90. package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
  91. package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
  92. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
  93. package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
  94. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
  95. package/src/components/AtomixGlass/glass-utils.ts +6 -5
  96. package/src/components/AtomixGlass/shader-utils.ts +133 -52
  97. package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
  98. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
  99. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
  100. package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
  101. package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
  102. package/src/components/AtomixGlass/stories/Playground.stories.tsx +51 -36
  103. package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +2 -2
  104. package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
  105. package/src/components/Avatar/Avatar.stories.tsx +195 -0
  106. package/src/components/Avatar/Avatar.tsx +58 -56
  107. package/src/components/Badge/Badge.stories.tsx +122 -352
  108. package/src/components/Badge/Badge.test.tsx +41 -41
  109. package/src/components/Badge/Badge.tsx +64 -62
  110. package/src/components/Block/Block.stories.tsx +30 -11
  111. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +142 -23
  112. package/src/components/Breadcrumb/Breadcrumb.tsx +62 -60
  113. package/src/components/Button/Button.stories.tsx +454 -1126
  114. package/src/components/Button/Button.test.tsx +123 -0
  115. package/src/components/Button/Button.tsx +88 -60
  116. package/src/components/Button/ButtonGroup.stories.tsx +376 -215
  117. package/src/components/Button/ButtonGroup.tsx +4 -15
  118. package/src/components/Callout/Callout.stories.tsx +316 -568
  119. package/src/components/Card/Card.stories.tsx +292 -81
  120. package/src/components/Card/Card.tsx +30 -14
  121. package/src/components/Chart/AreaChart.tsx +1 -1
  122. package/src/components/Chart/CandlestickChart.tsx +23 -16
  123. package/src/components/Chart/Chart.stories.tsx +153 -16
  124. package/src/components/Chart/Chart.tsx +40 -44
  125. package/src/components/Chart/ChartRenderer.tsx +39 -12
  126. package/src/components/Chart/ChartToolbar.tsx +21 -5
  127. package/src/components/Chart/DonutChart.tsx +1 -1
  128. package/src/components/Chart/FunnelChart.tsx +4 -1
  129. package/src/components/Chart/GaugeChart.tsx +3 -1
  130. package/src/components/Chart/HeatmapChart.tsx +50 -37
  131. package/src/components/Chart/LineChart.tsx +3 -2
  132. package/src/components/Chart/MultiAxisChart.tsx +24 -16
  133. package/src/components/Chart/RadarChart.tsx +19 -17
  134. package/src/components/Chart/ScatterChart.tsx +29 -21
  135. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +152 -66
  136. package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
  137. package/src/components/Countdown/Countdown.stories.tsx +114 -7
  138. package/src/components/DataTable/DataTable.stories.tsx +349 -144
  139. package/src/components/DataTable/DataTable.test.tsx +26 -148
  140. package/src/components/DataTable/DataTable.tsx +485 -456
  141. package/src/components/DatePicker/DatePicker.stories.tsx +310 -1066
  142. package/src/components/DatePicker/DatePicker.tsx +31 -26
  143. package/src/components/Dropdown/Dropdown.stories.tsx +153 -36
  144. package/src/components/Dropdown/Dropdown.tsx +313 -299
  145. package/src/components/EdgePanel/EdgePanel.stories.tsx +221 -25
  146. package/src/components/EdgePanel/EdgePanel.tsx +1 -3
  147. package/src/components/Footer/Footer.stories.tsx +396 -327
  148. package/src/components/Footer/Footer.tsx +130 -128
  149. package/src/components/Footer/FooterLink.tsx +2 -2
  150. package/src/components/Form/Checkbox.stories.tsx +140 -6
  151. package/src/components/Form/Checkbox.test.tsx +63 -0
  152. package/src/components/Form/Checkbox.tsx +122 -78
  153. package/src/components/Form/Form.stories.tsx +110 -19
  154. package/src/components/Form/FormGroup.stories.tsx +127 -4
  155. package/src/components/Form/Input.stories.tsx +22 -39
  156. package/src/components/Form/Input.test.tsx +38 -44
  157. package/src/components/Form/Radio.stories.tsx +146 -17
  158. package/src/components/Form/Radio.tsx +68 -66
  159. package/src/components/Form/Select.stories.tsx +140 -8
  160. package/src/components/Form/Select.tsx +184 -182
  161. package/src/components/Form/Textarea.stories.tsx +149 -6
  162. package/src/components/Form/Textarea.test.tsx +27 -32
  163. package/src/components/Hero/Hero.stories.tsx +372 -38
  164. package/src/components/Hero/Hero.tsx +201 -55
  165. package/src/components/Icon/index.ts +7 -1
  166. package/src/components/List/List.stories.tsx +141 -3
  167. package/src/components/List/List.tsx +19 -23
  168. package/src/components/Modal/Modal.stories.tsx +183 -43
  169. package/src/components/Modal/Modal.tsx +130 -127
  170. package/src/components/Navigation/Menu/MegaMenu.tsx +70 -70
  171. package/src/components/Navigation/Nav/NavDropdown.tsx +1 -5
  172. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +128 -28
  173. package/src/components/Navigation/SideMenu/SideMenu.tsx +5 -7
  174. package/src/components/Navigation/SideMenu/SideMenuItem.tsx +4 -5
  175. package/src/components/Pagination/Pagination.stories.tsx +7 -4
  176. package/src/components/Pagination/Pagination.tsx +199 -202
  177. package/src/components/PhotoViewer/PhotoViewer.tsx +4 -1
  178. package/src/components/Popover/Popover.stories.tsx +354 -97
  179. package/src/components/Popover/Popover.tsx +41 -37
  180. package/src/components/Progress/Progress.stories.tsx +160 -7
  181. package/src/components/River/River.stories.tsx +3 -2
  182. package/src/components/SectionIntro/SectionIntro.stories.tsx +239 -47
  183. package/src/components/Slider/Slider.stories.tsx +12 -4
  184. package/src/components/Spinner/Spinner.stories.tsx +104 -8
  185. package/src/components/Spinner/Spinner.test.tsx +23 -23
  186. package/src/components/Spinner/Spinner.tsx +43 -46
  187. package/src/components/Steps/Steps.stories.tsx +173 -42
  188. package/src/components/Tabs/Tabs.stories.tsx +141 -12
  189. package/src/components/Tabs/Tabs.tsx +74 -72
  190. package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
  191. package/src/components/Todo/Todo.stories.tsx +198 -9
  192. package/src/components/Toggle/Toggle.stories.tsx +137 -36
  193. package/src/components/Toggle/Toggle.test.tsx +65 -70
  194. package/src/components/Toggle/Toggle.tsx +4 -1
  195. package/src/components/Tooltip/Tooltip.stories.tsx +194 -100
  196. package/src/components/Tooltip/Tooltip.tsx +104 -106
  197. package/src/components/Upload/Upload.stories.tsx +241 -150
  198. package/src/components/Upload/Upload.tsx +287 -283
  199. package/src/components/VideoPlayer/VideoPlayer.tsx +6 -1
  200. package/src/components/index.ts +13 -2
  201. package/src/layouts/Grid/Grid.stories.tsx +9 -3
  202. package/src/layouts/MasonryGrid/MasonryGrid.tsx +5 -1
  203. package/src/lib/README.md +2 -2
  204. package/src/lib/__tests__/theme-tools.test.ts +219 -0
  205. package/src/lib/composables/index.ts +2 -2
  206. package/src/lib/composables/shared-mouse-tracker.ts +13 -14
  207. package/src/lib/composables/useAtomixGlass.ts +126 -97
  208. package/src/lib/composables/useChartExport.ts +3 -8
  209. package/src/lib/composables/useDataTable.ts +72 -43
  210. package/src/lib/composables/useHero.ts +58 -14
  211. package/src/lib/composables/useHeroBackgroundSlider.ts +2 -9
  212. package/src/lib/composables/useInput.ts +10 -8
  213. package/src/lib/composables/useSideMenu.ts +6 -5
  214. package/src/lib/composables/useTooltip.ts +1 -2
  215. package/src/lib/composables/useVideoPlayer.ts +44 -35
  216. package/src/lib/config/index.ts +154 -154
  217. package/src/lib/constants/components.ts +9 -32
  218. package/src/lib/constants/cssVariables.ts +29 -29
  219. package/src/lib/hooks/__tests__/useComponentCustomization.test.ts +2 -6
  220. package/src/lib/hooks/index.ts +1 -1
  221. package/src/lib/hooks/useComponentCustomization.ts +11 -17
  222. package/src/lib/hooks/usePerformanceMonitor.ts +6 -7
  223. package/src/lib/patterns/__tests__/slots.test.ts +1 -1
  224. package/src/lib/patterns/index.ts +1 -1
  225. package/src/lib/patterns/slots.tsx +8 -13
  226. package/src/lib/storybook/InteractiveDemo.tsx +13 -18
  227. package/src/lib/storybook/PreviewContainer.tsx +1 -1
  228. package/src/lib/storybook/VariantsGrid.tsx +3 -7
  229. package/src/lib/storybook/index.ts +1 -1
  230. package/src/lib/theme/adapters/cssVariableMapper.ts +47 -74
  231. package/src/lib/theme/adapters/index.ts +3 -9
  232. package/src/lib/theme/adapters/themeAdapter.ts +41 -26
  233. package/src/lib/theme/config/index.ts +1 -1
  234. package/src/lib/theme/config/types.ts +2 -2
  235. package/src/lib/theme/config/validator.ts +10 -5
  236. package/src/lib/theme/constants/constants.ts +2 -2
  237. package/src/lib/theme/constants/index.ts +1 -2
  238. package/src/lib/theme/core/__tests__/createTheme.test.ts +20 -22
  239. package/src/lib/theme/core/composeTheme.ts +32 -26
  240. package/src/lib/theme/core/createTheme.ts +1 -1
  241. package/src/lib/theme/core/createThemeObject.ts +308 -301
  242. package/src/lib/theme/core/index.ts +3 -3
  243. package/src/lib/theme/devtools/CLI.ts +107 -105
  244. package/src/lib/theme/devtools/Comparator.tsx +50 -32
  245. package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +50 -48
  246. package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +257 -63
  247. package/src/lib/theme/devtools/Inspector.tsx +75 -60
  248. package/src/lib/theme/devtools/LiveEditor.tsx +97 -76
  249. package/src/lib/theme/devtools/Preview.tsx +150 -106
  250. package/src/lib/theme/devtools/ThemeValidator.ts +29 -21
  251. package/src/lib/theme/devtools/index.ts +3 -9
  252. package/src/lib/theme/devtools/useHistory.ts +23 -21
  253. package/src/lib/theme/errors/errors.ts +12 -11
  254. package/src/lib/theme/errors/index.ts +2 -7
  255. package/src/lib/theme/generators/generateCSS.ts +9 -13
  256. package/src/lib/theme/generators/generateCSSNested.ts +1 -6
  257. package/src/lib/theme/generators/generateCSSVariables.ts +673 -630
  258. package/src/lib/theme/generators/index.ts +1 -4
  259. package/src/lib/theme/i18n/index.ts +1 -1
  260. package/src/lib/theme/i18n/rtl.ts +13 -13
  261. package/src/lib/theme/index.ts +7 -16
  262. package/src/lib/theme/runtime/ThemeApplicator.ts +4 -4
  263. package/src/lib/theme/runtime/ThemeContext.tsx +1 -1
  264. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +19 -23
  265. package/src/lib/theme/runtime/ThemeProvider.tsx +230 -239
  266. package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +1 -1
  267. package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +24 -29
  268. package/src/lib/theme/runtime/index.ts +2 -5
  269. package/src/lib/theme/runtime/useTheme.ts +18 -18
  270. package/src/lib/theme/runtime/useThemeTokens.ts +22 -22
  271. package/src/lib/theme/test/testTheme.ts +15 -16
  272. package/src/lib/theme/tokens/index.ts +2 -7
  273. package/src/lib/theme/tokens/tokens.ts +25 -24
  274. package/src/lib/theme/types.ts +428 -411
  275. package/src/lib/theme/utils/__tests__/themeValidation.test.ts +3 -3
  276. package/src/lib/theme/utils/componentTheming.ts +18 -18
  277. package/src/lib/theme/utils/domUtils.ts +277 -289
  278. package/src/lib/theme/utils/index.ts +1 -2
  279. package/src/lib/theme/utils/injectCSS.ts +10 -14
  280. package/src/lib/theme/utils/naming.ts +20 -16
  281. package/src/lib/theme/utils/themeHelpers.ts +10 -12
  282. package/src/lib/theme/utils/themeUtils.ts +85 -86
  283. package/src/lib/theme/utils/themeValidation.ts +82 -33
  284. package/src/lib/theme-tools.ts +8 -6
  285. package/src/lib/types/components.ts +172 -71
  286. package/src/lib/types/partProps.ts +1 -1
  287. package/src/lib/utils/__tests__/csv.test.ts +45 -0
  288. package/src/lib/utils/componentUtils.ts +8 -12
  289. package/src/lib/utils/csv.ts +19 -0
  290. package/src/lib/utils/dataTableExport.ts +2 -15
  291. package/src/lib/utils/fontPreloader.ts +10 -19
  292. package/src/lib/utils/icons.ts +4 -1
  293. package/src/lib/utils/index.ts +2 -6
  294. package/src/lib/utils/memoryMonitor.ts +10 -8
  295. package/src/lib/utils/themeNaming.ts +2 -2
  296. package/src/styles/01-settings/_index.scss +1 -1
  297. package/src/styles/01-settings/_settings.accordion.scss +28 -7
  298. package/src/styles/01-settings/_settings.colors.scss +11 -11
  299. package/src/styles/01-settings/_settings.design-tokens.scss +61 -50
  300. package/src/styles/01-settings/_settings.navbar.scss +1 -1
  301. package/src/styles/01-settings/_settings.spacing.scss +3 -4
  302. package/src/styles/01-settings/_settings.tooltip.scss +1 -1
  303. package/src/styles/01-settings/_settings.typography.scss +4 -4
  304. package/src/styles/02-tools/_tools.button.scss +51 -21
  305. package/src/styles/02-tools/_tools.utility-api.scss +38 -12
  306. package/src/styles/03-generic/_generic.root.scss +4 -3
  307. package/src/styles/06-components/_components.accordion.scss +56 -14
  308. package/src/styles/06-components/_components.atomix-glass.scss +13 -9
  309. package/src/styles/06-components/_components.button.scss +16 -4
  310. package/src/styles/06-components/_components.callout.scss +27 -21
  311. package/src/styles/06-components/_components.card.scss +5 -14
  312. package/src/styles/06-components/_components.chart.scss +22 -19
  313. package/src/styles/06-components/_components.checkbox.scss +25 -17
  314. package/src/styles/06-components/_components.color-mode-toggle.scss +3 -1
  315. package/src/styles/06-components/_components.edge-panel.scss +9 -2
  316. package/src/styles/06-components/_components.footer.scss +1 -1
  317. package/src/styles/06-components/_components.side-menu.scss +5 -5
  318. package/src/styles/06-components/_components.toggle.scss +18 -0
  319. package/src/styles/06-components/_index.scss +1 -1
  320. package/src/styles/06-components/old.chart.styles.scss +0 -2
  321. package/src/styles/99-utilities/_index.scss +2 -0
  322. package/src/styles/99-utilities/_utilities.border.scss +69 -27
  323. package/src/styles/99-utilities/_utilities.display.scss +1 -1
  324. package/src/styles/99-utilities/_utilities.opacity.scss +10 -0
  325. package/src/styles/99-utilities/_utilities.position.scss +16 -9
  326. package/src/styles/99-utilities/_utilities.scss +2 -0
  327. package/src/styles/99-utilities/_utilities.sizes.scss +47 -18
  328. package/src/styles/99-utilities/_utilities.spacing.scss +118 -66
  329. package/src/styles/99-utilities/_utilities.text-gradient.scss +45 -0
  330. package/src/styles/99-utilities/_utilities.text.scss +67 -46
  331. package/themes/dark-complementary/README.md +98 -0
  332. package/themes/dark-complementary/index.scss +158 -0
  333. package/themes/default-light/README.md +81 -0
  334. package/themes/default-light/index.scss +154 -0
  335. package/themes/high-contrast/README.md +105 -0
  336. package/themes/high-contrast/index.scss +172 -0
  337. package/themes/test-theme/README.md +38 -0
  338. package/themes/test-theme/index.scss +47 -0
  339. package/scripts/cli/templates-original-backup.js +0 -1655
  340. package/scripts/cli/templates_backup.js +0 -684
  341. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
  342. package/src/lib/composables/useButton.ts +0 -93
  343. package/src/lib/composables/useCheckbox.ts +0 -70
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * createThemeObject - Create a theme object with computed values
3
- *
3
+ *
4
4
  * Similar to Material-UI's createTheme, this function accepts theme configuration
5
5
  * options and returns a complete theme object with computed values.
6
- *
6
+ *
7
7
  * NOTE: For most use cases, use the simple theme system's `createTheme` instead,
8
8
  * which generates CSS from DesignTokens. This function is for advanced use cases
9
9
  * that need the full Theme object structure.
10
- *
10
+ *
11
11
  * @example
12
12
  * ```typescript
13
13
  * const theme = createThemeObject({
@@ -23,20 +23,27 @@
23
23
  */
24
24
 
25
25
  import type {
26
- Theme,
27
- ThemeOptions,
28
- PaletteColor,
29
- PaletteOptions,
30
- TypographyOptions,
31
- SpacingOptions,
32
- SpacingFunction,
33
- BreakpointsOptions,
34
- ShadowOptions,
35
- TransitionOptions,
36
- ZIndexOptions,
37
- BorderRadiusOptions,
26
+ Theme,
27
+ ThemeOptions,
28
+ PaletteColor,
29
+ PaletteOptions,
30
+ TypographyOptions,
31
+ SpacingOptions,
32
+ SpacingFunction,
33
+ BreakpointsOptions,
34
+ ShadowOptions,
35
+ TransitionOptions,
36
+ ZIndexOptions,
37
+ BorderRadiusOptions,
38
38
  } from '../types';
39
- import { hexToRgb, getLuminance, getContrastText, lighten, darken, createSpacing } from '../utils/themeUtils';
39
+ import {
40
+ hexToRgb,
41
+ getLuminance,
42
+ getContrastText,
43
+ lighten,
44
+ darken,
45
+ createSpacing,
46
+ } from '../utils/themeUtils';
40
47
  import { deepMerge } from './composeTheme';
41
48
 
42
49
  // ============================================================================
@@ -44,184 +51,184 @@ import { deepMerge } from './composeTheme';
44
51
  // ============================================================================
45
52
 
46
53
  const DEFAULT_PALETTE: Theme['palette'] = {
47
- primary: {
48
- main: '#7c3aed', // Primary-6
49
- light: '#d0b2f5', // Primary-3
50
- dark: '#3c1583', // Primary-9
51
- contrastText: '#ffffff',
52
- },
53
- secondary: {
54
- main: '#f3f4f6', // Gray-2
55
- light: '#ffffff', // Gray-1
56
- dark: '#e5e7eb', // Gray-3
57
- contrastText: '#1f2937', // Gray-9
58
- },
59
- error: {
60
- main: '#ef4444', // Red-6
61
- light: '#fca5a5', // Red-4
62
- dark: '#991b1b', // Red-9
63
- contrastText: '#ffffff',
64
- },
65
- warning: {
66
- main: '#eab308', // Yellow-6
67
- light: '#fde047', // Yellow-4
68
- dark: '#854d0e', // Yellow-9
69
- contrastText: '#000000',
70
- },
71
- info: {
72
- main: '#3b82f6', // Blue-6
73
- light: '#93c5fd', // Blue-4
74
- dark: '#1e40af', // Blue-9
75
- contrastText: '#ffffff',
76
- },
77
- success: {
78
- main: '#22c55e', // Green-6
79
- light: '#86efac', // Green-4
80
- dark: '#166534', // Green-9
81
- contrastText: '#ffffff',
82
- },
83
- background: {
84
- default: '#ffffff', // Primary-bg
85
- paper: '#f3f4f6', // Secondary-bg
86
- subtle: '#d1d5db', // Gray-4 (Tertiary-bg)
87
- },
88
- text: {
89
- primary: '#111827', // Gray-10
90
- secondary: '#374151', // Gray-8
91
- disabled: '#9ca3af', // Gray-5
92
- },
54
+ primary: {
55
+ main: '#7c3aed', // Primary-6
56
+ light: '#d0b2f5', // Primary-3
57
+ dark: '#3c1583', // Primary-9
58
+ contrastText: '#ffffff',
59
+ },
60
+ secondary: {
61
+ main: '#f3f4f6', // Gray-2
62
+ light: '#ffffff', // Gray-1
63
+ dark: '#e5e7eb', // Gray-3
64
+ contrastText: '#1f2937', // Gray-9
65
+ },
66
+ error: {
67
+ main: '#ef4444', // Red-6
68
+ light: '#fca5a5', // Red-4
69
+ dark: '#991b1b', // Red-9
70
+ contrastText: '#ffffff',
71
+ },
72
+ warning: {
73
+ main: '#eab308', // Yellow-6
74
+ light: '#fde047', // Yellow-4
75
+ dark: '#854d0e', // Yellow-9
76
+ contrastText: '#000000',
77
+ },
78
+ info: {
79
+ main: '#3b82f6', // Blue-6
80
+ light: '#93c5fd', // Blue-4
81
+ dark: '#1e40af', // Blue-9
82
+ contrastText: '#ffffff',
83
+ },
84
+ success: {
85
+ main: '#22c55e', // Green-6
86
+ light: '#86efac', // Green-4
87
+ dark: '#166534', // Green-9
88
+ contrastText: '#ffffff',
89
+ },
90
+ background: {
91
+ default: '#ffffff', // Primary-bg
92
+ paper: '#f3f4f6', // Secondary-bg
93
+ subtle: '#d1d5db', // Gray-4 (Tertiary-bg)
94
+ },
95
+ text: {
96
+ primary: '#111827', // Gray-10
97
+ secondary: '#374151', // Gray-8
98
+ disabled: '#9ca3af', // Gray-5
99
+ },
93
100
  };
94
101
 
95
102
  const DEFAULT_TYPOGRAPHY: Theme['typography'] = {
96
- fontFamily: '"Roboto", "Helvetica Neue", "Helvetica", "Arial", sans-serif',
97
- fontSize: 16, // 1rem
98
- fontWeightLight: 300,
99
- fontWeightRegular: 400,
100
- fontWeightMedium: 500,
101
- fontWeightSemiBold: 600,
102
- fontWeightBold: 700,
103
- fontWeightHeavy: 800,
104
- fontWeightBlack: 900,
105
- h1: {
106
- fontSize: '2.5rem', // 40px
107
- fontWeight: 700,
108
- lineHeight: 1.3,
109
- letterSpacing: '-1px',
110
- },
111
- h2: {
112
- fontSize: '2rem', // 32px
113
- fontWeight: 700,
114
- lineHeight: 1.3,
115
- letterSpacing: '-1px',
116
- },
117
- h3: {
118
- fontSize: '1.5rem', // 24px
119
- fontWeight: 700,
120
- lineHeight: 1.3,
121
- letterSpacing: '-1px',
122
- },
123
- h4: {
124
- fontSize: '1.25rem', // 20px
125
- fontWeight: 700,
126
- lineHeight: 1.3,
127
- letterSpacing: '-0.5px',
128
- },
129
- h5: {
130
- fontSize: '1.125rem', // 18px
131
- fontWeight: 700,
132
- lineHeight: 1.3,
133
- letterSpacing: '-0.5px',
134
- },
135
- h6: {
136
- fontSize: '1rem', // 16px
137
- fontWeight: 700,
138
- lineHeight: 1.3,
139
- letterSpacing: '-0.5px',
140
- },
141
- body1: {
142
- fontSize: '1rem', // 16px
143
- fontWeight: 400,
144
- lineHeight: 1.2,
145
- },
146
- body2: {
147
- fontSize: '0.875rem', // 14px
148
- fontWeight: 400,
149
- lineHeight: 1.2,
150
- },
103
+ fontFamily: '"Roboto", "Helvetica Neue", "Helvetica", "Arial", sans-serif',
104
+ fontSize: 16, // 1rem
105
+ fontWeightLight: 300,
106
+ fontWeightRegular: 400,
107
+ fontWeightMedium: 500,
108
+ fontWeightSemiBold: 600,
109
+ fontWeightBold: 700,
110
+ fontWeightHeavy: 800,
111
+ fontWeightBlack: 900,
112
+ h1: {
113
+ fontSize: '2.5rem', // 40px
114
+ fontWeight: 700,
115
+ lineHeight: 1.3,
116
+ letterSpacing: '-1px',
117
+ },
118
+ h2: {
119
+ fontSize: '2rem', // 32px
120
+ fontWeight: 700,
121
+ lineHeight: 1.3,
122
+ letterSpacing: '-1px',
123
+ },
124
+ h3: {
125
+ fontSize: '1.5rem', // 24px
126
+ fontWeight: 700,
127
+ lineHeight: 1.3,
128
+ letterSpacing: '-1px',
129
+ },
130
+ h4: {
131
+ fontSize: '1.25rem', // 20px
132
+ fontWeight: 700,
133
+ lineHeight: 1.3,
134
+ letterSpacing: '-0.5px',
135
+ },
136
+ h5: {
137
+ fontSize: '1.125rem', // 18px
138
+ fontWeight: 700,
139
+ lineHeight: 1.3,
140
+ letterSpacing: '-0.5px',
141
+ },
142
+ h6: {
143
+ fontSize: '1rem', // 16px
144
+ fontWeight: 700,
145
+ lineHeight: 1.3,
146
+ letterSpacing: '-0.5px',
147
+ },
148
+ body1: {
149
+ fontSize: '1rem', // 16px
150
+ fontWeight: 400,
151
+ lineHeight: 1.2,
152
+ },
153
+ body2: {
154
+ fontSize: '0.875rem', // 14px
155
+ fontWeight: 400,
156
+ lineHeight: 1.2,
157
+ },
151
158
  };
152
159
 
153
160
  const DEFAULT_BREAKPOINTS: Theme['breakpoints'] = {
154
- values: {
155
- xs: 0,
156
- sm: 576,
157
- md: 768,
158
- lg: 992,
159
- xl: 1200,
160
- xxl: 1440,
161
- },
162
- unit: 'px',
163
- up: (key) => {
164
- const value = typeof key === 'number' ? key : DEFAULT_BREAKPOINTS.values[key] || 0;
165
- return `@media (min-width:${value}${DEFAULT_BREAKPOINTS.unit})`;
166
- },
167
- down: (key) => {
168
- const value = typeof key === 'number' ? key : DEFAULT_BREAKPOINTS.values[key] || 0;
169
- return `@media (max-width:${value - 0.05}${DEFAULT_BREAKPOINTS.unit})`;
170
- },
171
- between: (start, end) => {
172
- const startValue = typeof start === 'number' ? start : DEFAULT_BREAKPOINTS.values[start] || 0;
173
- const endValue = typeof end === 'number' ? end : DEFAULT_BREAKPOINTS.values[end] || 0;
174
- return `@media (min-width:${startValue}${DEFAULT_BREAKPOINTS.unit}) and (max-width:${endValue - 0.05}${DEFAULT_BREAKPOINTS.unit})`;
175
- },
161
+ values: {
162
+ xs: 0,
163
+ sm: 576,
164
+ md: 768,
165
+ lg: 992,
166
+ xl: 1200,
167
+ xxl: 1440,
168
+ },
169
+ unit: 'px',
170
+ up: key => {
171
+ const value = typeof key === 'number' ? key : DEFAULT_BREAKPOINTS.values[key] || 0;
172
+ return `@media (min-width:${value}${DEFAULT_BREAKPOINTS.unit})`;
173
+ },
174
+ down: key => {
175
+ const value = typeof key === 'number' ? key : DEFAULT_BREAKPOINTS.values[key] || 0;
176
+ return `@media (max-width:${value - 0.05}${DEFAULT_BREAKPOINTS.unit})`;
177
+ },
178
+ between: (start, end) => {
179
+ const startValue = typeof start === 'number' ? start : DEFAULT_BREAKPOINTS.values[start] || 0;
180
+ const endValue = typeof end === 'number' ? end : DEFAULT_BREAKPOINTS.values[end] || 0;
181
+ return `@media (min-width:${startValue}${DEFAULT_BREAKPOINTS.unit}) and (max-width:${endValue - 0.05}${DEFAULT_BREAKPOINTS.unit})`;
182
+ },
176
183
  };
177
184
 
178
185
  const DEFAULT_SHADOWS: Theme['shadows'] = {
179
- xs: '0px 1px 2px 0px rgba(45, 54, 67, 0.04), 0px 2px 4px 0px rgba(45, 54, 67, 0.08)',
180
- sm: '0 2px 4px rgba(0, 0, 0, 0.075)',
181
- md: '0 4px 8px rgba(0, 0, 0, 0.1)',
182
- lg: '0 16px 48px rgba(0, 0, 0, 0.175)',
183
- xl: '0px 16px 64px -8px rgba(45, 54, 67, 0.14)',
184
- inset: 'inset 0 1px 2px rgba(0, 0, 0, 0.075)',
186
+ xs: '0px 1px 2px 0px rgba(45, 54, 67, 0.04), 0px 2px 4px 0px rgba(45, 54, 67, 0.08)',
187
+ sm: '0 2px 4px rgba(0, 0, 0, 0.075)',
188
+ md: '0 4px 8px rgba(0, 0, 0, 0.1)',
189
+ lg: '0 16px 48px rgba(0, 0, 0, 0.175)',
190
+ xl: '0px 16px 64px -8px rgba(45, 54, 67, 0.14)',
191
+ inset: 'inset 0 1px 2px rgba(0, 0, 0, 0.075)',
185
192
  };
186
193
 
187
194
  const DEFAULT_TRANSITIONS: Theme['transitions'] = {
188
- duration: {
189
- shortest: 150,
190
- shorter: 200,
191
- short: 250,
192
- standard: 300,
193
- complex: 375,
194
- enteringScreen: 225,
195
- leavingScreen: 195,
196
- },
197
- easing: {
198
- easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
199
- easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
200
- easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
201
- sharp: 'cubic-bezier(0.4, 0, 0.6, 1)',
202
- },
195
+ duration: {
196
+ shortest: 150,
197
+ shorter: 200,
198
+ short: 250,
199
+ standard: 300,
200
+ complex: 375,
201
+ enteringScreen: 225,
202
+ leavingScreen: 195,
203
+ },
204
+ easing: {
205
+ easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
206
+ easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
207
+ easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
208
+ sharp: 'cubic-bezier(0.4, 0, 0.6, 1)',
209
+ },
203
210
  };
204
211
 
205
212
  const DEFAULT_ZINDEX: Theme['zIndex'] = {
206
- mobileStepper: 1000,
207
- speedDial: 1050,
208
- appBar: 1020,
209
- drawer: 1070,
210
- modal: 1040,
211
- snackbar: 1080,
212
- tooltip: 1060,
213
+ mobileStepper: 1000,
214
+ speedDial: 1050,
215
+ appBar: 1020,
216
+ drawer: 1070,
217
+ modal: 1040,
218
+ snackbar: 1080,
219
+ tooltip: 1060,
213
220
  };
214
221
 
215
222
  const DEFAULT_BORDER_RADIUS: Theme['borderRadius'] = {
216
- base: '0.5rem', // 8px (spacing-2)
217
- sm: '0.25rem', // 4px (spacing-1)
218
- md: '0.25rem', // 4px (spacing-1)
219
- lg: '0.625rem', // 10px (spacing-2.5)
220
- xl: '0.75rem', // 12px (spacing-3)
221
- xxl: '1rem', // 16px (spacing-4)
222
- '3xl': '1.5rem', // 24px (spacing-6)
223
- '4xl': '2rem', // 32px (spacing-8)
224
- pill: '50rem', // 800px (spacing-200)
223
+ base: '0.5rem', // 8px (spacing-2)
224
+ sm: '0.25rem', // 4px (spacing-1)
225
+ md: '0.25rem', // 4px (spacing-1)
226
+ lg: '0.625rem', // 10px (spacing-2.5)
227
+ xl: '0.75rem', // 12px (spacing-3)
228
+ xxl: '1rem', // 16px (spacing-4)
229
+ '3xl': '1.5rem', // 24px (spacing-6)
230
+ '4xl': '2rem', // 32px (spacing-8)
231
+ pill: '50rem', // 800px (spacing-200)
225
232
  };
226
233
 
227
234
  // ============================================================================
@@ -232,57 +239,57 @@ const DEFAULT_BORDER_RADIUS: Theme['borderRadius'] = {
232
239
  * Create a complete palette color from partial configuration
233
240
  */
234
241
  function createPaletteColor(color: Partial<PaletteColor> | string): PaletteColor {
235
- if (typeof color === 'string') {
236
- return {
237
- main: color,
238
- light: lighten(color),
239
- dark: darken(color),
240
- contrastText: getContrastText(color),
241
- };
242
- }
243
-
242
+ if (typeof color === 'string') {
244
243
  return {
245
- main: color.main || '#000000',
246
- light: color.light || lighten(color.main || '#000000'),
247
- dark: color.dark || darken(color.main || '#000000'),
248
- contrastText: color.contrastText || getContrastText(color.main || '#000000'),
244
+ main: color,
245
+ light: lighten(color),
246
+ dark: darken(color),
247
+ contrastText: getContrastText(color),
249
248
  };
250
- }
249
+ }
251
250
 
251
+ return {
252
+ main: color.main || '#000000',
253
+ light: color.light || lighten(color.main || '#000000'),
254
+ dark: color.dark || darken(color.main || '#000000'),
255
+ contrastText: color.contrastText || getContrastText(color.main || '#000000'),
256
+ };
257
+ }
252
258
 
253
259
  /**
254
260
  * Create breakpoints object
255
261
  */
256
262
  function createBreakpoints(breakpointsInput?: BreakpointsOptions): Theme['breakpoints'] {
257
- const values = {
258
- xs: 0,
259
- sm: 576,
260
- md: 768,
261
- lg: 992,
262
- xl: 1200,
263
- xxl: 1440,
264
- ...breakpointsInput?.values,
265
- };
263
+ const values = {
264
+ xs: 0,
265
+ sm: 576,
266
+ md: 768,
267
+ lg: 992,
268
+ xl: 1200,
269
+ xxl: 1440,
270
+ ...breakpointsInput?.values,
271
+ };
266
272
 
267
- const unit = breakpointsInput?.unit || 'px';
273
+ const unit = breakpointsInput?.unit || 'px';
268
274
 
269
- return {
270
- values,
271
- unit,
272
- up: (key) => {
273
- const value = typeof key === 'number' ? key : (values[key as keyof typeof values] ?? 0);
274
- return `@media (min-width:${value}${unit})`;
275
- },
276
- down: (key) => {
277
- const value = typeof key === 'number' ? key : (values[key as keyof typeof values] ?? 0);
278
- return `@media (max-width:${value - 0.05}${unit})`;
279
- },
280
- between: (start, end) => {
281
- const startValue = typeof start === 'number' ? start : (values[start as keyof typeof values] ?? 0);
282
- const endValue = typeof end === 'number' ? end : (values[end as keyof typeof values] ?? 0);
283
- return `@media (min-width:${startValue}${unit}) and (max-width:${endValue - 0.05}${unit})`;
284
- },
285
- };
275
+ return {
276
+ values,
277
+ unit,
278
+ up: key => {
279
+ const value = typeof key === 'number' ? key : (values[key as keyof typeof values] ?? 0);
280
+ return `@media (min-width:${value}${unit})`;
281
+ },
282
+ down: key => {
283
+ const value = typeof key === 'number' ? key : (values[key as keyof typeof values] ?? 0);
284
+ return `@media (max-width:${value - 0.05}${unit})`;
285
+ },
286
+ between: (start, end) => {
287
+ const startValue =
288
+ typeof start === 'number' ? start : (values[start as keyof typeof values] ?? 0);
289
+ const endValue = typeof end === 'number' ? end : (values[end as keyof typeof values] ?? 0);
290
+ return `@media (min-width:${startValue}${unit}) and (max-width:${endValue - 0.05}${unit})`;
291
+ },
292
+ };
286
293
  }
287
294
 
288
295
  // ============================================================================
@@ -291,106 +298,106 @@ function createBreakpoints(breakpointsInput?: BreakpointsOptions): Theme['breakp
291
298
 
292
299
  /**
293
300
  * Create a theme object with computed values
294
- *
301
+ *
295
302
  * @param options - Theme configuration options
296
303
  * @returns Complete theme object
297
304
  */
298
305
  export function createThemeObject(...options: ThemeOptions[]): Theme {
299
- // Merge all options by spreading them into a single object
300
- const mergedOptions = options.reduce((acc, option) => {
301
- // Cast option to any to avoid strict typing during merge
302
- const opt = option as any;
303
- return deepMerge(acc, opt || {}) as any;
304
- }, {} as any);
306
+ // Merge all options by spreading them into a single object
307
+ const mergedOptions = options.reduce((acc, option) => {
308
+ // Cast option to any to avoid strict typing during merge
309
+ const opt = option as any;
310
+ return deepMerge(acc, opt || {}) as any;
311
+ }, {} as any);
305
312
 
306
- // Create palette
307
- const palette: Theme['palette'] = {
308
- primary: createPaletteColor(mergedOptions.palette?.primary || DEFAULT_PALETTE.primary),
309
- secondary: createPaletteColor(mergedOptions.palette?.secondary || DEFAULT_PALETTE.secondary),
310
- error: createPaletteColor(mergedOptions.palette?.error || DEFAULT_PALETTE.error),
311
- warning: createPaletteColor(mergedOptions.palette?.warning || DEFAULT_PALETTE.warning),
312
- info: createPaletteColor(mergedOptions.palette?.info || DEFAULT_PALETTE.info),
313
- success: createPaletteColor(mergedOptions.palette?.success || DEFAULT_PALETTE.success),
314
- // Handle light and dark colors if provided
315
- ...(mergedOptions.palette?.light && {
316
- light: createPaletteColor(mergedOptions.palette.light),
317
- }),
318
- ...(mergedOptions.palette?.dark && {
319
- dark: createPaletteColor(mergedOptions.palette.dark),
320
- }),
321
- background: {
322
- default: mergedOptions.palette?.background?.default || DEFAULT_PALETTE.background.default,
323
- subtle: mergedOptions.palette?.background?.subtle || DEFAULT_PALETTE.background.subtle,
324
- },
325
- text: {
326
- primary: mergedOptions.palette?.text?.primary || DEFAULT_PALETTE.text.primary,
327
- secondary: mergedOptions.palette?.text?.secondary || DEFAULT_PALETTE.text.secondary,
328
- disabled: mergedOptions.palette?.text?.disabled || DEFAULT_PALETTE.text.disabled,
329
- },
330
- };
313
+ // Create palette
314
+ const palette: Theme['palette'] = {
315
+ primary: createPaletteColor(mergedOptions.palette?.primary || DEFAULT_PALETTE.primary),
316
+ secondary: createPaletteColor(mergedOptions.palette?.secondary || DEFAULT_PALETTE.secondary),
317
+ error: createPaletteColor(mergedOptions.palette?.error || DEFAULT_PALETTE.error),
318
+ warning: createPaletteColor(mergedOptions.palette?.warning || DEFAULT_PALETTE.warning),
319
+ info: createPaletteColor(mergedOptions.palette?.info || DEFAULT_PALETTE.info),
320
+ success: createPaletteColor(mergedOptions.palette?.success || DEFAULT_PALETTE.success),
321
+ // Handle light and dark colors if provided
322
+ ...(mergedOptions.palette?.light && {
323
+ light: createPaletteColor(mergedOptions.palette.light),
324
+ }),
325
+ ...(mergedOptions.palette?.dark && {
326
+ dark: createPaletteColor(mergedOptions.palette.dark),
327
+ }),
328
+ background: {
329
+ default: mergedOptions.palette?.background?.default || DEFAULT_PALETTE.background.default,
330
+ subtle: mergedOptions.palette?.background?.subtle || DEFAULT_PALETTE.background.subtle,
331
+ },
332
+ text: {
333
+ primary: mergedOptions.palette?.text?.primary || DEFAULT_PALETTE.text.primary,
334
+ secondary: mergedOptions.palette?.text?.secondary || DEFAULT_PALETTE.text.secondary,
335
+ disabled: mergedOptions.palette?.text?.disabled || DEFAULT_PALETTE.text.disabled,
336
+ },
337
+ };
331
338
 
332
- // Create typography
333
- const typography: Theme['typography'] = deepMerge(
334
- { ...DEFAULT_TYPOGRAPHY } as Partial<Theme['typography']>,
335
- (mergedOptions.typography || {}) as Partial<Theme['typography']>
336
- ) as Theme['typography'];
339
+ // Create typography
340
+ const typography: Theme['typography'] = deepMerge(
341
+ { ...DEFAULT_TYPOGRAPHY } as Partial<Theme['typography']>,
342
+ (mergedOptions.typography || {}) as Partial<Theme['typography']>
343
+ ) as Theme['typography'];
337
344
 
338
- // Create spacing
339
- const spacing = createSpacing(mergedOptions.spacing);
345
+ // Create spacing
346
+ const spacing = createSpacing(mergedOptions.spacing);
340
347
 
341
- // Create breakpoints
342
- const breakpoints = createBreakpoints(mergedOptions.breakpoints);
348
+ // Create breakpoints
349
+ const breakpoints = createBreakpoints(mergedOptions.breakpoints);
343
350
 
344
- // Create shadows
345
- const shadows: Theme['shadows'] = deepMerge({ ...DEFAULT_SHADOWS }, mergedOptions.shadows || {});
351
+ // Create shadows
352
+ const shadows: Theme['shadows'] = deepMerge({ ...DEFAULT_SHADOWS }, mergedOptions.shadows || {});
346
353
 
347
- // Create transitions
348
- const transitions: Theme['transitions'] = deepMerge(
349
- { ...DEFAULT_TRANSITIONS } as Partial<Theme['transitions']>,
350
- (mergedOptions.transitions || {}) as Partial<Theme['transitions']>
351
- ) as Theme['transitions'];
354
+ // Create transitions
355
+ const transitions: Theme['transitions'] = deepMerge(
356
+ { ...DEFAULT_TRANSITIONS } as Partial<Theme['transitions']>,
357
+ (mergedOptions.transitions || {}) as Partial<Theme['transitions']>
358
+ ) as Theme['transitions'];
352
359
 
353
- // Create z-index
354
- const zIndex: Theme['zIndex'] = deepMerge({ ...DEFAULT_ZINDEX }, mergedOptions.zIndex || {});
360
+ // Create z-index
361
+ const zIndex: Theme['zIndex'] = deepMerge({ ...DEFAULT_ZINDEX }, mergedOptions.zIndex || {});
355
362
 
356
- // Create border radius
357
- const borderRadius: Theme['borderRadius'] = deepMerge(
358
- { ...DEFAULT_BORDER_RADIUS },
359
- mergedOptions.borderRadius || {}
360
- );
363
+ // Create border radius
364
+ const borderRadius: Theme['borderRadius'] = deepMerge(
365
+ { ...DEFAULT_BORDER_RADIUS },
366
+ mergedOptions.borderRadius || {}
367
+ );
361
368
 
362
- // Create theme object
363
- const theme: Theme = {
364
- // Metadata
365
- name: mergedOptions.name || 'Custom Theme',
366
- class: mergedOptions.class,
367
- description: mergedOptions.description,
368
- author: mergedOptions.author,
369
- version: mergedOptions.version || '1.0.0',
370
- tags: mergedOptions.tags,
371
- supportsDarkMode: mergedOptions.supportsDarkMode,
372
- status: mergedOptions.status || 'experimental',
373
- a11y: mergedOptions.a11y,
374
- color: mergedOptions.color || palette.primary.main,
375
- features: mergedOptions.features,
376
- dependencies: mergedOptions.dependencies,
369
+ // Create theme object
370
+ const theme: Theme = {
371
+ // Metadata
372
+ name: mergedOptions.name || 'Custom Theme',
373
+ class: mergedOptions.class,
374
+ description: mergedOptions.description,
375
+ author: mergedOptions.author,
376
+ version: mergedOptions.version || '1.0.0',
377
+ tags: mergedOptions.tags,
378
+ supportsDarkMode: mergedOptions.supportsDarkMode,
379
+ status: mergedOptions.status || 'experimental',
380
+ a11y: mergedOptions.a11y,
381
+ color: mergedOptions.color || palette.primary.main,
382
+ features: mergedOptions.features,
383
+ dependencies: mergedOptions.dependencies,
377
384
 
378
- // Theme configuration
379
- palette,
380
- typography,
381
- spacing,
382
- breakpoints,
383
- shadows,
384
- transitions,
385
- zIndex,
386
- borderRadius,
387
- custom: mergedOptions.custom || {},
385
+ // Theme configuration
386
+ palette,
387
+ typography,
388
+ spacing,
389
+ breakpoints,
390
+ shadows,
391
+ transitions,
392
+ zIndex,
393
+ borderRadius,
394
+ custom: mergedOptions.custom || {},
388
395
 
389
- // Mark as JS theme
390
- __isJSTheme: true,
391
- };
396
+ // Mark as JS theme
397
+ __isJSTheme: true,
398
+ };
392
399
 
393
- return theme;
400
+ return theme;
394
401
  }
395
402
 
396
403
  export default createThemeObject;