@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,224 @@
1
+ import React, { ReactNode, useState, useEffect } from 'react'
2
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../card'
3
+ import { Badge } from '../badge'
4
+ import { Button } from '../button'
5
+
6
+ export interface DesktopLayoutProps {
7
+ children: ReactNode
8
+ title?: string
9
+ description?: string
10
+ showHeader?: boolean
11
+ showSidebar?: boolean
12
+ showTopBar?: boolean
13
+ enablePerformanceMonitoring?: boolean
14
+ enableAdvancedFeatures?: boolean
15
+ className?: string
16
+ }
17
+
18
+ export const DesktopLayout: React.FC<DesktopLayoutProps> = ({
19
+ children,
20
+ title = 'Desktop Layout',
21
+ description = 'Desktop-optimized layout with advanced features and performance monitoring',
22
+ showHeader = true,
23
+ showSidebar = true,
24
+ showTopBar = true,
25
+ enablePerformanceMonitoring = true,
26
+ enableAdvancedFeatures = true,
27
+ className = ''
28
+ }) => {
29
+ const [performanceMetrics, setPerformanceMetrics] = useState({
30
+ renderTime: 0,
31
+ memoryUsage: 0,
32
+ cpuUsage: 0,
33
+ fps: 60
34
+ })
35
+ const [sidebarCollapsed, setSidebarCollapsed] = useState(false)
36
+
37
+ // Performance monitoring
38
+ useEffect(() => {
39
+ if (!enablePerformanceMonitoring) return
40
+
41
+ const measurePerformance = () => {
42
+ const startTime = performance.now()
43
+
44
+ // Simulate performance measurement
45
+ setTimeout(() => {
46
+ const endTime = performance.now()
47
+ const renderTime = endTime - startTime
48
+
49
+ setPerformanceMetrics(prev => ({
50
+ ...prev,
51
+ renderTime,
52
+ memoryUsage: Math.random() * 100,
53
+ cpuUsage: Math.random() * 50,
54
+ fps: 55 + Math.random() * 10
55
+ }))
56
+ }, 100)
57
+ }
58
+
59
+ measurePerformance()
60
+ const interval = setInterval(measurePerformance, 4000)
61
+
62
+ return () => clearInterval(interval)
63
+ }, [enablePerformanceMonitoring])
64
+
65
+ return (
66
+ <div className={`min-h-screen bg-cs-page-bg ${className}`}>
67
+ {/* Top Bar */}
68
+ {showTopBar && (
69
+ <div className="bg-cs-surface border-b border-cs-border px-6 py-2">
70
+ <div className="flex items-center justify-between text-sm text-cs-text-secondary">
71
+ <span>Stan Design System</span>
72
+ <div className="flex items-center gap-4">
73
+ <span>Desktop Layout</span>
74
+ {enableAdvancedFeatures && <span>Advanced Features Enabled</span>}
75
+ </div>
76
+ </div>
77
+ </div>
78
+ )}
79
+
80
+ {/* Desktop Header */}
81
+ {showHeader && (
82
+ <header className="bg-cs-surface border-b border-cs-border px-8 py-6">
83
+ <div className="flex items-center justify-between">
84
+ <div className="flex-1">
85
+ <h1 className="text-3xl font-bold text-cs-text-primary">{title}</h1>
86
+ {description && (
87
+ <p className="text-lg text-cs-text-secondary mt-3">{description}</p>
88
+ )}
89
+ </div>
90
+ <div className="flex items-center gap-4">
91
+ <Badge variant="outline" className="text-base">
92
+ Desktop
93
+ </Badge>
94
+ {enableAdvancedFeatures && (
95
+ <Badge variant="default" className="text-base">
96
+ Advanced
97
+ </Badge>
98
+ )}
99
+ {enablePerformanceMonitoring && (
100
+ <Badge variant="secondary" className="text-base">
101
+ Performance
102
+ </Badge>
103
+ )}
104
+ </div>
105
+ </div>
106
+ </header>
107
+ )}
108
+
109
+ {/* Main Content with Sidebar */}
110
+ <div className="flex flex-1">
111
+ {/* Sidebar */}
112
+ {showSidebar && (
113
+ <aside className={`bg-cs-surface border-r border-cs-border transition-all duration-300 ${
114
+ sidebarCollapsed ? 'w-16' : 'w-80'
115
+ }`}>
116
+ <div className="p-4">
117
+ <div className="flex items-center justify-between mb-6">
118
+ <h3 className={`font-semibold text-cs-text-primary ${
119
+ sidebarCollapsed ? 'hidden' : 'block'
120
+ }`}>
121
+ Navigation
122
+ </h3>
123
+ <Button
124
+ variant="ghost"
125
+ size="sm"
126
+ onClick={() => setSidebarCollapsed(!sidebarCollapsed)}
127
+ className="ml-auto"
128
+ >
129
+ {sidebarCollapsed ? 'โ†’' : 'โ†'}
130
+ </Button>
131
+ </div>
132
+
133
+ <nav className="space-y-2">
134
+ <Button variant="ghost" className={`w-full justify-start ${
135
+ sidebarCollapsed ? 'px-2' : 'px-4'
136
+ }`}>
137
+ ๐Ÿ  {!sidebarCollapsed && 'Dashboard'}
138
+ </Button>
139
+ <Button variant="ghost" className={`w-full justify-start ${
140
+ sidebarCollapsed ? 'px-2' : 'px-4'
141
+ }`}>
142
+ ๐ŸŽจ {!sidebarCollapsed && 'Design System'}
143
+ </Button>
144
+ <Button variant="ghost" className={`w-full justify-start ${
145
+ sidebarCollapsed ? 'px-2' : 'px-4'
146
+ }`}>
147
+ ๐Ÿ“ฑ {!sidebarCollapsed && 'Mobile Features'}
148
+ </Button>
149
+ <Button variant="ghost" className={`w-full justify-start ${
150
+ sidebarCollapsed ? 'px-2' : 'px-4'
151
+ }`}>
152
+ ๐Ÿงช {!sidebarCollapsed && 'Interactive Demos'}
153
+ </Button>
154
+ <Button variant="ghost" className={`w-full justify-start ${
155
+ sidebarCollapsed ? 'px-2' : 'px-4'
156
+ }`}>
157
+ ๐Ÿ“Š {!sidebarCollapsed && 'Performance'}
158
+ </Button>
159
+ <Button variant="ghost" className={`w-full justify-start ${
160
+ sidebarCollapsed ? 'px-2' : 'px-4'
161
+ }`}>
162
+ โš™๏ธ {!sidebarCollapsed && 'Configuration'}
163
+ </Button>
164
+ </nav>
165
+ </div>
166
+ </aside>
167
+ )}
168
+
169
+ {/* Main Content */}
170
+ <main className="flex-1 p-8 space-y-8">
171
+ {/* Performance Metrics */}
172
+ {enablePerformanceMonitoring && (
173
+ <Card className="border-2 border-cs-accent">
174
+ <CardHeader>
175
+ <CardTitle className="text-2xl flex items-center gap-3">
176
+ ๐Ÿ“Š Desktop Performance Metrics
177
+ <Badge variant="outline" className="text-base">Real-time</Badge>
178
+ </CardTitle>
179
+ <CardDescription className="text-base">
180
+ Advanced performance monitoring for desktop devices
181
+ </CardDescription>
182
+ </CardHeader>
183
+ <CardContent>
184
+ <div className="grid grid-cols-2 xl:grid-cols-4 gap-8 text-center">
185
+ <div>
186
+ <p className="text-4xl font-bold text-cs-primary">
187
+ {performanceMetrics.renderTime.toFixed(1)}ms
188
+ </p>
189
+ <p className="text-base text-cs-text-secondary">Render Time</p>
190
+ </div>
191
+ <div>
192
+ <p className="text-4xl font-bold text-cs-secondary">
193
+ {performanceMetrics.memoryUsage.toFixed(1)}%
194
+ </p>
195
+ <p className="text-base text-cs-text-secondary">Memory Usage</p>
196
+ </div>
197
+ <div>
198
+ <p className="text-4xl font-bold text-cs-accent">
199
+ {performanceMetrics.cpuUsage.toFixed(1)}%
200
+ </p>
201
+ <p className="text-base text-cs-text-secondary">CPU Usage</p>
202
+ </div>
203
+ <div>
204
+ <p className="text-4xl font-bold text-cs-primary">
205
+ {performanceMetrics.fps.toFixed(0)}
206
+ </p>
207
+ <p className="text-base text-cs-text-secondary">FPS</p>
208
+ </div>
209
+ </div>
210
+ </CardContent>
211
+ </Card>
212
+ )}
213
+
214
+ {/* Content Area */}
215
+ <div className="space-y-8">
216
+ {children}
217
+ </div>
218
+ </main>
219
+ </div>
220
+ </div>
221
+ )
222
+ }
223
+
224
+ export default DesktopLayout
@@ -0,0 +1,10 @@
1
+ export { MobileLayout, default as MobileLayoutDefault } from './mobile-layout'
2
+ export { TabletLayout, default as TabletLayoutDefault } from './tablet-layout'
3
+ export { DesktopLayout, default as DesktopLayoutDefault } from './desktop-layout'
4
+ export { AdaptiveLayout, default as AdaptiveLayoutDefault, type DeviceType } from './adaptive-layout'
5
+
6
+ // Re-export types
7
+ export type { MobileLayoutProps } from './mobile-layout'
8
+ export type { TabletLayoutProps } from './tablet-layout'
9
+ export type { DesktopLayoutProps } from './desktop-layout'
10
+ export type { AdaptiveLayoutProps } from './adaptive-layout'
@@ -0,0 +1,162 @@
1
+ import React, { ReactNode, useState, useEffect } from 'react'
2
+ import { Card, CardContent, CardHeader, CardTitle } from '../card'
3
+ import { Badge } from '../badge'
4
+
5
+ export interface MobileLayoutProps {
6
+ children: ReactNode
7
+ title?: string
8
+ description?: string
9
+ showHeader?: boolean
10
+ showFooter?: boolean
11
+ enableTouchOptimization?: boolean
12
+ enablePerformanceMonitoring?: boolean
13
+ className?: string
14
+ }
15
+
16
+ export const MobileLayout: React.FC<MobileLayoutProps> = ({
17
+ children,
18
+ title = 'Mobile Layout',
19
+ description = 'Touch-optimized mobile layout with performance monitoring',
20
+ showHeader = true,
21
+ showFooter = true,
22
+ enableTouchOptimization = true,
23
+ enablePerformanceMonitoring = true,
24
+ className = ''
25
+ }) => {
26
+ const [touchActive, setTouchActive] = useState(false)
27
+ const [performanceMetrics, setPerformanceMetrics] = useState({
28
+ renderTime: 0,
29
+ memoryUsage: 0,
30
+ touchResponsiveness: 0
31
+ })
32
+
33
+ // Touch optimization
34
+ useEffect(() => {
35
+ if (!enableTouchOptimization) return
36
+
37
+ const handleTouchStart = () => setTouchActive(true)
38
+ const handleTouchEnd = () => setTouchActive(false)
39
+
40
+ document.addEventListener('touchstart', handleTouchStart, { passive: true })
41
+ document.addEventListener('touchend', handleTouchEnd, { passive: true })
42
+
43
+ return () => {
44
+ document.removeEventListener('touchstart', handleTouchStart)
45
+ document.removeEventListener('touchend', handleTouchEnd)
46
+ }
47
+ }, [enableTouchOptimization])
48
+
49
+ // Performance monitoring
50
+ useEffect(() => {
51
+ if (!enablePerformanceMonitoring) return
52
+
53
+ const measurePerformance = () => {
54
+ const startTime = performance.now()
55
+
56
+ // Simulate performance measurement
57
+ setTimeout(() => {
58
+ const endTime = performance.now()
59
+ const renderTime = endTime - startTime
60
+
61
+ setPerformanceMetrics(prev => ({
62
+ ...prev,
63
+ renderTime,
64
+ memoryUsage: Math.random() * 100,
65
+ touchResponsiveness: touchActive ? 95 : 85
66
+ }))
67
+ }, 100)
68
+ }
69
+
70
+ measurePerformance()
71
+ const interval = setInterval(measurePerformance, 2000)
72
+
73
+ return () => clearInterval(interval)
74
+ }, [enablePerformanceMonitoring, touchActive])
75
+
76
+ return (
77
+ <div className={`min-h-screen bg-cs-page-bg ${className}`}>
78
+ {/* Mobile Header */}
79
+ {showHeader && (
80
+ <header className="sticky top-0 z-50 bg-cs-surface border-b border-cs-border p-4">
81
+ <div className="flex items-center justify-between">
82
+ <div className="flex-1">
83
+ <h1 className="text-xl font-bold text-cs-text-primary">{title}</h1>
84
+ {description && (
85
+ <p className="text-sm text-cs-text-secondary mt-1">{description}</p>
86
+ )}
87
+ </div>
88
+ <div className="flex items-center gap-2">
89
+ <Badge variant="outline" className="text-xs">
90
+ Mobile
91
+ </Badge>
92
+ {enableTouchOptimization && (
93
+ <Badge variant="default" className="text-xs">
94
+ Touch
95
+ </Badge>
96
+ )}
97
+ {enablePerformanceMonitoring && (
98
+ <Badge variant="secondary" className="text-xs">
99
+ Performance
100
+ </Badge>
101
+ )}
102
+ </div>
103
+ </div>
104
+ </header>
105
+ )}
106
+
107
+ {/* Main Content */}
108
+ <main className="p-4 space-y-4">
109
+ {/* Performance Metrics */}
110
+ {enablePerformanceMonitoring && (
111
+ <Card className="border-2 border-cs-accent">
112
+ <CardHeader className="pb-3">
113
+ <CardTitle className="text-lg flex items-center gap-2">
114
+ ๐Ÿ“Š Performance Metrics
115
+ <Badge variant="outline">Real-time</Badge>
116
+ </CardTitle>
117
+ </CardHeader>
118
+ <CardContent>
119
+ <div className="grid grid-cols-3 gap-4 text-center">
120
+ <div>
121
+ <p className="text-2xl font-bold text-cs-primary">
122
+ {performanceMetrics.renderTime.toFixed(1)}ms
123
+ </p>
124
+ <p className="text-xs text-cs-text-secondary">Render Time</p>
125
+ </div>
126
+ <div>
127
+ <p className="text-2xl font-bold text-cs-secondary">
128
+ {performanceMetrics.memoryUsage.toFixed(1)}%
129
+ </p>
130
+ <p className="text-xs text-cs-text-secondary">Memory</p>
131
+ </div>
132
+ <div>
133
+ <p className="text-2xl font-bold text-cs-accent">
134
+ {performanceMetrics.touchResponsiveness.toFixed(0)}%
135
+ </p>
136
+ <p className="text-xs text-cs-text-secondary">Touch</p>
137
+ </div>
138
+ </div>
139
+ </CardContent>
140
+ </Card>
141
+ )}
142
+
143
+ {/* Content Area */}
144
+ <div className="space-y-4">
145
+ {children}
146
+ </div>
147
+ </main>
148
+
149
+ {/* Mobile Footer */}
150
+ {showFooter && (
151
+ <footer className="sticky bottom-0 z-50 bg-cs-surface border-t border-cs-border p-4">
152
+ <div className="flex items-center justify-between text-sm text-cs-text-secondary">
153
+ <span>Mobile Layout</span>
154
+ <span>Touch Optimized</span>
155
+ </div>
156
+ </footer>
157
+ )}
158
+ </div>
159
+ )
160
+ }
161
+
162
+ export default MobileLayout
@@ -0,0 +1,197 @@
1
+ import React, { ReactNode, useState, useEffect } from 'react'
2
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../card'
3
+ import { Badge } from '../badge'
4
+ import { Button } from '../button'
5
+
6
+ export interface TabletLayoutProps {
7
+ children: ReactNode
8
+ title?: string
9
+ description?: string
10
+ showHeader?: boolean
11
+ showSidebar?: boolean
12
+ enableTouchOptimization?: boolean
13
+ enablePerformanceMonitoring?: boolean
14
+ className?: string
15
+ }
16
+
17
+ export const TabletLayout: React.FC<TabletLayoutProps> = ({
18
+ children,
19
+ title = 'Tablet Layout',
20
+ description = 'Tablet-optimized layout with touch and performance features',
21
+ showHeader = true,
22
+ showSidebar = true,
23
+ enableTouchOptimization = true,
24
+ enablePerformanceMonitoring = true,
25
+ className = ''
26
+ }) => {
27
+ const [orientation, setOrientation] = useState<'portrait' | 'landscape'>('portrait')
28
+ const [performanceMetrics, setPerformanceMetrics] = useState({
29
+ renderTime: 0,
30
+ memoryUsage: 0,
31
+ touchResponsiveness: 0,
32
+ orientation: 'portrait'
33
+ })
34
+
35
+ // Orientation detection
36
+ useEffect(() => {
37
+ const handleOrientationChange = () => {
38
+ const newOrientation = window.innerWidth > window.innerHeight ? 'landscape' : 'portrait'
39
+ setOrientation(newOrientation)
40
+ setPerformanceMetrics(prev => ({ ...prev, orientation: newOrientation }))
41
+ }
42
+
43
+ handleOrientationChange()
44
+ window.addEventListener('resize', handleOrientationChange)
45
+ window.addEventListener('orientationchange', handleOrientationChange)
46
+
47
+ return () => {
48
+ window.removeEventListener('resize', handleOrientationChange)
49
+ window.removeEventListener('orientationchange', handleOrientationChange)
50
+ }
51
+ }, [])
52
+
53
+ // Performance monitoring
54
+ useEffect(() => {
55
+ if (!enablePerformanceMonitoring) return
56
+
57
+ const measurePerformance = () => {
58
+ const startTime = performance.now()
59
+
60
+ // Simulate performance measurement
61
+ setTimeout(() => {
62
+ const endTime = performance.now()
63
+ const renderTime = endTime - startTime
64
+
65
+ setPerformanceMetrics(prev => ({
66
+ ...prev,
67
+ renderTime,
68
+ memoryUsage: Math.random() * 100,
69
+ touchResponsiveness: orientation === 'landscape' ? 90 : 95
70
+ }))
71
+ }, 100)
72
+ }
73
+
74
+ measurePerformance()
75
+ const interval = setInterval(measurePerformance, 3000)
76
+
77
+ return () => clearInterval(interval)
78
+ }, [enablePerformanceMonitoring, orientation])
79
+
80
+ return (
81
+ <div className={`min-h-screen bg-cs-page-bg ${className}`}>
82
+ {/* Tablet Header */}
83
+ {showHeader && (
84
+ <header className="sticky top-0 z-50 bg-cs-surface border-b border-cs-border p-6">
85
+ <div className="flex items-center justify-between">
86
+ <div className="flex-1">
87
+ <h1 className="text-2xl font-bold text-cs-text-primary">{title}</h1>
88
+ {description && (
89
+ <p className="text-base text-cs-text-secondary mt-2">{description}</p>
90
+ )}
91
+ </div>
92
+ <div className="flex items-center gap-3">
93
+ <Badge variant="outline">
94
+ Tablet
95
+ </Badge>
96
+ <Badge variant={orientation === 'landscape' ? 'default' : 'secondary'}>
97
+ {orientation === 'landscape' ? 'Landscape' : 'Portrait'}
98
+ </Badge>
99
+ {enableTouchOptimization && (
100
+ <Badge variant="default">
101
+ Touch
102
+ </Badge>
103
+ )}
104
+ {enablePerformanceMonitoring && (
105
+ <Badge variant="secondary">
106
+ Performance
107
+ </Badge>
108
+ )}
109
+ </div>
110
+ </div>
111
+ </header>
112
+ )}
113
+
114
+ {/* Main Content with Sidebar */}
115
+ <div className="flex flex-1">
116
+ {/* Sidebar */}
117
+ {showSidebar && (
118
+ <aside className="w-64 bg-cs-surface border-r border-cs-border p-4 hidden lg:block">
119
+ <div className="space-y-4">
120
+ <h3 className="font-semibold text-cs-text-primary">Navigation</h3>
121
+ <nav className="space-y-2">
122
+ <Button variant="ghost" className="w-full justify-start">
123
+ ๐Ÿ  Dashboard
124
+ </Button>
125
+ <Button variant="ghost" className="w-full justify-start">
126
+ ๐ŸŽจ Design System
127
+ </Button>
128
+ <Button variant="ghost" className="w-full justify-start">
129
+ ๐Ÿ“ฑ Mobile Features
130
+ </Button>
131
+ <Button variant="ghost" className="w-full justify-start">
132
+ ๐Ÿงช Interactive Demos
133
+ </Button>
134
+ <Button variant="ghost" className="w-full justify-start">
135
+ ๐Ÿ“Š Performance
136
+ </Button>
137
+ </nav>
138
+ </div>
139
+ </aside>
140
+ )}
141
+
142
+ {/* Main Content */}
143
+ <main className="flex-1 p-6 space-y-6">
144
+ {/* Performance Metrics */}
145
+ {enablePerformanceMonitoring && (
146
+ <Card className="border-2 border-cs-accent">
147
+ <CardHeader>
148
+ <CardTitle className="text-xl flex items-center gap-2">
149
+ ๐Ÿ“Š Tablet Performance Metrics
150
+ <Badge variant="outline">Real-time</Badge>
151
+ </CardTitle>
152
+ <CardDescription>
153
+ Performance monitoring optimized for tablet devices
154
+ </CardDescription>
155
+ </CardHeader>
156
+ <CardContent>
157
+ <div className="grid grid-cols-2 lg:grid-cols-4 gap-6 text-center">
158
+ <div>
159
+ <p className="text-3xl font-bold text-cs-primary">
160
+ {performanceMetrics.renderTime.toFixed(1)}ms
161
+ </p>
162
+ <p className="text-sm text-cs-text-secondary">Render Time</p>
163
+ </div>
164
+ <div>
165
+ <p className="text-3xl font-bold text-cs-secondary">
166
+ {performanceMetrics.memoryUsage.toFixed(1)}%
167
+ </p>
168
+ <p className="text-sm text-cs-text-secondary">Memory Usage</p>
169
+ </div>
170
+ <div>
171
+ <p className="text-3xl font-bold text-cs-accent">
172
+ {performanceMetrics.touchResponsiveness.toFixed(0)}%
173
+ </p>
174
+ <p className="text-sm text-cs-text-secondary">Touch Responsiveness</p>
175
+ </div>
176
+ <div>
177
+ <p className="text-3xl font-bold text-cs-primary">
178
+ {performanceMetrics.orientation}
179
+ </p>
180
+ <p className="text-sm text-cs-text-secondary">Orientation</p>
181
+ </div>
182
+ </div>
183
+ </CardContent>
184
+ </Card>
185
+ )}
186
+
187
+ {/* Content Area */}
188
+ <div className="space-y-6">
189
+ {children}
190
+ </div>
191
+ </main>
192
+ </div>
193
+ </div>
194
+ )
195
+ }
196
+
197
+ export default TabletLayout