@shohojdhara/atomix 0.3.3 → 0.3.5

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 (489) hide show
  1. package/README.md +46 -28
  2. package/dist/atomix.css +15 -9
  3. package/dist/atomix.css.map +1 -0
  4. package/dist/atomix.min.css +15108 -11
  5. package/dist/atomix.min.css.map +1 -0
  6. package/dist/charts.d.ts +1929 -0
  7. package/dist/charts.js +6482 -0
  8. package/dist/charts.js.map +1 -0
  9. package/dist/core.d.ts +1289 -0
  10. package/dist/core.js +3357 -0
  11. package/dist/core.js.map +1 -0
  12. package/dist/forms.d.ts +1085 -0
  13. package/dist/forms.js +2450 -0
  14. package/dist/forms.js.map +1 -0
  15. package/dist/heavy.d.ts +636 -0
  16. package/dist/heavy.js +4550 -0
  17. package/dist/heavy.js.map +1 -0
  18. package/dist/index.d.ts +5196 -4618
  19. package/dist/index.esm.js +4240 -2776
  20. package/dist/index.esm.js.map +1 -1
  21. package/dist/index.js +4057 -2571
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.min.js +1 -1
  24. package/dist/index.min.js.map +1 -1
  25. package/dist/layout.d.ts +300 -0
  26. package/dist/layout.js +336 -0
  27. package/dist/layout.js.map +1 -0
  28. package/dist/theme.d.ts +1992 -0
  29. package/dist/theme.js +5348 -0
  30. package/dist/theme.js.map +1 -0
  31. package/package.json +63 -68
  32. package/scripts/atomix-cli.js +879 -15
  33. package/scripts/cli/__tests__/cli-commands.test.js +204 -0
  34. package/scripts/cli/__tests__/utils.test.js +201 -0
  35. package/scripts/cli/__tests__/vitest.config.js +26 -0
  36. package/scripts/cli/interactive-init.js +37 -45
  37. package/scripts/cli/theme-bridge.js +129 -0
  38. package/scripts/cli/token-manager.js +32 -7
  39. package/scripts/cli/utils.js +347 -0
  40. package/scripts/sync-theme-config.js +22 -22
  41. package/src/components/Accordion/Accordion.tsx +5 -54
  42. package/src/components/Accordion/index.ts +1 -1
  43. package/src/components/Avatar/Avatar.tsx +3 -3
  44. package/src/components/Badge/Badge.tsx +3 -3
  45. package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
  46. package/src/components/Button/Button.tsx +36 -1
  47. package/src/components/Card/ElevationCard.tsx +1 -1
  48. package/src/components/Chart/AnimatedChart.tsx +19 -17
  49. package/src/components/Chart/AreaChart.tsx +5 -1
  50. package/src/components/Chart/BarChart.tsx +1 -0
  51. package/src/components/Chart/BubbleChart.tsx +6 -5
  52. package/src/components/Chart/ChartToolbar.tsx +1 -0
  53. package/src/components/Chart/FunnelChart.tsx +1 -1
  54. package/src/components/Chart/RadarChart.tsx +19 -12
  55. package/src/components/Chart/ScatterChart.tsx +3 -3
  56. package/src/components/Chart/TreemapChart.tsx +2 -1
  57. package/src/components/Chart/WaterfallChart.tsx +0 -1
  58. package/src/components/Chart/types.ts +12 -2
  59. package/src/components/Chart/utils.ts +4 -3
  60. package/src/components/DataTable/DataTable.tsx +3 -3
  61. package/src/components/Dropdown/Dropdown.tsx +12 -9
  62. package/src/components/Footer/FooterSection.tsx +3 -3
  63. package/src/components/Form/Checkbox.tsx +3 -3
  64. package/src/components/Form/Input.tsx +4 -2
  65. package/src/components/Form/Radio.tsx +3 -3
  66. package/src/components/Form/Select.tsx +3 -3
  67. package/src/components/Form/Textarea.tsx +4 -2
  68. package/src/components/List/List.stories.tsx +3 -3
  69. package/src/components/List/List.tsx +3 -3
  70. package/src/components/List/ListGroup.tsx +3 -1
  71. package/src/components/Modal/Modal.tsx +3 -3
  72. package/src/components/Navigation/Menu/MegaMenu.tsx +9 -3
  73. package/src/components/Navigation/Menu/Menu.tsx +9 -3
  74. package/src/components/Pagination/Pagination.tsx +6 -5
  75. package/src/components/PhotoViewer/PhotoViewerImage.tsx +2 -2
  76. package/src/components/Popover/Popover.tsx +4 -4
  77. package/src/components/Progress/Progress.tsx +6 -2
  78. package/src/components/Rating/Rating.tsx +5 -2
  79. package/src/components/Slider/Slider.tsx +10 -9
  80. package/src/components/Spinner/Spinner.tsx +3 -3
  81. package/src/components/Tabs/Tabs.tsx +3 -3
  82. package/src/components/Tooltip/Tooltip.tsx +3 -3
  83. package/src/components/index.ts +5 -2
  84. package/src/layouts/MasonryGrid/MasonryGrid.tsx +2 -2
  85. package/src/lib/composables/useChartPerformance.ts +102 -78
  86. package/src/lib/composables/useChartScale.ts +10 -0
  87. package/src/lib/composables/useHero.ts +9 -2
  88. package/src/lib/composables/useHeroBackgroundSlider.ts +5 -3
  89. package/src/lib/composables/useSideMenu.ts +1 -0
  90. package/src/lib/composables/useVideoPlayer.ts +3 -2
  91. package/src/lib/config/index.ts +275 -0
  92. package/src/lib/config/loader.ts +147 -0
  93. package/src/lib/hooks/index.ts +0 -1
  94. package/src/lib/hooks/useComponentCustomization.ts +10 -14
  95. package/src/lib/hooks/usePerformanceMonitor.ts +149 -0
  96. package/src/lib/index.ts +1 -0
  97. package/src/lib/patterns/index.ts +2 -2
  98. package/src/lib/patterns/slots.tsx +2 -2
  99. package/src/lib/theme/composeTheme.ts +1 -6
  100. package/src/lib/theme/config/index.ts +1 -1
  101. package/src/lib/theme/config/loader.ts +75 -41
  102. package/src/lib/theme/config/types.ts +21 -7
  103. package/src/lib/theme/config/validator.ts +1 -1
  104. package/src/lib/theme/constants.ts +12 -2
  105. package/src/lib/theme/core/ThemeEngine.ts +8 -0
  106. package/src/lib/theme/core/ThemeValidator.ts +5 -2
  107. package/src/lib/theme/createTheme.ts +0 -1
  108. package/src/lib/theme/createThemeFromConfig.ts +132 -0
  109. package/src/lib/theme/devtools/CLI.ts +161 -76
  110. package/src/lib/theme/devtools/Comparator.tsx +343 -0
  111. package/src/lib/theme/devtools/IMPROVEMENTS.md +429 -0
  112. package/src/lib/theme/devtools/Inspector.tsx +22 -7
  113. package/src/lib/theme/devtools/LiveEditor.tsx +399 -0
  114. package/src/lib/theme/devtools/README.md +433 -0
  115. package/src/lib/theme/devtools/index.ts +12 -11
  116. package/src/lib/theme/generateCSSVariables.ts +80 -39
  117. package/src/lib/theme/i18n/rtl.ts +2 -1
  118. package/src/lib/theme/index.ts +18 -2
  119. package/src/lib/theme/runtime/ThemeApplicator.ts +28 -11
  120. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +3 -3
  121. package/src/lib/theme/runtime/ThemeManager.test.ts +17 -1
  122. package/src/lib/theme/runtime/ThemeManager.ts +11 -7
  123. package/src/lib/theme/types.ts +42 -43
  124. package/src/lib/theme-tools.ts +8 -68
  125. package/src/lib/types/components.ts +252 -109
  126. package/src/lib/types/partProps.ts +0 -16
  127. package/src/lib/utils/fontPreloader.ts +148 -0
  128. package/src/lib/utils/index.ts +11 -0
  129. package/src/lib/utils/memoryMonitor.ts +189 -0
  130. package/src/styles/01-settings/_settings.fonts.scss +2 -5
  131. package/src/styles/01-settings/_settings.navbar.scss +1 -1
  132. package/src/styles/03-generic/_generated-root.css +26 -0
  133. package/src/styles/06-components/_components.navbar.scss +6 -5
  134. package/src/themes/README.md +1 -2
  135. package/src/themes/themes.config.js +30 -181
  136. package/dist/themes/applemix.css +0 -16576
  137. package/dist/themes/applemix.css.map +0 -1
  138. package/dist/themes/applemix.min.css +0 -73
  139. package/dist/themes/boomdevs.css +0 -16007
  140. package/dist/themes/boomdevs.css.map +0 -1
  141. package/dist/themes/boomdevs.min.css +0 -406
  142. package/dist/themes/esrar.css +0 -18424
  143. package/dist/themes/esrar.css.map +0 -1
  144. package/dist/themes/esrar.min.css +0 -221
  145. package/dist/themes/flashtrade.css +0 -17596
  146. package/dist/themes/flashtrade.css.map +0 -1
  147. package/dist/themes/flashtrade.min.css +0 -196
  148. package/dist/themes/mashroom.css +0 -31082
  149. package/dist/themes/mashroom.css.map +0 -1
  150. package/dist/themes/mashroom.min.css +0 -450
  151. package/dist/themes/shaj-default.css +0 -17200
  152. package/dist/themes/shaj-default.css.map +0 -1
  153. package/dist/themes/shaj-default.min.css +0 -502
  154. package/scripts/build-themes.js +0 -208
  155. package/src/components/AtomixGlass/atomixGLass.old.tsx +0 -1263
  156. package/src/lib/theme/__tests__/ThemeBuilder.test.ts +0 -223
  157. package/src/lib/theme/builders/ThemeBuilder.ts +0 -372
  158. package/src/lib/theme/errors.test.ts +0 -207
  159. package/src/lib/theme/generators/CSSGenerator.ts +0 -311
  160. package/src/lib/theme/generators/ConfigGenerator.ts +0 -287
  161. package/src/lib/theme/generators/TypeGenerator.ts +0 -228
  162. package/src/lib/theme/generators/index.ts +0 -21
  163. package/src/lib/theme/monitoring/ThemeAnalytics.ts +0 -409
  164. package/src/lib/theme/monitoring/index.ts +0 -17
  165. package/src/lib/theme/overrides/ComponentOverrides.ts +0 -243
  166. package/src/lib/theme/overrides/index.ts +0 -15
  167. package/src/lib/theme/whitelabel/WhiteLabelManager.ts +0 -364
  168. package/src/lib/theme/whitelabel/index.ts +0 -13
  169. package/src/themes/THEME_CHECKLIST.md +0 -74
  170. package/src/themes/applemix/01-settings/_index.scss +0 -24
  171. package/src/themes/applemix/01-settings/_settings.animations.scss +0 -0
  172. package/src/themes/applemix/01-settings/_settings.background.scss +0 -6
  173. package/src/themes/applemix/01-settings/_settings.colors.scss +0 -75
  174. package/src/themes/applemix/01-settings/_settings.config.scss +0 -15
  175. package/src/themes/applemix/01-settings/_settings.typography.scss +0 -30
  176. package/src/themes/applemix/02-tools/_index.scss +0 -4
  177. package/src/themes/applemix/03-generic/_index.scss +0 -7
  178. package/src/themes/applemix/04-elements/_index.scss +0 -7
  179. package/src/themes/applemix/05-objects/_index.scss +0 -7
  180. package/src/themes/applemix/06-components/_index.scss +0 -15
  181. package/src/themes/applemix/99-utilities/_index.scss +0 -7
  182. package/src/themes/applemix/README.md +0 -378
  183. package/src/themes/applemix/index.scss +0 -33
  184. package/src/themes/boomdevs/01-settings/_index.scss +0 -38
  185. package/src/themes/boomdevs/01-settings/_settings.accordion.scss +0 -12
  186. package/src/themes/boomdevs/01-settings/_settings.animations.scss +0 -11
  187. package/src/themes/boomdevs/01-settings/_settings.avatar.scss +0 -9
  188. package/src/themes/boomdevs/01-settings/_settings.badge.scss +0 -11
  189. package/src/themes/boomdevs/01-settings/_settings.border-radius.scss +0 -16
  190. package/src/themes/boomdevs/01-settings/_settings.border.scss +0 -10
  191. package/src/themes/boomdevs/01-settings/_settings.box-shadow.scss +0 -14
  192. package/src/themes/boomdevs/01-settings/_settings.breadcrumb.scss +0 -13
  193. package/src/themes/boomdevs/01-settings/_settings.breakpoints.scss +0 -15
  194. package/src/themes/boomdevs/01-settings/_settings.button.scss +0 -9
  195. package/src/themes/boomdevs/01-settings/_settings.callout.scss +0 -9
  196. package/src/themes/boomdevs/01-settings/_settings.card.scss +0 -11
  197. package/src/themes/boomdevs/01-settings/_settings.checkbox.scss +0 -9
  198. package/src/themes/boomdevs/01-settings/_settings.colors.scss +0 -145
  199. package/src/themes/boomdevs/01-settings/_settings.dropdown.scss +0 -11
  200. package/src/themes/boomdevs/01-settings/_settings.grid.scss +0 -16
  201. package/src/themes/boomdevs/01-settings/_settings.input.scss +0 -14
  202. package/src/themes/boomdevs/01-settings/_settings.link.scss +0 -11
  203. package/src/themes/boomdevs/01-settings/_settings.list.scss +0 -10
  204. package/src/themes/boomdevs/01-settings/_settings.modal.scss +0 -16
  205. package/src/themes/boomdevs/01-settings/_settings.navbar.scss +0 -16
  206. package/src/themes/boomdevs/01-settings/_settings.pagination.scss +0 -13
  207. package/src/themes/boomdevs/01-settings/_settings.progress.scss +0 -11
  208. package/src/themes/boomdevs/01-settings/_settings.rating.scss +0 -10
  209. package/src/themes/boomdevs/01-settings/_settings.spacing.scss +0 -33
  210. package/src/themes/boomdevs/01-settings/_settings.spinner.scss +0 -11
  211. package/src/themes/boomdevs/01-settings/_settings.steps.scss +0 -12
  212. package/src/themes/boomdevs/01-settings/_settings.tabs.scss +0 -12
  213. package/src/themes/boomdevs/01-settings/_settings.todo.scss +0 -15
  214. package/src/themes/boomdevs/01-settings/_settings.toggle.scss +0 -14
  215. package/src/themes/boomdevs/01-settings/_settings.tooltip.scss +0 -13
  216. package/src/themes/boomdevs/01-settings/_settings.typography.scss +0 -58
  217. package/src/themes/boomdevs/01-settings/_settings.video-player.scss +0 -12
  218. package/src/themes/boomdevs/02-tools/_index.scss +0 -7
  219. package/src/themes/boomdevs/03-generic/_index.scss +0 -7
  220. package/src/themes/boomdevs/04-elements/_index.scss +0 -7
  221. package/src/themes/boomdevs/05-objects/_index.scss +0 -7
  222. package/src/themes/boomdevs/06-components/_components.button.scss +0 -11
  223. package/src/themes/boomdevs/06-components/_index.scss +0 -11
  224. package/src/themes/boomdevs/99-utilities/_index.scss +0 -7
  225. package/src/themes/boomdevs/index.scss +0 -26
  226. package/src/themes/esrar/01-settings/_index.scss +0 -15
  227. package/src/themes/esrar/01-settings/_settings.colors.scss +0 -91
  228. package/src/themes/esrar/02-tools/_index.scss +0 -8
  229. package/src/themes/esrar/02-tools/_tools.animations.scss +0 -342
  230. package/src/themes/esrar/06-components/_components.accordion.scss +0 -49
  231. package/src/themes/esrar/06-components/_components.avatar-group.scss +0 -14
  232. package/src/themes/esrar/06-components/_components.avatar.scss +0 -61
  233. package/src/themes/esrar/06-components/_components.badge.scss +0 -117
  234. package/src/themes/esrar/06-components/_components.breadcrumb.scss +0 -65
  235. package/src/themes/esrar/06-components/_components.btn-group.scss +0 -19
  236. package/src/themes/esrar/06-components/_components.button.scss +0 -224
  237. package/src/themes/esrar/06-components/_components.callout.scss +0 -51
  238. package/src/themes/esrar/06-components/_components.card.scss +0 -134
  239. package/src/themes/esrar/06-components/_components.chart.scss +0 -24
  240. package/src/themes/esrar/06-components/_components.checkbox-group.scss +0 -26
  241. package/src/themes/esrar/06-components/_components.checkbox.scss +0 -71
  242. package/src/themes/esrar/06-components/_components.color-mode-toggle.scss +0 -29
  243. package/src/themes/esrar/06-components/_components.countdown.scss +0 -67
  244. package/src/themes/esrar/06-components/_components.data-table.scss +0 -22
  245. package/src/themes/esrar/06-components/_components.datepicker.scss +0 -20
  246. package/src/themes/esrar/06-components/_components.dropdown.scss +0 -272
  247. package/src/themes/esrar/06-components/_components.edge-panel.scss +0 -10
  248. package/src/themes/esrar/06-components/_components.form-group.scss +0 -15
  249. package/src/themes/esrar/06-components/_components.form.scss +0 -66
  250. package/src/themes/esrar/06-components/_components.hero.scss +0 -251
  251. package/src/themes/esrar/06-components/_components.icon.scss +0 -33
  252. package/src/themes/esrar/06-components/_components.image-gallery.scss +0 -29
  253. package/src/themes/esrar/06-components/_components.input.scss +0 -91
  254. package/src/themes/esrar/06-components/_components.list-group.scss +0 -26
  255. package/src/themes/esrar/06-components/_components.modal.scss +0 -148
  256. package/src/themes/esrar/06-components/_components.notification.scss +0 -80
  257. package/src/themes/esrar/06-components/_components.pagination.scss +0 -84
  258. package/src/themes/esrar/06-components/_components.popover.scss +0 -10
  259. package/src/themes/esrar/06-components/_components.progress.scss +0 -64
  260. package/src/themes/esrar/06-components/_components.rating.scss +0 -26
  261. package/src/themes/esrar/06-components/_components.skeleton.scss +0 -15
  262. package/src/themes/esrar/06-components/_components.slider.scss +0 -90
  263. package/src/themes/esrar/06-components/_components.spinner.scss +0 -71
  264. package/src/themes/esrar/06-components/_components.steps.scss +0 -76
  265. package/src/themes/esrar/06-components/_components.tab.scss +0 -58
  266. package/src/themes/esrar/06-components/_components.tag.scss +0 -21
  267. package/src/themes/esrar/06-components/_components.timeline.scss +0 -19
  268. package/src/themes/esrar/06-components/_components.toast.scss +0 -91
  269. package/src/themes/esrar/06-components/_components.toggle.scss +0 -74
  270. package/src/themes/esrar/06-components/_components.tooltip.scss +0 -45
  271. package/src/themes/esrar/06-components/_components.upload.scss +0 -102
  272. package/src/themes/esrar/06-components/_index.scss +0 -42
  273. package/src/themes/esrar/index.scss +0 -30
  274. package/src/themes/flashtrade/01-settings/_index.scss +0 -19
  275. package/src/themes/flashtrade/01-settings/_settings.animations.scss +0 -11
  276. package/src/themes/flashtrade/01-settings/_settings.background.scss +0 -9
  277. package/src/themes/flashtrade/01-settings/_settings.colors.scss +0 -79
  278. package/src/themes/flashtrade/01-settings/_settings.config.scss +0 -16
  279. package/src/themes/flashtrade/01-settings/_settings.typography.scss +0 -35
  280. package/src/themes/flashtrade/02-tools/_index.scss +0 -8
  281. package/src/themes/flashtrade/03-generic/_index.scss +0 -8
  282. package/src/themes/flashtrade/04-elements/_index.scss +0 -12
  283. package/src/themes/flashtrade/05-objects/_index.scss +0 -8
  284. package/src/themes/flashtrade/06-components/_components.badge.scss +0 -156
  285. package/src/themes/flashtrade/06-components/_components.button.scss +0 -135
  286. package/src/themes/flashtrade/06-components/_components.card.scss +0 -214
  287. package/src/themes/flashtrade/06-components/_components.navbar.scss +0 -227
  288. package/src/themes/flashtrade/06-components/_index.scss +0 -13
  289. package/src/themes/flashtrade/99-utilities/_index.scss +0 -9
  290. package/src/themes/flashtrade/99-utilities/_utilities.trading.scss +0 -187
  291. package/src/themes/flashtrade/README.md +0 -386
  292. package/src/themes/flashtrade/demo.html +0 -272
  293. package/src/themes/flashtrade/index.scss +0 -36
  294. package/src/themes/mashroom/01-settings/_index.scss +0 -69
  295. package/src/themes/mashroom/01-settings/_settings.accordion.scss +0 -32
  296. package/src/themes/mashroom/01-settings/_settings.animations.scss +0 -26
  297. package/src/themes/mashroom/01-settings/_settings.avatar-group.scss +0 -22
  298. package/src/themes/mashroom/01-settings/_settings.avatar.scss +0 -57
  299. package/src/themes/mashroom/01-settings/_settings.badge.scss +0 -19
  300. package/src/themes/mashroom/01-settings/_settings.border-radius.scss +0 -24
  301. package/src/themes/mashroom/01-settings/_settings.border.scss +0 -14
  302. package/src/themes/mashroom/01-settings/_settings.box-shadow.scss +0 -40
  303. package/src/themes/mashroom/01-settings/_settings.breadcrumb.scss +0 -0
  304. package/src/themes/mashroom/01-settings/_settings.breakpoints.scss +0 -17
  305. package/src/themes/mashroom/01-settings/_settings.btn-group.scss +0 -5
  306. package/src/themes/mashroom/01-settings/_settings.button.scss +0 -50
  307. package/src/themes/mashroom/01-settings/_settings.callout.scss +0 -81
  308. package/src/themes/mashroom/01-settings/_settings.card.scss +0 -52
  309. package/src/themes/mashroom/01-settings/_settings.checkbox-group.scss +0 -5
  310. package/src/themes/mashroom/01-settings/_settings.checkbox.scss +0 -23
  311. package/src/themes/mashroom/01-settings/_settings.color-mode.scss +0 -7
  312. package/src/themes/mashroom/01-settings/_settings.colors.scss +0 -180
  313. package/src/themes/mashroom/01-settings/_settings.config.scss +0 -4
  314. package/src/themes/mashroom/01-settings/_settings.countdown.scss +0 -20
  315. package/src/themes/mashroom/01-settings/_settings.data-table.scss +0 -56
  316. package/src/themes/mashroom/01-settings/_settings.datepicker.scss +0 -45
  317. package/src/themes/mashroom/01-settings/_settings.design-tokens.scss +0 -3
  318. package/src/themes/mashroom/01-settings/_settings.dropdown.scss +0 -45
  319. package/src/themes/mashroom/01-settings/_settings.edge-panel.scss +0 -24
  320. package/src/themes/mashroom/01-settings/_settings.fonts.scss +0 -8
  321. package/src/themes/mashroom/01-settings/_settings.form-group.scss +0 -14
  322. package/src/themes/mashroom/01-settings/_settings.form.scss +0 -6
  323. package/src/themes/mashroom/01-settings/_settings.grid.scss +0 -23
  324. package/src/themes/mashroom/01-settings/_settings.hero.scss +0 -41
  325. package/src/themes/mashroom/01-settings/_settings.input.scss +0 -51
  326. package/src/themes/mashroom/01-settings/_settings.link.scss +0 -13
  327. package/src/themes/mashroom/01-settings/_settings.list-group.scss +0 -16
  328. package/src/themes/mashroom/01-settings/_settings.list.scss +0 -13
  329. package/src/themes/mashroom/01-settings/_settings.masonry-grid.scss +0 -23
  330. package/src/themes/mashroom/01-settings/_settings.menu.scss +0 -50
  331. package/src/themes/mashroom/01-settings/_settings.messages.scss +0 -98
  332. package/src/themes/mashroom/01-settings/_settings.modal.scss +0 -41
  333. package/src/themes/mashroom/01-settings/_settings.nav.scss +0 -20
  334. package/src/themes/mashroom/01-settings/_settings.navbar.scss +0 -54
  335. package/src/themes/mashroom/01-settings/_settings.pagination.scss +0 -30
  336. package/src/themes/mashroom/01-settings/_settings.photoviewer.scss +0 -45
  337. package/src/themes/mashroom/01-settings/_settings.popover.scss +0 -20
  338. package/src/themes/mashroom/01-settings/_settings.position.scss +0 -9
  339. package/src/themes/mashroom/01-settings/_settings.progress.scss +0 -17
  340. package/src/themes/mashroom/01-settings/_settings.rating.scss +0 -11
  341. package/src/themes/mashroom/01-settings/_settings.river.scss +0 -50
  342. package/src/themes/mashroom/01-settings/_settings.sectionintro.scss +0 -31
  343. package/src/themes/mashroom/01-settings/_settings.select.scss +0 -47
  344. package/src/themes/mashroom/01-settings/_settings.side-menu.scss +0 -79
  345. package/src/themes/mashroom/01-settings/_settings.skeleton.scss +0 -24
  346. package/src/themes/mashroom/01-settings/_settings.spacing.scss +0 -66
  347. package/src/themes/mashroom/01-settings/_settings.spinner.scss +0 -34
  348. package/src/themes/mashroom/01-settings/_settings.steps.scss +0 -33
  349. package/src/themes/mashroom/01-settings/_settings.tabs.scss +0 -33
  350. package/src/themes/mashroom/01-settings/_settings.testimonials.scss +0 -24
  351. package/src/themes/mashroom/01-settings/_settings.todo.scss +0 -52
  352. package/src/themes/mashroom/01-settings/_settings.toggle.scss +0 -49
  353. package/src/themes/mashroom/01-settings/_settings.tooltip.scss +0 -20
  354. package/src/themes/mashroom/01-settings/_settings.typography.scss +0 -95
  355. package/src/themes/mashroom/01-settings/_settings.upload.scss +0 -96
  356. package/src/themes/mashroom/01-settings/_settings.z-layers.scss +0 -19
  357. package/src/themes/mashroom/02-tools/_index.scss +0 -8
  358. package/src/themes/mashroom/02-tools/_tools.psychedelic-gradients.scss +0 -78
  359. package/src/themes/mashroom/02-tools/_tools.trippy-effects.scss +0 -114
  360. package/src/themes/mashroom/03-generic/_index.scss +0 -6
  361. package/src/themes/mashroom/04-elements/_index.scss +0 -6
  362. package/src/themes/mashroom/05-objects/_index.scss +0 -6
  363. package/src/themes/mashroom/06-components/_components.accordion.scss +0 -187
  364. package/src/themes/mashroom/06-components/_components.avatar-group.scss +0 -276
  365. package/src/themes/mashroom/06-components/_components.avatar.scss +0 -114
  366. package/src/themes/mashroom/06-components/_components.badge.scss +0 -152
  367. package/src/themes/mashroom/06-components/_components.breadcrumb.scss +0 -162
  368. package/src/themes/mashroom/06-components/_components.btn-group.scss +0 -404
  369. package/src/themes/mashroom/06-components/_components.button.scss +0 -160
  370. package/src/themes/mashroom/06-components/_components.callout.scss +0 -140
  371. package/src/themes/mashroom/06-components/_components.card.scss +0 -225
  372. package/src/themes/mashroom/06-components/_components.checkbox.scss +0 -186
  373. package/src/themes/mashroom/06-components/_components.color-mode-toggle.scss +0 -308
  374. package/src/themes/mashroom/06-components/_components.countdown.scss +0 -402
  375. package/src/themes/mashroom/06-components/_components.data-table.scss +0 -354
  376. package/src/themes/mashroom/06-components/_components.datepicker.scss +0 -349
  377. package/src/themes/mashroom/06-components/_components.dropdown.scss +0 -334
  378. package/src/themes/mashroom/06-components/_components.edge-panel.scss +0 -413
  379. package/src/themes/mashroom/06-components/_components.form-group.scss +0 -433
  380. package/src/themes/mashroom/06-components/_components.form.scss +0 -358
  381. package/src/themes/mashroom/06-components/_components.hero.scss +0 -151
  382. package/src/themes/mashroom/06-components/_components.input.scss +0 -147
  383. package/src/themes/mashroom/06-components/_components.list-group.scss +0 -456
  384. package/src/themes/mashroom/06-components/_components.list.scss +0 -145
  385. package/src/themes/mashroom/06-components/_components.menu.scss +0 -497
  386. package/src/themes/mashroom/06-components/_components.messages.scss +0 -277
  387. package/src/themes/mashroom/06-components/_components.modal.scss +0 -264
  388. package/src/themes/mashroom/06-components/_components.nav.scss +0 -181
  389. package/src/themes/mashroom/06-components/_components.navbar.scss +0 -538
  390. package/src/themes/mashroom/06-components/_components.pagination.scss +0 -400
  391. package/src/themes/mashroom/06-components/_components.photoviewer.scss +0 -498
  392. package/src/themes/mashroom/06-components/_components.popover.scss +0 -383
  393. package/src/themes/mashroom/06-components/_components.product-review.scss +0 -408
  394. package/src/themes/mashroom/06-components/_components.progress.scss +0 -249
  395. package/src/themes/mashroom/06-components/_components.rating.scss +0 -300
  396. package/src/themes/mashroom/06-components/_components.river.scss +0 -570
  397. package/src/themes/mashroom/06-components/_components.sectionintro.scss +0 -546
  398. package/src/themes/mashroom/06-components/_components.select.scss +0 -455
  399. package/src/themes/mashroom/06-components/_components.side-menu.scss +0 -635
  400. package/src/themes/mashroom/06-components/_components.skeleton.scss +0 -447
  401. package/src/themes/mashroom/06-components/_components.slider.scss +0 -414
  402. package/src/themes/mashroom/06-components/_components.spinner.scss +0 -198
  403. package/src/themes/mashroom/06-components/_components.steps.scss +0 -350
  404. package/src/themes/mashroom/06-components/_components.tabs.scss +0 -269
  405. package/src/themes/mashroom/06-components/_components.testimonials.scss +0 -561
  406. package/src/themes/mashroom/06-components/_components.toggle.scss +0 -231
  407. package/src/themes/mashroom/06-components/_components.tooltip.scss +0 -167
  408. package/src/themes/mashroom/06-components/_components.upload.scss +0 -537
  409. package/src/themes/mashroom/06-components/_components.video-player.scss +0 -560
  410. package/src/themes/mashroom/06-components/_index.scss +0 -55
  411. package/src/themes/mashroom/99-utilities/_index.scss +0 -6
  412. package/src/themes/mashroom/index.scss +0 -26
  413. package/src/themes/shaj-default/01-settings/_index.scss +0 -69
  414. package/src/themes/shaj-default/01-settings/_settings.accordion.scss +0 -38
  415. package/src/themes/shaj-default/01-settings/_settings.animations.scss +0 -32
  416. package/src/themes/shaj-default/01-settings/_settings.avatar-group.scss +0 -28
  417. package/src/themes/shaj-default/01-settings/_settings.avatar.scss +0 -63
  418. package/src/themes/shaj-default/01-settings/_settings.badge.scss +0 -25
  419. package/src/themes/shaj-default/01-settings/_settings.border-radius.scss +0 -24
  420. package/src/themes/shaj-default/01-settings/_settings.border.scss +0 -20
  421. package/src/themes/shaj-default/01-settings/_settings.box-shadow.scss +0 -46
  422. package/src/themes/shaj-default/01-settings/_settings.breadcrumb.scss +0 -0
  423. package/src/themes/shaj-default/01-settings/_settings.breakpoints.scss +0 -23
  424. package/src/themes/shaj-default/01-settings/_settings.btn-group.scss +0 -11
  425. package/src/themes/shaj-default/01-settings/_settings.button.scss +0 -56
  426. package/src/themes/shaj-default/01-settings/_settings.callout.scss +0 -87
  427. package/src/themes/shaj-default/01-settings/_settings.card.scss +0 -52
  428. package/src/themes/shaj-default/01-settings/_settings.checkbox-group.scss +0 -11
  429. package/src/themes/shaj-default/01-settings/_settings.checkbox.scss +0 -29
  430. package/src/themes/shaj-default/01-settings/_settings.color-mode.scss +0 -13
  431. package/src/themes/shaj-default/01-settings/_settings.colors.scss +0 -91
  432. package/src/themes/shaj-default/01-settings/_settings.config.scss +0 -4
  433. package/src/themes/shaj-default/01-settings/_settings.countdown.scss +0 -26
  434. package/src/themes/shaj-default/01-settings/_settings.data-table.scss +0 -62
  435. package/src/themes/shaj-default/01-settings/_settings.datepicker.scss +0 -51
  436. package/src/themes/shaj-default/01-settings/_settings.design-tokens.scss +0 -9
  437. package/src/themes/shaj-default/01-settings/_settings.dropdown.scss +0 -51
  438. package/src/themes/shaj-default/01-settings/_settings.edge-panel.scss +0 -30
  439. package/src/themes/shaj-default/01-settings/_settings.fonts.scss +0 -13
  440. package/src/themes/shaj-default/01-settings/_settings.form-group.scss +0 -20
  441. package/src/themes/shaj-default/01-settings/_settings.form.scss +0 -12
  442. package/src/themes/shaj-default/01-settings/_settings.grid.scss +0 -29
  443. package/src/themes/shaj-default/01-settings/_settings.hero.scss +0 -47
  444. package/src/themes/shaj-default/01-settings/_settings.input.scss +0 -57
  445. package/src/themes/shaj-default/01-settings/_settings.link.scss +0 -19
  446. package/src/themes/shaj-default/01-settings/_settings.list-group.scss +0 -22
  447. package/src/themes/shaj-default/01-settings/_settings.list.scss +0 -19
  448. package/src/themes/shaj-default/01-settings/_settings.masonry-grid.scss +0 -29
  449. package/src/themes/shaj-default/01-settings/_settings.menu.scss +0 -56
  450. package/src/themes/shaj-default/01-settings/_settings.messages.scss +0 -104
  451. package/src/themes/shaj-default/01-settings/_settings.modal.scss +0 -47
  452. package/src/themes/shaj-default/01-settings/_settings.nav.scss +0 -26
  453. package/src/themes/shaj-default/01-settings/_settings.navbar.scss +0 -60
  454. package/src/themes/shaj-default/01-settings/_settings.pagination.scss +0 -36
  455. package/src/themes/shaj-default/01-settings/_settings.photoviewer.scss +0 -51
  456. package/src/themes/shaj-default/01-settings/_settings.popover.scss +0 -26
  457. package/src/themes/shaj-default/01-settings/_settings.position.scss +0 -15
  458. package/src/themes/shaj-default/01-settings/_settings.progress.scss +0 -23
  459. package/src/themes/shaj-default/01-settings/_settings.rating.scss +0 -17
  460. package/src/themes/shaj-default/01-settings/_settings.river.scss +0 -56
  461. package/src/themes/shaj-default/01-settings/_settings.sectionintro.scss +0 -37
  462. package/src/themes/shaj-default/01-settings/_settings.select.scss +0 -53
  463. package/src/themes/shaj-default/01-settings/_settings.side-menu.scss +0 -85
  464. package/src/themes/shaj-default/01-settings/_settings.skeleton.scss +0 -30
  465. package/src/themes/shaj-default/01-settings/_settings.spacing.scss +0 -72
  466. package/src/themes/shaj-default/01-settings/_settings.spinner.scss +0 -24
  467. package/src/themes/shaj-default/01-settings/_settings.steps.scss +0 -39
  468. package/src/themes/shaj-default/01-settings/_settings.tabs.scss +0 -39
  469. package/src/themes/shaj-default/01-settings/_settings.testimonials.scss +0 -30
  470. package/src/themes/shaj-default/01-settings/_settings.todo.scss +0 -58
  471. package/src/themes/shaj-default/01-settings/_settings.toggle.scss +0 -55
  472. package/src/themes/shaj-default/01-settings/_settings.tooltip.scss +0 -26
  473. package/src/themes/shaj-default/01-settings/_settings.typography.scss +0 -101
  474. package/src/themes/shaj-default/01-settings/_settings.upload.scss +0 -102
  475. package/src/themes/shaj-default/01-settings/_settings.z-layers.scss +0 -25
  476. package/src/themes/shaj-default/02-tools/_index.scss +0 -0
  477. package/src/themes/shaj-default/03-generic/_generic.root.scss +0 -0
  478. package/src/themes/shaj-default/03-generic/_index.scss +0 -2
  479. package/src/themes/shaj-default/04-elements/_index.scss +0 -0
  480. package/src/themes/shaj-default/05-objects/_index.scss +0 -0
  481. package/src/themes/shaj-default/06-components/_components.button.scss +0 -55
  482. package/src/themes/shaj-default/06-components/_components.card.scss +0 -57
  483. package/src/themes/shaj-default/06-components/_components.input.scss +0 -58
  484. package/src/themes/shaj-default/06-components/_components.navbar.scss +0 -99
  485. package/src/themes/shaj-default/06-components/_components.tooltip.scss +0 -0
  486. package/src/themes/shaj-default/06-components/_index.scss +0 -13
  487. package/src/themes/shaj-default/99-utilities/_index.scss +0 -0
  488. package/src/themes/shaj-default/index.scss +0 -25
  489. package/theme.config.ts +0 -360
@@ -70,35 +70,33 @@ export function useChartPerformance() {
70
70
  height: number,
71
71
  padding: { top: number; right: number; bottom: number; left: number }
72
72
  ) => {
73
- return useMemo(() => {
74
- if (!datasets.length) return null;
75
-
76
- const innerWidth = width - padding.left - padding.right;
77
- const innerHeight = height - padding.top - padding.bottom;
78
-
79
- // Calculate bounds efficiently
80
- const allValues = datasets.flatMap(dataset => dataset.data.map(d => d.value));
81
- const minValue = Math.min(...allValues);
82
- const maxValue = Math.max(...allValues);
83
- const valueRange = maxValue - minValue;
84
-
85
- // Pre-calculate scale functions for better performance
86
- const xScale = (i: number, dataLength: number) =>
87
- padding.left + (i / (dataLength - 1)) * innerWidth;
88
-
89
- const yScale = (value: number) =>
90
- padding.top + innerHeight - ((value - minValue) / valueRange) * innerHeight;
91
-
92
- return {
93
- xScale,
94
- yScale,
95
- minValue,
96
- maxValue,
97
- valueRange,
98
- innerWidth,
99
- innerHeight,
100
- };
101
- }, [datasets, width, height, padding.top, padding.right, padding.bottom, padding.left]);
73
+ if (!datasets.length) return null;
74
+
75
+ const innerWidth = width - padding.left - padding.right;
76
+ const innerHeight = height - padding.top - padding.bottom;
77
+
78
+ // Calculate bounds efficiently
79
+ const allValues = datasets.flatMap(dataset => dataset.data.map(d => d.value));
80
+ const minValue = Math.min(...allValues);
81
+ const maxValue = Math.max(...allValues);
82
+ const valueRange = maxValue - minValue;
83
+
84
+ // Pre-calculate scale functions for better performance
85
+ const xScale = (i: number, dataLength: number) =>
86
+ padding.left + (i / (dataLength - 1)) * innerWidth;
87
+
88
+ const yScale = (value: number) =>
89
+ padding.top + innerHeight - ((value - minValue) / valueRange) * innerHeight;
90
+
91
+ return {
92
+ xScale,
93
+ yScale,
94
+ minValue,
95
+ maxValue,
96
+ valueRange,
97
+ innerWidth,
98
+ innerHeight,
99
+ };
102
100
  },
103
101
  []
104
102
  );
@@ -113,47 +111,65 @@ export function useChartPerformance() {
113
111
  viewportEnd: number,
114
112
  bufferSize: number = 50
115
113
  ) => {
116
- return useMemo(() => {
117
- if (data.length <= 1000) {
118
- // No virtualization needed for small datasets
119
- return {
120
- visibleData: data,
121
- startIndex: 0,
122
- endIndex: data.length - 1,
123
- isVirtualized: false,
124
- };
125
- }
126
-
127
- const start = Math.max(0, viewportStart - bufferSize);
128
- const end = Math.min(data.length - 1, viewportEnd + bufferSize);
129
-
114
+ if (data.length <= 1000) {
115
+ // No virtualization needed for small datasets
130
116
  return {
131
- visibleData: data.slice(start, end + 1),
132
- startIndex: start,
133
- endIndex: end,
134
- isVirtualized: true,
135
- totalLength: data.length,
117
+ visibleData: data,
118
+ startIndex: 0,
119
+ endIndex: data.length - 1,
120
+ isVirtualized: false,
136
121
  };
137
- }, [data, viewportStart, viewportEnd, bufferSize]);
122
+ }
123
+
124
+ const start = Math.max(0, viewportStart - bufferSize);
125
+ const end = Math.min(data.length - 1, viewportEnd + bufferSize);
126
+
127
+ return {
128
+ visibleData: data.slice(start, end + 1),
129
+ startIndex: start,
130
+ endIndex: end,
131
+ isVirtualized: true,
132
+ totalLength: data.length,
133
+ };
138
134
  },
139
135
  []
140
136
  );
141
137
 
142
138
  /**
143
139
  * Debounced data updates for real-time charts
140
+ * Returns a debounced function that maintains timeout state across calls
141
+ * Uses a closure to maintain state - each call to useDebouncedUpdates creates
142
+ * a new debounced function with its own persistent timeout state
144
143
  */
145
144
  const useDebouncedUpdates = useCallback((updateFunction: () => void, delay: number = 100) => {
146
- const timeoutRef = useRef<NodeJS.Timeout | null>(null);
147
-
148
- return useCallback(() => {
149
- if (timeoutRef.current) {
150
- clearTimeout(timeoutRef.current);
145
+ // Use a closure variable to maintain timeout state across multiple calls to the returned function
146
+ // This variable is created once when useDebouncedUpdates is called and persists
147
+ // across all invocations of the returned debounced function
148
+ let timeoutId: NodeJS.Timeout | null = null;
149
+
150
+ const debouncedFn: (() => void) & { cancel: () => void } = () => {
151
+ // Clear any existing timeout before setting a new one
152
+ if (timeoutId !== null) {
153
+ clearTimeout(timeoutId);
154
+ timeoutId = null;
151
155
  }
152
156
 
153
- timeoutRef.current = setTimeout(() => {
157
+ // Set new timeout and store the ID
158
+ timeoutId = setTimeout(() => {
154
159
  updateFunction();
160
+ timeoutId = null;
155
161
  }, delay);
156
- }, [updateFunction, delay]);
162
+ };
163
+
164
+ // Add cleanup method to cancel pending debounced calls
165
+ debouncedFn.cancel = () => {
166
+ if (timeoutId !== null) {
167
+ clearTimeout(timeoutId);
168
+ timeoutId = null;
169
+ }
170
+ };
171
+
172
+ return debouncedFn;
157
173
  }, []);
158
174
 
159
175
  /**
@@ -192,32 +208,40 @@ export function useChartPerformance() {
192
208
 
193
209
  /**
194
210
  * Optimized animation frame handling
211
+ * Returns animation control functions that maintain state across calls
212
+ * Uses closures to maintain state - each call to useAnimationFrame creates
213
+ * a new animation controller with its own persistent state
195
214
  */
196
215
  const useAnimationFrame = useCallback((callback: () => void) => {
197
- const requestRef = useRef<number | null>(null);
198
- const previousTimeRef = useRef<number | null>(null);
199
-
200
- const animate = useCallback(
201
- (time: number) => {
202
- if (previousTimeRef.current !== undefined) {
203
- const deltaTime = time - (previousTimeRef.current || 0);
204
- callback();
205
- }
206
- previousTimeRef.current = time;
207
- requestRef.current = requestAnimationFrame(animate);
208
- },
209
- [callback]
210
- );
211
-
212
- const startAnimation = useCallback(() => {
213
- requestRef.current = requestAnimationFrame(animate);
214
- }, [animate]);
216
+ // Use closure variables to maintain animation state across multiple calls
217
+ // These variables are created once when useAnimationFrame is called and persist
218
+ // across all invocations of the returned animation control functions
219
+ let requestId: number | null = null;
220
+ let previousTime: number | null = null;
221
+
222
+ const animate = (time: number) => {
223
+ if (previousTime !== null && previousTime !== undefined) {
224
+ const deltaTime = time - previousTime;
225
+ callback();
226
+ }
227
+ previousTime = time;
228
+ requestId = requestAnimationFrame(animate);
229
+ };
230
+
231
+ const startAnimation = () => {
232
+ // Only start if not already running
233
+ if (requestId === null) {
234
+ requestId = requestAnimationFrame(animate);
235
+ }
236
+ };
215
237
 
216
- const stopAnimation = useCallback(() => {
217
- if (requestRef.current) {
218
- cancelAnimationFrame(requestRef.current);
238
+ const stopAnimation = () => {
239
+ if (requestId !== null) {
240
+ cancelAnimationFrame(requestId);
241
+ requestId = null;
219
242
  }
220
- }, []);
243
+ previousTime = null;
244
+ };
221
245
 
222
246
  return { startAnimation, stopAnimation };
223
247
  }, []);
@@ -18,6 +18,11 @@ export function useChartScale(
18
18
  return {
19
19
  xScale: () => padding.left,
20
20
  yScale: () => padding.top + innerHeight,
21
+ minValue: 0,
22
+ maxValue: 0,
23
+ valueRange: 0,
24
+ innerWidth,
25
+ innerHeight,
21
26
  width,
22
27
  height,
23
28
  padding,
@@ -40,6 +45,11 @@ export function useChartScale(
40
45
  return {
41
46
  xScale,
42
47
  yScale,
48
+ minValue,
49
+ maxValue,
50
+ valueRange,
51
+ innerWidth,
52
+ innerHeight,
43
53
  width,
44
54
  height,
45
55
  padding,
@@ -97,10 +97,17 @@ export function useHero(initialProps?: Partial<HeroProps>): UseHeroResult {
97
97
  const hasBackgroundSlider = !!defaultProps.backgroundSlider;
98
98
 
99
99
  /**
100
- * Initialize background slider hook if enabled
100
+ * Initialize background slider hook - always call hook, conditionally use result
101
101
  */
102
+ const backgroundSliderResult = useHeroBackgroundSlider(
103
+ defaultProps.backgroundSlider || {
104
+ slides: [],
105
+ autoplay: { delay: 5000, pauseOnHover: true }
106
+ }
107
+ );
108
+
102
109
  const backgroundSlider = hasBackgroundSlider && defaultProps.backgroundSlider
103
- ? useHeroBackgroundSlider(defaultProps.backgroundSlider)
110
+ ? backgroundSliderResult
104
111
  : undefined;
105
112
 
106
113
  /**
@@ -89,8 +89,9 @@ export function useHeroBackgroundSlider(
89
89
 
90
90
  // Play video if it's a video slide
91
91
  const currentVideo = videoRefs[nextIndex]?.current;
92
- if (currentVideo && slides[nextIndex].type === 'video') {
93
- const videoOptions = slides[nextIndex].videoOptions || {};
92
+ const nextSlide = slides[nextIndex];
93
+ if (currentVideo && nextSlide && nextSlide.type === 'video') {
94
+ const videoOptions = nextSlide.videoOptions || {};
94
95
  if (videoOptions.autoplay !== false) {
95
96
  currentVideo.play().catch(() => {
96
97
  // Ignore autoplay errors
@@ -100,7 +101,8 @@ export function useHeroBackgroundSlider(
100
101
 
101
102
  // Pause previous video if it exists
102
103
  const prevVideo = videoRefs[currentIndex]?.current;
103
- if (prevVideo && slides[currentIndex].type === 'video') {
104
+ const currentSlide = slides[currentIndex];
105
+ if (prevVideo && currentSlide && currentSlide.type === 'video') {
104
106
  prevVideo.pause();
105
107
  }
106
108
 
@@ -60,6 +60,7 @@ export function useSideMenu(initialProps?: Partial<SideMenuProps>) {
60
60
  } else if (!shouldCollapse && wrapperRef.current) {
61
61
  wrapperRef.current.style.height = 'auto';
62
62
  }
63
+ return undefined;
63
64
  }, []); // Only run on mount
64
65
 
65
66
  // Handle responsive behavior - vertical collapse for both mobile and desktop
@@ -41,18 +41,19 @@ export function useVideoPlayer({
41
41
  const [currentQuality, setCurrentQuality] = useState<VideoQuality | null>(quality?.[0] || null);
42
42
  const [showControls, setShowControls] = useState(true);
43
43
 
44
- const controlsTimeoutRef = useRef<NodeJS.Timeout>(null);
44
+ const controlsTimeoutRef = useRef<NodeJS.Timeout | null>(null);
45
45
 
46
46
  const resetControlsTimeout = useCallback(() => {
47
47
  if (controlsTimeoutRef.current) {
48
48
  clearTimeout(controlsTimeoutRef.current);
49
49
  }
50
50
  setShowControls(true);
51
- controlsTimeoutRef.current = setTimeout(() => {
51
+ const timeout = setTimeout(() => {
52
52
  if (isPlaying) {
53
53
  setShowControls(false);
54
54
  }
55
55
  }, 3000);
56
+ controlsTimeoutRef.current = timeout;
56
57
  }, [isPlaying]);
57
58
 
58
59
  const play = useCallback(async () => {
@@ -0,0 +1,275 @@
1
+ /**
2
+ * Atomix Configuration System
3
+ *
4
+ * Tailwind-like configuration for customizing the Atomix Design System.
5
+ *
6
+ * External developers can create `atomix.config.ts` in their project root
7
+ * to customize design tokens, similar to Tailwind's tailwind.config.js
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // atomix.config.ts (in your project)
12
+ * import { defineConfig } from '@shohojdhara/atomix/config';
13
+ *
14
+ * export default defineConfig({
15
+ * theme: {
16
+ * extend: {
17
+ * colors: {
18
+ * primary: { main: '#7AFFD7' },
19
+ * },
20
+ * },
21
+ * },
22
+ * });
23
+ * ```
24
+ */
25
+
26
+ import type { Theme } from '../theme/types';
27
+
28
+ /**
29
+ * Color Scale (1-10)
30
+ */
31
+ export interface ColorScale {
32
+ 1?: string;
33
+ 2?: string;
34
+ 3?: string;
35
+ 4?: string;
36
+ 5?: string;
37
+ 6?: string;
38
+ 7?: string;
39
+ 8?: string;
40
+ 9?: string;
41
+ 10?: string;
42
+ [key: string]: string | undefined;
43
+ }
44
+
45
+ /**
46
+ * Palette Color Options
47
+ */
48
+ export interface PaletteColorOptions {
49
+ main: string;
50
+ light?: string;
51
+ dark?: string;
52
+ contrastText?: string;
53
+ }
54
+
55
+ /**
56
+ * Design Tokens Schema (Tailwind-like)
57
+ */
58
+ export interface ThemeTokens {
59
+ /** Color palette */
60
+ colors?: Record<string, string | PaletteColorOptions | ColorScale | Record<string, string>>;
61
+ /** Spacing scale */
62
+ spacing?: Record<string, string>;
63
+ /** Border radius scale */
64
+ borderRadius?: Record<string, string>;
65
+ /** Typography scale and settings */
66
+ typography?: {
67
+ fontFamilies?: Record<string, string>;
68
+ fontSizes?: Record<string, string>;
69
+ fontWeights?: Record<string, string | number>;
70
+ lineHeights?: Record<string, string | number>;
71
+ letterSpacings?: Record<string, string>;
72
+ };
73
+ /** Shadow scale */
74
+ shadows?: Record<string, string>;
75
+ /** Z-index scale */
76
+ zIndex?: Record<string, string | number>;
77
+ /** Breakpoints scale */
78
+ breakpoints?: Record<string, string | number>;
79
+ /** Transitions settings */
80
+ transitions?: {
81
+ durations?: Record<string, string>;
82
+ easings?: Record<string, string>;
83
+ };
84
+ }
85
+
86
+ /**
87
+ * CSS Theme Definition
88
+ */
89
+ export interface CSSThemeDefinition {
90
+ type: 'css';
91
+ name: string;
92
+ class?: string;
93
+ description?: string;
94
+ author?: string;
95
+ version?: string;
96
+ tags?: string[];
97
+ supportsDarkMode?: boolean;
98
+ status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
99
+ a11y?: {
100
+ contrastTarget?: number;
101
+ modes?: string[];
102
+ };
103
+ color?: string;
104
+ features?: string[];
105
+ dependencies?: string[];
106
+ cssPath?: string;
107
+ }
108
+
109
+ /**
110
+ * JavaScript Theme Definition
111
+ */
112
+ export interface JSThemeDefinition {
113
+ type: 'js';
114
+ name: string;
115
+ class?: string;
116
+ description?: string;
117
+ author?: string;
118
+ version?: string;
119
+ tags?: string[];
120
+ supportsDarkMode?: boolean;
121
+ status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
122
+ a11y?: {
123
+ contrastTarget?: number;
124
+ modes?: string[];
125
+ };
126
+ color?: string;
127
+ features?: string[];
128
+ dependencies?: string[];
129
+ createTheme: () => Theme;
130
+ }
131
+
132
+ /**
133
+ * Theme Definition (CSS or JS)
134
+ */
135
+ export type ThemeDefinition = CSSThemeDefinition | JSThemeDefinition;
136
+
137
+ /**
138
+ * Build configuration (migrated from theme.config.ts)
139
+ */
140
+ export interface BuildConfig {
141
+ output?: {
142
+ directory?: string;
143
+ formats?: {
144
+ expanded?: string;
145
+ compressed?: string;
146
+ };
147
+ };
148
+ sass?: {
149
+ style?: 'expanded' | 'compressed';
150
+ sourceMap?: boolean;
151
+ loadPaths?: string[];
152
+ };
153
+ }
154
+
155
+ /**
156
+ * Runtime configuration (migrated from theme.config.ts)
157
+ */
158
+ export interface RuntimeConfig {
159
+ basePath?: string;
160
+ cdnPath?: string | null;
161
+ preload?: string[];
162
+ lazy?: boolean;
163
+ defaultTheme?: string;
164
+ storageKey?: string;
165
+ dataAttribute?: string;
166
+ enablePersistence?: boolean;
167
+ useMinified?: boolean;
168
+ }
169
+
170
+ /**
171
+ * Integration settings (migrated from theme.config.ts)
172
+ */
173
+ export interface IntegrationConfig {
174
+ cssVariables?: Record<string, string>;
175
+ classNames?: {
176
+ theme?: string;
177
+ colorMode?: string;
178
+ };
179
+ }
180
+
181
+ /**
182
+ * Atomix Configuration Interface
183
+ *
184
+ * Tailwind-like configuration for external developers.
185
+ * Focus on theme customization - build/runtime configs are internal only.
186
+ */
187
+ export interface AtomixConfig {
188
+ /**
189
+ * CSS variable prefix (default: 'atomix')
190
+ *
191
+ * Change this to customize all CSS variable names.
192
+ * Example: prefix: 'myapp' → --myapp-primary instead of --atomix-primary
193
+ */
194
+ prefix?: string;
195
+
196
+ /**
197
+ * Theme customization (Tailwind-like)
198
+ *
199
+ * Use `extend` to add or override design tokens.
200
+ * Use `tokens` to completely replace the default token system (advanced).
201
+ */
202
+ theme?: {
203
+ /**
204
+ * Extend the default design tokens
205
+ *
206
+ * This is the recommended way to customize Atomix.
207
+ * Your values will override or extend the base tokens.
208
+ */
209
+ extend?: ThemeTokens;
210
+
211
+ /**
212
+ * Override the default tokens entirely (advanced)
213
+ *
214
+ * Use with caution - this replaces the entire token system.
215
+ * Most users should use `extend` instead.
216
+ */
217
+ tokens?: ThemeTokens;
218
+
219
+ /**
220
+ * Register custom themes (optional)
221
+ *
222
+ * Define CSS or JavaScript themes that can be loaded dynamically.
223
+ */
224
+ themes?: Record<string, ThemeDefinition>;
225
+ };
226
+
227
+ // Internal configurations (for library development only)
228
+ // These are not needed for external developers
229
+ /** @internal Build configuration (internal use only) */
230
+ build?: BuildConfig;
231
+ /** @internal Runtime configuration (internal use only) */
232
+ runtime?: RuntimeConfig;
233
+ /** @internal Integration settings (internal use only) */
234
+ integration?: IntegrationConfig;
235
+ /** @internal Theme dependencies mapping (internal use only) */
236
+ dependencies?: Record<string, string[]>;
237
+ }
238
+
239
+ /**
240
+ * Helper function to define Atomix configuration with type safety
241
+ *
242
+ * @param config - Atomix configuration object
243
+ * @returns The configuration object
244
+ */
245
+ /**
246
+ * Helper function to define Atomix configuration with type safety
247
+ *
248
+ * Similar to Tailwind's defineConfig, provides autocomplete and type checking.
249
+ *
250
+ * @param config - Atomix configuration object
251
+ * @returns The configuration object
252
+ *
253
+ * @example
254
+ * ```typescript
255
+ * import { defineConfig } from '@shohojdhara/atomix/config';
256
+ *
257
+ * export default defineConfig({
258
+ * theme: {
259
+ * extend: {
260
+ * colors: {
261
+ * primary: { main: '#7AFFD7' },
262
+ * },
263
+ * },
264
+ * },
265
+ * });
266
+ * ```
267
+ */
268
+ export function defineConfig(config: AtomixConfig): AtomixConfig {
269
+ return config;
270
+ }
271
+
272
+ // Export loader functions
273
+ export { loadAtomixConfig, resolveConfigPath } from './loader';
274
+
275
+ export default AtomixConfig;