@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.8 → 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
|
@@ -5,7 +5,7 @@ import { Button } from './button'
|
|
|
5
5
|
import { useHardwareAcceleration } from '../../hooks/use-hardware-acceleration'
|
|
6
6
|
import { useBatteryOptimization } from '../../hooks/use-battery-optimization'
|
|
7
7
|
|
|
8
|
-
export const HardwareAccelerationDemo= () => {
|
|
8
|
+
export const HardwareAccelerationDemo: React.FC = () => {
|
|
9
9
|
const [showGPUInfo, setShowGPUInfo] = useState(true)
|
|
10
10
|
const [showPerformanceMetrics, setShowPerformanceMetrics] = useState(true)
|
|
11
11
|
const [showBatteryInfo, setShowBatteryInfo] = useState(true)
|
|
@@ -15,32 +15,34 @@ export const HardwareAccelerationDemo= () => {
|
|
|
15
15
|
|
|
16
16
|
// Hooks with error handling
|
|
17
17
|
const hardwareAcceleration = useHardwareAcceleration({
|
|
18
|
-
enableGPUMonitoring,
|
|
19
|
-
enablePerformanceTracking,
|
|
20
|
-
enableBatteryOptimization,
|
|
21
|
-
enableAutomaticOptimization
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
enableGPUMonitoring: true,
|
|
19
|
+
enablePerformanceTracking: true,
|
|
20
|
+
enableBatteryOptimization: true,
|
|
21
|
+
enableAutomaticOptimization: true
|
|
22
|
+
}, {
|
|
23
|
+
onGPUDetected: (gpuInfo) => console.log('GPU detected:', gpuInfo),
|
|
24
|
+
onPerformanceWarning: (warning, metrics) => console.log('Performance warning:', warning, metrics),
|
|
25
|
+
onBatteryWarning: (level, isLow) => console.log('Battery warning:', level, isLow),
|
|
26
|
+
onOptimizationApplied: (optimization) => console.log('Optimization applied:', optimization)
|
|
26
27
|
})
|
|
27
28
|
|
|
28
29
|
const batteryOptimization = useBatteryOptimization({
|
|
29
|
-
enableBatteryMonitoring,
|
|
30
|
-
enablePerformanceThrottling,
|
|
31
|
-
enableUserPreferences,
|
|
32
|
-
enableAdaptiveOptimization
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
enableBatteryMonitoring: true,
|
|
31
|
+
enablePerformanceThrottling: true,
|
|
32
|
+
enableUserPreferences: true,
|
|
33
|
+
enableAdaptiveOptimization: true
|
|
34
|
+
}, {
|
|
35
|
+
onBatteryStatusChange: (status) => console.log('Battery status changed:', status),
|
|
36
|
+
onLowBatteryWarning: (status) => console.log('Low battery warning:', status),
|
|
37
|
+
onCriticalBatteryWarning: (status) => console.log('Critical battery warning:', status),
|
|
38
|
+
onPerformanceThrottled: (level, reason) => console.log('Performance throttled:', level, reason),
|
|
39
|
+
onOptimizationApplied: (optimization) => console.log('Battery optimization applied:', optimization)
|
|
38
40
|
})
|
|
39
41
|
|
|
40
42
|
// Error boundary effect
|
|
41
43
|
useEffect(() => {
|
|
42
|
-
const handleError = (error) => {
|
|
43
|
-
console.error('Hardware acceleration demo error, error)
|
|
44
|
+
const handleError = (error: ErrorEvent) => {
|
|
45
|
+
console.error('Hardware acceleration demo error:', error)
|
|
44
46
|
setError(error.message)
|
|
45
47
|
}
|
|
46
48
|
|
|
@@ -66,22 +68,41 @@ export const HardwareAccelerationDemo= () => {
|
|
|
66
68
|
}, [])
|
|
67
69
|
|
|
68
70
|
// Get animation classes based on type
|
|
69
|
-
const getAnimationClasses = useCallback((type) => {
|
|
71
|
+
const getAnimationClasses = useCallback((type: string) => {
|
|
70
72
|
const baseClasses = 'w-32 h-32 rounded-lg transition-all duration-1000 ease-in-out'
|
|
71
73
|
|
|
72
74
|
switch (type) {
|
|
73
|
-
case 'basic'
|
|
75
|
+
case 'basic':
|
|
76
|
+
return `${baseClasses} bg-cs-primary hover:bg-cs-secondary`
|
|
77
|
+
case 'gpu':
|
|
78
|
+
return `${baseClasses} bg-cs-secondary gpu-optimized hover:bg-cs-accent`
|
|
79
|
+
case 'transform3d':
|
|
80
|
+
return `${baseClasses} bg-cs-accent transform3d-optimized hover:bg-cs-primary`
|
|
81
|
+
case 'performance':
|
|
82
|
+
return `${baseClasses} bg-cs-primary performance-accelerated hover:bg-cs-secondary`
|
|
83
|
+
default:
|
|
84
|
+
return baseClasses
|
|
85
|
+
}
|
|
74
86
|
}, [])
|
|
75
87
|
|
|
76
88
|
// Get animation styles based on state
|
|
77
|
-
const getAnimationStyles = useCallback((state) => {
|
|
89
|
+
const getAnimationStyles = useCallback((state: string) => {
|
|
78
90
|
switch (state) {
|
|
79
|
-
case 'running'
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
opacity
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
case 'running':
|
|
92
|
+
return {
|
|
93
|
+
transform: 'translate3d(100px, 0, 0) rotate(360deg) scale(1.2)',
|
|
94
|
+
opacity: 0.8
|
|
95
|
+
}
|
|
96
|
+
case 'paused':
|
|
97
|
+
return {
|
|
98
|
+
transform: 'translate3d(50px, 0, 0) rotate(180deg) scale(1.1)',
|
|
99
|
+
opacity: 0.9
|
|
100
|
+
}
|
|
101
|
+
default:
|
|
102
|
+
return {
|
|
103
|
+
transform: 'translate3d(0, 0, 0) rotate(0deg) scale(1)',
|
|
104
|
+
opacity: 1
|
|
105
|
+
}
|
|
85
106
|
}
|
|
86
107
|
}, [])
|
|
87
108
|
|
|
@@ -121,8 +142,8 @@ export const HardwareAccelerationDemo= () => {
|
|
|
121
142
|
<CardHeader>
|
|
122
143
|
<CardTitle className="text-xl flex items-center gap-2">
|
|
123
144
|
🎮 GPU Information
|
|
124
|
-
<Badge variant={hardwareAcceleration.isGPUSupported ? 'default' }>
|
|
125
|
-
{hardwareAcceleration.isGPUSupported ? 'Supported' }
|
|
145
|
+
<Badge variant={hardwareAcceleration.isGPUSupported ? 'default' : 'secondary'}>
|
|
146
|
+
{hardwareAcceleration.isGPUSupported ? 'Supported' : 'Not Supported'}
|
|
126
147
|
</Badge>
|
|
127
148
|
</CardTitle>
|
|
128
149
|
<CardDescription>
|
|
@@ -130,30 +151,37 @@ export const HardwareAccelerationDemo= () => {
|
|
|
130
151
|
</CardDescription>
|
|
131
152
|
</CardHeader>
|
|
132
153
|
<CardContent>
|
|
133
|
-
<div className="grid grid-cols-1 md
|
|
154
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
155
|
+
<div className="space-y-2">
|
|
134
156
|
<div className="flex justify-between">
|
|
135
|
-
<span className="text-sm font-medium">Vendor
|
|
157
|
+
<span className="text-sm font-medium">Vendor:</span>
|
|
158
|
+
<span className="text-sm text-cs-text-secondary">{hardwareAcceleration.gpuInfo.vendor}</span>
|
|
136
159
|
</div>
|
|
137
160
|
<div className="flex justify-between">
|
|
138
|
-
<span className="text-sm font-medium">Renderer
|
|
161
|
+
<span className="text-sm font-medium">Renderer:</span>
|
|
162
|
+
<span className="text-sm text-cs-text-secondary">{hardwareAcceleration.gpuInfo.renderer}</span>
|
|
139
163
|
</div>
|
|
140
164
|
<div className="flex justify-between">
|
|
141
|
-
<span className="text-sm font-medium">Version
|
|
165
|
+
<span className="text-sm font-medium">Version:</span>
|
|
166
|
+
<span className="text-sm text-cs-text-secondary">{hardwareAcceleration.gpuInfo.version}</span>
|
|
142
167
|
</div>
|
|
143
168
|
</div>
|
|
144
169
|
<div className="space-y-2">
|
|
145
170
|
<div className="flex justify-between">
|
|
146
|
-
<span className="text-sm font-medium">WebGL Support
|
|
147
|
-
|
|
171
|
+
<span className="text-sm font-medium">WebGL Support:</span>
|
|
172
|
+
<Badge variant={hardwareAcceleration.gpuInfo.isWebGLSupported ? 'default' : 'secondary'}>
|
|
173
|
+
{hardwareAcceleration.gpuInfo.isWebGLSupported ? 'Yes' : 'No'}
|
|
148
174
|
</Badge>
|
|
149
175
|
</div>
|
|
150
176
|
<div className="flex justify-between">
|
|
151
|
-
<span className="text-sm font-medium">WebGL2 Support
|
|
152
|
-
|
|
177
|
+
<span className="text-sm font-medium">WebGL2 Support:</span>
|
|
178
|
+
<Badge variant={hardwareAcceleration.gpuInfo.isWebGL2Supported ? 'default' : 'secondary'}>
|
|
179
|
+
{hardwareAcceleration.gpuInfo.isWebGL2Supported ? 'Yes' : 'No'}
|
|
153
180
|
</Badge>
|
|
154
181
|
</div>
|
|
155
182
|
<div className="flex justify-between">
|
|
156
|
-
<span className="text-sm font-medium">Max Texture Size
|
|
183
|
+
<span className="text-sm font-medium">Max Texture Size:</span>
|
|
184
|
+
<span className="text-sm text-cs-text-secondary">{hardwareAcceleration.gpuInfo.maxTextureSize}</span>
|
|
157
185
|
</div>
|
|
158
186
|
</div>
|
|
159
187
|
</div>
|
|
@@ -174,7 +202,9 @@ export const HardwareAccelerationDemo= () => {
|
|
|
174
202
|
</CardDescription>
|
|
175
203
|
</CardHeader>
|
|
176
204
|
<CardContent>
|
|
177
|
-
<div className="grid grid-cols-2 lg
|
|
205
|
+
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4 text-center">
|
|
206
|
+
<div>
|
|
207
|
+
<p className="text-2xl font-bold text-cs-primary">
|
|
178
208
|
{hardwareAcceleration.metrics.fps}
|
|
179
209
|
</p>
|
|
180
210
|
<p className="text-sm text-cs-text-secondary">FPS</p>
|
|
@@ -201,14 +231,19 @@ export const HardwareAccelerationDemo= () => {
|
|
|
201
231
|
|
|
202
232
|
<div className="mt-4 p-3 bg-cs-accent/10 rounded-lg">
|
|
203
233
|
<div className="flex items-center justify-between mb-2">
|
|
204
|
-
<span className="font-medium text-sm">Performance Level
|
|
205
|
-
|
|
234
|
+
<span className="font-medium text-sm">Performance Level:</span>
|
|
235
|
+
<Badge variant={
|
|
236
|
+
hardwareAcceleration.performanceLevel === 'excellent' ? 'default' :
|
|
237
|
+
hardwareAcceleration.performanceLevel === 'good' ? 'default' :
|
|
238
|
+
hardwareAcceleration.performanceLevel === 'fair' ? 'secondary' : 'secondary'
|
|
239
|
+
}>
|
|
206
240
|
{hardwareAcceleration.performanceLevel.toUpperCase()}
|
|
207
241
|
</Badge>
|
|
208
242
|
</div>
|
|
209
243
|
<div className="flex items-center justify-between">
|
|
210
|
-
<span className="font-medium text-sm">Hardware Acceleration
|
|
211
|
-
|
|
244
|
+
<span className="font-medium text-sm">Hardware Acceleration:</span>
|
|
245
|
+
<Badge variant={hardwareAcceleration.isHardwareAccelerated ? 'default' : 'secondary'}>
|
|
246
|
+
{hardwareAcceleration.isHardwareAccelerated ? 'Enabled' : 'Disabled'}
|
|
212
247
|
</Badge>
|
|
213
248
|
</div>
|
|
214
249
|
</div>
|
|
@@ -222,7 +257,7 @@ export const HardwareAccelerationDemo= () => {
|
|
|
222
257
|
<CardHeader>
|
|
223
258
|
<CardTitle className="text-xl flex items-center gap-2">
|
|
224
259
|
🔋 Battery Optimization
|
|
225
|
-
<Badge variant={batteryOptimization.isLowBattery ? 'secondary' }>
|
|
260
|
+
<Badge variant={batteryOptimization.isLowBattery ? 'secondary' : 'default'}>
|
|
226
261
|
{batteryOptimization.batteryPercentage}%
|
|
227
262
|
</Badge>
|
|
228
263
|
</CardTitle>
|
|
@@ -231,19 +266,23 @@ export const HardwareAccelerationDemo= () => {
|
|
|
231
266
|
</CardDescription>
|
|
232
267
|
</CardHeader>
|
|
233
268
|
<CardContent>
|
|
234
|
-
<div className="grid grid-cols-1 md
|
|
269
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
270
|
+
<div className="space-y-3">
|
|
235
271
|
<h4 className="font-medium">Battery Status</h4>
|
|
236
272
|
<div className="space-y-2">
|
|
237
273
|
<div className="flex justify-between">
|
|
238
|
-
<span className="text-sm">Level
|
|
274
|
+
<span className="text-sm">Level:</span>
|
|
275
|
+
<span className="text-sm text-cs-text-secondary">{batteryOptimization.batteryPercentage}%</span>
|
|
239
276
|
</div>
|
|
240
277
|
<div className="flex justify-between">
|
|
241
|
-
<span className="text-sm">Status
|
|
242
|
-
|
|
278
|
+
<span className="text-sm">Status:</span>
|
|
279
|
+
<Badge variant={batteryOptimization.isCharging ? 'default' : 'secondary'}>
|
|
280
|
+
{batteryOptimization.isCharging ? 'Charging' : 'Discharging'}
|
|
243
281
|
</Badge>
|
|
244
282
|
</div>
|
|
245
283
|
<div className="flex justify-between">
|
|
246
|
-
<span className="text-sm">Health
|
|
284
|
+
<span className="text-sm">Health:</span>
|
|
285
|
+
<Badge variant="outline">{batteryOptimization.getBatteryHealth()}</Badge>
|
|
247
286
|
</div>
|
|
248
287
|
</div>
|
|
249
288
|
</div>
|
|
@@ -252,14 +291,17 @@ export const HardwareAccelerationDemo= () => {
|
|
|
252
291
|
<h4 className="font-medium">Performance Settings</h4>
|
|
253
292
|
<div className="space-y-2">
|
|
254
293
|
<div className="flex justify-between">
|
|
255
|
-
<span className="text-sm">Throttle Level
|
|
294
|
+
<span className="text-sm">Throttle Level:</span>
|
|
295
|
+
<Badge variant="outline">{batteryOptimization.currentThrottleLevel}</Badge>
|
|
256
296
|
</div>
|
|
257
297
|
<div className="flex justify-between">
|
|
258
|
-
<span className="text-sm">User Preference
|
|
298
|
+
<span className="text-sm">User Preference:</span>
|
|
299
|
+
<Badge variant="outline">{batteryOptimization.userPreferences}</Badge>
|
|
259
300
|
</div>
|
|
260
301
|
<div className="flex justify-between">
|
|
261
|
-
<span className="text-sm">Optimization
|
|
262
|
-
|
|
302
|
+
<span className="text-sm">Optimization:</span>
|
|
303
|
+
<Badge variant={batteryOptimization.isOptimizing ? 'secondary' : 'default'}>
|
|
304
|
+
{batteryOptimization.isOptimizing ? 'Active' : 'Idle'}
|
|
263
305
|
</Badge>
|
|
264
306
|
</div>
|
|
265
307
|
</div>
|
|
@@ -268,23 +310,24 @@ export const HardwareAccelerationDemo= () => {
|
|
|
268
310
|
|
|
269
311
|
{/* User Preference Controls */}
|
|
270
312
|
<div className="mt-4 p-3 bg-cs-accent/10 rounded-lg">
|
|
271
|
-
<h4 className="font-medium text-sm mb-2">User Preference
|
|
313
|
+
<h4 className="font-medium text-sm mb-2">User Preference:</h4>
|
|
314
|
+
<div className="flex gap-2">
|
|
272
315
|
<Button
|
|
273
|
-
variant={batteryOptimization.userPreferences === 'performance' ? 'default' }
|
|
316
|
+
variant={batteryOptimization.userPreferences === 'performance' ? 'default' : 'outline'}
|
|
274
317
|
size="sm"
|
|
275
318
|
onClick={() => batteryOptimization.updateUserPreferences('performance')}
|
|
276
319
|
>
|
|
277
320
|
Performance
|
|
278
321
|
</Button>
|
|
279
322
|
<Button
|
|
280
|
-
variant={batteryOptimization.userPreferences === 'balanced' ? 'default' }
|
|
323
|
+
variant={batteryOptimization.userPreferences === 'balanced' ? 'default' : 'outline'}
|
|
281
324
|
size="sm"
|
|
282
325
|
onClick={() => batteryOptimization.updateUserPreferences('balanced')}
|
|
283
326
|
>
|
|
284
327
|
Balanced
|
|
285
328
|
</Button>
|
|
286
329
|
<Button
|
|
287
|
-
variant={batteryOptimization.userPreferences === 'battery' ? 'default' }
|
|
330
|
+
variant={batteryOptimization.userPreferences === 'battery' ? 'default' : 'outline'}
|
|
288
331
|
size="sm"
|
|
289
332
|
onClick={() => batteryOptimization.updateUserPreferences('battery')}
|
|
290
333
|
>
|
|
@@ -308,28 +351,28 @@ export const HardwareAccelerationDemo= () => {
|
|
|
308
351
|
{/* Animation Type Selection */}
|
|
309
352
|
<div className="flex flex-wrap gap-2">
|
|
310
353
|
<Button
|
|
311
|
-
variant={animationType === 'basic' ? 'default' }
|
|
354
|
+
variant={animationType === 'basic' ? 'default' : 'outline'}
|
|
312
355
|
size="sm"
|
|
313
356
|
onClick={() => setAnimationType('basic')}
|
|
314
357
|
>
|
|
315
358
|
Basic
|
|
316
359
|
</Button>
|
|
317
360
|
<Button
|
|
318
|
-
variant={animationType === 'gpu' ? 'default' }
|
|
361
|
+
variant={animationType === 'gpu' ? 'default' : 'outline'}
|
|
319
362
|
size="sm"
|
|
320
363
|
onClick={() => setAnimationType('gpu')}
|
|
321
364
|
>
|
|
322
365
|
GPU Optimized
|
|
323
366
|
</Button>
|
|
324
367
|
<Button
|
|
325
|
-
variant={animationType === 'transform3d' ? 'default' }
|
|
368
|
+
variant={animationType === 'transform3d' ? 'default' : 'outline'}
|
|
326
369
|
size="sm"
|
|
327
370
|
onClick={() => setAnimationType('transform3d')}
|
|
328
371
|
>
|
|
329
372
|
Transform3D
|
|
330
373
|
</Button>
|
|
331
374
|
<Button
|
|
332
|
-
variant={animationType === 'performance' ? 'default' }
|
|
375
|
+
variant={animationType === 'performance' ? 'default' : 'outline'}
|
|
333
376
|
size="sm"
|
|
334
377
|
onClick={() => setAnimationType('performance')}
|
|
335
378
|
>
|
|
@@ -372,10 +415,10 @@ export const HardwareAccelerationDemo= () => {
|
|
|
372
415
|
|
|
373
416
|
{/* Animation Info */}
|
|
374
417
|
<div className="text-center text-sm text-cs-text-secondary">
|
|
375
|
-
<p>Animation Type="font-medium">{animationType}</span></p>
|
|
376
|
-
<p>State="font-medium">{animationState}</span></p>
|
|
377
|
-
<p>Hardware Acceleration="font-medium">
|
|
378
|
-
{hardwareAcceleration.isHardwareAccelerated ? 'Enabled' }
|
|
418
|
+
<p>Animation Type: <span className="font-medium">{animationType}</span></p>
|
|
419
|
+
<p>State: <span className="font-medium">{animationState}</span></p>
|
|
420
|
+
<p>Hardware Acceleration: <span className="font-medium">
|
|
421
|
+
{hardwareAcceleration.isHardwareAccelerated ? 'Enabled' : 'Disabled'}
|
|
379
422
|
</span></p>
|
|
380
423
|
</div>
|
|
381
424
|
</CardContent>
|
|
@@ -392,42 +435,42 @@ export const HardwareAccelerationDemo= () => {
|
|
|
392
435
|
<CardContent className="space-y-4">
|
|
393
436
|
<div className="flex flex-wrap gap-4">
|
|
394
437
|
<Button
|
|
395
|
-
variant={showGPUInfo ? 'default' }
|
|
438
|
+
variant={showGPUInfo ? 'default' : 'outline'}
|
|
396
439
|
size="sm"
|
|
397
440
|
onClick={() => setShowGPUInfo(!showGPUInfo)}
|
|
398
441
|
>
|
|
399
|
-
{showGPUInfo ? 'Hide' } GPU Info
|
|
442
|
+
{showGPUInfo ? 'Hide' : 'Show'} GPU Info
|
|
400
443
|
</Button>
|
|
401
444
|
<Button
|
|
402
|
-
variant={showPerformanceMetrics ? 'default' }
|
|
445
|
+
variant={showPerformanceMetrics ? 'default' : 'outline'}
|
|
403
446
|
size="sm"
|
|
404
447
|
onClick={() => setShowPerformanceMetrics(!showPerformanceMetrics)}
|
|
405
448
|
>
|
|
406
|
-
{showPerformanceMetrics ? 'Hide' } Performance
|
|
449
|
+
{showPerformanceMetrics ? 'Hide' : 'Show'} Performance
|
|
407
450
|
</Button>
|
|
408
451
|
<Button
|
|
409
|
-
variant={showBatteryInfo ? 'default' }
|
|
452
|
+
variant={showBatteryInfo ? 'default' : 'outline'}
|
|
410
453
|
size="sm"
|
|
411
454
|
onClick={() => setShowBatteryInfo(!showBatteryInfo)}
|
|
412
455
|
>
|
|
413
|
-
{showBatteryInfo ? 'Hide' } Battery Info
|
|
456
|
+
{showBatteryInfo ? 'Hide' : 'Show'} Battery Info
|
|
414
457
|
</Button>
|
|
415
458
|
</div>
|
|
416
459
|
|
|
417
460
|
<div className="flex flex-wrap gap-4">
|
|
418
461
|
<Button
|
|
419
|
-
variant={enableHardwareAcceleration ? 'default' }
|
|
462
|
+
variant={enableHardwareAcceleration ? 'default' : 'outline'}
|
|
420
463
|
size="sm"
|
|
421
464
|
onClick={() => setEnableHardwareAcceleration(!enableHardwareAcceleration)}
|
|
422
465
|
>
|
|
423
|
-
{enableHardwareAcceleration ? 'Disable' } Hardware Acceleration
|
|
466
|
+
{enableHardwareAcceleration ? 'Disable' : 'Enable'} Hardware Acceleration
|
|
424
467
|
</Button>
|
|
425
468
|
<Button
|
|
426
|
-
variant={enableBatteryOptimization ? 'default' }
|
|
469
|
+
variant={enableBatteryOptimization ? 'default' : 'outline'}
|
|
427
470
|
size="sm"
|
|
428
471
|
onClick={() => setEnableBatteryOptimization(!enableBatteryOptimization)}
|
|
429
472
|
>
|
|
430
|
-
{enableBatteryOptimization ? 'Disable' } Battery Optimization
|
|
473
|
+
{enableBatteryOptimization ? 'Disable' : 'Enable'} Battery Optimization
|
|
431
474
|
</Button>
|
|
432
475
|
</div>
|
|
433
476
|
</CardContent>
|
|
@@ -444,25 +487,30 @@ export const HardwareAccelerationDemo= () => {
|
|
|
444
487
|
<CardContent>
|
|
445
488
|
<div className="space-y-3">
|
|
446
489
|
<div className="flex items-center justify-between">
|
|
447
|
-
<span className="text-sm">Hardware Acceleration
|
|
448
|
-
|
|
490
|
+
<span className="text-sm">Hardware Acceleration:</span>
|
|
491
|
+
<Badge variant={hardwareAcceleration.isHardwareAccelerated ? 'default' : 'secondary'}>
|
|
492
|
+
{hardwareAcceleration.isHardwareAccelerated ? 'Optimal' : 'Needs Optimization'}
|
|
449
493
|
</Badge>
|
|
450
494
|
</div>
|
|
451
495
|
<div className="flex items-center justify-between">
|
|
452
|
-
<span className="text-sm">Performance Level
|
|
496
|
+
<span className="text-sm">Performance Level:</span>
|
|
497
|
+
<Badge variant={
|
|
453
498
|
hardwareAcceleration.performanceLevel === 'excellent' || hardwareAcceleration.performanceLevel === 'good'
|
|
454
|
-
? 'default'
|
|
499
|
+
? 'default' : 'secondary'
|
|
500
|
+
}>
|
|
455
501
|
{hardwareAcceleration.performanceLevel.toUpperCase()}
|
|
456
502
|
</Badge>
|
|
457
503
|
</div>
|
|
458
504
|
<div className="flex items-center justify-between">
|
|
459
|
-
<span className="text-sm">Battery Optimization
|
|
460
|
-
|
|
505
|
+
<span className="text-sm">Battery Optimization:</span>
|
|
506
|
+
<Badge variant={batteryOptimization.isLowBattery ? 'secondary' : 'default'}>
|
|
507
|
+
{batteryOptimization.isLowBattery ? 'Needs Optimization' : 'Optimized'}
|
|
461
508
|
</Badge>
|
|
462
509
|
</div>
|
|
463
510
|
<div className="flex items-center justify-between">
|
|
464
|
-
<span className="text-sm">GPU Utilization
|
|
465
|
-
|
|
511
|
+
<span className="text-sm">GPU Utilization:</span>
|
|
512
|
+
<Badge variant={hardwareAcceleration.metrics.gpuUtilization < 80 ? 'default' : 'secondary'}>
|
|
513
|
+
{hardwareAcceleration.metrics.gpuUtilization < 80 ? 'Optimal' : 'High Usage'}
|
|
466
514
|
</Badge>
|
|
467
515
|
</div>
|
|
468
516
|
</div>
|
|
@@ -470,7 +518,8 @@ export const HardwareAccelerationDemo= () => {
|
|
|
470
518
|
{/* Recent Optimizations */}
|
|
471
519
|
{hardwareAcceleration.optimizations.length > 0 && (
|
|
472
520
|
<div className="mt-4 p-3 bg-cs-accent/10 rounded-lg">
|
|
473
|
-
<h4 className="font-medium text-sm mb-2">Recent Optimizations
|
|
521
|
+
<h4 className="font-medium text-sm mb-2">Recent Optimizations:</h4>
|
|
522
|
+
<ul className="text-xs text-cs-text-secondary space-y-1">
|
|
474
523
|
{hardwareAcceleration.optimizations.slice(-3).map((optimization, index) => (
|
|
475
524
|
<li key={index}>• {optimization}</li>
|
|
476
525
|
))}
|
|
@@ -481,7 +530,8 @@ export const HardwareAccelerationDemo= () => {
|
|
|
481
530
|
{/* Battery Recommendations */}
|
|
482
531
|
{batteryOptimization.optimizationRecommendations.length > 0 && (
|
|
483
532
|
<div className="mt-4 p-3 bg-cs-secondary/10 rounded-lg">
|
|
484
|
-
<h4 className="font-medium text-sm mb-2">Battery Recommendations
|
|
533
|
+
<h4 className="font-medium text-sm mb-2">Battery Recommendations:</h4>
|
|
534
|
+
<ul className="text-xs text-cs-text-secondary space-y-1">
|
|
485
535
|
{batteryOptimization.optimizationRecommendations.slice(0, 3).map((recommendation, index) => (
|
|
486
536
|
<li key={index}>• {recommendation}</li>
|
|
487
537
|
))}
|