@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
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Theme CLI Bridge
3
+ *
4
+ * Bridges the TypeScript theme devtools CLI with the main JavaScript CLI
5
+ */
6
+
7
+ import { spawn } from 'child_process';
8
+ import { join, dirname } from 'path';
9
+ import { fileURLToPath } from 'url';
10
+ import chalk from 'chalk';
11
+ import ora from 'ora';
12
+
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = dirname(__filename);
15
+
16
+ /**
17
+ * Execute theme CLI command
18
+ */
19
+ export async function executeThemeCommand(command, args = [], options = {}) {
20
+ const spinner = options.spinner || ora(`Running theme ${command}...`).start();
21
+
22
+ try {
23
+ // Path to the theme CLI
24
+ const themeCliPath = join(__dirname, '../../src/lib/theme/devtools/CLI.ts');
25
+
26
+ // Use ts-node to execute TypeScript CLI
27
+ const tsNodePath = join(__dirname, '../../node_modules/.bin/ts-node');
28
+
29
+ return new Promise((resolve, reject) => {
30
+ const child = spawn(tsNodePath, [themeCliPath, command, ...args], {
31
+ stdio: 'inherit',
32
+ cwd: process.cwd(),
33
+ });
34
+
35
+ child.on('close', (code) => {
36
+ if (code === 0) {
37
+ spinner.succeed(chalk.green(`āœ“ Theme ${command} completed`));
38
+ resolve();
39
+ } else {
40
+ spinner.fail(chalk.red(`āœ— Theme ${command} failed`));
41
+ reject(new Error(`Theme command failed with code ${code}`));
42
+ }
43
+ });
44
+
45
+ child.on('error', (error) => {
46
+ spinner.fail(chalk.red(`āœ— Theme ${command} failed`));
47
+ reject(error);
48
+ });
49
+ });
50
+ } catch (error) {
51
+ spinner.fail(chalk.red(`āœ— Theme ${command} failed`));
52
+ throw error;
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Create theme CLI bridge
58
+ */
59
+ export function createThemeCLIBridge() {
60
+ return {
61
+ /**
62
+ * Validate theme configuration
63
+ */
64
+ async validate(options = {}) {
65
+ const args = [];
66
+ if (options.config) args.push('--config', options.config);
67
+ if (options.strict) args.push('--strict');
68
+
69
+ return executeThemeCommand('validate', args, options);
70
+ },
71
+
72
+ /**
73
+ * List all themes
74
+ */
75
+ async list(options = {}) {
76
+ return executeThemeCommand('list', [], options);
77
+ },
78
+
79
+ /**
80
+ * Inspect a theme
81
+ */
82
+ async inspect(themeName, options = {}) {
83
+ const args = ['--theme', themeName];
84
+ if (options.json) args.push('--json');
85
+
86
+ return executeThemeCommand('inspect', args, options);
87
+ },
88
+
89
+ /**
90
+ * Compare two themes
91
+ */
92
+ async compare(theme1, theme2, options = {}) {
93
+ const args = ['--theme1', theme1, '--theme2', theme2];
94
+
95
+ return executeThemeCommand('compare', args, options);
96
+ },
97
+
98
+ /**
99
+ * Export a theme
100
+ */
101
+ async export(themeName, options = {}) {
102
+ const args = ['--theme', themeName];
103
+ if (options.output) args.push('--output', options.output);
104
+
105
+ return executeThemeCommand('export', args, options);
106
+ },
107
+ };
108
+ }
109
+
110
+ /**
111
+ * Check if theme CLI is available
112
+ */
113
+ export async function isThemeCLIAvailable() {
114
+ try {
115
+ const themeCliPath = join(__dirname, '../../src/lib/theme/devtools/CLI.ts');
116
+ const { access } = await import('fs/promises');
117
+ await access(themeCliPath);
118
+ return true;
119
+ } catch {
120
+ return false;
121
+ }
122
+ }
123
+
124
+ export default {
125
+ createThemeCLIBridge,
126
+ executeThemeCommand,
127
+ isThemeCLIAvailable,
128
+ };
129
+
@@ -433,13 +433,38 @@ export async function importTokens(filePath, options = {}) {
433
433
 
434
434
  case 'js':
435
435
  case 'ts':
436
- // Extract tokens from JS/TS export
437
- const match = content.match(/export\s+(?:const|default)\s+\w*\s*=\s*({[\s\S]*})/);
438
- if (match) {
439
- // Simple eval (be careful in production)
440
- tokens = eval(`(${match[1]})`);
441
- } else {
442
- throw new Error('Could not parse JavaScript/TypeScript tokens');
436
+ // Parse tokens safely without eval
437
+ try {
438
+ // Try to parse as JSON first (common case)
439
+ const jsonMatch = content.match(/export\s+(?:const|default)\s+\w*\s*=\s*({[\s\S]*})/);
440
+ if (jsonMatch) {
441
+ // Extract the object literal and clean it up
442
+ let objectStr = jsonMatch[1];
443
+
444
+ // Remove trailing semicolon if present
445
+ objectStr = objectStr.replace(/;\s*$/, '');
446
+
447
+ // Try direct JSON parsing first
448
+ try {
449
+ tokens = JSON.parse(objectStr);
450
+ } catch {
451
+ // If that fails, try to convert JS object to JSON
452
+ // This handles single quotes and unquoted keys
453
+ objectStr = objectStr
454
+ // Replace single quotes with double quotes
455
+ .replace(/'/g, '"')
456
+ // Add quotes to unquoted keys
457
+ .replace(/(\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g, '$1"$2":')
458
+ // Handle trailing commas
459
+ .replace(/,(\s*[}\]])/g, '$1');
460
+
461
+ tokens = JSON.parse(objectStr);
462
+ }
463
+ } else {
464
+ throw new Error('Could not find token export in JavaScript/TypeScript file');
465
+ }
466
+ } catch (error) {
467
+ throw new Error(`Could not parse JavaScript/TypeScript tokens: ${error.message}`);
443
468
  }
444
469
  break;
445
470
 
@@ -0,0 +1,347 @@
1
+ /**
2
+ * CLI Utility Functions
3
+ * Provides common utilities for the Atomix CLI including security, validation, and helpers
4
+ */
5
+
6
+ import { resolve, relative, isAbsolute, normalize } from 'path';
7
+ import { existsSync } from 'fs';
8
+ import { access } from 'fs/promises';
9
+
10
+ /**
11
+ * Validates and sanitizes file paths to prevent directory traversal attacks
12
+ * @param {string} inputPath - The path to validate
13
+ * @param {string} basePath - The base directory (defaults to process.cwd())
14
+ * @returns {Object} { isValid: boolean, safePath: string, error?: string }
15
+ */
16
+ export function validatePath(inputPath, basePath = process.cwd()) {
17
+ try {
18
+ // Normalize the paths to remove any '..' or '.' segments
19
+ const normalizedBase = normalize(resolve(basePath));
20
+ const normalizedInput = normalize(isAbsolute(inputPath)
21
+ ? inputPath
22
+ : resolve(basePath, inputPath));
23
+
24
+ // Check if the resolved path is within the base directory
25
+ const relativePath = relative(normalizedBase, normalizedInput);
26
+
27
+ // If the relative path starts with '..', it's outside the base directory
28
+ if (relativePath.startsWith('..')) {
29
+ return {
30
+ isValid: false,
31
+ safePath: null,
32
+ error: 'Path is outside the project directory'
33
+ };
34
+ }
35
+
36
+ // Additional checks for sensitive paths
37
+ const sensitivePatterns = [
38
+ /^\.git/,
39
+ /node_modules/,
40
+ /^\.env/,
41
+ /\.pem$/,
42
+ /\.key$/,
43
+ /private/i,
44
+ /secret/i
45
+ ];
46
+
47
+ for (const pattern of sensitivePatterns) {
48
+ if (pattern.test(relativePath)) {
49
+ return {
50
+ isValid: false,
51
+ safePath: null,
52
+ error: `Access to sensitive path is restricted: ${pattern}`
53
+ };
54
+ }
55
+ }
56
+
57
+ return {
58
+ isValid: true,
59
+ safePath: normalizedInput,
60
+ error: null
61
+ };
62
+ } catch (error) {
63
+ return {
64
+ isValid: false,
65
+ safePath: null,
66
+ error: `Invalid path: ${error.message}`
67
+ };
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Validates component names according to PascalCase convention
73
+ * @param {string} name - The component name to validate
74
+ * @returns {Object} { isValid: boolean, error?: string }
75
+ */
76
+ export function validateComponentName(name) {
77
+ if (!name || typeof name !== 'string') {
78
+ return {
79
+ isValid: false,
80
+ error: 'Component name must be a non-empty string'
81
+ };
82
+ }
83
+
84
+ // Check PascalCase: starts with uppercase, only contains letters and numbers
85
+ if (!/^[A-Z][a-zA-Z0-9]*$/.test(name)) {
86
+ return {
87
+ isValid: false,
88
+ error: 'Component name must be in PascalCase (e.g., Button, CardHeader)'
89
+ };
90
+ }
91
+
92
+ // Check for reserved words
93
+ const reservedWords = [
94
+ 'Component', 'React', 'Fragment', 'Suspense', 'StrictMode',
95
+ 'Error', 'Loading', 'App', 'Root', 'Document', 'Html'
96
+ ];
97
+
98
+ if (reservedWords.includes(name)) {
99
+ return {
100
+ isValid: false,
101
+ error: `"${name}" is a reserved word. Please choose a different name.`
102
+ };
103
+ }
104
+
105
+ // Check minimum length
106
+ if (name.length < 2) {
107
+ return {
108
+ isValid: false,
109
+ error: 'Component name must be at least 2 characters long'
110
+ };
111
+ }
112
+
113
+ return { isValid: true };
114
+ }
115
+
116
+ /**
117
+ * Validates theme names according to kebab-case convention
118
+ * @param {string} name - The theme name to validate
119
+ * @returns {Object} { isValid: boolean, error?: string }
120
+ */
121
+ export function validateThemeName(name) {
122
+ if (!name || typeof name !== 'string') {
123
+ return {
124
+ isValid: false,
125
+ error: 'Theme name must be a non-empty string'
126
+ };
127
+ }
128
+
129
+ // Check kebab-case: lowercase letters, numbers, and hyphens
130
+ if (!/^[a-z][a-z0-9-]*$/.test(name)) {
131
+ return {
132
+ isValid: false,
133
+ error: 'Theme name must be lowercase and use hyphens (e.g., dark-theme)'
134
+ };
135
+ }
136
+
137
+ // Check for consecutive hyphens
138
+ if (/--/.test(name)) {
139
+ return {
140
+ isValid: false,
141
+ error: 'Theme name cannot contain consecutive hyphens'
142
+ };
143
+ }
144
+
145
+ // Check for trailing hyphen
146
+ if (name.endsWith('-')) {
147
+ return {
148
+ isValid: false,
149
+ error: 'Theme name cannot end with a hyphen'
150
+ };
151
+ }
152
+
153
+ return { isValid: true };
154
+ }
155
+
156
+ /**
157
+ * Sanitizes user input to prevent injection attacks
158
+ * @param {string} input - The user input to sanitize
159
+ * @returns {string} Sanitized input
160
+ */
161
+ export function sanitizeInput(input) {
162
+ if (typeof input !== 'string') {
163
+ return String(input);
164
+ }
165
+
166
+ // Remove any shell metacharacters that could be dangerous
167
+ return input
168
+ .replace(/[;&|`$<>\\]/g, '')
169
+ .replace(/\0/g, '') // Remove null bytes
170
+ .trim();
171
+ }
172
+
173
+ /**
174
+ * Checks if a file exists and is accessible
175
+ * @param {string} filePath - Path to check
176
+ * @returns {Promise<boolean>}
177
+ */
178
+ export async function fileExists(filePath) {
179
+ try {
180
+ await access(filePath);
181
+ return true;
182
+ } catch {
183
+ return false;
184
+ }
185
+ }
186
+
187
+ /**
188
+ * Checks if running in CI environment
189
+ * @returns {boolean}
190
+ */
191
+ export function isCI() {
192
+ return !!(
193
+ process.env.CI ||
194
+ process.env.CONTINUOUS_INTEGRATION ||
195
+ process.env.GITHUB_ACTIONS ||
196
+ process.env.GITLAB_CI ||
197
+ process.env.CIRCLECI ||
198
+ process.env.TRAVIS ||
199
+ process.env.JENKINS_URL
200
+ );
201
+ }
202
+
203
+ /**
204
+ * Checks if running in debug mode
205
+ * @returns {boolean}
206
+ */
207
+ export function isDebug() {
208
+ return process.env.ATOMIX_DEBUG === 'true' ||
209
+ process.argv.includes('--debug') ||
210
+ process.argv.includes('-d');
211
+ }
212
+
213
+ /**
214
+ * Formats file size in human readable format
215
+ * @param {number} bytes - File size in bytes
216
+ * @returns {string} Formatted size
217
+ */
218
+ export function formatFileSize(bytes) {
219
+ const sizes = ['B', 'KB', 'MB', 'GB'];
220
+ if (bytes === 0) return '0 B';
221
+ const i = Math.floor(Math.log(bytes) / Math.log(1024));
222
+ return `${(bytes / Math.pow(1024, i)).toFixed(2)} ${sizes[i]}`;
223
+ }
224
+
225
+ /**
226
+ * Debounce function for watch mode
227
+ * @param {Function} func - Function to debounce
228
+ * @param {number} wait - Wait time in milliseconds
229
+ * @returns {Function} Debounced function
230
+ */
231
+ export function debounce(func, wait) {
232
+ let timeout;
233
+ return function executedFunction(...args) {
234
+ const later = () => {
235
+ clearTimeout(timeout);
236
+ func(...args);
237
+ };
238
+ clearTimeout(timeout);
239
+ timeout = setTimeout(later, wait);
240
+ };
241
+ }
242
+
243
+ /**
244
+ * Creates a safe file path for cross-platform compatibility
245
+ * @param {...string} segments - Path segments
246
+ * @returns {string} Safe file path
247
+ */
248
+ export function safePath(...segments) {
249
+ // Filter out empty segments and join with proper separator
250
+ return segments
251
+ .filter(Boolean)
252
+ .join('/')
253
+ .replace(/\/+/g, '/') // Remove duplicate slashes
254
+ .replace(/\\/g, '/'); // Convert Windows backslashes
255
+ }
256
+
257
+ /**
258
+ * Validates SCSS/CSS color values
259
+ * @param {string} color - Color value to validate
260
+ * @returns {boolean}
261
+ */
262
+ export function isValidColor(color) {
263
+ const patterns = [
264
+ /^#[0-9A-F]{3}$/i, // #RGB
265
+ /^#[0-9A-F]{4}$/i, // #RGBA
266
+ /^#[0-9A-F]{6}$/i, // #RRGGBB
267
+ /^#[0-9A-F]{8}$/i, // #RRGGBBAA
268
+ /^rgb\(/i, // rgb()
269
+ /^rgba\(/i, // rgba()
270
+ /^hsl\(/i, // hsl()
271
+ /^hsla\(/i, // hsla()
272
+ /^var\(--/ // CSS custom property
273
+ ];
274
+
275
+ return patterns.some(pattern => pattern.test(color));
276
+ }
277
+
278
+ /**
279
+ * Extracts and validates npm scripts from package.json
280
+ * @param {Object} packageJson - Parsed package.json content
281
+ * @param {Array<string>} requiredScripts - List of required script names
282
+ * @returns {Object} { valid: boolean, missing: Array<string> }
283
+ */
284
+ export function validateNpmScripts(packageJson, requiredScripts = []) {
285
+ const scripts = packageJson.scripts || {};
286
+ const missing = requiredScripts.filter(script => !scripts[script]);
287
+
288
+ return {
289
+ valid: missing.length === 0,
290
+ missing
291
+ };
292
+ }
293
+
294
+ /**
295
+ * Generates a unique ID for components/themes
296
+ * @param {string} prefix - Prefix for the ID
297
+ * @returns {string} Unique ID
298
+ */
299
+ export function generateId(prefix = 'atomix') {
300
+ const timestamp = Date.now().toString(36);
301
+ const random = Math.random().toString(36).substring(2, 7);
302
+ return `${prefix}-${timestamp}-${random}`;
303
+ }
304
+
305
+ /**
306
+ * Checks Node.js version compatibility
307
+ * @param {string} requiredVersion - Minimum required version (e.g., '18.0.0')
308
+ * @returns {Object} { compatible: boolean, current: string, required: string }
309
+ */
310
+ export function checkNodeVersion(requiredVersion = '18.0.0') {
311
+ const currentVersion = process.version.substring(1); // Remove 'v' prefix
312
+ const current = currentVersion.split('.').map(Number);
313
+ const required = requiredVersion.split('.').map(Number);
314
+
315
+ let compatible = true;
316
+ for (let i = 0; i < required.length; i++) {
317
+ if (current[i] < required[i]) {
318
+ compatible = false;
319
+ break;
320
+ } else if (current[i] > required[i]) {
321
+ break;
322
+ }
323
+ }
324
+
325
+ return {
326
+ compatible,
327
+ current: currentVersion,
328
+ required: requiredVersion
329
+ };
330
+ }
331
+
332
+ export default {
333
+ validatePath,
334
+ validateComponentName,
335
+ validateThemeName,
336
+ sanitizeInput,
337
+ fileExists,
338
+ isCI,
339
+ isDebug,
340
+ formatFileSize,
341
+ debounce,
342
+ safePath,
343
+ isValidColor,
344
+ validateNpmScripts,
345
+ generateId,
346
+ checkNodeVersion
347
+ };
@@ -25,7 +25,7 @@ const THEMES_CONFIG_JS = join(__dirname, '../src/themes/themes.config.js');
25
25
  async function parseThemeConfigTS() {
26
26
  try {
27
27
  const content = await readFile(THEME_CONFIG_TS, 'utf8');
28
-
28
+
29
29
  // Extract themes object
30
30
  const themesMatch = content.match(/themes:\s*{([^}]+(?:{[^}]*}[^}]*)*[^}]+)}/s);
31
31
  if (!themesMatch) {
@@ -36,10 +36,10 @@ async function parseThemeConfigTS() {
36
36
  const themes = {};
37
37
  const themeRegex = /['"]([^'"]+)['"]\s*:\s*{([^}]+(?:{[^}]*}[^}]*)*[^}]+)}/gs;
38
38
  let match;
39
-
39
+
40
40
  while ((match = themeRegex.exec(themesMatch[1])) !== null) {
41
41
  const [, themeName, themeConfig] = match;
42
-
42
+
43
43
  // Parse theme properties
44
44
  const theme = {
45
45
  name: extractValue(themeConfig, 'name'),
@@ -51,7 +51,7 @@ async function parseThemeConfigTS() {
51
51
  status: extractValue(themeConfig, 'status'),
52
52
  color: extractValue(themeConfig, 'color'),
53
53
  };
54
-
54
+
55
55
  // Parse features if present
56
56
  const featuresMatch = themeConfig.match(/features:\s*\[([^\]]*)\]/s);
57
57
  if (featuresMatch) {
@@ -60,7 +60,7 @@ async function parseThemeConfigTS() {
60
60
  .map(f => f.trim().replace(/['"]/g, ''))
61
61
  .filter(f => f.length > 0);
62
62
  }
63
-
63
+
64
64
  // Parse a11y if present
65
65
  const a11yMatch = themeConfig.match(/a11y:\s*{([^}]*)}/);
66
66
  if (a11yMatch) {
@@ -69,28 +69,28 @@ async function parseThemeConfigTS() {
69
69
  modes: extractArray(a11yMatch[1], 'modes'),
70
70
  };
71
71
  }
72
-
72
+
73
73
  themes[themeName] = theme;
74
74
  }
75
-
75
+
76
76
  // Extract build configuration
77
77
  const buildMatch = content.match(/build:\s*(defaultBuildConfig|{[^}]+})/);
78
- const build = buildMatch && buildMatch[1] === 'defaultBuildConfig'
79
- ? getDefaultBuildConfig()
78
+ const build = buildMatch && buildMatch[1] === 'defaultBuildConfig'
79
+ ? getDefaultBuildConfig()
80
80
  : parseBuildConfig(buildMatch?.[1]);
81
-
81
+
82
82
  // Extract runtime configuration
83
83
  const runtimeMatch = content.match(/runtime:\s*(defaultRuntimeConfig|{[^}]+})/);
84
84
  const runtime = runtimeMatch && runtimeMatch[1] === 'defaultRuntimeConfig'
85
85
  ? getDefaultRuntimeConfig()
86
86
  : parseRuntimeConfig(runtimeMatch?.[1]);
87
-
87
+
88
88
  // Extract integration configuration
89
89
  const integrationMatch = content.match(/integration:\s*(defaultIntegrationConfig|{[^}]+})/);
90
90
  const integration = integrationMatch && integrationMatch[1] === 'defaultIntegrationConfig'
91
91
  ? getDefaultIntegrationConfig()
92
92
  : parseIntegrationConfig(integrationMatch?.[1]);
93
-
93
+
94
94
  return {
95
95
  themes,
96
96
  build,
@@ -138,7 +138,7 @@ function extractArray(text, key) {
138
138
  const regex = new RegExp(`${key}:\\s*\\[([^\\]]*)\\]`);
139
139
  const match = text.match(regex);
140
140
  if (!match) return undefined;
141
-
141
+
142
142
  return match[1]
143
143
  .split(',')
144
144
  .map(item => item.trim().replace(/['"]/g, ''))
@@ -172,9 +172,9 @@ function getDefaultRuntimeConfig() {
172
172
  return {
173
173
  basePath: '/themes',
174
174
  cdnPath: null,
175
- preload: ['shaj-default'],
175
+ preload: [],
176
176
  lazy: true,
177
- defaultTheme: 'shaj-default',
177
+ defaultTheme: '',
178
178
  storageKey: 'atomix-theme',
179
179
  useMinified: "process.env.NODE_ENV === 'production'",
180
180
  };
@@ -230,7 +230,7 @@ function parseIntegrationConfig(configText) {
230
230
  */
231
231
  function generateThemesConfigJS(config) {
232
232
  const { themes, build, runtime, integration, dependencies } = config;
233
-
233
+
234
234
  // Convert themes to metadata format
235
235
  const metadata = {};
236
236
  for (const [key, theme] of Object.entries(themes)) {
@@ -242,7 +242,7 @@ function generateThemesConfigJS(config) {
242
242
  }
243
243
  });
244
244
  }
245
-
245
+
246
246
  return `/**
247
247
  * Theme Configuration
248
248
  *
@@ -281,24 +281,24 @@ export const themesConfig = {
281
281
  */
282
282
  async function main() {
283
283
  console.log('šŸ”„ Syncing theme configuration...\n');
284
-
284
+
285
285
  try {
286
286
  // Parse theme.config.ts
287
287
  console.log('šŸ“– Reading theme.config.ts...');
288
288
  const config = await parseThemeConfigTS();
289
289
  console.log(` āœ… Found ${Object.keys(config.themes).length} themes`);
290
-
290
+
291
291
  // Generate themes.config.js
292
292
  console.log('\nšŸ“ Generating themes.config.js...');
293
293
  const jsContent = generateThemesConfigJS(config);
294
-
294
+
295
295
  // Write to file
296
296
  await writeFile(THEMES_CONFIG_JS, jsContent, 'utf8');
297
297
  console.log(' āœ… Written to src/themes/themes.config.js');
298
-
298
+
299
299
  console.log('\n✨ Configuration sync complete!');
300
300
  console.log(' themes.config.js has been updated from theme.config.ts');
301
-
301
+
302
302
  } catch (error) {
303
303
  console.error('\nšŸ’„ Sync failed:', error.message);
304
304
  process.exit(1);