@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/components/ui/accessibility-demo.esm.js +30 -24
- package/dist/components/ui/accessibility-demo.js +30 -24
- package/dist/components/ui/advanced-component-architecture-demo.esm.js +235 -179
- package/dist/components/ui/advanced-component-architecture-demo.js +235 -179
- package/dist/components/ui/advanced-transition-system-demo.esm.js +110 -64
- package/dist/components/ui/advanced-transition-system-demo.js +110 -64
- package/dist/components/ui/advanced-transition-system.esm.js +166 -122
- package/dist/components/ui/advanced-transition-system.js +166 -122
- package/dist/components/ui/animation/animated-container.esm.js +52 -29
- package/dist/components/ui/animation/animated-container.js +52 -29
- package/dist/components/ui/animation/staggered-container.esm.js +18 -9
- package/dist/components/ui/animation/staggered-container.js +18 -9
- package/dist/components/ui/animation-demo.esm.js +67 -35
- package/dist/components/ui/animation-demo.js +67 -35
- package/dist/components/ui/badge.esm.js +9 -6
- package/dist/components/ui/badge.js +9 -6
- package/dist/components/ui/battery-conscious-animation-demo.esm.js +122 -87
- package/dist/components/ui/battery-conscious-animation-demo.js +122 -87
- package/dist/components/ui/border-radius-shadow-demo.esm.js +23 -12
- package/dist/components/ui/border-radius-shadow-demo.js +23 -12
- package/dist/components/ui/button.esm.js +8 -2
- package/dist/components/ui/button.js +8 -2
- package/dist/components/ui/card.esm.js +33 -8
- package/dist/components/ui/card.js +33 -8
- package/dist/components/ui/checkbox.esm.js +3 -3
- package/dist/components/ui/checkbox.js +3 -3
- package/dist/components/ui/color-preview.esm.js +68 -45
- package/dist/components/ui/color-preview.js +68 -45
- package/dist/components/ui/data-display/chart.esm.js +112 -84
- package/dist/components/ui/data-display/chart.js +112 -84
- package/dist/components/ui/data-display/data-grid-simple.esm.js +1 -1
- package/dist/components/ui/data-display/data-grid-simple.js +1 -1
- package/dist/components/ui/data-display/data-grid.esm.js +80 -67
- package/dist/components/ui/data-display/data-grid.js +80 -67
- package/dist/components/ui/data-display/list.esm.js +53 -45
- package/dist/components/ui/data-display/list.js +53 -45
- package/dist/components/ui/data-display/table.esm.js +62 -54
- package/dist/components/ui/data-display/table.js +62 -54
- package/dist/components/ui/data-display/timeline.esm.js +39 -34
- package/dist/components/ui/data-display/timeline.js +39 -34
- package/dist/components/ui/data-display/tree.esm.js +116 -84
- package/dist/components/ui/data-display/tree.js +116 -84
- package/dist/components/ui/data-display/types.esm.js +389 -364
- package/dist/components/ui/data-display/types.js +389 -364
- package/dist/components/ui/enterprise-mobile-experience-demo.esm.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience-demo.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience.esm.js +124 -73
- package/dist/components/ui/enterprise-mobile-experience.js +124 -73
- package/dist/components/ui/feedback/alert.esm.js +22 -15
- package/dist/components/ui/feedback/alert.js +22 -15
- package/dist/components/ui/feedback/progress.esm.js +47 -24
- package/dist/components/ui/feedback/progress.js +47 -24
- package/dist/components/ui/feedback/skeleton.esm.js +39 -29
- package/dist/components/ui/feedback/skeleton.js +39 -29
- package/dist/components/ui/feedback/toast.esm.js +62 -38
- package/dist/components/ui/feedback/toast.js +62 -38
- package/dist/components/ui/feedback/types.esm.js +83 -83
- package/dist/components/ui/feedback/types.js +83 -83
- package/dist/components/ui/font-preview.esm.js +41 -39
- package/dist/components/ui/font-preview.js +41 -39
- package/dist/components/ui/form-demo.esm.js +150 -113
- package/dist/components/ui/form-demo.js +150 -113
- package/dist/components/ui/hardware-acceleration-demo.esm.js +137 -87
- package/dist/components/ui/hardware-acceleration-demo.js +137 -87
- package/dist/components/ui/input.esm.js +4 -1
- package/dist/components/ui/input.js +4 -1
- package/dist/components/ui/layout-demo.esm.js +81 -56
- package/dist/components/ui/layout-demo.js +81 -56
- package/dist/components/ui/layouts/adaptive-layout.esm.js +27 -8
- package/dist/components/ui/layouts/adaptive-layout.js +27 -8
- package/dist/components/ui/layouts/desktop-layout.esm.js +39 -19
- package/dist/components/ui/layouts/desktop-layout.js +39 -19
- package/dist/components/ui/layouts/mobile-layout.esm.js +19 -9
- package/dist/components/ui/layouts/mobile-layout.js +19 -9
- package/dist/components/ui/layouts/tablet-layout.esm.js +28 -14
- package/dist/components/ui/layouts/tablet-layout.js +28 -14
- package/dist/components/ui/mobile-form-validation.esm.js +120 -87
- package/dist/components/ui/mobile-form-validation.js +120 -87
- package/dist/components/ui/mobile-input-demo.esm.js +19 -13
- package/dist/components/ui/mobile-input-demo.js +19 -13
- package/dist/components/ui/mobile-input.esm.js +185 -120
- package/dist/components/ui/mobile-input.js +185 -120
- package/dist/components/ui/mobile-skeleton-loading-demo.esm.js +128 -111
- package/dist/components/ui/mobile-skeleton-loading-demo.js +128 -111
- package/dist/components/ui/navigation/breadcrumb.esm.js +17 -14
- package/dist/components/ui/navigation/breadcrumb.js +17 -14
- package/dist/components/ui/navigation/index.esm.js +23 -1
- package/dist/components/ui/navigation/index.js +23 -1
- package/dist/components/ui/navigation/menu.esm.js +49 -35
- package/dist/components/ui/navigation/menu.js +49 -35
- package/dist/components/ui/navigation/navigation-demo.esm.js +81 -74
- package/dist/components/ui/navigation/navigation-demo.js +81 -74
- package/dist/components/ui/navigation/pagination.esm.js +62 -50
- package/dist/components/ui/navigation/pagination.js +62 -50
- package/dist/components/ui/navigation/sidebar.esm.js +56 -42
- package/dist/components/ui/navigation/sidebar.js +56 -42
- package/dist/components/ui/navigation/stepper.esm.js +34 -23
- package/dist/components/ui/navigation/stepper.js +34 -23
- package/dist/components/ui/navigation/tabs.esm.js +32 -21
- package/dist/components/ui/navigation/tabs.js +32 -21
- package/dist/components/ui/navigation/types.esm.js +196 -195
- package/dist/components/ui/navigation/types.js +196 -195
- package/dist/components/ui/overlay/backdrop.esm.js +17 -16
- package/dist/components/ui/overlay/backdrop.js +17 -16
- package/dist/components/ui/overlay/focus-manager.esm.js +21 -19
- package/dist/components/ui/overlay/focus-manager.js +21 -19
- package/dist/components/ui/overlay/index.esm.js +22 -2
- package/dist/components/ui/overlay/index.js +22 -2
- package/dist/components/ui/overlay/modal.esm.js +38 -34
- package/dist/components/ui/overlay/modal.js +38 -34
- package/dist/components/ui/overlay/overlay-manager.esm.js +25 -20
- package/dist/components/ui/overlay/overlay-manager.js +25 -20
- package/dist/components/ui/overlay/popover.esm.js +74 -58
- package/dist/components/ui/overlay/popover.js +74 -58
- package/dist/components/ui/overlay/portal.esm.js +7 -7
- package/dist/components/ui/overlay/portal.js +7 -7
- package/dist/components/ui/overlay/tooltip.esm.js +54 -39
- package/dist/components/ui/overlay/tooltip.js +54 -39
- package/dist/components/ui/overlay/types.esm.js +132 -131
- package/dist/components/ui/overlay/types.js +132 -131
- package/dist/components/ui/performance-demo.esm.js +135 -88
- package/dist/components/ui/performance-demo.js +135 -88
- package/dist/components/ui/semantic-input-system-demo.esm.js +117 -80
- package/dist/components/ui/semantic-input-system-demo.js +117 -80
- package/dist/components/ui/theme-customizer.esm.js +84 -52
- package/dist/components/ui/theme-customizer.js +84 -52
- package/dist/components/ui/theme-preview.esm.js +95 -43
- package/dist/components/ui/theme-preview.js +95 -43
- package/dist/components/ui/theme-switcher.esm.js +70 -44
- package/dist/components/ui/theme-switcher.js +70 -44
- package/dist/components/ui/theme-toggle.esm.js +3 -3
- package/dist/components/ui/theme-toggle.js +3 -3
- package/dist/components/ui/token-demo.esm.js +33 -21
- package/dist/components/ui/token-demo.js +33 -21
- package/dist/components/ui/touch-demo.esm.js +102 -73
- package/dist/components/ui/touch-demo.js +102 -73
- package/dist/components/ui/touch-friendly-interface-demo.esm.js +102 -64
- package/dist/components/ui/touch-friendly-interface-demo.js +102 -64
- package/dist/components/ui/touch-friendly-interface.esm.js +85 -61
- package/dist/components/ui/touch-friendly-interface.js +85 -61
- package/dist/hooks/use-accessibility-support.esm.js +115 -85
- package/dist/hooks/use-accessibility-support.js +115 -85
- package/dist/hooks/use-adaptive-layout.esm.js +56 -33
- package/dist/hooks/use-adaptive-layout.js +56 -33
- package/dist/hooks/use-advanced-patterns.esm.js +57 -42
- package/dist/hooks/use-advanced-patterns.js +57 -42
- package/dist/hooks/use-advanced-transition-system.esm.js +112 -71
- package/dist/hooks/use-advanced-transition-system.js +112 -71
- package/dist/hooks/use-animation-profile.esm.js +63 -34
- package/dist/hooks/use-animation-profile.js +63 -34
- package/dist/hooks/use-battery-animations.esm.js +80 -55
- package/dist/hooks/use-battery-animations.js +80 -55
- package/dist/hooks/use-battery-conscious-loading.esm.js +166 -123
- package/dist/hooks/use-battery-conscious-loading.js +166 -123
- package/dist/hooks/use-battery-optimization.esm.js +78 -55
- package/dist/hooks/use-battery-optimization.js +78 -55
- package/dist/hooks/use-battery-status.esm.js +73 -51
- package/dist/hooks/use-battery-status.js +73 -51
- package/dist/hooks/use-component-performance.esm.js +62 -47
- package/dist/hooks/use-component-performance.js +62 -47
- package/dist/hooks/use-device-loading-states.esm.js +152 -109
- package/dist/hooks/use-device-loading-states.js +152 -109
- package/dist/hooks/use-device.esm.js +25 -14
- package/dist/hooks/use-device.js +25 -14
- package/dist/hooks/use-enterprise-mobile-experience.esm.js +137 -88
- package/dist/hooks/use-enterprise-mobile-experience.js +137 -88
- package/dist/hooks/use-form-feedback.esm.js +124 -81
- package/dist/hooks/use-form-feedback.js +124 -81
- package/dist/hooks/use-form-performance.esm.js +127 -92
- package/dist/hooks/use-form-performance.js +127 -92
- package/dist/hooks/use-frame-rate.esm.js +56 -37
- package/dist/hooks/use-frame-rate.js +56 -37
- package/dist/hooks/use-gestures.esm.js +96 -72
- package/dist/hooks/use-gestures.js +96 -72
- package/dist/hooks/use-hardware-acceleration.esm.js +65 -37
- package/dist/hooks/use-hardware-acceleration.js +65 -37
- package/dist/hooks/use-input-accessibility.esm.js +157 -119
- package/dist/hooks/use-input-accessibility.js +157 -119
- package/dist/hooks/use-input-performance.esm.js +139 -104
- package/dist/hooks/use-input-performance.js +139 -104
- package/dist/hooks/use-layout-performance.esm.js +50 -29
- package/dist/hooks/use-layout-performance.js +50 -29
- package/dist/hooks/use-loading-accessibility.esm.js +209 -169
- package/dist/hooks/use-loading-accessibility.js +209 -169
- package/dist/hooks/use-loading-performance.esm.js +117 -93
- package/dist/hooks/use-loading-performance.js +117 -93
- package/dist/hooks/use-memory-usage.esm.js +57 -38
- package/dist/hooks/use-memory-usage.js +57 -38
- package/dist/hooks/use-mobile-form-layout.esm.js +111 -74
- package/dist/hooks/use-mobile-form-layout.js +111 -74
- package/dist/hooks/use-mobile-form-validation.esm.js +211 -144
- package/dist/hooks/use-mobile-form-validation.js +211 -144
- package/dist/hooks/use-mobile-keyboard-optimization.esm.js +154 -113
- package/dist/hooks/use-mobile-keyboard-optimization.js +154 -113
- package/dist/hooks/use-mobile-layout.esm.js +73 -51
- package/dist/hooks/use-mobile-layout.js +73 -51
- package/dist/hooks/use-mobile-optimization.esm.js +72 -44
- package/dist/hooks/use-mobile-optimization.js +72 -44
- package/dist/hooks/use-mobile-skeleton.esm.js +97 -64
- package/dist/hooks/use-mobile-skeleton.js +97 -64
- package/dist/hooks/use-mobile-touch.esm.js +128 -93
- package/dist/hooks/use-mobile-touch.js +128 -93
- package/dist/hooks/use-performance-throttling.esm.js +72 -48
- package/dist/hooks/use-performance-throttling.js +72 -48
- package/dist/hooks/use-performance.esm.js +90 -52
- package/dist/hooks/use-performance.js +90 -52
- package/dist/hooks/use-reusable-architecture.esm.js +94 -65
- package/dist/hooks/use-reusable-architecture.js +94 -65
- package/dist/hooks/use-semantic-input-types.esm.js +166 -124
- package/dist/hooks/use-semantic-input-types.js +166 -124
- package/dist/hooks/use-semantic-input.esm.js +178 -126
- package/dist/hooks/use-semantic-input.js +178 -126
- package/dist/hooks/use-tablet-layout.esm.js +67 -38
- package/dist/hooks/use-tablet-layout.js +67 -38
- package/dist/hooks/use-touch-friendly-input.esm.js +193 -149
- package/dist/hooks/use-touch-friendly-input.js +193 -149
- package/dist/hooks/use-touch-friendly-interface.esm.js +99 -67
- package/dist/hooks/use-touch-friendly-interface.js +99 -67
- package/dist/hooks/use-touch-optimization.esm.js +99 -72
- package/dist/hooks/use-touch-optimization.js +99 -72
- package/dist/index.esm.js +289 -280
- package/dist/index.js +289 -280
- package/dist/lib/utils.esm.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/plugins/theme-css-generator.esm.js +104 -55
- package/dist/plugins/theme-css-generator.js +104 -55
- package/dist/provider.esm.js +4 -4
- package/dist/provider.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/theme.esm.js +633 -468
- package/dist/theme.js +633 -468
- package/dist/themes/ThemeContext.esm.js +15 -15
- package/dist/themes/ThemeContext.js +15 -15
- package/dist/themes/ThemeProvider.esm.js +25 -22
- package/dist/themes/ThemeProvider.js +25 -22
- package/dist/themes/accessibility.esm.js +147 -108
- package/dist/themes/accessibility.js +147 -108
- package/dist/themes/aria-patterns.esm.js +198 -162
- package/dist/themes/aria-patterns.js +198 -162
- package/dist/themes/base-themes.esm.js +14 -11
- package/dist/themes/base-themes.js +14 -11
- package/dist/themes/colorManager.esm.js +101 -83
- package/dist/themes/colorManager.js +101 -83
- package/dist/themes/examples/dark-theme.esm.js +133 -103
- package/dist/themes/examples/dark-theme.js +133 -103
- package/dist/themes/examples/minimal-theme.esm.js +83 -61
- package/dist/themes/examples/minimal-theme.js +83 -61
- package/dist/themes/focus-management.esm.js +202 -143
- package/dist/themes/focus-management.js +202 -143
- package/dist/themes/fontLoader.esm.js +28 -19
- package/dist/themes/fontLoader.js +28 -19
- package/dist/themes/high-contrast.esm.js +152 -104
- package/dist/themes/high-contrast.js +152 -104
- package/dist/themes/inheritance.esm.js +35 -27
- package/dist/themes/inheritance.js +35 -27
- package/dist/themes/keyboard-navigation.esm.js +152 -123
- package/dist/themes/keyboard-navigation.js +152 -123
- package/dist/themes/motion-reduction.esm.js +193 -133
- package/dist/themes/motion-reduction.js +193 -133
- package/dist/themes/navigation.esm.js +146 -146
- package/dist/themes/navigation.js +146 -146
- package/dist/themes/screen-reader.esm.js +159 -94
- package/dist/themes/screen-reader.js +159 -94
- package/dist/themes/systemThemeDetector.esm.js +42 -34
- package/dist/themes/systemThemeDetector.js +42 -34
- package/dist/themes/themeCSSUpdater.esm.js +21 -9
- package/dist/themes/themeCSSUpdater.js +21 -9
- package/dist/themes/themePersistence.esm.js +68 -47
- package/dist/themes/themePersistence.js +68 -47
- package/dist/themes/themes/stan-design.esm.js +633 -468
- package/dist/themes/themes/stan-design.js +633 -468
- package/dist/themes/types.esm.js +301 -287
- package/dist/themes/types.js +301 -287
- package/dist/themes/useSystemTheme.esm.js +4 -4
- package/dist/themes/useSystemTheme.js +4 -4
- package/dist/themes/useTheme.esm.js +4 -4
- package/dist/themes/useTheme.js +4 -4
- package/dist/themes/validation.esm.js +128 -77
- package/dist/themes/validation.js +128 -77
- package/dist/tokens/index.esm.js +15 -4
- package/dist/tokens/index.js +15 -4
- package/dist/tokens/tokenExporter.esm.js +87 -61
- package/dist/tokens/tokenExporter.js +87 -61
- package/dist/tokens/tokenGenerator.esm.js +86 -77
- package/dist/tokens/tokenGenerator.js +86 -77
- package/dist/tokens/tokenManager.esm.js +64 -51
- package/dist/tokens/tokenManager.js +64 -51
- package/dist/tokens/tokenValidator.esm.js +193 -147
- package/dist/tokens/tokenValidator.js +193 -147
- package/dist/tokens/types.esm.js +49 -35
- package/dist/tokens/types.js +49 -35
- package/dist/utils/bundle-analyzer.esm.js +83 -65
- package/dist/utils/bundle-analyzer.js +83 -65
- package/dist/utils/bundle-splitting.esm.js +142 -117
- package/dist/utils/bundle-splitting.js +142 -117
- package/dist/utils/lazy-loading.esm.js +132 -106
- package/dist/utils/lazy-loading.js +132 -106
- package/dist/utils/performance-monitor.esm.js +170 -129
- package/dist/utils/performance-monitor.js +170 -129
- package/dist/utils/tree-shaking.esm.js +69 -61
- package/dist/utils/tree-shaking.js +69 -61
- package/package.json +1 -1
- package/src/index.ts +146 -146
|
@@ -3,9 +3,15 @@ import { cn } from '../../../lib/utils'
|
|
|
3
3
|
import { useAnimationProfile } from '../../../hooks/use-animation-profile'
|
|
4
4
|
|
|
5
5
|
export interface AnimatedContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
animation
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
animation?: 'fadeIn' | 'slideIn' | 'scaleIn' | 'bounce' | 'none'
|
|
7
|
+
duration?: 'fast' | 'normal' | 'slow'
|
|
8
|
+
easing?: 'ease' | 'easeIn' | 'easeOut' | 'easeInOut' | 'bounce'
|
|
9
|
+
delay?: number
|
|
10
|
+
stagger?: number
|
|
11
|
+
onAnimationStart?: () => void
|
|
12
|
+
onAnimationEnd?: () => void
|
|
13
|
+
children: React.ReactNode
|
|
14
|
+
}
|
|
9
15
|
|
|
10
16
|
export const AnimatedContainer = forwardRef<HTMLDivElement, AnimatedContainerProps>(
|
|
11
17
|
(
|
|
@@ -59,11 +65,12 @@ export const AnimatedContainer = forwardRef<HTMLDivElement, AnimatedContainerPro
|
|
|
59
65
|
element.style.transform = getInitialTransform(animation)
|
|
60
66
|
|
|
61
67
|
// Apply animation
|
|
62
|
-
const animationOptions= {
|
|
63
|
-
duration) * 1000,
|
|
64
|
-
easing,
|
|
65
|
-
delay) * 1000,
|
|
66
|
-
fill
|
|
68
|
+
const animationOptions: KeyframeAnimationOptions = {
|
|
69
|
+
duration: parseFloat(optimizedDuration) * 1000,
|
|
70
|
+
easing: optimizedEasing,
|
|
71
|
+
delay: (delay + stagger) * 1000,
|
|
72
|
+
fill: 'forwards'
|
|
73
|
+
}
|
|
67
74
|
|
|
68
75
|
const keyframes = getKeyframes(animation)
|
|
69
76
|
const anim = element.animate(keyframes, animationOptions)
|
|
@@ -86,30 +93,45 @@ export const AnimatedContainer = forwardRef<HTMLDivElement, AnimatedContainerPro
|
|
|
86
93
|
}
|
|
87
94
|
}, [animation, optimizedDuration, optimizedEasing, delay, stagger, shouldDisable, onAnimationStart, onAnimationEnd])
|
|
88
95
|
|
|
89
|
-
const getInitialTransform = (anim)=> {
|
|
96
|
+
const getInitialTransform = (anim: string): string => {
|
|
90
97
|
switch (anim) {
|
|
91
|
-
case 'slideIn'
|
|
92
|
-
|
|
93
|
-
case '
|
|
94
|
-
|
|
98
|
+
case 'slideIn':
|
|
99
|
+
return 'translateX(-100%)'
|
|
100
|
+
case 'scaleIn':
|
|
101
|
+
return 'scale(0.8)'
|
|
102
|
+
case 'bounce':
|
|
103
|
+
return 'translateY(-20px)'
|
|
104
|
+
default:
|
|
105
|
+
return 'none'
|
|
106
|
+
}
|
|
95
107
|
}
|
|
96
108
|
|
|
97
|
-
const getKeyframes = (anim)] => {
|
|
109
|
+
const getKeyframes = (anim: string): Keyframe[] => {
|
|
98
110
|
switch (anim) {
|
|
99
|
-
case 'fadeIn'
|
|
100
|
-
|
|
111
|
+
case 'fadeIn':
|
|
112
|
+
return [
|
|
113
|
+
{ opacity: 0, transform: 'none' },
|
|
114
|
+
{ opacity: 1, transform: 'none' }
|
|
101
115
|
]
|
|
102
|
-
case 'slideIn'
|
|
103
|
-
|
|
116
|
+
case 'slideIn':
|
|
117
|
+
return [
|
|
118
|
+
{ opacity: 0, transform: 'translateX(-100%)' },
|
|
119
|
+
{ opacity: 1, transform: 'translateX(0)' }
|
|
104
120
|
]
|
|
105
|
-
case 'scaleIn'
|
|
106
|
-
|
|
121
|
+
case 'scaleIn':
|
|
122
|
+
return [
|
|
123
|
+
{ opacity: 0, transform: 'scale(0.8)' },
|
|
124
|
+
{ opacity: 1, transform: 'scale(1)' }
|
|
107
125
|
]
|
|
108
|
-
case 'bounce'
|
|
109
|
-
|
|
126
|
+
case 'bounce':
|
|
127
|
+
return [
|
|
128
|
+
{ opacity: 0, transform: 'translateY(-20px)' },
|
|
129
|
+
{ opacity: 1, transform: 'translateY(0)' }
|
|
110
130
|
]
|
|
111
|
-
default
|
|
112
|
-
|
|
131
|
+
default:
|
|
132
|
+
return [
|
|
133
|
+
{ opacity: 0 },
|
|
134
|
+
{ opacity: 1 }
|
|
113
135
|
]
|
|
114
136
|
}
|
|
115
137
|
}
|
|
@@ -118,8 +140,9 @@ export const AnimatedContainer = forwardRef<HTMLDivElement, AnimatedContainerPro
|
|
|
118
140
|
'coach-stan-animation-base',
|
|
119
141
|
animationClasses,
|
|
120
142
|
{
|
|
121
|
-
'opacity-0',
|
|
122
|
-
'pointer-events-none'
|
|
143
|
+
'opacity-0': !hasAnimated && !shouldDisable,
|
|
144
|
+
'pointer-events-none': isAnimating
|
|
145
|
+
},
|
|
123
146
|
className
|
|
124
147
|
)
|
|
125
148
|
|
|
@@ -128,9 +151,9 @@ export const AnimatedContainer = forwardRef<HTMLDivElement, AnimatedContainerPro
|
|
|
128
151
|
ref={finalRef}
|
|
129
152
|
className={containerClassName}
|
|
130
153
|
style={{
|
|
131
|
-
'--animation-duration',
|
|
132
|
-
'--animation-easing',
|
|
133
|
-
'--animation-delay'}s`
|
|
154
|
+
'--animation-duration': optimizedDuration,
|
|
155
|
+
'--animation-easing': optimizedEasing,
|
|
156
|
+
'--animation-delay': `${delay + stagger}s`
|
|
134
157
|
} as React.CSSProperties}
|
|
135
158
|
{...props}
|
|
136
159
|
>
|
|
@@ -3,9 +3,13 @@ import { cn } from '../../../lib/utils'
|
|
|
3
3
|
import { AnimatedContainer, AnimatedContainerProps } from './animated-container'
|
|
4
4
|
|
|
5
5
|
export interface StaggeredContainerProps extends Omit<AnimatedContainerProps, 'children'> {
|
|
6
|
-
children
|
|
6
|
+
children: React.ReactNode
|
|
7
|
+
staggerDelay?: number
|
|
8
|
+
staggerDirection?: 'forward' | 'reverse' | 'center'
|
|
9
|
+
staggerEasing?: 'linear' | 'ease' | 'easeIn' | 'easeOut' | 'easeInOut'
|
|
10
|
+
}
|
|
7
11
|
|
|
8
|
-
export const StaggeredContainer= ({
|
|
12
|
+
export const StaggeredContainer: React.FC<StaggeredContainerProps> = ({
|
|
9
13
|
children,
|
|
10
14
|
staggerDelay = 0.1,
|
|
11
15
|
staggerDirection = 'forward',
|
|
@@ -16,16 +20,21 @@ export const StaggeredContainer= ({
|
|
|
16
20
|
const childrenArray = Children.toArray(children)
|
|
17
21
|
const totalChildren = childrenArray.length
|
|
18
22
|
|
|
19
|
-
const getStaggerDelay = (index)=> {
|
|
23
|
+
const getStaggerDelay = (index: number): number => {
|
|
20
24
|
switch (staggerDirection) {
|
|
21
|
-
case 'reverse'
|
|
22
|
-
|
|
25
|
+
case 'reverse':
|
|
26
|
+
return (totalChildren - 1 - index) * staggerDelay
|
|
27
|
+
case 'center':
|
|
28
|
+
const centerIndex = Math.floor(totalChildren / 2)
|
|
23
29
|
const distanceFromCenter = Math.abs(index - centerIndex)
|
|
24
30
|
return distanceFromCenter * staggerDelay
|
|
25
|
-
case 'forward'
|
|
31
|
+
case 'forward':
|
|
32
|
+
default:
|
|
33
|
+
return index * staggerDelay
|
|
34
|
+
}
|
|
26
35
|
}
|
|
27
36
|
|
|
28
|
-
const renderChild = (child, index)=> {
|
|
37
|
+
const renderChild = (child: React.ReactNode, index: number): ReactElement | null => {
|
|
29
38
|
if (!isValidElement(child)) {
|
|
30
39
|
return null
|
|
31
40
|
}
|
|
@@ -34,8 +43,8 @@ export const StaggeredContainer= ({
|
|
|
34
43
|
if (child.type === AnimatedContainer) {
|
|
35
44
|
return cloneElement(child, {
|
|
36
45
|
...child.props,
|
|
37
|
-
stagger),
|
|
38
|
-
key}`
|
|
46
|
+
stagger: getStaggerDelay(index),
|
|
47
|
+
key: `staggered-${index}`
|
|
39
48
|
})
|
|
40
49
|
}
|
|
41
50
|
|
|
@@ -3,9 +3,13 @@ import { cn } from '../../../lib/utils'
|
|
|
3
3
|
import { AnimatedContainer, AnimatedContainerProps } from './animated-container'
|
|
4
4
|
|
|
5
5
|
export interface StaggeredContainerProps extends Omit<AnimatedContainerProps, 'children'> {
|
|
6
|
-
children
|
|
6
|
+
children: React.ReactNode
|
|
7
|
+
staggerDelay?: number
|
|
8
|
+
staggerDirection?: 'forward' | 'reverse' | 'center'
|
|
9
|
+
staggerEasing?: 'linear' | 'ease' | 'easeIn' | 'easeOut' | 'easeInOut'
|
|
10
|
+
}
|
|
7
11
|
|
|
8
|
-
export const StaggeredContainer= ({
|
|
12
|
+
export const StaggeredContainer: React.FC<StaggeredContainerProps> = ({
|
|
9
13
|
children,
|
|
10
14
|
staggerDelay = 0.1,
|
|
11
15
|
staggerDirection = 'forward',
|
|
@@ -16,16 +20,21 @@ export const StaggeredContainer= ({
|
|
|
16
20
|
const childrenArray = Children.toArray(children)
|
|
17
21
|
const totalChildren = childrenArray.length
|
|
18
22
|
|
|
19
|
-
const getStaggerDelay = (index)=> {
|
|
23
|
+
const getStaggerDelay = (index: number): number => {
|
|
20
24
|
switch (staggerDirection) {
|
|
21
|
-
case 'reverse'
|
|
22
|
-
|
|
25
|
+
case 'reverse':
|
|
26
|
+
return (totalChildren - 1 - index) * staggerDelay
|
|
27
|
+
case 'center':
|
|
28
|
+
const centerIndex = Math.floor(totalChildren / 2)
|
|
23
29
|
const distanceFromCenter = Math.abs(index - centerIndex)
|
|
24
30
|
return distanceFromCenter * staggerDelay
|
|
25
|
-
case 'forward'
|
|
31
|
+
case 'forward':
|
|
32
|
+
default:
|
|
33
|
+
return index * staggerDelay
|
|
34
|
+
}
|
|
26
35
|
}
|
|
27
36
|
|
|
28
|
-
const renderChild = (child, index)=> {
|
|
37
|
+
const renderChild = (child: React.ReactNode, index: number): ReactElement | null => {
|
|
29
38
|
if (!isValidElement(child)) {
|
|
30
39
|
return null
|
|
31
40
|
}
|
|
@@ -34,8 +43,8 @@ export const StaggeredContainer= ({
|
|
|
34
43
|
if (child.type === AnimatedContainer) {
|
|
35
44
|
return cloneElement(child, {
|
|
36
45
|
...child.props,
|
|
37
|
-
stagger),
|
|
38
|
-
key}`
|
|
46
|
+
stagger: getStaggerDelay(index),
|
|
47
|
+
key: `staggered-${index}`
|
|
39
48
|
})
|
|
40
49
|
}
|
|
41
50
|
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from './animation'
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
export const AnimationDemo= () => {
|
|
13
|
+
export const AnimationDemo: React.FC = () => {
|
|
14
14
|
const [currentAnimation, setCurrentAnimation] = useState<'fadeIn' | 'slideIn' | 'scaleIn' | 'bounce'>('fadeIn')
|
|
15
15
|
const [isAnimating, setIsAnimating] = useState(false)
|
|
16
16
|
|
|
@@ -18,13 +18,13 @@ export const AnimationDemo= () => {
|
|
|
18
18
|
const { performanceMode, shouldOptimizeForBattery } = usePerformanceMode()
|
|
19
19
|
|
|
20
20
|
const animations = [
|
|
21
|
-
{ key, label, icon},
|
|
22
|
-
{ key, label, icon},
|
|
23
|
-
{ key, label, icon},
|
|
24
|
-
{ key, label, icon}
|
|
21
|
+
{ key: 'fadeIn' as const, label: 'Fade In', icon: '✨' },
|
|
22
|
+
{ key: 'slideIn' as const, label: 'Slide In', icon: '➡️' },
|
|
23
|
+
{ key: 'scaleIn' as const, label: 'Scale In', icon: '🔍' },
|
|
24
|
+
{ key: 'bounce' as const, label: 'Bounce', icon: '🎾' }
|
|
25
25
|
]
|
|
26
26
|
|
|
27
|
-
const handleAnimationChange = (animation) => {
|
|
27
|
+
const handleAnimationChange = (animation: typeof currentAnimation) => {
|
|
28
28
|
setCurrentAnimation(animation)
|
|
29
29
|
setIsAnimating(true)
|
|
30
30
|
|
|
@@ -33,24 +33,31 @@ export const AnimationDemo= () => {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const performanceIndicators = [
|
|
36
|
-
{ label, value, unit, color},
|
|
37
|
-
{ label, value) , unit, color},
|
|
38
|
-
{ label, value) , unit, color}
|
|
36
|
+
{ label: 'FPS', value: performanceMetrics.fps, unit: '', color: performanceMetrics.fps > 50 ? 'green' : performanceMetrics.fps > 30 ? 'yellow' : 'red' },
|
|
37
|
+
{ label: 'Memory', value: performanceMetrics.memoryUsage ? Math.round(performanceMetrics.memoryUsage * 100) : 'N/A', unit: '%', color: 'blue' },
|
|
38
|
+
{ label: 'Battery', value: performanceMetrics.batteryLevel ? Math.round(performanceMetrics.batteryLevel * 100) : 'N/A', unit: '%', color: performanceMetrics.isLowPowerMode ? 'red' : 'green' }
|
|
39
39
|
]
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<div className="space-y-6 p-6">
|
|
43
43
|
<div className="text-center">
|
|
44
44
|
<h1 className="text-3xl font-bold mb-2">Mobile-First Animation System</h1>
|
|
45
|
-
<p className="text-gray-600 dark
|
|
45
|
+
<p className="text-gray-600 dark:text-gray-400">
|
|
46
|
+
Device-specific animations with performance optimization and battery awareness
|
|
47
|
+
</p>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
{/* Performance Metrics */}
|
|
46
51
|
<Card className="p-4">
|
|
47
52
|
<h2 className="text-xl font-semibold mb-4">Performance Metrics</h2>
|
|
48
|
-
<div className="grid grid-cols-1 md
|
|
53
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
54
|
+
{performanceIndicators.map((indicator) => (
|
|
49
55
|
<div key={indicator.label} className="text-center">
|
|
50
56
|
<div className={`text-2xl font-bold text-${indicator.color}-600`}>
|
|
51
57
|
{indicator.value}{indicator.unit}
|
|
52
58
|
</div>
|
|
53
|
-
<div className="text-sm text-gray-600 dark
|
|
59
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">
|
|
60
|
+
{indicator.label}
|
|
54
61
|
</div>
|
|
55
62
|
</div>
|
|
56
63
|
))}
|
|
@@ -58,18 +65,21 @@ export const AnimationDemo= () => {
|
|
|
58
65
|
|
|
59
66
|
<div className="mt-4 space-y-2">
|
|
60
67
|
<div className="flex items-center justify-between">
|
|
61
|
-
<span>Performance Mode
|
|
68
|
+
<span>Performance Mode:</span>
|
|
69
|
+
<Badge variant={performanceMode === 'high' ? 'default' : performanceMode === 'medium' ? 'secondary' : 'destructive'}>
|
|
62
70
|
{performanceMode.toUpperCase()}
|
|
63
71
|
</Badge>
|
|
64
72
|
</div>
|
|
65
73
|
<div className="flex items-center justify-between">
|
|
66
|
-
<span>Battery Optimization
|
|
67
|
-
|
|
74
|
+
<span>Battery Optimization:</span>
|
|
75
|
+
<Badge variant={shouldOptimizeForBattery ? 'destructive' : 'default'}>
|
|
76
|
+
{shouldOptimizeForBattery ? 'Enabled' : 'Disabled'}
|
|
68
77
|
</Badge>
|
|
69
78
|
</div>
|
|
70
79
|
<div className="flex items-center justify-between">
|
|
71
|
-
<span>Reduced Motion
|
|
72
|
-
|
|
80
|
+
<span>Reduced Motion:</span>
|
|
81
|
+
<Badge variant={profile.performance.reducedMotion ? 'destructive' : 'default'}>
|
|
82
|
+
{profile.performance.reducedMotion ? 'Enabled' : 'Disabled'}
|
|
73
83
|
</Badge>
|
|
74
84
|
</div>
|
|
75
85
|
</div>
|
|
@@ -78,22 +88,34 @@ export const AnimationDemo= () => {
|
|
|
78
88
|
{/* Device Information */}
|
|
79
89
|
<Card className="p-4">
|
|
80
90
|
<h2 className="text-xl font-semibold mb-4">Device Profile</h2>
|
|
81
|
-
<div className="grid grid-cols-2 md
|
|
91
|
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
|
92
|
+
<div className="text-center">
|
|
82
93
|
<div className="text-lg font-semibold">{deviceInfo.screenSize}</div>
|
|
83
|
-
<div className="text-sm text-gray-600 dark
|
|
94
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">Screen Size</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div className="text-center">
|
|
84
97
|
<div className="text-lg font-semibold">{deviceInfo.orientation}</div>
|
|
85
|
-
<div className="text-sm text-gray-600 dark
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<div className="text-lg font-semibold">{deviceInfo.
|
|
89
|
-
<div className="text-sm text-gray-600 dark
|
|
98
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">Orientation</div>
|
|
99
|
+
</div>
|
|
100
|
+
<div className="text-center">
|
|
101
|
+
<div className="text-lg font-semibold">{deviceInfo.touchDevice ? 'Touch' : 'Mouse'}</div>
|
|
102
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">Input Type</div>
|
|
103
|
+
</div>
|
|
104
|
+
<div className="text-center">
|
|
105
|
+
<div className="text-lg font-semibold">{deviceInfo.isMobile ? 'Mobile' : deviceInfo.isTablet ? 'Tablet' : 'Desktop'}</div>
|
|
106
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">Device Type</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</Card>
|
|
110
|
+
|
|
111
|
+
{/* Animation Controls */}
|
|
90
112
|
<Card className="p-4">
|
|
91
113
|
<h2 className="text-xl font-semibold mb-4">Animation Controls</h2>
|
|
92
114
|
<div className="flex flex-wrap gap-2 mb-4">
|
|
93
115
|
{animations.map((animation) => (
|
|
94
116
|
<Button
|
|
95
117
|
key={animation.key}
|
|
96
|
-
variant={currentAnimation === animation.key ? 'default' }
|
|
118
|
+
variant={currentAnimation === animation.key ? 'default' : 'outline'}
|
|
97
119
|
onClick={() => handleAnimationChange(animation.key)}
|
|
98
120
|
disabled={isAnimating}
|
|
99
121
|
className="flex items-center gap-2"
|
|
@@ -104,16 +126,19 @@ export const AnimationDemo= () => {
|
|
|
104
126
|
))}
|
|
105
127
|
</div>
|
|
106
128
|
|
|
107
|
-
<div className="grid grid-cols-1 md
|
|
129
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
130
|
+
<div>
|
|
131
|
+
<label className="block text-sm font-medium mb-2">Current Animation Profile</label>
|
|
108
132
|
<div className="space-y-2 text-sm">
|
|
109
|
-
<div>Duration}</div>
|
|
110
|
-
<div>Easing}</div>
|
|
111
|
-
<div>Performance}</div>
|
|
133
|
+
<div>Duration: {profile.duration.normal}</div>
|
|
134
|
+
<div>Easing: {profile.easing.ease}</div>
|
|
135
|
+
<div>Performance: {profile.performance.mode}</div>
|
|
112
136
|
</div>
|
|
113
137
|
</div>
|
|
114
138
|
<div>
|
|
115
139
|
<label className="block text-sm font-medium mb-2">Animation Classes</label>
|
|
116
|
-
<div className="text-xs bg-gray-100 dark
|
|
140
|
+
<div className="text-xs bg-gray-100 dark:bg-gray-800 p-2 rounded">
|
|
141
|
+
{deviceInfo.isMobile && 'coach-stan-mobile-animation '}
|
|
117
142
|
{deviceInfo.isTablet && 'coach-stan-tablet-animation '}
|
|
118
143
|
{deviceInfo.isDesktop && 'coach-stan-desktop-animation '}
|
|
119
144
|
{shouldOptimizeForBattery && 'coach-stan-battery-saver '}
|
|
@@ -152,7 +177,9 @@ export const AnimationDemo= () => {
|
|
|
152
177
|
duration="fast"
|
|
153
178
|
staggerDelay={0.1}
|
|
154
179
|
staggerDirection="forward"
|
|
155
|
-
className="grid grid-cols-2 md
|
|
180
|
+
className="grid grid-cols-2 md:grid-cols-4 gap-4"
|
|
181
|
+
>
|
|
182
|
+
{[1, 2, 3, 4].map((num) => (
|
|
156
183
|
<div
|
|
157
184
|
key={num}
|
|
158
185
|
className="h-20 bg-gradient-to-br from-green-400 to-blue-500 rounded-lg flex items-center justify-center text-white font-bold text-xl"
|
|
@@ -166,7 +193,9 @@ export const AnimationDemo= () => {
|
|
|
166
193
|
{/* Performance Mode Comparison */}
|
|
167
194
|
<div>
|
|
168
195
|
<h3 className="text-lg font-medium mb-3">Performance Mode Comparison</h3>
|
|
169
|
-
<div className="grid grid-cols-1 md
|
|
196
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
197
|
+
<AnimatedContainer
|
|
198
|
+
animation="fadeIn"
|
|
170
199
|
duration="fast"
|
|
171
200
|
className="h-24 bg-red-400 rounded-lg flex items-center justify-center text-white font-semibold"
|
|
172
201
|
>
|
|
@@ -196,19 +225,22 @@ export const AnimationDemo= () => {
|
|
|
196
225
|
<div className="space-y-4">
|
|
197
226
|
<div>
|
|
198
227
|
<h3 className="font-medium mb-2">Animation Profile</h3>
|
|
199
|
-
<pre className="text-xs bg-gray-100 dark
|
|
228
|
+
<pre className="text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto">
|
|
229
|
+
{JSON.stringify(profile, null, 2)}
|
|
200
230
|
</pre>
|
|
201
231
|
</div>
|
|
202
232
|
|
|
203
233
|
<div>
|
|
204
234
|
<h3 className="font-medium mb-2">Device Info</h3>
|
|
205
|
-
<pre className="text-xs bg-gray-100 dark
|
|
235
|
+
<pre className="text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto">
|
|
236
|
+
{JSON.stringify(deviceInfo, null, 2)}
|
|
206
237
|
</pre>
|
|
207
238
|
</div>
|
|
208
239
|
|
|
209
240
|
<div>
|
|
210
241
|
<h3 className="font-medium mb-2">Performance Metrics</h3>
|
|
211
|
-
<pre className="text-xs bg-gray-100 dark
|
|
242
|
+
<pre className="text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto">
|
|
243
|
+
{JSON.stringify(performanceMetrics, null, 2)}
|
|
212
244
|
</pre>
|
|
213
245
|
</div>
|
|
214
246
|
</div>
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from './animation'
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
export const AnimationDemo= () => {
|
|
13
|
+
export const AnimationDemo: React.FC = () => {
|
|
14
14
|
const [currentAnimation, setCurrentAnimation] = useState<'fadeIn' | 'slideIn' | 'scaleIn' | 'bounce'>('fadeIn')
|
|
15
15
|
const [isAnimating, setIsAnimating] = useState(false)
|
|
16
16
|
|
|
@@ -18,13 +18,13 @@ export const AnimationDemo= () => {
|
|
|
18
18
|
const { performanceMode, shouldOptimizeForBattery } = usePerformanceMode()
|
|
19
19
|
|
|
20
20
|
const animations = [
|
|
21
|
-
{ key, label, icon},
|
|
22
|
-
{ key, label, icon},
|
|
23
|
-
{ key, label, icon},
|
|
24
|
-
{ key, label, icon}
|
|
21
|
+
{ key: 'fadeIn' as const, label: 'Fade In', icon: '✨' },
|
|
22
|
+
{ key: 'slideIn' as const, label: 'Slide In', icon: '➡️' },
|
|
23
|
+
{ key: 'scaleIn' as const, label: 'Scale In', icon: '🔍' },
|
|
24
|
+
{ key: 'bounce' as const, label: 'Bounce', icon: '🎾' }
|
|
25
25
|
]
|
|
26
26
|
|
|
27
|
-
const handleAnimationChange = (animation) => {
|
|
27
|
+
const handleAnimationChange = (animation: typeof currentAnimation) => {
|
|
28
28
|
setCurrentAnimation(animation)
|
|
29
29
|
setIsAnimating(true)
|
|
30
30
|
|
|
@@ -33,24 +33,31 @@ export const AnimationDemo= () => {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const performanceIndicators = [
|
|
36
|
-
{ label, value, unit, color},
|
|
37
|
-
{ label, value) , unit, color},
|
|
38
|
-
{ label, value) , unit, color}
|
|
36
|
+
{ label: 'FPS', value: performanceMetrics.fps, unit: '', color: performanceMetrics.fps > 50 ? 'green' : performanceMetrics.fps > 30 ? 'yellow' : 'red' },
|
|
37
|
+
{ label: 'Memory', value: performanceMetrics.memoryUsage ? Math.round(performanceMetrics.memoryUsage * 100) : 'N/A', unit: '%', color: 'blue' },
|
|
38
|
+
{ label: 'Battery', value: performanceMetrics.batteryLevel ? Math.round(performanceMetrics.batteryLevel * 100) : 'N/A', unit: '%', color: performanceMetrics.isLowPowerMode ? 'red' : 'green' }
|
|
39
39
|
]
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<div className="space-y-6 p-6">
|
|
43
43
|
<div className="text-center">
|
|
44
44
|
<h1 className="text-3xl font-bold mb-2">Mobile-First Animation System</h1>
|
|
45
|
-
<p className="text-gray-600 dark
|
|
45
|
+
<p className="text-gray-600 dark:text-gray-400">
|
|
46
|
+
Device-specific animations with performance optimization and battery awareness
|
|
47
|
+
</p>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
{/* Performance Metrics */}
|
|
46
51
|
<Card className="p-4">
|
|
47
52
|
<h2 className="text-xl font-semibold mb-4">Performance Metrics</h2>
|
|
48
|
-
<div className="grid grid-cols-1 md
|
|
53
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
54
|
+
{performanceIndicators.map((indicator) => (
|
|
49
55
|
<div key={indicator.label} className="text-center">
|
|
50
56
|
<div className={`text-2xl font-bold text-${indicator.color}-600`}>
|
|
51
57
|
{indicator.value}{indicator.unit}
|
|
52
58
|
</div>
|
|
53
|
-
<div className="text-sm text-gray-600 dark
|
|
59
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">
|
|
60
|
+
{indicator.label}
|
|
54
61
|
</div>
|
|
55
62
|
</div>
|
|
56
63
|
))}
|
|
@@ -58,18 +65,21 @@ export const AnimationDemo= () => {
|
|
|
58
65
|
|
|
59
66
|
<div className="mt-4 space-y-2">
|
|
60
67
|
<div className="flex items-center justify-between">
|
|
61
|
-
<span>Performance Mode
|
|
68
|
+
<span>Performance Mode:</span>
|
|
69
|
+
<Badge variant={performanceMode === 'high' ? 'default' : performanceMode === 'medium' ? 'secondary' : 'destructive'}>
|
|
62
70
|
{performanceMode.toUpperCase()}
|
|
63
71
|
</Badge>
|
|
64
72
|
</div>
|
|
65
73
|
<div className="flex items-center justify-between">
|
|
66
|
-
<span>Battery Optimization
|
|
67
|
-
|
|
74
|
+
<span>Battery Optimization:</span>
|
|
75
|
+
<Badge variant={shouldOptimizeForBattery ? 'destructive' : 'default'}>
|
|
76
|
+
{shouldOptimizeForBattery ? 'Enabled' : 'Disabled'}
|
|
68
77
|
</Badge>
|
|
69
78
|
</div>
|
|
70
79
|
<div className="flex items-center justify-between">
|
|
71
|
-
<span>Reduced Motion
|
|
72
|
-
|
|
80
|
+
<span>Reduced Motion:</span>
|
|
81
|
+
<Badge variant={profile.performance.reducedMotion ? 'destructive' : 'default'}>
|
|
82
|
+
{profile.performance.reducedMotion ? 'Enabled' : 'Disabled'}
|
|
73
83
|
</Badge>
|
|
74
84
|
</div>
|
|
75
85
|
</div>
|
|
@@ -78,22 +88,34 @@ export const AnimationDemo= () => {
|
|
|
78
88
|
{/* Device Information */}
|
|
79
89
|
<Card className="p-4">
|
|
80
90
|
<h2 className="text-xl font-semibold mb-4">Device Profile</h2>
|
|
81
|
-
<div className="grid grid-cols-2 md
|
|
91
|
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
|
92
|
+
<div className="text-center">
|
|
82
93
|
<div className="text-lg font-semibold">{deviceInfo.screenSize}</div>
|
|
83
|
-
<div className="text-sm text-gray-600 dark
|
|
94
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">Screen Size</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div className="text-center">
|
|
84
97
|
<div className="text-lg font-semibold">{deviceInfo.orientation}</div>
|
|
85
|
-
<div className="text-sm text-gray-600 dark
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<div className="text-lg font-semibold">{deviceInfo.
|
|
89
|
-
<div className="text-sm text-gray-600 dark
|
|
98
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">Orientation</div>
|
|
99
|
+
</div>
|
|
100
|
+
<div className="text-center">
|
|
101
|
+
<div className="text-lg font-semibold">{deviceInfo.touchDevice ? 'Touch' : 'Mouse'}</div>
|
|
102
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">Input Type</div>
|
|
103
|
+
</div>
|
|
104
|
+
<div className="text-center">
|
|
105
|
+
<div className="text-lg font-semibold">{deviceInfo.isMobile ? 'Mobile' : deviceInfo.isTablet ? 'Tablet' : 'Desktop'}</div>
|
|
106
|
+
<div className="text-sm text-gray-600 dark:text-gray-400">Device Type</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</Card>
|
|
110
|
+
|
|
111
|
+
{/* Animation Controls */}
|
|
90
112
|
<Card className="p-4">
|
|
91
113
|
<h2 className="text-xl font-semibold mb-4">Animation Controls</h2>
|
|
92
114
|
<div className="flex flex-wrap gap-2 mb-4">
|
|
93
115
|
{animations.map((animation) => (
|
|
94
116
|
<Button
|
|
95
117
|
key={animation.key}
|
|
96
|
-
variant={currentAnimation === animation.key ? 'default' }
|
|
118
|
+
variant={currentAnimation === animation.key ? 'default' : 'outline'}
|
|
97
119
|
onClick={() => handleAnimationChange(animation.key)}
|
|
98
120
|
disabled={isAnimating}
|
|
99
121
|
className="flex items-center gap-2"
|
|
@@ -104,16 +126,19 @@ export const AnimationDemo= () => {
|
|
|
104
126
|
))}
|
|
105
127
|
</div>
|
|
106
128
|
|
|
107
|
-
<div className="grid grid-cols-1 md
|
|
129
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
130
|
+
<div>
|
|
131
|
+
<label className="block text-sm font-medium mb-2">Current Animation Profile</label>
|
|
108
132
|
<div className="space-y-2 text-sm">
|
|
109
|
-
<div>Duration}</div>
|
|
110
|
-
<div>Easing}</div>
|
|
111
|
-
<div>Performance}</div>
|
|
133
|
+
<div>Duration: {profile.duration.normal}</div>
|
|
134
|
+
<div>Easing: {profile.easing.ease}</div>
|
|
135
|
+
<div>Performance: {profile.performance.mode}</div>
|
|
112
136
|
</div>
|
|
113
137
|
</div>
|
|
114
138
|
<div>
|
|
115
139
|
<label className="block text-sm font-medium mb-2">Animation Classes</label>
|
|
116
|
-
<div className="text-xs bg-gray-100 dark
|
|
140
|
+
<div className="text-xs bg-gray-100 dark:bg-gray-800 p-2 rounded">
|
|
141
|
+
{deviceInfo.isMobile && 'coach-stan-mobile-animation '}
|
|
117
142
|
{deviceInfo.isTablet && 'coach-stan-tablet-animation '}
|
|
118
143
|
{deviceInfo.isDesktop && 'coach-stan-desktop-animation '}
|
|
119
144
|
{shouldOptimizeForBattery && 'coach-stan-battery-saver '}
|
|
@@ -152,7 +177,9 @@ export const AnimationDemo= () => {
|
|
|
152
177
|
duration="fast"
|
|
153
178
|
staggerDelay={0.1}
|
|
154
179
|
staggerDirection="forward"
|
|
155
|
-
className="grid grid-cols-2 md
|
|
180
|
+
className="grid grid-cols-2 md:grid-cols-4 gap-4"
|
|
181
|
+
>
|
|
182
|
+
{[1, 2, 3, 4].map((num) => (
|
|
156
183
|
<div
|
|
157
184
|
key={num}
|
|
158
185
|
className="h-20 bg-gradient-to-br from-green-400 to-blue-500 rounded-lg flex items-center justify-center text-white font-bold text-xl"
|
|
@@ -166,7 +193,9 @@ export const AnimationDemo= () => {
|
|
|
166
193
|
{/* Performance Mode Comparison */}
|
|
167
194
|
<div>
|
|
168
195
|
<h3 className="text-lg font-medium mb-3">Performance Mode Comparison</h3>
|
|
169
|
-
<div className="grid grid-cols-1 md
|
|
196
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
197
|
+
<AnimatedContainer
|
|
198
|
+
animation="fadeIn"
|
|
170
199
|
duration="fast"
|
|
171
200
|
className="h-24 bg-red-400 rounded-lg flex items-center justify-center text-white font-semibold"
|
|
172
201
|
>
|
|
@@ -196,19 +225,22 @@ export const AnimationDemo= () => {
|
|
|
196
225
|
<div className="space-y-4">
|
|
197
226
|
<div>
|
|
198
227
|
<h3 className="font-medium mb-2">Animation Profile</h3>
|
|
199
|
-
<pre className="text-xs bg-gray-100 dark
|
|
228
|
+
<pre className="text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto">
|
|
229
|
+
{JSON.stringify(profile, null, 2)}
|
|
200
230
|
</pre>
|
|
201
231
|
</div>
|
|
202
232
|
|
|
203
233
|
<div>
|
|
204
234
|
<h3 className="font-medium mb-2">Device Info</h3>
|
|
205
|
-
<pre className="text-xs bg-gray-100 dark
|
|
235
|
+
<pre className="text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto">
|
|
236
|
+
{JSON.stringify(deviceInfo, null, 2)}
|
|
206
237
|
</pre>
|
|
207
238
|
</div>
|
|
208
239
|
|
|
209
240
|
<div>
|
|
210
241
|
<h3 className="font-medium mb-2">Performance Metrics</h3>
|
|
211
|
-
<pre className="text-xs bg-gray-100 dark
|
|
242
|
+
<pre className="text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto">
|
|
243
|
+
{JSON.stringify(performanceMetrics, null, 2)}
|
|
212
244
|
</pre>
|
|
213
245
|
</div>
|
|
214
246
|
</div>
|