@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
|
@@ -5,7 +5,7 @@ import { Button } from './button'
|
|
|
5
5
|
import { useBatteryAnimations } from '../../hooks/use-battery-animations'
|
|
6
6
|
import { usePerformanceThrottling } from '../../hooks/use-performance-throttling'
|
|
7
7
|
|
|
8
|
-
export const BatteryConsciousAnimationDemo= () => {
|
|
8
|
+
export const BatteryConsciousAnimationDemo: React.FC = () => {
|
|
9
9
|
const [showBatteryInfo, setShowBatteryInfo] = useState(true)
|
|
10
10
|
const [showPerformanceInfo, setShowPerformanceInfo] = useState(true)
|
|
11
11
|
const [showAnimationDemo, setShowAnimationDemo] = useState(true)
|
|
@@ -18,27 +18,29 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
18
18
|
|
|
19
19
|
// Hooks
|
|
20
20
|
const batteryAnimations = useBatteryAnimations({
|
|
21
|
-
enableBatteryMonitoring,
|
|
22
|
-
enablePerformanceThrottling,
|
|
23
|
-
enableReducedMotion,
|
|
24
|
-
enableUserPreferences,
|
|
25
|
-
enableAutomaticOptimization
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
enableBatteryMonitoring: true,
|
|
22
|
+
enablePerformanceThrottling: true,
|
|
23
|
+
enableReducedMotion: true,
|
|
24
|
+
enableUserPreferences: true,
|
|
25
|
+
enableAutomaticOptimization: true
|
|
26
|
+
}, {
|
|
27
|
+
onBatteryLevelChange: (level, isLow) => console.log('Battery level changed:', level, isLow),
|
|
28
|
+
onPerformanceWarning: (score, shouldThrottle) => console.log('Performance warning:', score, shouldThrottle),
|
|
29
|
+
onAnimationThrottled: (level, reason) => console.log('Animation throttled:', level, reason),
|
|
30
|
+
onUserPreferenceChange: (preference) => console.log('User preference changed:', preference),
|
|
31
|
+
onReducedMotionChange: (enabled) => console.log('Reduced motion changed:', enabled)
|
|
31
32
|
})
|
|
32
33
|
|
|
33
34
|
const performanceThrottling = usePerformanceThrottling({
|
|
34
|
-
enablePerformanceMonitoring,
|
|
35
|
-
enableAutomaticThrottling,
|
|
36
|
-
enableUserExperienceOptimization,
|
|
37
|
-
enableBatteryPreservation
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
enablePerformanceMonitoring: true,
|
|
36
|
+
enableAutomaticThrottling: true,
|
|
37
|
+
enableUserExperienceOptimization: true,
|
|
38
|
+
enableBatteryPreservation: true
|
|
39
|
+
}, {
|
|
40
|
+
onPerformanceWarning: (metrics) => console.log('Performance warning:', metrics),
|
|
41
|
+
onThrottlingApplied: (level, reason) => console.log('Throttling applied:', level, reason),
|
|
42
|
+
onPerformanceRecovery: (metrics) => console.log('Performance recovery:', metrics),
|
|
43
|
+
onUserExperienceOptimized: (optimization) => console.log('User experience optimized:', optimization)
|
|
42
44
|
})
|
|
43
45
|
|
|
44
46
|
// Animation controls
|
|
@@ -104,23 +106,33 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
104
106
|
|
|
105
107
|
if (!settings.shouldAnimate || batteryAnimations.shouldDisableAnimations) {
|
|
106
108
|
return {
|
|
107
|
-
transform, 0, 0) rotate(0deg) scale(1)',
|
|
108
|
-
opacity
|
|
109
|
+
transform: 'translate3d(0, 0, 0) rotate(0deg) scale(1)',
|
|
110
|
+
opacity: 1
|
|
111
|
+
}
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
switch (animationState) {
|
|
112
|
-
case 'running'
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
case 'running':
|
|
116
|
+
return {
|
|
117
|
+
transform: `translate3d(100px, 0, 0) rotate(360deg) scale(1.2)`,
|
|
118
|
+
opacity: 0.8,
|
|
119
|
+
transitionDuration: `${settings.duration}ms`,
|
|
120
|
+
transitionTimingFunction: settings.easing
|
|
121
|
+
}
|
|
122
|
+
case 'paused':
|
|
123
|
+
return {
|
|
124
|
+
transform: `translate3d(50px, 0, 0) rotate(180deg) scale(1.1)`,
|
|
125
|
+
opacity: 0.9,
|
|
126
|
+
transitionDuration: `${settings.duration}ms`,
|
|
127
|
+
transitionTimingFunction: settings.easing
|
|
128
|
+
}
|
|
129
|
+
default:
|
|
130
|
+
return {
|
|
131
|
+
transform: 'translate3d(0, 0, 0) rotate(0deg) scale(1)',
|
|
132
|
+
opacity: 1,
|
|
133
|
+
transitionDuration: `${settings.duration}ms`,
|
|
134
|
+
transitionTimingFunction: settings.easing
|
|
135
|
+
}
|
|
124
136
|
}
|
|
125
137
|
}, [animationState, batteryAnimations.animationSettings, batteryAnimations.shouldDisableAnimations])
|
|
126
138
|
|
|
@@ -155,7 +167,7 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
155
167
|
<CardHeader>
|
|
156
168
|
<CardTitle className="text-xl flex items-center gap-2">
|
|
157
169
|
🔋 Battery Status
|
|
158
|
-
<Badge variant={batteryAnimations.state.isLowBattery ? 'secondary' }>
|
|
170
|
+
<Badge variant={batteryAnimations.state.isLowBattery ? 'secondary' : 'default'}>
|
|
159
171
|
{batteryAnimations.batteryPercentage}%
|
|
160
172
|
</Badge>
|
|
161
173
|
</CardTitle>
|
|
@@ -164,22 +176,27 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
164
176
|
</CardDescription>
|
|
165
177
|
</CardHeader>
|
|
166
178
|
<CardContent>
|
|
167
|
-
<div className="grid grid-cols-1 md
|
|
179
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
180
|
+
<div className="space-y-3">
|
|
168
181
|
<h4 className="font-medium">Battery Information</h4>
|
|
169
182
|
<div className="space-y-2">
|
|
170
183
|
<div className="flex justify-between">
|
|
171
|
-
<span className="text-sm">Level
|
|
184
|
+
<span className="text-sm">Level:</span>
|
|
185
|
+
<span className="text-sm text-cs-text-secondary">{batteryAnimations.batteryPercentage}%</span>
|
|
172
186
|
</div>
|
|
173
187
|
<div className="flex justify-between">
|
|
174
|
-
<span className="text-sm">Status
|
|
175
|
-
|
|
188
|
+
<span className="text-sm">Status:</span>
|
|
189
|
+
<Badge variant={batteryAnimations.state.isCharging ? 'default' : 'secondary'}>
|
|
190
|
+
{batteryAnimations.state.isCharging ? 'Charging' : 'Discharging'}
|
|
176
191
|
</Badge>
|
|
177
192
|
</div>
|
|
178
193
|
<div className="flex justify-between">
|
|
179
|
-
<span className="text-sm">Health
|
|
194
|
+
<span className="text-sm">Health:</span>
|
|
195
|
+
<Badge variant="outline">{batteryAnimations.getBatteryHealth()}</Badge>
|
|
180
196
|
</div>
|
|
181
197
|
<div className="flex justify-between">
|
|
182
|
-
<span className="text-sm">Throttle Level
|
|
198
|
+
<span className="text-sm">Throttle Level:</span>
|
|
199
|
+
<Badge variant="outline">{batteryAnimations.state.throttleLevel}</Badge>
|
|
183
200
|
</div>
|
|
184
201
|
</div>
|
|
185
202
|
</div>
|
|
@@ -188,16 +205,20 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
188
205
|
<h4 className="font-medium">Animation Settings</h4>
|
|
189
206
|
<div className="space-y-2">
|
|
190
207
|
<div className="flex justify-between">
|
|
191
|
-
<span className="text-sm">Duration
|
|
208
|
+
<span className="text-sm">Duration:</span>
|
|
209
|
+
<span className="text-sm text-cs-text-secondary">{batteryAnimations.animationSettings.duration}ms</span>
|
|
192
210
|
</div>
|
|
193
211
|
<div className="flex justify-between">
|
|
194
|
-
<span className="text-sm">Easing
|
|
212
|
+
<span className="text-sm">Easing:</span>
|
|
213
|
+
<span className="text-sm text-cs-text-secondary">{batteryAnimations.animationSettings.easing}</span>
|
|
195
214
|
</div>
|
|
196
215
|
<div className="flex justify-between">
|
|
197
|
-
<span className="text-sm">Complexity
|
|
216
|
+
<span className="text-sm">Complexity:</span>
|
|
217
|
+
<Badge variant="outline">{batteryAnimations.animationSettings.complexity}</Badge>
|
|
198
218
|
</div>
|
|
199
219
|
<div className="flex justify-between">
|
|
200
|
-
<span className="text-sm">Frame Rate
|
|
220
|
+
<span className="text-sm">Frame Rate:</span>
|
|
221
|
+
<span className="text-sm text-cs-text-secondary">{batteryAnimations.animationSettings.frameRate}fps</span>
|
|
201
222
|
</div>
|
|
202
223
|
</div>
|
|
203
224
|
</div>
|
|
@@ -205,30 +226,31 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
205
226
|
|
|
206
227
|
{/* User Preference Controls */}
|
|
207
228
|
<div className="mt-4 p-3 bg-cs-accent/10 rounded-lg">
|
|
208
|
-
<h4 className="font-medium text-sm mb-2">User Preference
|
|
229
|
+
<h4 className="font-medium text-sm mb-2">User Preference:</h4>
|
|
230
|
+
<div className="flex gap-2">
|
|
209
231
|
<Button
|
|
210
|
-
variant={batteryAnimations.state.userPreference === 'performance' ? 'default' }
|
|
232
|
+
variant={batteryAnimations.state.userPreference === 'performance' ? 'default' : 'outline'}
|
|
211
233
|
size="sm"
|
|
212
234
|
onClick={() => batteryAnimations.updateUserPreference('performance')}
|
|
213
235
|
>
|
|
214
236
|
Performance
|
|
215
237
|
</Button>
|
|
216
238
|
<Button
|
|
217
|
-
variant={batteryAnimations.state.userPreference === 'balanced' ? 'default' }
|
|
239
|
+
variant={batteryAnimations.state.userPreference === 'balanced' ? 'default' : 'outline'}
|
|
218
240
|
size="sm"
|
|
219
241
|
onClick={() => batteryAnimations.updateUserPreference('balanced')}
|
|
220
242
|
>
|
|
221
243
|
Balanced
|
|
222
244
|
</Button>
|
|
223
245
|
<Button
|
|
224
|
-
variant={batteryAnimations.state.userPreference === 'battery' ? 'default' }
|
|
246
|
+
variant={batteryAnimations.state.userPreference === 'battery' ? 'default' : 'outline'}
|
|
225
247
|
size="sm"
|
|
226
248
|
onClick={() => batteryAnimations.updateUserPreference('battery')}
|
|
227
249
|
>
|
|
228
250
|
Battery
|
|
229
251
|
</Button>
|
|
230
252
|
<Button
|
|
231
|
-
variant={batteryAnimations.state.userPreference === 'accessibility' ? 'default' }
|
|
253
|
+
variant={batteryAnimations.state.userPreference === 'accessibility' ? 'default' : 'outline'}
|
|
232
254
|
size="sm"
|
|
233
255
|
onClick={() => batteryAnimations.updateUserPreference('accessibility')}
|
|
234
256
|
>
|
|
@@ -246,8 +268,8 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
246
268
|
<CardHeader>
|
|
247
269
|
<CardTitle className="text-xl flex items-center gap-2">
|
|
248
270
|
📊 Performance Monitoring
|
|
249
|
-
<Badge variant={performanceThrottling.isThrottling ? 'secondary' }>
|
|
250
|
-
{performanceThrottling.isThrottling ? 'Throttling' }
|
|
271
|
+
<Badge variant={performanceThrottling.isThrottling ? 'secondary' : 'default'}>
|
|
272
|
+
{performanceThrottling.isThrottling ? 'Throttling' : 'Optimal'}
|
|
251
273
|
</Badge>
|
|
252
274
|
</CardTitle>
|
|
253
275
|
<CardDescription>
|
|
@@ -255,7 +277,9 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
255
277
|
</CardDescription>
|
|
256
278
|
</CardHeader>
|
|
257
279
|
<CardContent>
|
|
258
|
-
<div className="grid grid-cols-2 lg
|
|
280
|
+
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4 text-center">
|
|
281
|
+
<div>
|
|
282
|
+
<p className="text-2xl font-bold text-cs-primary">
|
|
259
283
|
{performanceThrottling.metrics.fps}
|
|
260
284
|
</p>
|
|
261
285
|
<p className="text-sm text-cs-text-secondary">FPS</p>
|
|
@@ -282,15 +306,18 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
282
306
|
|
|
283
307
|
<div className="mt-4 p-3 bg-cs-accent/10 rounded-lg">
|
|
284
308
|
<div className="flex items-center justify-between mb-2">
|
|
285
|
-
<span className="font-medium text-sm">Performance Level
|
|
309
|
+
<span className="font-medium text-sm">Performance Level:</span>
|
|
310
|
+
<Badge variant={
|
|
286
311
|
performanceThrottling.performanceLevel === 'excellent' || performanceThrottling.performanceLevel === 'good'
|
|
287
|
-
? 'default'
|
|
312
|
+
? 'default' : 'secondary'
|
|
313
|
+
}>
|
|
288
314
|
{performanceThrottling.performanceLevel.toUpperCase()}
|
|
289
315
|
</Badge>
|
|
290
316
|
</div>
|
|
291
317
|
<div className="flex items-center justify-between">
|
|
292
|
-
<span className="font-medium text-sm">Throttling Status
|
|
293
|
-
|
|
318
|
+
<span className="font-medium text-sm">Throttling Status:</span>
|
|
319
|
+
<Badge variant={performanceThrottling.isThrottling ? 'secondary' : 'default'}>
|
|
320
|
+
{performanceThrottling.isThrottling ? 'Active' : 'Inactive'}
|
|
294
321
|
</Badge>
|
|
295
322
|
</div>
|
|
296
323
|
</div>
|
|
@@ -311,28 +338,28 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
311
338
|
{/* Animation Type Selection */}
|
|
312
339
|
<div className="flex flex-wrap gap-2">
|
|
313
340
|
<Button
|
|
314
|
-
variant={animationType === 'battery' ? 'default' }
|
|
341
|
+
variant={animationType === 'battery' ? 'default' : 'outline'}
|
|
315
342
|
size="sm"
|
|
316
343
|
onClick={() => setAnimationType('battery')}
|
|
317
344
|
>
|
|
318
345
|
Battery Optimized
|
|
319
346
|
</Button>
|
|
320
347
|
<Button
|
|
321
|
-
variant={animationType === 'performance' ? 'default' }
|
|
348
|
+
variant={animationType === 'performance' ? 'default' : 'outline'}
|
|
322
349
|
size="sm"
|
|
323
350
|
onClick={() => setAnimationType('performance')}
|
|
324
351
|
>
|
|
325
352
|
Performance Optimized
|
|
326
353
|
</Button>
|
|
327
354
|
<Button
|
|
328
|
-
variant={animationType === 'reduced-motion' ? 'default' }
|
|
355
|
+
variant={animationType === 'reduced-motion' ? 'default' : 'outline'}
|
|
329
356
|
size="sm"
|
|
330
357
|
onClick={() => setAnimationType('reduced-motion')}
|
|
331
358
|
>
|
|
332
359
|
Reduced Motion
|
|
333
360
|
</Button>
|
|
334
361
|
<Button
|
|
335
|
-
variant={animationType === 'user-preference' ? 'default' }
|
|
362
|
+
variant={animationType === 'user-preference' ? 'default' : 'outline'}
|
|
336
363
|
size="sm"
|
|
337
364
|
onClick={() => setAnimationType('user-preference')}
|
|
338
365
|
>
|
|
@@ -343,21 +370,21 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
343
370
|
{/* Animation Complexity Selection */}
|
|
344
371
|
<div className="flex flex-wrap gap-2">
|
|
345
372
|
<Button
|
|
346
|
-
variant={animationComplexity === 'low' ? 'default' }
|
|
373
|
+
variant={animationComplexity === 'low' ? 'default' : 'outline'}
|
|
347
374
|
size="sm"
|
|
348
375
|
onClick={() => setAnimationComplexity('low')}
|
|
349
376
|
>
|
|
350
377
|
Low Complexity
|
|
351
378
|
</Button>
|
|
352
379
|
<Button
|
|
353
|
-
variant={animationComplexity === 'medium' ? 'default' }
|
|
380
|
+
variant={animationComplexity === 'medium' ? 'default' : 'outline'}
|
|
354
381
|
size="sm"
|
|
355
382
|
onClick={() => setAnimationComplexity('medium')}
|
|
356
383
|
>
|
|
357
384
|
Medium Complexity
|
|
358
385
|
</Button>
|
|
359
386
|
<Button
|
|
360
|
-
variant={animationComplexity === 'high' ? 'default' }
|
|
387
|
+
variant={animationComplexity === 'high' ? 'default' : 'outline'}
|
|
361
388
|
size="sm"
|
|
362
389
|
onClick={() => setAnimationComplexity('high')}
|
|
363
390
|
>
|
|
@@ -400,14 +427,14 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
400
427
|
|
|
401
428
|
{/* Animation Info */}
|
|
402
429
|
<div className="text-center text-sm text-cs-text-secondary">
|
|
403
|
-
<p>Animation Type="font-medium">{animationType}</span></p>
|
|
404
|
-
<p>Complexity="font-medium">{animationComplexity}</span></p>
|
|
405
|
-
<p>State="font-medium">{animationState}</span></p>
|
|
406
|
-
<p>Battery Optimized="font-medium">
|
|
407
|
-
{batteryAnimations.isAnimationOptimized() ? 'Yes' }
|
|
430
|
+
<p>Animation Type: <span className="font-medium">{animationType}</span></p>
|
|
431
|
+
<p>Complexity: <span className="font-medium">{animationComplexity}</span></p>
|
|
432
|
+
<p>State: <span className="font-medium">{animationState}</span></p>
|
|
433
|
+
<p>Battery Optimized: <span className="font-medium">
|
|
434
|
+
{batteryAnimations.isAnimationOptimized() ? 'Yes' : 'No'}
|
|
408
435
|
</span></p>
|
|
409
|
-
<p>Animations Disabled="font-medium">
|
|
410
|
-
{batteryAnimations.shouldDisableAnimations ? 'Yes' }
|
|
436
|
+
<p>Animations Disabled: <span className="font-medium">
|
|
437
|
+
{batteryAnimations.shouldDisableAnimations ? 'Yes' : 'No'}
|
|
411
438
|
</span></p>
|
|
412
439
|
</div>
|
|
413
440
|
</CardContent>
|
|
@@ -426,25 +453,25 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
426
453
|
<CardContent className="space-y-4">
|
|
427
454
|
<div className="flex flex-wrap gap-4">
|
|
428
455
|
<Button
|
|
429
|
-
variant={showBatteryInfo ? 'default' }
|
|
456
|
+
variant={showBatteryInfo ? 'default' : 'outline'}
|
|
430
457
|
size="sm"
|
|
431
458
|
onClick={() => setShowBatteryInfo(!showBatteryInfo)}
|
|
432
459
|
>
|
|
433
|
-
{showBatteryInfo ? 'Hide' } Battery Info
|
|
460
|
+
{showBatteryInfo ? 'Hide' : 'Show'} Battery Info
|
|
434
461
|
</Button>
|
|
435
462
|
<Button
|
|
436
|
-
variant={showPerformanceInfo ? 'default' }
|
|
463
|
+
variant={showPerformanceInfo ? 'default' : 'outline'}
|
|
437
464
|
size="sm"
|
|
438
465
|
onClick={() => setShowPerformanceInfo(!showPerformanceInfo)}
|
|
439
466
|
>
|
|
440
|
-
{showPerformanceInfo ? 'Hide' } Performance
|
|
467
|
+
{showPerformanceInfo ? 'Hide' : 'Show'} Performance
|
|
441
468
|
</Button>
|
|
442
469
|
<Button
|
|
443
|
-
variant={showAnimationDemo ? 'default' }
|
|
470
|
+
variant={showAnimationDemo ? 'default' : 'outline'}
|
|
444
471
|
size="sm"
|
|
445
472
|
onClick={() => setShowAnimationDemo(!showAnimationDemo)}
|
|
446
473
|
>
|
|
447
|
-
{showAnimationDemo ? 'Hide' } Animation Demo
|
|
474
|
+
{showAnimationDemo ? 'Hide' : 'Show'} Animation Demo
|
|
448
475
|
</Button>
|
|
449
476
|
</div>
|
|
450
477
|
</CardContent>
|
|
@@ -462,29 +489,34 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
462
489
|
<CardContent>
|
|
463
490
|
<div className="space-y-3">
|
|
464
491
|
<div className="flex items-center justify-between">
|
|
465
|
-
<span className="text-sm">Battery Optimization
|
|
466
|
-
|
|
492
|
+
<span className="text-sm">Battery Optimization:</span>
|
|
493
|
+
<Badge variant={batteryAnimations.isAnimationOptimized() ? 'default' : 'secondary'}>
|
|
494
|
+
{batteryAnimations.isAnimationOptimized() ? 'Active' : 'Inactive'}
|
|
467
495
|
</Badge>
|
|
468
496
|
</div>
|
|
469
497
|
<div className="flex items-center justify-between">
|
|
470
|
-
<span className="text-sm">Performance Throttling
|
|
471
|
-
|
|
498
|
+
<span className="text-sm">Performance Throttling:</span>
|
|
499
|
+
<Badge variant={performanceThrottling.isThrottling ? 'secondary' : 'default'}>
|
|
500
|
+
{performanceThrottling.isThrottling ? 'Active' : 'Inactive'}
|
|
472
501
|
</Badge>
|
|
473
502
|
</div>
|
|
474
503
|
<div className="flex items-center justify-between">
|
|
475
|
-
<span className="text-sm">Reduced Motion
|
|
476
|
-
|
|
504
|
+
<span className="text-sm">Reduced Motion:</span>
|
|
505
|
+
<Badge variant={batteryAnimations.state.reducedMotion ? 'secondary' : 'default'}>
|
|
506
|
+
{batteryAnimations.state.reducedMotion ? 'Enabled' : 'Disabled'}
|
|
477
507
|
</Badge>
|
|
478
508
|
</div>
|
|
479
509
|
<div className="flex items-center justify-between">
|
|
480
|
-
<span className="text-sm">User Preference
|
|
510
|
+
<span className="text-sm">User Preference:</span>
|
|
511
|
+
<Badge variant="outline">{batteryAnimations.state.userPreference}</Badge>
|
|
481
512
|
</div>
|
|
482
513
|
</div>
|
|
483
514
|
|
|
484
515
|
{/* Recent Optimizations */}
|
|
485
516
|
{batteryAnimations.optimizations.length > 0 && (
|
|
486
517
|
<div className="mt-4 p-3 bg-cs-accent/10 rounded-lg">
|
|
487
|
-
<h4 className="font-medium text-sm mb-2">Recent Optimizations
|
|
518
|
+
<h4 className="font-medium text-sm mb-2">Recent Optimizations:</h4>
|
|
519
|
+
<ul className="text-xs text-cs-text-secondary space-y-1">
|
|
488
520
|
{batteryAnimations.optimizations.slice(-3).map((optimization, index) => (
|
|
489
521
|
<li key={index}>• {optimization}</li>
|
|
490
522
|
))}
|
|
@@ -495,7 +527,8 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
495
527
|
{/* Performance Optimizations */}
|
|
496
528
|
{performanceThrottling.optimizations.length > 0 && (
|
|
497
529
|
<div className="mt-4 p-3 bg-cs-secondary/10 rounded-lg">
|
|
498
|
-
<h4 className="font-medium text-sm mb-2">Performance Optimizations
|
|
530
|
+
<h4 className="font-medium text-sm mb-2">Performance Optimizations:</h4>
|
|
531
|
+
<ul className="text-xs text-cs-text-secondary space-y-1">
|
|
499
532
|
{performanceThrottling.optimizations.slice(-3).map((optimization, index) => (
|
|
500
533
|
<li key={index}>• {optimization}</li>
|
|
501
534
|
))}
|
|
@@ -506,7 +539,8 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
506
539
|
{/* Battery Recommendations */}
|
|
507
540
|
{batteryAnimations.recommendations.length > 0 && (
|
|
508
541
|
<div className="mt-4 p-3 bg-cs-primary/10 rounded-lg">
|
|
509
|
-
<h4 className="font-medium text-sm mb-2">Battery Recommendations
|
|
542
|
+
<h4 className="font-medium text-sm mb-2">Battery Recommendations:</h4>
|
|
543
|
+
<ul className="text-xs text-cs-text-secondary space-y-1">
|
|
510
544
|
{batteryAnimations.recommendations.slice(0, 3).map((recommendation, index) => (
|
|
511
545
|
<li key={index}>• {recommendation}</li>
|
|
512
546
|
))}
|
|
@@ -517,7 +551,8 @@ export const BatteryConsciousAnimationDemo= () => {
|
|
|
517
551
|
{/* Performance Recommendations */}
|
|
518
552
|
{performanceThrottling.recommendations.length > 0 && (
|
|
519
553
|
<div className="mt-4 p-3 bg-cs-accent/10 rounded-lg">
|
|
520
|
-
<h4 className="font-medium text-sm mb-2">Performance Recommendations
|
|
554
|
+
<h4 className="font-medium text-sm mb-2">Performance Recommendations:</h4>
|
|
555
|
+
<ul className="text-xs text-cs-text-secondary space-y-1">
|
|
521
556
|
{performanceThrottling.recommendations.slice(0, 3).map((recommendation, index) => (
|
|
522
557
|
<li key={index}>• {recommendation}</li>
|
|
523
558
|
))}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Card } from './card';
|
|
3
3
|
import { Button } from './button';
|
|
4
4
|
|
|
5
|
-
export const BorderRadiusShadowDemo= () => {
|
|
5
|
+
export const BorderRadiusShadowDemo: React.FC = () => {
|
|
6
6
|
return (
|
|
7
7
|
<div className="space-y-6">
|
|
8
8
|
<div className="text-center">
|
|
@@ -19,7 +19,8 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
19
19
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
20
20
|
Border Radius System
|
|
21
21
|
</h3>
|
|
22
|
-
<div className="grid grid-cols-1 md
|
|
22
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
23
|
+
<div className="space-y-2">
|
|
23
24
|
<div className="h-20 bg-cs-primary rounded-sm flex items-center justify-center text-white font-medium">
|
|
24
25
|
rounded-sm
|
|
25
26
|
</div>
|
|
@@ -68,7 +69,8 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
68
69
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
69
70
|
Shadow System
|
|
70
71
|
</h3>
|
|
71
|
-
<div className="grid grid-cols-1 md
|
|
72
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
73
|
+
<div className="space-y-2">
|
|
72
74
|
<div className="h-20 bg-white rounded-lg shadow-sm flex items-center justify-center text-cs-text-primary font-medium border">
|
|
73
75
|
shadow-sm
|
|
74
76
|
</div>
|
|
@@ -118,7 +120,8 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
118
120
|
Component Integration
|
|
119
121
|
</h3>
|
|
120
122
|
<div className="space-y-4">
|
|
121
|
-
<div className="grid grid-cols-1 md
|
|
123
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
124
|
+
<Button variant="default" className="w-full">
|
|
122
125
|
Default Button
|
|
123
126
|
</Button>
|
|
124
127
|
<Button variant="outline" className="w-full">
|
|
@@ -129,12 +132,17 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
129
132
|
</Button>
|
|
130
133
|
</div>
|
|
131
134
|
|
|
132
|
-
<div className="grid grid-cols-1 md
|
|
135
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
136
|
+
<div className="space-y-2">
|
|
133
137
|
<label className="text-sm font-medium text-cs-text-secondary">Input Field</label>
|
|
134
138
|
<input
|
|
135
139
|
type="text"
|
|
136
140
|
placeholder="Type something..."
|
|
137
|
-
className="w-full h-11 rounded-md border border-cs-border bg-cs-surface-bg px-3 py-2 text-cs-text-primary focus
|
|
141
|
+
className="w-full h-11 rounded-md border border-cs-border bg-cs-surface-bg px-3 py-2 text-cs-text-primary focus:outline-none focus:ring-2 focus:ring-cs-primary focus:ring-offset-2"
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<div className="space-y-2">
|
|
138
146
|
<label className="text-sm font-medium text-cs-text-secondary">Card Example</label>
|
|
139
147
|
<div className="p-4 rounded-lg border border-cs-border bg-cs-surface-bg shadow-sm">
|
|
140
148
|
<p className="text-sm text-cs-text-secondary">This card uses rounded-lg and shadow-sm</p>
|
|
@@ -149,13 +157,16 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
149
157
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
150
158
|
Technical Implementation
|
|
151
159
|
</h3>
|
|
152
|
-
<div className="grid grid-cols-1 md
|
|
160
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
161
|
+
<div>
|
|
162
|
+
<h4 className="font-medium text-cs-text-primary mb-2">CSS Custom Properties</h4>
|
|
153
163
|
<div className="bg-cs-surface-bg p-3 rounded-md text-xs font-mono text-cs-text-secondary overflow-auto">
|
|
154
|
-
<p>--radius
|
|
155
|
-
<p>--radius-
|
|
156
|
-
<p>--radius-
|
|
157
|
-
<p>--radius-
|
|
158
|
-
<p>--radius-
|
|
164
|
+
<p>--radius: 0.5rem</p>
|
|
165
|
+
<p>--radius-sm: calc(var(--radius) - 4px)</p>
|
|
166
|
+
<p>--radius-md: calc(var(--radius) - 2px)</p>
|
|
167
|
+
<p>--radius-lg: var(--radius)</p>
|
|
168
|
+
<p>--radius-xl: calc(var(--radius) + 2px)</p>
|
|
169
|
+
<p>--radius-2xl: calc(var(--radius) + 4px)</p>
|
|
159
170
|
</div>
|
|
160
171
|
</div>
|
|
161
172
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Card } from './card';
|
|
3
3
|
import { Button } from './button';
|
|
4
4
|
|
|
5
|
-
export const BorderRadiusShadowDemo= () => {
|
|
5
|
+
export const BorderRadiusShadowDemo: React.FC = () => {
|
|
6
6
|
return (
|
|
7
7
|
<div className="space-y-6">
|
|
8
8
|
<div className="text-center">
|
|
@@ -19,7 +19,8 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
19
19
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
20
20
|
Border Radius System
|
|
21
21
|
</h3>
|
|
22
|
-
<div className="grid grid-cols-1 md
|
|
22
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
23
|
+
<div className="space-y-2">
|
|
23
24
|
<div className="h-20 bg-cs-primary rounded-sm flex items-center justify-center text-white font-medium">
|
|
24
25
|
rounded-sm
|
|
25
26
|
</div>
|
|
@@ -68,7 +69,8 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
68
69
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
69
70
|
Shadow System
|
|
70
71
|
</h3>
|
|
71
|
-
<div className="grid grid-cols-1 md
|
|
72
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
73
|
+
<div className="space-y-2">
|
|
72
74
|
<div className="h-20 bg-white rounded-lg shadow-sm flex items-center justify-center text-cs-text-primary font-medium border">
|
|
73
75
|
shadow-sm
|
|
74
76
|
</div>
|
|
@@ -118,7 +120,8 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
118
120
|
Component Integration
|
|
119
121
|
</h3>
|
|
120
122
|
<div className="space-y-4">
|
|
121
|
-
<div className="grid grid-cols-1 md
|
|
123
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
124
|
+
<Button variant="default" className="w-full">
|
|
122
125
|
Default Button
|
|
123
126
|
</Button>
|
|
124
127
|
<Button variant="outline" className="w-full">
|
|
@@ -129,12 +132,17 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
129
132
|
</Button>
|
|
130
133
|
</div>
|
|
131
134
|
|
|
132
|
-
<div className="grid grid-cols-1 md
|
|
135
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
136
|
+
<div className="space-y-2">
|
|
133
137
|
<label className="text-sm font-medium text-cs-text-secondary">Input Field</label>
|
|
134
138
|
<input
|
|
135
139
|
type="text"
|
|
136
140
|
placeholder="Type something..."
|
|
137
|
-
className="w-full h-11 rounded-md border border-cs-border bg-cs-surface-bg px-3 py-2 text-cs-text-primary focus
|
|
141
|
+
className="w-full h-11 rounded-md border border-cs-border bg-cs-surface-bg px-3 py-2 text-cs-text-primary focus:outline-none focus:ring-2 focus:ring-cs-primary focus:ring-offset-2"
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<div className="space-y-2">
|
|
138
146
|
<label className="text-sm font-medium text-cs-text-secondary">Card Example</label>
|
|
139
147
|
<div className="p-4 rounded-lg border border-cs-border bg-cs-surface-bg shadow-sm">
|
|
140
148
|
<p className="text-sm text-cs-text-secondary">This card uses rounded-lg and shadow-sm</p>
|
|
@@ -149,13 +157,16 @@ export const BorderRadiusShadowDemo= () => {
|
|
|
149
157
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
150
158
|
Technical Implementation
|
|
151
159
|
</h3>
|
|
152
|
-
<div className="grid grid-cols-1 md
|
|
160
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
161
|
+
<div>
|
|
162
|
+
<h4 className="font-medium text-cs-text-primary mb-2">CSS Custom Properties</h4>
|
|
153
163
|
<div className="bg-cs-surface-bg p-3 rounded-md text-xs font-mono text-cs-text-secondary overflow-auto">
|
|
154
|
-
<p>--radius
|
|
155
|
-
<p>--radius-
|
|
156
|
-
<p>--radius-
|
|
157
|
-
<p>--radius-
|
|
158
|
-
<p>--radius-
|
|
164
|
+
<p>--radius: 0.5rem</p>
|
|
165
|
+
<p>--radius-sm: calc(var(--radius) - 4px)</p>
|
|
166
|
+
<p>--radius-md: calc(var(--radius) - 2px)</p>
|
|
167
|
+
<p>--radius-lg: var(--radius)</p>
|
|
168
|
+
<p>--radius-xl: calc(var(--radius) + 2px)</p>
|
|
169
|
+
<p>--radius-2xl: calc(var(--radius) + 4px)</p>
|
|
159
170
|
</div>
|
|
160
171
|
</div>
|
|
161
172
|
|
|
@@ -3,11 +3,17 @@ import { Slot } from "@radix-ui/react-slot"
|
|
|
3
3
|
|
|
4
4
|
export interface ButtonProps
|
|
5
5
|
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
-
variant
|
|
6
|
+
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'
|
|
7
|
+
size?: 'default' | 'sm' | 'lg' | 'icon' | 'mobile'
|
|
8
|
+
asChild?: boolean
|
|
9
|
+
}
|
|
7
10
|
|
|
8
11
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
9
12
|
({ className, variant = 'default', size = 'default', asChild = false, ...props }, ref) => {
|
|
10
|
-
const Comp = asChild ? Slot
|
|
13
|
+
const Comp = asChild ? Slot : "button"
|
|
14
|
+
|
|
15
|
+
// Build semantic CSS classes using BEM methodology
|
|
16
|
+
const baseClass = 'button'
|
|
11
17
|
const variantClass = `button--variant-${variant}`
|
|
12
18
|
const sizeClass = `button--size-${size}`
|
|
13
19
|
|