@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
|
@@ -8,7 +8,7 @@ import { useMobileOptimization } from '../../hooks/use-mobile-optimization'
|
|
|
8
8
|
import { useReusableArchitecture } from '../../hooks/use-reusable-architecture'
|
|
9
9
|
import { useAccessibilitySupport } from '../../hooks/use-accessibility-support'
|
|
10
10
|
|
|
11
|
-
export const AdvancedComponentArchitectureDemo= () => {
|
|
11
|
+
export const AdvancedComponentArchitectureDemo: React.FC = () => {
|
|
12
12
|
const [activeTab, setActiveTab] = useState<'patterns' | 'performance' | 'mobile' | 'architecture' | 'accessibility'>('patterns')
|
|
13
13
|
const [showPatternDemo, setShowPatternDemo] = useState(true)
|
|
14
14
|
const [showPerformanceDemo, setShowPerformanceDemo] = useState(true)
|
|
@@ -18,69 +18,74 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
18
18
|
|
|
19
19
|
// Hooks
|
|
20
20
|
const advancedPatterns = useAdvancedPatterns({
|
|
21
|
-
enableCompoundComponents,
|
|
22
|
-
enableRenderProps,
|
|
23
|
-
enableHigherOrderComponents,
|
|
24
|
-
enableCustomHooks,
|
|
25
|
-
enablePerformanceOptimization,
|
|
26
|
-
enableAccessibilitySupport
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
enableCompoundComponents: true,
|
|
22
|
+
enableRenderProps: true,
|
|
23
|
+
enableHigherOrderComponents: true,
|
|
24
|
+
enableCustomHooks: true,
|
|
25
|
+
enablePerformanceOptimization: true,
|
|
26
|
+
enableAccessibilitySupport: true
|
|
27
|
+
}, {
|
|
28
|
+
onPatternApplied: (pattern, component) => console.log('Pattern applied:', pattern, component),
|
|
29
|
+
onPerformanceOptimized: (optimization) => console.log('Performance optimized:', optimization),
|
|
30
|
+
onAccessibilityEnhanced: (feature) => console.log('Accessibility enhanced:', feature)
|
|
30
31
|
})
|
|
31
32
|
|
|
32
33
|
const componentPerformance = useComponentPerformance({
|
|
33
|
-
enableMemoization,
|
|
34
|
-
enableLazyLoading,
|
|
35
|
-
enableVirtualization,
|
|
36
|
-
enablePerformanceMonitoring,
|
|
37
|
-
enableAutoOptimization
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
enableMemoization: true,
|
|
35
|
+
enableLazyLoading: true,
|
|
36
|
+
enableVirtualization: true,
|
|
37
|
+
enablePerformanceMonitoring: true,
|
|
38
|
+
enableAutoOptimization: true
|
|
39
|
+
}, {
|
|
40
|
+
onPerformanceWarning: (metrics) => console.log('Performance warning:', metrics),
|
|
41
|
+
onOptimizationApplied: (type, component) => console.log('Optimization applied:', type, component),
|
|
42
|
+
onPerformanceImproved: (improvement) => console.log('Performance improved:', improvement),
|
|
43
|
+
onMemoryWarning: (usage) => console.log('Memory warning:', usage)
|
|
42
44
|
})
|
|
43
45
|
|
|
44
46
|
const mobileOptimization = useMobileOptimization({
|
|
45
|
-
enableTouchOptimization,
|
|
46
|
-
enablePerformanceOptimization,
|
|
47
|
-
enableBatteryOptimization,
|
|
48
|
-
enableAccessibilityOptimization,
|
|
49
|
-
enableResponsiveOptimization
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
enableTouchOptimization: true,
|
|
48
|
+
enablePerformanceOptimization: true,
|
|
49
|
+
enableBatteryOptimization: true,
|
|
50
|
+
enableAccessibilityOptimization: true,
|
|
51
|
+
enableResponsiveOptimization: true
|
|
52
|
+
}, {
|
|
53
|
+
onMobileOptimized: (optimization) => console.log('Mobile optimized:', optimization),
|
|
54
|
+
onTouchOptimized: (feature) => console.log('Touch optimized:', feature),
|
|
55
|
+
onPerformanceOptimized: (improvement) => console.log('Performance optimized:', improvement),
|
|
56
|
+
onBatteryOptimized: (strategy) => console.log('Battery optimized:', strategy),
|
|
57
|
+
onAccessibilityEnhanced: (feature) => console.log('Accessibility enhanced:', feature)
|
|
55
58
|
})
|
|
56
59
|
|
|
57
60
|
const reusableArchitecture = useReusableArchitecture({
|
|
58
|
-
enableComponentComposition,
|
|
59
|
-
enablePatternSharing,
|
|
60
|
-
enableStyleSharing,
|
|
61
|
-
enableBehaviorSharing,
|
|
62
|
-
enableTemplateSystem,
|
|
63
|
-
enableComponentRegistry
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
enableComponentComposition: true,
|
|
62
|
+
enablePatternSharing: true,
|
|
63
|
+
enableStyleSharing: true,
|
|
64
|
+
enableBehaviorSharing: true,
|
|
65
|
+
enableTemplateSystem: true,
|
|
66
|
+
enableComponentRegistry: true
|
|
67
|
+
}, {
|
|
68
|
+
onTemplateCreated: (template) => console.log('Template created:', template),
|
|
69
|
+
onPatternShared: (pattern) => console.log('Pattern shared:', pattern),
|
|
70
|
+
onStyleShared: (style) => console.log('Style shared:', style),
|
|
71
|
+
onBehaviorShared: (behavior) => console.log('Behavior shared:', behavior),
|
|
72
|
+
onArchitectureOptimized: (optimization) => console.log('Architecture optimized:', optimization)
|
|
69
73
|
})
|
|
70
74
|
|
|
71
75
|
const accessibilitySupport = useAccessibilitySupport({
|
|
72
|
-
enableAriaSupport,
|
|
73
|
-
enableKeyboardNavigation,
|
|
74
|
-
enableScreenReaderSupport,
|
|
75
|
-
enableFocusManagement,
|
|
76
|
-
enableHighContrast,
|
|
77
|
-
enableReducedMotion,
|
|
78
|
-
enableVoiceControl
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
enableAriaSupport: true,
|
|
77
|
+
enableKeyboardNavigation: true,
|
|
78
|
+
enableScreenReaderSupport: true,
|
|
79
|
+
enableFocusManagement: true,
|
|
80
|
+
enableHighContrast: true,
|
|
81
|
+
enableReducedMotion: true,
|
|
82
|
+
enableVoiceControl: true
|
|
83
|
+
}, {
|
|
84
|
+
onAriaEnhanced: (feature) => console.log('ARIA enhanced:', feature),
|
|
85
|
+
onKeyboardNavigationEnabled: (feature) => console.log('Keyboard navigation enabled:', feature),
|
|
86
|
+
onScreenReaderEnhanced: (feature) => console.log('Screen reader enhanced:', feature),
|
|
87
|
+
onFocusManagementImproved: (feature) => console.log('Focus management improved:', feature),
|
|
88
|
+
onAccessibilityWarning: (warning) => console.log('Accessibility warning:', warning)
|
|
84
89
|
})
|
|
85
90
|
|
|
86
91
|
// Demo functions
|
|
@@ -90,29 +95,31 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
90
95
|
const SubComponent = () => <div>Sub Component</div>
|
|
91
96
|
|
|
92
97
|
const compoundComponent = advancedPatterns.createCompoundComponent(BaseComponent, {
|
|
93
|
-
Sub
|
|
98
|
+
Sub: SubComponent
|
|
99
|
+
})
|
|
94
100
|
|
|
95
101
|
// Demonstrate render props
|
|
96
|
-
const renderPropsData = { message}
|
|
102
|
+
const renderPropsData = { message: 'Hello from Render Props!' }
|
|
97
103
|
const renderPropsComponent = advancedPatterns.createRenderPropsComponent({
|
|
98
|
-
data,
|
|
99
|
-
loading,
|
|
100
|
-
error,
|
|
101
|
-
render) => <div>Render Props}</div>
|
|
104
|
+
data: renderPropsData,
|
|
105
|
+
loading: false,
|
|
106
|
+
error: null,
|
|
107
|
+
render: (data) => <div>Render Props: {data.message}</div>
|
|
102
108
|
})
|
|
103
109
|
|
|
104
110
|
// Demonstrate higher-order components
|
|
105
111
|
const enhancedComponent = advancedPatterns.createHigherOrderComponent({
|
|
106
|
-
component,
|
|
107
|
-
props},
|
|
108
|
-
enhancers
|
|
112
|
+
component: BaseComponent,
|
|
113
|
+
props: { enhanced: true },
|
|
114
|
+
enhancers: [
|
|
115
|
+
(Component) => (props: any) => <div className="enhanced"><Component {...props} /></div>
|
|
109
116
|
]
|
|
110
117
|
})
|
|
111
118
|
|
|
112
119
|
// Demonstrate custom hooks
|
|
113
120
|
const customHookResult = advancedPatterns.createCustomHook('DemoHook', () => 'Custom Hook Result')
|
|
114
121
|
|
|
115
|
-
console.log('Patterns demonstrated, {
|
|
122
|
+
console.log('Patterns demonstrated:', {
|
|
116
123
|
compoundComponent,
|
|
117
124
|
renderPropsComponent,
|
|
118
125
|
enhancedComponent,
|
|
@@ -126,11 +133,11 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
126
133
|
|
|
127
134
|
// Demonstrate lazy loading
|
|
128
135
|
const lazyComponent = componentPerformance.lazyLoadComponent('DemoComponent', () =>
|
|
129
|
-
Promise.resolve({ default) => <div>Lazy Loaded Component</div> })
|
|
136
|
+
Promise.resolve({ default: () => <div>Lazy Loaded Component</div> })
|
|
130
137
|
)
|
|
131
138
|
|
|
132
139
|
// Demonstrate virtualization
|
|
133
|
-
const items = Array.from({ length}, (_, i) => `Item ${i}`)
|
|
140
|
+
const items = Array.from({ length: 1000 }, (_, i) => `Item ${i}`)
|
|
134
141
|
const virtualizedList = componentPerformance.createVirtualizedList(
|
|
135
142
|
items,
|
|
136
143
|
50,
|
|
@@ -145,7 +152,7 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
145
152
|
// Demonstrate auto-optimization
|
|
146
153
|
componentPerformance.autoOptimize('DemoComponent')
|
|
147
154
|
|
|
148
|
-
console.log('Performance optimizations demonstrated, {
|
|
155
|
+
console.log('Performance optimizations demonstrated:', {
|
|
149
156
|
memoizedValue,
|
|
150
157
|
lazyComponent,
|
|
151
158
|
virtualizedList
|
|
@@ -180,55 +187,56 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
180
187
|
// Demonstrate component composition
|
|
181
188
|
const BaseComponent = () => <div>Base Component</div>
|
|
182
189
|
const enhancedComponent = reusableArchitecture.composeComponent(BaseComponent, [
|
|
183
|
-
(Component) => (props) => <div className="enhanced"><Component {...props} /></div>,
|
|
184
|
-
(Component) => (props) => <div className="wrapped"><Component {...props} /></div>
|
|
190
|
+
(Component) => (props: any) => <div className="enhanced"><Component {...props} /></div>,
|
|
191
|
+
(Component) => (props: any) => <div className="wrapped"><Component {...props} /></div>
|
|
185
192
|
])
|
|
186
193
|
|
|
187
194
|
// Demonstrate template creation
|
|
188
195
|
const templateId = reusableArchitecture.createTemplate({
|
|
189
|
-
name,
|
|
190
|
-
component,
|
|
191
|
-
props},
|
|
192
|
-
styles},
|
|
193
|
-
behaviors, 'hoverable'],
|
|
194
|
-
patterns, 'enhanced']
|
|
196
|
+
name: 'Demo Template',
|
|
197
|
+
component: BaseComponent,
|
|
198
|
+
props: { demo: true },
|
|
199
|
+
styles: { padding: '1rem' },
|
|
200
|
+
behaviors: ['clickable', 'hoverable'],
|
|
201
|
+
patterns: ['compound', 'enhanced']
|
|
195
202
|
})
|
|
196
203
|
|
|
197
204
|
// Demonstrate pattern sharing
|
|
198
205
|
const patternId = reusableArchitecture.sharePattern({
|
|
199
|
-
name,
|
|
200
|
-
description,
|
|
201
|
-
implementation,
|
|
202
|
-
usage, 'Component2'],
|
|
203
|
-
category
|
|
206
|
+
name: 'Demo Pattern',
|
|
207
|
+
description: 'A demonstration pattern',
|
|
208
|
+
implementation: 'Pattern implementation details',
|
|
209
|
+
usage: ['Component1', 'Component2'],
|
|
210
|
+
category: 'composition'
|
|
211
|
+
})
|
|
204
212
|
|
|
205
213
|
// Demonstrate style sharing
|
|
206
214
|
const styleId = reusableArchitecture.shareStyle({
|
|
207
|
-
name,
|
|
208
|
-
css; }',
|
|
209
|
-
variables},
|
|
210
|
-
breakpoints},
|
|
211
|
-
usage]
|
|
215
|
+
name: 'Demo Style',
|
|
216
|
+
css: '.demo-style { color: blue; }',
|
|
217
|
+
variables: { '--demo-color': 'blue' },
|
|
218
|
+
breakpoints: { mobile: 'max-width: 768px' },
|
|
219
|
+
usage: ['Component1']
|
|
212
220
|
})
|
|
213
221
|
|
|
214
222
|
// Demonstrate behavior sharing
|
|
215
223
|
const behaviorId = reusableArchitecture.shareBehavior({
|
|
216
|
-
name,
|
|
217
|
-
description,
|
|
218
|
-
hook,
|
|
219
|
-
dependencies],
|
|
220
|
-
usage]
|
|
224
|
+
name: 'Demo Behavior',
|
|
225
|
+
description: 'A demonstration behavior',
|
|
226
|
+
hook: 'useDemoBehavior',
|
|
227
|
+
dependencies: ['react'],
|
|
228
|
+
usage: ['Component1']
|
|
221
229
|
})
|
|
222
230
|
|
|
223
231
|
// Demonstrate component registry
|
|
224
232
|
reusableArchitecture.registerComponent('DemoComponent', BaseComponent, {
|
|
225
|
-
name,
|
|
226
|
-
description,
|
|
227
|
-
category,
|
|
228
|
-
tags, 'example']
|
|
233
|
+
name: 'Demo Component',
|
|
234
|
+
description: 'A demonstration component',
|
|
235
|
+
category: 'demo',
|
|
236
|
+
tags: ['demo', 'example']
|
|
229
237
|
})
|
|
230
238
|
|
|
231
|
-
console.log('Architecture demonstrated, {
|
|
239
|
+
console.log('Architecture demonstrated:', {
|
|
232
240
|
enhancedComponent,
|
|
233
241
|
templateId,
|
|
234
242
|
patternId,
|
|
@@ -240,15 +248,17 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
240
248
|
const demonstrateAccessibility = useCallback(() => {
|
|
241
249
|
// Demonstrate ARIA support
|
|
242
250
|
accessibilitySupport.enhanceAriaSupport('DemoElement', {
|
|
243
|
-
'aria-label',
|
|
244
|
-
'aria-describedby',
|
|
245
|
-
'role'
|
|
251
|
+
'aria-label': 'Demo Element',
|
|
252
|
+
'aria-describedby': 'demo-description',
|
|
253
|
+
'role': 'button'
|
|
254
|
+
})
|
|
246
255
|
|
|
247
256
|
// Demonstrate keyboard navigation
|
|
248
257
|
accessibilitySupport.enableKeyboardNavigation('DemoElement', {
|
|
249
|
-
'Enter',
|
|
250
|
-
'Space',
|
|
251
|
-
'Tab'
|
|
258
|
+
'Enter': 'Activate',
|
|
259
|
+
'Space': 'Toggle',
|
|
260
|
+
'Tab': 'Navigate'
|
|
261
|
+
})
|
|
252
262
|
|
|
253
263
|
// Demonstrate screen reader support
|
|
254
264
|
accessibilitySupport.enhanceScreenReaderSupport('DemoElement', 'This is a demo element for screen readers')
|
|
@@ -283,11 +293,11 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
283
293
|
}, [demonstratePatterns, demonstratePerformance, demonstrateMobileOptimization, demonstrateArchitecture, demonstrateAccessibility])
|
|
284
294
|
|
|
285
295
|
const tabs = [
|
|
286
|
-
{ id, label, icon},
|
|
287
|
-
{ id, label, icon},
|
|
288
|
-
{ id, label, icon},
|
|
289
|
-
{ id, label, icon},
|
|
290
|
-
{ id, label, icon}
|
|
296
|
+
{ id: 'patterns', label: 'Advanced Patterns', icon: '🧩' },
|
|
297
|
+
{ id: 'performance', label: 'Performance', icon: '⚡' },
|
|
298
|
+
{ id: 'mobile', label: 'Mobile Optimization', icon: '📱' },
|
|
299
|
+
{ id: 'architecture', label: 'Reusable Architecture', icon: '🏗️' },
|
|
300
|
+
{ id: 'accessibility', label: 'Accessibility', icon: '♿' }
|
|
291
301
|
]
|
|
292
302
|
|
|
293
303
|
return (
|
|
@@ -314,7 +324,7 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
314
324
|
{tabs.map((tab) => (
|
|
315
325
|
<Button
|
|
316
326
|
key={tab.id}
|
|
317
|
-
variant={activeTab === tab.id ? 'default' }
|
|
327
|
+
variant={activeTab === tab.id ? 'default' : 'outline'}
|
|
318
328
|
size="sm"
|
|
319
329
|
onClick={() => setActiveTab(tab.id as any)}
|
|
320
330
|
className="flex items-center gap-2"
|
|
@@ -338,27 +348,32 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
338
348
|
</CardDescription>
|
|
339
349
|
</CardHeader>
|
|
340
350
|
<CardContent className="space-y-4">
|
|
341
|
-
<div className="grid grid-cols-1 md
|
|
351
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
352
|
+
<div className="space-y-3">
|
|
342
353
|
<h4 className="font-medium">Pattern Status</h4>
|
|
343
354
|
<div className="space-y-2">
|
|
344
355
|
<div className="flex justify-between">
|
|
345
|
-
<span className="text-sm">Compound Components
|
|
346
|
-
|
|
356
|
+
<span className="text-sm">Compound Components:</span>
|
|
357
|
+
<Badge variant={advancedPatterns.hasPattern('Compound Components') ? 'default' : 'secondary'}>
|
|
358
|
+
{advancedPatterns.hasPattern('Compound Components') ? 'Active' : 'Inactive'}
|
|
347
359
|
</Badge>
|
|
348
360
|
</div>
|
|
349
361
|
<div className="flex justify-between">
|
|
350
|
-
<span className="text-sm">Render Props
|
|
351
|
-
|
|
362
|
+
<span className="text-sm">Render Props:</span>
|
|
363
|
+
<Badge variant={advancedPatterns.hasPattern('Render Props') ? 'default' : 'secondary'}>
|
|
364
|
+
{advancedPatterns.hasPattern('Render Props') ? 'Active' : 'Inactive'}
|
|
352
365
|
</Badge>
|
|
353
366
|
</div>
|
|
354
367
|
<div className="flex justify-between">
|
|
355
|
-
<span className="text-sm">Higher-Order Components
|
|
356
|
-
|
|
368
|
+
<span className="text-sm">Higher-Order Components:</span>
|
|
369
|
+
<Badge variant={advancedPatterns.hasPattern('Higher-Order Components') ? 'default' : 'secondary'}>
|
|
370
|
+
{advancedPatterns.hasPattern('Higher-Order Components') ? 'Active' : 'Inactive'}
|
|
357
371
|
</Badge>
|
|
358
372
|
</div>
|
|
359
373
|
<div className="flex justify-between">
|
|
360
|
-
<span className="text-sm">Custom Hooks
|
|
361
|
-
|
|
374
|
+
<span className="text-sm">Custom Hooks:</span>
|
|
375
|
+
<Badge variant={advancedPatterns.hasPattern('Custom Hooks') ? 'default' : 'secondary'}>
|
|
376
|
+
{advancedPatterns.hasPattern('Custom Hooks') ? 'Active' : 'Inactive'}
|
|
362
377
|
</Badge>
|
|
363
378
|
</div>
|
|
364
379
|
</div>
|
|
@@ -368,13 +383,16 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
368
383
|
<h4 className="font-medium">Pattern Analysis</h4>
|
|
369
384
|
<div className="space-y-2">
|
|
370
385
|
<div className="flex justify-between">
|
|
371
|
-
<span className="text-sm">Total Patterns
|
|
386
|
+
<span className="text-sm">Total Patterns:</span>
|
|
387
|
+
<span className="text-sm text-cs-text-secondary">{advancedPatterns.patterns.length}</span>
|
|
372
388
|
</div>
|
|
373
389
|
<div className="flex justify-between">
|
|
374
|
-
<span className="text-sm">Unique Patterns
|
|
390
|
+
<span className="text-sm">Unique Patterns:</span>
|
|
391
|
+
<span className="text-sm text-cs-text-secondary">{advancedPatterns.analyzePatterns().uniquePatterns}</span>
|
|
375
392
|
</div>
|
|
376
393
|
<div className="flex justify-between">
|
|
377
|
-
<span className="text-sm">Optimization Level
|
|
394
|
+
<span className="text-sm">Optimization Level:</span>
|
|
395
|
+
<Badge variant="outline">{advancedPatterns.patterns.length > 0 ? 'Optimized' : 'Not Optimized'}</Badge>
|
|
378
396
|
</div>
|
|
379
397
|
</div>
|
|
380
398
|
</div>
|
|
@@ -400,7 +418,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
400
418
|
{/* Pattern Recommendations */}
|
|
401
419
|
{advancedPatterns.getPatternRecommendations().length > 0 && (
|
|
402
420
|
<div className="p-3 bg-cs-accent/10 rounded-lg">
|
|
403
|
-
<h4 className="font-medium text-sm mb-2">Pattern Recommendations
|
|
421
|
+
<h4 className="font-medium text-sm mb-2">Pattern Recommendations:</h4>
|
|
422
|
+
<ul className="text-xs text-cs-text-secondary space-y-1">
|
|
404
423
|
{advancedPatterns.getPatternRecommendations().map((recommendation, index) => (
|
|
405
424
|
<li key={index}>• {recommendation}</li>
|
|
406
425
|
))}
|
|
@@ -411,7 +430,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
411
430
|
{/* Pattern Validation */}
|
|
412
431
|
{advancedPatterns.validatePatterns().warnings.length > 0 && (
|
|
413
432
|
<div className="p-3 bg-yellow-50 border border-yellow-200 rounded-lg">
|
|
414
|
-
<h4 className="font-medium text-sm mb-2 text-yellow-800">Pattern Warnings
|
|
433
|
+
<h4 className="font-medium text-sm mb-2 text-yellow-800">Pattern Warnings:</h4>
|
|
434
|
+
<ul className="text-xs text-yellow-700 space-y-1">
|
|
415
435
|
{advancedPatterns.validatePatterns().warnings.map((warning, index) => (
|
|
416
436
|
<li key={index}>• {warning}</li>
|
|
417
437
|
))}
|
|
@@ -428,8 +448,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
428
448
|
<CardHeader>
|
|
429
449
|
<CardTitle className="text-xl flex items-center gap-2">
|
|
430
450
|
⚡ Component Performance Optimization
|
|
431
|
-
<Badge variant={componentPerformance.isPerformanceOptimized() ? 'default' }>
|
|
432
|
-
{componentPerformance.isPerformanceOptimized() ? 'Optimized' }
|
|
451
|
+
<Badge variant={componentPerformance.isPerformanceOptimized() ? 'default' : 'secondary'}>
|
|
452
|
+
{componentPerformance.isPerformanceOptimized() ? 'Optimized' : 'Not Optimized'}
|
|
433
453
|
</Badge>
|
|
434
454
|
</CardTitle>
|
|
435
455
|
<CardDescription>
|
|
@@ -437,7 +457,9 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
437
457
|
</CardDescription>
|
|
438
458
|
</CardHeader>
|
|
439
459
|
<CardContent className="space-y-4">
|
|
440
|
-
<div className="grid grid-cols-2 lg
|
|
460
|
+
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4 text-center">
|
|
461
|
+
<div>
|
|
462
|
+
<p className="text-2xl font-bold text-cs-primary">
|
|
441
463
|
{componentPerformance.metrics.renderTime.toFixed(2)}ms
|
|
442
464
|
</p>
|
|
443
465
|
<p className="text-sm text-cs-text-secondary">Render Time</p>
|
|
@@ -481,14 +503,17 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
481
503
|
|
|
482
504
|
{/* Performance Analysis */}
|
|
483
505
|
<div className="p-3 bg-cs-accent/10 rounded-lg">
|
|
484
|
-
<h4 className="font-medium text-sm mb-2">Performance Analysis
|
|
506
|
+
<h4 className="font-medium text-sm mb-2">Performance Analysis:</h4>
|
|
507
|
+
<div className="grid grid-cols-2 gap-4 text-sm">
|
|
485
508
|
<div>
|
|
486
|
-
<span className="font-medium">Needs Optimization
|
|
487
|
-
|
|
509
|
+
<span className="font-medium">Needs Optimization:</span>
|
|
510
|
+
<div className="text-cs-text-secondary">
|
|
511
|
+
{componentPerformance.analyzePerformance().needsOptimization ? 'Yes' : 'No'}
|
|
488
512
|
</div>
|
|
489
513
|
</div>
|
|
490
514
|
<div>
|
|
491
|
-
<span className="font-medium">Optimization Score
|
|
515
|
+
<span className="font-medium">Optimization Score:</span>
|
|
516
|
+
<div className="text-cs-text-secondary">
|
|
492
517
|
{componentPerformance.analyzePerformance().optimizationScore.toFixed(1)}%
|
|
493
518
|
</div>
|
|
494
519
|
</div>
|
|
@@ -498,7 +523,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
498
523
|
{/* Performance Recommendations */}
|
|
499
524
|
{componentPerformance.analyzePerformance().recommendations.length > 0 && (
|
|
500
525
|
<div className="p-3 bg-blue-50 border border-blue-200 rounded-lg">
|
|
501
|
-
<h4 className="font-medium text-sm mb-2 text-blue-800">Performance Recommendations
|
|
526
|
+
<h4 className="font-medium text-sm mb-2 text-blue-800">Performance Recommendations:</h4>
|
|
527
|
+
<ul className="text-xs text-blue-700 space-y-1">
|
|
502
528
|
{componentPerformance.analyzePerformance().recommendations.map((recommendation, index) => (
|
|
503
529
|
<li key={index}>• {recommendation}</li>
|
|
504
530
|
))}
|
|
@@ -515,8 +541,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
515
541
|
<CardHeader>
|
|
516
542
|
<CardTitle className="text-xl flex items-center gap-2">
|
|
517
543
|
📱 Mobile Optimization
|
|
518
|
-
<Badge variant={mobileOptimization.isMobileOptimized() ? 'default' }>
|
|
519
|
-
{mobileOptimization.isMobileOptimized() ? 'Optimized' }
|
|
544
|
+
<Badge variant={mobileOptimization.isMobileOptimized() ? 'default' : 'secondary'}>
|
|
545
|
+
{mobileOptimization.isMobileOptimized() ? 'Optimized' : 'Not Optimized'}
|
|
520
546
|
</Badge>
|
|
521
547
|
</CardTitle>
|
|
522
548
|
<CardDescription>
|
|
@@ -524,24 +550,29 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
524
550
|
</CardDescription>
|
|
525
551
|
</CardHeader>
|
|
526
552
|
<CardContent className="space-y-4">
|
|
527
|
-
<div className="grid grid-cols-1 md
|
|
553
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
554
|
+
<div className="space-y-3">
|
|
528
555
|
<h4 className="font-medium">Device Information</h4>
|
|
529
556
|
<div className="space-y-2">
|
|
530
557
|
<div className="flex justify-between">
|
|
531
|
-
<span className="text-sm">Device Type
|
|
532
|
-
|
|
558
|
+
<span className="text-sm">Device Type:</span>
|
|
559
|
+
<Badge variant={mobileOptimization.state.isMobile ? 'default' : 'secondary'}>
|
|
560
|
+
{mobileOptimization.state.isMobile ? 'Mobile' : 'Desktop'}
|
|
533
561
|
</Badge>
|
|
534
562
|
</div>
|
|
535
563
|
<div className="flex justify-between">
|
|
536
|
-
<span className="text-sm">Touch Device
|
|
537
|
-
|
|
564
|
+
<span className="text-sm">Touch Device:</span>
|
|
565
|
+
<Badge variant={mobileOptimization.state.isTouchDevice ? 'default' : 'secondary'}>
|
|
566
|
+
{mobileOptimization.state.isTouchDevice ? 'Yes' : 'No'}
|
|
538
567
|
</Badge>
|
|
539
568
|
</div>
|
|
540
569
|
<div className="flex justify-between">
|
|
541
|
-
<span className="text-sm">Screen Size
|
|
570
|
+
<span className="text-sm">Screen Size:</span>
|
|
571
|
+
<Badge variant="outline">{mobileOptimization.state.screenSize}</Badge>
|
|
542
572
|
</div>
|
|
543
573
|
<div className="flex justify-between">
|
|
544
|
-
<span className="text-sm">Orientation
|
|
574
|
+
<span className="text-sm">Orientation:</span>
|
|
575
|
+
<Badge variant="outline">{mobileOptimization.state.orientation}</Badge>
|
|
545
576
|
</div>
|
|
546
577
|
</div>
|
|
547
578
|
</div>
|
|
@@ -550,16 +581,20 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
550
581
|
<h4 className="font-medium">Optimization Status</h4>
|
|
551
582
|
<div className="space-y-2">
|
|
552
583
|
<div className="flex justify-between">
|
|
553
|
-
<span className="text-sm">Touch Optimized
|
|
584
|
+
<span className="text-sm">Touch Optimized:</span>
|
|
585
|
+
<Badge variant="outline">{mobileOptimization.analyzeMobileOptimization().touchOptimized ? 'Yes' : 'No'}</Badge>
|
|
554
586
|
</div>
|
|
555
587
|
<div className="flex justify-between">
|
|
556
|
-
<span className="text-sm">Performance Optimized
|
|
588
|
+
<span className="text-sm">Performance Optimized:</span>
|
|
589
|
+
<Badge variant="outline">{mobileOptimization.analyzeMobileOptimization().performanceOptimized ? 'Yes' : 'No'}</Badge>
|
|
557
590
|
</div>
|
|
558
591
|
<div className="flex justify-between">
|
|
559
|
-
<span className="text-sm">Battery Optimized
|
|
592
|
+
<span className="text-sm">Battery Optimized:</span>
|
|
593
|
+
<Badge variant="outline">{mobileOptimization.analyzeMobileOptimization().batteryOptimized ? 'Yes' : 'No'}</Badge>
|
|
560
594
|
</div>
|
|
561
595
|
<div className="flex justify-between">
|
|
562
|
-
<span className="text-sm">Accessibility Optimized
|
|
596
|
+
<span className="text-sm">Accessibility Optimized:</span>
|
|
597
|
+
<Badge variant="outline">{mobileOptimization.analyzeMobileOptimization().accessibilityOptimized ? 'Yes' : 'No'}</Badge>
|
|
563
598
|
</div>
|
|
564
599
|
</div>
|
|
565
600
|
</div>
|
|
@@ -585,7 +620,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
585
620
|
{/* Mobile Recommendations */}
|
|
586
621
|
{mobileOptimization.analyzeMobileOptimization().recommendations.length > 0 && (
|
|
587
622
|
<div className="p-3 bg-green-50 border border-green-200 rounded-lg">
|
|
588
|
-
<h4 className="font-medium text-sm mb-2 text-green-800">Mobile Optimization Recommendations
|
|
623
|
+
<h4 className="font-medium text-sm mb-2 text-green-800">Mobile Optimization Recommendations:</h4>
|
|
624
|
+
<ul className="text-xs text-green-700 space-y-1">
|
|
589
625
|
{mobileOptimization.analyzeMobileOptimization().recommendations.map((recommendation, index) => (
|
|
590
626
|
<li key={index}>• {recommendation}</li>
|
|
591
627
|
))}
|
|
@@ -609,7 +645,9 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
609
645
|
</CardDescription>
|
|
610
646
|
</CardHeader>
|
|
611
647
|
<CardContent className="space-y-4">
|
|
612
|
-
<div className="grid grid-cols-2 lg
|
|
648
|
+
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4 text-center">
|
|
649
|
+
<div>
|
|
650
|
+
<p className="text-2xl font-bold text-cs-primary">
|
|
613
651
|
{reusableArchitecture.templates.length}
|
|
614
652
|
</p>
|
|
615
653
|
<p className="text-sm text-cs-text-secondary">Templates</p>
|
|
@@ -653,14 +691,17 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
653
691
|
|
|
654
692
|
{/* Architecture Analysis */}
|
|
655
693
|
<div className="p-3 bg-cs-accent/10 rounded-lg">
|
|
656
|
-
<h4 className="font-medium text-sm mb-2">Architecture Analysis
|
|
694
|
+
<h4 className="font-medium text-sm mb-2">Architecture Analysis:</h4>
|
|
695
|
+
<div className="grid grid-cols-2 gap-4 text-sm">
|
|
657
696
|
<div>
|
|
658
|
-
<span className="font-medium">Composition Level
|
|
697
|
+
<span className="font-medium">Composition Level:</span>
|
|
698
|
+
<div className="text-cs-text-secondary">
|
|
659
699
|
{reusableArchitecture.analyzeArchitecture().compositionLevel}
|
|
660
700
|
</div>
|
|
661
701
|
</div>
|
|
662
702
|
<div>
|
|
663
|
-
<span className="font-medium">Reusability Score
|
|
703
|
+
<span className="font-medium">Reusability Score:</span>
|
|
704
|
+
<div className="text-cs-text-secondary">
|
|
664
705
|
{reusableArchitecture.analyzeArchitecture().reusabilityScore.toFixed(1)}%
|
|
665
706
|
</div>
|
|
666
707
|
</div>
|
|
@@ -670,7 +711,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
670
711
|
{/* Architecture Recommendations */}
|
|
671
712
|
{reusableArchitecture.analyzeArchitecture().recommendations.length > 0 && (
|
|
672
713
|
<div className="p-3 bg-blue-50 border border-blue-200 rounded-lg">
|
|
673
|
-
<h4 className="font-medium text-sm mb-2 text-blue-800">Architecture Recommendations
|
|
714
|
+
<h4 className="font-medium text-sm mb-2 text-blue-800">Architecture Recommendations:</h4>
|
|
715
|
+
<ul className="text-xs text-blue-700 space-y-1">
|
|
674
716
|
{reusableArchitecture.analyzeArchitecture().recommendations.map((recommendation, index) => (
|
|
675
717
|
<li key={index}>• {recommendation}</li>
|
|
676
718
|
))}
|
|
@@ -687,8 +729,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
687
729
|
<CardHeader>
|
|
688
730
|
<CardTitle className="text-xl flex items-center gap-2">
|
|
689
731
|
♿ Accessibility Support
|
|
690
|
-
<Badge variant={accessibilitySupport.isAccessibilityEnhanced() ? 'default' }>
|
|
691
|
-
{accessibilitySupport.isAccessibilityEnhanced() ? 'Enhanced' }
|
|
732
|
+
<Badge variant={accessibilitySupport.isAccessibilityEnhanced() ? 'default' : 'secondary'}>
|
|
733
|
+
{accessibilitySupport.isAccessibilityEnhanced() ? 'Enhanced' : 'Basic'}
|
|
692
734
|
</Badge>
|
|
693
735
|
</CardTitle>
|
|
694
736
|
<CardDescription>
|
|
@@ -696,27 +738,32 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
696
738
|
</CardDescription>
|
|
697
739
|
</CardHeader>
|
|
698
740
|
<CardContent className="space-y-4">
|
|
699
|
-
<div className="grid grid-cols-1 md
|
|
741
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
742
|
+
<div className="space-y-3">
|
|
700
743
|
<h4 className="font-medium">Accessibility Features</h4>
|
|
701
744
|
<div className="space-y-2">
|
|
702
745
|
<div className="flex justify-between">
|
|
703
|
-
<span className="text-sm">ARIA Support
|
|
704
|
-
|
|
746
|
+
<span className="text-sm">ARIA Support:</span>
|
|
747
|
+
<Badge variant={accessibilitySupport.state.hasAriaLabels ? 'default' : 'secondary'}>
|
|
748
|
+
{accessibilitySupport.state.hasAriaLabels ? 'Enabled' : 'Disabled'}
|
|
705
749
|
</Badge>
|
|
706
750
|
</div>
|
|
707
751
|
<div className="flex justify-between">
|
|
708
|
-
<span className="text-sm">Keyboard Navigation
|
|
709
|
-
|
|
752
|
+
<span className="text-sm">Keyboard Navigation:</span>
|
|
753
|
+
<Badge variant={accessibilitySupport.state.hasKeyboardNavigation ? 'default' : 'secondary'}>
|
|
754
|
+
{accessibilitySupport.state.hasKeyboardNavigation ? 'Enabled' : 'Disabled'}
|
|
710
755
|
</Badge>
|
|
711
756
|
</div>
|
|
712
757
|
<div className="flex justify-between">
|
|
713
|
-
<span className="text-sm">Screen Reader
|
|
714
|
-
|
|
758
|
+
<span className="text-sm">Screen Reader:</span>
|
|
759
|
+
<Badge variant={accessibilitySupport.state.hasScreenReaderSupport ? 'default' : 'secondary'}>
|
|
760
|
+
{accessibilitySupport.state.hasScreenReaderSupport ? 'Enabled' : 'Disabled'}
|
|
715
761
|
</Badge>
|
|
716
762
|
</div>
|
|
717
763
|
<div className="flex justify-between">
|
|
718
|
-
<span className="text-sm">Focus Management
|
|
719
|
-
|
|
764
|
+
<span className="text-sm">Focus Management:</span>
|
|
765
|
+
<Badge variant={accessibilitySupport.state.hasFocusManagement ? 'default' : 'secondary'}>
|
|
766
|
+
{accessibilitySupport.state.hasFocusManagement ? 'Enabled' : 'Disabled'}
|
|
720
767
|
</Badge>
|
|
721
768
|
</div>
|
|
722
769
|
</div>
|
|
@@ -726,22 +773,26 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
726
773
|
<h4 className="font-medium">Accessibility Preferences</h4>
|
|
727
774
|
<div className="space-y-2">
|
|
728
775
|
<div className="flex justify-between">
|
|
729
|
-
<span className="text-sm">High Contrast
|
|
730
|
-
|
|
776
|
+
<span className="text-sm">High Contrast:</span>
|
|
777
|
+
<Badge variant={accessibilitySupport.state.isHighContrast ? 'default' : 'secondary'}>
|
|
778
|
+
{accessibilitySupport.state.isHighContrast ? 'Enabled' : 'Disabled'}
|
|
731
779
|
</Badge>
|
|
732
780
|
</div>
|
|
733
781
|
<div className="flex justify-between">
|
|
734
|
-
<span className="text-sm">Reduced Motion
|
|
735
|
-
|
|
782
|
+
<span className="text-sm">Reduced Motion:</span>
|
|
783
|
+
<Badge variant={accessibilitySupport.state.isReducedMotion ? 'default' : 'secondary'}>
|
|
784
|
+
{accessibilitySupport.state.isReducedMotion ? 'Enabled' : 'Disabled'}
|
|
736
785
|
</Badge>
|
|
737
786
|
</div>
|
|
738
787
|
<div className="flex justify-between">
|
|
739
|
-
<span className="text-sm">Voice Control
|
|
740
|
-
|
|
788
|
+
<span className="text-sm">Voice Control:</span>
|
|
789
|
+
<Badge variant={accessibilitySupport.state.isVoiceControlEnabled ? 'default' : 'secondary'}>
|
|
790
|
+
{accessibilitySupport.state.isVoiceControlEnabled ? 'Enabled' : 'Disabled'}
|
|
741
791
|
</Badge>
|
|
742
792
|
</div>
|
|
743
793
|
<div className="flex justify-between">
|
|
744
|
-
<span className="text-sm">Accessibility Level
|
|
794
|
+
<span className="text-sm">Accessibility Level:</span>
|
|
795
|
+
<Badge variant="outline">{accessibilitySupport.state.accessibilityLevel}</Badge>
|
|
745
796
|
</div>
|
|
746
797
|
</div>
|
|
747
798
|
</div>
|
|
@@ -766,14 +817,17 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
766
817
|
|
|
767
818
|
{/* Accessibility Analysis */}
|
|
768
819
|
<div className="p-3 bg-cs-accent/10 rounded-lg">
|
|
769
|
-
<h4 className="font-medium text-sm mb-2">Accessibility Analysis
|
|
820
|
+
<h4 className="font-medium text-sm mb-2">Accessibility Analysis:</h4>
|
|
821
|
+
<div className="grid grid-cols-2 gap-4 text-sm">
|
|
770
822
|
<div>
|
|
771
|
-
<span className="font-medium">Accessibility Level
|
|
823
|
+
<span className="font-medium">Accessibility Level:</span>
|
|
824
|
+
<div className="text-cs-text-secondary">
|
|
772
825
|
{accessibilitySupport.analyzeAccessibility().level}
|
|
773
826
|
</div>
|
|
774
827
|
</div>
|
|
775
828
|
<div>
|
|
776
|
-
<span className="font-medium">Feature Coverage
|
|
829
|
+
<span className="font-medium">Feature Coverage:</span>
|
|
830
|
+
<div className="text-cs-text-secondary">
|
|
777
831
|
{accessibilitySupport.analyzeAccessibility().coverage.toFixed(1)}%
|
|
778
832
|
</div>
|
|
779
833
|
</div>
|
|
@@ -783,7 +837,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
783
837
|
{/* Accessibility Recommendations */}
|
|
784
838
|
{accessibilitySupport.analyzeAccessibility().recommendations.length > 0 && (
|
|
785
839
|
<div className="p-3 bg-green-50 border border-green-200 rounded-lg">
|
|
786
|
-
<h4 className="font-medium text-sm mb-2 text-green-800">Accessibility Recommendations
|
|
840
|
+
<h4 className="font-medium text-sm mb-2 text-green-800">Accessibility Recommendations:</h4>
|
|
841
|
+
<ul className="text-xs text-green-700 space-y-1">
|
|
787
842
|
{accessibilitySupport.analyzeAccessibility().recommendations.map((recommendation, index) => (
|
|
788
843
|
<li key={index}>• {recommendation}</li>
|
|
789
844
|
))}
|
|
@@ -794,7 +849,8 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
794
849
|
{/* Accessibility Warnings */}
|
|
795
850
|
{accessibilitySupport.accessibilityWarnings.length > 0 && (
|
|
796
851
|
<div className="p-3 bg-yellow-50 border border-yellow-200 rounded-lg">
|
|
797
|
-
<h4 className="font-medium text-sm mb-2 text-yellow-800">Accessibility Warnings
|
|
852
|
+
<h4 className="font-medium text-sm mb-2 text-yellow-800">Accessibility Warnings:</h4>
|
|
853
|
+
<ul className="text-xs text-yellow-700 space-y-1">
|
|
798
854
|
{accessibilitySupport.accessibilityWarnings.map((warning, index) => (
|
|
799
855
|
<li key={index}>• {warning}</li>
|
|
800
856
|
))}
|
|
@@ -816,39 +872,39 @@ export const AdvancedComponentArchitectureDemo= () => {
|
|
|
816
872
|
<CardContent className="space-y-4">
|
|
817
873
|
<div className="flex flex-wrap gap-4">
|
|
818
874
|
<Button
|
|
819
|
-
variant={showPatternDemo ? 'default' }
|
|
875
|
+
variant={showPatternDemo ? 'default' : 'outline'}
|
|
820
876
|
size="sm"
|
|
821
877
|
onClick={() => setShowPatternDemo(!showPatternDemo)}
|
|
822
878
|
>
|
|
823
|
-
{showPatternDemo ? 'Hide' } Pattern Demo
|
|
879
|
+
{showPatternDemo ? 'Hide' : 'Show'} Pattern Demo
|
|
824
880
|
</Button>
|
|
825
881
|
<Button
|
|
826
|
-
variant={showPerformanceDemo ? 'default' }
|
|
882
|
+
variant={showPerformanceDemo ? 'default' : 'outline'}
|
|
827
883
|
size="sm"
|
|
828
884
|
onClick={() => setShowPerformanceDemo(!showPerformanceDemo)}
|
|
829
885
|
>
|
|
830
|
-
{showPerformanceDemo ? 'Hide' } Performance Demo
|
|
886
|
+
{showPerformanceDemo ? 'Hide' : 'Show'} Performance Demo
|
|
831
887
|
</Button>
|
|
832
888
|
<Button
|
|
833
|
-
variant={showMobileDemo ? 'default' }
|
|
889
|
+
variant={showMobileDemo ? 'default' : 'outline'}
|
|
834
890
|
size="sm"
|
|
835
891
|
onClick={() => setShowMobileDemo(!showMobileDemo)}
|
|
836
892
|
>
|
|
837
|
-
{showMobileDemo ? 'Hide' } Mobile Demo
|
|
893
|
+
{showMobileDemo ? 'Hide' : 'Show'} Mobile Demo
|
|
838
894
|
</Button>
|
|
839
895
|
<Button
|
|
840
|
-
variant={showArchitectureDemo ? 'default' }
|
|
896
|
+
variant={showArchitectureDemo ? 'default' : 'outline'}
|
|
841
897
|
size="sm"
|
|
842
898
|
onClick={() => setShowArchitectureDemo(!showArchitectureDemo)}
|
|
843
899
|
>
|
|
844
|
-
{showArchitectureDemo ? 'Hide' } Architecture Demo
|
|
900
|
+
{showArchitectureDemo ? 'Hide' : 'Show'} Architecture Demo
|
|
845
901
|
</Button>
|
|
846
902
|
<Button
|
|
847
|
-
variant={showAccessibilityDemo ? 'default' }
|
|
903
|
+
variant={showAccessibilityDemo ? 'default' : 'outline'}
|
|
848
904
|
size="sm"
|
|
849
905
|
onClick={() => setShowAccessibilityDemo(!showAccessibilityDemo)}
|
|
850
906
|
>
|
|
851
|
-
{showAccessibilityDemo ? 'Hide' } Accessibility Demo
|
|
907
|
+
{showAccessibilityDemo ? 'Hide' : 'Show'} Accessibility Demo
|
|
852
908
|
</Button>
|
|
853
909
|
</div>
|
|
854
910
|
</CardContent>
|