@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.9 → 0.2.11
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 +0 -1
- package/dist/components/ui/navigation/index.js +0 -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 +0 -2
- package/dist/components/ui/overlay/index.js +0 -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 +157 -281
- package/dist/index.js +157 -281
- 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/index.esm.js +1 -1
- package/dist/themes/index.js +1 -1
- 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 +1 -2
- package/dist/tokens/index.js +1 -2
- 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
|
@@ -2,19 +2,21 @@ import { ColorThemeConfig, MultiThemeConfig } from './types';
|
|
|
2
2
|
|
|
3
3
|
// High contrast theme configuration
|
|
4
4
|
export interface HighContrastThemeConfig extends MultiThemeConfig {
|
|
5
|
-
highContrast
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
highContrast: {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
contrastRatio: number; // Target contrast ratio (WCAG AAA = 7.0)
|
|
8
|
+
enhancedColors: boolean; // Use enhanced color palette
|
|
9
|
+
borderEmphasis: boolean; // Add borders for better definition
|
|
10
|
+
textEmphasis: boolean; // Enhanced text styling
|
|
11
|
+
focusIndicators: boolean; // Enhanced focus indicators
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
// High contrast color utilities
|
|
15
16
|
export class HighContrastColors {
|
|
16
17
|
// WCAG contrast ratio calculation
|
|
17
|
-
static calculateContrastRatio(foreground, background)
|
|
18
|
+
static calculateContrastRatio(foreground: string, background: string): number {
|
|
19
|
+
const fgLuminance = this.getLuminance(foreground);
|
|
18
20
|
const bgLuminance = this.getLuminance(background);
|
|
19
21
|
|
|
20
22
|
const lighter = Math.max(fgLuminance, bgLuminance);
|
|
@@ -24,7 +26,8 @@ export class HighContrastColors {
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
// Get relative luminance of a color
|
|
27
|
-
private static getLuminance(color)
|
|
29
|
+
private static getLuminance(color: string): number {
|
|
30
|
+
const rgb = this.hexToRgb(color);
|
|
28
31
|
if (!rgb) return 0;
|
|
29
32
|
|
|
30
33
|
const { r, g, b } = rgb;
|
|
@@ -33,35 +36,36 @@ export class HighContrastColors {
|
|
|
33
36
|
const gsRGB = g / 255;
|
|
34
37
|
const bsRGB = b / 255;
|
|
35
38
|
|
|
36
|
-
const rL = rsRGB <= 0.03928 ? rsRGB / 12.92 ) / 1.055, 2.4);
|
|
37
|
-
const gL = gsRGB <= 0.03928 ? gsRGB / 12.92 ) / 1.055, 2.4);
|
|
38
|
-
const bL = bsRGB <= 0.03928 ? bsRGB / 12.92 ) / 1.055, 2.4);
|
|
39
|
+
const rL = rsRGB <= 0.03928 ? rsRGB / 12.92 : Math.pow((rsRGB + 0.055) / 1.055, 2.4);
|
|
40
|
+
const gL = gsRGB <= 0.03928 ? gsRGB / 12.92 : Math.pow((gsRGB + 0.055) / 1.055, 2.4);
|
|
41
|
+
const bL = bsRGB <= 0.03928 ? bsRGB / 12.92 : Math.pow((bsRGB + 0.055) / 1.055, 2.4);
|
|
39
42
|
|
|
40
43
|
return 0.2126 * rL + 0.7152 * gL + 0.0722 * bL;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
// Convert hex color to RGB
|
|
44
|
-
private static hexToRgb(hex); g; b} | null {
|
|
47
|
+
private static hexToRgb(hex: string): { r: number; g: number; b: number } | null {
|
|
45
48
|
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
46
49
|
if (!result) return null;
|
|
47
50
|
|
|
48
51
|
return {
|
|
49
|
-
r], 16),
|
|
50
|
-
g], 16),
|
|
51
|
-
b], 16)
|
|
52
|
+
r: parseInt(result[1], 16),
|
|
53
|
+
g: parseInt(result[2], 16),
|
|
54
|
+
b: parseInt(result[3], 16)
|
|
52
55
|
};
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
// Check if contrast ratio meets WCAG requirements
|
|
56
|
-
static meetsWCAGRequirements(foreground, background, level= 'AA')
|
|
57
|
-
const
|
|
59
|
+
static meetsWCAGRequirements(foreground: string, background: string, level: 'AA' | 'AAA' = 'AA'): boolean {
|
|
60
|
+
const ratio = this.calculateContrastRatio(foreground, background);
|
|
61
|
+
const requiredRatio = level === 'AA' ? 4.5 : 7.0;
|
|
58
62
|
|
|
59
63
|
return ratio >= requiredRatio;
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
// Generate high contrast color variants
|
|
63
|
-
static generateHighContrastVariants(baseColor, backgroundColor, targetRatio= 7.0)] {
|
|
64
|
-
const variants] = [];
|
|
67
|
+
static generateHighContrastVariants(baseColor: string, backgroundColor: string, targetRatio: number = 7.0): string[] {
|
|
68
|
+
const variants: string[] = [];
|
|
65
69
|
|
|
66
70
|
// Generate lighter and darker variants
|
|
67
71
|
for (let i = 1; i <= 10; i++) {
|
|
@@ -81,7 +85,8 @@ export class HighContrastColors {
|
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
// Adjust color brightness
|
|
84
|
-
private static adjustColorBrightness(color, factor)
|
|
88
|
+
private static adjustColorBrightness(color: string, factor: number): string {
|
|
89
|
+
const rgb = this.hexToRgb(color);
|
|
85
90
|
if (!rgb) return color;
|
|
86
91
|
|
|
87
92
|
const { r, g, b } = rgb;
|
|
@@ -94,7 +99,8 @@ export class HighContrastColors {
|
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
// Find best high contrast color
|
|
97
|
-
static findBestHighContrastColor(foreground, background, targetRatio= 7.0)
|
|
102
|
+
static findBestHighContrastColor(foreground: string, background: string, targetRatio: number = 7.0): string {
|
|
103
|
+
const ratio = this.calculateContrastRatio(foreground, background);
|
|
98
104
|
|
|
99
105
|
if (ratio >= targetRatio) {
|
|
100
106
|
return foreground;
|
|
@@ -120,28 +126,29 @@ export class HighContrastColors {
|
|
|
120
126
|
const blackRatio = this.calculateContrastRatio('#000000', background);
|
|
121
127
|
const whiteRatio = this.calculateContrastRatio('#FFFFFF', background);
|
|
122
128
|
|
|
123
|
-
return blackRatio > whiteRatio ? '#000000' ;
|
|
129
|
+
return blackRatio > whiteRatio ? '#000000' : '#FFFFFF';
|
|
124
130
|
}
|
|
125
131
|
}
|
|
126
132
|
|
|
127
133
|
// High contrast theme manager
|
|
128
134
|
export class HighContrastThemeManager {
|
|
129
|
-
private isEnabled= false;
|
|
130
|
-
private targetContrastRatio= 7.0; // WCAG AAA
|
|
131
|
-
private enhancedColors= true;
|
|
132
|
-
private borderEmphasis= true;
|
|
133
|
-
private textEmphasis= true;
|
|
134
|
-
private focusIndicators= true;
|
|
135
|
-
private originalTheme= null;
|
|
136
|
-
private highContrastTheme= null;
|
|
135
|
+
private isEnabled: boolean = false;
|
|
136
|
+
private targetContrastRatio: number = 7.0; // WCAG AAA
|
|
137
|
+
private enhancedColors: boolean = true;
|
|
138
|
+
private borderEmphasis: boolean = true;
|
|
139
|
+
private textEmphasis: boolean = true;
|
|
140
|
+
private focusIndicators: boolean = true;
|
|
141
|
+
private originalTheme: MultiThemeConfig | null = null;
|
|
142
|
+
private highContrastTheme: HighContrastThemeConfig | null = null;
|
|
137
143
|
|
|
138
144
|
constructor() {
|
|
139
145
|
this.initializeSystemPreference();
|
|
140
146
|
}
|
|
141
147
|
|
|
142
148
|
// Initialize system preference detection
|
|
143
|
-
private initializeSystemPreference()
|
|
144
|
-
|
|
149
|
+
private initializeSystemPreference(): void {
|
|
150
|
+
if (typeof window !== 'undefined' && window.matchMedia) {
|
|
151
|
+
const highContrastQuery = window.matchMedia('(prefers-contrast: high)');
|
|
145
152
|
this.isEnabled = highContrastQuery.matches;
|
|
146
153
|
|
|
147
154
|
highContrastQuery.addEventListener('change', (e) => {
|
|
@@ -152,17 +159,20 @@ export class HighContrastThemeManager {
|
|
|
152
159
|
}
|
|
153
160
|
|
|
154
161
|
// Enable high contrast mode
|
|
155
|
-
enable()
|
|
162
|
+
enable(): void {
|
|
163
|
+
this.isEnabled = true;
|
|
156
164
|
this.applyHighContrast();
|
|
157
165
|
}
|
|
158
166
|
|
|
159
167
|
// Disable high contrast mode
|
|
160
|
-
disable()
|
|
168
|
+
disable(): void {
|
|
169
|
+
this.isEnabled = false;
|
|
161
170
|
this.removeHighContrast();
|
|
162
171
|
}
|
|
163
172
|
|
|
164
173
|
// Toggle high contrast mode
|
|
165
|
-
toggle()
|
|
174
|
+
toggle(): void {
|
|
175
|
+
if (this.isEnabled) {
|
|
166
176
|
this.disable();
|
|
167
177
|
} else {
|
|
168
178
|
this.enable();
|
|
@@ -170,50 +180,58 @@ export class HighContrastThemeManager {
|
|
|
170
180
|
}
|
|
171
181
|
|
|
172
182
|
// Check if high contrast is enabled
|
|
173
|
-
isHighContrastEnabled()
|
|
183
|
+
isHighContrastEnabled(): boolean {
|
|
184
|
+
return this.isEnabled;
|
|
174
185
|
}
|
|
175
186
|
|
|
176
187
|
// Set target contrast ratio
|
|
177
|
-
setTargetContrastRatio(ratio)
|
|
188
|
+
setTargetContrastRatio(ratio: number): void {
|
|
189
|
+
this.targetContrastRatio = Math.max(1.0, Math.min(21.0, ratio));
|
|
178
190
|
if (this.isEnabled) {
|
|
179
191
|
this.applyHighContrast();
|
|
180
192
|
}
|
|
181
193
|
}
|
|
182
194
|
|
|
183
195
|
// Get current target contrast ratio
|
|
184
|
-
getTargetContrastRatio()
|
|
196
|
+
getTargetContrastRatio(): number {
|
|
197
|
+
return this.targetContrastRatio;
|
|
185
198
|
}
|
|
186
199
|
|
|
187
200
|
// Enable/disable enhanced colors
|
|
188
|
-
setEnhancedColors(enabled)
|
|
201
|
+
setEnhancedColors(enabled: boolean): void {
|
|
202
|
+
this.enhancedColors = enabled;
|
|
189
203
|
if (this.isEnabled) {
|
|
190
204
|
this.applyHighContrast();
|
|
191
205
|
}
|
|
192
206
|
}
|
|
193
207
|
|
|
194
208
|
// Enable/disable border emphasis
|
|
195
|
-
setBorderEmphasis(enabled)
|
|
209
|
+
setBorderEmphasis(enabled: boolean): void {
|
|
210
|
+
this.borderEmphasis = enabled;
|
|
196
211
|
if (this.isEnabled) {
|
|
197
212
|
this.applyHighContrast();
|
|
198
213
|
}
|
|
199
214
|
}
|
|
200
215
|
|
|
201
216
|
// Enable/disable text emphasis
|
|
202
|
-
setTextEmphasis(enabled)
|
|
217
|
+
setTextEmphasis(enabled: boolean): void {
|
|
218
|
+
this.textEmphasis = enabled;
|
|
203
219
|
if (this.isEnabled) {
|
|
204
220
|
this.applyHighContrast();
|
|
205
221
|
}
|
|
206
222
|
}
|
|
207
223
|
|
|
208
224
|
// Enable/disable focus indicators
|
|
209
|
-
setFocusIndicators(enabled)
|
|
225
|
+
setFocusIndicators(enabled: boolean): void {
|
|
226
|
+
this.focusIndicators = enabled;
|
|
210
227
|
if (this.isEnabled) {
|
|
211
228
|
this.applyHighContrast();
|
|
212
229
|
}
|
|
213
230
|
}
|
|
214
231
|
|
|
215
232
|
// Apply high contrast to current theme
|
|
216
|
-
applyHighContrast()
|
|
233
|
+
applyHighContrast(): void {
|
|
234
|
+
if (!this.isEnabled) return;
|
|
217
235
|
|
|
218
236
|
// Store original theme if not already stored
|
|
219
237
|
if (!this.originalTheme) {
|
|
@@ -234,7 +252,8 @@ export class HighContrastThemeManager {
|
|
|
234
252
|
}
|
|
235
253
|
|
|
236
254
|
// Remove high contrast mode
|
|
237
|
-
removeHighContrast()
|
|
255
|
+
removeHighContrast(): void {
|
|
256
|
+
if (!this.isEnabled) return;
|
|
238
257
|
|
|
239
258
|
// Remove high contrast CSS classes
|
|
240
259
|
document.documentElement.classList.remove('high-contrast');
|
|
@@ -249,14 +268,17 @@ export class HighContrastThemeManager {
|
|
|
249
268
|
}
|
|
250
269
|
|
|
251
270
|
// Generate high contrast theme from base theme
|
|
252
|
-
private generateHighContrastTheme(baseTheme)
|
|
271
|
+
private generateHighContrastTheme(baseTheme: MultiThemeConfig): HighContrastThemeConfig {
|
|
272
|
+
const highContrastTheme: HighContrastThemeConfig = {
|
|
253
273
|
...baseTheme,
|
|
254
|
-
highContrast
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
274
|
+
highContrast: {
|
|
275
|
+
enabled: true,
|
|
276
|
+
contrastRatio: this.targetContrastRatio,
|
|
277
|
+
enhancedColors: this.enhancedColors,
|
|
278
|
+
borderEmphasis: this.borderEmphasis,
|
|
279
|
+
textEmphasis: this.textEmphasis,
|
|
280
|
+
focusIndicators: this.focusIndicators
|
|
281
|
+
}
|
|
260
282
|
};
|
|
261
283
|
|
|
262
284
|
// Enhance colors for high contrast
|
|
@@ -279,21 +301,25 @@ export class HighContrastThemeManager {
|
|
|
279
301
|
}
|
|
280
302
|
|
|
281
303
|
// Enhance colors for high contrast
|
|
282
|
-
private enhanceColorsForHighContrast(colors)
|
|
304
|
+
private enhanceColorsForHighContrast(colors: ColorThemeConfig): ColorThemeConfig {
|
|
305
|
+
const enhancedColors: ColorThemeConfig = { ...colors };
|
|
283
306
|
|
|
284
307
|
// Enhance primary colors
|
|
285
308
|
if (enhancedColors.primary) {
|
|
286
309
|
enhancedColors.primary = {
|
|
287
310
|
...enhancedColors.primary,
|
|
288
|
-
500
|
|
311
|
+
500: HighContrastColors.findBestHighContrastColor(
|
|
312
|
+
enhancedColors.primary[500],
|
|
289
313
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
290
314
|
this.targetContrastRatio
|
|
291
315
|
),
|
|
292
|
-
light
|
|
316
|
+
light: HighContrastColors.findBestHighContrastColor(
|
|
317
|
+
enhancedColors.primary.light || enhancedColors.primary[100],
|
|
293
318
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
294
319
|
this.targetContrastRatio
|
|
295
320
|
),
|
|
296
|
-
dark
|
|
321
|
+
dark: HighContrastColors.findBestHighContrastColor(
|
|
322
|
+
enhancedColors.primary.dark || enhancedColors.primary[900],
|
|
297
323
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
298
324
|
this.targetContrastRatio
|
|
299
325
|
)
|
|
@@ -304,15 +330,18 @@ export class HighContrastThemeManager {
|
|
|
304
330
|
if (enhancedColors.secondary) {
|
|
305
331
|
enhancedColors.secondary = {
|
|
306
332
|
...enhancedColors.secondary,
|
|
307
|
-
500
|
|
333
|
+
500: HighContrastColors.findBestHighContrastColor(
|
|
334
|
+
enhancedColors.secondary[500],
|
|
308
335
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
309
336
|
this.targetContrastRatio
|
|
310
337
|
),
|
|
311
|
-
light
|
|
338
|
+
light: HighContrastColors.findBestHighContrastColor(
|
|
339
|
+
enhancedColors.secondary.light || enhancedColors.secondary[100],
|
|
312
340
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
313
341
|
this.targetContrastRatio
|
|
314
342
|
),
|
|
315
|
-
dark
|
|
343
|
+
dark: HighContrastColors.findBestHighContrastColor(
|
|
344
|
+
enhancedColors.secondary.dark || enhancedColors.secondary[900],
|
|
316
345
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
317
346
|
this.targetContrastRatio
|
|
318
347
|
)
|
|
@@ -323,7 +352,8 @@ export class HighContrastThemeManager {
|
|
|
323
352
|
if (enhancedColors.semantic?.error) {
|
|
324
353
|
enhancedColors.semantic = {
|
|
325
354
|
...enhancedColors.semantic,
|
|
326
|
-
error
|
|
355
|
+
error: HighContrastColors.findBestHighContrastColor(
|
|
356
|
+
enhancedColors.semantic.error,
|
|
327
357
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
328
358
|
this.targetContrastRatio
|
|
329
359
|
)
|
|
@@ -334,7 +364,8 @@ export class HighContrastThemeManager {
|
|
|
334
364
|
if (enhancedColors.semantic?.warning) {
|
|
335
365
|
enhancedColors.semantic = {
|
|
336
366
|
...enhancedColors.semantic,
|
|
337
|
-
warning
|
|
367
|
+
warning: HighContrastColors.findBestHighContrastColor(
|
|
368
|
+
enhancedColors.semantic.warning,
|
|
338
369
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
339
370
|
this.targetContrastRatio
|
|
340
371
|
)
|
|
@@ -345,7 +376,8 @@ export class HighContrastThemeManager {
|
|
|
345
376
|
if (enhancedColors.semantic?.success) {
|
|
346
377
|
enhancedColors.semantic = {
|
|
347
378
|
...enhancedColors.semantic,
|
|
348
|
-
success
|
|
379
|
+
success: HighContrastColors.findBestHighContrastColor(
|
|
380
|
+
enhancedColors.semantic.success,
|
|
349
381
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
350
382
|
this.targetContrastRatio
|
|
351
383
|
)
|
|
@@ -356,7 +388,8 @@ export class HighContrastThemeManager {
|
|
|
356
388
|
if (enhancedColors.semantic?.info) {
|
|
357
389
|
enhancedColors.semantic = {
|
|
358
390
|
...enhancedColors.semantic,
|
|
359
|
-
info
|
|
391
|
+
info: HighContrastColors.findBestHighContrastColor(
|
|
392
|
+
enhancedColors.semantic.info,
|
|
360
393
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
361
394
|
this.targetContrastRatio
|
|
362
395
|
)
|
|
@@ -367,11 +400,13 @@ export class HighContrastThemeManager {
|
|
|
367
400
|
if (enhancedColors.text) {
|
|
368
401
|
enhancedColors.text = {
|
|
369
402
|
...enhancedColors.text,
|
|
370
|
-
primary
|
|
403
|
+
primary: HighContrastColors.findBestHighContrastColor(
|
|
404
|
+
enhancedColors.text.primary,
|
|
371
405
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
372
406
|
this.targetContrastRatio
|
|
373
407
|
),
|
|
374
|
-
secondary
|
|
408
|
+
secondary: HighContrastColors.findBestHighContrastColor(
|
|
409
|
+
enhancedColors.text.secondary,
|
|
375
410
|
enhancedColors.surface?.background || '#FFFFFF',
|
|
376
411
|
this.targetContrastRatio
|
|
377
412
|
)
|
|
@@ -382,17 +417,18 @@ export class HighContrastThemeManager {
|
|
|
382
417
|
}
|
|
383
418
|
|
|
384
419
|
// Enhance fonts for high contrast
|
|
385
|
-
private enhanceFontsForHighContrast(fonts)
|
|
420
|
+
private enhanceFontsForHighContrast(fonts: any): any {
|
|
421
|
+
const enhancedFonts = { ...fonts };
|
|
386
422
|
|
|
387
423
|
// Increase font weights for better visibility
|
|
388
424
|
if (enhancedFonts.primary?.weights) {
|
|
389
|
-
enhancedFonts.primary.weights = enhancedFonts.primary.weights.map((weight) =>
|
|
425
|
+
enhancedFonts.primary.weights = enhancedFonts.primary.weights.map((weight: number) =>
|
|
390
426
|
Math.max(400, weight)
|
|
391
427
|
);
|
|
392
428
|
}
|
|
393
429
|
|
|
394
430
|
if (enhancedFonts.body?.weights) {
|
|
395
|
-
enhancedFonts.body.weights = enhancedFonts.body.weights.map((weight) =>
|
|
431
|
+
enhancedFonts.body.weights = enhancedFonts.body.weights.map((weight: number) =>
|
|
396
432
|
Math.max(400, weight)
|
|
397
433
|
);
|
|
398
434
|
}
|
|
@@ -401,9 +437,9 @@ export class HighContrastThemeManager {
|
|
|
401
437
|
if (enhancedFonts.primary?.letterSpacing) {
|
|
402
438
|
enhancedFonts.primary.letterSpacing = {
|
|
403
439
|
...enhancedFonts.primary.letterSpacing,
|
|
404
|
-
tight, enhancedFonts.primary.letterSpacing.tight || 0.025),
|
|
405
|
-
normal, enhancedFonts.primary.letterSpacing.normal || 0),
|
|
406
|
-
wide, enhancedFonts.primary.letterSpacing.wide || 0.025)
|
|
440
|
+
tight: Math.max(0.025, enhancedFonts.primary.letterSpacing.tight || 0.025),
|
|
441
|
+
normal: Math.max(0, enhancedFonts.primary.letterSpacing.normal || 0),
|
|
442
|
+
wide: Math.max(0.025, enhancedFonts.primary.letterSpacing.wide || 0.025)
|
|
407
443
|
};
|
|
408
444
|
}
|
|
409
445
|
|
|
@@ -411,7 +447,8 @@ export class HighContrastThemeManager {
|
|
|
411
447
|
}
|
|
412
448
|
|
|
413
449
|
// Enhance spacing for high contrast
|
|
414
|
-
private enhanceSpacingForHighContrast(spacing)
|
|
450
|
+
private enhanceSpacingForHighContrast(spacing: any): any {
|
|
451
|
+
const enhancedSpacing = { ...spacing };
|
|
415
452
|
|
|
416
453
|
// Increase focus ring spacing
|
|
417
454
|
if (enhancedSpacing.focusRing) {
|
|
@@ -422,9 +459,9 @@ export class HighContrastThemeManager {
|
|
|
422
459
|
if (enhancedSpacing.borderWidth) {
|
|
423
460
|
enhancedSpacing.borderWidth = {
|
|
424
461
|
...enhancedSpacing.borderWidth,
|
|
425
|
-
thin, enhancedSpacing.borderWidth.thin || 1),
|
|
426
|
-
normal, enhancedSpacing.borderWidth.normal || 2),
|
|
427
|
-
thick, enhancedSpacing.borderWidth.thick || 3)
|
|
462
|
+
thin: Math.max(1, enhancedSpacing.borderWidth.thin || 1),
|
|
463
|
+
normal: Math.max(2, enhancedSpacing.borderWidth.normal || 2),
|
|
464
|
+
thick: Math.max(3, enhancedSpacing.borderWidth.thick || 3)
|
|
428
465
|
};
|
|
429
466
|
}
|
|
430
467
|
|
|
@@ -432,7 +469,8 @@ export class HighContrastThemeManager {
|
|
|
432
469
|
}
|
|
433
470
|
|
|
434
471
|
// Enhance shadows for high contrast
|
|
435
|
-
private enhanceShadowsForHighContrast(shadows)
|
|
472
|
+
private enhanceShadowsForHighContrast(shadows: any): any {
|
|
473
|
+
const enhancedShadows = { ...shadows };
|
|
436
474
|
|
|
437
475
|
// Increase shadow intensity
|
|
438
476
|
if (enhancedShadows.intensity) {
|
|
@@ -448,21 +486,23 @@ export class HighContrastThemeManager {
|
|
|
448
486
|
}
|
|
449
487
|
|
|
450
488
|
// Apply high contrast styles
|
|
451
|
-
private applyHighContrastStyles()
|
|
489
|
+
private applyHighContrastStyles(): void {
|
|
490
|
+
const style = document.createElement('style');
|
|
452
491
|
style.id = 'high-contrast-styles';
|
|
453
492
|
|
|
454
493
|
style.textContent = `
|
|
455
494
|
.high-contrast {
|
|
456
|
-
--focus-ring-width;
|
|
457
|
-
--focus-ring-color;
|
|
458
|
-
--focus-ring-offset;
|
|
459
|
-
--border-emphasis;
|
|
460
|
-
--text-emphasis;
|
|
461
|
-
--shadow-emphasis, 0, 0, 0.8);
|
|
495
|
+
--focus-ring-width: 3px;
|
|
496
|
+
--focus-ring-color: #FFFFFF;
|
|
497
|
+
--focus-ring-offset: 1px;
|
|
498
|
+
--border-emphasis: 2px solid;
|
|
499
|
+
--text-emphasis: 700;
|
|
500
|
+
--shadow-emphasis: 0 4px 8px rgba(0, 0, 0, 0.8);
|
|
462
501
|
}
|
|
463
502
|
|
|
464
|
-
.high-contrast
|
|
465
|
-
outline-
|
|
503
|
+
.high-contrast *:focus {
|
|
504
|
+
outline: var(--focus-ring-width) solid var(--focus-ring-color) !important;
|
|
505
|
+
outline-offset: var(--focus-ring-offset) !important;
|
|
466
506
|
}
|
|
467
507
|
|
|
468
508
|
.high-contrast button,
|
|
@@ -470,7 +510,7 @@ export class HighContrastThemeManager {
|
|
|
470
510
|
.high-contrast select,
|
|
471
511
|
.high-contrast textarea,
|
|
472
512
|
.high-contrast a {
|
|
473
|
-
border) !important;
|
|
513
|
+
border: var(--border-emphasis) !important;
|
|
474
514
|
}
|
|
475
515
|
|
|
476
516
|
.high-contrast h1,
|
|
@@ -479,15 +519,15 @@ export class HighContrastThemeManager {
|
|
|
479
519
|
.high-contrast h4,
|
|
480
520
|
.high-contrast h5,
|
|
481
521
|
.high-contrast h6 {
|
|
482
|
-
font-weight) !important;
|
|
522
|
+
font-weight: var(--text-emphasis) !important;
|
|
483
523
|
}
|
|
484
524
|
|
|
485
525
|
.high-contrast .card,
|
|
486
526
|
.high-contrast .modal,
|
|
487
527
|
.high-contrast .tooltip,
|
|
488
528
|
.high-contrast .popover {
|
|
489
|
-
box-shadow) !important;
|
|
490
|
-
border) !important;
|
|
529
|
+
box-shadow: var(--shadow-emphasis) !important;
|
|
530
|
+
border: var(--border-emphasis) !important;
|
|
491
531
|
}
|
|
492
532
|
`;
|
|
493
533
|
|
|
@@ -495,39 +535,47 @@ export class HighContrastThemeManager {
|
|
|
495
535
|
}
|
|
496
536
|
|
|
497
537
|
// Remove high contrast styles
|
|
498
|
-
private removeHighContrastStyles()
|
|
538
|
+
private removeHighContrastStyles(): void {
|
|
539
|
+
const style = document.getElementById('high-contrast-styles');
|
|
499
540
|
if (style) {
|
|
500
541
|
style.remove();
|
|
501
542
|
}
|
|
502
543
|
}
|
|
503
544
|
|
|
504
545
|
// Get current theme (placeholder - would integrate with actual theme system)
|
|
505
|
-
private getCurrentTheme()
|
|
546
|
+
private getCurrentTheme(): MultiThemeConfig {
|
|
547
|
+
// This would integrate with the actual theme system
|
|
548
|
+
return {} as MultiThemeConfig;
|
|
506
549
|
}
|
|
507
550
|
|
|
508
551
|
// Apply theme (placeholder - would integrate with actual theme system)
|
|
509
|
-
private applyTheme(theme)
|
|
552
|
+
private applyTheme(theme: MultiThemeConfig): void {
|
|
553
|
+
// This would integrate with the actual theme system
|
|
554
|
+
console.log('Applying theme:', theme);
|
|
510
555
|
}
|
|
511
556
|
|
|
512
557
|
// Get high contrast configuration
|
|
513
|
-
getConfiguration()
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
558
|
+
getConfiguration(): {
|
|
559
|
+
enabled: boolean;
|
|
560
|
+
targetContrastRatio: number;
|
|
561
|
+
enhancedColors: boolean;
|
|
562
|
+
borderEmphasis: boolean;
|
|
563
|
+
textEmphasis: boolean;
|
|
564
|
+
focusIndicators: boolean;
|
|
519
565
|
} {
|
|
520
566
|
return {
|
|
521
|
-
enabled,
|
|
522
|
-
targetContrastRatio,
|
|
523
|
-
enhancedColors,
|
|
524
|
-
borderEmphasis,
|
|
525
|
-
textEmphasis,
|
|
526
|
-
focusIndicators
|
|
567
|
+
enabled: this.isEnabled,
|
|
568
|
+
targetContrastRatio: this.targetContrastRatio,
|
|
569
|
+
enhancedColors: this.enhancedColors,
|
|
570
|
+
borderEmphasis: this.borderEmphasis,
|
|
571
|
+
textEmphasis: this.textEmphasis,
|
|
572
|
+
focusIndicators: this.focusIndicators
|
|
573
|
+
};
|
|
527
574
|
}
|
|
528
575
|
|
|
529
576
|
// Validate high contrast theme
|
|
530
|
-
validateHighContrastTheme(theme)
|
|
577
|
+
validateHighContrastTheme(theme: HighContrastThemeConfig): boolean {
|
|
578
|
+
if (!theme.highContrast?.enabled) return false;
|
|
531
579
|
|
|
532
580
|
// Validate contrast ratios
|
|
533
581
|
if (theme.colors) {
|
package/dist/themes/index.esm.js
CHANGED
package/dist/themes/index.js
CHANGED