@shohojdhara/atomix 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -199
- package/atomix.config.ts +241 -0
- package/dist/atomix.css +269 -189
- package/dist/atomix.css.map +1 -0
- package/dist/atomix.min.css +15179 -11
- package/dist/atomix.min.css.map +1 -0
- package/dist/charts.d.ts +1929 -0
- package/dist/charts.js +6477 -0
- package/dist/charts.js.map +1 -0
- package/dist/core.d.ts +1289 -0
- package/dist/core.js +3373 -0
- package/dist/core.js.map +1 -0
- package/dist/forms.d.ts +1085 -0
- package/dist/forms.js +2466 -0
- package/dist/forms.js.map +1 -0
- package/dist/heavy.d.ts +636 -0
- package/dist/heavy.js +4566 -0
- package/dist/heavy.js.map +1 -0
- package/dist/index.d.ts +5171 -4792
- package/dist/index.esm.js +6098 -4563
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6291 -4747
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.d.ts +300 -0
- package/dist/layout.js +336 -0
- package/dist/layout.js.map +1 -0
- package/dist/theme.d.ts +2122 -0
- package/dist/theme.js +6084 -0
- package/dist/theme.js.map +1 -0
- package/package.json +59 -27
- package/scripts/atomix-cli.js +544 -16
- package/scripts/cli/__tests__/cli-commands.test.js +204 -0
- package/scripts/cli/__tests__/utils.test.js +201 -0
- package/scripts/cli/__tests__/vitest.config.js +26 -0
- package/scripts/cli/interactive-init.js +1 -1
- package/scripts/cli/token-manager.js +32 -7
- package/scripts/cli/utils.js +347 -0
- package/src/components/Accordion/Accordion.stories.tsx +50 -17
- package/src/components/Accordion/Accordion.tsx +5 -54
- package/src/components/Accordion/index.ts +1 -1
- package/src/components/AtomixGlass/AtomixGlass.tsx +65 -31
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +11 -4
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -32
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +2 -2
- package/src/components/AtomixGlass/stories/shared-components.tsx +0 -31
- package/src/components/Avatar/Avatar.stories.tsx +7 -0
- package/src/components/Avatar/Avatar.tsx +3 -3
- package/src/components/Badge/Badge.stories.tsx +91 -13
- package/src/components/Badge/Badge.tsx +3 -3
- package/src/components/Block/Block.stories.tsx +7 -23
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +7 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
- package/src/components/Button/Button.stories.tsx +141 -22
- package/src/components/Button/ButtonGroup.stories.tsx +315 -0
- package/src/components/Button/ButtonGroup.tsx +67 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Callout/Callout.stories.tsx +8 -6
- package/src/components/Card/Card.stories.tsx +82 -28
- package/src/components/Card/ElevationCard.tsx +1 -1
- package/src/components/Chart/AnimatedChart.tsx +19 -18
- package/src/components/Chart/AreaChart.tsx +5 -2
- package/src/components/Chart/BarChart.tsx +1 -1
- package/src/components/Chart/BubbleChart.tsx +6 -6
- package/src/components/Chart/CandlestickChart.tsx +0 -1
- package/src/components/Chart/Chart.stories.tsx +5 -7
- package/src/components/Chart/Chart.tsx +0 -16
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/ChartToolbar.tsx +1 -0
- package/src/components/Chart/DonutChart.tsx +0 -1
- package/src/components/Chart/FunnelChart.tsx +1 -2
- package/src/components/Chart/GaugeChart.tsx +0 -1
- package/src/components/Chart/HeatmapChart.tsx +0 -1
- package/src/components/Chart/LineChart.tsx +0 -1
- package/src/components/Chart/MultiAxisChart.tsx +0 -1
- package/src/components/Chart/PieChart.tsx +0 -1
- package/src/components/Chart/RadarChart.tsx +19 -13
- package/src/components/Chart/ScatterChart.tsx +3 -4
- package/src/components/Chart/TreemapChart.tsx +2 -1
- package/src/components/Chart/WaterfallChart.tsx +0 -2
- package/src/components/Chart/types.ts +12 -2
- package/src/components/Chart/utils.ts +4 -3
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
- package/src/components/DataTable/DataTable.stories.tsx +23 -16
- package/src/components/DataTable/DataTable.tsx +3 -3
- package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
- package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
- package/src/components/Dropdown/Dropdown.tsx +12 -9
- package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
- package/src/components/Footer/Footer.stories.tsx +8 -6
- package/src/components/Footer/FooterLink.tsx +9 -2
- package/src/components/Footer/FooterSection.tsx +3 -3
- package/src/components/Form/Checkbox.stories.tsx +7 -0
- package/src/components/Form/Checkbox.tsx +3 -3
- package/src/components/Form/Form.stories.tsx +7 -0
- package/src/components/Form/FormGroup.stories.tsx +9 -1
- package/src/components/Form/Input.stories.tsx +69 -16
- package/src/components/Form/Input.tsx +4 -2
- package/src/components/Form/Radio.stories.tsx +9 -1
- package/src/components/Form/Radio.tsx +3 -3
- package/src/components/Form/Select.stories.tsx +9 -1
- package/src/components/Form/Select.tsx +3 -3
- package/src/components/Form/Textarea.stories.tsx +10 -2
- package/src/components/Form/Textarea.tsx +4 -2
- package/src/components/Hero/Hero.stories.tsx +7 -0
- package/src/components/List/List.stories.tsx +10 -3
- package/src/components/List/List.tsx +3 -3
- package/src/components/List/ListGroup.tsx +3 -1
- package/src/components/Messages/Messages.stories.tsx +8 -7
- package/src/components/Modal/Modal.stories.tsx +17 -6
- package/src/components/Modal/Modal.tsx +3 -3
- package/src/components/Navigation/Menu/MegaMenu.tsx +9 -3
- package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
- package/src/components/Navigation/Menu/Menu.tsx +9 -3
- package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +188 -111
- package/src/components/Pagination/Pagination.tsx +88 -7
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +2 -2
- package/src/components/Popover/Popover.stories.tsx +191 -115
- package/src/components/Popover/Popover.tsx +4 -4
- package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
- package/src/components/Progress/Progress.stories.tsx +79 -49
- package/src/components/Progress/Progress.tsx +6 -2
- package/src/components/Rating/Rating.stories.tsx +109 -84
- package/src/components/Rating/Rating.tsx +5 -2
- package/src/components/River/River.stories.tsx +194 -114
- package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
- package/src/components/Slider/Slider.stories.tsx +7 -0
- package/src/components/Slider/Slider.tsx +10 -9
- package/src/components/Spinner/Spinner.stories.tsx +15 -11
- package/src/components/Spinner/Spinner.tsx +3 -3
- package/src/components/Steps/Steps.stories.tsx +132 -98
- package/src/components/Tabs/Tabs.stories.tsx +163 -112
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
- package/src/components/Todo/Todo.stories.tsx +38 -12
- package/src/components/Toggle/Toggle.stories.tsx +61 -28
- package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
- package/src/components/Tooltip/Tooltip.tsx +3 -3
- package/src/components/Upload/Upload.stories.tsx +122 -84
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
- package/src/components/index.ts +6 -2
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +2 -2
- package/src/lib/composables/useAtomixGlass.ts +2 -3
- package/src/lib/composables/useChartPerformance.ts +102 -78
- package/src/lib/composables/useChartScale.ts +10 -0
- package/src/lib/composables/useHero.ts +9 -2
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -3
- package/src/lib/composables/useNavbar.ts +0 -10
- package/src/lib/composables/useSideMenu.ts +1 -0
- package/src/lib/composables/useVideoPlayer.ts +3 -2
- package/src/lib/config/loader.ts +57 -14
- package/src/lib/constants/components.ts +10 -0
- package/src/lib/hooks/index.ts +0 -1
- package/src/lib/hooks/useComponentCustomization.ts +11 -15
- package/src/lib/hooks/usePerformanceMonitor.ts +149 -0
- package/src/lib/patterns/index.ts +2 -2
- package/src/lib/patterns/slots.tsx +2 -2
- package/src/lib/theme/README.md +174 -0
- package/src/lib/theme/adapters/index.ts +31 -0
- package/src/lib/theme/adapters/themeAdapter.ts +287 -0
- package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
- package/src/lib/theme/config/configLoader.ts +254 -0
- package/src/lib/theme/config/loader.ts +37 -48
- package/src/lib/theme/config/types.ts +2 -2
- package/src/lib/theme/config/validator.ts +15 -91
- package/src/lib/theme/{constants.ts → constants/constants.ts} +0 -18
- package/src/lib/theme/constants/index.ts +8 -0
- package/src/lib/theme/core/ThemeRegistry.ts +19 -6
- package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
- package/src/lib/theme/core/composeTheme.ts +155 -0
- package/src/lib/theme/core/createTheme.ts +94 -0
- package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +10 -6
- package/src/lib/theme/core/index.ts +5 -19
- package/src/lib/theme/devtools/Comparator.tsx +346 -22
- package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
- package/src/lib/theme/devtools/Inspector.tsx +335 -51
- package/src/lib/theme/devtools/LiveEditor.tsx +489 -112
- package/src/lib/theme/devtools/Preview.tsx +471 -221
- package/src/lib/theme/{core → devtools}/ThemeValidator.ts +6 -3
- package/src/lib/theme/devtools/index.ts +14 -4
- package/src/lib/theme/devtools/useHistory.ts +130 -0
- package/src/lib/theme/errors/index.ts +12 -0
- package/src/lib/theme/generators/cssFile.ts +79 -0
- package/src/lib/theme/generators/generateCSS.ts +89 -0
- package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +4 -14
- package/src/lib/theme/generators/index.ts +19 -0
- package/src/lib/theme/i18n/rtl.ts +7 -7
- package/src/lib/theme/index.ts +120 -15
- package/src/lib/theme/runtime/ThemeApplicator.ts +53 -95
- package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +4 -4
- package/src/lib/theme/runtime/ThemeProvider.tsx +456 -179
- package/src/lib/theme/runtime/index.ts +1 -2
- package/src/lib/theme/runtime/useTheme.ts +1 -2
- package/src/lib/theme/test/testTheme.ts +385 -0
- package/src/lib/theme/tokens/index.ts +12 -0
- package/src/lib/theme/tokens/tokens.ts +721 -0
- package/src/lib/theme/types.ts +6 -42
- package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
- package/src/lib/theme/utils/index.ts +11 -0
- package/src/lib/theme/utils/injectCSS.ts +90 -0
- package/src/lib/theme/utils/themeHelpers.ts +78 -0
- package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +1 -1
- package/src/lib/theme-tools.ts +8 -9
- package/src/lib/types/components.ts +93 -34
- package/src/lib/types/partProps.ts +0 -16
- package/src/lib/utils/componentUtils.ts +1 -1
- package/src/lib/utils/fontPreloader.ts +148 -0
- package/src/lib/utils/index.ts +11 -0
- package/src/lib/utils/memoryMonitor.ts +189 -0
- package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
- package/src/styles/01-settings/_settings.fonts.scss +2 -5
- package/src/styles/02-tools/_tools.button.scss +66 -79
- package/src/styles/06-components/_components.atomix-glass.scss +13 -3
- package/src/styles/06-components/_components.navbar.scss +0 -6
- package/src/styles/06-components/_components.pagination.scss +88 -0
- package/scripts/build-themes.js +0 -208
- package/scripts/sync-theme-config.js +0 -309
- package/src/components/AtomixGlass/atomixGLass.old.tsx +0 -1263
- package/src/lib/theme/composeTheme.ts +0 -370
- package/src/lib/theme/core/ThemeCache.ts +0 -283
- package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
- package/src/lib/theme/core/ThemeEngine.ts +0 -657
- package/src/lib/theme/createThemeFromConfig.ts +0 -132
- package/src/lib/theme/devtools/CLI.ts +0 -364
- package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
- package/src/lib/theme/runtime/ThemeManager.ts +0 -442
- package/src/styles/03-generic/_generated-root.css +0 -5
- package/src/themes/README.md +0 -442
- package/src/themes/themes.config.js +0 -35
- /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
- /package/src/lib/theme/{errors.ts → errors/errors.ts} +0 -0
|
@@ -3,17 +3,23 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Applies theme configurations to the DOM, including CSS variables,
|
|
5
5
|
* component overrides, typography, spacing, and color palettes.
|
|
6
|
+
*
|
|
7
|
+
* Uses the unified theme system for CSS generation and injection.
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
|
-
import { applyCSSVariables, removeCSSVariables } from '../cssVariableMapper';
|
|
9
10
|
import type { Theme, ThemeComponentOverrides, ComponentThemeOverride } from '../types';
|
|
11
|
+
import type { DesignTokens } from '../tokens/tokens';
|
|
12
|
+
import { createTheme } from '../core/createTheme';
|
|
13
|
+
import { injectCSS, removeCSS } from '../utils/injectCSS';
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
* Theme applicator class for runtime theme application
|
|
17
|
+
*
|
|
18
|
+
* Uses the unified theme system for efficient CSS variable generation and injection.
|
|
13
19
|
*/
|
|
14
20
|
export class ThemeApplicator {
|
|
15
|
-
private appliedVars: Set<string> = new Set();
|
|
16
21
|
private root: HTMLElement;
|
|
22
|
+
private styleId: string = 'atomix-theme-applicator';
|
|
17
23
|
|
|
18
24
|
constructor(root: HTMLElement = document.documentElement) {
|
|
19
25
|
this.root = root;
|
|
@@ -21,112 +27,71 @@ export class ThemeApplicator {
|
|
|
21
27
|
|
|
22
28
|
/**
|
|
23
29
|
* Apply a complete theme configuration
|
|
30
|
+
*
|
|
31
|
+
* Uses the unified theme system to convert Theme to DesignTokens and inject CSS.
|
|
32
|
+
* Automatically respects atomix.config.ts when using DesignTokens.
|
|
24
33
|
*/
|
|
25
|
-
applyTheme(theme: Theme): void {
|
|
34
|
+
applyTheme(theme: Theme | DesignTokens): void {
|
|
26
35
|
// Clear previously applied variables
|
|
27
36
|
this.clearAppliedVars();
|
|
28
37
|
|
|
29
|
-
//
|
|
30
|
-
if (theme
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.applySpacing(theme.spacing);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Apply color palette
|
|
45
|
-
if (theme.palette) {
|
|
46
|
-
this.applyPalette(theme.palette);
|
|
38
|
+
// Check if it's DesignTokens
|
|
39
|
+
if (this.isDesignTokens(theme)) {
|
|
40
|
+
// Direct DesignTokens - use unified theme system (with config support)
|
|
41
|
+
this.applyDesignTokens(theme);
|
|
42
|
+
} else {
|
|
43
|
+
// Theme object - use createTheme which handles Theme objects
|
|
44
|
+
// createTheme automatically converts Theme to DesignTokens internally
|
|
45
|
+
const css = createTheme(theme, {
|
|
46
|
+
selector: ':root',
|
|
47
|
+
prefix: 'atomix',
|
|
48
|
+
});
|
|
49
|
+
injectCSS(css, this.styleId);
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
// Apply component overrides
|
|
50
|
-
if (theme.components) {
|
|
51
|
-
this.applyComponentOverrides(theme.components);
|
|
52
|
+
// Apply component overrides (only for Theme objects)
|
|
53
|
+
if (!this.isDesignTokens(theme) && (theme as any).components) {
|
|
54
|
+
this.applyComponentOverrides((theme as any).components);
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
/**
|
|
56
|
-
* Apply
|
|
59
|
+
* Apply DesignTokens using unified theme system
|
|
60
|
+
*
|
|
61
|
+
* Uses createTheme() which automatically loads from atomix.config.ts
|
|
62
|
+
* if no tokens are provided, ensuring config is always respected.
|
|
57
63
|
*/
|
|
58
|
-
private
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
private applyDesignTokens(tokens: Partial<DesignTokens>): void {
|
|
65
|
+
// Use createTheme() which handles config loading automatically
|
|
66
|
+
// If tokens is empty, it will load from config
|
|
67
|
+
const css = createTheme(tokens, {
|
|
68
|
+
selector: ':root',
|
|
69
|
+
prefix: 'atomix', // Can be overridden by config
|
|
62
70
|
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Apply typography system
|
|
67
|
-
*/
|
|
68
|
-
private applyTypography(typography: Theme['typography']): void {
|
|
69
|
-
if (!typography) return;
|
|
70
|
-
|
|
71
|
-
const vars: Record<string, string | number> = {};
|
|
72
|
-
|
|
73
|
-
if (typography.fontFamily) {
|
|
74
|
-
vars['--atomix-font-family'] = typography.fontFamily;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (typography.fontSize) {
|
|
78
|
-
Object.entries(typography.fontSize).forEach(([key, value]) => {
|
|
79
|
-
vars[`--atomix-font-size-${key}`] = value;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (typography.fontWeight) {
|
|
84
|
-
Object.entries(typography.fontWeight).forEach(([key, value]) => {
|
|
85
|
-
vars[`--atomix-font-weight-${key}`] = value;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (typography.lineHeight) {
|
|
90
|
-
Object.entries(typography.lineHeight).forEach(([key, value]) => {
|
|
91
|
-
vars[`--atomix-line-height-${key}`] = value;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
71
|
|
|
95
|
-
|
|
72
|
+
// Inject CSS into DOM
|
|
73
|
+
injectCSS(css, this.styleId);
|
|
96
74
|
}
|
|
97
75
|
|
|
98
76
|
/**
|
|
99
|
-
*
|
|
77
|
+
* Check if object is DesignTokens
|
|
100
78
|
*/
|
|
101
|
-
private
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.applyGlobalCSSVars(vars);
|
|
79
|
+
private isDesignTokens(obj: Theme | DesignTokens): obj is DesignTokens {
|
|
80
|
+
// DesignTokens is a flat object with string keys, no nested structures
|
|
81
|
+
return obj !== null &&
|
|
82
|
+
typeof obj === 'object' &&
|
|
83
|
+
!('palette' in obj) &&
|
|
84
|
+
!('typography' in obj) &&
|
|
85
|
+
!('__isJSTheme' in obj);
|
|
109
86
|
}
|
|
110
87
|
|
|
111
88
|
/**
|
|
112
|
-
* Apply
|
|
89
|
+
* Apply global CSS variables (for component overrides)
|
|
113
90
|
*/
|
|
114
|
-
private
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const vars: Record<string, string | number> = {};
|
|
118
|
-
|
|
119
|
-
Object.entries(palette).forEach(([colorName, colorScale]) => {
|
|
120
|
-
if (colorScale) {
|
|
121
|
-
Object.entries(colorScale).forEach(([shade, value]) => {
|
|
122
|
-
if (value) {
|
|
123
|
-
vars[`--atomix-color-${colorName}-${shade}`] = value;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
91
|
+
private applyGlobalCSSVars(vars: Record<string, string | number>): void {
|
|
92
|
+
Object.entries(vars).forEach(([key, value]) => {
|
|
93
|
+
this.root.style.setProperty(key, String(value));
|
|
127
94
|
});
|
|
128
|
-
|
|
129
|
-
this.applyGlobalCSSVars(vars);
|
|
130
95
|
}
|
|
131
96
|
|
|
132
97
|
/**
|
|
@@ -196,15 +161,7 @@ export class ThemeApplicator {
|
|
|
196
161
|
* Clear all applied CSS variables
|
|
197
162
|
*/
|
|
198
163
|
private clearAppliedVars(): void {
|
|
199
|
-
|
|
200
|
-
this.appliedVars.clear();
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Get all currently applied variables
|
|
205
|
-
*/
|
|
206
|
-
getAppliedVars(): string[] {
|
|
207
|
-
return Array.from(this.appliedVars);
|
|
164
|
+
removeCSS(this.styleId);
|
|
208
165
|
}
|
|
209
166
|
|
|
210
167
|
/**
|
|
@@ -212,6 +169,7 @@ export class ThemeApplicator {
|
|
|
212
169
|
*/
|
|
213
170
|
removeTheme(): void {
|
|
214
171
|
this.clearAppliedVars();
|
|
172
|
+
removeCSS(this.styleId);
|
|
215
173
|
}
|
|
216
174
|
|
|
217
175
|
/**
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, { Component, type ReactNode, type ErrorInfo } from 'react';
|
|
9
|
-
import { ThemeError, ThemeErrorCode, getLogger } from '../errors';
|
|
9
|
+
import { ThemeError, ThemeErrorCode, getLogger } from '../errors/errors';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Error boundary state
|
|
@@ -148,7 +148,7 @@ export class ThemeErrorBoundary extends Component<
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
componentDidCatch(error: Error, errorInfo: ErrorInfo): void {
|
|
151
|
+
override componentDidCatch(error: Error, errorInfo: ErrorInfo): void {
|
|
152
152
|
// Log error
|
|
153
153
|
const themeError = error instanceof ThemeError
|
|
154
154
|
? error
|
|
@@ -187,7 +187,7 @@ export class ThemeErrorBoundary extends Component<
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
componentDidUpdate(prevProps: ThemeErrorBoundaryProps): void {
|
|
190
|
+
override componentDidUpdate(prevProps: ThemeErrorBoundaryProps): void {
|
|
191
191
|
// Reset error if resetOnPropsChange is true and children changed
|
|
192
192
|
if (
|
|
193
193
|
this.props.resetOnPropsChange &&
|
|
@@ -202,7 +202,7 @@ export class ThemeErrorBoundary extends Component<
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
render(): ReactNode {
|
|
205
|
+
override render(): ReactNode {
|
|
206
206
|
if (this.state.hasError && this.state.error && this.state.errorInfo) {
|
|
207
207
|
// Use custom fallback if provided
|
|
208
208
|
if (this.props.fallback) {
|