@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.9 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/components/ui/accessibility-demo.esm.js +30 -24
- package/dist/components/ui/accessibility-demo.js +30 -24
- package/dist/components/ui/advanced-component-architecture-demo.esm.js +235 -179
- package/dist/components/ui/advanced-component-architecture-demo.js +235 -179
- package/dist/components/ui/advanced-transition-system-demo.esm.js +110 -64
- package/dist/components/ui/advanced-transition-system-demo.js +110 -64
- package/dist/components/ui/advanced-transition-system.esm.js +166 -122
- package/dist/components/ui/advanced-transition-system.js +166 -122
- package/dist/components/ui/animation/animated-container.esm.js +52 -29
- package/dist/components/ui/animation/animated-container.js +52 -29
- package/dist/components/ui/animation/staggered-container.esm.js +18 -9
- package/dist/components/ui/animation/staggered-container.js +18 -9
- package/dist/components/ui/animation-demo.esm.js +67 -35
- package/dist/components/ui/animation-demo.js +67 -35
- package/dist/components/ui/badge.esm.js +9 -6
- package/dist/components/ui/badge.js +9 -6
- package/dist/components/ui/battery-conscious-animation-demo.esm.js +122 -87
- package/dist/components/ui/battery-conscious-animation-demo.js +122 -87
- package/dist/components/ui/border-radius-shadow-demo.esm.js +23 -12
- package/dist/components/ui/border-radius-shadow-demo.js +23 -12
- package/dist/components/ui/button.esm.js +8 -2
- package/dist/components/ui/button.js +8 -2
- package/dist/components/ui/card.esm.js +33 -8
- package/dist/components/ui/card.js +33 -8
- package/dist/components/ui/checkbox.esm.js +3 -3
- package/dist/components/ui/checkbox.js +3 -3
- package/dist/components/ui/color-preview.esm.js +68 -45
- package/dist/components/ui/color-preview.js +68 -45
- package/dist/components/ui/data-display/chart.esm.js +112 -84
- package/dist/components/ui/data-display/chart.js +112 -84
- package/dist/components/ui/data-display/data-grid-simple.esm.js +1 -1
- package/dist/components/ui/data-display/data-grid-simple.js +1 -1
- package/dist/components/ui/data-display/data-grid.esm.js +80 -67
- package/dist/components/ui/data-display/data-grid.js +80 -67
- package/dist/components/ui/data-display/list.esm.js +53 -45
- package/dist/components/ui/data-display/list.js +53 -45
- package/dist/components/ui/data-display/table.esm.js +62 -54
- package/dist/components/ui/data-display/table.js +62 -54
- package/dist/components/ui/data-display/timeline.esm.js +39 -34
- package/dist/components/ui/data-display/timeline.js +39 -34
- package/dist/components/ui/data-display/tree.esm.js +116 -84
- package/dist/components/ui/data-display/tree.js +116 -84
- package/dist/components/ui/data-display/types.esm.js +389 -364
- package/dist/components/ui/data-display/types.js +389 -364
- package/dist/components/ui/enterprise-mobile-experience-demo.esm.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience-demo.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience.esm.js +124 -73
- package/dist/components/ui/enterprise-mobile-experience.js +124 -73
- package/dist/components/ui/feedback/alert.esm.js +22 -15
- package/dist/components/ui/feedback/alert.js +22 -15
- package/dist/components/ui/feedback/progress.esm.js +47 -24
- package/dist/components/ui/feedback/progress.js +47 -24
- package/dist/components/ui/feedback/skeleton.esm.js +39 -29
- package/dist/components/ui/feedback/skeleton.js +39 -29
- package/dist/components/ui/feedback/toast.esm.js +62 -38
- package/dist/components/ui/feedback/toast.js +62 -38
- package/dist/components/ui/feedback/types.esm.js +83 -83
- package/dist/components/ui/feedback/types.js +83 -83
- package/dist/components/ui/font-preview.esm.js +41 -39
- package/dist/components/ui/font-preview.js +41 -39
- package/dist/components/ui/form-demo.esm.js +150 -113
- package/dist/components/ui/form-demo.js +150 -113
- package/dist/components/ui/hardware-acceleration-demo.esm.js +137 -87
- package/dist/components/ui/hardware-acceleration-demo.js +137 -87
- package/dist/components/ui/input.esm.js +4 -1
- package/dist/components/ui/input.js +4 -1
- package/dist/components/ui/layout-demo.esm.js +81 -56
- package/dist/components/ui/layout-demo.js +81 -56
- package/dist/components/ui/layouts/adaptive-layout.esm.js +27 -8
- package/dist/components/ui/layouts/adaptive-layout.js +27 -8
- package/dist/components/ui/layouts/desktop-layout.esm.js +39 -19
- package/dist/components/ui/layouts/desktop-layout.js +39 -19
- package/dist/components/ui/layouts/mobile-layout.esm.js +19 -9
- package/dist/components/ui/layouts/mobile-layout.js +19 -9
- package/dist/components/ui/layouts/tablet-layout.esm.js +28 -14
- package/dist/components/ui/layouts/tablet-layout.js +28 -14
- package/dist/components/ui/mobile-form-validation.esm.js +120 -87
- package/dist/components/ui/mobile-form-validation.js +120 -87
- package/dist/components/ui/mobile-input-demo.esm.js +19 -13
- package/dist/components/ui/mobile-input-demo.js +19 -13
- package/dist/components/ui/mobile-input.esm.js +185 -120
- package/dist/components/ui/mobile-input.js +185 -120
- package/dist/components/ui/mobile-skeleton-loading-demo.esm.js +128 -111
- package/dist/components/ui/mobile-skeleton-loading-demo.js +128 -111
- package/dist/components/ui/navigation/breadcrumb.esm.js +17 -14
- package/dist/components/ui/navigation/breadcrumb.js +17 -14
- package/dist/components/ui/navigation/index.esm.js +0 -1
- package/dist/components/ui/navigation/index.js +0 -1
- package/dist/components/ui/navigation/menu.esm.js +49 -35
- package/dist/components/ui/navigation/menu.js +49 -35
- package/dist/components/ui/navigation/navigation-demo.esm.js +81 -74
- package/dist/components/ui/navigation/navigation-demo.js +81 -74
- package/dist/components/ui/navigation/pagination.esm.js +62 -50
- package/dist/components/ui/navigation/pagination.js +62 -50
- package/dist/components/ui/navigation/sidebar.esm.js +56 -42
- package/dist/components/ui/navigation/sidebar.js +56 -42
- package/dist/components/ui/navigation/stepper.esm.js +34 -23
- package/dist/components/ui/navigation/stepper.js +34 -23
- package/dist/components/ui/navigation/tabs.esm.js +32 -21
- package/dist/components/ui/navigation/tabs.js +32 -21
- package/dist/components/ui/navigation/types.esm.js +196 -195
- package/dist/components/ui/navigation/types.js +196 -195
- package/dist/components/ui/overlay/backdrop.esm.js +17 -16
- package/dist/components/ui/overlay/backdrop.js +17 -16
- package/dist/components/ui/overlay/focus-manager.esm.js +21 -19
- package/dist/components/ui/overlay/focus-manager.js +21 -19
- package/dist/components/ui/overlay/index.esm.js +0 -2
- package/dist/components/ui/overlay/index.js +0 -2
- package/dist/components/ui/overlay/modal.esm.js +38 -34
- package/dist/components/ui/overlay/modal.js +38 -34
- package/dist/components/ui/overlay/overlay-manager.esm.js +25 -20
- package/dist/components/ui/overlay/overlay-manager.js +25 -20
- package/dist/components/ui/overlay/popover.esm.js +74 -58
- package/dist/components/ui/overlay/popover.js +74 -58
- package/dist/components/ui/overlay/portal.esm.js +7 -7
- package/dist/components/ui/overlay/portal.js +7 -7
- package/dist/components/ui/overlay/tooltip.esm.js +54 -39
- package/dist/components/ui/overlay/tooltip.js +54 -39
- package/dist/components/ui/overlay/types.esm.js +132 -131
- package/dist/components/ui/overlay/types.js +132 -131
- package/dist/components/ui/performance-demo.esm.js +135 -88
- package/dist/components/ui/performance-demo.js +135 -88
- package/dist/components/ui/semantic-input-system-demo.esm.js +117 -80
- package/dist/components/ui/semantic-input-system-demo.js +117 -80
- package/dist/components/ui/theme-customizer.esm.js +84 -52
- package/dist/components/ui/theme-customizer.js +84 -52
- package/dist/components/ui/theme-preview.esm.js +95 -43
- package/dist/components/ui/theme-preview.js +95 -43
- package/dist/components/ui/theme-switcher.esm.js +70 -44
- package/dist/components/ui/theme-switcher.js +70 -44
- package/dist/components/ui/theme-toggle.esm.js +3 -3
- package/dist/components/ui/theme-toggle.js +3 -3
- package/dist/components/ui/token-demo.esm.js +33 -21
- package/dist/components/ui/token-demo.js +33 -21
- package/dist/components/ui/touch-demo.esm.js +102 -73
- package/dist/components/ui/touch-demo.js +102 -73
- package/dist/components/ui/touch-friendly-interface-demo.esm.js +102 -64
- package/dist/components/ui/touch-friendly-interface-demo.js +102 -64
- package/dist/components/ui/touch-friendly-interface.esm.js +85 -61
- package/dist/components/ui/touch-friendly-interface.js +85 -61
- package/dist/hooks/use-accessibility-support.esm.js +115 -85
- package/dist/hooks/use-accessibility-support.js +115 -85
- package/dist/hooks/use-adaptive-layout.esm.js +56 -33
- package/dist/hooks/use-adaptive-layout.js +56 -33
- package/dist/hooks/use-advanced-patterns.esm.js +57 -42
- package/dist/hooks/use-advanced-patterns.js +57 -42
- package/dist/hooks/use-advanced-transition-system.esm.js +112 -71
- package/dist/hooks/use-advanced-transition-system.js +112 -71
- package/dist/hooks/use-animation-profile.esm.js +63 -34
- package/dist/hooks/use-animation-profile.js +63 -34
- package/dist/hooks/use-battery-animations.esm.js +80 -55
- package/dist/hooks/use-battery-animations.js +80 -55
- package/dist/hooks/use-battery-conscious-loading.esm.js +166 -123
- package/dist/hooks/use-battery-conscious-loading.js +166 -123
- package/dist/hooks/use-battery-optimization.esm.js +78 -55
- package/dist/hooks/use-battery-optimization.js +78 -55
- package/dist/hooks/use-battery-status.esm.js +73 -51
- package/dist/hooks/use-battery-status.js +73 -51
- package/dist/hooks/use-component-performance.esm.js +62 -47
- package/dist/hooks/use-component-performance.js +62 -47
- package/dist/hooks/use-device-loading-states.esm.js +152 -109
- package/dist/hooks/use-device-loading-states.js +152 -109
- package/dist/hooks/use-device.esm.js +25 -14
- package/dist/hooks/use-device.js +25 -14
- package/dist/hooks/use-enterprise-mobile-experience.esm.js +137 -88
- package/dist/hooks/use-enterprise-mobile-experience.js +137 -88
- package/dist/hooks/use-form-feedback.esm.js +124 -81
- package/dist/hooks/use-form-feedback.js +124 -81
- package/dist/hooks/use-form-performance.esm.js +127 -92
- package/dist/hooks/use-form-performance.js +127 -92
- package/dist/hooks/use-frame-rate.esm.js +56 -37
- package/dist/hooks/use-frame-rate.js +56 -37
- package/dist/hooks/use-gestures.esm.js +96 -72
- package/dist/hooks/use-gestures.js +96 -72
- package/dist/hooks/use-hardware-acceleration.esm.js +65 -37
- package/dist/hooks/use-hardware-acceleration.js +65 -37
- package/dist/hooks/use-input-accessibility.esm.js +157 -119
- package/dist/hooks/use-input-accessibility.js +157 -119
- package/dist/hooks/use-input-performance.esm.js +139 -104
- package/dist/hooks/use-input-performance.js +139 -104
- package/dist/hooks/use-layout-performance.esm.js +50 -29
- package/dist/hooks/use-layout-performance.js +50 -29
- package/dist/hooks/use-loading-accessibility.esm.js +209 -169
- package/dist/hooks/use-loading-accessibility.js +209 -169
- package/dist/hooks/use-loading-performance.esm.js +117 -93
- package/dist/hooks/use-loading-performance.js +117 -93
- package/dist/hooks/use-memory-usage.esm.js +57 -38
- package/dist/hooks/use-memory-usage.js +57 -38
- package/dist/hooks/use-mobile-form-layout.esm.js +111 -74
- package/dist/hooks/use-mobile-form-layout.js +111 -74
- package/dist/hooks/use-mobile-form-validation.esm.js +211 -144
- package/dist/hooks/use-mobile-form-validation.js +211 -144
- package/dist/hooks/use-mobile-keyboard-optimization.esm.js +154 -113
- package/dist/hooks/use-mobile-keyboard-optimization.js +154 -113
- package/dist/hooks/use-mobile-layout.esm.js +73 -51
- package/dist/hooks/use-mobile-layout.js +73 -51
- package/dist/hooks/use-mobile-optimization.esm.js +72 -44
- package/dist/hooks/use-mobile-optimization.js +72 -44
- package/dist/hooks/use-mobile-skeleton.esm.js +97 -64
- package/dist/hooks/use-mobile-skeleton.js +97 -64
- package/dist/hooks/use-mobile-touch.esm.js +128 -93
- package/dist/hooks/use-mobile-touch.js +128 -93
- package/dist/hooks/use-performance-throttling.esm.js +72 -48
- package/dist/hooks/use-performance-throttling.js +72 -48
- package/dist/hooks/use-performance.esm.js +90 -52
- package/dist/hooks/use-performance.js +90 -52
- package/dist/hooks/use-reusable-architecture.esm.js +94 -65
- package/dist/hooks/use-reusable-architecture.js +94 -65
- package/dist/hooks/use-semantic-input-types.esm.js +166 -124
- package/dist/hooks/use-semantic-input-types.js +166 -124
- package/dist/hooks/use-semantic-input.esm.js +178 -126
- package/dist/hooks/use-semantic-input.js +178 -126
- package/dist/hooks/use-tablet-layout.esm.js +67 -38
- package/dist/hooks/use-tablet-layout.js +67 -38
- package/dist/hooks/use-touch-friendly-input.esm.js +193 -149
- package/dist/hooks/use-touch-friendly-input.js +193 -149
- package/dist/hooks/use-touch-friendly-interface.esm.js +99 -67
- package/dist/hooks/use-touch-friendly-interface.js +99 -67
- package/dist/hooks/use-touch-optimization.esm.js +99 -72
- package/dist/hooks/use-touch-optimization.js +99 -72
- package/dist/index.esm.js +157 -281
- package/dist/index.js +157 -281
- package/dist/lib/utils.esm.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/plugins/theme-css-generator.esm.js +104 -55
- package/dist/plugins/theme-css-generator.js +104 -55
- package/dist/provider.esm.js +4 -4
- package/dist/provider.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/theme.esm.js +633 -468
- package/dist/theme.js +633 -468
- package/dist/themes/ThemeContext.esm.js +15 -15
- package/dist/themes/ThemeContext.js +15 -15
- package/dist/themes/ThemeProvider.esm.js +25 -22
- package/dist/themes/ThemeProvider.js +25 -22
- package/dist/themes/accessibility.esm.js +147 -108
- package/dist/themes/accessibility.js +147 -108
- package/dist/themes/aria-patterns.esm.js +198 -162
- package/dist/themes/aria-patterns.js +198 -162
- package/dist/themes/base-themes.esm.js +14 -11
- package/dist/themes/base-themes.js +14 -11
- package/dist/themes/colorManager.esm.js +101 -83
- package/dist/themes/colorManager.js +101 -83
- package/dist/themes/examples/dark-theme.esm.js +133 -103
- package/dist/themes/examples/dark-theme.js +133 -103
- package/dist/themes/examples/minimal-theme.esm.js +83 -61
- package/dist/themes/examples/minimal-theme.js +83 -61
- package/dist/themes/focus-management.esm.js +202 -143
- package/dist/themes/focus-management.js +202 -143
- package/dist/themes/fontLoader.esm.js +28 -19
- package/dist/themes/fontLoader.js +28 -19
- package/dist/themes/high-contrast.esm.js +152 -104
- package/dist/themes/high-contrast.js +152 -104
- package/dist/themes/index.esm.js +1 -1
- package/dist/themes/index.js +1 -1
- package/dist/themes/inheritance.esm.js +35 -27
- package/dist/themes/inheritance.js +35 -27
- package/dist/themes/keyboard-navigation.esm.js +152 -123
- package/dist/themes/keyboard-navigation.js +152 -123
- package/dist/themes/motion-reduction.esm.js +193 -133
- package/dist/themes/motion-reduction.js +193 -133
- package/dist/themes/navigation.esm.js +146 -146
- package/dist/themes/navigation.js +146 -146
- package/dist/themes/screen-reader.esm.js +159 -94
- package/dist/themes/screen-reader.js +159 -94
- package/dist/themes/systemThemeDetector.esm.js +42 -34
- package/dist/themes/systemThemeDetector.js +42 -34
- package/dist/themes/themeCSSUpdater.esm.js +21 -9
- package/dist/themes/themeCSSUpdater.js +21 -9
- package/dist/themes/themePersistence.esm.js +68 -47
- package/dist/themes/themePersistence.js +68 -47
- package/dist/themes/themes/stan-design.esm.js +633 -468
- package/dist/themes/themes/stan-design.js +633 -468
- package/dist/themes/types.esm.js +301 -287
- package/dist/themes/types.js +301 -287
- package/dist/themes/useSystemTheme.esm.js +4 -4
- package/dist/themes/useSystemTheme.js +4 -4
- package/dist/themes/useTheme.esm.js +4 -4
- package/dist/themes/useTheme.js +4 -4
- package/dist/themes/validation.esm.js +128 -77
- package/dist/themes/validation.js +128 -77
- package/dist/tokens/index.esm.js +1 -2
- package/dist/tokens/index.js +1 -2
- package/dist/tokens/tokenExporter.esm.js +87 -61
- package/dist/tokens/tokenExporter.js +87 -61
- package/dist/tokens/tokenGenerator.esm.js +86 -77
- package/dist/tokens/tokenGenerator.js +86 -77
- package/dist/tokens/tokenManager.esm.js +64 -51
- package/dist/tokens/tokenManager.js +64 -51
- package/dist/tokens/tokenValidator.esm.js +193 -147
- package/dist/tokens/tokenValidator.js +193 -147
- package/dist/tokens/types.esm.js +49 -35
- package/dist/tokens/types.js +49 -35
- package/dist/utils/bundle-analyzer.esm.js +83 -65
- package/dist/utils/bundle-analyzer.js +83 -65
- package/dist/utils/bundle-splitting.esm.js +142 -117
- package/dist/utils/bundle-splitting.js +142 -117
- package/dist/utils/lazy-loading.esm.js +132 -106
- package/dist/utils/lazy-loading.js +132 -106
- package/dist/utils/performance-monitor.esm.js +170 -129
- package/dist/utils/performance-monitor.js +170 -129
- package/dist/utils/tree-shaking.esm.js +69 -61
- package/dist/utils/tree-shaking.js +69 -61
- package/package.json +1 -1
- package/src/index.ts +146 -146
|
@@ -8,7 +8,7 @@ import { useLoadingPerformance } from '../../hooks/use-loading-performance'
|
|
|
8
8
|
import { useBatteryConsciousLoading } from '../../hooks/use-battery-conscious-loading'
|
|
9
9
|
import { useLoadingAccessibility } from '../../hooks/use-loading-accessibility'
|
|
10
10
|
|
|
11
|
-
export const MobileSkeletonLoadingDemo= () => {
|
|
11
|
+
export const MobileSkeletonLoadingDemo: React.FC = () => {
|
|
12
12
|
const [activeTab, setActiveTab] = useState('overview')
|
|
13
13
|
const [isLoading, setIsLoading] = useState(false)
|
|
14
14
|
const [loadingProgress, setLoadingProgress] = useState(0)
|
|
@@ -17,83 +17,88 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
17
17
|
// Initialize all hooks
|
|
18
18
|
const mobileSkeleton = useMobileSkeleton(
|
|
19
19
|
{
|
|
20
|
-
enableMobileOptimization,
|
|
21
|
-
enablePerformanceOptimization,
|
|
22
|
-
enableBatteryOptimization,
|
|
23
|
-
enableAccessibilitySupport,
|
|
24
|
-
enableTouchOptimization
|
|
20
|
+
enableMobileOptimization: true,
|
|
21
|
+
enablePerformanceOptimization: true,
|
|
22
|
+
enableBatteryOptimization: true,
|
|
23
|
+
enableAccessibilitySupport: true,
|
|
24
|
+
enableTouchOptimization: true
|
|
25
|
+
},
|
|
25
26
|
{
|
|
26
|
-
onSkeletonCreated) => console.log('Skeleton created, variant),
|
|
27
|
-
onLoadingStateChanged) => console.log('Loading state changed, state),
|
|
28
|
-
onPerformanceOptimized) => console.log('Performance optimized, optimization),
|
|
29
|
-
onBatteryOptimized) => console.log('Battery optimized, strategy),
|
|
30
|
-
onAccessibilityEnhanced) => console.log('Accessibility enhanced, feature)
|
|
27
|
+
onSkeletonCreated: (variant) => console.log('Skeleton created:', variant),
|
|
28
|
+
onLoadingStateChanged: (state) => console.log('Loading state changed:', state),
|
|
29
|
+
onPerformanceOptimized: (optimization) => console.log('Performance optimized:', optimization),
|
|
30
|
+
onBatteryOptimized: (strategy) => console.log('Battery optimized:', strategy),
|
|
31
|
+
onAccessibilityEnhanced: (feature) => console.log('Accessibility enhanced:', feature)
|
|
31
32
|
}
|
|
32
33
|
)
|
|
33
34
|
|
|
34
35
|
const deviceLoadingStates = useDeviceLoadingStates(
|
|
35
36
|
{
|
|
36
|
-
enableMobileStates,
|
|
37
|
-
enableTabletStates,
|
|
38
|
-
enableDesktopStates,
|
|
39
|
-
enableAdaptiveBehavior,
|
|
40
|
-
enableOrientationSupport,
|
|
41
|
-
enablePerformanceAdaptation
|
|
37
|
+
enableMobileStates: true,
|
|
38
|
+
enableTabletStates: true,
|
|
39
|
+
enableDesktopStates: true,
|
|
40
|
+
enableAdaptiveBehavior: true,
|
|
41
|
+
enableOrientationSupport: true,
|
|
42
|
+
enablePerformanceAdaptation: true
|
|
43
|
+
},
|
|
42
44
|
{
|
|
43
|
-
onLoadingStateChanged) => console.log('Device loading state changed, state),
|
|
44
|
-
onDeviceStateChanged) => console.log('Device state changed, deviceState),
|
|
45
|
-
onAdaptiveBehaviorEnabled) => console.log('Adaptive behavior enabled, behavior),
|
|
46
|
-
onPerformanceAdapted) => console.log('Performance adapted, adaptation)
|
|
45
|
+
onLoadingStateChanged: (state) => console.log('Device loading state changed:', state),
|
|
46
|
+
onDeviceStateChanged: (deviceState) => console.log('Device state changed:', deviceState),
|
|
47
|
+
onAdaptiveBehaviorEnabled: (behavior) => console.log('Adaptive behavior enabled:', behavior),
|
|
48
|
+
onPerformanceAdapted: (adaptation) => console.log('Performance adapted:', adaptation)
|
|
47
49
|
}
|
|
48
50
|
)
|
|
49
51
|
|
|
50
52
|
const loadingPerformance = useLoadingPerformance(
|
|
51
53
|
{
|
|
52
|
-
enableAnimationOptimization,
|
|
53
|
-
enableMemoryManagement,
|
|
54
|
-
enableBatteryOptimization,
|
|
55
|
-
enablePerformanceMonitoring,
|
|
56
|
-
enableAutoOptimization
|
|
54
|
+
enableAnimationOptimization: true,
|
|
55
|
+
enableMemoryManagement: true,
|
|
56
|
+
enableBatteryOptimization: true,
|
|
57
|
+
enablePerformanceMonitoring: true,
|
|
58
|
+
enableAutoOptimization: true
|
|
59
|
+
},
|
|
57
60
|
{
|
|
58
|
-
onPerformanceOptimized) => console.log('Loading performance optimized, strategy),
|
|
59
|
-
onMemoryOptimized) => console.log('Memory optimized, optimization),
|
|
60
|
-
onBatteryOptimized) => console.log('Battery optimized, strategy),
|
|
61
|
-
onAnimationOptimized) => console.log('Animation optimized, optimization)
|
|
61
|
+
onPerformanceOptimized: (strategy) => console.log('Loading performance optimized:', strategy),
|
|
62
|
+
onMemoryOptimized: (optimization) => console.log('Memory optimized:', optimization),
|
|
63
|
+
onBatteryOptimized: (strategy) => console.log('Battery optimized:', strategy),
|
|
64
|
+
onAnimationOptimized: (optimization) => console.log('Animation optimized:', optimization)
|
|
62
65
|
}
|
|
63
66
|
)
|
|
64
67
|
|
|
65
68
|
const batteryConsciousLoading = useBatteryConsciousLoading(
|
|
66
69
|
{
|
|
67
|
-
enableBatteryMonitoring,
|
|
68
|
-
enableLoadingOptimization,
|
|
69
|
-
enablePerformanceAdjustment,
|
|
70
|
-
enableUserNotification,
|
|
71
|
-
enableAutoOptimization
|
|
70
|
+
enableBatteryMonitoring: true,
|
|
71
|
+
enableLoadingOptimization: true,
|
|
72
|
+
enablePerformanceAdjustment: true,
|
|
73
|
+
enableUserNotification: true,
|
|
74
|
+
enableAutoOptimization: true
|
|
75
|
+
},
|
|
72
76
|
{
|
|
73
|
-
onBatteryLevelChanged) => console.log('Battery level changed, batteryState),
|
|
74
|
-
onLoadingOptimized) => console.log('Loading optimized for battery, optimization),
|
|
75
|
-
onPerformanceAdjusted) => console.log('Performance adjusted, adjustment),
|
|
76
|
-
onUserNotified) => console.log('User notified, notification)
|
|
77
|
+
onBatteryLevelChanged: (batteryState) => console.log('Battery level changed:', batteryState),
|
|
78
|
+
onLoadingOptimized: (optimization) => console.log('Loading optimized for battery:', optimization),
|
|
79
|
+
onPerformanceAdjusted: (adjustment) => console.log('Performance adjusted:', adjustment),
|
|
80
|
+
onUserNotified: (notification) => console.log('User notified:', notification)
|
|
77
81
|
}
|
|
78
82
|
)
|
|
79
83
|
|
|
80
84
|
const loadingAccessibility = useLoadingAccessibility(
|
|
81
85
|
{
|
|
82
|
-
enableScreenReaderSupport,
|
|
83
|
-
enableReducedMotionSupport,
|
|
84
|
-
enableFocusManagement,
|
|
85
|
-
enableAriaSupport,
|
|
86
|
-
enableVoiceControl,
|
|
87
|
-
enableHighContrast,
|
|
88
|
-
enableKeyboardNavigation
|
|
86
|
+
enableScreenReaderSupport: true,
|
|
87
|
+
enableReducedMotionSupport: true,
|
|
88
|
+
enableFocusManagement: true,
|
|
89
|
+
enableAriaSupport: true,
|
|
90
|
+
enableVoiceControl: true,
|
|
91
|
+
enableHighContrast: true,
|
|
92
|
+
enableKeyboardNavigation: true
|
|
93
|
+
},
|
|
89
94
|
{
|
|
90
|
-
onScreenReaderEnhanced) => console.log('Screen reader enhanced, feature),
|
|
91
|
-
onReducedMotionApplied) => console.log('Reduced motion applied, feature),
|
|
92
|
-
onFocusManaged) => console.log('Focus managed, feature),
|
|
93
|
-
onAriaEnhanced) => console.log('ARIA enhanced, feature),
|
|
94
|
-
onVoiceControlEnabled) => console.log('Voice control enabled, feature),
|
|
95
|
-
onHighContrastApplied) => console.log('High contrast applied, feature),
|
|
96
|
-
onKeyboardNavigationEnabled) => console.log('Keyboard navigation enabled, feature)
|
|
95
|
+
onScreenReaderEnhanced: (feature) => console.log('Screen reader enhanced:', feature),
|
|
96
|
+
onReducedMotionApplied: (feature) => console.log('Reduced motion applied:', feature),
|
|
97
|
+
onFocusManaged: (feature) => console.log('Focus managed:', feature),
|
|
98
|
+
onAriaEnhanced: (feature) => console.log('ARIA enhanced:', feature),
|
|
99
|
+
onVoiceControlEnabled: (feature) => console.log('Voice control enabled:', feature),
|
|
100
|
+
onHighContrastApplied: (feature) => console.log('High contrast applied:', feature),
|
|
101
|
+
onKeyboardNavigationEnabled: (feature) => console.log('Keyboard navigation enabled:', feature)
|
|
97
102
|
}
|
|
98
103
|
)
|
|
99
104
|
|
|
@@ -128,7 +133,11 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
128
133
|
// Get device-specific loading class
|
|
129
134
|
const getLoadingStateClass = () => {
|
|
130
135
|
switch (deviceLoadingStates.deviceState.deviceType) {
|
|
131
|
-
case 'mobile'
|
|
136
|
+
case 'mobile': return 'loading-state-mobile'
|
|
137
|
+
case 'tablet': return 'loading-state-tablet'
|
|
138
|
+
case 'desktop': return 'loading-state-desktop'
|
|
139
|
+
default: return 'loading-state-mobile'
|
|
140
|
+
}
|
|
132
141
|
}
|
|
133
142
|
|
|
134
143
|
// Get battery-conscious class
|
|
@@ -172,35 +181,35 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
172
181
|
{/* Navigation */}
|
|
173
182
|
<div className="flex flex-wrap gap-2 mb-6">
|
|
174
183
|
<Button
|
|
175
|
-
variant={activeTab === 'overview' ? 'default' }
|
|
184
|
+
variant={activeTab === 'overview' ? 'default' : 'outline'}
|
|
176
185
|
onClick={() => setActiveTab('overview')}
|
|
177
186
|
size="sm"
|
|
178
187
|
>
|
|
179
188
|
Overview
|
|
180
189
|
</Button>
|
|
181
190
|
<Button
|
|
182
|
-
variant={activeTab === 'skeletons' ? 'default' }
|
|
191
|
+
variant={activeTab === 'skeletons' ? 'default' : 'outline'}
|
|
183
192
|
onClick={() => setActiveTab('skeletons')}
|
|
184
193
|
size="sm"
|
|
185
194
|
>
|
|
186
195
|
Skeletons
|
|
187
196
|
</Button>
|
|
188
197
|
<Button
|
|
189
|
-
variant={activeTab === 'loading' ? 'default' }
|
|
198
|
+
variant={activeTab === 'loading' ? 'default' : 'outline'}
|
|
190
199
|
onClick={() => setActiveTab('loading')}
|
|
191
200
|
size="sm"
|
|
192
201
|
>
|
|
193
202
|
Loading States
|
|
194
203
|
</Button>
|
|
195
204
|
<Button
|
|
196
|
-
variant={activeTab === 'performance' ? 'default' }
|
|
205
|
+
variant={activeTab === 'performance' ? 'default' : 'outline'}
|
|
197
206
|
onClick={() => setActiveTab('performance')}
|
|
198
207
|
size="sm"
|
|
199
208
|
>
|
|
200
209
|
Performance
|
|
201
210
|
</Button>
|
|
202
211
|
<Button
|
|
203
|
-
variant={activeTab === 'accessibility' ? 'default' }
|
|
212
|
+
variant={activeTab === 'accessibility' ? 'default' : 'outline'}
|
|
204
213
|
onClick={() => setActiveTab('accessibility')}
|
|
205
214
|
size="sm"
|
|
206
215
|
>
|
|
@@ -211,14 +220,15 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
211
220
|
{/* Overview Section */}
|
|
212
221
|
{activeTab === 'overview' && (
|
|
213
222
|
<div className="space-y-6">
|
|
214
|
-
<div className="grid grid-cols-1 md
|
|
223
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
224
|
+
{/* Device State */}
|
|
215
225
|
<div className="p-4 bg-blue-50 rounded-lg">
|
|
216
226
|
<h3 className="font-semibold text-blue-900 mb-2">Device State</h3>
|
|
217
227
|
<div className="space-y-1 text-sm">
|
|
218
|
-
<p><span className="font-medium">Type}</p>
|
|
219
|
-
<p><span className="font-medium">Orientation}</p>
|
|
220
|
-
<p><span className="font-medium">Screen}</p>
|
|
221
|
-
<p><span className="font-medium">Strategy]?.type || 'skeleton'}</p>
|
|
228
|
+
<p><span className="font-medium">Type:</span> {deviceLoadingStates.deviceState.deviceType}</p>
|
|
229
|
+
<p><span className="font-medium">Orientation:</span> {deviceLoadingStates.deviceState.orientation}</p>
|
|
230
|
+
<p><span className="font-medium">Screen:</span> {deviceLoadingStates.deviceState.screenSize}</p>
|
|
231
|
+
<p><span className="font-medium">Strategy:</span> {deviceLoadingStates.deviceState.loadingStates[0]?.type || 'skeleton'}</p>
|
|
222
232
|
</div>
|
|
223
233
|
</div>
|
|
224
234
|
|
|
@@ -226,10 +236,10 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
226
236
|
<div className="p-4 bg-yellow-50 rounded-lg">
|
|
227
237
|
<h3 className="font-semibold text-yellow-900 mb-2">Battery Status</h3>
|
|
228
238
|
<div className="space-y-1 text-sm">
|
|
229
|
-
<p><span className="font-medium">Level)}%</p>
|
|
230
|
-
<p><span className="font-medium">Status}</p>
|
|
231
|
-
<p><span className="font-medium">Mode}</p>
|
|
232
|
-
<p><span className="font-medium">Savings}%</p>
|
|
239
|
+
<p><span className="font-medium">Level:</span> {batteryConsciousLoading.getBatteryPercentage()}%</p>
|
|
240
|
+
<p><span className="font-medium">Status:</span> {batteryConsciousLoading.batteryState.status}</p>
|
|
241
|
+
<p><span className="font-medium">Mode:</span> {batteryConsciousLoading.performanceMode}</p>
|
|
242
|
+
<p><span className="font-medium">Savings:</span> {batteryConsciousLoading.batterySavings}%</p>
|
|
233
243
|
</div>
|
|
234
244
|
</div>
|
|
235
245
|
|
|
@@ -237,10 +247,10 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
237
247
|
<div className="p-4 bg-green-50 rounded-lg">
|
|
238
248
|
<h3 className="font-semibold text-green-900 mb-2">Performance</h3>
|
|
239
249
|
<div className="space-y-1 text-sm">
|
|
240
|
-
<p><span className="font-medium">FPS}</p>
|
|
241
|
-
<p><span className="font-medium">Render)}ms</p>
|
|
242
|
-
<p><span className="font-medium">Memory}MB</p>
|
|
243
|
-
<p><span className="font-medium">Health}</p>
|
|
250
|
+
<p><span className="font-medium">FPS:</span> {loadingPerformance.performanceMetrics.frameRate}</p>
|
|
251
|
+
<p><span className="font-medium">Render:</span> {Math.round(loadingPerformance.performanceMetrics.renderTime)}ms</p>
|
|
252
|
+
<p><span className="font-medium">Memory:</span> {loadingPerformance.performanceMetrics.memoryUsage}MB</p>
|
|
253
|
+
<p><span className="font-medium">Health:</span> {loadingPerformance.performanceHealth}</p>
|
|
244
254
|
</div>
|
|
245
255
|
</div>
|
|
246
256
|
|
|
@@ -248,10 +258,10 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
248
258
|
<div className="p-4 bg-purple-50 rounded-lg">
|
|
249
259
|
<h3 className="font-semibold text-purple-900 mb-2">Accessibility</h3>
|
|
250
260
|
<div className="space-y-1 text-sm">
|
|
251
|
-
<p><span className="font-medium">Score}%</p>
|
|
252
|
-
<p><span className="font-medium">Features}</p>
|
|
253
|
-
<p><span className="font-medium">Active}</p>
|
|
254
|
-
<p><span className="font-medium">Enhancing}</p>
|
|
261
|
+
<p><span className="font-medium">Score:</span> {loadingAccessibility.accessibilityScore}%</p>
|
|
262
|
+
<p><span className="font-medium">Features:</span> {loadingAccessibility.accessibilityFeatures.length}</p>
|
|
263
|
+
<p><span className="font-medium">Active:</span> {loadingAccessibility.activeFeatures.length}</p>
|
|
264
|
+
<p><span className="font-medium">Enhancing:</span> {loadingAccessibility.isEnhancing ? 'Yes' : 'No'}</p>
|
|
255
265
|
</div>
|
|
256
266
|
</div>
|
|
257
267
|
</div>
|
|
@@ -259,10 +269,10 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
259
269
|
{/* Controls */}
|
|
260
270
|
<div className="flex flex-wrap gap-4 justify-center">
|
|
261
271
|
<Button onClick={startLoading} disabled={isLoading}>
|
|
262
|
-
{isLoading ? 'Loading...' }
|
|
272
|
+
{isLoading ? 'Loading...' : 'Start Loading Simulation'}
|
|
263
273
|
</Button>
|
|
264
274
|
<Button onClick={toggleSkeletons} variant="outline">
|
|
265
|
-
{showSkeletons ? 'Hide' } Skeletons
|
|
275
|
+
{showSkeletons ? 'Hide' : 'Show'} Skeletons
|
|
266
276
|
</Button>
|
|
267
277
|
<Button onClick={loadingPerformance.autoOptimize} variant="outline">
|
|
268
278
|
Auto-Optimize Performance
|
|
@@ -316,13 +326,14 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
316
326
|
</div>
|
|
317
327
|
|
|
318
328
|
{/* Skeleton Variants */}
|
|
319
|
-
<div className="grid grid-cols-1 md
|
|
329
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
330
|
+
<div className="p-4 bg-gray-50 rounded-lg">
|
|
320
331
|
<h4 className="font-semibold mb-2">Available Skeleton Variants</h4>
|
|
321
332
|
<div className="space-y-2 text-sm">
|
|
322
333
|
{mobileSkeleton.skeletonVariants.map(variant => (
|
|
323
334
|
<div key={variant.id} className="flex justify-between items-center">
|
|
324
335
|
<span>{variant.name}</span>
|
|
325
|
-
<Badge variant={variant.mobileOptimized ? "default" }>
|
|
336
|
+
<Badge variant={variant.mobileOptimized ? "default" : "secondary"}>
|
|
326
337
|
{variant.animation}
|
|
327
338
|
</Badge>
|
|
328
339
|
</div>
|
|
@@ -333,10 +344,10 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
333
344
|
<div className="p-4 bg-gray-50 rounded-lg">
|
|
334
345
|
<h4 className="font-semibold mb-2">Device Optimizations</h4>
|
|
335
346
|
<div className="space-y-2 text-sm">
|
|
336
|
-
<p><span className="font-medium">Mobile Optimized) ? 'Yes' }</p>
|
|
337
|
-
<p><span className="font-medium">Loading Strategy)}</p>
|
|
338
|
-
<p><span className="font-medium">Animation Intensity)}</p>
|
|
339
|
-
<p><span className="font-medium">Touch Friendly=> v.touchFriendly) ? 'Yes' }</p>
|
|
347
|
+
<p><span className="font-medium">Mobile Optimized:</span> {mobileSkeleton.isMobileOptimized() ? 'Yes' : 'No'}</p>
|
|
348
|
+
<p><span className="font-medium">Loading Strategy:</span> {mobileSkeleton.getLoadingStrategy()}</p>
|
|
349
|
+
<p><span className="font-medium">Animation Intensity:</span> {mobileSkeleton.getAnimationIntensity()}</p>
|
|
350
|
+
<p><span className="font-medium">Touch Friendly:</span> {mobileSkeleton.skeletonVariants.some(v => v.touchFriendly) ? 'Yes' : 'No'}</p>
|
|
340
351
|
</div>
|
|
341
352
|
</div>
|
|
342
353
|
</div>
|
|
@@ -359,8 +370,8 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
359
370
|
<div className="loading-progress">
|
|
360
371
|
<div
|
|
361
372
|
className="loading-progress-bar"
|
|
362
|
-
style={{ width}%` }}
|
|
363
|
-
aria-label={`Loading progress}%`}
|
|
373
|
+
style={{ width: `${loadingProgress}%` }}
|
|
374
|
+
aria-label={`Loading progress: ${loadingProgress}%`}
|
|
364
375
|
></div>
|
|
365
376
|
</div>
|
|
366
377
|
<p className="text-center text-sm text-gray-600">
|
|
@@ -370,14 +381,15 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
370
381
|
)}
|
|
371
382
|
|
|
372
383
|
{/* Device Loading States */}
|
|
373
|
-
<div className="grid grid-cols-1 md
|
|
384
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
385
|
+
<div className="space-y-4">
|
|
374
386
|
<h4 className="font-semibold">Current Device State</h4>
|
|
375
387
|
<div className="p-4 bg-blue-50 rounded-lg space-y-2">
|
|
376
|
-
<p><span className="font-medium">Device}</p>
|
|
377
|
-
<p><span className="font-medium">Orientation}</p>
|
|
378
|
-
<p><span className="font-medium">Performance}</p>
|
|
379
|
-
<p><span className="font-medium">Battery}</p>
|
|
380
|
-
<p><span className="font-medium">Adaptive}</p>
|
|
388
|
+
<p><span className="font-medium">Device:</span> {deviceLoadingStates.deviceState.deviceType}</p>
|
|
389
|
+
<p><span className="font-medium">Orientation:</span> {deviceLoadingStates.deviceState.orientation}</p>
|
|
390
|
+
<p><span className="font-medium">Performance:</span> {deviceLoadingStates.deviceState.performanceLevel}</p>
|
|
391
|
+
<p><span className="font-medium">Battery:</span> {deviceLoadingStates.deviceState.batteryLevel}</p>
|
|
392
|
+
<p><span className="font-medium">Adaptive:</span> {deviceLoadingStates.deviceState.adaptiveBehavior ? 'Yes' : 'No'}</p>
|
|
381
393
|
</div>
|
|
382
394
|
</div>
|
|
383
395
|
|
|
@@ -391,9 +403,9 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
391
403
|
<Badge variant="outline">{state.type}</Badge>
|
|
392
404
|
</div>
|
|
393
405
|
<div className="text-sm text-gray-600">
|
|
394
|
-
<p>Duration}ms</p>
|
|
395
|
-
<p>Complexity}</p>
|
|
396
|
-
<p>Performance}</p>
|
|
406
|
+
<p>Duration: {state.duration}ms</p>
|
|
407
|
+
<p>Complexity: {state.complexity}</p>
|
|
408
|
+
<p>Performance: {state.performance}</p>
|
|
397
409
|
</div>
|
|
398
410
|
</div>
|
|
399
411
|
))}
|
|
@@ -427,7 +439,8 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
427
439
|
</div>
|
|
428
440
|
|
|
429
441
|
{/* Performance Metrics */}
|
|
430
|
-
<div className="grid grid-cols-2 md
|
|
442
|
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
|
443
|
+
<div className="metric-item">
|
|
431
444
|
<div className="metric-value">{loadingPerformance.performanceMetrics.frameRate}</div>
|
|
432
445
|
<div className="metric-label">FPS</div>
|
|
433
446
|
</div>
|
|
@@ -447,7 +460,7 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
447
460
|
|
|
448
461
|
{/* Performance Health */}
|
|
449
462
|
<div className="p-4 bg-gray-50 rounded-lg">
|
|
450
|
-
<h4 className="font-semibold mb-3">Performance Health}</h4>
|
|
463
|
+
<h4 className="font-semibold mb-3">Performance Health: {loadingPerformance.performanceHealth}</h4>
|
|
451
464
|
<div className="space-y-2">
|
|
452
465
|
{loadingPerformance.getOptimizationRecommendations().map((recommendation, index) => (
|
|
453
466
|
<p key={index} className="text-sm text-gray-600">• {recommendation}</p>
|
|
@@ -458,11 +471,12 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
458
471
|
{/* Optimization Strategies */}
|
|
459
472
|
<div className="space-y-4">
|
|
460
473
|
<h4 className="font-semibold">Applied Optimizations</h4>
|
|
461
|
-
<div className="grid grid-cols-1 md
|
|
474
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
475
|
+
{loadingPerformance.optimizationStrategies.map(strategy => (
|
|
462
476
|
<div key={strategy.id} className="p-3 bg-green-50 rounded-lg">
|
|
463
477
|
<div className="flex justify-between items-center mb-1">
|
|
464
478
|
<span className="font-medium">{strategy.name}</span>
|
|
465
|
-
<Badge variant={strategy.impact === 'high' ? 'default' }>
|
|
479
|
+
<Badge variant={strategy.impact === 'high' ? 'default' : 'secondary'}>
|
|
466
480
|
{strategy.impact}
|
|
467
481
|
</Badge>
|
|
468
482
|
</div>
|
|
@@ -509,20 +523,21 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
509
523
|
</div>
|
|
510
524
|
|
|
511
525
|
{/* Accessibility State */}
|
|
512
|
-
<div className="grid grid-cols-2 md
|
|
513
|
-
|
|
526
|
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
|
527
|
+
<div className="metric-item">
|
|
528
|
+
<div className="metric-value">{loadingAccessibility.accessibilityState.screenReaderActive ? '✓' : '✗'}</div>
|
|
514
529
|
<div className="metric-label">Screen Reader</div>
|
|
515
530
|
</div>
|
|
516
531
|
<div className="metric-item">
|
|
517
|
-
<div className="metric-value">{loadingAccessibility.accessibilityState.reducedMotionEnabled ? '✓' }</div>
|
|
532
|
+
<div className="metric-value">{loadingAccessibility.accessibilityState.reducedMotionEnabled ? '✓' : '✗'}</div>
|
|
518
533
|
<div className="metric-label">Reduced Motion</div>
|
|
519
534
|
</div>
|
|
520
535
|
<div className="metric-item">
|
|
521
|
-
<div className="metric-value">{loadingAccessibility.accessibilityState.ariaLabelsActive ? '✓' }</div>
|
|
536
|
+
<div className="metric-value">{loadingAccessibility.accessibilityState.ariaLabelsActive ? '✓' : '✗'}</div>
|
|
522
537
|
<div className="metric-label">ARIA Labels</div>
|
|
523
538
|
</div>
|
|
524
539
|
<div className="metric-item">
|
|
525
|
-
<div className="metric-value">{loadingAccessibility.accessibilityState.keyboardNavigationActive ? '✓' }</div>
|
|
540
|
+
<div className="metric-value">{loadingAccessibility.accessibilityState.keyboardNavigationActive ? '✓' : '✗'}</div>
|
|
526
541
|
<div className="metric-label">Keyboard Nav</div>
|
|
527
542
|
</div>
|
|
528
543
|
</div>
|
|
@@ -530,11 +545,12 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
530
545
|
{/* Accessibility Features */}
|
|
531
546
|
<div className="space-y-4">
|
|
532
547
|
<h4 className="font-semibold">Active Accessibility Features</h4>
|
|
533
|
-
<div className="grid grid-cols-1 md
|
|
548
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
549
|
+
{loadingAccessibility.accessibilityFeatures.map(feature => (
|
|
534
550
|
<div key={feature.id} className="p-3 bg-purple-50 rounded-lg">
|
|
535
551
|
<div className="flex justify-between items-center mb-1">
|
|
536
552
|
<span className="font-medium">{feature.name}</span>
|
|
537
|
-
<Badge variant={feature.impact === 'high' ? 'default' }>
|
|
553
|
+
<Badge variant={feature.impact === 'high' ? 'default' : 'secondary'}>
|
|
538
554
|
{feature.impact}
|
|
539
555
|
</Badge>
|
|
540
556
|
</div>
|
|
@@ -574,31 +590,32 @@ export const MobileSkeletonLoadingDemo= () => {
|
|
|
574
590
|
</Card>
|
|
575
591
|
|
|
576
592
|
{/* Status Indicators */}
|
|
577
|
-
<div className="grid grid-cols-1 md
|
|
593
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
594
|
+
<div className={`loading-status ${getBatteryClass()}`}>
|
|
578
595
|
<div className="w-3 h-3 bg-current rounded-full"></div>
|
|
579
596
|
<span className="text-sm font-medium">
|
|
580
|
-
Battery)}
|
|
597
|
+
Battery: {batteryConsciousLoading.getBatteryStatus()}
|
|
581
598
|
</span>
|
|
582
599
|
</div>
|
|
583
600
|
|
|
584
601
|
<div className={`loading-status ${getPerformanceClass()}`}>
|
|
585
602
|
<div className="w-3 h-3 bg-current rounded-full"></div>
|
|
586
603
|
<span className="text-sm font-medium">
|
|
587
|
-
Performance}
|
|
604
|
+
Performance: {loadingPerformance.performanceHealth}
|
|
588
605
|
</span>
|
|
589
606
|
</div>
|
|
590
607
|
|
|
591
608
|
<div className={`loading-status ${getAccessibilityClass()}`}>
|
|
592
609
|
<div className="w-3 h-3 bg-current rounded-full"></div>
|
|
593
610
|
<span className="text-sm font-medium">
|
|
594
|
-
Accessibility}%
|
|
611
|
+
Accessibility: {loadingAccessibility.accessibilityScore}%
|
|
595
612
|
</span>
|
|
596
613
|
</div>
|
|
597
614
|
|
|
598
615
|
<div className="loading-status">
|
|
599
616
|
<div className="w-3 h-3 bg-current rounded-full"></div>
|
|
600
617
|
<span className="text-sm font-medium">
|
|
601
|
-
Device}
|
|
618
|
+
Device: {deviceLoadingStates.deviceState.deviceType}
|
|
602
619
|
</span>
|
|
603
620
|
</div>
|
|
604
621
|
</div>
|
|
@@ -8,7 +8,7 @@ import { useState, useMemo } from 'react';
|
|
|
8
8
|
import { ChevronRightIcon, HomeIcon } from '@heroicons/react/24/outline';
|
|
9
9
|
import { BreadcrumbProps, BreadcrumbItem } from './types';
|
|
10
10
|
|
|
11
|
-
export const Breadcrumb= ({
|
|
11
|
+
export const Breadcrumb: React.FC<BreadcrumbProps> = ({
|
|
12
12
|
items,
|
|
13
13
|
separator = <ChevronRightIcon className="w-4 h-4" />,
|
|
14
14
|
maxItems = 5,
|
|
@@ -18,7 +18,7 @@ export const Breadcrumb= ({
|
|
|
18
18
|
truncate = true,
|
|
19
19
|
responsive = true,
|
|
20
20
|
className = '',
|
|
21
|
-
'data-testid'= 'breadcrumb',
|
|
21
|
+
'data-testid': testId = 'breadcrumb',
|
|
22
22
|
}) => {
|
|
23
23
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
24
24
|
|
|
@@ -38,12 +38,12 @@ export const Breadcrumb= ({
|
|
|
38
38
|
|
|
39
39
|
return [
|
|
40
40
|
...firstItems,
|
|
41
|
-
{ id, label, disabled},
|
|
41
|
+
{ id: 'ellipsis', label: '...', disabled: true },
|
|
42
42
|
...lastItems,
|
|
43
43
|
];
|
|
44
44
|
}, [items, maxItems, truncate, isExpanded]);
|
|
45
45
|
|
|
46
|
-
const handleItemClick = (item) => {
|
|
46
|
+
const handleItemClick = (item: BreadcrumbItem) => {
|
|
47
47
|
if (item.disabled || item.id === 'ellipsis') return;
|
|
48
48
|
|
|
49
49
|
if (onItemClick) {
|
|
@@ -59,7 +59,7 @@ export const Breadcrumb= ({
|
|
|
59
59
|
return 'breadcrumb breadcrumb--stan-design';
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
const getItemClasses = (item, isLast) => {
|
|
62
|
+
const getItemClasses = (item: BreadcrumbItem, isLast: boolean) => {
|
|
63
63
|
const baseClasses = 'breadcrumb__item-button';
|
|
64
64
|
|
|
65
65
|
if (item.disabled) {
|
|
@@ -86,8 +86,8 @@ export const Breadcrumb= ({
|
|
|
86
86
|
{showHome && (
|
|
87
87
|
<>
|
|
88
88
|
<button
|
|
89
|
-
onClick={() => handleItemClick({ id, label, href})}
|
|
90
|
-
className={`breadcrumb__home-button ${getItemClasses({ id, label} as BreadcrumbItem, false)}`}
|
|
89
|
+
onClick={() => handleItemClick({ id: 'home', label: 'Home', href: '/' })}
|
|
90
|
+
className={`breadcrumb__home-button ${getItemClasses({ id: 'home', label: 'Home' } as BreadcrumbItem, false)}`}
|
|
91
91
|
aria-label="Go to home page"
|
|
92
92
|
>
|
|
93
93
|
<span className="breadcrumb__icon">{homeIcon}</span>
|
|
@@ -117,20 +117,23 @@ export const Breadcrumb= ({
|
|
|
117
117
|
<button
|
|
118
118
|
onClick={handleExpandToggle}
|
|
119
119
|
className="breadcrumb__ellipsis"
|
|
120
|
-
aria-label={isExpanded ? 'Collapse breadcrumbs' }
|
|
120
|
+
aria-label={isExpanded ? 'Collapse breadcrumbs' : 'Expand breadcrumbs'}
|
|
121
121
|
>
|
|
122
122
|
{item.label}
|
|
123
123
|
</button>
|
|
124
|
-
)
|
|
124
|
+
) : (
|
|
125
|
+
<button
|
|
126
|
+
onClick={() => handleItemClick(item)}
|
|
125
127
|
className={getItemClasses(item, isLast)}
|
|
126
128
|
disabled={item.disabled}
|
|
127
|
-
aria-current={isLast ? 'page' }
|
|
128
|
-
aria-label={item.href ? `Navigate to ${item.label}` }
|
|
129
|
+
aria-current={isLast ? 'page' : undefined}
|
|
130
|
+
aria-label={item.href ? `Navigate to ${item.label}` : item.label}
|
|
129
131
|
>
|
|
130
132
|
{item.icon && <span className="breadcrumb__icon">{item.icon}</span>}
|
|
131
133
|
{responsive && window.innerWidth < 640 ? (
|
|
132
134
|
<span className="breadcrumb__item-label">{item.label}</span>
|
|
133
|
-
)
|
|
135
|
+
) : (
|
|
136
|
+
<span className="breadcrumb__item-label">{item.label}</span>
|
|
134
137
|
)}
|
|
135
138
|
</button>
|
|
136
139
|
)}
|
|
@@ -143,9 +146,9 @@ export const Breadcrumb= ({
|
|
|
143
146
|
<button
|
|
144
147
|
onClick={handleExpandToggle}
|
|
145
148
|
className={`breadcrumb__expand-toggle breadcrumb__expand-toggle--semantic`}
|
|
146
|
-
aria-label={isExpanded ? 'Show fewer breadcrumbs' }
|
|
149
|
+
aria-label={isExpanded ? 'Show fewer breadcrumbs' : 'Show all breadcrumbs'}
|
|
147
150
|
>
|
|
148
|
-
{isExpanded ? 'Show Less' }
|
|
151
|
+
{isExpanded ? 'Show Less' : 'Show All'}
|
|
149
152
|
</button>
|
|
150
153
|
)}
|
|
151
154
|
</nav>
|