@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
package/theme.config.ts
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atomix Theme Configuration
|
|
3
|
+
*
|
|
4
|
+
* Global configuration file for the Atomix Design System theme system.
|
|
5
|
+
* This file defines all available themes, build settings, runtime configuration,
|
|
6
|
+
* and integration settings.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { loadThemeConfig } from '@shohojdhara/atomix/theme/config';
|
|
11
|
+
* const config = loadThemeConfig();
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { Theme } from './src/lib/theme/types';
|
|
16
|
+
import { createTheme } from './src/lib/theme/createTheme';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* CSS Theme Definition
|
|
20
|
+
* Defines a theme that is loaded from a CSS file
|
|
21
|
+
*/
|
|
22
|
+
export interface CSSThemeDefinition {
|
|
23
|
+
/** Theme type identifier */
|
|
24
|
+
type: 'css';
|
|
25
|
+
/** Display name of the theme */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Unique identifier/class name for the theme */
|
|
28
|
+
class?: string;
|
|
29
|
+
/** Theme description */
|
|
30
|
+
description?: string;
|
|
31
|
+
/** Theme author */
|
|
32
|
+
author?: string;
|
|
33
|
+
/** Theme version (semver) */
|
|
34
|
+
version?: string;
|
|
35
|
+
/** Theme tags for categorization */
|
|
36
|
+
tags?: string[];
|
|
37
|
+
/** Whether the theme supports dark mode */
|
|
38
|
+
supportsDarkMode?: boolean;
|
|
39
|
+
/** Theme status: stable, beta, experimental, deprecated */
|
|
40
|
+
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
41
|
+
/** Accessibility information */
|
|
42
|
+
a11y?: {
|
|
43
|
+
/** Target contrast ratio */
|
|
44
|
+
contrastTarget?: number;
|
|
45
|
+
/** Supported color modes */
|
|
46
|
+
modes?: string[];
|
|
47
|
+
};
|
|
48
|
+
/** Primary theme color (for UI display) */
|
|
49
|
+
color?: string;
|
|
50
|
+
/** Theme features list */
|
|
51
|
+
features?: string[];
|
|
52
|
+
/** Theme dependencies (other themes required) */
|
|
53
|
+
dependencies?: string[];
|
|
54
|
+
/** Custom CSS file path (optional, defaults to theme name) */
|
|
55
|
+
cssPath?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* JavaScript Theme Definition
|
|
60
|
+
* Defines a theme created programmatically using createTheme
|
|
61
|
+
*/
|
|
62
|
+
export interface JSThemeDefinition {
|
|
63
|
+
/** Theme type identifier */
|
|
64
|
+
type: 'js';
|
|
65
|
+
/** Display name of the theme */
|
|
66
|
+
name: string;
|
|
67
|
+
/** Unique identifier/class name for the theme */
|
|
68
|
+
class?: string;
|
|
69
|
+
/** Theme description */
|
|
70
|
+
description?: string;
|
|
71
|
+
/** Theme author */
|
|
72
|
+
author?: string;
|
|
73
|
+
/** Theme version (semver) */
|
|
74
|
+
version?: string;
|
|
75
|
+
/** Theme tags for categorization */
|
|
76
|
+
tags?: string[];
|
|
77
|
+
/** Whether the theme supports dark mode */
|
|
78
|
+
supportsDarkMode?: boolean;
|
|
79
|
+
/** Theme status: stable, beta, experimental, deprecated */
|
|
80
|
+
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
81
|
+
/** Accessibility information */
|
|
82
|
+
a11y?: {
|
|
83
|
+
/** Target contrast ratio */
|
|
84
|
+
contrastTarget?: number;
|
|
85
|
+
/** Supported color modes */
|
|
86
|
+
modes?: string[];
|
|
87
|
+
};
|
|
88
|
+
/** Primary theme color (for UI display) */
|
|
89
|
+
color?: string;
|
|
90
|
+
/** Theme features list */
|
|
91
|
+
features?: string[];
|
|
92
|
+
/** Theme dependencies (other themes required) */
|
|
93
|
+
dependencies?: string[];
|
|
94
|
+
/** Function that creates the theme object */
|
|
95
|
+
createTheme: () => Theme;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Theme definition (CSS or JS)
|
|
100
|
+
*/
|
|
101
|
+
export type ThemeDefinition = CSSThemeDefinition | JSThemeDefinition;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Build configuration
|
|
105
|
+
*/
|
|
106
|
+
export interface BuildConfig {
|
|
107
|
+
/** Output directory for compiled themes */
|
|
108
|
+
output: {
|
|
109
|
+
/** Output directory path */
|
|
110
|
+
directory: string;
|
|
111
|
+
/** Output file formats */
|
|
112
|
+
formats: {
|
|
113
|
+
/** Expanded format extension */
|
|
114
|
+
expanded: string;
|
|
115
|
+
/** Compressed format extension */
|
|
116
|
+
compressed: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
/** Sass compilation settings */
|
|
120
|
+
sass: {
|
|
121
|
+
/** Output style */
|
|
122
|
+
style: 'expanded' | 'compressed' | 'compact' | 'nested';
|
|
123
|
+
/** Generate source maps */
|
|
124
|
+
sourceMap: boolean;
|
|
125
|
+
/** Additional load paths */
|
|
126
|
+
loadPaths: string[];
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Runtime configuration
|
|
132
|
+
*/
|
|
133
|
+
export interface RuntimeConfig {
|
|
134
|
+
/** Base path for theme CSS files (relative to public directory) */
|
|
135
|
+
basePath: string;
|
|
136
|
+
/** Optional CDN path for theme files */
|
|
137
|
+
cdnPath?: string | null;
|
|
138
|
+
/** Themes to preload on initialization */
|
|
139
|
+
preload?: string[];
|
|
140
|
+
/** Enable lazy loading of themes */
|
|
141
|
+
lazy?: boolean;
|
|
142
|
+
/** Default theme name */
|
|
143
|
+
defaultTheme: string;
|
|
144
|
+
/** localStorage key for theme persistence */
|
|
145
|
+
storageKey?: string;
|
|
146
|
+
/** Data attribute name for theme */
|
|
147
|
+
dataAttribute?: string;
|
|
148
|
+
/** Enable persistence */
|
|
149
|
+
enablePersistence?: boolean;
|
|
150
|
+
/** Use minified CSS files in production */
|
|
151
|
+
useMinified?: boolean;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Integration configuration
|
|
156
|
+
*/
|
|
157
|
+
export interface IntegrationConfig {
|
|
158
|
+
/** CSS variables for theme integration */
|
|
159
|
+
cssVariables: {
|
|
160
|
+
/** Color mode variable name */
|
|
161
|
+
colorMode?: string;
|
|
162
|
+
/** Additional custom variables */
|
|
163
|
+
[key: string]: string | undefined;
|
|
164
|
+
};
|
|
165
|
+
/** Attribute names used for theme and color mode */
|
|
166
|
+
classNames: {
|
|
167
|
+
/** Theme attribute name */
|
|
168
|
+
theme: string;
|
|
169
|
+
/** Color mode attribute name */
|
|
170
|
+
colorMode: string;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Complete theme configuration
|
|
176
|
+
*/
|
|
177
|
+
export interface ThemeConfig {
|
|
178
|
+
/** Available themes */
|
|
179
|
+
themes: Record<string, ThemeDefinition>;
|
|
180
|
+
/** Build configuration */
|
|
181
|
+
build: BuildConfig;
|
|
182
|
+
/** Runtime configuration */
|
|
183
|
+
runtime: RuntimeConfig;
|
|
184
|
+
/** Integration settings */
|
|
185
|
+
integration: IntegrationConfig;
|
|
186
|
+
/** Theme dependencies mapping */
|
|
187
|
+
dependencies?: Record<string, string[]>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Default build configuration
|
|
192
|
+
*/
|
|
193
|
+
const defaultBuildConfig: BuildConfig = {
|
|
194
|
+
output: {
|
|
195
|
+
directory: 'themes',
|
|
196
|
+
formats: {
|
|
197
|
+
expanded: '.css',
|
|
198
|
+
compressed: '.min.css',
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
sass: {
|
|
202
|
+
style: 'expanded',
|
|
203
|
+
sourceMap: true,
|
|
204
|
+
loadPaths: ['src'],
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Default runtime configuration
|
|
210
|
+
*/
|
|
211
|
+
const defaultRuntimeConfig: RuntimeConfig = {
|
|
212
|
+
basePath: '/themes',
|
|
213
|
+
cdnPath: null,
|
|
214
|
+
preload: ['shaj-default'],
|
|
215
|
+
lazy: true,
|
|
216
|
+
defaultTheme: 'shaj-default',
|
|
217
|
+
storageKey: 'atomix-theme',
|
|
218
|
+
dataAttribute: 'data-theme',
|
|
219
|
+
enablePersistence: true,
|
|
220
|
+
useMinified: process.env.NODE_ENV === 'production',
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Default integration configuration
|
|
225
|
+
*/
|
|
226
|
+
const defaultIntegrationConfig: IntegrationConfig = {
|
|
227
|
+
cssVariables: {
|
|
228
|
+
colorMode: '--storybook-color-mode',
|
|
229
|
+
},
|
|
230
|
+
classNames: {
|
|
231
|
+
theme: 'data-theme',
|
|
232
|
+
colorMode: 'data-atomix-color-mode',
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Theme configuration
|
|
238
|
+
*
|
|
239
|
+
* This is the main configuration object that defines all themes,
|
|
240
|
+
* build settings, runtime behavior, and integration options.
|
|
241
|
+
*/
|
|
242
|
+
const themeConfig: ThemeConfig = {
|
|
243
|
+
themes: {
|
|
244
|
+
'shaj-default': {
|
|
245
|
+
type: 'css',
|
|
246
|
+
name: 'Shaj Default',
|
|
247
|
+
description: 'The default theme for the Atomix Design System',
|
|
248
|
+
author: 'Shohoj Dhara',
|
|
249
|
+
version: '1.0.0',
|
|
250
|
+
tags: ['default', 'light'],
|
|
251
|
+
supportsDarkMode: true,
|
|
252
|
+
status: 'stable',
|
|
253
|
+
a11y: { contrastTarget: 4.5, modes: ['light', 'dark'] },
|
|
254
|
+
color: '#3b82f6',
|
|
255
|
+
},
|
|
256
|
+
boomdevs: {
|
|
257
|
+
type: 'css',
|
|
258
|
+
name: 'BoomDevs',
|
|
259
|
+
description: 'BoomDevs theme for the Atomix Design System',
|
|
260
|
+
author: 'BoomDevs Team',
|
|
261
|
+
version: '1.0.0',
|
|
262
|
+
tags: ['dark', 'modern'],
|
|
263
|
+
supportsDarkMode: true,
|
|
264
|
+
status: 'beta',
|
|
265
|
+
a11y: { contrastTarget: 4.5, modes: ['light', 'dark'] },
|
|
266
|
+
color: '#8b5cf6',
|
|
267
|
+
},
|
|
268
|
+
esrar: {
|
|
269
|
+
type: 'css',
|
|
270
|
+
name: 'Esrar',
|
|
271
|
+
description: 'Esrar theme for the Atomix Design System',
|
|
272
|
+
author: 'Esrar Team',
|
|
273
|
+
version: '1.0.0',
|
|
274
|
+
tags: ['light', 'minimal'],
|
|
275
|
+
supportsDarkMode: true,
|
|
276
|
+
status: 'beta',
|
|
277
|
+
a11y: { contrastTarget: 4.5, modes: ['light', 'dark'] },
|
|
278
|
+
color: '#10b981',
|
|
279
|
+
},
|
|
280
|
+
mashroom: {
|
|
281
|
+
type: 'css',
|
|
282
|
+
name: 'Mashroom',
|
|
283
|
+
description: 'Mashroom theme for the Atomix Design System',
|
|
284
|
+
author: 'Mashroom Team',
|
|
285
|
+
version: '1.0.0',
|
|
286
|
+
tags: ['dark', 'contrast'],
|
|
287
|
+
supportsDarkMode: true,
|
|
288
|
+
status: 'beta',
|
|
289
|
+
a11y: { contrastTarget: 4.5, modes: ['light', 'dark'] },
|
|
290
|
+
color: '#f59e0b',
|
|
291
|
+
},
|
|
292
|
+
applemix: {
|
|
293
|
+
type: 'css',
|
|
294
|
+
name: 'Applemix',
|
|
295
|
+
description: 'Apple Mac OS 2026 Liquid Glass inspired theme with morphism effects',
|
|
296
|
+
author: 'Atomix Design System',
|
|
297
|
+
version: '1.0.0',
|
|
298
|
+
tags: ['glass', 'apple', 'modern', 'liquid', 'morphism'],
|
|
299
|
+
supportsDarkMode: true,
|
|
300
|
+
features: [
|
|
301
|
+
'Liquid glass morphism effects',
|
|
302
|
+
'Apple-inspired color palette',
|
|
303
|
+
'Chromatic aberration effects',
|
|
304
|
+
'Smooth animations and transitions',
|
|
305
|
+
'AtomixGlass component integration',
|
|
306
|
+
'Comprehensive component overrides',
|
|
307
|
+
'Light and dark mode support',
|
|
308
|
+
],
|
|
309
|
+
status: 'experimental',
|
|
310
|
+
a11y: { contrastTarget: 4.5, modes: ['light', 'dark'] },
|
|
311
|
+
color: '#f5f5f5',
|
|
312
|
+
},
|
|
313
|
+
flashtrade: {
|
|
314
|
+
type: 'css',
|
|
315
|
+
name: 'Flash Trade',
|
|
316
|
+
description: 'Professional dark crypto perpetuals trading platform theme inspired by flash.trade',
|
|
317
|
+
author: 'Atomix Design System',
|
|
318
|
+
version: '1.1.0',
|
|
319
|
+
tags: ['dark', 'crypto', 'trading', 'glass', 'modern', 'decentralized', 'defi'],
|
|
320
|
+
supportsDarkMode: true,
|
|
321
|
+
features: [
|
|
322
|
+
'Ultra-dark trading interface aesthetic matching flash.trade',
|
|
323
|
+
'Bright cyan (#06b6d4) primary color for brand consistency',
|
|
324
|
+
'High contrast for financial data readability',
|
|
325
|
+
'Trading-focused color palette (green for long/profit, red for short/loss)',
|
|
326
|
+
'Glass morphism effects for modern UI depth',
|
|
327
|
+
'Optimized Inter typography for trading information',
|
|
328
|
+
'Fast animations for real-time data updates',
|
|
329
|
+
'Professional navbar with asset selector bar',
|
|
330
|
+
'Trading cards with hover effects and glass morphism',
|
|
331
|
+
'Comprehensive button styles for trading actions',
|
|
332
|
+
'Price change badges with glow effects',
|
|
333
|
+
'Responsive mobile-first design',
|
|
334
|
+
'AtomixGlass component integration',
|
|
335
|
+
],
|
|
336
|
+
status: 'stable',
|
|
337
|
+
a11y: { contrastTarget: 4.5, modes: ['dark'] },
|
|
338
|
+
color: '#06b6d4',
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
build: defaultBuildConfig,
|
|
342
|
+
runtime: defaultRuntimeConfig,
|
|
343
|
+
integration: defaultIntegrationConfig,
|
|
344
|
+
dependencies: {},
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Helper function to define theme configuration with type safety
|
|
349
|
+
*
|
|
350
|
+
* @param config - Theme configuration object
|
|
351
|
+
* @returns The configuration object with proper typing
|
|
352
|
+
*/
|
|
353
|
+
export function defineThemeConfig(config: ThemeConfig): ThemeConfig {
|
|
354
|
+
return config;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Default export of theme configuration
|
|
359
|
+
*/
|
|
360
|
+
export default themeConfig;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ThemeManager Integration Tests
|
|
3
|
-
*
|
|
4
|
-
* Verifies integration between ThemeManager and createTheme system
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
8
|
-
import { ThemeManager } from './ThemeManager';
|
|
9
|
-
import { createTheme } from './createTheme';
|
|
10
|
-
import { generateCSSVariables, injectCSS, removeInjectedCSS } from './generateCSSVariables';
|
|
11
|
-
import * as utils from './utils';
|
|
12
|
-
import { isJSTheme } from './themeUtils';
|
|
13
|
-
|
|
14
|
-
// Mock generateCSSVariables module
|
|
15
|
-
vi.mock('./generateCSSVariables', () => ({
|
|
16
|
-
generateCSSVariables: vi.fn(() => '--mock-css: 1;'),
|
|
17
|
-
injectCSS: vi.fn(),
|
|
18
|
-
removeInjectedCSS: vi.fn(),
|
|
19
|
-
}));
|
|
20
|
-
|
|
21
|
-
// Mock utils
|
|
22
|
-
vi.mock('./utils', () => ({
|
|
23
|
-
isBrowser: vi.fn(() => true),
|
|
24
|
-
isServer: vi.fn(() => false),
|
|
25
|
-
loadThemeCSS: vi.fn(() => Promise.resolve()),
|
|
26
|
-
removeThemeCSS: vi.fn(),
|
|
27
|
-
removeAllThemeCSS: vi.fn(),
|
|
28
|
-
applyThemeAttributes: vi.fn(),
|
|
29
|
-
getCurrentThemeFromDOM: vi.fn(() => null),
|
|
30
|
-
getSystemTheme: vi.fn(() => 'light'),
|
|
31
|
-
isThemeLoaded: vi.fn(() => false),
|
|
32
|
-
validateThemeMetadata: vi.fn(() => ({ valid: true, errors: [], warnings: [] })),
|
|
33
|
-
isValidThemeName: vi.fn(() => true),
|
|
34
|
-
createLocalStorageAdapter: vi.fn(() => ({
|
|
35
|
-
getItem: vi.fn(),
|
|
36
|
-
setItem: vi.fn(),
|
|
37
|
-
removeItem: vi.fn(),
|
|
38
|
-
isAvailable: vi.fn(() => true),
|
|
39
|
-
})),
|
|
40
|
-
}));
|
|
41
|
-
|
|
42
|
-
describe('ThemeManager Integration with JS Themes', () => {
|
|
43
|
-
let themeManager: ThemeManager;
|
|
44
|
-
|
|
45
|
-
beforeEach(() => {
|
|
46
|
-
vi.clearAllMocks();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
afterEach(() => {
|
|
50
|
-
if (themeManager) {
|
|
51
|
-
themeManager.destroy();
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should allow setting a JS theme object directly', async () => {
|
|
56
|
-
themeManager = new ThemeManager({
|
|
57
|
-
defaultTheme: 'dummy',
|
|
58
|
-
themes: { dummy: { name: 'dummy' } },
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
const jsTheme = createTheme({
|
|
62
|
-
name: 'custom-js-theme',
|
|
63
|
-
palette: { primary: { main: '#ff0000' } }
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
await themeManager.setTheme(jsTheme);
|
|
67
|
-
|
|
68
|
-
expect(themeManager.getTheme()).toBe('custom-js-theme');
|
|
69
|
-
expect(themeManager.getActiveTheme()).toBe(jsTheme);
|
|
70
|
-
expect(generateCSSVariables).toHaveBeenCalledWith(jsTheme);
|
|
71
|
-
expect(injectCSS).toHaveBeenCalled();
|
|
72
|
-
expect(utils.applyThemeAttributes).toHaveBeenCalledWith('custom-js-theme', 'data-theme');
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('should initialize with a JS theme as defaultTheme', () => {
|
|
76
|
-
const jsTheme = createTheme({
|
|
77
|
-
name: 'default-js-theme',
|
|
78
|
-
palette: { primary: { main: '#00ff00' } }
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// Constructor shouldn't throw if defaultTheme is object, even if themes is empty
|
|
82
|
-
themeManager = new ThemeManager({
|
|
83
|
-
themes: {},
|
|
84
|
-
defaultTheme: jsTheme,
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
expect(themeManager.getTheme()).toBe('default-js-theme');
|
|
88
|
-
expect(themeManager.getActiveTheme()).toBe(jsTheme);
|
|
89
|
-
// It initializes synchronously
|
|
90
|
-
expect(generateCSSVariables).toHaveBeenCalledWith(jsTheme);
|
|
91
|
-
expect(injectCSS).toHaveBeenCalled();
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('should switch between JS and CSS themes', async () => {
|
|
95
|
-
const jsTheme = createTheme({ name: 'js-theme' });
|
|
96
|
-
|
|
97
|
-
themeManager = new ThemeManager({
|
|
98
|
-
themes: {
|
|
99
|
-
'css-theme': { name: 'CSS Theme' },
|
|
100
|
-
},
|
|
101
|
-
defaultTheme: 'css-theme',
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// Initial state: CSS theme
|
|
105
|
-
expect(themeManager.getTheme()).toBe('css-theme');
|
|
106
|
-
expect(themeManager.getActiveTheme()).toBeNull();
|
|
107
|
-
|
|
108
|
-
// Switch to JS theme
|
|
109
|
-
await themeManager.setTheme(jsTheme, { removePrevious: true });
|
|
110
|
-
|
|
111
|
-
expect(themeManager.getTheme()).toBe('js-theme');
|
|
112
|
-
expect(themeManager.getActiveTheme()).toBe(jsTheme);
|
|
113
|
-
expect(injectCSS).toHaveBeenCalled();
|
|
114
|
-
expect(utils.removeThemeCSS).toHaveBeenCalledWith('css-theme');
|
|
115
|
-
|
|
116
|
-
// Switch back to CSS theme
|
|
117
|
-
await themeManager.setTheme('css-theme', { removePrevious: true });
|
|
118
|
-
|
|
119
|
-
expect(themeManager.getTheme()).toBe('css-theme');
|
|
120
|
-
expect(themeManager.getActiveTheme()).toBeNull();
|
|
121
|
-
expect(removeInjectedCSS).toHaveBeenCalled();
|
|
122
|
-
expect(utils.loadThemeCSS).toHaveBeenCalledWith('css-theme', '/themes', false, null);
|
|
123
|
-
});
|
|
124
|
-
});
|