@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.
- package/README.md +46 -28
- package/dist/atomix.css +15 -9
- package/dist/atomix.css.map +1 -0
- package/dist/atomix.min.css +15108 -11
- package/dist/atomix.min.css.map +1 -0
- package/dist/charts.d.ts +1929 -0
- package/dist/charts.js +6482 -0
- package/dist/charts.js.map +1 -0
- package/dist/core.d.ts +1289 -0
- package/dist/core.js +3357 -0
- package/dist/core.js.map +1 -0
- package/dist/forms.d.ts +1085 -0
- package/dist/forms.js +2450 -0
- package/dist/forms.js.map +1 -0
- package/dist/heavy.d.ts +636 -0
- package/dist/heavy.js +4550 -0
- package/dist/heavy.js.map +1 -0
- package/dist/index.d.ts +5196 -4618
- package/dist/index.esm.js +4240 -2776
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4057 -2571
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.d.ts +300 -0
- package/dist/layout.js +336 -0
- package/dist/layout.js.map +1 -0
- package/dist/theme.d.ts +1992 -0
- package/dist/theme.js +5348 -0
- package/dist/theme.js.map +1 -0
- package/package.json +63 -68
- package/scripts/atomix-cli.js +879 -15
- package/scripts/cli/__tests__/cli-commands.test.js +204 -0
- package/scripts/cli/__tests__/utils.test.js +201 -0
- package/scripts/cli/__tests__/vitest.config.js +26 -0
- package/scripts/cli/interactive-init.js +37 -45
- package/scripts/cli/theme-bridge.js +129 -0
- package/scripts/cli/token-manager.js +32 -7
- package/scripts/cli/utils.js +347 -0
- package/scripts/sync-theme-config.js +22 -22
- package/src/components/Accordion/Accordion.tsx +5 -54
- package/src/components/Accordion/index.ts +1 -1
- package/src/components/Avatar/Avatar.tsx +3 -3
- package/src/components/Badge/Badge.tsx +3 -3
- package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
- package/src/components/Button/Button.tsx +36 -1
- package/src/components/Card/ElevationCard.tsx +1 -1
- package/src/components/Chart/AnimatedChart.tsx +19 -17
- package/src/components/Chart/AreaChart.tsx +5 -1
- package/src/components/Chart/BarChart.tsx +1 -0
- package/src/components/Chart/BubbleChart.tsx +6 -5
- package/src/components/Chart/ChartToolbar.tsx +1 -0
- package/src/components/Chart/FunnelChart.tsx +1 -1
- package/src/components/Chart/RadarChart.tsx +19 -12
- package/src/components/Chart/ScatterChart.tsx +3 -3
- package/src/components/Chart/TreemapChart.tsx +2 -1
- package/src/components/Chart/WaterfallChart.tsx +0 -1
- package/src/components/Chart/types.ts +12 -2
- package/src/components/Chart/utils.ts +4 -3
- package/src/components/DataTable/DataTable.tsx +3 -3
- package/src/components/Dropdown/Dropdown.tsx +12 -9
- package/src/components/Footer/FooterSection.tsx +3 -3
- package/src/components/Form/Checkbox.tsx +3 -3
- package/src/components/Form/Input.tsx +4 -2
- package/src/components/Form/Radio.tsx +3 -3
- package/src/components/Form/Select.tsx +3 -3
- package/src/components/Form/Textarea.tsx +4 -2
- package/src/components/List/List.stories.tsx +3 -3
- package/src/components/List/List.tsx +3 -3
- package/src/components/List/ListGroup.tsx +3 -1
- package/src/components/Modal/Modal.tsx +3 -3
- package/src/components/Navigation/Menu/MegaMenu.tsx +9 -3
- package/src/components/Navigation/Menu/Menu.tsx +9 -3
- package/src/components/Pagination/Pagination.tsx +6 -5
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +2 -2
- package/src/components/Popover/Popover.tsx +4 -4
- package/src/components/Progress/Progress.tsx +6 -2
- package/src/components/Rating/Rating.tsx +5 -2
- package/src/components/Slider/Slider.tsx +10 -9
- package/src/components/Spinner/Spinner.tsx +3 -3
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/components/Tooltip/Tooltip.tsx +3 -3
- package/src/components/index.ts +5 -2
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +2 -2
- package/src/lib/composables/useChartPerformance.ts +102 -78
- package/src/lib/composables/useChartScale.ts +10 -0
- package/src/lib/composables/useHero.ts +9 -2
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -3
- package/src/lib/composables/useSideMenu.ts +1 -0
- package/src/lib/composables/useVideoPlayer.ts +3 -2
- package/src/lib/config/index.ts +275 -0
- package/src/lib/config/loader.ts +147 -0
- package/src/lib/hooks/index.ts +0 -1
- package/src/lib/hooks/useComponentCustomization.ts +10 -14
- package/src/lib/hooks/usePerformanceMonitor.ts +149 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/patterns/index.ts +2 -2
- package/src/lib/patterns/slots.tsx +2 -2
- package/src/lib/theme/composeTheme.ts +1 -6
- 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/core/ThemeEngine.ts +8 -0
- package/src/lib/theme/core/ThemeValidator.ts +5 -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 +22 -7
- package/src/lib/theme/devtools/LiveEditor.tsx +399 -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 +80 -39
- package/src/lib/theme/i18n/rtl.ts +2 -1
- package/src/lib/theme/index.ts +18 -2
- package/src/lib/theme/runtime/ThemeApplicator.ts +28 -11
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +3 -3
- package/src/lib/theme/runtime/ThemeManager.test.ts +17 -1
- package/src/lib/theme/runtime/ThemeManager.ts +11 -7
- package/src/lib/theme/types.ts +42 -43
- package/src/lib/theme-tools.ts +8 -68
- package/src/lib/types/components.ts +252 -109
- package/src/lib/types/partProps.ts +0 -16
- package/src/lib/utils/fontPreloader.ts +148 -0
- package/src/lib/utils/index.ts +11 -0
- package/src/lib/utils/memoryMonitor.ts +189 -0
- package/src/styles/01-settings/_settings.fonts.scss +2 -5
- package/src/styles/01-settings/_settings.navbar.scss +1 -1
- package/src/styles/03-generic/_generated-root.css +26 -0
- package/src/styles/06-components/_components.navbar.scss +6 -5
- package/src/themes/README.md +1 -2
- package/src/themes/themes.config.js +30 -181
- 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/scripts/build-themes.js +0 -208
- package/src/components/AtomixGlass/atomixGLass.old.tsx +0 -1263
- 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
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type {
|
|
8
|
-
|
|
9
|
-
ThemeDefinition,
|
|
10
|
-
CSSThemeDefinition,
|
|
11
|
-
JSThemeDefinition,
|
|
8
|
+
AtomixConfig,
|
|
12
9
|
BuildConfig,
|
|
13
10
|
RuntimeConfig,
|
|
14
11
|
IntegrationConfig,
|
|
15
|
-
|
|
12
|
+
ThemeDefinition,
|
|
13
|
+
CSSThemeDefinition,
|
|
14
|
+
JSThemeDefinition,
|
|
15
|
+
} from '../../config';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Configuration loader options
|
|
@@ -29,13 +29,27 @@ export interface ConfigLoaderOptions {
|
|
|
29
29
|
/**
|
|
30
30
|
* Loaded and validated theme configuration
|
|
31
31
|
*/
|
|
32
|
-
export interface LoadedThemeConfig
|
|
32
|
+
export interface LoadedThemeConfig {
|
|
33
|
+
/** Registered themes */
|
|
34
|
+
themes: Record<string, ThemeDefinition>;
|
|
35
|
+
/** Build configuration */
|
|
36
|
+
build: BuildConfig;
|
|
37
|
+
/** Runtime configuration */
|
|
38
|
+
runtime: RuntimeConfig;
|
|
39
|
+
/** Integration settings */
|
|
40
|
+
integration: IntegrationConfig;
|
|
41
|
+
/** Theme dependencies mapping */
|
|
42
|
+
dependencies: Record<string, string[]>;
|
|
33
43
|
/** Whether config was validated */
|
|
34
44
|
validated: boolean;
|
|
35
45
|
/** Validation errors (if any) */
|
|
36
46
|
errors?: string[];
|
|
37
47
|
/** Validation warnings (if any) */
|
|
38
48
|
warnings?: string[];
|
|
49
|
+
/** Internal tokens (for generator) */
|
|
50
|
+
__tokens?: any;
|
|
51
|
+
/** Internal extensions (for generator) */
|
|
52
|
+
__extend?: any;
|
|
39
53
|
}
|
|
40
54
|
|
|
41
55
|
/**
|
|
@@ -88,7 +102,7 @@ export interface ConfigValidationResult {
|
|
|
88
102
|
}
|
|
89
103
|
|
|
90
104
|
export type {
|
|
91
|
-
|
|
105
|
+
AtomixConfig,
|
|
92
106
|
ThemeDefinition,
|
|
93
107
|
CSSThemeDefinition,
|
|
94
108
|
JSThemeDefinition,
|
|
@@ -54,14 +54,24 @@ export const CSS_EXTENSIONS = {
|
|
|
54
54
|
} as const;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* Default config file path
|
|
57
|
+
* Default Atomix config file path
|
|
58
|
+
*/
|
|
59
|
+
export const DEFAULT_ATOMIX_CONFIG_PATH = 'atomix.config.ts';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Default config file path (legacy)
|
|
58
63
|
*/
|
|
59
64
|
export const DEFAULT_CONFIG_PATH = 'theme.config.ts';
|
|
60
65
|
|
|
61
66
|
/**
|
|
62
67
|
* Default config file path (relative)
|
|
63
68
|
*/
|
|
64
|
-
export const DEFAULT_CONFIG_RELATIVE_PATH = '../../../../
|
|
69
|
+
export const DEFAULT_CONFIG_RELATIVE_PATH = '../../../../atomix.config';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Default legacy config file path (relative)
|
|
73
|
+
*/
|
|
74
|
+
export const DEFAULT_LEGACY_CONFIG_RELATIVE_PATH = '../../../../theme.config';
|
|
65
75
|
|
|
66
76
|
/**
|
|
67
77
|
* Validation thresholds
|
|
@@ -538,9 +538,13 @@ export class ThemeEngine {
|
|
|
538
538
|
/**
|
|
539
539
|
* Add change listener
|
|
540
540
|
*/
|
|
541
|
+
// @ts-ignore - TypeScript overloads are valid, ESLint doesn't understand them
|
|
541
542
|
on(event: 'change', listener: ThemeChangeListener): void;
|
|
543
|
+
// @ts-ignore
|
|
542
544
|
on(event: 'load', listener: ThemeLoadListener): void;
|
|
545
|
+
// @ts-ignore
|
|
543
546
|
on(event: 'error', listener: ThemeErrorListener): void;
|
|
547
|
+
// @ts-ignore
|
|
544
548
|
on(event: 'revert', listener: ThemeRevertListener): void;
|
|
545
549
|
on(
|
|
546
550
|
event: 'change' | 'load' | 'error' | 'revert',
|
|
@@ -560,9 +564,13 @@ export class ThemeEngine {
|
|
|
560
564
|
/**
|
|
561
565
|
* Remove listener
|
|
562
566
|
*/
|
|
567
|
+
// @ts-ignore - TypeScript overloads are valid, ESLint doesn't understand them
|
|
563
568
|
off(event: 'change', listener: ThemeChangeListener): void;
|
|
569
|
+
// @ts-ignore
|
|
564
570
|
off(event: 'load', listener: ThemeLoadListener): void;
|
|
571
|
+
// @ts-ignore
|
|
565
572
|
off(event: 'error', listener: ThemeErrorListener): void;
|
|
573
|
+
// @ts-ignore
|
|
566
574
|
off(event: 'revert', listener: ThemeRevertListener): void;
|
|
567
575
|
off(
|
|
568
576
|
event: 'change' | 'load' | 'error' | 'revert',
|
|
@@ -392,8 +392,11 @@ export class ThemeValidator {
|
|
|
392
392
|
|
|
393
393
|
for (let i = 0; i < numericEntries.length; i++) {
|
|
394
394
|
for (let j = i + 1; j < numericEntries.length; j++) {
|
|
395
|
-
const
|
|
396
|
-
const
|
|
395
|
+
const entryA = numericEntries[i];
|
|
396
|
+
const entryB = numericEntries[j];
|
|
397
|
+
if (!entryA || !entryB) continue;
|
|
398
|
+
const [keyA, valueA] = entryA;
|
|
399
|
+
const [keyB, valueB] = entryB;
|
|
397
400
|
const diff = Math.abs(valueA - valueB);
|
|
398
401
|
if (diff < 10 && diff > 0) {
|
|
399
402
|
warnings.push(
|
|
@@ -312,7 +312,6 @@ export function createTheme(...options: ThemeOptions[]): Theme {
|
|
|
312
312
|
}),
|
|
313
313
|
background: {
|
|
314
314
|
default: mergedOptions.palette?.background?.default || DEFAULT_PALETTE.background.default,
|
|
315
|
-
paper: mergedOptions.palette?.background?.paper || DEFAULT_PALETTE.background.paper,
|
|
316
315
|
subtle: mergedOptions.palette?.background?.subtle || DEFAULT_PALETTE.background.subtle,
|
|
317
316
|
},
|
|
318
317
|
text: {
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Theme from Atomix Config
|
|
3
|
+
*
|
|
4
|
+
* Helper function to create a theme from atomix.config.ts,
|
|
5
|
+
* similar to how Tailwind processes its config.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { createThemeFromConfig } from '@shohojdhara/atomix/theme';
|
|
10
|
+
* import config from './atomix.config';
|
|
11
|
+
*
|
|
12
|
+
* const theme = createThemeFromConfig(config);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type { AtomixConfig } from '../config';
|
|
17
|
+
import { createTheme } from './createTheme';
|
|
18
|
+
import type { ThemeOptions } from './types';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Convert config tokens to theme options
|
|
22
|
+
*/
|
|
23
|
+
function configToThemeOptions(config: AtomixConfig): ThemeOptions {
|
|
24
|
+
const tokens = config.theme?.tokens || config.theme?.extend || {};
|
|
25
|
+
const options: ThemeOptions = {};
|
|
26
|
+
|
|
27
|
+
// Convert colors
|
|
28
|
+
if (tokens.colors) {
|
|
29
|
+
options.palette = {};
|
|
30
|
+
|
|
31
|
+
// Handle primary color
|
|
32
|
+
if (tokens.colors.primary) {
|
|
33
|
+
const primary = tokens.colors.primary;
|
|
34
|
+
if (typeof primary === 'string') {
|
|
35
|
+
options.palette.primary = { main: primary };
|
|
36
|
+
} else if (typeof primary === 'object' && 'main' in primary) {
|
|
37
|
+
options.palette.primary = primary as any;
|
|
38
|
+
} else if (typeof primary === 'object' && '6' in primary) {
|
|
39
|
+
// Color scale format
|
|
40
|
+
options.palette.primary = { main: (primary as any)[6] || (primary as any).main };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Handle other colors
|
|
45
|
+
if (tokens.colors) {
|
|
46
|
+
const colorKeys = ['secondary', 'error', 'warning', 'info', 'success'] as const;
|
|
47
|
+
colorKeys.forEach((key) => {
|
|
48
|
+
if (tokens.colors![key]) {
|
|
49
|
+
const color = tokens.colors![key];
|
|
50
|
+
if (typeof color === 'string') {
|
|
51
|
+
options.palette![key] = { main: color };
|
|
52
|
+
} else if (typeof color === 'object' && 'main' in color) {
|
|
53
|
+
options.palette![key] = color as any;
|
|
54
|
+
} else if (typeof color === 'object' && '6' in color) {
|
|
55
|
+
options.palette![key] = { main: (color as any)[6] || (color as any).main };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Convert typography
|
|
63
|
+
if (tokens.typography) {
|
|
64
|
+
options.typography = {};
|
|
65
|
+
|
|
66
|
+
if (tokens.typography.fontFamilies?.sans) {
|
|
67
|
+
options.typography.fontFamily = Array.isArray(tokens.typography.fontFamilies.sans)
|
|
68
|
+
? tokens.typography.fontFamilies.sans.join(', ')
|
|
69
|
+
: tokens.typography.fontFamilies.sans;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (tokens.typography.fontSizes) {
|
|
73
|
+
// Map font sizes to theme typography
|
|
74
|
+
const baseSize = tokens.typography.fontSizes.base || tokens.typography.fontSizes.md;
|
|
75
|
+
if (baseSize) {
|
|
76
|
+
const numericSize = parseFloat(String(baseSize).replace(/[^\d.]/g, ''));
|
|
77
|
+
options.typography.fontSize = numericSize || 16;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Convert spacing (if needed for theme spacing function)
|
|
83
|
+
if (tokens.spacing) {
|
|
84
|
+
// Spacing is handled via CSS variables, but we can set a base multiplier
|
|
85
|
+
options.spacing = 4; // Default 4px base unit
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Convert border radius
|
|
89
|
+
if (tokens.borderRadius) {
|
|
90
|
+
options.borderRadius = {};
|
|
91
|
+
Object.entries(tokens.borderRadius).forEach(([key, value]) => {
|
|
92
|
+
options.borderRadius![key as keyof typeof options.borderRadius] = String(value);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return options;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Create a theme from Atomix configuration
|
|
101
|
+
*
|
|
102
|
+
* This function converts atomix.config.ts format to a theme object
|
|
103
|
+
* that can be used with ThemeProvider.
|
|
104
|
+
*
|
|
105
|
+
* @param config - Atomix configuration object
|
|
106
|
+
* @returns Theme object ready for use
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* import { createThemeFromConfig } from '@shohojdhara/atomix/theme';
|
|
111
|
+
* import config from './atomix.config';
|
|
112
|
+
*
|
|
113
|
+
* const theme = createThemeFromConfig(config);
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export function createThemeFromConfig(config: AtomixConfig) {
|
|
117
|
+
const themeOptions = configToThemeOptions(config);
|
|
118
|
+
|
|
119
|
+
// Create theme with options
|
|
120
|
+
const theme = createTheme(themeOptions);
|
|
121
|
+
|
|
122
|
+
// Apply prefix if specified
|
|
123
|
+
if (config.prefix && config.prefix !== 'atomix') {
|
|
124
|
+
// Note: Prefix is applied when generating CSS variables
|
|
125
|
+
// The theme object itself doesn't store prefix
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return theme;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export default createThemeFromConfig;
|
|
132
|
+
|
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
* Command-line interface for theme management
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { generateConfigTemplate } from '../generators/ConfigGenerator';
|
|
8
|
-
import { generateCSS } from '../generators/CSSGenerator';
|
|
9
|
-
import { generateTypes } from '../generators/TypeGenerator';
|
|
10
7
|
import { loadThemeConfig } from '../config/loader';
|
|
11
8
|
import { validateConfig } from '../config/validator';
|
|
12
9
|
|
|
@@ -37,39 +34,49 @@ export class ThemeCLI {
|
|
|
37
34
|
*/
|
|
38
35
|
private registerDefaultCommands(): void {
|
|
39
36
|
this.register({
|
|
40
|
-
name: '
|
|
41
|
-
description: '
|
|
37
|
+
name: 'validate',
|
|
38
|
+
description: 'Validate theme configuration',
|
|
42
39
|
options: {
|
|
43
|
-
'--
|
|
44
|
-
'--
|
|
40
|
+
'--config': 'Path to config file',
|
|
41
|
+
'--strict': 'Enable strict validation',
|
|
45
42
|
},
|
|
46
|
-
handler: this.
|
|
43
|
+
handler: this.handleValidate.bind(this),
|
|
47
44
|
});
|
|
48
45
|
|
|
49
46
|
this.register({
|
|
50
|
-
name: '
|
|
51
|
-
description: '
|
|
52
|
-
handler: this.
|
|
47
|
+
name: 'list',
|
|
48
|
+
description: 'List all available themes',
|
|
49
|
+
handler: this.handleList.bind(this),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
this.register({
|
|
53
|
+
name: 'inspect',
|
|
54
|
+
description: 'Inspect a specific theme',
|
|
55
|
+
options: {
|
|
56
|
+
'--theme': 'Theme name to inspect',
|
|
57
|
+
'--json': 'Output as JSON',
|
|
58
|
+
},
|
|
59
|
+
handler: this.handleInspect.bind(this),
|
|
53
60
|
});
|
|
54
61
|
|
|
55
62
|
this.register({
|
|
56
|
-
name: '
|
|
57
|
-
description: '
|
|
63
|
+
name: 'compare',
|
|
64
|
+
description: 'Compare two themes',
|
|
58
65
|
options: {
|
|
59
|
-
'--
|
|
60
|
-
'--
|
|
66
|
+
'--theme1': 'First theme name',
|
|
67
|
+
'--theme2': 'Second theme name',
|
|
61
68
|
},
|
|
62
|
-
handler: this.
|
|
69
|
+
handler: this.handleCompare.bind(this),
|
|
63
70
|
});
|
|
64
71
|
|
|
65
72
|
this.register({
|
|
66
|
-
name: '
|
|
67
|
-
description: '
|
|
73
|
+
name: 'export',
|
|
74
|
+
description: 'Export theme to JSON',
|
|
68
75
|
options: {
|
|
69
|
-
'--
|
|
70
|
-
'--
|
|
76
|
+
'--theme': 'Theme name to export',
|
|
77
|
+
'--output': 'Output file path',
|
|
71
78
|
},
|
|
72
|
-
handler: this.
|
|
79
|
+
handler: this.handleExport.bind(this),
|
|
73
80
|
});
|
|
74
81
|
|
|
75
82
|
this.register({
|
|
@@ -139,29 +146,6 @@ export class ThemeCLI {
|
|
|
139
146
|
return { args: parsedArgs, options };
|
|
140
147
|
}
|
|
141
148
|
|
|
142
|
-
/**
|
|
143
|
-
* Handle init command
|
|
144
|
-
*/
|
|
145
|
-
private handleInit(args: string[], options: Record<string, any>): void {
|
|
146
|
-
const format = options.format || 'typescript';
|
|
147
|
-
const includeExamples = options.examples !== false;
|
|
148
|
-
|
|
149
|
-
const config = generateConfigTemplate({
|
|
150
|
-
format: format as any,
|
|
151
|
-
includeExamples,
|
|
152
|
-
includeComments: true,
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
const filename = format === 'json' ? 'theme.config.json' :
|
|
156
|
-
format === 'javascript' ? 'theme.config.js' :
|
|
157
|
-
'theme.config.ts';
|
|
158
|
-
|
|
159
|
-
console.log(`Generating ${filename}...`);
|
|
160
|
-
console.log(config);
|
|
161
|
-
console.log(`\\nTheme configuration template generated!`);
|
|
162
|
-
console.log(`Save this content to ${filename} in your project root.`);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
149
|
/**
|
|
166
150
|
* Handle validate command
|
|
167
151
|
*/
|
|
@@ -173,16 +157,16 @@ export class ThemeCLI {
|
|
|
173
157
|
if (result.valid) {
|
|
174
158
|
console.log('✅ Theme configuration is valid');
|
|
175
159
|
if (result.warnings.length > 0) {
|
|
176
|
-
console.log('
|
|
160
|
+
console.log('\n⚠️ Warnings:');
|
|
177
161
|
result.warnings.forEach(warning => console.log(` - ${warning}`));
|
|
178
162
|
}
|
|
179
163
|
} else {
|
|
180
164
|
console.log('❌ Theme configuration is invalid');
|
|
181
|
-
console.log('
|
|
165
|
+
console.log('\nErrors:');
|
|
182
166
|
result.errors.forEach(error => console.log(` - ${error}`));
|
|
183
|
-
|
|
167
|
+
|
|
184
168
|
if (result.warnings.length > 0) {
|
|
185
|
-
console.log('
|
|
169
|
+
console.log('\nWarnings:');
|
|
186
170
|
result.warnings.forEach(warning => console.log(` - ${warning}`));
|
|
187
171
|
}
|
|
188
172
|
process.exit(1);
|
|
@@ -194,49 +178,150 @@ export class ThemeCLI {
|
|
|
194
178
|
}
|
|
195
179
|
|
|
196
180
|
/**
|
|
197
|
-
* Handle
|
|
181
|
+
* Handle list command
|
|
198
182
|
*/
|
|
199
|
-
private
|
|
200
|
-
console.log('Building themes...');
|
|
201
|
-
console.log('Note: This is a placeholder. Implement actual build logic based on your needs.');
|
|
202
|
-
|
|
183
|
+
private handleList(args: string[], options: Record<string, any>): void {
|
|
203
184
|
try {
|
|
204
185
|
const config = loadThemeConfig();
|
|
205
|
-
|
|
186
|
+
const themes = config.themes || {};
|
|
206
187
|
|
|
207
|
-
|
|
208
|
-
// 1. Load each theme
|
|
209
|
-
// 2. Generate CSS for CSS themes
|
|
210
|
-
// 3. Execute createTheme for JS themes and generate CSS
|
|
211
|
-
// 4. Write files to output directory
|
|
188
|
+
console.log('Available Themes:\n');
|
|
212
189
|
|
|
213
|
-
|
|
190
|
+
if (Object.keys(themes).length === 0) {
|
|
191
|
+
console.log('No themes found in configuration.');
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
for (const [id, theme] of Object.entries(themes)) {
|
|
196
|
+
console.log(` ${id}`);
|
|
197
|
+
console.log(` Name: ${theme.name}`);
|
|
198
|
+
if (theme.description) {
|
|
199
|
+
console.log(` Description: ${theme.description}`);
|
|
200
|
+
}
|
|
201
|
+
if (theme.version) {
|
|
202
|
+
console.log(` Version: ${theme.version}`);
|
|
203
|
+
}
|
|
204
|
+
if (theme.status) {
|
|
205
|
+
console.log(` Status: ${theme.status}`);
|
|
206
|
+
}
|
|
207
|
+
console.log();
|
|
208
|
+
}
|
|
214
209
|
} catch (error) {
|
|
215
|
-
console.error('
|
|
210
|
+
console.error('Failed to list themes:', error);
|
|
216
211
|
process.exit(1);
|
|
217
212
|
}
|
|
218
213
|
}
|
|
219
214
|
|
|
220
215
|
/**
|
|
221
|
-
* Handle
|
|
216
|
+
* Handle inspect command
|
|
222
217
|
*/
|
|
223
|
-
private
|
|
224
|
-
|
|
225
|
-
console.log('Note: This is a placeholder. Implement actual type generation logic.');
|
|
218
|
+
private handleInspect(args: string[], options: Record<string, any>): void {
|
|
219
|
+
const themeName = options.theme || args[0];
|
|
226
220
|
|
|
221
|
+
if (!themeName) {
|
|
222
|
+
console.error('Error: Theme name is required');
|
|
223
|
+
console.error('Usage: atomix-theme inspect --theme <theme-name>');
|
|
224
|
+
process.exit(1);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
try {
|
|
228
|
+
const config = loadThemeConfig();
|
|
229
|
+
const theme = config.themes?.[themeName];
|
|
230
|
+
|
|
231
|
+
if (!theme) {
|
|
232
|
+
console.error(`Error: Theme "${themeName}" not found`);
|
|
233
|
+
process.exit(1);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (options.json) {
|
|
237
|
+
console.log(JSON.stringify(theme, null, 2));
|
|
238
|
+
} else {
|
|
239
|
+
console.log(`Theme: ${themeName}\n`);
|
|
240
|
+
console.log(JSON.stringify(theme, null, 2));
|
|
241
|
+
}
|
|
242
|
+
} catch (error) {
|
|
243
|
+
console.error('Failed to inspect theme:', error);
|
|
244
|
+
process.exit(1);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Handle compare command
|
|
250
|
+
*/
|
|
251
|
+
private handleCompare(args: string[], options: Record<string, any>): void {
|
|
252
|
+
const theme1 = options.theme1 || args[0];
|
|
253
|
+
const theme2 = options.theme2 || args[1];
|
|
254
|
+
|
|
255
|
+
if (!theme1 || !theme2) {
|
|
256
|
+
console.error('Error: Two theme names are required');
|
|
257
|
+
console.error('Usage: atomix-theme compare --theme1 <name1> --theme2 <name2>');
|
|
258
|
+
process.exit(1);
|
|
259
|
+
}
|
|
260
|
+
|
|
227
261
|
try {
|
|
228
262
|
const config = loadThemeConfig();
|
|
229
|
-
const
|
|
263
|
+
const themeA = config.themes?.[theme1];
|
|
264
|
+
const themeB = config.themes?.[theme2];
|
|
265
|
+
|
|
266
|
+
if (!themeA) {
|
|
267
|
+
console.error(`Error: Theme "${theme1}" not found`);
|
|
268
|
+
process.exit(1);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (!themeB) {
|
|
272
|
+
console.error(`Error: Theme "${theme2}" not found`);
|
|
273
|
+
process.exit(1);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
console.log(`Comparing: ${theme1} vs ${theme2}\n`);
|
|
277
|
+
console.log('Differences:');
|
|
230
278
|
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
// 2. Generate TypeScript definitions
|
|
234
|
-
// 3. Write to output file
|
|
279
|
+
// Simple comparison (could be enhanced)
|
|
280
|
+
const keys = new Set([...Object.keys(themeA), ...Object.keys(themeB)]);
|
|
235
281
|
|
|
236
|
-
|
|
237
|
-
|
|
282
|
+
for (const key of keys) {
|
|
283
|
+
const valueA = (themeA as any)[key];
|
|
284
|
+
const valueB = (themeB as any)[key];
|
|
285
|
+
|
|
286
|
+
if (JSON.stringify(valueA) !== JSON.stringify(valueB)) {
|
|
287
|
+
console.log(`\n ${key}:`);
|
|
288
|
+
console.log(` ${theme1}: ${JSON.stringify(valueA)}`);
|
|
289
|
+
console.log(` ${theme2}: ${JSON.stringify(valueB)}`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
238
292
|
} catch (error) {
|
|
239
|
-
console.error('
|
|
293
|
+
console.error('Failed to compare themes:', error);
|
|
294
|
+
process.exit(1);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Handle export command
|
|
300
|
+
*/
|
|
301
|
+
private handleExport(args: string[], options: Record<string, any>): void {
|
|
302
|
+
const themeName = options.theme || args[0];
|
|
303
|
+
const outputPath = options.output || `${themeName}.json`;
|
|
304
|
+
|
|
305
|
+
if (!themeName) {
|
|
306
|
+
console.error('Error: Theme name is required');
|
|
307
|
+
console.error('Usage: atomix-theme export --theme <theme-name> [--output <path>]');
|
|
308
|
+
process.exit(1);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
try {
|
|
312
|
+
const config = loadThemeConfig();
|
|
313
|
+
const theme = config.themes?.[themeName];
|
|
314
|
+
|
|
315
|
+
if (!theme) {
|
|
316
|
+
console.error(`Error: Theme "${themeName}" not found`);
|
|
317
|
+
process.exit(1);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const fs = require('fs');
|
|
321
|
+
fs.writeFileSync(outputPath, JSON.stringify(theme, null, 2));
|
|
322
|
+
console.log(`✅ Theme exported to: ${outputPath}`);
|
|
323
|
+
} catch (error) {
|
|
324
|
+
console.error('Failed to export theme:', error);
|
|
240
325
|
process.exit(1);
|
|
241
326
|
}
|
|
242
327
|
}
|
|
@@ -245,13 +330,13 @@ export class ThemeCLI {
|
|
|
245
330
|
* Handle help command
|
|
246
331
|
*/
|
|
247
332
|
private handleHelp(args: string[], options: Record<string, any>): void {
|
|
248
|
-
console.log('Atomix Theme CLI
|
|
249
|
-
console.log('Usage: atomix-theme <command> [options]
|
|
333
|
+
console.log('Atomix Theme CLI\n');
|
|
334
|
+
console.log('Usage: atomix-theme <command> [options]\n');
|
|
250
335
|
console.log('Commands:');
|
|
251
336
|
|
|
252
337
|
for (const [name, command] of this.commands.entries()) {
|
|
253
338
|
console.log(` ${name.padEnd(12)} ${command.description}`);
|
|
254
|
-
|
|
339
|
+
|
|
255
340
|
if (command.options) {
|
|
256
341
|
for (const [option, description] of Object.entries(command.options)) {
|
|
257
342
|
console.log(` ${option.padEnd(16)} ${description}`);
|