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

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,250 @@
1
+ import React, { useState } from 'react'
2
+ import { Card } from './card'
3
+ import { Button } from './button'
4
+ import { Badge } from './badge'
5
+ import {
6
+ AnimatedContainer,
7
+ StaggeredContainer,
8
+ useAnimationProfile,
9
+ usePerformanceMode
10
+ } from './animation'
11
+
12
+
13
+ export const AnimationDemo: React.FC = () => {
14
+ const [currentAnimation, setCurrentAnimation] = useState<'fadeIn' | 'slideIn' | 'scaleIn' | 'bounce'>('fadeIn')
15
+ const [isAnimating, setIsAnimating] = useState(false)
16
+
17
+ const { profile, performanceMetrics, deviceInfo } = useAnimationProfile()
18
+ const { performanceMode, shouldOptimizeForBattery } = usePerformanceMode()
19
+
20
+ const animations = [
21
+ { key: 'fadeIn' as const, label: 'Fade In', icon: '✨' },
22
+ { key: 'slideIn' as const, label: 'Slide In', icon: '➡️' },
23
+ { key: 'scaleIn' as const, label: 'Scale In', icon: '🔍' },
24
+ { key: 'bounce' as const, label: 'Bounce', icon: '🎾' }
25
+ ]
26
+
27
+ const handleAnimationChange = (animation: typeof currentAnimation) => {
28
+ setCurrentAnimation(animation)
29
+ setIsAnimating(true)
30
+
31
+ // Reset animation state after a delay
32
+ setTimeout(() => setIsAnimating(false), 1000)
33
+ }
34
+
35
+ const performanceIndicators = [
36
+ { label: 'FPS', value: performanceMetrics.fps, unit: '', color: performanceMetrics.fps > 50 ? 'green' : performanceMetrics.fps > 30 ? 'yellow' : 'red' },
37
+ { label: 'Memory', value: performanceMetrics.memoryUsage ? Math.round(performanceMetrics.memoryUsage * 100) : 'N/A', unit: '%', color: 'blue' },
38
+ { label: 'Battery', value: performanceMetrics.batteryLevel ? Math.round(performanceMetrics.batteryLevel * 100) : 'N/A', unit: '%', color: performanceMetrics.isLowPowerMode ? 'red' : 'green' }
39
+ ]
40
+
41
+ return (
42
+ <div className="space-y-6 p-6">
43
+ <div className="text-center">
44
+ <h1 className="text-3xl font-bold mb-2">Mobile-First Animation System</h1>
45
+ <p className="text-gray-600 dark:text-gray-400">
46
+ Device-specific animations with performance optimization and battery awareness
47
+ </p>
48
+ </div>
49
+
50
+ {/* Performance Metrics */}
51
+ <Card className="p-4">
52
+ <h2 className="text-xl font-semibold mb-4">Performance Metrics</h2>
53
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
54
+ {performanceIndicators.map((indicator) => (
55
+ <div key={indicator.label} className="text-center">
56
+ <div className={`text-2xl font-bold text-${indicator.color}-600`}>
57
+ {indicator.value}{indicator.unit}
58
+ </div>
59
+ <div className="text-sm text-gray-600 dark:text-gray-400">
60
+ {indicator.label}
61
+ </div>
62
+ </div>
63
+ ))}
64
+ </div>
65
+
66
+ <div className="mt-4 space-y-2">
67
+ <div className="flex items-center justify-between">
68
+ <span>Performance Mode:</span>
69
+ <Badge variant={performanceMode === 'high' ? 'default' : performanceMode === 'medium' ? 'secondary' : 'destructive'}>
70
+ {performanceMode.toUpperCase()}
71
+ </Badge>
72
+ </div>
73
+ <div className="flex items-center justify-between">
74
+ <span>Battery Optimization:</span>
75
+ <Badge variant={shouldOptimizeForBattery ? 'destructive' : 'default'}>
76
+ {shouldOptimizeForBattery ? 'Enabled' : 'Disabled'}
77
+ </Badge>
78
+ </div>
79
+ <div className="flex items-center justify-between">
80
+ <span>Reduced Motion:</span>
81
+ <Badge variant={profile.performance.reducedMotion ? 'destructive' : 'default'}>
82
+ {profile.performance.reducedMotion ? 'Enabled' : 'Disabled'}
83
+ </Badge>
84
+ </div>
85
+ </div>
86
+ </Card>
87
+
88
+ {/* Device Information */}
89
+ <Card className="p-4">
90
+ <h2 className="text-xl font-semibold mb-4">Device Profile</h2>
91
+ <div className="grid grid-cols-2 md:grid-cols-4 gap-4">
92
+ <div className="text-center">
93
+ <div className="text-lg font-semibold">{deviceInfo.screenSize}</div>
94
+ <div className="text-sm text-gray-600 dark:text-gray-400">Screen Size</div>
95
+ </div>
96
+ <div className="text-center">
97
+ <div className="text-lg font-semibold">{deviceInfo.orientation}</div>
98
+ <div className="text-sm text-gray-600 dark:text-gray-400">Orientation</div>
99
+ </div>
100
+ <div className="text-center">
101
+ <div className="text-lg font-semibold">{deviceInfo.touchDevice ? 'Touch' : 'Mouse'}</div>
102
+ <div className="text-sm text-gray-600 dark:text-gray-400">Input Type</div>
103
+ </div>
104
+ <div className="text-center">
105
+ <div className="text-lg font-semibold">{deviceInfo.isMobile ? 'Mobile' : deviceInfo.isTablet ? 'Tablet' : 'Desktop'}</div>
106
+ <div className="text-sm text-gray-600 dark:text-gray-400">Device Type</div>
107
+ </div>
108
+ </div>
109
+ </Card>
110
+
111
+ {/* Animation Controls */}
112
+ <Card className="p-4">
113
+ <h2 className="text-xl font-semibold mb-4">Animation Controls</h2>
114
+ <div className="flex flex-wrap gap-2 mb-4">
115
+ {animations.map((animation) => (
116
+ <Button
117
+ key={animation.key}
118
+ variant={currentAnimation === animation.key ? 'default' : 'outline'}
119
+ onClick={() => handleAnimationChange(animation.key)}
120
+ disabled={isAnimating}
121
+ className="flex items-center gap-2"
122
+ >
123
+ <span>{animation.icon}</span>
124
+ {animation.label}
125
+ </Button>
126
+ ))}
127
+ </div>
128
+
129
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
130
+ <div>
131
+ <label className="block text-sm font-medium mb-2">Current Animation Profile</label>
132
+ <div className="space-y-2 text-sm">
133
+ <div>Duration: {profile.duration.normal}</div>
134
+ <div>Easing: {profile.easing.ease}</div>
135
+ <div>Performance: {profile.performance.mode}</div>
136
+ </div>
137
+ </div>
138
+ <div>
139
+ <label className="block text-sm font-medium mb-2">Animation Classes</label>
140
+ <div className="text-xs bg-gray-100 dark:bg-gray-800 p-2 rounded">
141
+ {deviceInfo.isMobile && 'coach-stan-mobile-animation '}
142
+ {deviceInfo.isTablet && 'coach-stan-tablet-animation '}
143
+ {deviceInfo.isDesktop && 'coach-stan-desktop-animation '}
144
+ {shouldOptimizeForBattery && 'coach-stan-battery-saver '}
145
+ {profile.performance.reducedMotion && 'reduced-motion'}
146
+ </div>
147
+ </div>
148
+ </div>
149
+ </Card>
150
+
151
+ {/* Animation Examples */}
152
+ <Card className="p-4">
153
+ <h2 className="text-xl font-semibold mb-4">Animation Examples</h2>
154
+
155
+ {/* Single Animation */}
156
+ <div className="mb-6">
157
+ <h3 className="text-lg font-medium mb-3">Single Animation</h3>
158
+ <AnimatedContainer
159
+ animation={currentAnimation}
160
+ duration="normal"
161
+ easing="ease"
162
+ className="h-32 bg-gradient-to-r from-blue-500 to-purple-500 rounded-lg flex items-center justify-center text-white font-semibold"
163
+ >
164
+ <div className="text-center">
165
+ <div className="text-2xl mb-2">🎭</div>
166
+ <div>Animated Element</div>
167
+ <div className="text-sm opacity-75">{currentAnimation}</div>
168
+ </div>
169
+ </AnimatedContainer>
170
+ </div>
171
+
172
+ {/* Staggered Animations */}
173
+ <div className="mb-6">
174
+ <h3 className="text-lg font-medium mb-3">Staggered Animations</h3>
175
+ <StaggeredContainer
176
+ animation="slideIn"
177
+ duration="fast"
178
+ staggerDelay={0.1}
179
+ staggerDirection="forward"
180
+ className="grid grid-cols-2 md:grid-cols-4 gap-4"
181
+ >
182
+ {[1, 2, 3, 4].map((num) => (
183
+ <div
184
+ key={num}
185
+ className="h-20 bg-gradient-to-br from-green-400 to-blue-500 rounded-lg flex items-center justify-center text-white font-bold text-xl"
186
+ >
187
+ {num}
188
+ </div>
189
+ ))}
190
+ </StaggeredContainer>
191
+ </div>
192
+
193
+ {/* Performance Mode Comparison */}
194
+ <div>
195
+ <h3 className="text-lg font-medium mb-3">Performance Mode Comparison</h3>
196
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
197
+ <AnimatedContainer
198
+ animation="fadeIn"
199
+ duration="fast"
200
+ className="h-24 bg-red-400 rounded-lg flex items-center justify-center text-white font-semibold"
201
+ >
202
+ Fast Mode
203
+ </AnimatedContainer>
204
+ <AnimatedContainer
205
+ animation="fadeIn"
206
+ duration="normal"
207
+ className="h-24 bg-yellow-400 rounded-lg flex items-center justify-center text-white font-semibold"
208
+ >
209
+ Normal Mode
210
+ </AnimatedContainer>
211
+ <AnimatedContainer
212
+ animation="fadeIn"
213
+ duration="slow"
214
+ className="h-24 bg-green-400 rounded-lg flex items-center justify-center text-white font-semibold"
215
+ >
216
+ Slow Mode
217
+ </AnimatedContainer>
218
+ </div>
219
+ </div>
220
+ </Card>
221
+
222
+ {/* Technical Details */}
223
+ <Card className="p-4">
224
+ <h2 className="text-xl font-semibold mb-4">Technical Details</h2>
225
+ <div className="space-y-4">
226
+ <div>
227
+ <h3 className="font-medium mb-2">Animation Profile</h3>
228
+ <pre className="text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto">
229
+ {JSON.stringify(profile, null, 2)}
230
+ </pre>
231
+ </div>
232
+
233
+ <div>
234
+ <h3 className="font-medium mb-2">Device Info</h3>
235
+ <pre className="text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto">
236
+ {JSON.stringify(deviceInfo, null, 2)}
237
+ </pre>
238
+ </div>
239
+
240
+ <div>
241
+ <h3 className="font-medium mb-2">Performance Metrics</h3>
242
+ <pre className="text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto">
243
+ {JSON.stringify(performanceMetrics, null, 2)}
244
+ </pre>
245
+ </div>
246
+ </div>
247
+ </Card>
248
+ </div>
249
+ )
250
+ }
@@ -0,0 +1,33 @@
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+
4
+ import { cn } from "../../lib/utils"
5
+
6
+ const badgeVariants = cva(
7
+ "badge",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "badge--default",
12
+ secondary: "badge--secondary",
13
+ destructive: "badge--destructive",
14
+ outline: "badge--outline",
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ variant: "default",
19
+ },
20
+ }
21
+ )
22
+
23
+ export interface BadgeProps
24
+ extends React.HTMLAttributes<HTMLDivElement>,
25
+ VariantProps<typeof badgeVariants> {}
26
+
27
+ function Badge({ className, variant, ...props }: BadgeProps) {
28
+ return (
29
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
30
+ )
31
+ }
32
+
33
+ export { Badge, badgeVariants }