@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.9 → 0.2.10
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 +1 -1
- package/dist/components/ui/accessibility-demo.esm.js +30 -24
- package/dist/components/ui/accessibility-demo.js +30 -24
- package/dist/components/ui/advanced-component-architecture-demo.esm.js +235 -179
- package/dist/components/ui/advanced-component-architecture-demo.js +235 -179
- package/dist/components/ui/advanced-transition-system-demo.esm.js +110 -64
- package/dist/components/ui/advanced-transition-system-demo.js +110 -64
- package/dist/components/ui/advanced-transition-system.esm.js +166 -122
- package/dist/components/ui/advanced-transition-system.js +166 -122
- package/dist/components/ui/animation/animated-container.esm.js +52 -29
- package/dist/components/ui/animation/animated-container.js +52 -29
- package/dist/components/ui/animation/staggered-container.esm.js +18 -9
- package/dist/components/ui/animation/staggered-container.js +18 -9
- package/dist/components/ui/animation-demo.esm.js +67 -35
- package/dist/components/ui/animation-demo.js +67 -35
- package/dist/components/ui/badge.esm.js +9 -6
- package/dist/components/ui/badge.js +9 -6
- package/dist/components/ui/battery-conscious-animation-demo.esm.js +122 -87
- package/dist/components/ui/battery-conscious-animation-demo.js +122 -87
- package/dist/components/ui/border-radius-shadow-demo.esm.js +23 -12
- package/dist/components/ui/border-radius-shadow-demo.js +23 -12
- package/dist/components/ui/button.esm.js +8 -2
- package/dist/components/ui/button.js +8 -2
- package/dist/components/ui/card.esm.js +33 -8
- package/dist/components/ui/card.js +33 -8
- package/dist/components/ui/checkbox.esm.js +3 -3
- package/dist/components/ui/checkbox.js +3 -3
- package/dist/components/ui/color-preview.esm.js +68 -45
- package/dist/components/ui/color-preview.js +68 -45
- package/dist/components/ui/data-display/chart.esm.js +112 -84
- package/dist/components/ui/data-display/chart.js +112 -84
- package/dist/components/ui/data-display/data-grid-simple.esm.js +1 -1
- package/dist/components/ui/data-display/data-grid-simple.js +1 -1
- package/dist/components/ui/data-display/data-grid.esm.js +80 -67
- package/dist/components/ui/data-display/data-grid.js +80 -67
- package/dist/components/ui/data-display/list.esm.js +53 -45
- package/dist/components/ui/data-display/list.js +53 -45
- package/dist/components/ui/data-display/table.esm.js +62 -54
- package/dist/components/ui/data-display/table.js +62 -54
- package/dist/components/ui/data-display/timeline.esm.js +39 -34
- package/dist/components/ui/data-display/timeline.js +39 -34
- package/dist/components/ui/data-display/tree.esm.js +116 -84
- package/dist/components/ui/data-display/tree.js +116 -84
- package/dist/components/ui/data-display/types.esm.js +389 -364
- package/dist/components/ui/data-display/types.js +389 -364
- package/dist/components/ui/enterprise-mobile-experience-demo.esm.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience-demo.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience.esm.js +124 -73
- package/dist/components/ui/enterprise-mobile-experience.js +124 -73
- package/dist/components/ui/feedback/alert.esm.js +22 -15
- package/dist/components/ui/feedback/alert.js +22 -15
- package/dist/components/ui/feedback/progress.esm.js +47 -24
- package/dist/components/ui/feedback/progress.js +47 -24
- package/dist/components/ui/feedback/skeleton.esm.js +39 -29
- package/dist/components/ui/feedback/skeleton.js +39 -29
- package/dist/components/ui/feedback/toast.esm.js +62 -38
- package/dist/components/ui/feedback/toast.js +62 -38
- package/dist/components/ui/feedback/types.esm.js +83 -83
- package/dist/components/ui/feedback/types.js +83 -83
- package/dist/components/ui/font-preview.esm.js +41 -39
- package/dist/components/ui/font-preview.js +41 -39
- package/dist/components/ui/form-demo.esm.js +150 -113
- package/dist/components/ui/form-demo.js +150 -113
- package/dist/components/ui/hardware-acceleration-demo.esm.js +137 -87
- package/dist/components/ui/hardware-acceleration-demo.js +137 -87
- package/dist/components/ui/input.esm.js +4 -1
- package/dist/components/ui/input.js +4 -1
- package/dist/components/ui/layout-demo.esm.js +81 -56
- package/dist/components/ui/layout-demo.js +81 -56
- package/dist/components/ui/layouts/adaptive-layout.esm.js +27 -8
- package/dist/components/ui/layouts/adaptive-layout.js +27 -8
- package/dist/components/ui/layouts/desktop-layout.esm.js +39 -19
- package/dist/components/ui/layouts/desktop-layout.js +39 -19
- package/dist/components/ui/layouts/mobile-layout.esm.js +19 -9
- package/dist/components/ui/layouts/mobile-layout.js +19 -9
- package/dist/components/ui/layouts/tablet-layout.esm.js +28 -14
- package/dist/components/ui/layouts/tablet-layout.js +28 -14
- package/dist/components/ui/mobile-form-validation.esm.js +120 -87
- package/dist/components/ui/mobile-form-validation.js +120 -87
- package/dist/components/ui/mobile-input-demo.esm.js +19 -13
- package/dist/components/ui/mobile-input-demo.js +19 -13
- package/dist/components/ui/mobile-input.esm.js +185 -120
- package/dist/components/ui/mobile-input.js +185 -120
- package/dist/components/ui/mobile-skeleton-loading-demo.esm.js +128 -111
- package/dist/components/ui/mobile-skeleton-loading-demo.js +128 -111
- package/dist/components/ui/navigation/breadcrumb.esm.js +17 -14
- package/dist/components/ui/navigation/breadcrumb.js +17 -14
- package/dist/components/ui/navigation/index.esm.js +23 -1
- package/dist/components/ui/navigation/index.js +23 -1
- package/dist/components/ui/navigation/menu.esm.js +49 -35
- package/dist/components/ui/navigation/menu.js +49 -35
- package/dist/components/ui/navigation/navigation-demo.esm.js +81 -74
- package/dist/components/ui/navigation/navigation-demo.js +81 -74
- package/dist/components/ui/navigation/pagination.esm.js +62 -50
- package/dist/components/ui/navigation/pagination.js +62 -50
- package/dist/components/ui/navigation/sidebar.esm.js +56 -42
- package/dist/components/ui/navigation/sidebar.js +56 -42
- package/dist/components/ui/navigation/stepper.esm.js +34 -23
- package/dist/components/ui/navigation/stepper.js +34 -23
- package/dist/components/ui/navigation/tabs.esm.js +32 -21
- package/dist/components/ui/navigation/tabs.js +32 -21
- package/dist/components/ui/navigation/types.esm.js +196 -195
- package/dist/components/ui/navigation/types.js +196 -195
- package/dist/components/ui/overlay/backdrop.esm.js +17 -16
- package/dist/components/ui/overlay/backdrop.js +17 -16
- package/dist/components/ui/overlay/focus-manager.esm.js +21 -19
- package/dist/components/ui/overlay/focus-manager.js +21 -19
- package/dist/components/ui/overlay/index.esm.js +22 -2
- package/dist/components/ui/overlay/index.js +22 -2
- package/dist/components/ui/overlay/modal.esm.js +38 -34
- package/dist/components/ui/overlay/modal.js +38 -34
- package/dist/components/ui/overlay/overlay-manager.esm.js +25 -20
- package/dist/components/ui/overlay/overlay-manager.js +25 -20
- package/dist/components/ui/overlay/popover.esm.js +74 -58
- package/dist/components/ui/overlay/popover.js +74 -58
- package/dist/components/ui/overlay/portal.esm.js +7 -7
- package/dist/components/ui/overlay/portal.js +7 -7
- package/dist/components/ui/overlay/tooltip.esm.js +54 -39
- package/dist/components/ui/overlay/tooltip.js +54 -39
- package/dist/components/ui/overlay/types.esm.js +132 -131
- package/dist/components/ui/overlay/types.js +132 -131
- package/dist/components/ui/performance-demo.esm.js +135 -88
- package/dist/components/ui/performance-demo.js +135 -88
- package/dist/components/ui/semantic-input-system-demo.esm.js +117 -80
- package/dist/components/ui/semantic-input-system-demo.js +117 -80
- package/dist/components/ui/theme-customizer.esm.js +84 -52
- package/dist/components/ui/theme-customizer.js +84 -52
- package/dist/components/ui/theme-preview.esm.js +95 -43
- package/dist/components/ui/theme-preview.js +95 -43
- package/dist/components/ui/theme-switcher.esm.js +70 -44
- package/dist/components/ui/theme-switcher.js +70 -44
- package/dist/components/ui/theme-toggle.esm.js +3 -3
- package/dist/components/ui/theme-toggle.js +3 -3
- package/dist/components/ui/token-demo.esm.js +33 -21
- package/dist/components/ui/token-demo.js +33 -21
- package/dist/components/ui/touch-demo.esm.js +102 -73
- package/dist/components/ui/touch-demo.js +102 -73
- package/dist/components/ui/touch-friendly-interface-demo.esm.js +102 -64
- package/dist/components/ui/touch-friendly-interface-demo.js +102 -64
- package/dist/components/ui/touch-friendly-interface.esm.js +85 -61
- package/dist/components/ui/touch-friendly-interface.js +85 -61
- package/dist/hooks/use-accessibility-support.esm.js +115 -85
- package/dist/hooks/use-accessibility-support.js +115 -85
- package/dist/hooks/use-adaptive-layout.esm.js +56 -33
- package/dist/hooks/use-adaptive-layout.js +56 -33
- package/dist/hooks/use-advanced-patterns.esm.js +57 -42
- package/dist/hooks/use-advanced-patterns.js +57 -42
- package/dist/hooks/use-advanced-transition-system.esm.js +112 -71
- package/dist/hooks/use-advanced-transition-system.js +112 -71
- package/dist/hooks/use-animation-profile.esm.js +63 -34
- package/dist/hooks/use-animation-profile.js +63 -34
- package/dist/hooks/use-battery-animations.esm.js +80 -55
- package/dist/hooks/use-battery-animations.js +80 -55
- package/dist/hooks/use-battery-conscious-loading.esm.js +166 -123
- package/dist/hooks/use-battery-conscious-loading.js +166 -123
- package/dist/hooks/use-battery-optimization.esm.js +78 -55
- package/dist/hooks/use-battery-optimization.js +78 -55
- package/dist/hooks/use-battery-status.esm.js +73 -51
- package/dist/hooks/use-battery-status.js +73 -51
- package/dist/hooks/use-component-performance.esm.js +62 -47
- package/dist/hooks/use-component-performance.js +62 -47
- package/dist/hooks/use-device-loading-states.esm.js +152 -109
- package/dist/hooks/use-device-loading-states.js +152 -109
- package/dist/hooks/use-device.esm.js +25 -14
- package/dist/hooks/use-device.js +25 -14
- package/dist/hooks/use-enterprise-mobile-experience.esm.js +137 -88
- package/dist/hooks/use-enterprise-mobile-experience.js +137 -88
- package/dist/hooks/use-form-feedback.esm.js +124 -81
- package/dist/hooks/use-form-feedback.js +124 -81
- package/dist/hooks/use-form-performance.esm.js +127 -92
- package/dist/hooks/use-form-performance.js +127 -92
- package/dist/hooks/use-frame-rate.esm.js +56 -37
- package/dist/hooks/use-frame-rate.js +56 -37
- package/dist/hooks/use-gestures.esm.js +96 -72
- package/dist/hooks/use-gestures.js +96 -72
- package/dist/hooks/use-hardware-acceleration.esm.js +65 -37
- package/dist/hooks/use-hardware-acceleration.js +65 -37
- package/dist/hooks/use-input-accessibility.esm.js +157 -119
- package/dist/hooks/use-input-accessibility.js +157 -119
- package/dist/hooks/use-input-performance.esm.js +139 -104
- package/dist/hooks/use-input-performance.js +139 -104
- package/dist/hooks/use-layout-performance.esm.js +50 -29
- package/dist/hooks/use-layout-performance.js +50 -29
- package/dist/hooks/use-loading-accessibility.esm.js +209 -169
- package/dist/hooks/use-loading-accessibility.js +209 -169
- package/dist/hooks/use-loading-performance.esm.js +117 -93
- package/dist/hooks/use-loading-performance.js +117 -93
- package/dist/hooks/use-memory-usage.esm.js +57 -38
- package/dist/hooks/use-memory-usage.js +57 -38
- package/dist/hooks/use-mobile-form-layout.esm.js +111 -74
- package/dist/hooks/use-mobile-form-layout.js +111 -74
- package/dist/hooks/use-mobile-form-validation.esm.js +211 -144
- package/dist/hooks/use-mobile-form-validation.js +211 -144
- package/dist/hooks/use-mobile-keyboard-optimization.esm.js +154 -113
- package/dist/hooks/use-mobile-keyboard-optimization.js +154 -113
- package/dist/hooks/use-mobile-layout.esm.js +73 -51
- package/dist/hooks/use-mobile-layout.js +73 -51
- package/dist/hooks/use-mobile-optimization.esm.js +72 -44
- package/dist/hooks/use-mobile-optimization.js +72 -44
- package/dist/hooks/use-mobile-skeleton.esm.js +97 -64
- package/dist/hooks/use-mobile-skeleton.js +97 -64
- package/dist/hooks/use-mobile-touch.esm.js +128 -93
- package/dist/hooks/use-mobile-touch.js +128 -93
- package/dist/hooks/use-performance-throttling.esm.js +72 -48
- package/dist/hooks/use-performance-throttling.js +72 -48
- package/dist/hooks/use-performance.esm.js +90 -52
- package/dist/hooks/use-performance.js +90 -52
- package/dist/hooks/use-reusable-architecture.esm.js +94 -65
- package/dist/hooks/use-reusable-architecture.js +94 -65
- package/dist/hooks/use-semantic-input-types.esm.js +166 -124
- package/dist/hooks/use-semantic-input-types.js +166 -124
- package/dist/hooks/use-semantic-input.esm.js +178 -126
- package/dist/hooks/use-semantic-input.js +178 -126
- package/dist/hooks/use-tablet-layout.esm.js +67 -38
- package/dist/hooks/use-tablet-layout.js +67 -38
- package/dist/hooks/use-touch-friendly-input.esm.js +193 -149
- package/dist/hooks/use-touch-friendly-input.js +193 -149
- package/dist/hooks/use-touch-friendly-interface.esm.js +99 -67
- package/dist/hooks/use-touch-friendly-interface.js +99 -67
- package/dist/hooks/use-touch-optimization.esm.js +99 -72
- package/dist/hooks/use-touch-optimization.js +99 -72
- package/dist/index.esm.js +289 -280
- package/dist/index.js +289 -280
- package/dist/lib/utils.esm.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/plugins/theme-css-generator.esm.js +104 -55
- package/dist/plugins/theme-css-generator.js +104 -55
- package/dist/provider.esm.js +4 -4
- package/dist/provider.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/theme.esm.js +633 -468
- package/dist/theme.js +633 -468
- package/dist/themes/ThemeContext.esm.js +15 -15
- package/dist/themes/ThemeContext.js +15 -15
- package/dist/themes/ThemeProvider.esm.js +25 -22
- package/dist/themes/ThemeProvider.js +25 -22
- package/dist/themes/accessibility.esm.js +147 -108
- package/dist/themes/accessibility.js +147 -108
- package/dist/themes/aria-patterns.esm.js +198 -162
- package/dist/themes/aria-patterns.js +198 -162
- package/dist/themes/base-themes.esm.js +14 -11
- package/dist/themes/base-themes.js +14 -11
- package/dist/themes/colorManager.esm.js +101 -83
- package/dist/themes/colorManager.js +101 -83
- package/dist/themes/examples/dark-theme.esm.js +133 -103
- package/dist/themes/examples/dark-theme.js +133 -103
- package/dist/themes/examples/minimal-theme.esm.js +83 -61
- package/dist/themes/examples/minimal-theme.js +83 -61
- package/dist/themes/focus-management.esm.js +202 -143
- package/dist/themes/focus-management.js +202 -143
- package/dist/themes/fontLoader.esm.js +28 -19
- package/dist/themes/fontLoader.js +28 -19
- package/dist/themes/high-contrast.esm.js +152 -104
- package/dist/themes/high-contrast.js +152 -104
- package/dist/themes/inheritance.esm.js +35 -27
- package/dist/themes/inheritance.js +35 -27
- package/dist/themes/keyboard-navigation.esm.js +152 -123
- package/dist/themes/keyboard-navigation.js +152 -123
- package/dist/themes/motion-reduction.esm.js +193 -133
- package/dist/themes/motion-reduction.js +193 -133
- package/dist/themes/navigation.esm.js +146 -146
- package/dist/themes/navigation.js +146 -146
- package/dist/themes/screen-reader.esm.js +159 -94
- package/dist/themes/screen-reader.js +159 -94
- package/dist/themes/systemThemeDetector.esm.js +42 -34
- package/dist/themes/systemThemeDetector.js +42 -34
- package/dist/themes/themeCSSUpdater.esm.js +21 -9
- package/dist/themes/themeCSSUpdater.js +21 -9
- package/dist/themes/themePersistence.esm.js +68 -47
- package/dist/themes/themePersistence.js +68 -47
- package/dist/themes/themes/stan-design.esm.js +633 -468
- package/dist/themes/themes/stan-design.js +633 -468
- package/dist/themes/types.esm.js +301 -287
- package/dist/themes/types.js +301 -287
- package/dist/themes/useSystemTheme.esm.js +4 -4
- package/dist/themes/useSystemTheme.js +4 -4
- package/dist/themes/useTheme.esm.js +4 -4
- package/dist/themes/useTheme.js +4 -4
- package/dist/themes/validation.esm.js +128 -77
- package/dist/themes/validation.js +128 -77
- package/dist/tokens/index.esm.js +15 -4
- package/dist/tokens/index.js +15 -4
- package/dist/tokens/tokenExporter.esm.js +87 -61
- package/dist/tokens/tokenExporter.js +87 -61
- package/dist/tokens/tokenGenerator.esm.js +86 -77
- package/dist/tokens/tokenGenerator.js +86 -77
- package/dist/tokens/tokenManager.esm.js +64 -51
- package/dist/tokens/tokenManager.js +64 -51
- package/dist/tokens/tokenValidator.esm.js +193 -147
- package/dist/tokens/tokenValidator.js +193 -147
- package/dist/tokens/types.esm.js +49 -35
- package/dist/tokens/types.js +49 -35
- package/dist/utils/bundle-analyzer.esm.js +83 -65
- package/dist/utils/bundle-analyzer.js +83 -65
- package/dist/utils/bundle-splitting.esm.js +142 -117
- package/dist/utils/bundle-splitting.js +142 -117
- package/dist/utils/lazy-loading.esm.js +132 -106
- package/dist/utils/lazy-loading.js +132 -106
- package/dist/utils/performance-monitor.esm.js +170 -129
- package/dist/utils/performance-monitor.js +170 -129
- package/dist/utils/tree-shaking.esm.js +69 -61
- package/dist/utils/tree-shaking.js +69 -61
- package/package.json +1 -1
- package/src/index.ts +146 -146
|
@@ -15,26 +15,27 @@ export class ColorManager {
|
|
|
15
15
|
/**
|
|
16
16
|
* Generate a complete color scale from a base color
|
|
17
17
|
*/
|
|
18
|
-
static generateColorScale(config)
|
|
18
|
+
static generateColorScale(config: ColorGenerationConfig): ColorScale {
|
|
19
|
+
const { baseColor, hueShift: _hueShift = 0, saturationAdjust = 0, lightnessAdjust = 0 } = config;
|
|
19
20
|
|
|
20
21
|
// Parse the base color
|
|
21
22
|
const hsl = this.hexToHsl(baseColor);
|
|
22
23
|
if (!hsl) {
|
|
23
|
-
throw new Error(`Invalid color format}`);
|
|
24
|
+
throw new Error(`Invalid color format: ${baseColor}`);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
// Generate the scale - preserve base color at 500
|
|
27
|
-
const scale= {
|
|
28
|
-
50, 0, saturationAdjust, 95 + lightnessAdjust),
|
|
29
|
-
100, 0, saturationAdjust, 90 + lightnessAdjust),
|
|
30
|
-
200, 0, saturationAdjust, 80 + lightnessAdjust),
|
|
31
|
-
300, 0, saturationAdjust, 70 + lightnessAdjust),
|
|
32
|
-
400, 0, saturationAdjust, 60 + lightnessAdjust),
|
|
33
|
-
500, // Keep original base color
|
|
34
|
-
600, 0, saturationAdjust, 40 + lightnessAdjust),
|
|
35
|
-
700, 0, saturationAdjust, 30 + lightnessAdjust),
|
|
36
|
-
800, 0, saturationAdjust, 20 + lightnessAdjust),
|
|
37
|
-
900, 0, saturationAdjust, 10 + lightnessAdjust)
|
|
28
|
+
const scale: ColorScale = {
|
|
29
|
+
50: this.adjustHsl(hsl, 0, saturationAdjust, 95 + lightnessAdjust),
|
|
30
|
+
100: this.adjustHsl(hsl, 0, saturationAdjust, 90 + lightnessAdjust),
|
|
31
|
+
200: this.adjustHsl(hsl, 0, saturationAdjust, 80 + lightnessAdjust),
|
|
32
|
+
300: this.adjustHsl(hsl, 0, saturationAdjust, 70 + lightnessAdjust),
|
|
33
|
+
400: this.adjustHsl(hsl, 0, saturationAdjust, 60 + lightnessAdjust),
|
|
34
|
+
500: baseColor, // Keep original base color
|
|
35
|
+
600: this.adjustHsl(hsl, 0, saturationAdjust, 40 + lightnessAdjust),
|
|
36
|
+
700: this.adjustHsl(hsl, 0, saturationAdjust, 30 + lightnessAdjust),
|
|
37
|
+
800: this.adjustHsl(hsl, 0, saturationAdjust, 20 + lightnessAdjust),
|
|
38
|
+
900: this.adjustHsl(hsl, 0, saturationAdjust, 10 + lightnessAdjust)
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
// Add optional variations
|
|
@@ -53,9 +54,10 @@ export class ColorManager {
|
|
|
53
54
|
/**
|
|
54
55
|
* Generate semantic colors based on a primary color
|
|
55
56
|
*/
|
|
56
|
-
static generateSemanticColors(primaryColor)
|
|
57
|
+
static generateSemanticColors(primaryColor: string): SemanticColors {
|
|
58
|
+
const primaryHsl = this.hexToHsl(primaryColor);
|
|
57
59
|
if (!primaryHsl) {
|
|
58
|
-
throw new Error(`Invalid primary color}`);
|
|
60
|
+
throw new Error(`Invalid primary color: ${primaryColor}`);
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
// Generate semantic colors with appropriate hues
|
|
@@ -65,61 +67,63 @@ export class ColorManager {
|
|
|
65
67
|
const infoHue = 210; // Blue
|
|
66
68
|
|
|
67
69
|
return {
|
|
68
|
-
success, 70, 50),
|
|
69
|
-
warning, 90, 50),
|
|
70
|
-
error, 80, 50),
|
|
71
|
-
info, 80, 50),
|
|
70
|
+
success: this.hslToHex(successHue, 70, 50),
|
|
71
|
+
warning: this.hslToHex(warningHue, 90, 50),
|
|
72
|
+
error: this.hslToHex(errorHue, 80, 50),
|
|
73
|
+
info: this.hslToHex(infoHue, 80, 50),
|
|
72
74
|
|
|
73
75
|
// Light variants
|
|
74
|
-
successLight, 70, 90),
|
|
75
|
-
warningLight, 90, 90),
|
|
76
|
-
errorLight, 80, 90),
|
|
77
|
-
infoLight, 80, 90),
|
|
76
|
+
successLight: this.hslToHex(successHue, 70, 90),
|
|
77
|
+
warningLight: this.hslToHex(warningHue, 90, 90),
|
|
78
|
+
errorLight: this.hslToHex(errorHue, 80, 90),
|
|
79
|
+
infoLight: this.hslToHex(infoHue, 80, 90),
|
|
78
80
|
|
|
79
81
|
// Dark variants
|
|
80
|
-
successDark, 70, 30),
|
|
81
|
-
warningDark, 90, 30),
|
|
82
|
-
errorDark, 80, 30),
|
|
83
|
-
infoDark, 80, 30)
|
|
82
|
+
successDark: this.hslToHex(successHue, 70, 30),
|
|
83
|
+
warningDark: this.hslToHex(warningHue, 90, 30),
|
|
84
|
+
errorDark: this.hslToHex(errorHue, 80, 30),
|
|
85
|
+
infoDark: this.hslToHex(infoHue, 80, 30)
|
|
84
86
|
};
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
/**
|
|
88
90
|
* Generate neutral color scale
|
|
89
91
|
*/
|
|
90
|
-
static generateNeutralColors(baseColor= '#6b7280')
|
|
92
|
+
static generateNeutralColors(baseColor: string = '#6b7280'): ColorScale {
|
|
93
|
+
const hsl = this.hexToHsl(baseColor);
|
|
91
94
|
if (!hsl) {
|
|
92
|
-
throw new Error(`Invalid neutral color}`);
|
|
95
|
+
throw new Error(`Invalid neutral color: ${baseColor}`);
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
return {
|
|
96
|
-
50, 5, 97),
|
|
97
|
-
100, 5, 90),
|
|
98
|
-
200, 5, 80),
|
|
99
|
-
300, 5, 70),
|
|
100
|
-
400, 5, 60),
|
|
101
|
-
500, // Keep original base color
|
|
102
|
-
600, 5, 40),
|
|
103
|
-
700, 5, 30),
|
|
104
|
-
800, 5, 20),
|
|
105
|
-
900, 5, 10)
|
|
99
|
+
50: this.hslToHex(hsl.h, 5, 97),
|
|
100
|
+
100: this.hslToHex(hsl.h, 5, 90),
|
|
101
|
+
200: this.hslToHex(hsl.h, 5, 80),
|
|
102
|
+
300: this.hslToHex(hsl.h, 5, 70),
|
|
103
|
+
400: this.hslToHex(hsl.h, 5, 60),
|
|
104
|
+
500: baseColor, // Keep original base color
|
|
105
|
+
600: this.hslToHex(hsl.h, 5, 40),
|
|
106
|
+
700: this.hslToHex(hsl.h, 5, 30),
|
|
107
|
+
800: this.hslToHex(hsl.h, 5, 20),
|
|
108
|
+
900: this.hslToHex(hsl.h, 5, 10)
|
|
106
109
|
};
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
/**
|
|
110
113
|
* Check color contrast for accessibility
|
|
111
114
|
*/
|
|
112
|
-
static checkColorContrast(foreground, background)
|
|
115
|
+
static checkColorContrast(foreground: string, background: string): ColorAccessibility {
|
|
116
|
+
const ratio = this.calculateContrastRatio(foreground, background);
|
|
113
117
|
|
|
114
118
|
const aa = ratio >= 4.5; // WCAG AA standard for normal text
|
|
115
119
|
const aaa = ratio >= 7; // WCAG AAA standard for normal text
|
|
116
120
|
|
|
117
|
-
const recommendations] = [];
|
|
121
|
+
const recommendations: string[] = [];
|
|
118
122
|
if (!aa) {
|
|
119
|
-
recommendations.push('Increase contrast to meet WCAG AA standards (4.5)');
|
|
123
|
+
recommendations.push('Increase contrast to meet WCAG AA standards (4.5:1)');
|
|
120
124
|
}
|
|
121
125
|
if (!aaa) {
|
|
122
|
-
recommendations.push('Increase contrast to meet WCAG AAA standards (7)');
|
|
126
|
+
recommendations.push('Increase contrast to meet WCAG AAA standards (7:1)');
|
|
123
127
|
}
|
|
124
128
|
if (ratio < 3) {
|
|
125
129
|
recommendations.push('Consider using a different color combination for better readability');
|
|
@@ -128,14 +132,17 @@ export class ColorManager {
|
|
|
128
132
|
return {
|
|
129
133
|
aa,
|
|
130
134
|
aaa,
|
|
131
|
-
contrastRatio,
|
|
132
|
-
recommended
|
|
135
|
+
contrastRatio: ratio,
|
|
136
|
+
recommended: recommendations
|
|
137
|
+
};
|
|
133
138
|
}
|
|
134
139
|
|
|
135
140
|
/**
|
|
136
141
|
* Validate color format
|
|
137
142
|
*/
|
|
138
|
-
static isValidColor(color)
|
|
143
|
+
static isValidColor(color: string): boolean {
|
|
144
|
+
// Check hex format
|
|
145
|
+
if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color)) {
|
|
139
146
|
return true;
|
|
140
147
|
}
|
|
141
148
|
|
|
@@ -146,7 +153,7 @@ export class ColorManager {
|
|
|
146
153
|
return parseInt(r) <= 255 && parseInt(g) <= 255 && parseInt(b) <= 255;
|
|
147
154
|
}
|
|
148
155
|
|
|
149
|
-
// Check hsl format with valid ranges (h, s
|
|
156
|
+
// Check hsl format with valid ranges (h: 0-360, s: 0-100%, l: 0-100%)
|
|
150
157
|
const hslMatch = color.match(/^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)$/);
|
|
151
158
|
if (hslMatch) {
|
|
152
159
|
const [, h, s, l] = hslMatch;
|
|
@@ -165,7 +172,7 @@ export class ColorManager {
|
|
|
165
172
|
/**
|
|
166
173
|
* Convert hex color to HSL
|
|
167
174
|
*/
|
|
168
|
-
private static hexToHsl(hex); s; l} | null {
|
|
175
|
+
private static hexToHsl(hex: string): { h: number; s: number; l: number } | null {
|
|
169
176
|
try {
|
|
170
177
|
// Remove # if present
|
|
171
178
|
hex = hex.replace('#', '');
|
|
@@ -191,23 +198,26 @@ export class ColorManager {
|
|
|
191
198
|
|
|
192
199
|
if (max !== min) {
|
|
193
200
|
const d = max - min;
|
|
194
|
-
s = l > 0.5 ? d / (2 - max - min) );
|
|
201
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
195
202
|
|
|
196
203
|
switch (max) {
|
|
197
|
-
case r
|
|
204
|
+
case r:
|
|
205
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
198
206
|
break;
|
|
199
|
-
case g
|
|
207
|
+
case g:
|
|
208
|
+
h = (b - r) / d + 2;
|
|
200
209
|
break;
|
|
201
|
-
case b
|
|
210
|
+
case b:
|
|
211
|
+
h = (r - g) / d + 4;
|
|
202
212
|
break;
|
|
203
213
|
}
|
|
204
214
|
h /= 6;
|
|
205
215
|
}
|
|
206
216
|
|
|
207
217
|
return {
|
|
208
|
-
h),
|
|
209
|
-
s),
|
|
210
|
-
l)
|
|
218
|
+
h: Math.round(h * 360),
|
|
219
|
+
s: Math.round(s * 100),
|
|
220
|
+
l: Math.round(l * 100)
|
|
211
221
|
};
|
|
212
222
|
} catch {
|
|
213
223
|
return null;
|
|
@@ -217,11 +227,12 @@ export class ColorManager {
|
|
|
217
227
|
/**
|
|
218
228
|
* Convert HSL to hex color
|
|
219
229
|
*/
|
|
220
|
-
private static hslToHex(h, s, l)
|
|
230
|
+
private static hslToHex(h: number, s: number, l: number): string {
|
|
231
|
+
h = h / 360;
|
|
221
232
|
s = s / 100;
|
|
222
233
|
l = l / 100;
|
|
223
234
|
|
|
224
|
-
const hue2rgb = (p, q, t)=> {
|
|
235
|
+
const hue2rgb = (p: number, q: number, t: number): number => {
|
|
225
236
|
if (t < 0) t += 1;
|
|
226
237
|
if (t > 1) t -= 1;
|
|
227
238
|
if (t < 1/6) return p + (q - p) * 6 * t;
|
|
@@ -230,21 +241,21 @@ export class ColorManager {
|
|
|
230
241
|
return p;
|
|
231
242
|
};
|
|
232
243
|
|
|
233
|
-
let r, g, b;
|
|
244
|
+
let r: number, g: number, b: number;
|
|
234
245
|
|
|
235
246
|
if (s === 0) {
|
|
236
247
|
r = g = b = l;
|
|
237
248
|
} else {
|
|
238
|
-
const q = l < 0.5 ? l * (1 + s) ;
|
|
249
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
239
250
|
const p = 2 * l - q;
|
|
240
251
|
r = hue2rgb(p, q, h + 1/3);
|
|
241
252
|
g = hue2rgb(p, q, h);
|
|
242
253
|
b = hue2rgb(p, q, h - 1/3);
|
|
243
254
|
}
|
|
244
255
|
|
|
245
|
-
const toHex = (c)=> {
|
|
256
|
+
const toHex = (c: number): string => {
|
|
246
257
|
const hex = Math.round(c * 255).toString(16);
|
|
247
|
-
return hex.length === 1 ? '0' + hex ;
|
|
258
|
+
return hex.length === 1 ? '0' + hex : hex;
|
|
248
259
|
};
|
|
249
260
|
|
|
250
261
|
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
@@ -254,10 +265,12 @@ export class ColorManager {
|
|
|
254
265
|
* Adjust HSL values
|
|
255
266
|
*/
|
|
256
267
|
private static adjustHsl(
|
|
257
|
-
base; s; l},
|
|
258
|
-
hShift,
|
|
259
|
-
sAdjust,
|
|
260
|
-
lValue
|
|
268
|
+
base: { h: number; s: number; l: number },
|
|
269
|
+
hShift: number,
|
|
270
|
+
sAdjust: number,
|
|
271
|
+
lValue: number
|
|
272
|
+
): string {
|
|
273
|
+
const h = (base.h + hShift) % 360;
|
|
261
274
|
const s = Math.max(0, Math.min(100, base.s + sAdjust));
|
|
262
275
|
const l = Math.max(0, Math.min(100, lValue));
|
|
263
276
|
|
|
@@ -267,7 +280,8 @@ export class ColorManager {
|
|
|
267
280
|
/**
|
|
268
281
|
* Calculate contrast ratio between two colors
|
|
269
282
|
*/
|
|
270
|
-
private static calculateContrastRatio(color1, color2)
|
|
283
|
+
private static calculateContrastRatio(color1: string, color2: string): number {
|
|
284
|
+
const luminance1 = this.calculateLuminance(color1);
|
|
271
285
|
const luminance2 = this.calculateLuminance(color2);
|
|
272
286
|
|
|
273
287
|
const lighter = Math.max(luminance1, luminance2);
|
|
@@ -279,14 +293,15 @@ export class ColorManager {
|
|
|
279
293
|
/**
|
|
280
294
|
* Calculate relative luminance of a color
|
|
281
295
|
*/
|
|
282
|
-
private static calculateLuminance(color)
|
|
296
|
+
private static calculateLuminance(color: string): number {
|
|
297
|
+
const rgb = this.hexToRgb(color);
|
|
283
298
|
if (!rgb) return 0;
|
|
284
299
|
|
|
285
300
|
const { r, g, b } = rgb;
|
|
286
301
|
|
|
287
302
|
const [rs, gs, bs] = [r, g, b].map(c => {
|
|
288
303
|
c = c / 255;
|
|
289
|
-
return c <= 0.03928 ? c / 12.92 ) / 1.055, 2.4);
|
|
304
|
+
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
290
305
|
});
|
|
291
306
|
|
|
292
307
|
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
@@ -295,7 +310,7 @@ export class ColorManager {
|
|
|
295
310
|
/**
|
|
296
311
|
* Convert hex to RGB
|
|
297
312
|
*/
|
|
298
|
-
private static hexToRgb(hex); g; b} | null {
|
|
313
|
+
private static hexToRgb(hex: string): { r: number; g: number; b: number } | null {
|
|
299
314
|
try {
|
|
300
315
|
hex = hex.replace('#', '');
|
|
301
316
|
|
|
@@ -308,9 +323,9 @@ export class ColorManager {
|
|
|
308
323
|
}
|
|
309
324
|
|
|
310
325
|
return {
|
|
311
|
-
r, 2), 16),
|
|
312
|
-
g, 2), 16),
|
|
313
|
-
b, 2), 16)
|
|
326
|
+
r: parseInt(hex.substr(0, 2), 16),
|
|
327
|
+
g: parseInt(hex.substr(2, 2), 16),
|
|
328
|
+
b: parseInt(hex.substr(4, 2), 16)
|
|
314
329
|
};
|
|
315
330
|
} catch {
|
|
316
331
|
return null;
|
|
@@ -320,28 +335,31 @@ export class ColorManager {
|
|
|
320
335
|
/**
|
|
321
336
|
* Generate a high contrast color
|
|
322
337
|
*/
|
|
323
|
-
private static generateContrastColor(baseColor)
|
|
338
|
+
private static generateContrastColor(baseColor: string): string {
|
|
339
|
+
const hsl = this.hexToHsl(baseColor);
|
|
324
340
|
if (!hsl) return '#000000';
|
|
325
341
|
|
|
326
342
|
// Generate a contrasting color by shifting hue by 180 degrees
|
|
327
343
|
const contrastHue = (hsl.h + 180) % 360;
|
|
328
344
|
|
|
329
345
|
// Use high saturation and appropriate lightness for contrast
|
|
330
|
-
return this.hslToHex(contrastHue, 80, hsl.l > 50 ? 20 );
|
|
346
|
+
return this.hslToHex(contrastHue, 80, hsl.l > 50 ? 20 : 80);
|
|
331
347
|
}
|
|
332
348
|
|
|
333
349
|
/**
|
|
334
350
|
* Create a color palette with accessibility information
|
|
335
351
|
*/
|
|
336
352
|
static createColorPalette(
|
|
337
|
-
name,
|
|
338
|
-
baseColor,
|
|
339
|
-
description,
|
|
340
|
-
tags] = []
|
|
341
|
-
)
|
|
353
|
+
name: string,
|
|
354
|
+
baseColor: string,
|
|
355
|
+
description: string,
|
|
356
|
+
tags: string[] = []
|
|
357
|
+
): ColorPalette {
|
|
358
|
+
const colors = this.generateColorScale({
|
|
342
359
|
baseColor,
|
|
343
|
-
generateShades,
|
|
344
|
-
generateContrast
|
|
360
|
+
generateShades: true,
|
|
361
|
+
generateContrast: true
|
|
362
|
+
});
|
|
345
363
|
|
|
346
364
|
const accessibility = this.checkColorContrast(colors[500], '#ffffff');
|
|
347
365
|
|
|
@@ -350,8 +368,8 @@ export class ColorManager {
|
|
|
350
368
|
description,
|
|
351
369
|
colors,
|
|
352
370
|
accessibility,
|
|
353
|
-
usage, 'accent', 'brand'],
|
|
354
|
-
tags, 'generated', 'accessible']
|
|
371
|
+
usage: ['primary', 'accent', 'brand'],
|
|
372
|
+
tags: [...tags, 'generated', 'accessible']
|
|
355
373
|
};
|
|
356
374
|
}
|
|
357
375
|
}
|
|
@@ -2,84 +2,103 @@ import { createTheme, overrideTheme, PartialThemeConfig } from '../inheritance';
|
|
|
2
2
|
import { stanDesignTheme } from '../base-themes';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Example
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
5
|
+
* Example: Dark Theme using inheritance
|
|
6
|
+
* This theme overrides colors for a dark mode while keeping other properties
|
|
7
|
+
*/
|
|
8
|
+
const darkThemeConfig: PartialThemeConfig = {
|
|
9
|
+
meta: {
|
|
10
|
+
name: 'Dark Mode',
|
|
11
|
+
description: 'Dark variant with inheritance from default theme',
|
|
12
|
+
author: 'Theme Examples',
|
|
13
|
+
version: '1.0.0',
|
|
14
|
+
category: 'custom',
|
|
15
|
+
tags: ['dark', 'night', 'inheritance'],
|
|
16
|
+
preview: '/themes/dark-preview.png',
|
|
17
|
+
createdAt: '2024-12-01T00:00:00.000Z',
|
|
18
|
+
updatedAt: '2024-12-01T00:00:00.000Z'
|
|
19
|
+
},
|
|
20
|
+
colors: {
|
|
21
|
+
primary: {
|
|
22
|
+
50: '#0f172a',
|
|
23
|
+
100: '#1e293b',
|
|
24
|
+
200: '#334155',
|
|
25
|
+
300: '#475569',
|
|
26
|
+
400: '#64748b',
|
|
27
|
+
500: '#94a3b8',
|
|
28
|
+
600: '#cbd5e1',
|
|
29
|
+
700: '#e2e8f0',
|
|
30
|
+
800: '#f1f5f9',
|
|
31
|
+
900: '#f8fafc',
|
|
32
|
+
'500-rgb': '148, 163, 184',
|
|
33
|
+
'600-rgb': '203, 213, 225',
|
|
34
|
+
'700-rgb': '226, 232, 240'
|
|
35
|
+
},
|
|
36
|
+
secondary: {
|
|
37
|
+
50: '#f8fafc',
|
|
38
|
+
100: '#f1f5f9',
|
|
39
|
+
200: '#e2e8f0',
|
|
40
|
+
300: '#cbd5e1',
|
|
41
|
+
400: '#94a3b8',
|
|
42
|
+
500: '#64748b',
|
|
43
|
+
600: '#475569',
|
|
44
|
+
700: '#334155',
|
|
45
|
+
800: '#1e293b',
|
|
46
|
+
900: '#0f172a'
|
|
47
|
+
},
|
|
48
|
+
semantic: {
|
|
49
|
+
success: '#10b981',
|
|
50
|
+
warning: '#f59e0b',
|
|
51
|
+
error: '#ef4444',
|
|
52
|
+
info: '#3b82f6',
|
|
53
|
+
successRgb: '16, 185, 129',
|
|
54
|
+
warningRgb: '245, 158, 11',
|
|
55
|
+
errorRgb: '239, 68, 68',
|
|
56
|
+
infoRgb: '59, 130, 246',
|
|
57
|
+
'success-rgb': '16, 185, 129',
|
|
58
|
+
'warning-rgb': '245, 158, 11',
|
|
59
|
+
'error-rgb': '239, 68, 68',
|
|
60
|
+
'info-rgb': '59, 130, 246'
|
|
61
|
+
},
|
|
62
|
+
neutral: {
|
|
63
|
+
50: '#fafafa',
|
|
64
|
+
100: '#f5f5f5',
|
|
65
|
+
200: '#e5e5e5',
|
|
66
|
+
300: '#d4d4d4',
|
|
67
|
+
400: '#a3a3a3',
|
|
68
|
+
500: '#737373',
|
|
69
|
+
600: '#525252',
|
|
70
|
+
700: '#404040',
|
|
71
|
+
800: '#262626',
|
|
72
|
+
900: '#171717'
|
|
73
|
+
},
|
|
74
|
+
surface: {
|
|
75
|
+
background: '#0f172a',
|
|
76
|
+
surface: '#1e293b',
|
|
77
|
+
border: '#334155',
|
|
78
|
+
divider: '#475569'
|
|
28
79
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
successRgb, 185, 129',
|
|
44
|
-
warningRgb, 158, 11',
|
|
45
|
-
errorRgb, 68, 68',
|
|
46
|
-
infoRgb, 130, 246',
|
|
47
|
-
'success-rgb', 185, 129',
|
|
48
|
-
'warning-rgb', 158, 11',
|
|
49
|
-
'error-rgb', 68, 68',
|
|
50
|
-
'info-rgb', 130, 246'
|
|
80
|
+
text: {
|
|
81
|
+
primary: '#f8fafc',
|
|
82
|
+
secondary: '#e2e8f0',
|
|
83
|
+
muted: '#cbd5e1',
|
|
84
|
+
inverse: '#0f172a',
|
|
85
|
+
onPrimary: '#0f172a',
|
|
86
|
+
onSecondary: '#0f172a',
|
|
87
|
+
onSurface: '#f8fafc'
|
|
88
|
+
},
|
|
89
|
+
interactive: {
|
|
90
|
+
hover: '#1e293b',
|
|
91
|
+
active: '#334155',
|
|
92
|
+
focus: '#94a3b8',
|
|
93
|
+
disabled: '#475569'
|
|
51
94
|
},
|
|
52
|
-
neutral,
|
|
53
|
-
100,
|
|
54
|
-
200,
|
|
55
|
-
300,
|
|
56
|
-
400,
|
|
57
|
-
500,
|
|
58
|
-
600,
|
|
59
|
-
700,
|
|
60
|
-
800,
|
|
61
|
-
900},
|
|
62
|
-
surface,
|
|
63
|
-
surface,
|
|
64
|
-
border,
|
|
65
|
-
divider},
|
|
66
|
-
text,
|
|
67
|
-
secondary,
|
|
68
|
-
muted,
|
|
69
|
-
inverse,
|
|
70
|
-
onPrimary,
|
|
71
|
-
onSecondary,
|
|
72
|
-
onSurface},
|
|
73
|
-
interactive,
|
|
74
|
-
active,
|
|
75
|
-
focus,
|
|
76
|
-
disabled},
|
|
77
95
|
// Additional dark mode colors
|
|
78
|
-
'bg-primary',
|
|
79
|
-
'bg-secondary',
|
|
80
|
-
'surface-bg',
|
|
81
|
-
'text-primary',
|
|
82
|
-
'text-secondary'
|
|
96
|
+
'bg-primary': '#0f172a',
|
|
97
|
+
'bg-secondary': '#1e293b',
|
|
98
|
+
'surface-bg': '#1e293b',
|
|
99
|
+
'text-primary': '#f8fafc',
|
|
100
|
+
'text-secondary': '#e2e8f0'
|
|
101
|
+
}
|
|
83
102
|
// All other properties (fonts, navigation, spacing, etc.) inherit from default
|
|
84
103
|
};
|
|
85
104
|
|
|
@@ -89,36 +108,47 @@ import { stanDesignTheme } from '../base-themes';
|
|
|
89
108
|
export const darkTheme = createTheme(darkThemeConfig);
|
|
90
109
|
|
|
91
110
|
/**
|
|
92
|
-
* Example) to create a dark variant
|
|
111
|
+
* Example: Override an existing theme (Stan Design) to create a dark variant
|
|
93
112
|
*/
|
|
94
113
|
export const stanDesignDarkTheme = overrideTheme(stanDesignTheme, {
|
|
95
|
-
meta
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
114
|
+
meta: {
|
|
115
|
+
name: 'Stan Design Dark',
|
|
116
|
+
description: 'Dark variant of Stan Design theme',
|
|
117
|
+
author: 'Theme Examples',
|
|
118
|
+
version: '1.0.0',
|
|
119
|
+
category: 'custom',
|
|
120
|
+
tags: ['dark', 'stan-design', 'professional'],
|
|
121
|
+
preview: '/themes/stan-design-dark-preview.png',
|
|
122
|
+
createdAt: '2024-12-01T00:00:00.000Z',
|
|
123
|
+
updatedAt: '2024-12-01T00:00:00.000Z'
|
|
124
|
+
},
|
|
125
|
+
colors: darkThemeConfig.colors
|
|
126
|
+
});
|
|
105
127
|
|
|
106
128
|
/**
|
|
107
|
-
* Example
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
129
|
+
* Example: Partial override for quick customizations
|
|
130
|
+
*/
|
|
131
|
+
export const quickDarkVariant = overrideTheme(stanDesignTheme, {
|
|
132
|
+
colors: {
|
|
133
|
+
primary: stanDesignTheme.colors.primary,
|
|
134
|
+
secondary: stanDesignTheme.colors.secondary,
|
|
135
|
+
semantic: stanDesignTheme.colors.semantic,
|
|
136
|
+
neutral: stanDesignTheme.colors.neutral,
|
|
137
|
+
surface: {
|
|
138
|
+
background: '#0f172a',
|
|
139
|
+
surface: '#1e293b',
|
|
140
|
+
border: '#334155',
|
|
141
|
+
divider: '#475569'
|
|
142
|
+
},
|
|
143
|
+
text: {
|
|
144
|
+
primary: '#f8fafc',
|
|
145
|
+
secondary: '#e2e8f0',
|
|
146
|
+
muted: '#cbd5e1',
|
|
147
|
+
inverse: '#0f172a',
|
|
148
|
+
onPrimary: '#0f172a',
|
|
149
|
+
onSecondary: '#0f172a',
|
|
150
|
+
onSurface: '#f8fafc'
|
|
151
|
+
},
|
|
152
|
+
interactive: stanDesignTheme.colors.interactive
|
|
153
|
+
}
|
|
124
154
|
});
|