@shohojdhara/atomix 0.3.15 → 0.4.0
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/build-tools/index.d.ts +31 -30
- package/build-tools/package.json +4 -21
- package/dist/atomix.css +20924 -2611
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +76 -2
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/index.d.ts +31 -30
- package/dist/build-tools/package.json +4 -21
- package/dist/charts.js.map +1 -1
- package/dist/core.js.map +1 -1
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +144 -18
- package/dist/index.esm.js +110 -55
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +110 -55
- 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.js.map +1 -1
- package/dist/theme.d.ts +9 -9
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.stories.tsx +32 -23
- package/src/components/Accordion/Accordion.test.tsx +70 -50
- package/src/components/Accordion/Accordion.tsx +99 -94
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
- package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
- package/src/components/AtomixGlass/glass-utils.ts +4 -3
- package/src/components/AtomixGlass/shader-utils.ts +128 -52
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +1 -1
- package/src/components/AtomixGlass/stories/Shaders.stories.tsx +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +45 -62
- package/src/components/Avatar/Avatar.tsx +58 -56
- package/src/components/Badge/Badge.stories.tsx +20 -9
- package/src/components/Badge/Badge.test.tsx +41 -41
- package/src/components/Badge/Badge.tsx +64 -62
- package/src/components/Block/Block.stories.tsx +14 -4
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +9 -8
- package/src/components/Breadcrumb/Breadcrumb.tsx +62 -60
- package/src/components/Button/Button.stories.tsx +13 -22
- package/src/components/Button/Button.test.tsx +97 -81
- package/src/components/Button/Button.tsx +46 -14
- package/src/components/Button/ButtonGroup.stories.tsx +37 -32
- package/src/components/Button/ButtonGroup.tsx +4 -15
- package/src/components/Callout/Callout.stories.tsx +109 -16
- package/src/components/Card/Card.stories.tsx +67 -36
- package/src/components/Card/Card.tsx +30 -14
- package/src/components/Chart/AreaChart.tsx +1 -1
- package/src/components/Chart/CandlestickChart.tsx +23 -16
- package/src/components/Chart/Chart.stories.tsx +4 -9
- package/src/components/Chart/Chart.tsx +40 -44
- package/src/components/Chart/ChartRenderer.tsx +39 -12
- package/src/components/Chart/ChartToolbar.tsx +21 -5
- package/src/components/Chart/DonutChart.tsx +1 -1
- package/src/components/Chart/FunnelChart.tsx +4 -1
- package/src/components/Chart/GaugeChart.tsx +3 -1
- package/src/components/Chart/HeatmapChart.tsx +50 -37
- package/src/components/Chart/LineChart.tsx +3 -2
- package/src/components/Chart/MultiAxisChart.tsx +24 -16
- package/src/components/Chart/RadarChart.tsx +19 -17
- package/src/components/Chart/ScatterChart.tsx +29 -21
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +6 -2
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
- package/src/components/Countdown/Countdown.stories.tsx +7 -7
- package/src/components/DataTable/DataTable.stories.tsx +43 -38
- package/src/components/DataTable/DataTable.test.tsx +26 -148
- package/src/components/DataTable/DataTable.tsx +485 -456
- package/src/components/DatePicker/DatePicker.stories.tsx +32 -47
- package/src/components/DatePicker/DatePicker.tsx +31 -26
- package/src/components/Dropdown/Dropdown.stories.tsx +2 -5
- package/src/components/Dropdown/Dropdown.tsx +313 -299
- package/src/components/EdgePanel/EdgePanel.stories.tsx +6 -19
- package/src/components/EdgePanel/EdgePanel.tsx +1 -3
- package/src/components/Footer/Footer.stories.tsx +21 -16
- package/src/components/Footer/Footer.tsx +130 -128
- package/src/components/Footer/FooterLink.tsx +2 -2
- package/src/components/Form/Checkbox.test.tsx +49 -49
- package/src/components/Form/Checkbox.tsx +108 -100
- package/src/components/Form/Form.stories.tsx +2 -10
- package/src/components/Form/Input.stories.tsx +22 -39
- package/src/components/Form/Input.test.tsx +38 -44
- package/src/components/Form/Radio.stories.tsx +6 -12
- package/src/components/Form/Radio.tsx +68 -66
- package/src/components/Form/Select.tsx +184 -182
- package/src/components/Form/Textarea.test.tsx +27 -32
- package/src/components/Hero/Hero.stories.tsx +56 -23
- package/src/components/Hero/Hero.tsx +201 -55
- package/src/components/Icon/index.ts +7 -1
- package/src/components/List/List.tsx +19 -23
- package/src/components/Modal/Modal.stories.tsx +2 -1
- package/src/components/Modal/Modal.tsx +130 -127
- package/src/components/Navigation/Menu/MegaMenu.tsx +70 -70
- package/src/components/Navigation/Nav/NavDropdown.tsx +1 -5
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +128 -28
- package/src/components/Navigation/SideMenu/SideMenu.tsx +5 -7
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +4 -5
- package/src/components/Pagination/Pagination.stories.tsx +7 -4
- package/src/components/Pagination/Pagination.tsx +199 -202
- package/src/components/PhotoViewer/PhotoViewer.tsx +4 -1
- package/src/components/Popover/Popover.stories.tsx +99 -192
- package/src/components/Popover/Popover.tsx +41 -37
- package/src/components/Progress/Progress.stories.tsx +35 -44
- package/src/components/River/River.stories.tsx +2 -1
- package/src/components/SectionIntro/SectionIntro.stories.tsx +71 -71
- package/src/components/Slider/Slider.stories.tsx +12 -4
- package/src/components/Spinner/Spinner.stories.tsx +3 -1
- package/src/components/Spinner/Spinner.test.tsx +23 -23
- package/src/components/Spinner/Spinner.tsx +43 -46
- package/src/components/Steps/Steps.stories.tsx +8 -6
- package/src/components/Tabs/Tabs.stories.tsx +12 -9
- package/src/components/Tabs/Tabs.tsx +74 -72
- package/src/components/Toggle/Toggle.stories.tsx +27 -13
- package/src/components/Toggle/Toggle.test.tsx +65 -70
- package/src/components/Toggle/Toggle.tsx +4 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +24 -20
- package/src/components/Tooltip/Tooltip.tsx +104 -106
- package/src/components/Upload/Upload.stories.tsx +129 -127
- package/src/components/Upload/Upload.tsx +287 -283
- package/src/components/VideoPlayer/VideoPlayer.tsx +6 -1
- package/src/components/index.ts +13 -2
- package/src/layouts/Grid/Grid.stories.tsx +9 -3
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +5 -1
- package/src/lib/__tests__/theme-tools.test.ts +32 -6
- package/src/lib/composables/shared-mouse-tracker.ts +13 -14
- package/src/lib/composables/useAtomixGlass.ts +106 -49
- package/src/lib/composables/useChartExport.ts +1 -1
- package/src/lib/composables/useDataTable.ts +29 -17
- package/src/lib/composables/useHero.ts +58 -14
- package/src/lib/composables/useHeroBackgroundSlider.ts +2 -9
- package/src/lib/composables/useInput.ts +10 -8
- package/src/lib/composables/useSideMenu.ts +6 -5
- package/src/lib/composables/useTooltip.ts +1 -2
- package/src/lib/composables/useVideoPlayer.ts +44 -35
- package/src/lib/config/index.ts +154 -154
- package/src/lib/constants/cssVariables.ts +29 -29
- package/src/lib/hooks/__tests__/useComponentCustomization.test.ts +2 -6
- package/src/lib/hooks/index.ts +1 -1
- package/src/lib/hooks/useComponentCustomization.ts +11 -17
- package/src/lib/hooks/usePerformanceMonitor.ts +6 -7
- package/src/lib/patterns/__tests__/slots.test.ts +1 -1
- package/src/lib/patterns/index.ts +1 -1
- package/src/lib/patterns/slots.tsx +8 -13
- package/src/lib/storybook/InteractiveDemo.tsx +13 -18
- package/src/lib/storybook/PreviewContainer.tsx +1 -1
- package/src/lib/storybook/VariantsGrid.tsx +3 -7
- package/src/lib/storybook/index.ts +1 -1
- package/src/lib/theme/adapters/cssVariableMapper.ts +47 -74
- package/src/lib/theme/adapters/index.ts +3 -9
- package/src/lib/theme/adapters/themeAdapter.ts +41 -26
- package/src/lib/theme/config/index.ts +1 -1
- package/src/lib/theme/config/types.ts +2 -2
- package/src/lib/theme/config/validator.ts +10 -5
- package/src/lib/theme/constants/constants.ts +2 -2
- package/src/lib/theme/constants/index.ts +1 -2
- package/src/lib/theme/core/__tests__/createTheme.test.ts +20 -22
- package/src/lib/theme/core/composeTheme.ts +32 -26
- package/src/lib/theme/core/createTheme.ts +1 -1
- package/src/lib/theme/core/createThemeObject.ts +308 -301
- package/src/lib/theme/core/index.ts +3 -3
- package/src/lib/theme/devtools/CLI.ts +106 -104
- package/src/lib/theme/devtools/Comparator.tsx +50 -32
- package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +50 -48
- package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +257 -63
- package/src/lib/theme/devtools/Inspector.tsx +75 -60
- package/src/lib/theme/devtools/LiveEditor.tsx +97 -76
- package/src/lib/theme/devtools/Preview.tsx +150 -106
- package/src/lib/theme/devtools/ThemeValidator.ts +29 -21
- package/src/lib/theme/devtools/index.ts +3 -9
- package/src/lib/theme/devtools/useHistory.ts +23 -21
- package/src/lib/theme/errors/errors.ts +12 -11
- package/src/lib/theme/errors/index.ts +2 -7
- package/src/lib/theme/generators/generateCSS.ts +9 -13
- package/src/lib/theme/generators/generateCSSNested.ts +1 -6
- package/src/lib/theme/generators/generateCSSVariables.ts +673 -630
- package/src/lib/theme/generators/index.ts +1 -4
- package/src/lib/theme/i18n/index.ts +1 -1
- package/src/lib/theme/i18n/rtl.ts +13 -13
- package/src/lib/theme/index.ts +7 -16
- package/src/lib/theme/runtime/ThemeApplicator.ts +4 -4
- package/src/lib/theme/runtime/ThemeContext.tsx +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +19 -23
- package/src/lib/theme/runtime/ThemeProvider.tsx +230 -239
- package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +1 -1
- package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +24 -29
- package/src/lib/theme/runtime/index.ts +2 -5
- package/src/lib/theme/runtime/useTheme.ts +18 -18
- package/src/lib/theme/runtime/useThemeTokens.ts +22 -22
- package/src/lib/theme/test/testTheme.ts +15 -16
- package/src/lib/theme/tokens/index.ts +2 -7
- package/src/lib/theme/tokens/tokens.ts +25 -24
- package/src/lib/theme/types.ts +428 -411
- package/src/lib/theme/utils/__tests__/themeValidation.test.ts +3 -3
- package/src/lib/theme/utils/componentTheming.ts +18 -18
- package/src/lib/theme/utils/domUtils.ts +277 -289
- package/src/lib/theme/utils/index.ts +1 -2
- package/src/lib/theme/utils/injectCSS.ts +10 -14
- package/src/lib/theme/utils/naming.ts +20 -16
- package/src/lib/theme/utils/themeHelpers.ts +10 -12
- package/src/lib/theme/utils/themeUtils.ts +85 -86
- package/src/lib/theme/utils/themeValidation.ts +82 -33
- package/src/lib/theme-tools.ts +8 -6
- package/src/lib/types/components.ts +172 -71
- package/src/lib/types/partProps.ts +1 -1
- package/src/lib/utils/__tests__/csv.test.ts +1 -1
- package/src/lib/utils/componentUtils.ts +8 -12
- package/src/lib/utils/csv.ts +3 -1
- package/src/lib/utils/dataTableExport.ts +1 -5
- package/src/lib/utils/fontPreloader.ts +10 -19
- package/src/lib/utils/icons.ts +4 -1
- package/src/lib/utils/index.ts +2 -6
- package/src/lib/utils/memoryMonitor.ts +10 -8
- package/src/lib/utils/themeNaming.ts +2 -2
- package/src/styles/01-settings/_index.scss +0 -1
- package/src/styles/01-settings/_settings.colors.scss +8 -8
- package/src/styles/01-settings/_settings.design-tokens.scss +61 -50
- package/src/styles/01-settings/_settings.navbar.scss +1 -1
- package/src/styles/01-settings/_settings.spacing.scss +3 -4
- package/src/styles/01-settings/_settings.tooltip.scss +1 -1
- package/src/styles/01-settings/_settings.typography.scss +1 -1
- package/src/styles/02-tools/_tools.button.scss +51 -21
- package/src/styles/02-tools/_tools.utility-api.scss +30 -18
- package/src/styles/03-generic/_generic.root.scss +4 -3
- package/src/styles/06-components/_components.atomix-glass.scss +13 -9
- package/src/styles/06-components/_components.button.scss +16 -4
- package/src/styles/06-components/_components.callout.scss +27 -21
- package/src/styles/06-components/_components.card.scss +5 -14
- package/src/styles/06-components/_components.chart.scss +22 -19
- package/src/styles/06-components/_components.checkbox.scss +3 -1
- package/src/styles/06-components/_components.color-mode-toggle.scss +3 -1
- package/src/styles/06-components/_components.edge-panel.scss +9 -2
- package/src/styles/06-components/_components.footer.scss +1 -1
- package/src/styles/06-components/_components.side-menu.scss +5 -5
- package/src/styles/06-components/_components.toggle.scss +18 -0
- package/src/styles/06-components/_index.scss +1 -1
- package/src/styles/06-components/old.chart.styles.scss +0 -2
- package/src/styles/99-utilities/_utilities.border.scss +69 -27
- package/src/styles/99-utilities/_utilities.display.scss +1 -1
- package/src/styles/99-utilities/_utilities.opacity.scss +10 -0
- package/src/styles/99-utilities/_utilities.position.scss +16 -9
- package/src/styles/99-utilities/_utilities.scss +1 -1
- package/src/styles/99-utilities/_utilities.sizes.scss +47 -18
- package/src/styles/99-utilities/_utilities.spacing.scss +118 -66
- package/src/styles/99-utilities/_utilities.text-gradient.scss +30 -30
- package/src/styles/99-utilities/_utilities.text.scss +67 -46
package/src/lib/theme/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme Manager Type Definitions
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* TypeScript types and interfaces for the Atomix Design System theme management system.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -10,80 +10,79 @@ import type { PartStyleProps } from '../types/partProps';
|
|
|
10
10
|
* Theme metadata interface matching themes.config.js structure
|
|
11
11
|
*/
|
|
12
12
|
export interface ThemeMetadata {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
13
|
+
/** Display name of the theme */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Unique identifier/class name for the theme */
|
|
16
|
+
class?: string;
|
|
17
|
+
/** Theme description */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Theme author */
|
|
20
|
+
author?: string;
|
|
21
|
+
/** Theme version (semver) */
|
|
22
|
+
version?: string;
|
|
23
|
+
/** Theme tags for categorization */
|
|
24
|
+
tags?: string[];
|
|
25
|
+
/** Whether the theme supports dark mode */
|
|
26
|
+
supportsDarkMode?: boolean;
|
|
27
|
+
/** Theme status: stable, beta, experimental, deprecated */
|
|
28
|
+
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
29
|
+
/** Accessibility information */
|
|
30
|
+
a11y?: {
|
|
31
|
+
/** Target contrast ratio */
|
|
32
|
+
contrastTarget?: number;
|
|
33
|
+
/** Supported color modes */
|
|
34
|
+
modes?: string[];
|
|
35
|
+
};
|
|
36
|
+
/** Primary theme color (for UI display) */
|
|
37
|
+
color?: string;
|
|
38
|
+
/** Theme features list */
|
|
39
|
+
features?: string[];
|
|
40
|
+
/** Theme dependencies (other themes required) */
|
|
41
|
+
dependencies?: string[];
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
45
44
|
/**
|
|
46
45
|
* Theme change event payload
|
|
47
46
|
*/
|
|
48
47
|
export interface ThemeChangeEvent {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
/** Previous theme name */
|
|
49
|
+
previousTheme: string | null;
|
|
50
|
+
/** New theme name */
|
|
51
|
+
currentTheme: string;
|
|
52
|
+
/** DesignTokens if using tokens-based theme */
|
|
53
|
+
tokens?: import('./tokens').DesignTokens | null;
|
|
54
|
+
/** Timestamp of the change */
|
|
55
|
+
timestamp: number;
|
|
56
|
+
/** Whether the change was from user action or system */
|
|
57
|
+
source: 'user' | 'system' | 'storage';
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
/**
|
|
62
61
|
* Theme load options
|
|
63
62
|
*/
|
|
64
63
|
export interface ThemeLoadOptions {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
/** Force reload even if already loaded */
|
|
65
|
+
force?: boolean;
|
|
66
|
+
/** Preload without applying */
|
|
67
|
+
preload?: boolean;
|
|
68
|
+
/** Remove previous theme CSS */
|
|
69
|
+
removePrevious?: boolean;
|
|
70
|
+
/** Custom CSS path override */
|
|
71
|
+
customPath?: string;
|
|
72
|
+
/** Fallback to default theme on error */
|
|
73
|
+
fallbackOnError?: boolean;
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
/**
|
|
78
77
|
* Theme validation result
|
|
79
78
|
*/
|
|
80
79
|
export interface ThemeValidationResult {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
/** Whether the theme is valid */
|
|
81
|
+
valid: boolean;
|
|
82
|
+
/** Validation errors */
|
|
83
|
+
errors: string[];
|
|
84
|
+
/** Validation warnings */
|
|
85
|
+
warnings: string[];
|
|
87
86
|
}
|
|
88
87
|
|
|
89
88
|
/**
|
|
@@ -110,155 +109,170 @@ export type ThemeErrorCallback = (error: Error, themeName: string) => void;
|
|
|
110
109
|
* Event listener map
|
|
111
110
|
*/
|
|
112
111
|
export interface ThemeEventListeners {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
themeChange: ThemeChangeCallback[];
|
|
113
|
+
themeLoad: ThemeLoadCallback[];
|
|
114
|
+
themeError: ThemeErrorCallback[];
|
|
116
115
|
}
|
|
117
116
|
|
|
118
117
|
/**
|
|
119
118
|
* React hook options for useTheme
|
|
120
119
|
*/
|
|
121
120
|
export interface UseThemeOptions {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
/** Default theme (overrides ThemeProvider default) */
|
|
122
|
+
defaultTheme?: string;
|
|
123
|
+
/** Enable persistence for this hook instance */
|
|
124
|
+
enablePersistence?: boolean;
|
|
125
|
+
/** Custom storage key */
|
|
126
|
+
storageKey?: string;
|
|
127
|
+
/** Callback when theme changes */
|
|
128
|
+
onChange?: (theme: string | import('./tokens').DesignTokens) => void;
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
/**
|
|
133
132
|
* React hook return type for useTheme
|
|
134
133
|
*/
|
|
135
134
|
export interface UseThemeReturn {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
135
|
+
/** Current theme name */
|
|
136
|
+
theme: string;
|
|
137
|
+
/** Current active DesignTokens (if using tokens-based theme) */
|
|
138
|
+
activeTokens: import('./tokens').DesignTokens | null;
|
|
139
|
+
/** Function to change theme (supports string or DesignTokens) */
|
|
140
|
+
setTheme: (
|
|
141
|
+
theme: string | import('./tokens').DesignTokens | Partial<import('./tokens').DesignTokens>,
|
|
142
|
+
options?: ThemeLoadOptions
|
|
143
|
+
) => Promise<void>;
|
|
144
|
+
/** Available themes */
|
|
145
|
+
availableThemes: ThemeMetadata[];
|
|
146
|
+
/** Whether a theme is currently loading */
|
|
147
|
+
isLoading: boolean;
|
|
148
|
+
/** Current error, if any */
|
|
149
|
+
error: Error | null;
|
|
150
|
+
/** Whether a specific theme is loaded */
|
|
151
|
+
isThemeLoaded: (themeName: string) => boolean;
|
|
152
|
+
/** Preload a theme */
|
|
153
|
+
preloadTheme: (themeName: string) => Promise<void>;
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
/**
|
|
155
157
|
* Component-level theme override configuration
|
|
156
158
|
*/
|
|
157
159
|
export interface ComponentThemeOverride {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
160
|
+
/** CSS variable overrides for the component */
|
|
161
|
+
cssVars?: Record<string, string | number>;
|
|
162
|
+
|
|
163
|
+
/** Default prop overrides */
|
|
164
|
+
defaultProps?: Record<string, any>;
|
|
165
|
+
|
|
166
|
+
/** Part-specific overrides */
|
|
167
|
+
parts?: Record<
|
|
168
|
+
string,
|
|
169
|
+
{
|
|
170
|
+
cssVars?: Record<string, string | number>;
|
|
171
|
+
className?: string;
|
|
172
|
+
}
|
|
173
|
+
>;
|
|
174
|
+
|
|
175
|
+
/** Variant overrides */
|
|
176
|
+
variants?: Record<
|
|
177
|
+
string,
|
|
178
|
+
{
|
|
179
|
+
cssVars?: Record<string, string | number>;
|
|
180
|
+
className?: string;
|
|
181
|
+
}
|
|
182
|
+
>;
|
|
183
|
+
|
|
184
|
+
/** Additional className for the component */
|
|
185
|
+
className?: string;
|
|
178
186
|
}
|
|
179
187
|
|
|
180
188
|
/**
|
|
181
189
|
* Theme component overrides for all components
|
|
182
190
|
*/
|
|
183
191
|
export interface ThemeComponentOverrides {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
192
|
+
Button?: ComponentThemeOverride;
|
|
193
|
+
Card?: ComponentThemeOverride;
|
|
194
|
+
Input?: ComponentThemeOverride;
|
|
195
|
+
Modal?: ComponentThemeOverride;
|
|
196
|
+
Dropdown?: ComponentThemeOverride;
|
|
197
|
+
Badge?: ComponentThemeOverride;
|
|
198
|
+
Tabs?: ComponentThemeOverride;
|
|
199
|
+
Progress?: ComponentThemeOverride;
|
|
200
|
+
Tooltip?: ComponentThemeOverride;
|
|
201
|
+
Select?: ComponentThemeOverride;
|
|
202
|
+
Checkbox?: ComponentThemeOverride;
|
|
203
|
+
Radio?: ComponentThemeOverride;
|
|
204
|
+
Textarea?: ComponentThemeOverride;
|
|
205
|
+
FormGroup?: ComponentThemeOverride;
|
|
206
|
+
Navbar?: ComponentThemeOverride;
|
|
207
|
+
Accordion?: ComponentThemeOverride;
|
|
208
|
+
DataTable?: ComponentThemeOverride;
|
|
209
|
+
Avatar?: ComponentThemeOverride;
|
|
210
|
+
List?: ComponentThemeOverride;
|
|
211
|
+
Popover?: ComponentThemeOverride;
|
|
212
|
+
Messages?: ComponentThemeOverride;
|
|
213
|
+
Callout?: ComponentThemeOverride;
|
|
214
|
+
Spinner?: ComponentThemeOverride;
|
|
215
|
+
[key: string]: ComponentThemeOverride | undefined;
|
|
208
216
|
}
|
|
209
217
|
|
|
210
218
|
/**
|
|
211
219
|
* Theme provider props
|
|
212
220
|
*/
|
|
213
221
|
export interface ThemeProviderProps {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
222
|
+
/** Child components */
|
|
223
|
+
children: React.ReactNode;
|
|
224
|
+
/** Default theme (string name or DesignTokens) */
|
|
225
|
+
defaultTheme?:
|
|
226
|
+
| string
|
|
227
|
+
| import('./tokens').DesignTokens
|
|
228
|
+
| Partial<import('./tokens').DesignTokens>;
|
|
229
|
+
/** Available themes */
|
|
230
|
+
themes?: Record<string, ThemeMetadata>;
|
|
231
|
+
/** Base path for theme CSS */
|
|
232
|
+
basePath?: string;
|
|
233
|
+
/** CDN path for theme CSS */
|
|
234
|
+
cdnPath?: string | null;
|
|
235
|
+
/** Themes to preload */
|
|
236
|
+
preload?: string[];
|
|
237
|
+
/** Enable lazy loading */
|
|
238
|
+
lazy?: boolean;
|
|
239
|
+
/** localStorage key */
|
|
240
|
+
storageKey?: string;
|
|
241
|
+
/** Data attribute name */
|
|
242
|
+
dataAttribute?: string;
|
|
243
|
+
/** Enable persistence */
|
|
244
|
+
enablePersistence?: boolean;
|
|
245
|
+
/** Use minified CSS */
|
|
246
|
+
useMinified?: boolean;
|
|
247
|
+
/** Callback when theme changes */
|
|
248
|
+
onThemeChange?: (theme: string | import('./tokens').DesignTokens) => void;
|
|
249
|
+
/** Callback on error */
|
|
250
|
+
onError?: (error: Error, themeName: string) => void;
|
|
240
251
|
}
|
|
241
252
|
|
|
242
253
|
/**
|
|
243
254
|
* Theme context value
|
|
244
255
|
*/
|
|
245
256
|
export interface ThemeContextValue {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
257
|
+
/** Current theme name */
|
|
258
|
+
theme: string;
|
|
259
|
+
/** Current active DesignTokens (if using tokens-based theme) */
|
|
260
|
+
activeTokens: import('./tokens').DesignTokens | null;
|
|
261
|
+
/** Set theme function (supports string or DesignTokens) */
|
|
262
|
+
setTheme: (
|
|
263
|
+
theme: string | import('./tokens').DesignTokens | Partial<import('./tokens').DesignTokens>,
|
|
264
|
+
options?: ThemeLoadOptions
|
|
265
|
+
) => Promise<void>;
|
|
266
|
+
/** Available themes */
|
|
267
|
+
availableThemes: ThemeMetadata[];
|
|
268
|
+
/** Loading state */
|
|
269
|
+
isLoading: boolean;
|
|
270
|
+
/** Error state */
|
|
271
|
+
error: Error | null;
|
|
272
|
+
/** Check if theme is loaded */
|
|
273
|
+
isThemeLoaded: (themeName: string) => boolean;
|
|
274
|
+
/** Preload theme */
|
|
275
|
+
preloadTheme: (themeName: string) => Promise<void>;
|
|
262
276
|
}
|
|
263
277
|
|
|
264
278
|
// ============================================================================
|
|
@@ -269,111 +283,111 @@ export interface ThemeContextValue {
|
|
|
269
283
|
* Color palette configuration for a single color
|
|
270
284
|
*/
|
|
271
285
|
export interface PaletteColor {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
286
|
+
/** Main color value */
|
|
287
|
+
main: string;
|
|
288
|
+
/** Light variant (auto-generated if not provided) */
|
|
289
|
+
light?: string;
|
|
290
|
+
/** Dark variant (auto-generated if not provided) */
|
|
291
|
+
dark?: string;
|
|
292
|
+
/** Contrast text color (auto-generated if not provided) */
|
|
293
|
+
contrastText?: string;
|
|
280
294
|
}
|
|
281
295
|
|
|
282
296
|
/**
|
|
283
297
|
* Palette configuration options for createTheme
|
|
284
298
|
*/
|
|
285
299
|
export interface PaletteOptions {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
300
|
+
/** Primary color configuration */
|
|
301
|
+
primary?: Partial<PaletteColor> | string;
|
|
302
|
+
/** Secondary color configuration */
|
|
303
|
+
secondary?: Partial<PaletteColor> | string;
|
|
304
|
+
/** Error color configuration */
|
|
305
|
+
error?: Partial<PaletteColor> | string;
|
|
306
|
+
/** Warning color configuration */
|
|
307
|
+
warning?: Partial<PaletteColor> | string;
|
|
308
|
+
/** Info color configuration */
|
|
309
|
+
info?: Partial<PaletteColor> | string;
|
|
310
|
+
/** Success color configuration */
|
|
311
|
+
success?: Partial<PaletteColor> | string;
|
|
312
|
+
/** Background colors */
|
|
313
|
+
background?: {
|
|
314
|
+
default?: string;
|
|
315
|
+
subtle?: string;
|
|
316
|
+
};
|
|
317
|
+
/** Text colors */
|
|
318
|
+
text?: {
|
|
319
|
+
primary?: string;
|
|
320
|
+
secondary?: string;
|
|
321
|
+
disabled?: string;
|
|
322
|
+
};
|
|
323
|
+
/** Additional custom colors */
|
|
324
|
+
[key: string]: any;
|
|
311
325
|
}
|
|
312
326
|
|
|
313
327
|
/**
|
|
314
328
|
* Typography configuration options for createTheme
|
|
315
329
|
*/
|
|
316
330
|
export interface TypographyOptions {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
331
|
+
/** Font family */
|
|
332
|
+
fontFamily?: string;
|
|
333
|
+
/** Base font size in pixels */
|
|
334
|
+
fontSize?: number;
|
|
335
|
+
/** Font weight scale */
|
|
336
|
+
fontWeightLight?: number;
|
|
337
|
+
fontWeightRegular?: number;
|
|
338
|
+
fontWeightMedium?: number;
|
|
339
|
+
fontWeightSemiBold?: number;
|
|
340
|
+
fontWeightBold?: number;
|
|
341
|
+
/** Heading configurations */
|
|
342
|
+
h1?: {
|
|
343
|
+
fontSize?: string | number;
|
|
344
|
+
fontWeight?: number;
|
|
345
|
+
lineHeight?: number | string;
|
|
346
|
+
letterSpacing?: string;
|
|
347
|
+
};
|
|
348
|
+
h2?: {
|
|
349
|
+
fontSize?: string | number;
|
|
350
|
+
fontWeight?: number;
|
|
351
|
+
lineHeight?: number | string;
|
|
352
|
+
letterSpacing?: string;
|
|
353
|
+
};
|
|
354
|
+
h3?: {
|
|
355
|
+
fontSize?: string | number;
|
|
356
|
+
fontWeight?: number;
|
|
357
|
+
lineHeight?: number | string;
|
|
358
|
+
letterSpacing?: string;
|
|
359
|
+
};
|
|
360
|
+
h4?: {
|
|
361
|
+
fontSize?: string | number;
|
|
362
|
+
fontWeight?: number;
|
|
363
|
+
lineHeight?: number | string;
|
|
364
|
+
letterSpacing?: string;
|
|
365
|
+
};
|
|
366
|
+
h5?: {
|
|
367
|
+
fontSize?: string | number;
|
|
368
|
+
fontWeight?: number;
|
|
369
|
+
lineHeight?: number | string;
|
|
370
|
+
letterSpacing?: string;
|
|
371
|
+
};
|
|
372
|
+
h6?: {
|
|
373
|
+
fontSize?: string | number;
|
|
374
|
+
fontWeight?: number;
|
|
375
|
+
lineHeight?: number | string;
|
|
376
|
+
letterSpacing?: string;
|
|
377
|
+
};
|
|
378
|
+
/** Body text configurations */
|
|
379
|
+
body1?: {
|
|
380
|
+
fontSize?: string | number;
|
|
381
|
+
fontWeight?: number;
|
|
382
|
+
lineHeight?: number | string;
|
|
383
|
+
};
|
|
384
|
+
body2?: {
|
|
385
|
+
fontSize?: string | number;
|
|
386
|
+
fontWeight?: number;
|
|
387
|
+
lineHeight?: number | string;
|
|
388
|
+
};
|
|
389
|
+
/** Additional custom typography */
|
|
390
|
+
[key: string]: any;
|
|
377
391
|
}
|
|
378
392
|
|
|
379
393
|
/**
|
|
@@ -390,96 +404,96 @@ export type SpacingOptions = number | number[] | SpacingFunction;
|
|
|
390
404
|
* Breakpoint values configuration
|
|
391
405
|
*/
|
|
392
406
|
export interface BreakpointValues {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
407
|
+
xs?: number;
|
|
408
|
+
sm?: number;
|
|
409
|
+
md?: number;
|
|
410
|
+
lg?: number;
|
|
411
|
+
xl?: number;
|
|
412
|
+
[key: string]: number | undefined;
|
|
399
413
|
}
|
|
400
414
|
|
|
401
415
|
/**
|
|
402
416
|
* Breakpoints configuration options for createTheme
|
|
403
417
|
*/
|
|
404
418
|
export interface BreakpointsOptions {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
419
|
+
/** Breakpoint values in pixels */
|
|
420
|
+
values?: BreakpointValues;
|
|
421
|
+
/** Unit for breakpoints (default: 'px') */
|
|
422
|
+
unit?: string;
|
|
409
423
|
}
|
|
410
424
|
|
|
411
425
|
/**
|
|
412
426
|
* Shadow configuration
|
|
413
427
|
*/
|
|
414
428
|
export interface ShadowOptions {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
429
|
+
xs?: string;
|
|
430
|
+
sm?: string;
|
|
431
|
+
md?: string;
|
|
432
|
+
lg?: string;
|
|
433
|
+
xl?: string;
|
|
434
|
+
[key: string]: string | undefined;
|
|
421
435
|
}
|
|
422
436
|
|
|
423
437
|
/**
|
|
424
438
|
* Transition configuration
|
|
425
439
|
*/
|
|
426
440
|
export interface TransitionOptions {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
441
|
+
/** Transition duration values */
|
|
442
|
+
duration?: {
|
|
443
|
+
shortest?: number;
|
|
444
|
+
shorter?: number;
|
|
445
|
+
short?: number;
|
|
446
|
+
standard?: number;
|
|
447
|
+
complex?: number;
|
|
448
|
+
enteringScreen?: number;
|
|
449
|
+
leavingScreen?: number;
|
|
450
|
+
};
|
|
451
|
+
/** Easing functions */
|
|
452
|
+
easing?: {
|
|
453
|
+
easeInOut?: string;
|
|
454
|
+
easeOut?: string;
|
|
455
|
+
easeIn?: string;
|
|
456
|
+
sharp?: string;
|
|
457
|
+
};
|
|
444
458
|
}
|
|
445
459
|
|
|
446
460
|
/**
|
|
447
461
|
* Z-index configuration
|
|
448
462
|
*/
|
|
449
463
|
export interface ZIndexOptions {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
464
|
+
mobileStepper?: number;
|
|
465
|
+
speedDial?: number;
|
|
466
|
+
appBar?: number;
|
|
467
|
+
drawer?: number;
|
|
468
|
+
modal?: number;
|
|
469
|
+
snackbar?: number;
|
|
470
|
+
tooltip?: number;
|
|
471
|
+
[key: string]: number | undefined;
|
|
458
472
|
}
|
|
459
473
|
|
|
460
474
|
/**
|
|
461
475
|
* Border radius configuration
|
|
462
476
|
*/
|
|
463
477
|
export interface BorderRadiusOptions {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
/** Base border radius */
|
|
479
|
+
base?: string | number;
|
|
480
|
+
/** Small border radius */
|
|
481
|
+
sm?: string | number;
|
|
482
|
+
/** Medium border radius */
|
|
483
|
+
md?: string | number;
|
|
484
|
+
/** Large border radius */
|
|
485
|
+
lg?: string | number;
|
|
486
|
+
/** Extra large border radius */
|
|
487
|
+
xl?: string | number;
|
|
488
|
+
/** 2X large border radius */
|
|
489
|
+
xxl?: string | number;
|
|
490
|
+
/** 3X large border radius */
|
|
491
|
+
'3xl'?: string | number;
|
|
492
|
+
/** 4X large border radius */
|
|
493
|
+
'4xl'?: string | number;
|
|
494
|
+
/** Pill shape (fully rounded) */
|
|
495
|
+
pill?: string | number;
|
|
496
|
+
[key: string]: string | number | undefined;
|
|
483
497
|
}
|
|
484
498
|
|
|
485
499
|
/**
|
|
@@ -487,7 +501,7 @@ export interface BorderRadiusOptions {
|
|
|
487
501
|
* Users can augment this interface via module augmentation
|
|
488
502
|
*/
|
|
489
503
|
export interface ThemeCustomProperties {
|
|
490
|
-
|
|
504
|
+
[key: string]: any;
|
|
491
505
|
}
|
|
492
506
|
|
|
493
507
|
/**
|
|
@@ -495,24 +509,24 @@ export interface ThemeCustomProperties {
|
|
|
495
509
|
* Extends ThemeMetadata to support both CSS and JS theme properties
|
|
496
510
|
*/
|
|
497
511
|
export interface ThemeOptions extends Partial<ThemeMetadata> {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
512
|
+
/** Color palette configuration */
|
|
513
|
+
palette?: PaletteOptions;
|
|
514
|
+
/** Typography configuration */
|
|
515
|
+
typography?: TypographyOptions;
|
|
516
|
+
/** Spacing configuration */
|
|
517
|
+
spacing?: SpacingOptions;
|
|
518
|
+
/** Breakpoints configuration */
|
|
519
|
+
breakpoints?: BreakpointsOptions;
|
|
520
|
+
/** Shadow configuration */
|
|
521
|
+
shadows?: ShadowOptions;
|
|
522
|
+
/** Transition configuration */
|
|
523
|
+
transitions?: TransitionOptions;
|
|
524
|
+
/** Z-index configuration */
|
|
525
|
+
zIndex?: ZIndexOptions;
|
|
526
|
+
/** Border radius configuration */
|
|
527
|
+
borderRadius?: BorderRadiusOptions;
|
|
528
|
+
/** Custom properties */
|
|
529
|
+
custom?: ThemeCustomProperties;
|
|
516
530
|
}
|
|
517
531
|
|
|
518
532
|
/**
|
|
@@ -520,81 +534,84 @@ export interface ThemeOptions extends Partial<ThemeMetadata> {
|
|
|
520
534
|
* Generated by createTheme function
|
|
521
535
|
*/
|
|
522
536
|
export interface Theme extends ThemeMetadata {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
};
|
|
536
|
-
text: {
|
|
537
|
-
primary: string;
|
|
538
|
-
secondary: string;
|
|
539
|
-
disabled: string;
|
|
540
|
-
};
|
|
541
|
-
[key: string]: any;
|
|
542
|
-
};
|
|
543
|
-
/** Typography with computed values */
|
|
544
|
-
typography: {
|
|
545
|
-
fontFamily: string;
|
|
546
|
-
fontSize: number;
|
|
547
|
-
fontWeightLight: number;
|
|
548
|
-
fontWeightRegular: number;
|
|
549
|
-
fontWeightMedium: number;
|
|
550
|
-
fontWeightSemiBold: number;
|
|
551
|
-
fontWeightBold: number;
|
|
552
|
-
h1: Required<NonNullable<TypographyOptions['h1']>>;
|
|
553
|
-
h2: Required<NonNullable<TypographyOptions['h2']>>;
|
|
554
|
-
h3: Required<NonNullable<TypographyOptions['h3']>>;
|
|
555
|
-
h4: Required<NonNullable<TypographyOptions['h4']>>;
|
|
556
|
-
h5: Required<NonNullable<TypographyOptions['h5']>>;
|
|
557
|
-
h6: Required<NonNullable<TypographyOptions['h6']>>;
|
|
558
|
-
body1: Required<NonNullable<TypographyOptions['body1']>>;
|
|
559
|
-
body2: Required<NonNullable<TypographyOptions['body2']>>;
|
|
560
|
-
[key: string]: any;
|
|
537
|
+
/** Color palette with computed values */
|
|
538
|
+
palette: {
|
|
539
|
+
primary: PaletteColor;
|
|
540
|
+
secondary: PaletteColor;
|
|
541
|
+
error: PaletteColor;
|
|
542
|
+
warning: PaletteColor;
|
|
543
|
+
info: PaletteColor;
|
|
544
|
+
success: PaletteColor;
|
|
545
|
+
background: {
|
|
546
|
+
default: string;
|
|
547
|
+
paper: string;
|
|
548
|
+
subtle: string;
|
|
561
549
|
};
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
values: Required<BreakpointValues>;
|
|
567
|
-
unit: string;
|
|
568
|
-
up: (key: keyof BreakpointValues | number) => string;
|
|
569
|
-
down: (key: keyof BreakpointValues | number) => string;
|
|
570
|
-
between: (start: keyof BreakpointValues | number, end: keyof BreakpointValues | number) => string;
|
|
550
|
+
text: {
|
|
551
|
+
primary: string;
|
|
552
|
+
secondary: string;
|
|
553
|
+
disabled: string;
|
|
571
554
|
};
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
555
|
+
[key: string]: any;
|
|
556
|
+
};
|
|
557
|
+
/** Typography with computed values */
|
|
558
|
+
typography: {
|
|
559
|
+
fontFamily: string;
|
|
560
|
+
fontSize: number;
|
|
561
|
+
fontWeightLight: number;
|
|
562
|
+
fontWeightRegular: number;
|
|
563
|
+
fontWeightMedium: number;
|
|
564
|
+
fontWeightSemiBold: number;
|
|
565
|
+
fontWeightBold: number;
|
|
566
|
+
h1: Required<NonNullable<TypographyOptions['h1']>>;
|
|
567
|
+
h2: Required<NonNullable<TypographyOptions['h2']>>;
|
|
568
|
+
h3: Required<NonNullable<TypographyOptions['h3']>>;
|
|
569
|
+
h4: Required<NonNullable<TypographyOptions['h4']>>;
|
|
570
|
+
h5: Required<NonNullable<TypographyOptions['h5']>>;
|
|
571
|
+
h6: Required<NonNullable<TypographyOptions['h6']>>;
|
|
572
|
+
body1: Required<NonNullable<TypographyOptions['body1']>>;
|
|
573
|
+
body2: Required<NonNullable<TypographyOptions['body2']>>;
|
|
574
|
+
[key: string]: any;
|
|
575
|
+
};
|
|
576
|
+
/** Spacing function */
|
|
577
|
+
spacing: SpacingFunction;
|
|
578
|
+
/** Breakpoints with computed values */
|
|
579
|
+
breakpoints: {
|
|
580
|
+
values: Required<BreakpointValues>;
|
|
581
|
+
unit: string;
|
|
582
|
+
up: (key: keyof BreakpointValues | number) => string;
|
|
583
|
+
down: (key: keyof BreakpointValues | number) => string;
|
|
584
|
+
between: (
|
|
585
|
+
start: keyof BreakpointValues | number,
|
|
586
|
+
end: keyof BreakpointValues | number
|
|
587
|
+
) => string;
|
|
588
|
+
};
|
|
589
|
+
/** Shadows */
|
|
590
|
+
shadows: Required<ShadowOptions>;
|
|
591
|
+
/** Transitions */
|
|
592
|
+
transitions: Required<TransitionOptions>;
|
|
593
|
+
/** Z-index values */
|
|
594
|
+
zIndex: Required<ZIndexOptions>;
|
|
595
|
+
/** Border radius values */
|
|
596
|
+
borderRadius: Required<BorderRadiusOptions>;
|
|
597
|
+
/** Custom properties */
|
|
598
|
+
custom: ThemeCustomProperties;
|
|
599
|
+
/** Global CSS variables to apply */
|
|
600
|
+
cssVars?: Record<string, string | number>;
|
|
601
|
+
/** Indicates this is a JS theme (not CSS-only) */
|
|
602
|
+
__isJSTheme: true;
|
|
586
603
|
}
|
|
587
604
|
|
|
588
605
|
/**
|
|
589
606
|
* Storage adapter interface for custom storage implementations
|
|
590
607
|
*/
|
|
591
608
|
export interface StorageAdapter {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
609
|
+
/** Get item from storage */
|
|
610
|
+
getItem(key: string): string | null;
|
|
611
|
+
/** Set item in storage */
|
|
612
|
+
setItem(key: string, value: string): void;
|
|
613
|
+
/** Remove item from storage */
|
|
614
|
+
removeItem(key: string): void;
|
|
615
|
+
/** Check if storage is available */
|
|
616
|
+
isAvailable(): boolean;
|
|
600
617
|
}
|