@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.1.4 → 0.1.5

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.
Files changed (164) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/index.d.ts +131 -131
  3. package/dist/index.esm.js +148 -148
  4. package/dist/index.js +148 -148
  5. package/dist/styles.css +1 -1
  6. package/package.json +1 -1
  7. package/src/components/ui/accessibility-demo.tsx +271 -0
  8. package/src/components/ui/advanced-component-architecture-demo.tsx +916 -0
  9. package/src/components/ui/advanced-transition-system-demo.tsx +670 -0
  10. package/src/components/ui/advanced-transition-system.tsx +395 -0
  11. package/src/components/ui/animation/animated-container.tsx +166 -0
  12. package/src/components/ui/animation/index.ts +19 -0
  13. package/src/components/ui/animation/staggered-container.tsx +68 -0
  14. package/src/components/ui/animation-demo.tsx +250 -0
  15. package/src/components/ui/badge.tsx +33 -0
  16. package/src/components/ui/battery-conscious-animation-demo.tsx +568 -0
  17. package/src/components/ui/border-radius-shadow-demo.tsx +187 -0
  18. package/src/components/ui/button.tsx +36 -0
  19. package/src/components/ui/card.tsx +207 -0
  20. package/src/components/ui/checkbox.tsx +30 -0
  21. package/src/components/ui/color-preview.tsx +411 -0
  22. package/src/components/ui/data-display/chart.tsx +653 -0
  23. package/src/components/ui/data-display/data-grid-simple.tsx +76 -0
  24. package/src/components/ui/data-display/data-grid.tsx +680 -0
  25. package/src/components/ui/data-display/list.tsx +456 -0
  26. package/src/components/ui/data-display/table.tsx +482 -0
  27. package/src/components/ui/data-display/timeline.tsx +441 -0
  28. package/src/components/ui/data-display/tree.tsx +602 -0
  29. package/src/components/ui/data-display/types.ts +536 -0
  30. package/src/components/ui/enterprise-mobile-experience-demo.tsx +749 -0
  31. package/src/components/ui/enterprise-mobile-experience.tsx +464 -0
  32. package/src/components/ui/feedback/alert.tsx +157 -0
  33. package/src/components/ui/feedback/progress.tsx +292 -0
  34. package/src/components/ui/feedback/skeleton.tsx +185 -0
  35. package/src/components/ui/feedback/toast.tsx +280 -0
  36. package/src/components/ui/feedback/types.ts +125 -0
  37. package/src/components/ui/font-preview.tsx +288 -0
  38. package/src/components/ui/form-demo.tsx +553 -0
  39. package/src/components/ui/hardware-acceleration-demo.tsx +547 -0
  40. package/src/components/ui/input.tsx +35 -0
  41. package/src/components/ui/label.tsx +16 -0
  42. package/src/components/ui/layout-demo.tsx +367 -0
  43. package/src/components/ui/layouts/adaptive-layout.tsx +139 -0
  44. package/src/components/ui/layouts/desktop-layout.tsx +224 -0
  45. package/src/components/ui/layouts/index.ts +10 -0
  46. package/src/components/ui/layouts/mobile-layout.tsx +162 -0
  47. package/src/components/ui/layouts/tablet-layout.tsx +197 -0
  48. package/src/components/ui/mobile-form-validation.tsx +451 -0
  49. package/src/components/ui/mobile-input-demo.tsx +201 -0
  50. package/src/components/ui/mobile-input.tsx +281 -0
  51. package/src/components/ui/mobile-skeleton-loading-demo.tsx +638 -0
  52. package/src/components/ui/navigation/breadcrumb.tsx +158 -0
  53. package/src/components/ui/navigation/index.ts +36 -0
  54. package/src/components/ui/navigation/menu.tsx +374 -0
  55. package/src/components/ui/navigation/navigation-demo.tsx +324 -0
  56. package/src/components/ui/navigation/pagination.tsx +272 -0
  57. package/src/components/ui/navigation/sidebar.tsx +383 -0
  58. package/src/components/ui/navigation/stepper.tsx +303 -0
  59. package/src/components/ui/navigation/tabs.tsx +205 -0
  60. package/src/components/ui/navigation/types.ts +299 -0
  61. package/src/components/ui/overlay/backdrop.tsx +81 -0
  62. package/src/components/ui/overlay/focus-manager.tsx +143 -0
  63. package/src/components/ui/overlay/index.ts +36 -0
  64. package/src/components/ui/overlay/modal.tsx +270 -0
  65. package/src/components/ui/overlay/overlay-manager.tsx +110 -0
  66. package/src/components/ui/overlay/popover.tsx +462 -0
  67. package/src/components/ui/overlay/portal.tsx +79 -0
  68. package/src/components/ui/overlay/tooltip.tsx +303 -0
  69. package/src/components/ui/overlay/types.ts +196 -0
  70. package/src/components/ui/performance-demo.tsx +596 -0
  71. package/src/components/ui/semantic-input-system-demo.tsx +502 -0
  72. package/src/components/ui/semantic-input-system-demo.tsx.disabled +873 -0
  73. package/src/components/ui/tablet-layout.tsx +192 -0
  74. package/src/components/ui/theme-customizer.tsx +386 -0
  75. package/src/components/ui/theme-preview.tsx +310 -0
  76. package/src/components/ui/theme-switcher.tsx +264 -0
  77. package/src/components/ui/theme-toggle.tsx +38 -0
  78. package/src/components/ui/token-demo.tsx +195 -0
  79. package/src/components/ui/touch-demo.tsx +462 -0
  80. package/src/components/ui/touch-friendly-interface-demo.tsx +519 -0
  81. package/src/components/ui/touch-friendly-interface.tsx +296 -0
  82. package/src/hooks/index.ts +190 -0
  83. package/src/hooks/use-accessibility-support.ts +518 -0
  84. package/src/hooks/use-adaptive-layout.ts +289 -0
  85. package/src/hooks/use-advanced-patterns.ts +294 -0
  86. package/src/hooks/use-advanced-transition-system.ts +393 -0
  87. package/src/hooks/use-animation-profile.ts +288 -0
  88. package/src/hooks/use-battery-animations.ts +384 -0
  89. package/src/hooks/use-battery-conscious-loading.ts +475 -0
  90. package/src/hooks/use-battery-optimization.ts +330 -0
  91. package/src/hooks/use-battery-status.ts +299 -0
  92. package/src/hooks/use-component-performance.ts +344 -0
  93. package/src/hooks/use-device-loading-states.ts +459 -0
  94. package/src/hooks/use-device.tsx +110 -0
  95. package/src/hooks/use-enterprise-mobile-experience.ts +488 -0
  96. package/src/hooks/use-form-feedback.ts +403 -0
  97. package/src/hooks/use-form-performance.ts +513 -0
  98. package/src/hooks/use-frame-rate.ts +251 -0
  99. package/src/hooks/use-gestures.ts +338 -0
  100. package/src/hooks/use-hardware-acceleration.ts +341 -0
  101. package/src/hooks/use-input-accessibility.ts +455 -0
  102. package/src/hooks/use-input-performance.ts +506 -0
  103. package/src/hooks/use-layout-performance.ts +319 -0
  104. package/src/hooks/use-loading-accessibility.ts +535 -0
  105. package/src/hooks/use-loading-performance.ts +473 -0
  106. package/src/hooks/use-memory-usage.ts +287 -0
  107. package/src/hooks/use-mobile-form-layout.ts +464 -0
  108. package/src/hooks/use-mobile-form-validation.ts +518 -0
  109. package/src/hooks/use-mobile-keyboard-optimization.ts +472 -0
  110. package/src/hooks/use-mobile-layout.ts +302 -0
  111. package/src/hooks/use-mobile-optimization.ts +406 -0
  112. package/src/hooks/use-mobile-skeleton.ts +402 -0
  113. package/src/hooks/use-mobile-touch.ts +414 -0
  114. package/src/hooks/use-performance-throttling.ts +348 -0
  115. package/src/hooks/use-performance.ts +316 -0
  116. package/src/hooks/use-reusable-architecture.ts +414 -0
  117. package/src/hooks/use-semantic-input-types.ts +357 -0
  118. package/src/hooks/use-semantic-input.ts +565 -0
  119. package/src/hooks/use-tablet-layout.ts +384 -0
  120. package/src/hooks/use-touch-friendly-input.ts +524 -0
  121. package/src/hooks/use-touch-friendly-interface.ts +331 -0
  122. package/src/hooks/use-touch-optimization.ts +375 -0
  123. package/src/index.ts +279 -279
  124. package/src/lib/utils.ts +6 -0
  125. package/src/themes/README.md +272 -0
  126. package/src/themes/ThemeContext.tsx +31 -0
  127. package/src/themes/ThemeProvider.tsx +232 -0
  128. package/src/themes/accessibility/index.ts +27 -0
  129. package/src/themes/accessibility.ts +259 -0
  130. package/src/themes/aria-patterns.ts +420 -0
  131. package/src/themes/base-themes.ts +55 -0
  132. package/src/themes/colorManager.ts +380 -0
  133. package/src/themes/examples/dark-theme.ts +154 -0
  134. package/src/themes/examples/minimal-theme.ts +108 -0
  135. package/src/themes/focus-management.ts +701 -0
  136. package/src/themes/fontLoader.ts +201 -0
  137. package/src/themes/high-contrast.ts +621 -0
  138. package/src/themes/index.ts +19 -0
  139. package/src/themes/inheritance.ts +227 -0
  140. package/src/themes/keyboard-navigation.ts +550 -0
  141. package/src/themes/motion-reduction.ts +662 -0
  142. package/src/themes/navigation.ts +238 -0
  143. package/src/themes/screen-reader.ts +645 -0
  144. package/src/themes/systemThemeDetector.ts +182 -0
  145. package/src/themes/themeCSSUpdater.ts +262 -0
  146. package/src/themes/themePersistence.ts +238 -0
  147. package/src/themes/themes/default.ts +586 -0
  148. package/src/themes/themes/harvey.ts +554 -0
  149. package/src/themes/themes/stan-design.ts +683 -0
  150. package/src/themes/types.ts +460 -0
  151. package/src/themes/useSystemTheme.ts +48 -0
  152. package/src/themes/useTheme.ts +87 -0
  153. package/src/themes/validation.ts +462 -0
  154. package/src/tokens/index.ts +34 -0
  155. package/src/tokens/tokenExporter.ts +397 -0
  156. package/src/tokens/tokenGenerator.ts +276 -0
  157. package/src/tokens/tokenManager.ts +248 -0
  158. package/src/tokens/tokenValidator.ts +543 -0
  159. package/src/tokens/types.ts +78 -0
  160. package/src/utils/bundle-analyzer.ts +260 -0
  161. package/src/utils/bundle-splitting.ts +483 -0
  162. package/src/utils/lazy-loading.ts +441 -0
  163. package/src/utils/performance-monitor.ts +513 -0
  164. package/src/utils/tree-shaking.ts +274 -0
@@ -0,0 +1,638 @@
1
+ import React, { useState, useEffect } from 'react'
2
+ import { Card } from './card'
3
+ import { Button } from './button'
4
+ import { Badge } from './badge'
5
+ import { useMobileSkeleton } from '../../hooks/use-mobile-skeleton'
6
+ import { useDeviceLoadingStates } from '../../hooks/use-device-loading-states'
7
+ import { useLoadingPerformance } from '../../hooks/use-loading-performance'
8
+ import { useBatteryConsciousLoading } from '../../hooks/use-battery-conscious-loading'
9
+ import { useLoadingAccessibility } from '../../hooks/use-loading-accessibility'
10
+
11
+ export const MobileSkeletonLoadingDemo: React.FC = () => {
12
+ const [activeTab, setActiveTab] = useState('overview')
13
+ const [isLoading, setIsLoading] = useState(false)
14
+ const [loadingProgress, setLoadingProgress] = useState(0)
15
+ const [showSkeletons, setShowSkeletons] = useState(true)
16
+
17
+ // Initialize all hooks
18
+ const mobileSkeleton = useMobileSkeleton(
19
+ {
20
+ enableMobileOptimization: true,
21
+ enablePerformanceOptimization: true,
22
+ enableBatteryOptimization: true,
23
+ enableAccessibilitySupport: true,
24
+ enableTouchOptimization: true
25
+ },
26
+ {
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)
32
+ }
33
+ )
34
+
35
+ const deviceLoadingStates = useDeviceLoadingStates(
36
+ {
37
+ enableMobileStates: true,
38
+ enableTabletStates: true,
39
+ enableDesktopStates: true,
40
+ enableAdaptiveBehavior: true,
41
+ enableOrientationSupport: true,
42
+ enablePerformanceAdaptation: true
43
+ },
44
+ {
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)
49
+ }
50
+ )
51
+
52
+ const loadingPerformance = useLoadingPerformance(
53
+ {
54
+ enableAnimationOptimization: true,
55
+ enableMemoryManagement: true,
56
+ enableBatteryOptimization: true,
57
+ enablePerformanceMonitoring: true,
58
+ enableAutoOptimization: true
59
+ },
60
+ {
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)
65
+ }
66
+ )
67
+
68
+ const batteryConsciousLoading = useBatteryConsciousLoading(
69
+ {
70
+ enableBatteryMonitoring: true,
71
+ enableLoadingOptimization: true,
72
+ enablePerformanceAdjustment: true,
73
+ enableUserNotification: true,
74
+ enableAutoOptimization: true
75
+ },
76
+ {
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)
81
+ }
82
+ )
83
+
84
+ const loadingAccessibility = useLoadingAccessibility(
85
+ {
86
+ enableScreenReaderSupport: true,
87
+ enableReducedMotionSupport: true,
88
+ enableFocusManagement: true,
89
+ enableAriaSupport: true,
90
+ enableVoiceControl: true,
91
+ enableHighContrast: true,
92
+ enableKeyboardNavigation: true
93
+ },
94
+ {
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)
102
+ }
103
+ )
104
+
105
+ // Simulate loading progress
106
+ useEffect(() => {
107
+ if (isLoading) {
108
+ const interval = setInterval(() => {
109
+ setLoadingProgress(prev => {
110
+ if (prev >= 100) {
111
+ setIsLoading(false)
112
+ setLoadingProgress(0)
113
+ return 0
114
+ }
115
+ return prev + 10
116
+ })
117
+ }, 200)
118
+ return () => clearInterval(interval)
119
+ }
120
+ }, [isLoading])
121
+
122
+ // Start loading simulation
123
+ const startLoading = () => {
124
+ setIsLoading(true)
125
+ setLoadingProgress(0)
126
+ }
127
+
128
+ // Toggle skeleton visibility
129
+ const toggleSkeletons = () => {
130
+ setShowSkeletons(!showSkeletons)
131
+ }
132
+
133
+ // Get device-specific loading class
134
+ const getLoadingStateClass = () => {
135
+ switch (deviceLoadingStates.deviceState.deviceType) {
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
+ }
141
+ }
142
+
143
+ // Get battery-conscious class
144
+ const getBatteryClass = () => {
145
+ const batteryStatus = batteryConsciousLoading.batteryState.status
146
+ if (batteryStatus === 'critical') return 'battery-critical'
147
+ if (batteryStatus === 'low') return 'battery-low'
148
+ return ''
149
+ }
150
+
151
+ // Get performance class
152
+ const getPerformanceClass = () => {
153
+ const performanceHealth = loadingPerformance.performanceHealth
154
+ if (performanceHealth === 'poor') return 'performance-low'
155
+ if (performanceHealth === 'fair') return 'performance-medium'
156
+ return 'performance-high'
157
+ }
158
+
159
+ // Get accessibility class
160
+ const getAccessibilityClass = () => {
161
+ if (loadingAccessibility.accessibilityScore >= 80) return 'accessibility-enhanced'
162
+ return ''
163
+ }
164
+
165
+ return (
166
+ <div className="space-y-6">
167
+ {/* Header */}
168
+ <div className="text-center">
169
+ <h2 className="text-2xl font-bold text-gray-900 mb-2">
170
+ 📱 Mobile Skeleton & Loading State Sophistication
171
+ </h2>
172
+ <p className="text-gray-600 mb-4">
173
+ Advanced mobile-optimized skeleton components with device-specific loading states,
174
+ performance optimization, battery consciousness, and accessibility support.
175
+ </p>
176
+ <Badge variant="secondary">Story 11 Implementation</Badge>
177
+ </div>
178
+
179
+ {/* Main Demo */}
180
+ <Card className="p-6">
181
+ {/* Navigation */}
182
+ <div className="flex flex-wrap gap-2 mb-6">
183
+ <Button
184
+ variant={activeTab === 'overview' ? 'default' : 'outline'}
185
+ onClick={() => setActiveTab('overview')}
186
+ size="sm"
187
+ >
188
+ Overview
189
+ </Button>
190
+ <Button
191
+ variant={activeTab === 'skeletons' ? 'default' : 'outline'}
192
+ onClick={() => setActiveTab('skeletons')}
193
+ size="sm"
194
+ >
195
+ Skeletons
196
+ </Button>
197
+ <Button
198
+ variant={activeTab === 'loading' ? 'default' : 'outline'}
199
+ onClick={() => setActiveTab('loading')}
200
+ size="sm"
201
+ >
202
+ Loading States
203
+ </Button>
204
+ <Button
205
+ variant={activeTab === 'performance' ? 'default' : 'outline'}
206
+ onClick={() => setActiveTab('performance')}
207
+ size="sm"
208
+ >
209
+ Performance
210
+ </Button>
211
+ <Button
212
+ variant={activeTab === 'accessibility' ? 'default' : 'outline'}
213
+ onClick={() => setActiveTab('accessibility')}
214
+ size="sm"
215
+ >
216
+ Accessibility
217
+ </Button>
218
+ </div>
219
+
220
+ {/* Overview Section */}
221
+ {activeTab === 'overview' && (
222
+ <div className="space-y-6">
223
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
224
+ {/* Device State */}
225
+ <div className="p-4 bg-blue-50 rounded-lg">
226
+ <h3 className="font-semibold text-blue-900 mb-2">Device State</h3>
227
+ <div className="space-y-1 text-sm">
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>
232
+ </div>
233
+ </div>
234
+
235
+ {/* Battery Status */}
236
+ <div className="p-4 bg-yellow-50 rounded-lg">
237
+ <h3 className="font-semibold text-yellow-900 mb-2">Battery Status</h3>
238
+ <div className="space-y-1 text-sm">
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>
243
+ </div>
244
+ </div>
245
+
246
+ {/* Performance Metrics */}
247
+ <div className="p-4 bg-green-50 rounded-lg">
248
+ <h3 className="font-semibold text-green-900 mb-2">Performance</h3>
249
+ <div className="space-y-1 text-sm">
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>
254
+ </div>
255
+ </div>
256
+
257
+ {/* Accessibility Score */}
258
+ <div className="p-4 bg-purple-50 rounded-lg">
259
+ <h3 className="font-semibold text-purple-900 mb-2">Accessibility</h3>
260
+ <div className="space-y-1 text-sm">
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>
265
+ </div>
266
+ </div>
267
+ </div>
268
+
269
+ {/* Controls */}
270
+ <div className="flex flex-wrap gap-4 justify-center">
271
+ <Button onClick={startLoading} disabled={isLoading}>
272
+ {isLoading ? 'Loading...' : 'Start Loading Simulation'}
273
+ </Button>
274
+ <Button onClick={toggleSkeletons} variant="outline">
275
+ {showSkeletons ? 'Hide' : 'Show'} Skeletons
276
+ </Button>
277
+ <Button onClick={loadingPerformance.autoOptimize} variant="outline">
278
+ Auto-Optimize Performance
279
+ </Button>
280
+ <Button onClick={batteryConsciousLoading.optimizeLoadingForBattery} variant="outline">
281
+ Optimize for Battery
282
+ </Button>
283
+ <Button onClick={loadingAccessibility.autoEnableAccessibility} variant="outline">
284
+ Enable All Accessibility
285
+ </Button>
286
+ </div>
287
+ </div>
288
+ )}
289
+
290
+ {/* Skeletons Section */}
291
+ {activeTab === 'skeletons' && (
292
+ <div className="space-y-6">
293
+ <div className="text-center mb-6">
294
+ <h3 className="text-xl font-semibold mb-2">Mobile-Optimized Skeleton Components</h3>
295
+ <p className="text-gray-600">
296
+ Device-specific skeleton variants with performance optimization and touch-friendly interactions
297
+ </p>
298
+ </div>
299
+
300
+ <div className={`${getLoadingStateClass()} ${getBatteryClass()} ${getPerformanceClass()} ${getAccessibilityClass()}`}>
301
+ {showSkeletons && (
302
+ <>
303
+ {/* Text Line Skeletons */}
304
+ <div className="loading-skeleton">
305
+ <div className="mobile-skeleton text-line animation-pulse touch-friendly"
306
+ aria-label="Loading text line 1"></div>
307
+ <div className="mobile-skeleton text-line animation-pulse touch-friendly"
308
+ aria-label="Loading text line 2"></div>
309
+ <div className="mobile-skeleton text-line animation-pulse touch-friendly"
310
+ aria-label="Loading text line 3"></div>
311
+ </div>
312
+
313
+ {/* Avatar and Button Skeletons */}
314
+ <div className="flex items-center gap-4">
315
+ <div className="mobile-skeleton avatar animation-shimmer touch-friendly"
316
+ aria-label="Loading avatar"></div>
317
+ <div className="mobile-skeleton button animation-pulse touch-friendly"
318
+ aria-label="Loading button"></div>
319
+ </div>
320
+
321
+ {/* Card Skeleton */}
322
+ <div className="mobile-skeleton card animation-wave touch-friendly"
323
+ aria-label="Loading card content"></div>
324
+ </>
325
+ )}
326
+ </div>
327
+
328
+ {/* Skeleton Variants */}
329
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
330
+ <div className="p-4 bg-gray-50 rounded-lg">
331
+ <h4 className="font-semibold mb-2">Available Skeleton Variants</h4>
332
+ <div className="space-y-2 text-sm">
333
+ {mobileSkeleton.skeletonVariants.map(variant => (
334
+ <div key={variant.id} className="flex justify-between items-center">
335
+ <span>{variant.name}</span>
336
+ <Badge variant={variant.mobileOptimized ? "default" : "secondary"}>
337
+ {variant.animation}
338
+ </Badge>
339
+ </div>
340
+ ))}
341
+ </div>
342
+ </div>
343
+
344
+ <div className="p-4 bg-gray-50 rounded-lg">
345
+ <h4 className="font-semibold mb-2">Device Optimizations</h4>
346
+ <div className="space-y-2 text-sm">
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>
351
+ </div>
352
+ </div>
353
+ </div>
354
+ </div>
355
+ )}
356
+
357
+ {/* Loading States Section */}
358
+ {activeTab === 'loading' && (
359
+ <div className="space-y-6">
360
+ <div className="text-center mb-6">
361
+ <h3 className="text-xl font-semibold mb-2">Device-Specific Loading States</h3>
362
+ <p className="text-gray-600">
363
+ Adaptive loading states that automatically adjust based on device capabilities and battery level
364
+ </p>
365
+ </div>
366
+
367
+ {/* Loading Progress */}
368
+ {isLoading && (
369
+ <div className="space-y-4">
370
+ <div className="loading-progress">
371
+ <div
372
+ className="loading-progress-bar"
373
+ style={{ width: `${loadingProgress}%` }}
374
+ aria-label={`Loading progress: ${loadingProgress}%`}
375
+ ></div>
376
+ </div>
377
+ <p className="text-center text-sm text-gray-600">
378
+ Loading... {loadingProgress}%
379
+ </p>
380
+ </div>
381
+ )}
382
+
383
+ {/* Device Loading States */}
384
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
385
+ <div className="space-y-4">
386
+ <h4 className="font-semibold">Current Device State</h4>
387
+ <div className="p-4 bg-blue-50 rounded-lg space-y-2">
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>
393
+ </div>
394
+ </div>
395
+
396
+ <div className="space-y-4">
397
+ <h4 className="font-semibold">Available Loading States</h4>
398
+ <div className="space-y-2">
399
+ {deviceLoadingStates.getLoadingStatesForDevice().map(state => (
400
+ <div key={state.id} className="p-3 bg-gray-50 rounded-lg">
401
+ <div className="flex justify-between items-center mb-1">
402
+ <span className="font-medium">{state.name}</span>
403
+ <Badge variant="outline">{state.type}</Badge>
404
+ </div>
405
+ <div className="text-sm text-gray-600">
406
+ <p>Duration: {state.duration}ms</p>
407
+ <p>Complexity: {state.complexity}</p>
408
+ <p>Performance: {state.performance}</p>
409
+ </div>
410
+ </div>
411
+ ))}
412
+ </div>
413
+ </div>
414
+ </div>
415
+
416
+ {/* Loading State Controls */}
417
+ <div className="flex flex-wrap gap-4 justify-center">
418
+ <Button onClick={deviceLoadingStates.enableAdaptiveBehavior} variant="outline">
419
+ Enable Adaptive Behavior
420
+ </Button>
421
+ <Button onClick={deviceLoadingStates.adaptToPerformance} variant="outline">
422
+ Adapt to Performance
423
+ </Button>
424
+ <Button onClick={deviceLoadingStates.clearAdaptations} variant="outline">
425
+ Clear Adaptations
426
+ </Button>
427
+ </div>
428
+ </div>
429
+ )}
430
+
431
+ {/* Performance Section */}
432
+ {activeTab === 'performance' && (
433
+ <div className="space-y-6">
434
+ <div className="text-center mb-6">
435
+ <h3 className="text-xl font-semibold mb-2">Loading Performance Optimization</h3>
436
+ <p className="text-gray-600">
437
+ Real-time performance monitoring with automatic optimization and battery-conscious strategies
438
+ </p>
439
+ </div>
440
+
441
+ {/* Performance Metrics */}
442
+ <div className="grid grid-cols-2 md:grid-cols-4 gap-4">
443
+ <div className="metric-item">
444
+ <div className="metric-value">{loadingPerformance.performanceMetrics.frameRate}</div>
445
+ <div className="metric-label">FPS</div>
446
+ </div>
447
+ <div className="metric-item">
448
+ <div className="metric-value">{Math.round(loadingPerformance.performanceMetrics.renderTime)}ms</div>
449
+ <div className="metric-label">Render Time</div>
450
+ </div>
451
+ <div className="metric-item">
452
+ <div className="metric-value">{loadingPerformance.performanceMetrics.memoryUsage}MB</div>
453
+ <div className="metric-label">Memory</div>
454
+ </div>
455
+ <div className="metric-item">
456
+ <div className="metric-value">{loadingPerformance.getPerformanceScore()}</div>
457
+ <div className="metric-label">Score</div>
458
+ </div>
459
+ </div>
460
+
461
+ {/* Performance Health */}
462
+ <div className="p-4 bg-gray-50 rounded-lg">
463
+ <h4 className="font-semibold mb-3">Performance Health: {loadingPerformance.performanceHealth}</h4>
464
+ <div className="space-y-2">
465
+ {loadingPerformance.getOptimizationRecommendations().map((recommendation, index) => (
466
+ <p key={index} className="text-sm text-gray-600">• {recommendation}</p>
467
+ ))}
468
+ </div>
469
+ </div>
470
+
471
+ {/* Optimization Strategies */}
472
+ <div className="space-y-4">
473
+ <h4 className="font-semibold">Applied Optimizations</h4>
474
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
475
+ {loadingPerformance.optimizationStrategies.map(strategy => (
476
+ <div key={strategy.id} className="p-3 bg-green-50 rounded-lg">
477
+ <div className="flex justify-between items-center mb-1">
478
+ <span className="font-medium">{strategy.name}</span>
479
+ <Badge variant={strategy.impact === 'high' ? 'default' : 'secondary'}>
480
+ {strategy.impact}
481
+ </Badge>
482
+ </div>
483
+ <p className="text-sm text-gray-600">{strategy.description}</p>
484
+ </div>
485
+ ))}
486
+ </div>
487
+ </div>
488
+
489
+ {/* Performance Controls */}
490
+ <div className="flex flex-wrap gap-4 justify-center">
491
+ <Button onClick={loadingPerformance.optimizeAnimations} variant="outline">
492
+ Optimize Animations
493
+ </Button>
494
+ <Button onClick={loadingPerformance.optimizeMemory} variant="outline">
495
+ Optimize Memory
496
+ </Button>
497
+ <Button onClick={loadingPerformance.optimizeBattery} variant="outline">
498
+ Optimize Battery
499
+ </Button>
500
+ <Button onClick={loadingPerformance.optimizePerformance} variant="outline">
501
+ Optimize Overall
502
+ </Button>
503
+ </div>
504
+ </div>
505
+ )}
506
+
507
+ {/* Accessibility Section */}
508
+ {activeTab === 'accessibility' && (
509
+ <div className="space-y-6">
510
+ <div className="text-center mb-6">
511
+ <h3 className="text-xl font-semibold mb-2">Loading Accessibility Support</h3>
512
+ <p className="text-gray-600">
513
+ Comprehensive accessibility features including screen reader support, reduced motion, focus management, and ARIA
514
+ </p>
515
+ </div>
516
+
517
+ {/* Accessibility Score */}
518
+ <div className="text-center p-6 bg-purple-50 rounded-lg">
519
+ <div className="text-4xl font-bold text-purple-600 mb-2">
520
+ {loadingAccessibility.accessibilityScore}%
521
+ </div>
522
+ <p className="text-purple-700 font-medium">Accessibility Score</p>
523
+ </div>
524
+
525
+ {/* Accessibility State */}
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>
529
+ <div className="metric-label">Screen Reader</div>
530
+ </div>
531
+ <div className="metric-item">
532
+ <div className="metric-value">{loadingAccessibility.accessibilityState.reducedMotionEnabled ? '✓' : '✗'}</div>
533
+ <div className="metric-label">Reduced Motion</div>
534
+ </div>
535
+ <div className="metric-item">
536
+ <div className="metric-value">{loadingAccessibility.accessibilityState.ariaLabelsActive ? '✓' : '✗'}</div>
537
+ <div className="metric-label">ARIA Labels</div>
538
+ </div>
539
+ <div className="metric-item">
540
+ <div className="metric-value">{loadingAccessibility.accessibilityState.keyboardNavigationActive ? '✓' : '✗'}</div>
541
+ <div className="metric-label">Keyboard Nav</div>
542
+ </div>
543
+ </div>
544
+
545
+ {/* Accessibility Features */}
546
+ <div className="space-y-4">
547
+ <h4 className="font-semibold">Active Accessibility Features</h4>
548
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
549
+ {loadingAccessibility.accessibilityFeatures.map(feature => (
550
+ <div key={feature.id} className="p-3 bg-purple-50 rounded-lg">
551
+ <div className="flex justify-between items-center mb-1">
552
+ <span className="font-medium">{feature.name}</span>
553
+ <Badge variant={feature.impact === 'high' ? 'default' : 'secondary'}>
554
+ {feature.impact}
555
+ </Badge>
556
+ </div>
557
+ <p className="text-sm text-gray-600">{feature.description}</p>
558
+ </div>
559
+ ))}
560
+ </div>
561
+ </div>
562
+
563
+ {/* Accessibility Recommendations */}
564
+ <div className="p-4 bg-blue-50 rounded-lg">
565
+ <h4 className="font-semibold mb-3">Accessibility Recommendations</h4>
566
+ <div className="space-y-2">
567
+ {loadingAccessibility.getAccessibilityRecommendations().map((recommendation, index) => (
568
+ <p key={index} className="text-sm text-gray-600">• {recommendation}</p>
569
+ ))}
570
+ </div>
571
+ </div>
572
+
573
+ {/* Accessibility Controls */}
574
+ <div className="flex flex-wrap gap-4 justify-center">
575
+ <Button onClick={loadingAccessibility.enableScreenReaderSupport} variant="outline">
576
+ Enable Screen Reader
577
+ </Button>
578
+ <Button onClick={loadingAccessibility.enableReducedMotionSupport} variant="outline">
579
+ Enable Reduced Motion
580
+ </Button>
581
+ <Button onClick={loadingAccessibility.enableAriaSupport} variant="outline">
582
+ Enable ARIA Support
583
+ </Button>
584
+ <Button onClick={loadingAccessibility.enableKeyboardNavigation} variant="outline">
585
+ Enable Keyboard Nav
586
+ </Button>
587
+ </div>
588
+ </div>
589
+ )}
590
+ </Card>
591
+
592
+ {/* Status Indicators */}
593
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
594
+ <div className={`loading-status ${getBatteryClass()}`}>
595
+ <div className="w-3 h-3 bg-current rounded-full"></div>
596
+ <span className="text-sm font-medium">
597
+ Battery: {batteryConsciousLoading.getBatteryStatus()}
598
+ </span>
599
+ </div>
600
+
601
+ <div className={`loading-status ${getPerformanceClass()}`}>
602
+ <div className="w-3 h-3 bg-current rounded-full"></div>
603
+ <span className="text-sm font-medium">
604
+ Performance: {loadingPerformance.performanceHealth}
605
+ </span>
606
+ </div>
607
+
608
+ <div className={`loading-status ${getAccessibilityClass()}`}>
609
+ <div className="w-3 h-3 bg-current rounded-full"></div>
610
+ <span className="text-sm font-medium">
611
+ Accessibility: {loadingAccessibility.accessibilityScore}%
612
+ </span>
613
+ </div>
614
+
615
+ <div className="loading-status">
616
+ <div className="w-3 h-3 bg-current rounded-full"></div>
617
+ <span className="text-sm font-medium">
618
+ Device: {deviceLoadingStates.deviceState.deviceType}
619
+ </span>
620
+ </div>
621
+ </div>
622
+
623
+ {/* Notifications */}
624
+ {batteryConsciousLoading.notifications.length > 0 && (
625
+ <div className="space-y-2">
626
+ <h4 className="font-semibold">Recent Notifications</h4>
627
+ {batteryConsciousLoading.notifications.slice(-3).map((notification, index) => (
628
+ <div key={index} className="p-3 bg-blue-50 border border-blue-200 rounded-lg">
629
+ <p className="text-sm text-blue-800">{notification}</p>
630
+ </div>
631
+ ))}
632
+ </div>
633
+ )}
634
+ </div>
635
+ )
636
+ }
637
+
638
+ export default MobileSkeletonLoadingDemo