@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.1.3 → 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,596 @@
1
+ import React, { useState } from 'react'
2
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from './card'
3
+ import { Button } from './button'
4
+ import { Badge } from './badge'
5
+ import {
6
+ usePerformance,
7
+ useFrameRate,
8
+ useMemoryUsage,
9
+ useBatteryStatus,
10
+ usePerformanceThrottling
11
+ } from '../../hooks'
12
+ import { useDevice } from '../../hooks/use-device'
13
+
14
+ export const PerformanceDemo: React.FC = () => {
15
+ const [activeTab, setActiveTab] = useState<'overview' | 'fps' | 'memory' | 'battery' | 'throttling'>('overview')
16
+ const [showRecommendations, setShowRecommendations] = useState(false)
17
+
18
+ const device = useDevice()
19
+
20
+ // Main performance hook
21
+ const {
22
+ throttlingEnabled,
23
+ throttlingReason,
24
+ performanceMode,
25
+ getOptimizationRecommendations
26
+ } = usePerformance({
27
+ callbacks: {
28
+ onFPSWarning: (fps) => console.warn(`FPS Warning: ${fps}`),
29
+ onMemoryWarning: (usage) => console.warn(`Memory Warning: ${(usage * 100).toFixed(1)}%`),
30
+ onBatteryLow: (level) => console.warn(`Battery Low: ${(level * 100).toFixed(1)}%`),
31
+ onPerformanceModeChange: (mode) => console.log(`Performance mode changed to: ${mode}`),
32
+ onThrottlingChange: (enabled, reason) => console.log(`Throttling ${enabled ? 'enabled' : 'disabled'}: ${reason}`)
33
+ }
34
+ })
35
+
36
+ // Specialized hooks
37
+ const {
38
+ metrics: fpsMetrics,
39
+ performanceScore: fpsScore,
40
+ getPerformanceInsights: getFPSInsights
41
+ } = useFrameRate({
42
+ callbacks: {
43
+ onFPSWarning: (fps) => console.warn(`Frame rate warning: ${fps} FPS`),
44
+ onFPSDrop: (fps, previous) => console.warn(`FPS drop detected: ${previous} → ${fps}`)
45
+ }
46
+ })
47
+
48
+ const {
49
+ metrics: memoryMetrics,
50
+ memoryTrend,
51
+ memoryLeakDetected,
52
+ getOptimizationRecommendations: getMemoryRecommendations,
53
+ getCleanupSuggestions: getMemoryCleanupSuggestions
54
+ } = useMemoryUsage({
55
+ callbacks: {
56
+ onMemoryWarning: (usage) => console.warn(`Memory usage warning: ${(usage * 100).toFixed(1)}%`),
57
+ onMemoryLeakDetected: (trend) => console.warn(`Memory leak detected: ${trend} trend`)
58
+ }
59
+ })
60
+
61
+ const {
62
+ metrics: batteryMetrics,
63
+ batteryLevel,
64
+ isCharging,
65
+ isLowPowerMode,
66
+ isCriticalBattery,
67
+ getOptimizationRecommendations: getBatteryRecommendations,
68
+ getPowerSavingSuggestions: getBatteryPowerSuggestions,
69
+ getBatteryStatus: getBatteryStatusText
70
+ } = useBatteryStatus({
71
+ callbacks: {
72
+ onBatteryLow: (level) => console.warn(`Battery low: ${(level * 100).toFixed(1)}%`),
73
+ onBatteryCritical: (level) => console.error(`Battery critical: ${(level * 100).toFixed(1)}%`)
74
+ }
75
+ })
76
+
77
+ const {
78
+ metrics,
79
+ isThrottling,
80
+ throttleLevel,
81
+ optimizations,
82
+ recommendations,
83
+ performanceSettings,
84
+
85
+ } = usePerformanceThrottling({
86
+ enablePerformanceMonitoring: true,
87
+ enableAutomaticThrottling: true,
88
+ enableUserExperienceOptimization: true,
89
+ enableBatteryPreservation: true
90
+ }, {
91
+ onPerformanceWarning: (metrics) => console.log('Performance warning:', metrics),
92
+ onThrottlingApplied: (level, reason) => console.log('Throttling applied:', level, reason),
93
+ onPerformanceRecovery: (metrics) => console.log('Performance recovery:', metrics),
94
+ onUserExperienceOptimized: (optimization) => console.log('User experience optimized:', optimization)
95
+ })
96
+
97
+ // Performance score color mapping
98
+ const getScoreColor = (score: string) => {
99
+ switch (score) {
100
+ case 'excellent': return 'text-green-600 bg-green-100'
101
+ case 'good': return 'text-blue-600 bg-blue-100'
102
+ case 'fair': return 'text-yellow-600 bg-yellow-100'
103
+ case 'poor': return 'text-red-600 bg-red-100'
104
+ default: return 'text-gray-600 bg-gray-100'
105
+ }
106
+ }
107
+
108
+ // Performance mode color mapping
109
+ const getModeColor = (mode: string) => {
110
+ switch (mode) {
111
+ case 'high': return 'text-green-600 bg-green-100'
112
+ case 'medium': return 'text-yellow-600 bg-yellow-100'
113
+ case 'low': return 'text-red-600 bg-red-100'
114
+ default: return 'text-gray-600 bg-gray-100'
115
+ }
116
+ }
117
+
118
+ // Throttling level color mapping
119
+ const getThrottlingColor = (level: string) => {
120
+ switch (level) {
121
+ case 'none': return 'text-green-600 bg-green-100'
122
+ case 'light': return 'text-blue-600 bg-blue-100'
123
+ case 'moderate': return 'text-yellow-600 bg-yellow-100'
124
+ case 'aggressive': return 'text-red-600 bg-red-100'
125
+ default: return 'text-gray-600 bg-gray-100'
126
+ }
127
+ }
128
+
129
+ // Memory trend icon
130
+ const getMemoryTrendIcon = (trend: string) => {
131
+ switch (trend) {
132
+ case 'increasing': return '📈'
133
+ case 'decreasing': return '📉'
134
+ case 'stable': return '➡️'
135
+ default: return '❓'
136
+ }
137
+ }
138
+
139
+ // Battery icon
140
+ const getBatteryIcon = (level: number, charging: boolean) => {
141
+ if (charging) return '🔌'
142
+ if (level <= 0.15) return '🔴'
143
+ if (level <= 0.3) return '🟠'
144
+ if (level <= 0.5) return '🟡'
145
+ return '🟢'
146
+ }
147
+
148
+ const tabs = [
149
+ { id: 'overview', label: 'Overview', icon: '📊' },
150
+ { id: 'fps', label: 'Frame Rate', icon: '🎬' },
151
+ { id: 'memory', label: 'Memory', icon: '🧠' },
152
+ { id: 'battery', label: 'Battery', icon: '🔋' },
153
+ { id: 'throttling', label: 'Throttling', icon: '⚡' }
154
+ ]
155
+
156
+ return (
157
+ <div className="space-y-6">
158
+ {/* Tab Navigation */}
159
+ <div className="flex flex-wrap gap-2 border-b pb-4">
160
+ {tabs.map((tab) => (
161
+ <Button
162
+ key={tab.id}
163
+ variant={activeTab === tab.id ? 'default' : 'outline'}
164
+ size="sm"
165
+ onClick={() => setActiveTab(tab.id as any)}
166
+ className="flex items-center gap-2"
167
+ >
168
+ <span>{tab.icon}</span>
169
+ {tab.label}
170
+ </Button>
171
+ ))}
172
+ </div>
173
+
174
+ {/* Overview Tab */}
175
+ {activeTab === 'overview' && (
176
+ <div className="space-y-6">
177
+ {/* Performance Summary */}
178
+ <Card>
179
+ <CardHeader>
180
+ <CardTitle className="flex items-center gap-2">
181
+ 🎯 Performance Summary
182
+ <Badge variant={performanceMode === 'high' ? 'default' : 'secondary'}>
183
+ {performanceMode.toUpperCase()} MODE
184
+ </Badge>
185
+ </CardTitle>
186
+ <CardDescription>
187
+ Real-time performance overview and system status
188
+ </CardDescription>
189
+ </CardHeader>
190
+ <CardContent className="space-y-4">
191
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
192
+ {/* FPS Status */}
193
+ <div className="text-center p-4 border rounded-lg">
194
+ <div className="text-2xl font-bold text-blue-600">{fpsMetrics.fps}</div>
195
+ <div className="text-sm text-gray-600">FPS</div>
196
+ <Badge className={`mt-2 ${getScoreColor(fpsScore)}`}>
197
+ {fpsScore}
198
+ </Badge>
199
+ </div>
200
+
201
+ {/* Memory Status */}
202
+ <div className="text-center p-4 border rounded-lg">
203
+ <div className="text-2xl font-bold text-purple-600">
204
+ {memoryMetrics.memoryPercentage ? memoryMetrics.memoryPercentage.toFixed(1) : 'N/A'}%
205
+ </div>
206
+ <div className="text-sm text-gray-600">Memory Usage</div>
207
+ <div className="flex items-center justify-center gap-1 mt-2">
208
+ <span>{getMemoryTrendIcon(memoryTrend)}</span>
209
+ <Badge variant={memoryLeakDetected ? 'destructive' : 'secondary'}>
210
+ {memoryLeakDetected ? 'Leak Detected' : memoryTrend}
211
+ </Badge>
212
+ </div>
213
+ </div>
214
+
215
+ {/* Battery Status */}
216
+ <div className="text-center p-4 border rounded-lg">
217
+ <div className="text-2xl font-bold text-green-600">
218
+ {getBatteryIcon(batteryLevel || 1, isCharging)}
219
+ </div>
220
+ <div className="text-sm text-gray-600">Battery</div>
221
+ <Badge variant={isCriticalBattery ? 'destructive' : isLowPowerMode ? 'secondary' : 'default'}>
222
+ {getBatteryStatusText()}
223
+ </Badge>
224
+ </div>
225
+ </div>
226
+
227
+ {/* Throttling Status */}
228
+ {throttlingEnabled && (
229
+ <div className="p-4 bg-yellow-50 border border-yellow-200 rounded-lg">
230
+ <div className="flex items-center gap-2">
231
+ <span className="text-yellow-600">⚠️</span>
232
+ <div>
233
+ <div className="font-medium text-yellow-800">Performance Throttling Active</div>
234
+ <div className="text-sm text-yellow-700">{throttlingReason}</div>
235
+ </div>
236
+ </div>
237
+ </div>
238
+ )}
239
+
240
+ {/* Recommendations Toggle */}
241
+ <Button
242
+ variant="outline"
243
+ onClick={() => setShowRecommendations(!showRecommendations)}
244
+ className="w-full"
245
+ >
246
+ {showRecommendations ? 'Hide' : 'Show'} Performance Recommendations
247
+ </Button>
248
+
249
+ {/* Performance Recommendations */}
250
+ {showRecommendations && (
251
+ <div className="space-y-3">
252
+ <h4 className="font-medium text-gray-900">Optimization Recommendations:</h4>
253
+ <ul className="space-y-2 text-sm text-gray-700">
254
+ {getOptimizationRecommendations().map((rec, index) => (
255
+ <li key={index} className="flex items-start gap-2">
256
+ <span className="text-blue-500">•</span>
257
+ {rec}
258
+ </li>
259
+ ))}
260
+ </ul>
261
+ </div>
262
+ )}
263
+ </CardContent>
264
+ </Card>
265
+
266
+ {/* Device Information */}
267
+ <Card>
268
+ <CardHeader>
269
+ <CardTitle className="flex items-center gap-2">
270
+ 📱 Device Information
271
+ </CardTitle>
272
+ </CardHeader>
273
+ <CardContent>
274
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4 text-sm">
275
+ <div>
276
+ <span className="font-medium">Device Type:</span> {device.screenSize}
277
+ </div>
278
+ <div>
279
+ <span className="font-medium">Screen Size:</span> {device.screenSize}
280
+ </div>
281
+ <div>
282
+ <span className="font-medium">Orientation:</span> {device.orientation}
283
+ </div>
284
+ <div>
285
+ <span className="font-medium">Touch Device:</span> {device.touchDevice ? 'Yes' : 'No'}
286
+ </div>
287
+ </div>
288
+ </CardContent>
289
+ </Card>
290
+ </div>
291
+ )}
292
+
293
+ {/* Frame Rate Tab */}
294
+ {activeTab === 'fps' && (
295
+ <Card>
296
+ <CardHeader>
297
+ <CardTitle className="flex items-center gap-2">
298
+ 🎬 Frame Rate Monitoring
299
+ <Badge className={getScoreColor(fpsScore)}>
300
+ {fpsScore.toUpperCase()}
301
+ </Badge>
302
+ </CardTitle>
303
+ <CardDescription>
304
+ Real-time FPS tracking and performance analysis
305
+ </CardDescription>
306
+ </CardHeader>
307
+ <CardContent className="space-y-4">
308
+ <div className="grid grid-cols-2 md:grid-cols-4 gap-4">
309
+ <div className="text-center p-3 border rounded-lg">
310
+ <div className="text-xl font-bold text-blue-600">{fpsMetrics.fps}</div>
311
+ <div className="text-xs text-gray-600">Current FPS</div>
312
+ </div>
313
+ <div className="text-center p-3 border rounded-lg">
314
+ <div className="text-xl font-bold text-green-600">{fpsMetrics.averageFPS}</div>
315
+ <div className="text-xs text-gray-600">Average FPS</div>
316
+ </div>
317
+ <div className="text-center p-3 border rounded-lg">
318
+ <div className="text-xl font-bold text-purple-600">{fpsMetrics.minFPS}</div>
319
+ <div className="text-xs text-gray-600">Min FPS</div>
320
+ </div>
321
+ <div className="text-center p-3 border rounded-lg">
322
+ <div className="text-xl font-bold text-orange-600">{fpsMetrics.maxFPS}</div>
323
+ <div className="text-xs text-gray-600">Max FPS</div>
324
+ </div>
325
+ </div>
326
+
327
+ <div className="p-4 bg-blue-50 border border-blue-200 rounded-lg">
328
+ <h4 className="font-medium text-blue-800 mb-2">Performance Insights:</h4>
329
+ <ul className="space-y-1 text-sm text-blue-700">
330
+ {getFPSInsights().map((insight, index) => (
331
+ <li key={index} className="flex items-start gap-2">
332
+ <span className="text-blue-500">•</span>
333
+ {insight}
334
+ </li>
335
+ ))}
336
+ </ul>
337
+ </div>
338
+ </CardContent>
339
+ </Card>
340
+ )}
341
+
342
+ {/* Memory Tab */}
343
+ {activeTab === 'memory' && (
344
+ <Card>
345
+ <CardHeader>
346
+ <CardTitle className="flex items-center gap-2">
347
+ 🧠 Memory Usage Monitoring
348
+ <Badge variant={memoryLeakDetected ? 'destructive' : 'secondary'}>
349
+ {memoryLeakDetected ? 'LEAK DETECTED' : memoryTrend.toUpperCase()}
350
+ </Badge>
351
+ </CardTitle>
352
+ <CardDescription>
353
+ Memory usage tracking and leak detection
354
+ </CardDescription>
355
+ </CardHeader>
356
+ <CardContent className="space-y-4">
357
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
358
+ <div className="text-center p-3 border rounded-lg">
359
+ <div className="text-xl font-bold text-purple-600">
360
+ {memoryMetrics.memoryPercentage ? memoryMetrics.memoryPercentage.toFixed(1) : 'N/A'}%
361
+ </div>
362
+ <div className="text-xs text-gray-600">Usage</div>
363
+ </div>
364
+ <div className="text-center p-3 border rounded-lg">
365
+ <div className="text-xl font-bold text-blue-600">
366
+ {memoryMetrics.usedJSHeapSize ? (memoryMetrics.usedJSHeapSize / 1024 / 1024).toFixed(1) : 'N/A'} MB
367
+ </div>
368
+ <div className="text-xs text-gray-600">Used</div>
369
+ </div>
370
+ <div className="text-center p-3 border rounded-lg">
371
+ <div className="text-xl font-bold text-green-600">
372
+ {memoryMetrics.jsHeapSizeLimit ? (memoryMetrics.jsHeapSizeLimit / 1024 / 1024).toFixed(1) : 'N/A'} MB
373
+ </div>
374
+ <div className="text-xs text-gray-600">Limit</div>
375
+ </div>
376
+ </div>
377
+
378
+ <div className="p-4 bg-purple-50 border border-purple-200 rounded-lg">
379
+ <h4 className="font-medium text-purple-800 mb-2">Memory Optimization:</h4>
380
+ <ul className="space-y-1 text-sm text-purple-700">
381
+ {getMemoryRecommendations().map((rec, index) => (
382
+ <li key={index} className="flex items-start gap-2">
383
+ <span className="text-purple-500">•</span>
384
+ {rec}
385
+ </li>
386
+ ))}
387
+ </ul>
388
+ </div>
389
+
390
+ {memoryLeakDetected && (
391
+ <div className="p-4 bg-red-50 border border-red-200 rounded-lg">
392
+ <h4 className="font-medium text-red-800 mb-2">Memory Leak Cleanup Suggestions:</h4>
393
+ <ul className="space-y-1 text-sm text-red-700">
394
+ {getMemoryCleanupSuggestions().map((suggestion, index) => (
395
+ <li key={index} className="flex items-start gap-2">
396
+ <span className="text-red-500">•</span>
397
+ {suggestion}
398
+ </li>
399
+ ))}
400
+ </ul>
401
+ </div>
402
+ )}
403
+ </CardContent>
404
+ </Card>
405
+ )}
406
+
407
+ {/* Battery Tab */}
408
+ {activeTab === 'battery' && (
409
+ <Card>
410
+ <CardHeader>
411
+ <CardTitle className="flex items-center gap-2">
412
+ 🔋 Battery Status Monitoring
413
+ <Badge variant={isCriticalBattery ? 'destructive' : isLowPowerMode ? 'secondary' : 'default'}>
414
+ {getBatteryStatusText()}
415
+ </Badge>
416
+ </CardTitle>
417
+ <CardDescription>
418
+ Battery level monitoring and power optimization
419
+ </CardDescription>
420
+ </CardHeader>
421
+ <CardContent className="space-y-4">
422
+ <div className="grid grid-cols-1 md:grid-cols-4 gap-4">
423
+ <div className="text-center p-3 border rounded-lg">
424
+ <div className="text-2xl">{getBatteryIcon(batteryLevel || 1, isCharging)}</div>
425
+ <div className="text-xl font-bold text-green-600">
426
+ {batteryLevel ? (batteryLevel * 100).toFixed(1) : 'N/A'}%
427
+ </div>
428
+ <div className="text-xs text-gray-600">Level</div>
429
+ </div>
430
+ <div className="text-center p-3 border rounded-lg">
431
+ <div className="text-xl font-bold text-blue-600">
432
+ {isCharging ? 'Yes' : 'No'}
433
+ </div>
434
+ <div className="text-xs text-gray-600">Charging</div>
435
+ </div>
436
+ <div className="text-center p-3 border rounded-lg">
437
+ <div className="text-xl font-bold text-purple-600">
438
+ {batteryMetrics.chargingTime || 'N/A'}
439
+ </div>
440
+ <div className="text-xs text-gray-600">Charging Time</div>
441
+ </div>
442
+ <div className="text-center p-3 border rounded-lg">
443
+ <div className="text-xl font-bold text-orange-600">
444
+ {batteryMetrics.dischargingTime || 'N/A'}
445
+ </div>
446
+ <div className="text-xs text-gray-600">Discharge Time</div>
447
+ </div>
448
+ </div>
449
+
450
+ <div className="p-4 bg-green-50 border border-green-200 rounded-lg">
451
+ <h4 className="font-medium text-green-800 mb-2">Battery Optimization:</h4>
452
+ <ul className="space-y-1 text-sm text-green-700">
453
+ {getBatteryRecommendations().map((rec, index) => (
454
+ <li key={index} className="flex items-start gap-2">
455
+ <span className="text-green-500">•</span>
456
+ {rec}
457
+ </li>
458
+ ))}
459
+ </ul>
460
+ </div>
461
+
462
+ {(isLowPowerMode || isCriticalBattery) && (
463
+ <div className="p-4 bg-yellow-50 border border-yellow-200 rounded-lg">
464
+ <h4 className="font-medium text-yellow-800 mb-2">Power Saving Suggestions:</h4>
465
+ <ul className="space-y-1 text-sm text-yellow-700">
466
+ {getBatteryPowerSuggestions().map((suggestion, index) => (
467
+ <li key={index} className="flex items-start gap-2">
468
+ <span className="text-yellow-500">•</span>
469
+ {suggestion}
470
+ </li>
471
+ ))}
472
+ </ul>
473
+ </div>
474
+ )}
475
+ </CardContent>
476
+ </Card>
477
+ )}
478
+
479
+ {/* Throttling Tab */}
480
+ {activeTab === 'throttling' && (
481
+ <Card>
482
+ <CardHeader>
483
+ <CardTitle className="flex items-center gap-2">
484
+ ⚡ Performance Throttling
485
+ <Badge className={getThrottlingColor(throttleLevel)}>
486
+ {throttleLevel.toUpperCase()}
487
+ </Badge>
488
+ </CardTitle>
489
+ <CardDescription>
490
+ Automatic and manual performance throttling controls
491
+ </CardDescription>
492
+ </CardHeader>
493
+ <CardContent className="space-y-4">
494
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
495
+ <div className="text-center p-3 border rounded-lg">
496
+ <div className="text-xl font-bold text-blue-600">
497
+ {isThrottling ? 'Active' : 'Inactive'}
498
+ </div>
499
+ <div className="text-xs text-gray-600">Throttling Status</div>
500
+ </div>
501
+ <div className="text-center p-3 border rounded-lg">
502
+ <Badge className={getModeColor(performanceSettings.animationQuality)}>
503
+ {performanceSettings.animationQuality.toUpperCase()}
504
+ </Badge>
505
+ <div className="text-xs text-gray-600 mt-1">Performance Mode</div>
506
+ </div>
507
+ <div className="text-center p-3 border rounded-lg">
508
+ <div className="text-xl font-bold text-green-600">
509
+ {performanceSettings.memoryOptimization ? 'Yes' : 'No'}
510
+ </div>
511
+ <div className="text-xs text-gray-600">Battery Optimized</div>
512
+ </div>
513
+ </div>
514
+
515
+ {/* Throttling Status */}
516
+ <div className="flex flex-wrap gap-2">
517
+ <div className="text-center p-3 border rounded-lg">
518
+ <div className="text-lg font-bold text-blue-600">
519
+ {throttleLevel}
520
+ </div>
521
+ <div className="text-xs text-gray-600">Current Level</div>
522
+ </div>
523
+ <div className="text-center p-3 border rounded-lg">
524
+ <div className="text-lg font-bold text-green-600">
525
+ {isThrottling ? 'Active' : 'Inactive'}
526
+ </div>
527
+ <div className="text-xs text-gray-600">Throttling Status</div>
528
+ </div>
529
+ </div>
530
+
531
+ {/* Performance Settings */}
532
+ <div className="space-y-2">
533
+ <h4 className="font-medium text-gray-900">Performance Settings:</h4>
534
+ <div className="grid grid-cols-2 gap-4 text-sm">
535
+ <div>
536
+ <span className="font-medium">Max Concurrent Animations:</span>
537
+ <div className="text-blue-600">{performanceSettings.maxConcurrentAnimations}</div>
538
+ </div>
539
+ <div>
540
+ <span className="font-medium">Frame Rate Limit:</span>
541
+ <div className="text-blue-600">{performanceSettings.frameRateLimit}fps</div>
542
+ </div>
543
+ <div>
544
+ <span className="font-medium">Animation Quality:</span>
545
+ <div className="text-blue-600">{performanceSettings.animationQuality}</div>
546
+ </div>
547
+ <div>
548
+ <span className="font-medium">Memory Optimization:</span>
549
+ <div className="text-blue-600">{performanceSettings.memoryOptimization ? 'Yes' : 'No'}</div>
550
+ </div>
551
+ </div>
552
+ </div>
553
+
554
+ {/* Throttling Information */}
555
+ {isThrottling && (
556
+ <div className="p-4 bg-yellow-50 border border-yellow-200 rounded-lg">
557
+ <h4 className="font-medium text-yellow-800 mb-2">Throttling Information:</h4>
558
+ <div className="text-sm text-yellow-700 space-y-1">
559
+ <div><strong>Level:</strong> {throttleLevel}</div>
560
+ <div><strong>Performance Score:</strong> {metrics.performanceScore}</div>
561
+ <div><strong>FPS:</strong> {metrics.fps}</div>
562
+ </div>
563
+ </div>
564
+ )}
565
+
566
+ {/* Recommendations */}
567
+ <div className="p-4 bg-blue-50 border border-blue-200 rounded-lg">
568
+ <h4 className="font-medium text-blue-800 mb-2">Throttling Recommendations:</h4>
569
+ <ul className="space-y-1 text-sm text-blue-700">
570
+ {recommendations.map((rec, index) => (
571
+ <li key={index} className="flex items-start gap-2">
572
+ <span className="text-blue-500">•</span>
573
+ {rec}
574
+ </li>
575
+ ))}
576
+ </ul>
577
+ </div>
578
+
579
+ {/* Optimization Suggestions */}
580
+ <div className="p-4 bg-green-50 border border-green-200 rounded-lg">
581
+ <h4 className="font-medium text-green-800 mb-2">Optimization Suggestions:</h4>
582
+ <ul className="space-y-1 text-sm text-green-700">
583
+ {optimizations.map((suggestion, index) => (
584
+ <li key={index} className="flex items-start gap-2">
585
+ <span className="text-green-500">•</span>
586
+ {suggestion}
587
+ </li>
588
+ ))}
589
+ </ul>
590
+ </div>
591
+ </CardContent>
592
+ </Card>
593
+ )}
594
+ </div>
595
+ )
596
+ }