@shohojdhara/atomix 0.3.1 → 0.3.3
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/CHANGELOG.md +0 -1
- package/README.md +41 -24
- package/dist/atomix.css +540 -666
- package/dist/atomix.min.css +3 -3
- package/dist/index.d.ts +7559 -5717
- package/dist/index.esm.js +5013 -2301
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5084 -2356
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/applemix.css +1683 -722
- package/dist/themes/applemix.css.map +1 -0
- package/dist/themes/applemix.min.css +13 -10
- package/dist/themes/boomdevs.css +1358 -544
- package/dist/themes/boomdevs.css.map +1 -0
- package/dist/themes/boomdevs.min.css +13 -10
- package/dist/themes/esrar.css +1743 -718
- package/dist/themes/esrar.css.map +1 -0
- package/dist/themes/esrar.min.css +41 -7
- package/dist/themes/flashtrade.css +1735 -752
- package/dist/themes/flashtrade.css.map +1 -0
- package/dist/themes/flashtrade.min.css +19 -13
- package/dist/themes/mashroom.css +1765 -787
- package/dist/themes/mashroom.css.map +1 -0
- package/dist/themes/mashroom.min.css +87 -38
- package/dist/themes/shaj-default.css +1685 -713
- package/dist/themes/shaj-default.css.map +1 -0
- package/dist/themes/shaj-default.min.css +11 -7
- package/package.json +95 -26
- package/scripts/atomix-cli.js +1428 -0
- package/scripts/build-themes.js +208 -0
- package/scripts/cli/interactive-init.js +528 -0
- package/scripts/cli/migration-tools.js +603 -0
- package/scripts/cli/token-manager.js +519 -0
- package/scripts/sync-theme-config.js +309 -0
- package/src/components/List/ListGroup.tsx +1 -2
- package/src/components/Popover/Popover.tsx +2 -2
- package/src/components/Tooltip/Tooltip.stories.tsx +49 -12
- package/src/components/Tooltip/Tooltip.tsx +32 -58
- package/src/lib/composables/useAtomixGlass.ts +46 -46
- package/src/lib/composables/useTooltip.ts +285 -0
- package/src/lib/constants/cssVariables.ts +390 -0
- package/src/lib/hooks/__tests__/useComponentCustomization.test.ts +151 -0
- package/src/lib/hooks/index.ts +19 -0
- package/src/lib/hooks/useComponentCustomization.ts +175 -0
- package/src/lib/index.ts +10 -1
- package/src/lib/patterns/__tests__/slots.test.ts +108 -0
- package/src/lib/patterns/index.ts +35 -0
- package/src/lib/patterns/slots.tsx +421 -0
- package/src/lib/theme/__tests__/ThemeBuilder.test.ts +223 -0
- package/src/lib/theme/builders/ThemeBuilder.ts +372 -0
- package/src/lib/theme/config/index.ts +21 -0
- package/src/lib/theme/config/loader.ts +276 -0
- package/src/lib/theme/config/types.ts +98 -0
- package/src/lib/theme/config/validator.ts +326 -0
- package/src/lib/theme/constants.ts +183 -0
- package/src/lib/theme/core/ThemeCache.ts +283 -0
- package/src/lib/theme/core/ThemeEngine.test.ts +146 -0
- package/src/lib/theme/core/ThemeEngine.ts +657 -0
- package/src/lib/theme/core/ThemeRegistry.ts +284 -0
- package/src/lib/theme/core/ThemeValidator.ts +530 -0
- package/src/lib/theme/core/index.ts +24 -0
- package/src/lib/theme/createTheme.ts +83 -204
- package/src/lib/theme/cssVariableMapper.ts +261 -0
- package/src/lib/theme/devtools/CLI.ts +279 -0
- package/src/lib/theme/devtools/Inspector.tsx +594 -0
- package/src/lib/theme/devtools/Preview.tsx +392 -0
- package/src/lib/theme/devtools/index.ts +21 -0
- package/src/lib/theme/errors.test.ts +207 -0
- package/src/lib/theme/errors.ts +233 -0
- package/src/lib/theme/generateCSSVariables.ts +93 -9
- package/src/lib/theme/generators/CSSGenerator.ts +311 -0
- package/src/lib/theme/generators/ConfigGenerator.ts +287 -0
- package/src/lib/theme/generators/TypeGenerator.ts +228 -0
- package/src/lib/theme/generators/index.ts +21 -0
- package/src/lib/theme/i18n/index.ts +9 -0
- package/src/lib/theme/i18n/rtl.ts +325 -0
- package/src/lib/theme/index.ts +36 -109
- package/src/lib/theme/monitoring/ThemeAnalytics.ts +409 -0
- package/src/lib/theme/monitoring/index.ts +17 -0
- package/src/lib/theme/overrides/ComponentOverrides.ts +243 -0
- package/src/lib/theme/overrides/index.ts +15 -0
- package/src/lib/theme/runtime/ThemeApplicator.ts +252 -0
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +233 -0
- package/src/lib/theme/runtime/ThemeManager.test.ts +176 -0
- package/src/lib/theme/runtime/ThemeManager.ts +442 -0
- package/src/lib/theme/runtime/ThemeProvider.tsx +318 -0
- package/src/lib/theme/runtime/index.ts +17 -0
- package/src/lib/theme/runtime/useTheme.ts +52 -0
- package/src/lib/theme/themeUtils.ts +27 -5
- package/src/lib/theme/types.ts +62 -1
- package/src/lib/theme/utils.ts +23 -22
- package/src/lib/theme/whitelabel/WhiteLabelManager.ts +364 -0
- package/src/lib/theme/whitelabel/index.ts +13 -0
- package/src/lib/theme-tools.ts +185 -0
- package/src/lib/types/components.ts +194 -0
- package/src/lib/types/partProps.ts +426 -0
- package/src/lib/utils/__tests__/componentUtils.test.ts +144 -0
- package/src/lib/utils/componentUtils.ts +163 -0
- package/src/lib/utils/index.ts +17 -57
- package/src/styles/01-settings/_settings.badge.scss +1 -1
- package/src/styles/01-settings/_settings.callout.scss +1 -1
- package/src/styles/01-settings/_settings.card.scss +1 -1
- package/src/styles/01-settings/_settings.colors.scss +10 -10
- package/src/styles/01-settings/_settings.input.scss +1 -1
- package/src/styles/01-settings/_settings.navbar.scss +1 -1
- package/src/styles/01-settings/_settings.tooltip.scss +1 -1
- package/src/styles/01-settings/_settings.upload.scss +1 -1
- package/src/styles/06-components/_components.chart.scss +2 -2
- package/src/styles/06-components/_components.tooltip.scss +31 -81
- package/src/styles/99-utilities/_utilities.border.scss +27 -58
- package/src/styles/99-utilities/_utilities.gradient.scss +12 -0
- package/src/styles/99-utilities/_utilities.position.scss +8 -15
- package/src/styles/99-utilities/_utilities.scss +2 -0
- package/src/styles/99-utilities/_utilities.spacing.scss +76 -121
- package/src/styles/99-utilities/_utilities.text.scss +30 -49
- package/src/themes/README.md +443 -0
- package/src/themes/THEME_CHECKLIST.md +74 -0
- package/src/themes/applemix/01-settings/_index.scss +24 -0
- package/src/themes/applemix/01-settings/_settings.animations.scss +0 -0
- package/src/themes/applemix/01-settings/_settings.background.scss +6 -0
- package/src/themes/applemix/01-settings/_settings.colors.scss +75 -0
- package/src/themes/applemix/01-settings/_settings.config.scss +15 -0
- package/src/themes/applemix/01-settings/_settings.typography.scss +30 -0
- package/src/themes/applemix/02-tools/_index.scss +4 -0
- package/src/themes/applemix/03-generic/_index.scss +7 -0
- package/src/themes/applemix/04-elements/_index.scss +7 -0
- package/src/themes/applemix/05-objects/_index.scss +7 -0
- package/src/themes/applemix/06-components/_index.scss +15 -0
- package/src/themes/applemix/99-utilities/_index.scss +7 -0
- package/src/themes/applemix/README.md +378 -0
- package/src/themes/applemix/index.scss +33 -0
- package/src/themes/boomdevs/01-settings/_index.scss +38 -0
- package/src/themes/boomdevs/01-settings/_settings.accordion.scss +12 -0
- package/src/themes/boomdevs/01-settings/_settings.animations.scss +11 -0
- package/src/themes/boomdevs/01-settings/_settings.avatar.scss +9 -0
- package/src/themes/boomdevs/01-settings/_settings.badge.scss +11 -0
- package/src/themes/boomdevs/01-settings/_settings.border-radius.scss +16 -0
- package/src/themes/boomdevs/01-settings/_settings.border.scss +10 -0
- package/src/themes/boomdevs/01-settings/_settings.box-shadow.scss +14 -0
- package/src/themes/boomdevs/01-settings/_settings.breadcrumb.scss +13 -0
- package/src/themes/boomdevs/01-settings/_settings.breakpoints.scss +15 -0
- package/src/themes/boomdevs/01-settings/_settings.button.scss +9 -0
- package/src/themes/boomdevs/01-settings/_settings.callout.scss +9 -0
- package/src/themes/boomdevs/01-settings/_settings.card.scss +11 -0
- package/src/themes/boomdevs/01-settings/_settings.checkbox.scss +9 -0
- package/src/themes/boomdevs/01-settings/_settings.colors.scss +145 -0
- package/src/themes/boomdevs/01-settings/_settings.dropdown.scss +11 -0
- package/src/themes/boomdevs/01-settings/_settings.grid.scss +16 -0
- package/src/themes/boomdevs/01-settings/_settings.input.scss +14 -0
- package/src/themes/boomdevs/01-settings/_settings.link.scss +11 -0
- package/src/themes/boomdevs/01-settings/_settings.list.scss +10 -0
- package/src/themes/boomdevs/01-settings/_settings.modal.scss +16 -0
- package/src/themes/boomdevs/01-settings/_settings.navbar.scss +16 -0
- package/src/themes/boomdevs/01-settings/_settings.pagination.scss +13 -0
- package/src/themes/boomdevs/01-settings/_settings.progress.scss +11 -0
- package/src/themes/boomdevs/01-settings/_settings.rating.scss +10 -0
- package/src/themes/boomdevs/01-settings/_settings.spacing.scss +33 -0
- package/src/themes/boomdevs/01-settings/_settings.spinner.scss +11 -0
- package/src/themes/boomdevs/01-settings/_settings.steps.scss +12 -0
- package/src/themes/boomdevs/01-settings/_settings.tabs.scss +12 -0
- package/src/themes/boomdevs/01-settings/_settings.todo.scss +15 -0
- package/src/themes/boomdevs/01-settings/_settings.toggle.scss +14 -0
- package/src/themes/boomdevs/01-settings/_settings.tooltip.scss +13 -0
- package/src/themes/boomdevs/01-settings/_settings.typography.scss +58 -0
- package/src/themes/boomdevs/01-settings/_settings.video-player.scss +12 -0
- package/src/themes/boomdevs/02-tools/_index.scss +7 -0
- package/src/themes/boomdevs/03-generic/_index.scss +7 -0
- package/src/themes/boomdevs/04-elements/_index.scss +7 -0
- package/src/themes/boomdevs/05-objects/_index.scss +7 -0
- package/src/themes/boomdevs/06-components/_components.button.scss +11 -0
- package/src/themes/boomdevs/06-components/_index.scss +11 -0
- package/src/themes/boomdevs/99-utilities/_index.scss +7 -0
- package/src/themes/boomdevs/index.scss +26 -0
- package/src/themes/esrar/01-settings/_index.scss +15 -0
- package/src/themes/esrar/01-settings/_settings.colors.scss +91 -0
- package/src/themes/esrar/02-tools/_index.scss +8 -0
- package/src/themes/esrar/02-tools/_tools.animations.scss +342 -0
- package/src/themes/esrar/06-components/_components.accordion.scss +49 -0
- package/src/themes/esrar/06-components/_components.avatar-group.scss +14 -0
- package/src/themes/esrar/06-components/_components.avatar.scss +61 -0
- package/src/themes/esrar/06-components/_components.badge.scss +117 -0
- package/src/themes/esrar/06-components/_components.breadcrumb.scss +65 -0
- package/src/themes/esrar/06-components/_components.btn-group.scss +19 -0
- package/src/themes/esrar/06-components/_components.button.scss +224 -0
- package/src/themes/esrar/06-components/_components.callout.scss +51 -0
- package/src/themes/esrar/06-components/_components.card.scss +134 -0
- package/src/themes/esrar/06-components/_components.chart.scss +24 -0
- package/src/themes/esrar/06-components/_components.checkbox-group.scss +26 -0
- package/src/themes/esrar/06-components/_components.checkbox.scss +71 -0
- package/src/themes/esrar/06-components/_components.color-mode-toggle.scss +29 -0
- package/src/themes/esrar/06-components/_components.countdown.scss +67 -0
- package/src/themes/esrar/06-components/_components.data-table.scss +22 -0
- package/src/themes/esrar/06-components/_components.datepicker.scss +20 -0
- package/src/themes/esrar/06-components/_components.dropdown.scss +272 -0
- package/src/themes/esrar/06-components/_components.edge-panel.scss +10 -0
- package/src/themes/esrar/06-components/_components.form-group.scss +15 -0
- package/src/themes/esrar/06-components/_components.form.scss +66 -0
- package/src/themes/esrar/06-components/_components.hero.scss +251 -0
- package/src/themes/esrar/06-components/_components.icon.scss +33 -0
- package/src/themes/esrar/06-components/_components.image-gallery.scss +29 -0
- package/src/themes/esrar/06-components/_components.input.scss +91 -0
- package/src/themes/esrar/06-components/_components.list-group.scss +26 -0
- package/src/themes/esrar/06-components/_components.modal.scss +148 -0
- package/src/themes/esrar/06-components/_components.notification.scss +80 -0
- package/src/themes/esrar/06-components/_components.pagination.scss +84 -0
- package/src/themes/esrar/06-components/_components.popover.scss +10 -0
- package/src/themes/esrar/06-components/_components.progress.scss +64 -0
- package/src/themes/esrar/06-components/_components.rating.scss +26 -0
- package/src/themes/esrar/06-components/_components.skeleton.scss +15 -0
- package/src/themes/esrar/06-components/_components.slider.scss +90 -0
- package/src/themes/esrar/06-components/_components.spinner.scss +71 -0
- package/src/themes/esrar/06-components/_components.steps.scss +76 -0
- package/src/themes/esrar/06-components/_components.tab.scss +58 -0
- package/src/themes/esrar/06-components/_components.tag.scss +21 -0
- package/src/themes/esrar/06-components/_components.timeline.scss +19 -0
- package/src/themes/esrar/06-components/_components.toast.scss +91 -0
- package/src/themes/esrar/06-components/_components.toggle.scss +74 -0
- package/src/themes/esrar/06-components/_components.tooltip.scss +45 -0
- package/src/themes/esrar/06-components/_components.upload.scss +102 -0
- package/src/themes/esrar/06-components/_index.scss +42 -0
- package/src/themes/esrar/index.scss +30 -0
- package/src/themes/flashtrade/01-settings/_index.scss +19 -0
- package/src/themes/flashtrade/01-settings/_settings.animations.scss +11 -0
- package/src/themes/flashtrade/01-settings/_settings.background.scss +9 -0
- package/src/themes/flashtrade/01-settings/_settings.colors.scss +79 -0
- package/src/themes/flashtrade/01-settings/_settings.config.scss +16 -0
- package/src/themes/flashtrade/01-settings/_settings.typography.scss +35 -0
- package/src/themes/flashtrade/02-tools/_index.scss +8 -0
- package/src/themes/flashtrade/03-generic/_index.scss +8 -0
- package/src/themes/flashtrade/04-elements/_index.scss +12 -0
- package/src/themes/flashtrade/05-objects/_index.scss +8 -0
- package/src/themes/flashtrade/06-components/_components.badge.scss +156 -0
- package/src/themes/flashtrade/06-components/_components.button.scss +135 -0
- package/src/themes/flashtrade/06-components/_components.card.scss +214 -0
- package/src/themes/flashtrade/06-components/_components.navbar.scss +227 -0
- package/src/themes/flashtrade/06-components/_index.scss +13 -0
- package/src/themes/flashtrade/99-utilities/_index.scss +9 -0
- package/src/themes/flashtrade/99-utilities/_utilities.trading.scss +187 -0
- package/src/themes/flashtrade/README.md +386 -0
- package/src/themes/flashtrade/demo.html +272 -0
- package/src/themes/flashtrade/index.scss +36 -0
- package/src/themes/mashroom/01-settings/_index.scss +69 -0
- package/src/themes/mashroom/01-settings/_settings.accordion.scss +32 -0
- package/src/themes/mashroom/01-settings/_settings.animations.scss +26 -0
- package/src/themes/mashroom/01-settings/_settings.avatar-group.scss +22 -0
- package/src/themes/mashroom/01-settings/_settings.avatar.scss +57 -0
- package/src/themes/mashroom/01-settings/_settings.badge.scss +19 -0
- package/src/themes/mashroom/01-settings/_settings.border-radius.scss +24 -0
- package/src/themes/mashroom/01-settings/_settings.border.scss +14 -0
- package/src/themes/mashroom/01-settings/_settings.box-shadow.scss +40 -0
- package/src/themes/mashroom/01-settings/_settings.breadcrumb.scss +0 -0
- package/src/themes/mashroom/01-settings/_settings.breakpoints.scss +17 -0
- package/src/themes/mashroom/01-settings/_settings.btn-group.scss +5 -0
- package/src/themes/mashroom/01-settings/_settings.button.scss +50 -0
- package/src/themes/mashroom/01-settings/_settings.callout.scss +81 -0
- package/src/themes/mashroom/01-settings/_settings.card.scss +52 -0
- package/src/themes/mashroom/01-settings/_settings.checkbox-group.scss +5 -0
- package/src/themes/mashroom/01-settings/_settings.checkbox.scss +23 -0
- package/src/themes/mashroom/01-settings/_settings.color-mode.scss +7 -0
- package/src/themes/mashroom/01-settings/_settings.colors.scss +180 -0
- package/src/themes/mashroom/01-settings/_settings.config.scss +4 -0
- package/src/themes/mashroom/01-settings/_settings.countdown.scss +20 -0
- package/src/themes/mashroom/01-settings/_settings.data-table.scss +56 -0
- package/src/themes/mashroom/01-settings/_settings.datepicker.scss +45 -0
- package/src/themes/mashroom/01-settings/_settings.design-tokens.scss +3 -0
- package/src/themes/mashroom/01-settings/_settings.dropdown.scss +45 -0
- package/src/themes/mashroom/01-settings/_settings.edge-panel.scss +24 -0
- package/src/themes/mashroom/01-settings/_settings.fonts.scss +8 -0
- package/src/themes/mashroom/01-settings/_settings.form-group.scss +14 -0
- package/src/themes/mashroom/01-settings/_settings.form.scss +6 -0
- package/src/themes/mashroom/01-settings/_settings.grid.scss +23 -0
- package/src/themes/mashroom/01-settings/_settings.hero.scss +41 -0
- package/src/themes/mashroom/01-settings/_settings.input.scss +51 -0
- package/src/themes/mashroom/01-settings/_settings.link.scss +13 -0
- package/src/themes/mashroom/01-settings/_settings.list-group.scss +16 -0
- package/src/themes/mashroom/01-settings/_settings.list.scss +13 -0
- package/src/themes/mashroom/01-settings/_settings.masonry-grid.scss +23 -0
- package/src/themes/mashroom/01-settings/_settings.menu.scss +50 -0
- package/src/themes/mashroom/01-settings/_settings.messages.scss +98 -0
- package/src/themes/mashroom/01-settings/_settings.modal.scss +41 -0
- package/src/themes/mashroom/01-settings/_settings.nav.scss +20 -0
- package/src/themes/mashroom/01-settings/_settings.navbar.scss +54 -0
- package/src/themes/mashroom/01-settings/_settings.pagination.scss +30 -0
- package/src/themes/mashroom/01-settings/_settings.photoviewer.scss +45 -0
- package/src/themes/mashroom/01-settings/_settings.popover.scss +20 -0
- package/src/themes/mashroom/01-settings/_settings.position.scss +9 -0
- package/src/themes/mashroom/01-settings/_settings.progress.scss +17 -0
- package/src/themes/mashroom/01-settings/_settings.rating.scss +11 -0
- package/src/themes/mashroom/01-settings/_settings.river.scss +50 -0
- package/src/themes/mashroom/01-settings/_settings.sectionintro.scss +31 -0
- package/src/themes/mashroom/01-settings/_settings.select.scss +47 -0
- package/src/themes/mashroom/01-settings/_settings.side-menu.scss +79 -0
- package/src/themes/mashroom/01-settings/_settings.skeleton.scss +24 -0
- package/src/themes/mashroom/01-settings/_settings.spacing.scss +66 -0
- package/src/themes/mashroom/01-settings/_settings.spinner.scss +34 -0
- package/src/themes/mashroom/01-settings/_settings.steps.scss +33 -0
- package/src/themes/mashroom/01-settings/_settings.tabs.scss +33 -0
- package/src/themes/mashroom/01-settings/_settings.testimonials.scss +24 -0
- package/src/themes/mashroom/01-settings/_settings.todo.scss +52 -0
- package/src/themes/mashroom/01-settings/_settings.toggle.scss +49 -0
- package/src/themes/mashroom/01-settings/_settings.tooltip.scss +20 -0
- package/src/themes/mashroom/01-settings/_settings.typography.scss +95 -0
- package/src/themes/mashroom/01-settings/_settings.upload.scss +96 -0
- package/src/themes/mashroom/01-settings/_settings.z-layers.scss +19 -0
- package/src/themes/mashroom/02-tools/_index.scss +8 -0
- package/src/themes/mashroom/02-tools/_tools.psychedelic-gradients.scss +78 -0
- package/src/themes/mashroom/02-tools/_tools.trippy-effects.scss +114 -0
- package/src/themes/mashroom/03-generic/_index.scss +6 -0
- package/src/themes/mashroom/04-elements/_index.scss +6 -0
- package/src/themes/mashroom/05-objects/_index.scss +6 -0
- package/src/themes/mashroom/06-components/_components.accordion.scss +187 -0
- package/src/themes/mashroom/06-components/_components.avatar-group.scss +276 -0
- package/src/themes/mashroom/06-components/_components.avatar.scss +114 -0
- package/src/themes/mashroom/06-components/_components.badge.scss +152 -0
- package/src/themes/mashroom/06-components/_components.breadcrumb.scss +162 -0
- package/src/themes/mashroom/06-components/_components.btn-group.scss +404 -0
- package/src/themes/mashroom/06-components/_components.button.scss +160 -0
- package/src/themes/mashroom/06-components/_components.callout.scss +140 -0
- package/src/themes/mashroom/06-components/_components.card.scss +225 -0
- package/src/themes/mashroom/06-components/_components.checkbox.scss +186 -0
- package/src/themes/mashroom/06-components/_components.color-mode-toggle.scss +308 -0
- package/src/themes/mashroom/06-components/_components.countdown.scss +402 -0
- package/src/themes/mashroom/06-components/_components.data-table.scss +354 -0
- package/src/themes/mashroom/06-components/_components.datepicker.scss +349 -0
- package/src/themes/mashroom/06-components/_components.dropdown.scss +334 -0
- package/src/themes/mashroom/06-components/_components.edge-panel.scss +413 -0
- package/src/themes/mashroom/06-components/_components.form-group.scss +433 -0
- package/src/themes/mashroom/06-components/_components.form.scss +358 -0
- package/src/themes/mashroom/06-components/_components.hero.scss +151 -0
- package/src/themes/mashroom/06-components/_components.input.scss +147 -0
- package/src/themes/mashroom/06-components/_components.list-group.scss +456 -0
- package/src/themes/mashroom/06-components/_components.list.scss +145 -0
- package/src/themes/mashroom/06-components/_components.menu.scss +497 -0
- package/src/themes/mashroom/06-components/_components.messages.scss +277 -0
- package/src/themes/mashroom/06-components/_components.modal.scss +264 -0
- package/src/themes/mashroom/06-components/_components.nav.scss +181 -0
- package/src/themes/mashroom/06-components/_components.navbar.scss +538 -0
- package/src/themes/mashroom/06-components/_components.pagination.scss +400 -0
- package/src/themes/mashroom/06-components/_components.photoviewer.scss +498 -0
- package/src/themes/mashroom/06-components/_components.popover.scss +383 -0
- package/src/themes/mashroom/06-components/_components.product-review.scss +408 -0
- package/src/themes/mashroom/06-components/_components.progress.scss +249 -0
- package/src/themes/mashroom/06-components/_components.rating.scss +300 -0
- package/src/themes/mashroom/06-components/_components.river.scss +570 -0
- package/src/themes/mashroom/06-components/_components.sectionintro.scss +546 -0
- package/src/themes/mashroom/06-components/_components.select.scss +455 -0
- package/src/themes/mashroom/06-components/_components.side-menu.scss +635 -0
- package/src/themes/mashroom/06-components/_components.skeleton.scss +447 -0
- package/src/themes/mashroom/06-components/_components.slider.scss +414 -0
- package/src/themes/mashroom/06-components/_components.spinner.scss +198 -0
- package/src/themes/mashroom/06-components/_components.steps.scss +350 -0
- package/src/themes/mashroom/06-components/_components.tabs.scss +269 -0
- package/src/themes/mashroom/06-components/_components.testimonials.scss +561 -0
- package/src/themes/mashroom/06-components/_components.toggle.scss +231 -0
- package/src/themes/mashroom/06-components/_components.tooltip.scss +167 -0
- package/src/themes/mashroom/06-components/_components.upload.scss +537 -0
- package/src/themes/mashroom/06-components/_components.video-player.scss +560 -0
- package/src/themes/mashroom/06-components/_index.scss +55 -0
- package/src/themes/mashroom/99-utilities/_index.scss +6 -0
- package/src/themes/mashroom/index.scss +26 -0
- package/src/themes/shaj-default/01-settings/_index.scss +69 -0
- package/src/themes/shaj-default/01-settings/_settings.accordion.scss +38 -0
- package/src/themes/shaj-default/01-settings/_settings.animations.scss +32 -0
- package/src/themes/shaj-default/01-settings/_settings.avatar-group.scss +28 -0
- package/src/themes/shaj-default/01-settings/_settings.avatar.scss +63 -0
- package/src/themes/shaj-default/01-settings/_settings.badge.scss +25 -0
- package/src/themes/shaj-default/01-settings/_settings.border-radius.scss +24 -0
- package/src/themes/shaj-default/01-settings/_settings.border.scss +20 -0
- package/src/themes/shaj-default/01-settings/_settings.box-shadow.scss +46 -0
- package/src/themes/shaj-default/01-settings/_settings.breadcrumb.scss +0 -0
- package/src/themes/shaj-default/01-settings/_settings.breakpoints.scss +23 -0
- package/src/themes/shaj-default/01-settings/_settings.btn-group.scss +11 -0
- package/src/themes/shaj-default/01-settings/_settings.button.scss +56 -0
- package/src/themes/shaj-default/01-settings/_settings.callout.scss +87 -0
- package/src/themes/shaj-default/01-settings/_settings.card.scss +52 -0
- package/src/themes/shaj-default/01-settings/_settings.checkbox-group.scss +11 -0
- package/src/themes/shaj-default/01-settings/_settings.checkbox.scss +29 -0
- package/src/themes/shaj-default/01-settings/_settings.color-mode.scss +13 -0
- package/src/themes/shaj-default/01-settings/_settings.colors.scss +91 -0
- package/src/themes/shaj-default/01-settings/_settings.config.scss +4 -0
- package/src/themes/shaj-default/01-settings/_settings.countdown.scss +26 -0
- package/src/themes/shaj-default/01-settings/_settings.data-table.scss +62 -0
- package/src/themes/shaj-default/01-settings/_settings.datepicker.scss +51 -0
- package/src/themes/shaj-default/01-settings/_settings.design-tokens.scss +9 -0
- package/src/themes/shaj-default/01-settings/_settings.dropdown.scss +51 -0
- package/src/themes/shaj-default/01-settings/_settings.edge-panel.scss +30 -0
- package/src/themes/shaj-default/01-settings/_settings.fonts.scss +13 -0
- package/src/themes/shaj-default/01-settings/_settings.form-group.scss +20 -0
- package/src/themes/shaj-default/01-settings/_settings.form.scss +12 -0
- package/src/themes/shaj-default/01-settings/_settings.grid.scss +29 -0
- package/src/themes/shaj-default/01-settings/_settings.hero.scss +47 -0
- package/src/themes/shaj-default/01-settings/_settings.input.scss +57 -0
- package/src/themes/shaj-default/01-settings/_settings.link.scss +19 -0
- package/src/themes/shaj-default/01-settings/_settings.list-group.scss +22 -0
- package/src/themes/shaj-default/01-settings/_settings.list.scss +19 -0
- package/src/themes/shaj-default/01-settings/_settings.masonry-grid.scss +29 -0
- package/src/themes/shaj-default/01-settings/_settings.menu.scss +56 -0
- package/src/themes/shaj-default/01-settings/_settings.messages.scss +104 -0
- package/src/themes/shaj-default/01-settings/_settings.modal.scss +47 -0
- package/src/themes/shaj-default/01-settings/_settings.nav.scss +26 -0
- package/src/themes/shaj-default/01-settings/_settings.navbar.scss +60 -0
- package/src/themes/shaj-default/01-settings/_settings.pagination.scss +36 -0
- package/src/themes/shaj-default/01-settings/_settings.photoviewer.scss +51 -0
- package/src/themes/shaj-default/01-settings/_settings.popover.scss +26 -0
- package/src/themes/shaj-default/01-settings/_settings.position.scss +15 -0
- package/src/themes/shaj-default/01-settings/_settings.progress.scss +23 -0
- package/src/themes/shaj-default/01-settings/_settings.rating.scss +17 -0
- package/src/themes/shaj-default/01-settings/_settings.river.scss +56 -0
- package/src/themes/shaj-default/01-settings/_settings.sectionintro.scss +37 -0
- package/src/themes/shaj-default/01-settings/_settings.select.scss +53 -0
- package/src/themes/shaj-default/01-settings/_settings.side-menu.scss +85 -0
- package/src/themes/shaj-default/01-settings/_settings.skeleton.scss +30 -0
- package/src/themes/shaj-default/01-settings/_settings.spacing.scss +72 -0
- package/src/themes/shaj-default/01-settings/_settings.spinner.scss +24 -0
- package/src/themes/shaj-default/01-settings/_settings.steps.scss +39 -0
- package/src/themes/shaj-default/01-settings/_settings.tabs.scss +39 -0
- package/src/themes/shaj-default/01-settings/_settings.testimonials.scss +30 -0
- package/src/themes/shaj-default/01-settings/_settings.todo.scss +58 -0
- package/src/themes/shaj-default/01-settings/_settings.toggle.scss +55 -0
- package/src/themes/shaj-default/01-settings/_settings.tooltip.scss +26 -0
- package/src/themes/shaj-default/01-settings/_settings.typography.scss +101 -0
- package/src/themes/shaj-default/01-settings/_settings.upload.scss +102 -0
- package/src/themes/shaj-default/01-settings/_settings.z-layers.scss +25 -0
- 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 +2 -0
- 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 +55 -0
- package/src/themes/shaj-default/06-components/_components.card.scss +57 -0
- package/src/themes/shaj-default/06-components/_components.input.scss +58 -0
- package/src/themes/shaj-default/06-components/_components.navbar.scss +99 -0
- package/src/themes/shaj-default/06-components/_components.tooltip.scss +0 -0
- package/src/themes/shaj-default/06-components/_index.scss +13 -0
- package/src/themes/shaj-default/99-utilities/_index.scss +0 -0
- package/src/themes/shaj-default/index.scss +25 -0
- package/src/themes/themes.config.js +219 -0
- package/theme.config.ts +360 -0
- package/src/lib/theme/ThemeManager.integration.test.ts +0 -124
- package/src/lib/theme/ThemeManager.stories.tsx +0 -472
- package/src/lib/theme/ThemeManager.test.ts +0 -190
- package/src/lib/theme/ThemeManager.ts +0 -645
- package/src/lib/theme/ThemeProvider.tsx +0 -377
- package/src/lib/theme/createTheme.test.ts +0 -475
- package/src/lib/theme/useTheme.test.tsx +0 -67
- package/src/lib/theme/useTheme.ts +0 -64
- package/src/lib/theme/utils.test.ts +0 -140
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates theme configuration templates and scaffolding
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ThemeConfig, ThemeDefinition } from '../config/types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Config generation options
|
|
11
|
+
*/
|
|
12
|
+
export interface ConfigGeneratorOptions {
|
|
13
|
+
/** Include example themes */
|
|
14
|
+
includeExamples?: boolean;
|
|
15
|
+
/** Include comments and documentation */
|
|
16
|
+
includeComments?: boolean;
|
|
17
|
+
/** Output format */
|
|
18
|
+
format?: 'typescript' | 'javascript' | 'json';
|
|
19
|
+
/** Include build configuration */
|
|
20
|
+
includeBuild?: boolean;
|
|
21
|
+
/** Include runtime configuration */
|
|
22
|
+
includeRuntime?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Configuration Generator
|
|
27
|
+
*
|
|
28
|
+
* Generates theme configuration files and templates
|
|
29
|
+
*/
|
|
30
|
+
export class ConfigGenerator {
|
|
31
|
+
private options: Required<ConfigGeneratorOptions>;
|
|
32
|
+
|
|
33
|
+
constructor(options: ConfigGeneratorOptions = {}) {
|
|
34
|
+
this.options = {
|
|
35
|
+
includeExamples: options.includeExamples ?? true,
|
|
36
|
+
includeComments: options.includeComments ?? true,
|
|
37
|
+
format: options.format || 'typescript',
|
|
38
|
+
includeBuild: options.includeBuild ?? true,
|
|
39
|
+
includeRuntime: options.includeRuntime ?? true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Generate configuration template
|
|
45
|
+
*/
|
|
46
|
+
generate(): string {
|
|
47
|
+
let output = '';
|
|
48
|
+
|
|
49
|
+
if (this.options.includeComments) {
|
|
50
|
+
output += this.generateHeader();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (this.options.format === 'typescript') {
|
|
54
|
+
output += this.generateTypeScriptImports();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
output += this.generateConfigObject();
|
|
58
|
+
|
|
59
|
+
if (this.options.format === 'typescript') {
|
|
60
|
+
output += this.generateTypeScriptExport();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return output;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Generate file header
|
|
68
|
+
*/
|
|
69
|
+
private generateHeader(): string {
|
|
70
|
+
const comment = this.options.format === 'json' ? '' : '//';
|
|
71
|
+
return `${this.options.format === 'json' ? '' : '/**\n * Atomix Theme Configuration\n * \n * Configure themes, build settings, and runtime behavior\n */\n\n'}`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Generate TypeScript imports
|
|
76
|
+
*/
|
|
77
|
+
private generateTypeScriptImports(): string {
|
|
78
|
+
return `import type { ThemeConfig } from '@shohojdhara/atomix/theme/config';
|
|
79
|
+
import { createTheme } from '@shohojdhara/atomix/theme';
|
|
80
|
+
|
|
81
|
+
`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Generate configuration object
|
|
86
|
+
*/
|
|
87
|
+
private generateConfigObject(): string {
|
|
88
|
+
const isTS = this.options.format === 'typescript';
|
|
89
|
+
const isJSON = this.options.format === 'json';
|
|
90
|
+
|
|
91
|
+
let output = '';
|
|
92
|
+
|
|
93
|
+
if (isTS) {
|
|
94
|
+
output += 'const config: ThemeConfig = {\n';
|
|
95
|
+
} else if (!isJSON) {
|
|
96
|
+
output += 'const config = {\n';
|
|
97
|
+
} else {
|
|
98
|
+
output += '{\n';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Themes
|
|
102
|
+
output += ' themes: {\n';
|
|
103
|
+
|
|
104
|
+
if (this.options.includeExamples) {
|
|
105
|
+
output += this.generateExampleThemes();
|
|
106
|
+
} else {
|
|
107
|
+
if (this.options.includeComments && !isJSON) {
|
|
108
|
+
output += ' // Add your themes here\n';
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
output += ' },\n\n';
|
|
113
|
+
|
|
114
|
+
// Build configuration
|
|
115
|
+
if (this.options.includeBuild) {
|
|
116
|
+
output += this.generateBuildConfig();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Runtime configuration
|
|
120
|
+
if (this.options.includeRuntime) {
|
|
121
|
+
output += this.generateRuntimeConfig();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Integration configuration
|
|
125
|
+
output += this.generateIntegrationConfig();
|
|
126
|
+
|
|
127
|
+
output += '};\n\n';
|
|
128
|
+
|
|
129
|
+
return output;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Generate example themes
|
|
134
|
+
*/
|
|
135
|
+
private generateExampleThemes(): string {
|
|
136
|
+
const isJSON = this.options.format === 'json';
|
|
137
|
+
let output = '';
|
|
138
|
+
|
|
139
|
+
if (this.options.includeComments && !isJSON) {
|
|
140
|
+
output += ' // CSS Theme Example\n';
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
output += ` 'my-theme': {
|
|
144
|
+
type: 'css',
|
|
145
|
+
name: 'My Theme',
|
|
146
|
+
description: 'A custom theme for my application',
|
|
147
|
+
author: 'Your Name',
|
|
148
|
+
version: '1.0.0',
|
|
149
|
+
tags: ['custom', 'light'],
|
|
150
|
+
supportsDarkMode: true,
|
|
151
|
+
status: 'stable',
|
|
152
|
+
color: '#7AFFD7',
|
|
153
|
+
},\n\n`;
|
|
154
|
+
|
|
155
|
+
if (this.options.includeComments && !isJSON) {
|
|
156
|
+
output += ' // JS Theme Example\n';
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (this.options.format === 'typescript') {
|
|
160
|
+
output += ` 'my-js-theme': {
|
|
161
|
+
type: 'js',
|
|
162
|
+
name: 'My JS Theme',
|
|
163
|
+
description: 'A programmatically created theme',
|
|
164
|
+
author: 'Your Name',
|
|
165
|
+
version: '1.0.0',
|
|
166
|
+
tags: ['custom', 'js'],
|
|
167
|
+
status: 'experimental',
|
|
168
|
+
createTheme: () => createTheme({
|
|
169
|
+
name: 'My JS Theme',
|
|
170
|
+
palette: {
|
|
171
|
+
primary: { main: '#7AFFD7' },
|
|
172
|
+
secondary: { main: '#FF5733' },
|
|
173
|
+
},
|
|
174
|
+
typography: {
|
|
175
|
+
fontFamily: 'Inter, sans-serif',
|
|
176
|
+
},
|
|
177
|
+
}),
|
|
178
|
+
},\n\n`;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return output;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Generate build configuration
|
|
186
|
+
*/
|
|
187
|
+
private generateBuildConfig(): string {
|
|
188
|
+
const isJSON = this.options.format === 'json';
|
|
189
|
+
let output = '';
|
|
190
|
+
|
|
191
|
+
if (this.options.includeComments && !isJSON) {
|
|
192
|
+
output += ' // Build configuration\n';
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
output += ` build: {
|
|
196
|
+
output: {
|
|
197
|
+
directory: 'themes',
|
|
198
|
+
formats: {
|
|
199
|
+
expanded: '.css',
|
|
200
|
+
compressed: '.min.css',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
sass: {
|
|
204
|
+
style: 'expanded',
|
|
205
|
+
sourceMap: true,
|
|
206
|
+
loadPaths: ['src'],
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
`;
|
|
211
|
+
|
|
212
|
+
return output;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Generate runtime configuration
|
|
217
|
+
*/
|
|
218
|
+
private generateRuntimeConfig(): string {
|
|
219
|
+
const isJSON = this.options.format === 'json';
|
|
220
|
+
let output = '';
|
|
221
|
+
|
|
222
|
+
if (this.options.includeComments && !isJSON) {
|
|
223
|
+
output += ' // Runtime configuration\n';
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
output += ` runtime: {
|
|
227
|
+
basePath: '/themes',
|
|
228
|
+
cdnPath: null,
|
|
229
|
+
preload: ['my-theme'],
|
|
230
|
+
lazy: true,
|
|
231
|
+
defaultTheme: 'my-theme',
|
|
232
|
+
storageKey: 'atomix-theme',
|
|
233
|
+
dataAttribute: 'data-theme',
|
|
234
|
+
enablePersistence: true,
|
|
235
|
+
useMinified: process.env.NODE_ENV === 'production',
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
`;
|
|
239
|
+
|
|
240
|
+
return output;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Generate integration configuration
|
|
245
|
+
*/
|
|
246
|
+
private generateIntegrationConfig(): string {
|
|
247
|
+
const isJSON = this.options.format === 'json';
|
|
248
|
+
let output = '';
|
|
249
|
+
|
|
250
|
+
if (this.options.includeComments && !isJSON) {
|
|
251
|
+
output += ' // Integration configuration\n';
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
output += ` integration: {
|
|
255
|
+
cssVariables: {
|
|
256
|
+
colorMode: '--color-mode',
|
|
257
|
+
},
|
|
258
|
+
classNames: {
|
|
259
|
+
theme: 'data-theme',
|
|
260
|
+
colorMode: 'data-color-mode',
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
`;
|
|
265
|
+
|
|
266
|
+
return output;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Generate TypeScript export
|
|
271
|
+
*/
|
|
272
|
+
private generateTypeScriptExport(): string {
|
|
273
|
+
return `export default config;
|
|
274
|
+
`;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Generate configuration template
|
|
280
|
+
*
|
|
281
|
+
* @param options - Generation options
|
|
282
|
+
* @returns Configuration template string
|
|
283
|
+
*/
|
|
284
|
+
export function generateConfigTemplate(options: ConfigGeneratorOptions = {}): string {
|
|
285
|
+
const generator = new ConfigGenerator(options);
|
|
286
|
+
return generator.generate();
|
|
287
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript Type Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates TypeScript type definitions from theme objects
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Theme } from '../types';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Type generation options
|
|
11
|
+
*/
|
|
12
|
+
export interface TypeGeneratorOptions {
|
|
13
|
+
/** Module name for generated types */
|
|
14
|
+
moduleName?: string;
|
|
15
|
+
/** Include JSDoc comments */
|
|
16
|
+
includeComments?: boolean;
|
|
17
|
+
/** Export style */
|
|
18
|
+
exportStyle?: 'named' | 'default' | 'both';
|
|
19
|
+
/** Include theme interface augmentation */
|
|
20
|
+
includeAugmentation?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* TypeScript Type Generator
|
|
25
|
+
*
|
|
26
|
+
* Generates TypeScript definitions for theme objects
|
|
27
|
+
*/
|
|
28
|
+
export class TypeGenerator {
|
|
29
|
+
private options: Required<TypeGeneratorOptions>;
|
|
30
|
+
|
|
31
|
+
constructor(options: TypeGeneratorOptions = {}) {
|
|
32
|
+
this.options = {
|
|
33
|
+
moduleName: options.moduleName || 'Theme',
|
|
34
|
+
includeComments: options.includeComments ?? true,
|
|
35
|
+
exportStyle: options.exportStyle || 'named',
|
|
36
|
+
includeAugmentation: options.includeAugmentation ?? false,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Generate TypeScript definitions from theme
|
|
42
|
+
*/
|
|
43
|
+
generate(theme: Theme): string {
|
|
44
|
+
let output = '';
|
|
45
|
+
|
|
46
|
+
if (this.options.includeComments) {
|
|
47
|
+
output += this.generateHeader();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
output += this.generateImports();
|
|
51
|
+
output += this.generateThemeInterface(theme);
|
|
52
|
+
|
|
53
|
+
if (this.options.includeAugmentation) {
|
|
54
|
+
output += this.generateAugmentation();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return output;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Generate file header
|
|
62
|
+
*/
|
|
63
|
+
private generateHeader(): string {
|
|
64
|
+
return `/**
|
|
65
|
+
* Generated Theme Types
|
|
66
|
+
*
|
|
67
|
+
* Auto-generated TypeScript definitions for ${this.options.moduleName}
|
|
68
|
+
* Do not edit this file directly.
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Generate imports
|
|
76
|
+
*/
|
|
77
|
+
private generateImports(): string {
|
|
78
|
+
return `import type { Theme as BaseTheme } from '@shohojdhara/atomix/theme';
|
|
79
|
+
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Generate theme interface
|
|
85
|
+
*/
|
|
86
|
+
private generateThemeInterface(theme: Theme): string {
|
|
87
|
+
let output = '';
|
|
88
|
+
|
|
89
|
+
if (this.options.includeComments) {
|
|
90
|
+
output += `/**
|
|
91
|
+
* ${theme.name || 'Custom'} Theme Interface
|
|
92
|
+
*/
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
output += `export interface ${this.options.moduleName} extends BaseTheme {\n`;
|
|
97
|
+
output += ` name: '${theme.name}';\n`;
|
|
98
|
+
|
|
99
|
+
if (theme.class) {
|
|
100
|
+
output += ` class: '${theme.class}';\n`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Generate palette types
|
|
104
|
+
output += this.generatePaletteTypes(theme.palette);
|
|
105
|
+
|
|
106
|
+
// Generate typography types
|
|
107
|
+
output += this.generateTypographyTypes(theme.typography);
|
|
108
|
+
|
|
109
|
+
// Generate custom properties if any
|
|
110
|
+
if (Object.keys(theme.custom).length > 0) {
|
|
111
|
+
output += this.generateCustomTypes(theme.custom);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
output += '}\n\n';
|
|
115
|
+
|
|
116
|
+
// Generate exports
|
|
117
|
+
if (this.options.exportStyle === 'default' || this.options.exportStyle === 'both') {
|
|
118
|
+
output += `declare const theme: ${this.options.moduleName};\n`;
|
|
119
|
+
output += `export default theme;\n\n`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (this.options.exportStyle === 'named' || this.options.exportStyle === 'both') {
|
|
123
|
+
output += `export type { ${this.options.moduleName} };\n`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return output;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Generate palette types
|
|
131
|
+
*/
|
|
132
|
+
private generatePaletteTypes(palette: Theme['palette']): string {
|
|
133
|
+
let output = ' palette: {\n';
|
|
134
|
+
|
|
135
|
+
const colors = ['primary', 'secondary', 'error', 'warning', 'info', 'success'] as const;
|
|
136
|
+
for (const color of colors) {
|
|
137
|
+
const colorObj = palette[color];
|
|
138
|
+
if (colorObj) {
|
|
139
|
+
output += ` ${color}: {\n`;
|
|
140
|
+
output += ` main: '${colorObj.main}';\n`;
|
|
141
|
+
if (colorObj.light) output += ` light: '${colorObj.light}';\n`;
|
|
142
|
+
if (colorObj.dark) output += ` dark: '${colorObj.dark}';\n`;
|
|
143
|
+
if (colorObj.contrastText) output += ` contrastText: '${colorObj.contrastText}';\n`;
|
|
144
|
+
output += ' };\n';
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Background
|
|
149
|
+
if (palette.background) {
|
|
150
|
+
output += ' background: {\n';
|
|
151
|
+
output += ` default: '${palette.background.default}';\n`;
|
|
152
|
+
output += ` paper: '${palette.background.paper}';\n`;
|
|
153
|
+
output += ` subtle: '${palette.background.subtle}';\n`;
|
|
154
|
+
output += ' };\n';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Text
|
|
158
|
+
if (palette.text) {
|
|
159
|
+
output += ' text: {\n';
|
|
160
|
+
output += ` primary: '${palette.text.primary}';\n`;
|
|
161
|
+
output += ` secondary: '${palette.text.secondary}';\n`;
|
|
162
|
+
output += ` disabled: '${palette.text.disabled}';\n`;
|
|
163
|
+
output += ' };\n';
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
output += ' };\n';
|
|
167
|
+
return output;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Generate typography types
|
|
172
|
+
*/
|
|
173
|
+
private generateTypographyTypes(typography: Theme['typography']): string {
|
|
174
|
+
let output = ' typography: {\n';
|
|
175
|
+
output += ` fontFamily: '${typography.fontFamily}';\n`;
|
|
176
|
+
output += ` fontSize: ${typography.fontSize};\n`;
|
|
177
|
+
|
|
178
|
+
// Font weights
|
|
179
|
+
if (typography.fontWeightLight) output += ` fontWeightLight: ${typography.fontWeightLight};\n`;
|
|
180
|
+
if (typography.fontWeightRegular) output += ` fontWeightRegular: ${typography.fontWeightRegular};\n`;
|
|
181
|
+
if (typography.fontWeightMedium) output += ` fontWeightMedium: ${typography.fontWeightMedium};\n`;
|
|
182
|
+
if (typography.fontWeightSemiBold) output += ` fontWeightSemiBold: ${typography.fontWeightSemiBold};\n`;
|
|
183
|
+
if (typography.fontWeightBold) output += ` fontWeightBold: ${typography.fontWeightBold};\n`;
|
|
184
|
+
|
|
185
|
+
output += ' };\n';
|
|
186
|
+
return output;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Generate custom property types
|
|
191
|
+
*/
|
|
192
|
+
private generateCustomTypes(custom: Theme['custom']): string {
|
|
193
|
+
let output = ' custom: {\n';
|
|
194
|
+
|
|
195
|
+
for (const [key, value] of Object.entries(custom)) {
|
|
196
|
+
const type = typeof value === 'string' ? `'${value}'` : typeof value;
|
|
197
|
+
output += ` ${key}: ${type};\n`;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
output += ' };\n';
|
|
201
|
+
return output;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Generate module augmentation
|
|
206
|
+
*/
|
|
207
|
+
private generateAugmentation(): string {
|
|
208
|
+
return `
|
|
209
|
+
declare module '@shohojdhara/atomix/theme' {
|
|
210
|
+
interface ThemeCustomProperties {
|
|
211
|
+
${this.options.moduleName}: ${this.options.moduleName};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
`;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Generate TypeScript types from theme
|
|
220
|
+
*
|
|
221
|
+
* @param theme - Theme object
|
|
222
|
+
* @param options - Generation options
|
|
223
|
+
* @returns TypeScript definition string
|
|
224
|
+
*/
|
|
225
|
+
export function generateTypes(theme: Theme, options: TypeGeneratorOptions = {}): string {
|
|
226
|
+
const generator = new TypeGenerator(options);
|
|
227
|
+
return generator.generate(theme);
|
|
228
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Generators Module
|
|
3
|
+
*
|
|
4
|
+
* Code generation utilities for themes
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { CSSGenerator, generateCSS } from './CSSGenerator';
|
|
8
|
+
export { TypeGenerator, generateTypes } from './TypeGenerator';
|
|
9
|
+
export { ConfigGenerator, generateConfigTemplate } from './ConfigGenerator';
|
|
10
|
+
|
|
11
|
+
export type {
|
|
12
|
+
CSSGeneratorOptions,
|
|
13
|
+
} from './CSSGenerator';
|
|
14
|
+
|
|
15
|
+
export type {
|
|
16
|
+
TypeGeneratorOptions,
|
|
17
|
+
} from './TypeGenerator';
|
|
18
|
+
|
|
19
|
+
export type {
|
|
20
|
+
ConfigGeneratorOptions,
|
|
21
|
+
} from './ConfigGenerator';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internationalization (i18n) Module
|
|
3
|
+
*
|
|
4
|
+
* Provides internationalization utilities for the theme system
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export * from './rtl';
|
|
8
|
+
export { RTLManager, createRTLManager, isRTLLocale, getDirectionFromLocale, rtlCSS } from './rtl';
|
|
9
|
+
export type { RTLConfig } from './rtl';
|