@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
|
@@ -4,30 +4,34 @@ import { Card, CardContent, CardHeader, CardTitle } from './card';
|
|
|
4
4
|
import { Button } from './button';
|
|
5
5
|
import { Input } from './input';
|
|
6
6
|
import { ThemePreview } from './theme-preview';
|
|
7
|
-
|
|
7
|
+
import type { CompleteThemeConfig } from '../../themes/types';
|
|
8
8
|
|
|
9
9
|
export interface ThemeCustomizerProps {
|
|
10
|
-
initialTheme
|
|
11
|
-
onThemeChange
|
|
12
|
-
showPreview
|
|
13
|
-
allowCustomization
|
|
14
|
-
className
|
|
10
|
+
initialTheme?: string;
|
|
11
|
+
onThemeChange?: (theme: CompleteThemeConfig) => void;
|
|
12
|
+
showPreview?: boolean;
|
|
13
|
+
allowCustomization?: boolean;
|
|
14
|
+
className?: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface CustomizationState {
|
|
18
|
-
colors
|
|
19
|
-
|
|
18
|
+
colors: {
|
|
19
|
+
primary: string;
|
|
20
|
+
secondary: string;
|
|
20
21
|
};
|
|
21
|
-
fonts
|
|
22
|
-
|
|
22
|
+
fonts: {
|
|
23
|
+
primary: string;
|
|
24
|
+
secondary: string;
|
|
23
25
|
};
|
|
24
|
-
spacing
|
|
26
|
+
spacing: {
|
|
27
|
+
scale: number;
|
|
25
28
|
};
|
|
26
|
-
shadows
|
|
29
|
+
shadows: {
|
|
30
|
+
intensity: number;
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
export const ThemeCustomizer= ({
|
|
34
|
+
export const ThemeCustomizer: React.FC<ThemeCustomizerProps> = ({
|
|
31
35
|
initialTheme = 'stan-design',
|
|
32
36
|
onThemeChange,
|
|
33
37
|
showPreview = true,
|
|
@@ -36,12 +40,20 @@ export const ThemeCustomizer= ({
|
|
|
36
40
|
}) => {
|
|
37
41
|
const { getTheme } = useTheme();
|
|
38
42
|
const [customizationState, setCustomizationState] = useState<CustomizationState>({
|
|
39
|
-
colors
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
colors: {
|
|
44
|
+
primary: '#3b82f6',
|
|
45
|
+
secondary: '#10b981'
|
|
46
|
+
},
|
|
47
|
+
fonts: {
|
|
48
|
+
primary: 'Inter',
|
|
49
|
+
secondary: 'Roboto'
|
|
50
|
+
},
|
|
51
|
+
spacing: {
|
|
52
|
+
scale: 1.25
|
|
53
|
+
},
|
|
54
|
+
shadows: {
|
|
55
|
+
intensity: 0.1
|
|
56
|
+
}
|
|
45
57
|
});
|
|
46
58
|
|
|
47
59
|
const [activeTab, setActiveTab] = useState<'colors' | 'fonts' | 'spacing' | 'shadows' | 'preview'>('colors');
|
|
@@ -55,11 +67,13 @@ export const ThemeCustomizer= ({
|
|
|
55
67
|
}
|
|
56
68
|
}, [initialTheme]); // Removed getTheme from dependencies as it's stable
|
|
57
69
|
|
|
58
|
-
const handleCustomizationChange = useCallback((key, subKey, value) => {
|
|
70
|
+
const handleCustomizationChange = useCallback((key: keyof CustomizationState, subKey: string, value: any) => {
|
|
59
71
|
setCustomizationState(prev => ({
|
|
60
72
|
...prev,
|
|
61
|
-
[key]
|
|
62
|
-
[
|
|
73
|
+
[key]: {
|
|
74
|
+
...prev[key],
|
|
75
|
+
[subKey]: value
|
|
76
|
+
}
|
|
63
77
|
}));
|
|
64
78
|
}, []);
|
|
65
79
|
|
|
@@ -67,7 +81,7 @@ export const ThemeCustomizer= ({
|
|
|
67
81
|
if (!customTheme) return;
|
|
68
82
|
|
|
69
83
|
// Create a deep copy of the current theme
|
|
70
|
-
const newTheme= JSON.parse(JSON.stringify(customTheme));
|
|
84
|
+
const newTheme: CompleteThemeConfig = JSON.parse(JSON.stringify(customTheme));
|
|
71
85
|
|
|
72
86
|
// Apply customizations
|
|
73
87
|
// Generate color scales based on the selected primary color
|
|
@@ -75,18 +89,18 @@ export const ThemeCustomizer= ({
|
|
|
75
89
|
const secondaryColor = customizationState.colors.secondary;
|
|
76
90
|
|
|
77
91
|
// Simple color scale generation (in a real app, you'd use a color library)
|
|
78
|
-
const generateColorScale = (baseColor) => {
|
|
92
|
+
const generateColorScale = (baseColor: string) => {
|
|
79
93
|
return {
|
|
80
|
-
50}0a`,
|
|
81
|
-
100}1a`,
|
|
82
|
-
200}33`,
|
|
83
|
-
300}4d`,
|
|
84
|
-
400}66`,
|
|
85
|
-
500,
|
|
86
|
-
600}99`,
|
|
87
|
-
700}b3`,
|
|
88
|
-
800}cc`,
|
|
89
|
-
900}e6`
|
|
94
|
+
50: `${baseColor}0a`,
|
|
95
|
+
100: `${baseColor}1a`,
|
|
96
|
+
200: `${baseColor}33`,
|
|
97
|
+
300: `${baseColor}4d`,
|
|
98
|
+
400: `${baseColor}66`,
|
|
99
|
+
500: baseColor,
|
|
100
|
+
600: `${baseColor}99`,
|
|
101
|
+
700: `${baseColor}b3`,
|
|
102
|
+
800: `${baseColor}cc`,
|
|
103
|
+
900: `${baseColor}e6`
|
|
90
104
|
};
|
|
91
105
|
};
|
|
92
106
|
|
|
@@ -110,14 +124,14 @@ export const ThemeCustomizer= ({
|
|
|
110
124
|
if (newTheme.spacing && newTheme.spacing.scale) {
|
|
111
125
|
// This is a simplified approach - in reality you'd want to recalculate all spacing values
|
|
112
126
|
// For now, we'll just note that the scale factor has changed
|
|
113
|
-
console.log('Spacing scale factor updated to, customizationState.spacing.scale);
|
|
127
|
+
console.log('Spacing scale factor updated to:', customizationState.spacing.scale);
|
|
114
128
|
}
|
|
115
129
|
|
|
116
130
|
// Update shadow intensity (we'll adjust the existing shadows)
|
|
117
131
|
if (newTheme.shadows) {
|
|
118
132
|
// This is a simplified approach - in reality you'd want to recalculate all shadow values
|
|
119
133
|
// For now, we'll just note that the intensity has changed
|
|
120
|
-
console.log('Shadow intensity updated to, customizationState.shadows.intensity);
|
|
134
|
+
console.log('Shadow intensity updated to:', customizationState.shadows.intensity);
|
|
121
135
|
}
|
|
122
136
|
|
|
123
137
|
setCustomTheme(newTheme);
|
|
@@ -131,7 +145,7 @@ export const ThemeCustomizer= ({
|
|
|
131
145
|
if (!customTheme) return;
|
|
132
146
|
|
|
133
147
|
const themeData = JSON.stringify(customTheme, null, 2);
|
|
134
|
-
const blob = new Blob([themeData], { type});
|
|
148
|
+
const blob = new Blob([themeData], { type: 'application/json' });
|
|
135
149
|
const url = URL.createObjectURL(blob);
|
|
136
150
|
const a = document.createElement('a');
|
|
137
151
|
a.href = url;
|
|
@@ -147,12 +161,20 @@ export const ThemeCustomizer= ({
|
|
|
147
161
|
if (originalTheme) {
|
|
148
162
|
setCustomTheme(originalTheme);
|
|
149
163
|
setCustomizationState({
|
|
150
|
-
colors
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
164
|
+
colors: {
|
|
165
|
+
primary: '#3b82f6',
|
|
166
|
+
secondary: '#10b981'
|
|
167
|
+
},
|
|
168
|
+
fonts: {
|
|
169
|
+
primary: 'Inter',
|
|
170
|
+
secondary: 'Roboto'
|
|
171
|
+
},
|
|
172
|
+
spacing: {
|
|
173
|
+
scale: 1.25
|
|
174
|
+
},
|
|
175
|
+
shadows: {
|
|
176
|
+
intensity: 0.1
|
|
177
|
+
}
|
|
156
178
|
});
|
|
157
179
|
}
|
|
158
180
|
}, [initialTheme, getTheme]);
|
|
@@ -172,33 +194,38 @@ export const ThemeCustomizer= ({
|
|
|
172
194
|
<CardTitle className="flex items-center gap-2">
|
|
173
195
|
🎨 Theme Customizer
|
|
174
196
|
</CardTitle>
|
|
175
|
-
<p className="text-sm text-gray-600 dark
|
|
197
|
+
<p className="text-sm text-gray-600 dark:text-gray-400">
|
|
198
|
+
Customize and preview themes in real-time
|
|
199
|
+
</p>
|
|
200
|
+
</CardHeader>
|
|
201
|
+
<CardContent>
|
|
202
|
+
{/* Tab Navigation */}
|
|
176
203
|
<div className="flex space-x-1 mb-6 border-b">
|
|
177
204
|
{allowCustomization && (
|
|
178
205
|
<>
|
|
179
206
|
<Button
|
|
180
|
-
variant={activeTab === 'colors' ? 'default' }
|
|
207
|
+
variant={activeTab === 'colors' ? 'default' : 'ghost'}
|
|
181
208
|
size="sm"
|
|
182
209
|
onClick={() => setActiveTab('colors')}
|
|
183
210
|
>
|
|
184
211
|
Colors
|
|
185
212
|
</Button>
|
|
186
213
|
<Button
|
|
187
|
-
variant={activeTab === 'fonts' ? 'default' }
|
|
214
|
+
variant={activeTab === 'fonts' ? 'default' : 'ghost'}
|
|
188
215
|
size="sm"
|
|
189
216
|
onClick={() => setActiveTab('fonts')}
|
|
190
217
|
>
|
|
191
218
|
Fonts
|
|
192
219
|
</Button>
|
|
193
220
|
<Button
|
|
194
|
-
variant={activeTab === 'spacing' ? 'default' }
|
|
221
|
+
variant={activeTab === 'spacing' ? 'default' : 'ghost'}
|
|
195
222
|
size="sm"
|
|
196
223
|
onClick={() => setActiveTab('spacing')}
|
|
197
224
|
>
|
|
198
225
|
Spacing
|
|
199
226
|
</Button>
|
|
200
227
|
<Button
|
|
201
|
-
variant={activeTab === 'shadows' ? 'default' }
|
|
228
|
+
variant={activeTab === 'shadows' ? 'default' : 'ghost'}
|
|
202
229
|
size="sm"
|
|
203
230
|
onClick={() => setActiveTab('shadows')}
|
|
204
231
|
>
|
|
@@ -208,7 +235,7 @@ export const ThemeCustomizer= ({
|
|
|
208
235
|
)}
|
|
209
236
|
{showPreview && (
|
|
210
237
|
<Button
|
|
211
|
-
variant={activeTab === 'preview' ? 'default' }
|
|
238
|
+
variant={activeTab === 'preview' ? 'default' : 'ghost'}
|
|
212
239
|
size="sm"
|
|
213
240
|
onClick={() => setActiveTab('preview')}
|
|
214
241
|
>
|
|
@@ -222,7 +249,9 @@ export const ThemeCustomizer= ({
|
|
|
222
249
|
{activeTab === 'colors' && allowCustomization && (
|
|
223
250
|
<div className="space-y-4">
|
|
224
251
|
<h3 className="text-lg font-semibold">Color Customization</h3>
|
|
225
|
-
<div className="grid grid-cols-1 md
|
|
252
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
253
|
+
<div>
|
|
254
|
+
<label className="block text-sm font-medium mb-2">Primary Color</label>
|
|
226
255
|
<Input
|
|
227
256
|
type="color"
|
|
228
257
|
value={customizationState.colors.primary}
|
|
@@ -261,7 +290,9 @@ export const ThemeCustomizer= ({
|
|
|
261
290
|
{activeTab === 'fonts' && allowCustomization && (
|
|
262
291
|
<div className="space-y-4">
|
|
263
292
|
<h3 className="text-lg font-semibold">Font Customization</h3>
|
|
264
|
-
<div className="grid grid-cols-1 md
|
|
293
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
294
|
+
<div>
|
|
295
|
+
<label className="block text-sm font-medium mb-2">Primary Font</label>
|
|
265
296
|
<Input
|
|
266
297
|
value={customizationState.fonts.primary}
|
|
267
298
|
onChange={(e) => handleCustomizationChange('fonts', 'primary', e.target.value)}
|
|
@@ -314,7 +345,8 @@ export const ThemeCustomizer= ({
|
|
|
314
345
|
onChange={(e) => handleCustomizationChange('shadows', 'intensity', Number(e.target.value))}
|
|
315
346
|
className="w-full"
|
|
316
347
|
/>
|
|
317
|
-
<span className="text-sm text-gray-600 dark
|
|
348
|
+
<span className="text-sm text-gray-600 dark:text-gray-400">
|
|
349
|
+
{customizationState.shadows.intensity}
|
|
318
350
|
</span>
|
|
319
351
|
</div>
|
|
320
352
|
</div>
|
|
@@ -4,15 +4,15 @@ import { Card, CardContent, CardHeader, CardTitle } from './card';
|
|
|
4
4
|
import { Badge } from './badge';
|
|
5
5
|
|
|
6
6
|
export interface ThemePreviewProps {
|
|
7
|
-
themeName
|
|
8
|
-
showColors
|
|
9
|
-
showFonts
|
|
10
|
-
showNavigation
|
|
11
|
-
showSpacing
|
|
12
|
-
className
|
|
7
|
+
themeName?: string;
|
|
8
|
+
showColors?: boolean;
|
|
9
|
+
showFonts?: boolean;
|
|
10
|
+
showNavigation?: boolean;
|
|
11
|
+
showSpacing?: boolean;
|
|
12
|
+
className?: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export const ThemePreview= ({
|
|
15
|
+
export const ThemePreview: React.FC<ThemePreviewProps> = ({
|
|
16
16
|
themeName,
|
|
17
17
|
showColors = true,
|
|
18
18
|
showFonts = true,
|
|
@@ -43,13 +43,17 @@ export const ThemePreview= ({
|
|
|
43
43
|
|
|
44
44
|
{/* Primary Colors */}
|
|
45
45
|
<div>
|
|
46
|
-
<h5 className="text-sm font-medium text-gray-700 dark
|
|
46
|
+
<h5 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
47
|
+
Primary Colors
|
|
48
|
+
</h5>
|
|
49
|
+
<div className="grid grid-cols-5 gap-2">
|
|
47
50
|
{Object.entries(colors.primary).map(([shade, color]) => (
|
|
48
51
|
<div key={shade} className="text-center">
|
|
49
52
|
<div
|
|
50
|
-
className="w-12 h-12 rounded-lg border border-gray-200 dark
|
|
53
|
+
className="w-12 h-12 rounded-lg border border-gray-200 dark:border-gray-700 mb-1"
|
|
54
|
+
style={{ backgroundColor: color }}
|
|
51
55
|
/>
|
|
52
|
-
<span className="text-xs text-gray-600 dark}</span>
|
|
56
|
+
<span className="text-xs text-gray-600 dark:text-gray-400">{shade}</span>
|
|
53
57
|
</div>
|
|
54
58
|
))}
|
|
55
59
|
</div>
|
|
@@ -57,13 +61,18 @@ export const ThemePreview= ({
|
|
|
57
61
|
|
|
58
62
|
{/* Semantic Colors */}
|
|
59
63
|
<div>
|
|
60
|
-
<h5 className="text-sm font-medium text-gray-700 dark
|
|
64
|
+
<h5 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
65
|
+
Semantic Colors
|
|
66
|
+
</h5>
|
|
67
|
+
<div className="grid grid-cols-2 gap-2">
|
|
61
68
|
{Object.entries(colors.semantic).map(([name, color]) => (
|
|
62
69
|
<div key={name} className="flex items-center gap-2">
|
|
63
70
|
<div
|
|
64
|
-
className="w-6 h-6 rounded border border-gray-200 dark
|
|
71
|
+
className="w-6 h-6 rounded border border-gray-200 dark:border-gray-700"
|
|
72
|
+
style={{ backgroundColor: color }}
|
|
65
73
|
/>
|
|
66
|
-
<span className="text-sm text-gray-600 dark
|
|
74
|
+
<span className="text-sm text-gray-600 dark:text-gray-400 capitalize">
|
|
75
|
+
{name.replace(/([A-Z])/g, ' $1').trim()}
|
|
67
76
|
</span>
|
|
68
77
|
</div>
|
|
69
78
|
))}
|
|
@@ -72,13 +81,17 @@ export const ThemePreview= ({
|
|
|
72
81
|
|
|
73
82
|
{/* Neutral Colors */}
|
|
74
83
|
<div>
|
|
75
|
-
<h5 className="text-sm font-medium text-gray-700 dark
|
|
84
|
+
<h5 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
85
|
+
Neutral Colors
|
|
86
|
+
</h5>
|
|
87
|
+
<div className="grid grid-cols-5 gap-2">
|
|
76
88
|
{Object.entries(colors.neutral).map(([shade, color]) => (
|
|
77
89
|
<div key={shade} className="text-center">
|
|
78
90
|
<div
|
|
79
|
-
className="w-12 h-12 rounded-lg border border-gray-200 dark
|
|
91
|
+
className="w-12 h-12 rounded-lg border border-gray-200 dark:border-gray-700 mb-1"
|
|
92
|
+
style={{ backgroundColor: color }}
|
|
80
93
|
/>
|
|
81
|
-
<span className="text-xs text-gray-600 dark}</span>
|
|
94
|
+
<span className="text-xs text-gray-600 dark:text-gray-400">{shade}</span>
|
|
82
95
|
</div>
|
|
83
96
|
))}
|
|
84
97
|
</div>
|
|
@@ -98,15 +111,18 @@ export const ThemePreview= ({
|
|
|
98
111
|
|
|
99
112
|
{/* Primary Font */}
|
|
100
113
|
<div>
|
|
101
|
-
<h5 className="text-sm font-medium text-gray-700 dark
|
|
114
|
+
<h5 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
115
|
+
Primary Font: {fonts.primary.family}
|
|
102
116
|
</h5>
|
|
103
117
|
<div className="space-y-2">
|
|
104
118
|
{Object.entries(fonts.primary.sizes).map(([size, value]) => (
|
|
105
119
|
<div key={size} className="flex items-center gap-4">
|
|
106
|
-
<span className="text-xs text-gray-500 w-12">{size}
|
|
120
|
+
<span className="text-xs text-gray-500 w-12">{size}:</span>
|
|
121
|
+
<span
|
|
122
|
+
className="font-primary"
|
|
107
123
|
style={{
|
|
108
|
-
fontSize,
|
|
109
|
-
fontWeight] || 400
|
|
124
|
+
fontSize: value,
|
|
125
|
+
fontWeight: fonts.primary.weights[0] || 400
|
|
110
126
|
}}
|
|
111
127
|
>
|
|
112
128
|
The quick brown fox jumps over the lazy dog
|
|
@@ -118,13 +134,19 @@ export const ThemePreview= ({
|
|
|
118
134
|
|
|
119
135
|
{/* Font Weights */}
|
|
120
136
|
<div>
|
|
121
|
-
<h5 className="text-sm font-medium text-gray-700 dark
|
|
137
|
+
<h5 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
138
|
+
Font Weights
|
|
139
|
+
</h5>
|
|
140
|
+
<div className="space-y-2">
|
|
122
141
|
{fonts.primary.weights.map((weight) => (
|
|
123
142
|
<div key={weight} className="flex items-center gap-4">
|
|
124
|
-
<span className="text-xs text-gray-500 w-12">{weight}
|
|
143
|
+
<span className="text-xs text-gray-500 w-12">{weight}:</span>
|
|
144
|
+
<span
|
|
145
|
+
className="font-primary"
|
|
125
146
|
style={{
|
|
126
|
-
fontSize,
|
|
127
|
-
fontWeight
|
|
147
|
+
fontSize: '1rem',
|
|
148
|
+
fontWeight: weight
|
|
149
|
+
}}
|
|
128
150
|
>
|
|
129
151
|
The quick brown fox jumps over the lazy dog
|
|
130
152
|
</span>
|
|
@@ -147,34 +169,50 @@ export const ThemePreview= ({
|
|
|
147
169
|
|
|
148
170
|
<div className="grid grid-cols-2 gap-4">
|
|
149
171
|
<div>
|
|
150
|
-
<h5 className="text-sm font-medium text-gray-700 dark
|
|
172
|
+
<h5 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
173
|
+
Configuration
|
|
174
|
+
</h5>
|
|
175
|
+
<div className="space-y-2 text-sm">
|
|
151
176
|
<div className="flex justify-between">
|
|
152
|
-
<span className="text-gray-600 dark
|
|
177
|
+
<span className="text-gray-600 dark:text-gray-400">Layout:</span>
|
|
178
|
+
<Badge variant="outline">{navigation.layout}</Badge>
|
|
153
179
|
</div>
|
|
154
180
|
<div className="flex justify-between">
|
|
155
|
-
<span className="text-gray-600 dark
|
|
181
|
+
<span className="text-gray-600 dark:text-gray-400">Style:</span>
|
|
182
|
+
<Badge variant="outline">{navigation.style}</Badge>
|
|
156
183
|
</div>
|
|
157
184
|
<div className="flex justify-between">
|
|
158
|
-
<span className="text-gray-600 dark
|
|
185
|
+
<span className="text-gray-600 dark:text-gray-400">Behavior:</span>
|
|
186
|
+
<Badge variant="outline">{navigation.behavior}</Badge>
|
|
159
187
|
</div>
|
|
160
188
|
<div className="flex justify-between">
|
|
161
|
-
<span className="text-gray-600 dark
|
|
189
|
+
<span className="text-gray-600 dark:text-gray-400">Responsive:</span>
|
|
190
|
+
<Badge variant="outline">{navigation.responsive}</Badge>
|
|
162
191
|
</div>
|
|
163
192
|
</div>
|
|
164
193
|
</div>
|
|
165
194
|
|
|
166
195
|
<div>
|
|
167
|
-
<h5 className="text-sm font-medium text-gray-700 dark
|
|
196
|
+
<h5 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
197
|
+
Animations
|
|
198
|
+
</h5>
|
|
199
|
+
<div className="space-y-2 text-sm">
|
|
168
200
|
<div className="flex justify-between">
|
|
169
|
-
<span className="text-gray-600 dark
|
|
201
|
+
<span className="text-gray-600 dark:text-gray-400">Duration:</span>
|
|
202
|
+
<span className="text-gray-900 dark:text-gray-100">
|
|
203
|
+
{navigation.animations.duration.normal}
|
|
170
204
|
</span>
|
|
171
205
|
</div>
|
|
172
206
|
<div className="flex justify-between">
|
|
173
|
-
<span className="text-gray-600 dark
|
|
207
|
+
<span className="text-gray-600 dark:text-gray-400">Easing:</span>
|
|
208
|
+
<span className="text-gray-900 dark:text-gray-100">
|
|
209
|
+
{navigation.animations.easing.ease}
|
|
174
210
|
</span>
|
|
175
211
|
</div>
|
|
176
212
|
<div className="flex justify-between">
|
|
177
|
-
<span className="text-gray-600 dark
|
|
213
|
+
<span className="text-gray-600 dark:text-gray-400">Stagger:</span>
|
|
214
|
+
<span className="text-gray-900 dark:text-gray-100">
|
|
215
|
+
{navigation.animations.stagger.enabled ? 'Enabled' : 'Disabled'}
|
|
178
216
|
</span>
|
|
179
217
|
</div>
|
|
180
218
|
</div>
|
|
@@ -194,30 +232,41 @@ export const ThemePreview= ({
|
|
|
194
232
|
<h4 className="text-lg font-semibold">Spacing</h4>
|
|
195
233
|
|
|
196
234
|
<div>
|
|
197
|
-
<h5 className="text-sm font-medium text-gray-700 dark
|
|
235
|
+
<h5 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
236
|
+
Scale
|
|
237
|
+
</h5>
|
|
238
|
+
<div className="space-y-2">
|
|
198
239
|
{Object.entries(spacing.scale).map(([size, value]) => (
|
|
199
240
|
<div key={size} className="flex items-center gap-4">
|
|
200
|
-
<span className="text-xs text-gray-500 w-12">{size}
|
|
241
|
+
<span className="text-xs text-gray-500 w-12">{size}:</span>
|
|
242
|
+
<div
|
|
243
|
+
className="bg-blue-500 rounded"
|
|
201
244
|
style={{
|
|
202
|
-
width,
|
|
203
|
-
height
|
|
245
|
+
width: value,
|
|
246
|
+
height: '1rem'
|
|
247
|
+
}}
|
|
204
248
|
/>
|
|
205
|
-
<span className="text-sm text-gray-600 dark}</span>
|
|
249
|
+
<span className="text-sm text-gray-600 dark:text-gray-400">{value}</span>
|
|
206
250
|
</div>
|
|
207
251
|
))}
|
|
208
252
|
</div>
|
|
209
253
|
</div>
|
|
210
254
|
|
|
211
255
|
<div>
|
|
212
|
-
<h5 className="text-sm font-medium text-gray-700 dark
|
|
256
|
+
<h5 className="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
|
257
|
+
Component Spacing
|
|
258
|
+
</h5>
|
|
259
|
+
<div className="space-y-2">
|
|
213
260
|
{Object.entries(spacing.component).map(([component, spacingConfig]) => (
|
|
214
|
-
<div key={component} className="border border-gray-200 dark
|
|
261
|
+
<div key={component} className="border border-gray-200 dark:border-gray-700 rounded p-2">
|
|
262
|
+
<h6 className="text-xs font-medium text-gray-700 dark:text-gray-300 mb-1 capitalize">
|
|
263
|
+
{component}
|
|
215
264
|
</h6>
|
|
216
265
|
<div className="grid grid-cols-3 gap-2 text-xs">
|
|
217
266
|
{Object.entries(spacingConfig).map(([prop, value]) => (
|
|
218
267
|
<div key={prop} className="text-center">
|
|
219
268
|
<div className="text-gray-500 capitalize">{prop}</div>
|
|
220
|
-
<div className="text-gray-900 dark)}</div>
|
|
269
|
+
<div className="text-gray-900 dark:text-gray-100">{String(value)}</div>
|
|
221
270
|
</div>
|
|
222
271
|
))}
|
|
223
272
|
</div>
|
|
@@ -235,11 +284,14 @@ export const ThemePreview= ({
|
|
|
235
284
|
<CardHeader>
|
|
236
285
|
<CardTitle className="flex items-center gap-2">
|
|
237
286
|
<span className="text-2xl">
|
|
238
|
-
{targetTheme === 'stan-design' ? '⚡'
|
|
287
|
+
{targetTheme === 'stan-design' ? '⚡' :
|
|
288
|
+
targetTheme === 'enterprise' ? '🏢' :
|
|
289
|
+
targetTheme === 'harvey' ? '🎨' : '🎯'}
|
|
239
290
|
</span>
|
|
240
291
|
{themeConfig.meta.name} Theme Preview
|
|
241
292
|
</CardTitle>
|
|
242
|
-
<p className="text-sm text-gray-600 dark
|
|
293
|
+
<p className="text-sm text-gray-600 dark:text-gray-400">
|
|
294
|
+
{themeConfig.meta.description}
|
|
243
295
|
</p>
|
|
244
296
|
<div className="flex gap-2">
|
|
245
297
|
<Badge variant="outline">{themeConfig.meta.category}</Badge>
|