@shohojdhara/atomix 0.3.3 ā 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -28
- package/dist/atomix.css +13 -6
- package/dist/atomix.min.css +1 -1
- package/dist/index.d.ts +912 -505
- package/dist/index.esm.js +2924 -2133
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2719 -1916
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +11 -62
- package/scripts/atomix-cli.js +338 -2
- package/scripts/cli/interactive-init.js +36 -44
- package/scripts/cli/theme-bridge.js +129 -0
- package/scripts/sync-theme-config.js +22 -22
- package/src/components/Button/Button.tsx +36 -1
- package/src/lib/config/index.ts +275 -0
- package/src/lib/config/loader.ts +105 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/theme/composeTheme.ts +0 -5
- package/src/lib/theme/config/index.ts +1 -1
- package/src/lib/theme/config/loader.ts +75 -41
- package/src/lib/theme/config/types.ts +21 -7
- package/src/lib/theme/config/validator.ts +1 -1
- package/src/lib/theme/constants.ts +12 -2
- package/src/lib/theme/createTheme.ts +0 -1
- package/src/lib/theme/createThemeFromConfig.ts +132 -0
- package/src/lib/theme/devtools/CLI.ts +161 -76
- package/src/lib/theme/devtools/Comparator.tsx +343 -0
- package/src/lib/theme/devtools/IMPROVEMENTS.md +429 -0
- package/src/lib/theme/devtools/Inspector.tsx +21 -6
- package/src/lib/theme/devtools/LiveEditor.tsx +393 -0
- package/src/lib/theme/devtools/README.md +433 -0
- package/src/lib/theme/devtools/index.ts +12 -11
- package/src/lib/theme/generateCSSVariables.ts +79 -38
- package/src/lib/theme/index.ts +18 -2
- package/src/lib/theme/runtime/ThemeManager.test.ts +17 -1
- package/src/lib/theme/runtime/ThemeManager.ts +7 -7
- package/src/lib/theme/types.ts +42 -43
- package/src/lib/theme-tools.ts +7 -67
- package/src/lib/types/components.ts +69 -75
- package/src/styles/01-settings/_settings.navbar.scss +1 -1
- package/src/styles/03-generic/_generated-root.css +5 -0
- package/src/styles/06-components/_components.navbar.scss +12 -5
- package/src/themes/README.md +1 -2
- package/src/themes/themes.config.js +10 -194
- package/dist/themes/applemix.css +0 -16576
- package/dist/themes/applemix.css.map +0 -1
- package/dist/themes/applemix.min.css +0 -73
- package/dist/themes/boomdevs.css +0 -16007
- package/dist/themes/boomdevs.css.map +0 -1
- package/dist/themes/boomdevs.min.css +0 -406
- package/dist/themes/esrar.css +0 -18424
- package/dist/themes/esrar.css.map +0 -1
- package/dist/themes/esrar.min.css +0 -221
- package/dist/themes/flashtrade.css +0 -17596
- package/dist/themes/flashtrade.css.map +0 -1
- package/dist/themes/flashtrade.min.css +0 -196
- package/dist/themes/mashroom.css +0 -31082
- package/dist/themes/mashroom.css.map +0 -1
- package/dist/themes/mashroom.min.css +0 -450
- package/dist/themes/shaj-default.css +0 -17200
- package/dist/themes/shaj-default.css.map +0 -1
- package/dist/themes/shaj-default.min.css +0 -502
- package/src/lib/theme/__tests__/ThemeBuilder.test.ts +0 -223
- package/src/lib/theme/builders/ThemeBuilder.ts +0 -372
- package/src/lib/theme/errors.test.ts +0 -207
- package/src/lib/theme/generators/CSSGenerator.ts +0 -311
- package/src/lib/theme/generators/ConfigGenerator.ts +0 -287
- package/src/lib/theme/generators/TypeGenerator.ts +0 -228
- package/src/lib/theme/generators/index.ts +0 -21
- package/src/lib/theme/monitoring/ThemeAnalytics.ts +0 -409
- package/src/lib/theme/monitoring/index.ts +0 -17
- package/src/lib/theme/overrides/ComponentOverrides.ts +0 -243
- package/src/lib/theme/overrides/index.ts +0 -15
- package/src/lib/theme/whitelabel/WhiteLabelManager.ts +0 -364
- package/src/lib/theme/whitelabel/index.ts +0 -13
- package/src/themes/THEME_CHECKLIST.md +0 -74
- package/src/themes/applemix/01-settings/_index.scss +0 -24
- package/src/themes/applemix/01-settings/_settings.animations.scss +0 -0
- package/src/themes/applemix/01-settings/_settings.background.scss +0 -6
- package/src/themes/applemix/01-settings/_settings.colors.scss +0 -75
- package/src/themes/applemix/01-settings/_settings.config.scss +0 -15
- package/src/themes/applemix/01-settings/_settings.typography.scss +0 -30
- package/src/themes/applemix/02-tools/_index.scss +0 -4
- package/src/themes/applemix/03-generic/_index.scss +0 -7
- package/src/themes/applemix/04-elements/_index.scss +0 -7
- package/src/themes/applemix/05-objects/_index.scss +0 -7
- package/src/themes/applemix/06-components/_index.scss +0 -15
- package/src/themes/applemix/99-utilities/_index.scss +0 -7
- package/src/themes/applemix/README.md +0 -378
- package/src/themes/applemix/index.scss +0 -33
- package/src/themes/boomdevs/01-settings/_index.scss +0 -38
- package/src/themes/boomdevs/01-settings/_settings.accordion.scss +0 -12
- package/src/themes/boomdevs/01-settings/_settings.animations.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.avatar.scss +0 -9
- package/src/themes/boomdevs/01-settings/_settings.badge.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.border-radius.scss +0 -16
- package/src/themes/boomdevs/01-settings/_settings.border.scss +0 -10
- package/src/themes/boomdevs/01-settings/_settings.box-shadow.scss +0 -14
- package/src/themes/boomdevs/01-settings/_settings.breadcrumb.scss +0 -13
- package/src/themes/boomdevs/01-settings/_settings.breakpoints.scss +0 -15
- package/src/themes/boomdevs/01-settings/_settings.button.scss +0 -9
- package/src/themes/boomdevs/01-settings/_settings.callout.scss +0 -9
- package/src/themes/boomdevs/01-settings/_settings.card.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.checkbox.scss +0 -9
- package/src/themes/boomdevs/01-settings/_settings.colors.scss +0 -145
- package/src/themes/boomdevs/01-settings/_settings.dropdown.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.grid.scss +0 -16
- package/src/themes/boomdevs/01-settings/_settings.input.scss +0 -14
- package/src/themes/boomdevs/01-settings/_settings.link.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.list.scss +0 -10
- package/src/themes/boomdevs/01-settings/_settings.modal.scss +0 -16
- package/src/themes/boomdevs/01-settings/_settings.navbar.scss +0 -16
- package/src/themes/boomdevs/01-settings/_settings.pagination.scss +0 -13
- package/src/themes/boomdevs/01-settings/_settings.progress.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.rating.scss +0 -10
- package/src/themes/boomdevs/01-settings/_settings.spacing.scss +0 -33
- package/src/themes/boomdevs/01-settings/_settings.spinner.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.steps.scss +0 -12
- package/src/themes/boomdevs/01-settings/_settings.tabs.scss +0 -12
- package/src/themes/boomdevs/01-settings/_settings.todo.scss +0 -15
- package/src/themes/boomdevs/01-settings/_settings.toggle.scss +0 -14
- package/src/themes/boomdevs/01-settings/_settings.tooltip.scss +0 -13
- package/src/themes/boomdevs/01-settings/_settings.typography.scss +0 -58
- package/src/themes/boomdevs/01-settings/_settings.video-player.scss +0 -12
- package/src/themes/boomdevs/02-tools/_index.scss +0 -7
- package/src/themes/boomdevs/03-generic/_index.scss +0 -7
- package/src/themes/boomdevs/04-elements/_index.scss +0 -7
- package/src/themes/boomdevs/05-objects/_index.scss +0 -7
- package/src/themes/boomdevs/06-components/_components.button.scss +0 -11
- package/src/themes/boomdevs/06-components/_index.scss +0 -11
- package/src/themes/boomdevs/99-utilities/_index.scss +0 -7
- package/src/themes/boomdevs/index.scss +0 -26
- package/src/themes/esrar/01-settings/_index.scss +0 -15
- package/src/themes/esrar/01-settings/_settings.colors.scss +0 -91
- package/src/themes/esrar/02-tools/_index.scss +0 -8
- package/src/themes/esrar/02-tools/_tools.animations.scss +0 -342
- package/src/themes/esrar/06-components/_components.accordion.scss +0 -49
- package/src/themes/esrar/06-components/_components.avatar-group.scss +0 -14
- package/src/themes/esrar/06-components/_components.avatar.scss +0 -61
- package/src/themes/esrar/06-components/_components.badge.scss +0 -117
- package/src/themes/esrar/06-components/_components.breadcrumb.scss +0 -65
- package/src/themes/esrar/06-components/_components.btn-group.scss +0 -19
- package/src/themes/esrar/06-components/_components.button.scss +0 -224
- package/src/themes/esrar/06-components/_components.callout.scss +0 -51
- package/src/themes/esrar/06-components/_components.card.scss +0 -134
- package/src/themes/esrar/06-components/_components.chart.scss +0 -24
- package/src/themes/esrar/06-components/_components.checkbox-group.scss +0 -26
- package/src/themes/esrar/06-components/_components.checkbox.scss +0 -71
- package/src/themes/esrar/06-components/_components.color-mode-toggle.scss +0 -29
- package/src/themes/esrar/06-components/_components.countdown.scss +0 -67
- package/src/themes/esrar/06-components/_components.data-table.scss +0 -22
- package/src/themes/esrar/06-components/_components.datepicker.scss +0 -20
- package/src/themes/esrar/06-components/_components.dropdown.scss +0 -272
- package/src/themes/esrar/06-components/_components.edge-panel.scss +0 -10
- package/src/themes/esrar/06-components/_components.form-group.scss +0 -15
- package/src/themes/esrar/06-components/_components.form.scss +0 -66
- package/src/themes/esrar/06-components/_components.hero.scss +0 -251
- package/src/themes/esrar/06-components/_components.icon.scss +0 -33
- package/src/themes/esrar/06-components/_components.image-gallery.scss +0 -29
- package/src/themes/esrar/06-components/_components.input.scss +0 -91
- package/src/themes/esrar/06-components/_components.list-group.scss +0 -26
- package/src/themes/esrar/06-components/_components.modal.scss +0 -148
- package/src/themes/esrar/06-components/_components.notification.scss +0 -80
- package/src/themes/esrar/06-components/_components.pagination.scss +0 -84
- package/src/themes/esrar/06-components/_components.popover.scss +0 -10
- package/src/themes/esrar/06-components/_components.progress.scss +0 -64
- package/src/themes/esrar/06-components/_components.rating.scss +0 -26
- package/src/themes/esrar/06-components/_components.skeleton.scss +0 -15
- package/src/themes/esrar/06-components/_components.slider.scss +0 -90
- package/src/themes/esrar/06-components/_components.spinner.scss +0 -71
- package/src/themes/esrar/06-components/_components.steps.scss +0 -76
- package/src/themes/esrar/06-components/_components.tab.scss +0 -58
- package/src/themes/esrar/06-components/_components.tag.scss +0 -21
- package/src/themes/esrar/06-components/_components.timeline.scss +0 -19
- package/src/themes/esrar/06-components/_components.toast.scss +0 -91
- package/src/themes/esrar/06-components/_components.toggle.scss +0 -74
- package/src/themes/esrar/06-components/_components.tooltip.scss +0 -45
- package/src/themes/esrar/06-components/_components.upload.scss +0 -102
- package/src/themes/esrar/06-components/_index.scss +0 -42
- package/src/themes/esrar/index.scss +0 -30
- package/src/themes/flashtrade/01-settings/_index.scss +0 -19
- package/src/themes/flashtrade/01-settings/_settings.animations.scss +0 -11
- package/src/themes/flashtrade/01-settings/_settings.background.scss +0 -9
- package/src/themes/flashtrade/01-settings/_settings.colors.scss +0 -79
- package/src/themes/flashtrade/01-settings/_settings.config.scss +0 -16
- package/src/themes/flashtrade/01-settings/_settings.typography.scss +0 -35
- package/src/themes/flashtrade/02-tools/_index.scss +0 -8
- package/src/themes/flashtrade/03-generic/_index.scss +0 -8
- package/src/themes/flashtrade/04-elements/_index.scss +0 -12
- package/src/themes/flashtrade/05-objects/_index.scss +0 -8
- package/src/themes/flashtrade/06-components/_components.badge.scss +0 -156
- package/src/themes/flashtrade/06-components/_components.button.scss +0 -135
- package/src/themes/flashtrade/06-components/_components.card.scss +0 -214
- package/src/themes/flashtrade/06-components/_components.navbar.scss +0 -227
- package/src/themes/flashtrade/06-components/_index.scss +0 -13
- package/src/themes/flashtrade/99-utilities/_index.scss +0 -9
- package/src/themes/flashtrade/99-utilities/_utilities.trading.scss +0 -187
- package/src/themes/flashtrade/README.md +0 -386
- package/src/themes/flashtrade/demo.html +0 -272
- package/src/themes/flashtrade/index.scss +0 -36
- package/src/themes/mashroom/01-settings/_index.scss +0 -69
- package/src/themes/mashroom/01-settings/_settings.accordion.scss +0 -32
- package/src/themes/mashroom/01-settings/_settings.animations.scss +0 -26
- package/src/themes/mashroom/01-settings/_settings.avatar-group.scss +0 -22
- package/src/themes/mashroom/01-settings/_settings.avatar.scss +0 -57
- package/src/themes/mashroom/01-settings/_settings.badge.scss +0 -19
- package/src/themes/mashroom/01-settings/_settings.border-radius.scss +0 -24
- package/src/themes/mashroom/01-settings/_settings.border.scss +0 -14
- package/src/themes/mashroom/01-settings/_settings.box-shadow.scss +0 -40
- package/src/themes/mashroom/01-settings/_settings.breadcrumb.scss +0 -0
- package/src/themes/mashroom/01-settings/_settings.breakpoints.scss +0 -17
- package/src/themes/mashroom/01-settings/_settings.btn-group.scss +0 -5
- package/src/themes/mashroom/01-settings/_settings.button.scss +0 -50
- package/src/themes/mashroom/01-settings/_settings.callout.scss +0 -81
- package/src/themes/mashroom/01-settings/_settings.card.scss +0 -52
- package/src/themes/mashroom/01-settings/_settings.checkbox-group.scss +0 -5
- package/src/themes/mashroom/01-settings/_settings.checkbox.scss +0 -23
- package/src/themes/mashroom/01-settings/_settings.color-mode.scss +0 -7
- package/src/themes/mashroom/01-settings/_settings.colors.scss +0 -180
- package/src/themes/mashroom/01-settings/_settings.config.scss +0 -4
- package/src/themes/mashroom/01-settings/_settings.countdown.scss +0 -20
- package/src/themes/mashroom/01-settings/_settings.data-table.scss +0 -56
- package/src/themes/mashroom/01-settings/_settings.datepicker.scss +0 -45
- package/src/themes/mashroom/01-settings/_settings.design-tokens.scss +0 -3
- package/src/themes/mashroom/01-settings/_settings.dropdown.scss +0 -45
- package/src/themes/mashroom/01-settings/_settings.edge-panel.scss +0 -24
- package/src/themes/mashroom/01-settings/_settings.fonts.scss +0 -8
- package/src/themes/mashroom/01-settings/_settings.form-group.scss +0 -14
- package/src/themes/mashroom/01-settings/_settings.form.scss +0 -6
- package/src/themes/mashroom/01-settings/_settings.grid.scss +0 -23
- package/src/themes/mashroom/01-settings/_settings.hero.scss +0 -41
- package/src/themes/mashroom/01-settings/_settings.input.scss +0 -51
- package/src/themes/mashroom/01-settings/_settings.link.scss +0 -13
- package/src/themes/mashroom/01-settings/_settings.list-group.scss +0 -16
- package/src/themes/mashroom/01-settings/_settings.list.scss +0 -13
- package/src/themes/mashroom/01-settings/_settings.masonry-grid.scss +0 -23
- package/src/themes/mashroom/01-settings/_settings.menu.scss +0 -50
- package/src/themes/mashroom/01-settings/_settings.messages.scss +0 -98
- package/src/themes/mashroom/01-settings/_settings.modal.scss +0 -41
- package/src/themes/mashroom/01-settings/_settings.nav.scss +0 -20
- package/src/themes/mashroom/01-settings/_settings.navbar.scss +0 -54
- package/src/themes/mashroom/01-settings/_settings.pagination.scss +0 -30
- package/src/themes/mashroom/01-settings/_settings.photoviewer.scss +0 -45
- package/src/themes/mashroom/01-settings/_settings.popover.scss +0 -20
- package/src/themes/mashroom/01-settings/_settings.position.scss +0 -9
- package/src/themes/mashroom/01-settings/_settings.progress.scss +0 -17
- package/src/themes/mashroom/01-settings/_settings.rating.scss +0 -11
- package/src/themes/mashroom/01-settings/_settings.river.scss +0 -50
- package/src/themes/mashroom/01-settings/_settings.sectionintro.scss +0 -31
- package/src/themes/mashroom/01-settings/_settings.select.scss +0 -47
- package/src/themes/mashroom/01-settings/_settings.side-menu.scss +0 -79
- package/src/themes/mashroom/01-settings/_settings.skeleton.scss +0 -24
- package/src/themes/mashroom/01-settings/_settings.spacing.scss +0 -66
- package/src/themes/mashroom/01-settings/_settings.spinner.scss +0 -34
- package/src/themes/mashroom/01-settings/_settings.steps.scss +0 -33
- package/src/themes/mashroom/01-settings/_settings.tabs.scss +0 -33
- package/src/themes/mashroom/01-settings/_settings.testimonials.scss +0 -24
- package/src/themes/mashroom/01-settings/_settings.todo.scss +0 -52
- package/src/themes/mashroom/01-settings/_settings.toggle.scss +0 -49
- package/src/themes/mashroom/01-settings/_settings.tooltip.scss +0 -20
- package/src/themes/mashroom/01-settings/_settings.typography.scss +0 -95
- package/src/themes/mashroom/01-settings/_settings.upload.scss +0 -96
- package/src/themes/mashroom/01-settings/_settings.z-layers.scss +0 -19
- package/src/themes/mashroom/02-tools/_index.scss +0 -8
- package/src/themes/mashroom/02-tools/_tools.psychedelic-gradients.scss +0 -78
- package/src/themes/mashroom/02-tools/_tools.trippy-effects.scss +0 -114
- package/src/themes/mashroom/03-generic/_index.scss +0 -6
- package/src/themes/mashroom/04-elements/_index.scss +0 -6
- package/src/themes/mashroom/05-objects/_index.scss +0 -6
- package/src/themes/mashroom/06-components/_components.accordion.scss +0 -187
- package/src/themes/mashroom/06-components/_components.avatar-group.scss +0 -276
- package/src/themes/mashroom/06-components/_components.avatar.scss +0 -114
- package/src/themes/mashroom/06-components/_components.badge.scss +0 -152
- package/src/themes/mashroom/06-components/_components.breadcrumb.scss +0 -162
- package/src/themes/mashroom/06-components/_components.btn-group.scss +0 -404
- package/src/themes/mashroom/06-components/_components.button.scss +0 -160
- package/src/themes/mashroom/06-components/_components.callout.scss +0 -140
- package/src/themes/mashroom/06-components/_components.card.scss +0 -225
- package/src/themes/mashroom/06-components/_components.checkbox.scss +0 -186
- package/src/themes/mashroom/06-components/_components.color-mode-toggle.scss +0 -308
- package/src/themes/mashroom/06-components/_components.countdown.scss +0 -402
- package/src/themes/mashroom/06-components/_components.data-table.scss +0 -354
- package/src/themes/mashroom/06-components/_components.datepicker.scss +0 -349
- package/src/themes/mashroom/06-components/_components.dropdown.scss +0 -334
- package/src/themes/mashroom/06-components/_components.edge-panel.scss +0 -413
- package/src/themes/mashroom/06-components/_components.form-group.scss +0 -433
- package/src/themes/mashroom/06-components/_components.form.scss +0 -358
- package/src/themes/mashroom/06-components/_components.hero.scss +0 -151
- package/src/themes/mashroom/06-components/_components.input.scss +0 -147
- package/src/themes/mashroom/06-components/_components.list-group.scss +0 -456
- package/src/themes/mashroom/06-components/_components.list.scss +0 -145
- package/src/themes/mashroom/06-components/_components.menu.scss +0 -497
- package/src/themes/mashroom/06-components/_components.messages.scss +0 -277
- package/src/themes/mashroom/06-components/_components.modal.scss +0 -264
- package/src/themes/mashroom/06-components/_components.nav.scss +0 -181
- package/src/themes/mashroom/06-components/_components.navbar.scss +0 -538
- package/src/themes/mashroom/06-components/_components.pagination.scss +0 -400
- package/src/themes/mashroom/06-components/_components.photoviewer.scss +0 -498
- package/src/themes/mashroom/06-components/_components.popover.scss +0 -383
- package/src/themes/mashroom/06-components/_components.product-review.scss +0 -408
- package/src/themes/mashroom/06-components/_components.progress.scss +0 -249
- package/src/themes/mashroom/06-components/_components.rating.scss +0 -300
- package/src/themes/mashroom/06-components/_components.river.scss +0 -570
- package/src/themes/mashroom/06-components/_components.sectionintro.scss +0 -546
- package/src/themes/mashroom/06-components/_components.select.scss +0 -455
- package/src/themes/mashroom/06-components/_components.side-menu.scss +0 -635
- package/src/themes/mashroom/06-components/_components.skeleton.scss +0 -447
- package/src/themes/mashroom/06-components/_components.slider.scss +0 -414
- package/src/themes/mashroom/06-components/_components.spinner.scss +0 -198
- package/src/themes/mashroom/06-components/_components.steps.scss +0 -350
- package/src/themes/mashroom/06-components/_components.tabs.scss +0 -269
- package/src/themes/mashroom/06-components/_components.testimonials.scss +0 -561
- package/src/themes/mashroom/06-components/_components.toggle.scss +0 -231
- package/src/themes/mashroom/06-components/_components.tooltip.scss +0 -167
- package/src/themes/mashroom/06-components/_components.upload.scss +0 -537
- package/src/themes/mashroom/06-components/_components.video-player.scss +0 -560
- package/src/themes/mashroom/06-components/_index.scss +0 -55
- package/src/themes/mashroom/99-utilities/_index.scss +0 -6
- package/src/themes/mashroom/index.scss +0 -26
- package/src/themes/shaj-default/01-settings/_index.scss +0 -69
- package/src/themes/shaj-default/01-settings/_settings.accordion.scss +0 -38
- package/src/themes/shaj-default/01-settings/_settings.animations.scss +0 -32
- package/src/themes/shaj-default/01-settings/_settings.avatar-group.scss +0 -28
- package/src/themes/shaj-default/01-settings/_settings.avatar.scss +0 -63
- package/src/themes/shaj-default/01-settings/_settings.badge.scss +0 -25
- package/src/themes/shaj-default/01-settings/_settings.border-radius.scss +0 -24
- package/src/themes/shaj-default/01-settings/_settings.border.scss +0 -20
- package/src/themes/shaj-default/01-settings/_settings.box-shadow.scss +0 -46
- package/src/themes/shaj-default/01-settings/_settings.breadcrumb.scss +0 -0
- package/src/themes/shaj-default/01-settings/_settings.breakpoints.scss +0 -23
- package/src/themes/shaj-default/01-settings/_settings.btn-group.scss +0 -11
- package/src/themes/shaj-default/01-settings/_settings.button.scss +0 -56
- package/src/themes/shaj-default/01-settings/_settings.callout.scss +0 -87
- package/src/themes/shaj-default/01-settings/_settings.card.scss +0 -52
- package/src/themes/shaj-default/01-settings/_settings.checkbox-group.scss +0 -11
- package/src/themes/shaj-default/01-settings/_settings.checkbox.scss +0 -29
- package/src/themes/shaj-default/01-settings/_settings.color-mode.scss +0 -13
- package/src/themes/shaj-default/01-settings/_settings.colors.scss +0 -91
- package/src/themes/shaj-default/01-settings/_settings.config.scss +0 -4
- package/src/themes/shaj-default/01-settings/_settings.countdown.scss +0 -26
- package/src/themes/shaj-default/01-settings/_settings.data-table.scss +0 -62
- package/src/themes/shaj-default/01-settings/_settings.datepicker.scss +0 -51
- package/src/themes/shaj-default/01-settings/_settings.design-tokens.scss +0 -9
- package/src/themes/shaj-default/01-settings/_settings.dropdown.scss +0 -51
- package/src/themes/shaj-default/01-settings/_settings.edge-panel.scss +0 -30
- package/src/themes/shaj-default/01-settings/_settings.fonts.scss +0 -13
- package/src/themes/shaj-default/01-settings/_settings.form-group.scss +0 -20
- package/src/themes/shaj-default/01-settings/_settings.form.scss +0 -12
- package/src/themes/shaj-default/01-settings/_settings.grid.scss +0 -29
- package/src/themes/shaj-default/01-settings/_settings.hero.scss +0 -47
- package/src/themes/shaj-default/01-settings/_settings.input.scss +0 -57
- package/src/themes/shaj-default/01-settings/_settings.link.scss +0 -19
- package/src/themes/shaj-default/01-settings/_settings.list-group.scss +0 -22
- package/src/themes/shaj-default/01-settings/_settings.list.scss +0 -19
- package/src/themes/shaj-default/01-settings/_settings.masonry-grid.scss +0 -29
- package/src/themes/shaj-default/01-settings/_settings.menu.scss +0 -56
- package/src/themes/shaj-default/01-settings/_settings.messages.scss +0 -104
- package/src/themes/shaj-default/01-settings/_settings.modal.scss +0 -47
- package/src/themes/shaj-default/01-settings/_settings.nav.scss +0 -26
- package/src/themes/shaj-default/01-settings/_settings.navbar.scss +0 -60
- package/src/themes/shaj-default/01-settings/_settings.pagination.scss +0 -36
- package/src/themes/shaj-default/01-settings/_settings.photoviewer.scss +0 -51
- package/src/themes/shaj-default/01-settings/_settings.popover.scss +0 -26
- package/src/themes/shaj-default/01-settings/_settings.position.scss +0 -15
- package/src/themes/shaj-default/01-settings/_settings.progress.scss +0 -23
- package/src/themes/shaj-default/01-settings/_settings.rating.scss +0 -17
- package/src/themes/shaj-default/01-settings/_settings.river.scss +0 -56
- package/src/themes/shaj-default/01-settings/_settings.sectionintro.scss +0 -37
- package/src/themes/shaj-default/01-settings/_settings.select.scss +0 -53
- package/src/themes/shaj-default/01-settings/_settings.side-menu.scss +0 -85
- package/src/themes/shaj-default/01-settings/_settings.skeleton.scss +0 -30
- package/src/themes/shaj-default/01-settings/_settings.spacing.scss +0 -72
- package/src/themes/shaj-default/01-settings/_settings.spinner.scss +0 -24
- package/src/themes/shaj-default/01-settings/_settings.steps.scss +0 -39
- package/src/themes/shaj-default/01-settings/_settings.tabs.scss +0 -39
- package/src/themes/shaj-default/01-settings/_settings.testimonials.scss +0 -30
- package/src/themes/shaj-default/01-settings/_settings.todo.scss +0 -58
- package/src/themes/shaj-default/01-settings/_settings.toggle.scss +0 -55
- package/src/themes/shaj-default/01-settings/_settings.tooltip.scss +0 -26
- package/src/themes/shaj-default/01-settings/_settings.typography.scss +0 -101
- package/src/themes/shaj-default/01-settings/_settings.upload.scss +0 -102
- package/src/themes/shaj-default/01-settings/_settings.z-layers.scss +0 -25
- package/src/themes/shaj-default/02-tools/_index.scss +0 -0
- package/src/themes/shaj-default/03-generic/_generic.root.scss +0 -0
- package/src/themes/shaj-default/03-generic/_index.scss +0 -2
- package/src/themes/shaj-default/04-elements/_index.scss +0 -0
- package/src/themes/shaj-default/05-objects/_index.scss +0 -0
- package/src/themes/shaj-default/06-components/_components.button.scss +0 -55
- package/src/themes/shaj-default/06-components/_components.card.scss +0 -57
- package/src/themes/shaj-default/06-components/_components.input.scss +0 -58
- package/src/themes/shaj-default/06-components/_components.navbar.scss +0 -99
- package/src/themes/shaj-default/06-components/_components.tooltip.scss +0 -0
- package/src/themes/shaj-default/06-components/_index.scss +0 -13
- package/src/themes/shaj-default/99-utilities/_index.scss +0 -0
- package/src/themes/shaj-default/index.scss +0 -25
- package/theme.config.ts +0 -360
|
@@ -73,7 +73,7 @@ body {
|
|
|
73
73
|
}`
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
nextjs: {
|
|
78
78
|
dependencies: [
|
|
79
79
|
'@shohojdhara/atomix',
|
|
@@ -125,7 +125,7 @@ body {
|
|
|
125
125
|
}`
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
|
-
|
|
128
|
+
|
|
129
129
|
vanilla: {
|
|
130
130
|
dependencies: [
|
|
131
131
|
'@shohojdhara/atomix'
|
|
@@ -203,7 +203,7 @@ const configTemplates = {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
},
|
|
206
|
-
|
|
206
|
+
|
|
207
207
|
advanced: {
|
|
208
208
|
'atomix.config.js': `module.exports = {
|
|
209
209
|
// Theme configuration
|
|
@@ -260,7 +260,7 @@ export async function runInitWizard() {
|
|
|
260
260
|
borderColor: 'cyan'
|
|
261
261
|
}
|
|
262
262
|
));
|
|
263
|
-
|
|
263
|
+
|
|
264
264
|
try {
|
|
265
265
|
// Step 1: Project type
|
|
266
266
|
const { projectType } = await inquirer.prompt([
|
|
@@ -276,7 +276,7 @@ export async function runInitWizard() {
|
|
|
276
276
|
]
|
|
277
277
|
}
|
|
278
278
|
]);
|
|
279
|
-
|
|
279
|
+
|
|
280
280
|
// Step 2: Theme selection
|
|
281
281
|
const { themeChoice } = await inquirer.prompt([
|
|
282
282
|
{
|
|
@@ -291,27 +291,19 @@ export async function runInitWizard() {
|
|
|
291
291
|
]
|
|
292
292
|
}
|
|
293
293
|
]);
|
|
294
|
-
|
|
294
|
+
|
|
295
295
|
let selectedTheme = null;
|
|
296
296
|
if (themeChoice === 'prebuilt') {
|
|
297
297
|
const { theme } = await inquirer.prompt([
|
|
298
298
|
{
|
|
299
|
-
type: '
|
|
299
|
+
type: 'input',
|
|
300
300
|
name: 'theme',
|
|
301
|
-
message: '
|
|
302
|
-
choices: [
|
|
303
|
-
{ name: 'Shaj Default - Clean & Modern', value: 'shaj-default' },
|
|
304
|
-
{ name: 'FlashTrade - Crypto Trading', value: 'flashtrade' },
|
|
305
|
-
{ name: 'BoomDevs - Dark Mode', value: 'boomdevs' },
|
|
306
|
-
{ name: 'Esrar - Minimal Light', value: 'esrar' },
|
|
307
|
-
{ name: 'Mashroom - Colorful & Playful', value: 'mashroom' },
|
|
308
|
-
{ name: 'AppleMix - Glass Morphism', value: 'applemix' }
|
|
309
|
-
]
|
|
301
|
+
message: 'Enter the name of the pre-built theme:',
|
|
310
302
|
}
|
|
311
303
|
]);
|
|
312
304
|
selectedTheme = theme;
|
|
313
305
|
}
|
|
314
|
-
|
|
306
|
+
|
|
315
307
|
// Step 3: Features
|
|
316
308
|
const { features } = await inquirer.prompt([
|
|
317
309
|
{
|
|
@@ -328,7 +320,7 @@ export async function runInitWizard() {
|
|
|
328
320
|
]
|
|
329
321
|
}
|
|
330
322
|
]);
|
|
331
|
-
|
|
323
|
+
|
|
332
324
|
// Step 4: Configuration
|
|
333
325
|
const { configType } = await inquirer.prompt([
|
|
334
326
|
{
|
|
@@ -342,7 +334,7 @@ export async function runInitWizard() {
|
|
|
342
334
|
]
|
|
343
335
|
}
|
|
344
336
|
]);
|
|
345
|
-
|
|
337
|
+
|
|
346
338
|
// Step 5: Installation
|
|
347
339
|
const { shouldInstall } = await inquirer.prompt([
|
|
348
340
|
{
|
|
@@ -352,14 +344,14 @@ export async function runInitWizard() {
|
|
|
352
344
|
default: true
|
|
353
345
|
}
|
|
354
346
|
]);
|
|
355
|
-
|
|
347
|
+
|
|
356
348
|
// Generate files
|
|
357
349
|
console.log(chalk.cyan('\nš¦ Generating project files...\n'));
|
|
358
|
-
|
|
350
|
+
|
|
359
351
|
// Create project structure
|
|
360
352
|
if (projectType !== 'custom') {
|
|
361
353
|
const template = projectTemplates[projectType];
|
|
362
|
-
|
|
354
|
+
|
|
363
355
|
// Create directories
|
|
364
356
|
await mkdir('src', { recursive: true });
|
|
365
357
|
if (projectType === 'nextjs') {
|
|
@@ -370,32 +362,32 @@ export async function runInitWizard() {
|
|
|
370
362
|
} else if (projectType === 'vanilla') {
|
|
371
363
|
await mkdir('src/styles', { recursive: true });
|
|
372
364
|
}
|
|
373
|
-
|
|
365
|
+
|
|
374
366
|
// Write template files
|
|
375
367
|
for (const [path, content] of Object.entries(template.files)) {
|
|
376
368
|
const filePath = join(process.cwd(), path);
|
|
377
369
|
const dir = join(process.cwd(), path.substring(0, path.lastIndexOf('/')));
|
|
378
|
-
|
|
370
|
+
|
|
379
371
|
if (!existsSync(dir)) {
|
|
380
372
|
await mkdir(dir, { recursive: true });
|
|
381
373
|
}
|
|
382
|
-
|
|
374
|
+
|
|
383
375
|
await writeFile(filePath, content, 'utf8');
|
|
384
376
|
console.log(chalk.green(` ā Created ${path}`));
|
|
385
377
|
}
|
|
386
378
|
}
|
|
387
|
-
|
|
379
|
+
|
|
388
380
|
// Create configuration file
|
|
389
381
|
if (configType !== 'none') {
|
|
390
|
-
const configTemplate = configType === 'json'
|
|
391
|
-
? configTemplates.basic
|
|
382
|
+
const configTemplate = configType === 'json'
|
|
383
|
+
? configTemplates.basic
|
|
392
384
|
: configTemplates.advanced;
|
|
393
|
-
|
|
385
|
+
|
|
394
386
|
for (const [filename, content] of Object.entries(configTemplate)) {
|
|
395
|
-
const configContent = typeof content === 'object'
|
|
387
|
+
const configContent = typeof content === 'object'
|
|
396
388
|
? JSON.stringify(content, null, 2)
|
|
397
389
|
: content;
|
|
398
|
-
|
|
390
|
+
|
|
399
391
|
await writeFile(
|
|
400
392
|
join(process.cwd(), filename),
|
|
401
393
|
configContent,
|
|
@@ -404,11 +396,11 @@ export async function runInitWizard() {
|
|
|
404
396
|
console.log(chalk.green(` ā Created ${filename}`));
|
|
405
397
|
}
|
|
406
398
|
}
|
|
407
|
-
|
|
399
|
+
|
|
408
400
|
// Create custom theme if selected
|
|
409
401
|
if (themeChoice === 'custom') {
|
|
410
402
|
await mkdir('themes/custom', { recursive: true });
|
|
411
|
-
|
|
403
|
+
|
|
412
404
|
const themeContent = `// Custom Theme
|
|
413
405
|
// Generated by Atomix CLI
|
|
414
406
|
|
|
@@ -427,7 +419,7 @@ export async function runInitWizard() {
|
|
|
427
419
|
.custom-component {
|
|
428
420
|
// Custom component styles
|
|
429
421
|
}`;
|
|
430
|
-
|
|
422
|
+
|
|
431
423
|
await writeFile(
|
|
432
424
|
join(process.cwd(), 'themes/custom/index.scss'),
|
|
433
425
|
themeContent,
|
|
@@ -435,7 +427,7 @@ export async function runInitWizard() {
|
|
|
435
427
|
);
|
|
436
428
|
console.log(chalk.green(' ā Created custom theme'));
|
|
437
429
|
}
|
|
438
|
-
|
|
430
|
+
|
|
439
431
|
// Generate package.json scripts
|
|
440
432
|
const scripts = {
|
|
441
433
|
'dev': projectType === 'nextjs' ? 'next dev' : 'vite',
|
|
@@ -444,24 +436,24 @@ export async function runInitWizard() {
|
|
|
444
436
|
'generate:component': 'atomix generate component',
|
|
445
437
|
'validate': 'atomix validate --tokens --theme'
|
|
446
438
|
};
|
|
447
|
-
|
|
439
|
+
|
|
448
440
|
if (features.includes('storybook')) {
|
|
449
441
|
scripts['storybook'] = 'storybook dev -p 6006';
|
|
450
442
|
scripts['build:storybook'] = 'storybook build';
|
|
451
443
|
}
|
|
452
|
-
|
|
444
|
+
|
|
453
445
|
if (features.includes('testing')) {
|
|
454
446
|
scripts['test'] = 'vitest';
|
|
455
447
|
scripts['test:watch'] = 'vitest --watch';
|
|
456
448
|
scripts['test:coverage'] = 'vitest --coverage';
|
|
457
449
|
}
|
|
458
|
-
|
|
450
|
+
|
|
459
451
|
if (features.includes('linting')) {
|
|
460
452
|
scripts['lint'] = 'eslint . --ext .ts,.tsx,.js,.jsx';
|
|
461
453
|
scripts['lint:fix'] = 'eslint . --ext .ts,.tsx,.js,.jsx --fix';
|
|
462
454
|
scripts['format'] = 'prettier --write "src/**/*.{ts,tsx,js,jsx,json,css,scss}"';
|
|
463
455
|
}
|
|
464
|
-
|
|
456
|
+
|
|
465
457
|
// Update package.json if it exists
|
|
466
458
|
const packageJsonPath = join(process.cwd(), 'package.json');
|
|
467
459
|
if (existsSync(packageJsonPath)) {
|
|
@@ -473,7 +465,7 @@ export async function runInitWizard() {
|
|
|
473
465
|
default: true
|
|
474
466
|
}
|
|
475
467
|
]);
|
|
476
|
-
|
|
468
|
+
|
|
477
469
|
if (addScripts) {
|
|
478
470
|
const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf8'));
|
|
479
471
|
packageJson.scripts = { ...packageJson.scripts, ...scripts };
|
|
@@ -481,7 +473,7 @@ export async function runInitWizard() {
|
|
|
481
473
|
console.log(chalk.green(' ā Updated package.json scripts'));
|
|
482
474
|
}
|
|
483
475
|
}
|
|
484
|
-
|
|
476
|
+
|
|
485
477
|
// Success message
|
|
486
478
|
console.log(boxen(
|
|
487
479
|
chalk.bold.green('⨠Setup Complete!\n\n') +
|
|
@@ -499,12 +491,12 @@ export async function runInitWizard() {
|
|
|
499
491
|
borderColor: 'green'
|
|
500
492
|
}
|
|
501
493
|
));
|
|
502
|
-
|
|
494
|
+
|
|
503
495
|
// Install dependencies if requested
|
|
504
496
|
if (shouldInstall) {
|
|
505
497
|
console.log(chalk.cyan('\nš„ Installing dependencies...\n'));
|
|
506
498
|
const { execSync } = await import('child_process');
|
|
507
|
-
|
|
499
|
+
|
|
508
500
|
try {
|
|
509
501
|
execSync('npm install', { stdio: 'inherit' });
|
|
510
502
|
console.log(chalk.green('\nā
Dependencies installed successfully!'));
|
|
@@ -513,7 +505,7 @@ export async function runInitWizard() {
|
|
|
513
505
|
console.log(chalk.yellow('Please run: npm install'));
|
|
514
506
|
}
|
|
515
507
|
}
|
|
516
|
-
|
|
508
|
+
|
|
517
509
|
} catch (error) {
|
|
518
510
|
if (error.isTTYError) {
|
|
519
511
|
console.error(chalk.red('This environment doesn\'t support interactive prompts'));
|
|
@@ -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
|
+
|
|
@@ -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: [
|
|
175
|
+
preload: [],
|
|
176
176
|
lazy: true,
|
|
177
|
-
defaultTheme: '
|
|
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);
|
|
@@ -10,6 +10,7 @@ export type ButtonAsProp = {
|
|
|
10
10
|
as?: ElementType;
|
|
11
11
|
to?: string;
|
|
12
12
|
href?: string;
|
|
13
|
+
LinkComponent?: React.ComponentType<any>;
|
|
13
14
|
[key: string]: any;
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -50,6 +51,7 @@ export const Button = React.memo(
|
|
|
50
51
|
ariaControls,
|
|
51
52
|
tabIndex,
|
|
52
53
|
style,
|
|
54
|
+
LinkComponent,
|
|
53
55
|
...props
|
|
54
56
|
},
|
|
55
57
|
ref
|
|
@@ -253,6 +255,39 @@ export const Button = React.memo(
|
|
|
253
255
|
type: undefined,
|
|
254
256
|
disabled: undefined,
|
|
255
257
|
};
|
|
258
|
+
|
|
259
|
+
// Use custom LinkComponent if provided (e.g., Next.js Link)
|
|
260
|
+
if (LinkComponent) {
|
|
261
|
+
const LinkComp = LinkComponent as React.ComponentType<any>;
|
|
262
|
+
const linkProps = {
|
|
263
|
+
...anchorButtonProps,
|
|
264
|
+
ref: ref as React.Ref<HTMLAnchorElement>,
|
|
265
|
+
href,
|
|
266
|
+
target,
|
|
267
|
+
rel: target === '_blank' ? 'noopener noreferrer' : undefined,
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
const linkElement = (
|
|
271
|
+
<LinkComp {...linkProps}>
|
|
272
|
+
{buttonContent}
|
|
273
|
+
</LinkComp>
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
if (glass) {
|
|
277
|
+
const defaultGlassProps = {
|
|
278
|
+
displacementScale: 20,
|
|
279
|
+
blurAmount: 0,
|
|
280
|
+
saturation: 200,
|
|
281
|
+
elasticity: 0,
|
|
282
|
+
};
|
|
283
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
284
|
+
return <AtomixGlass {...glassProps}>{linkElement}</AtomixGlass>;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return linkElement;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Fallback to regular anchor tag
|
|
256
291
|
const anchorElement = (
|
|
257
292
|
<a {...anchorButtonProps} ref={ref as React.Ref<HTMLAnchorElement>} href={href} target={target} rel={target === '_blank' ? 'noopener noreferrer' : undefined}>
|
|
258
293
|
{buttonContent}
|
|
@@ -300,4 +335,4 @@ Button.displayName = 'Button';
|
|
|
300
335
|
|
|
301
336
|
export type { ButtonProps };
|
|
302
337
|
|
|
303
|
-
export default Button;
|
|
338
|
+
export default Button;
|