@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.
- package/CHANGELOG.md +1 -1
- package/dist/index.d.ts +131 -131
- package/dist/index.esm.js +148 -148
- package/dist/index.js +148 -148
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/accessibility-demo.tsx +271 -0
- package/src/components/ui/advanced-component-architecture-demo.tsx +916 -0
- package/src/components/ui/advanced-transition-system-demo.tsx +670 -0
- package/src/components/ui/advanced-transition-system.tsx +395 -0
- package/src/components/ui/animation/animated-container.tsx +166 -0
- package/src/components/ui/animation/index.ts +19 -0
- package/src/components/ui/animation/staggered-container.tsx +68 -0
- package/src/components/ui/animation-demo.tsx +250 -0
- package/src/components/ui/badge.tsx +33 -0
- package/src/components/ui/battery-conscious-animation-demo.tsx +568 -0
- package/src/components/ui/border-radius-shadow-demo.tsx +187 -0
- package/src/components/ui/button.tsx +36 -0
- package/src/components/ui/card.tsx +207 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/color-preview.tsx +411 -0
- package/src/components/ui/data-display/chart.tsx +653 -0
- package/src/components/ui/data-display/data-grid-simple.tsx +76 -0
- package/src/components/ui/data-display/data-grid.tsx +680 -0
- package/src/components/ui/data-display/list.tsx +456 -0
- package/src/components/ui/data-display/table.tsx +482 -0
- package/src/components/ui/data-display/timeline.tsx +441 -0
- package/src/components/ui/data-display/tree.tsx +602 -0
- package/src/components/ui/data-display/types.ts +536 -0
- package/src/components/ui/enterprise-mobile-experience-demo.tsx +749 -0
- package/src/components/ui/enterprise-mobile-experience.tsx +464 -0
- package/src/components/ui/feedback/alert.tsx +157 -0
- package/src/components/ui/feedback/progress.tsx +292 -0
- package/src/components/ui/feedback/skeleton.tsx +185 -0
- package/src/components/ui/feedback/toast.tsx +280 -0
- package/src/components/ui/feedback/types.ts +125 -0
- package/src/components/ui/font-preview.tsx +288 -0
- package/src/components/ui/form-demo.tsx +553 -0
- package/src/components/ui/hardware-acceleration-demo.tsx +547 -0
- package/src/components/ui/input.tsx +35 -0
- package/src/components/ui/label.tsx +16 -0
- package/src/components/ui/layout-demo.tsx +367 -0
- package/src/components/ui/layouts/adaptive-layout.tsx +139 -0
- package/src/components/ui/layouts/desktop-layout.tsx +224 -0
- package/src/components/ui/layouts/index.ts +10 -0
- package/src/components/ui/layouts/mobile-layout.tsx +162 -0
- package/src/components/ui/layouts/tablet-layout.tsx +197 -0
- package/src/components/ui/mobile-form-validation.tsx +451 -0
- package/src/components/ui/mobile-input-demo.tsx +201 -0
- package/src/components/ui/mobile-input.tsx +281 -0
- package/src/components/ui/mobile-skeleton-loading-demo.tsx +638 -0
- package/src/components/ui/navigation/breadcrumb.tsx +158 -0
- package/src/components/ui/navigation/index.ts +36 -0
- package/src/components/ui/navigation/menu.tsx +374 -0
- package/src/components/ui/navigation/navigation-demo.tsx +324 -0
- package/src/components/ui/navigation/pagination.tsx +272 -0
- package/src/components/ui/navigation/sidebar.tsx +383 -0
- package/src/components/ui/navigation/stepper.tsx +303 -0
- package/src/components/ui/navigation/tabs.tsx +205 -0
- package/src/components/ui/navigation/types.ts +299 -0
- package/src/components/ui/overlay/backdrop.tsx +81 -0
- package/src/components/ui/overlay/focus-manager.tsx +143 -0
- package/src/components/ui/overlay/index.ts +36 -0
- package/src/components/ui/overlay/modal.tsx +270 -0
- package/src/components/ui/overlay/overlay-manager.tsx +110 -0
- package/src/components/ui/overlay/popover.tsx +462 -0
- package/src/components/ui/overlay/portal.tsx +79 -0
- package/src/components/ui/overlay/tooltip.tsx +303 -0
- package/src/components/ui/overlay/types.ts +196 -0
- package/src/components/ui/performance-demo.tsx +596 -0
- package/src/components/ui/semantic-input-system-demo.tsx +502 -0
- package/src/components/ui/semantic-input-system-demo.tsx.disabled +873 -0
- package/src/components/ui/tablet-layout.tsx +192 -0
- package/src/components/ui/theme-customizer.tsx +386 -0
- package/src/components/ui/theme-preview.tsx +310 -0
- package/src/components/ui/theme-switcher.tsx +264 -0
- package/src/components/ui/theme-toggle.tsx +38 -0
- package/src/components/ui/token-demo.tsx +195 -0
- package/src/components/ui/touch-demo.tsx +462 -0
- package/src/components/ui/touch-friendly-interface-demo.tsx +519 -0
- package/src/components/ui/touch-friendly-interface.tsx +296 -0
- package/src/hooks/index.ts +190 -0
- package/src/hooks/use-accessibility-support.ts +518 -0
- package/src/hooks/use-adaptive-layout.ts +289 -0
- package/src/hooks/use-advanced-patterns.ts +294 -0
- package/src/hooks/use-advanced-transition-system.ts +393 -0
- package/src/hooks/use-animation-profile.ts +288 -0
- package/src/hooks/use-battery-animations.ts +384 -0
- package/src/hooks/use-battery-conscious-loading.ts +475 -0
- package/src/hooks/use-battery-optimization.ts +330 -0
- package/src/hooks/use-battery-status.ts +299 -0
- package/src/hooks/use-component-performance.ts +344 -0
- package/src/hooks/use-device-loading-states.ts +459 -0
- package/src/hooks/use-device.tsx +110 -0
- package/src/hooks/use-enterprise-mobile-experience.ts +488 -0
- package/src/hooks/use-form-feedback.ts +403 -0
- package/src/hooks/use-form-performance.ts +513 -0
- package/src/hooks/use-frame-rate.ts +251 -0
- package/src/hooks/use-gestures.ts +338 -0
- package/src/hooks/use-hardware-acceleration.ts +341 -0
- package/src/hooks/use-input-accessibility.ts +455 -0
- package/src/hooks/use-input-performance.ts +506 -0
- package/src/hooks/use-layout-performance.ts +319 -0
- package/src/hooks/use-loading-accessibility.ts +535 -0
- package/src/hooks/use-loading-performance.ts +473 -0
- package/src/hooks/use-memory-usage.ts +287 -0
- package/src/hooks/use-mobile-form-layout.ts +464 -0
- package/src/hooks/use-mobile-form-validation.ts +518 -0
- package/src/hooks/use-mobile-keyboard-optimization.ts +472 -0
- package/src/hooks/use-mobile-layout.ts +302 -0
- package/src/hooks/use-mobile-optimization.ts +406 -0
- package/src/hooks/use-mobile-skeleton.ts +402 -0
- package/src/hooks/use-mobile-touch.ts +414 -0
- package/src/hooks/use-performance-throttling.ts +348 -0
- package/src/hooks/use-performance.ts +316 -0
- package/src/hooks/use-reusable-architecture.ts +414 -0
- package/src/hooks/use-semantic-input-types.ts +357 -0
- package/src/hooks/use-semantic-input.ts +565 -0
- package/src/hooks/use-tablet-layout.ts +384 -0
- package/src/hooks/use-touch-friendly-input.ts +524 -0
- package/src/hooks/use-touch-friendly-interface.ts +331 -0
- package/src/hooks/use-touch-optimization.ts +375 -0
- package/src/index.ts +279 -279
- package/src/lib/utils.ts +6 -0
- package/src/themes/README.md +272 -0
- package/src/themes/ThemeContext.tsx +31 -0
- package/src/themes/ThemeProvider.tsx +232 -0
- package/src/themes/accessibility/index.ts +27 -0
- package/src/themes/accessibility.ts +259 -0
- package/src/themes/aria-patterns.ts +420 -0
- package/src/themes/base-themes.ts +55 -0
- package/src/themes/colorManager.ts +380 -0
- package/src/themes/examples/dark-theme.ts +154 -0
- package/src/themes/examples/minimal-theme.ts +108 -0
- package/src/themes/focus-management.ts +701 -0
- package/src/themes/fontLoader.ts +201 -0
- package/src/themes/high-contrast.ts +621 -0
- package/src/themes/index.ts +19 -0
- package/src/themes/inheritance.ts +227 -0
- package/src/themes/keyboard-navigation.ts +550 -0
- package/src/themes/motion-reduction.ts +662 -0
- package/src/themes/navigation.ts +238 -0
- package/src/themes/screen-reader.ts +645 -0
- package/src/themes/systemThemeDetector.ts +182 -0
- package/src/themes/themeCSSUpdater.ts +262 -0
- package/src/themes/themePersistence.ts +238 -0
- package/src/themes/themes/default.ts +586 -0
- package/src/themes/themes/harvey.ts +554 -0
- package/src/themes/themes/stan-design.ts +683 -0
- package/src/themes/types.ts +460 -0
- package/src/themes/useSystemTheme.ts +48 -0
- package/src/themes/useTheme.ts +87 -0
- package/src/themes/validation.ts +462 -0
- package/src/tokens/index.ts +34 -0
- package/src/tokens/tokenExporter.ts +397 -0
- package/src/tokens/tokenGenerator.ts +276 -0
- package/src/tokens/tokenManager.ts +248 -0
- package/src/tokens/tokenValidator.ts +543 -0
- package/src/tokens/types.ts +78 -0
- package/src/utils/bundle-analyzer.ts +260 -0
- package/src/utils/bundle-splitting.ts +483 -0
- package/src/utils/lazy-loading.ts +441 -0
- package/src/utils/performance-monitor.ts +513 -0
- package/src/utils/tree-shaking.ts +274 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
|
+
import { cn } from '../../lib/utils'
|
|
3
|
+
import { useTouchFriendlyInterface } from '../../hooks/use-touch-friendly-interface'
|
|
4
|
+
|
|
5
|
+
// Touch-Friendly Button Component
|
|
6
|
+
export interface TouchFriendlyButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
variant?: 'default' | 'secondary' | 'outline' | 'ghost' | 'destructive'
|
|
8
|
+
size?: 'sm' | 'default' | 'lg' | 'xl'
|
|
9
|
+
feedback?: 'scale' | 'ripple' | 'color' | 'none'
|
|
10
|
+
children: React.ReactNode
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const TouchFriendlyButton = forwardRef<HTMLButtonElement, TouchFriendlyButtonProps>(
|
|
14
|
+
({ className, variant = 'default', size = 'default', feedback = 'scale', children, ...props }, ref) => {
|
|
15
|
+
const { isTouchTargetCompliant, getTouchTargetSize } = useTouchFriendlyInterface({
|
|
16
|
+
minSize: 44,
|
|
17
|
+
feedback
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const baseClasses = 'touch-target touch-friendly-button touch-interaction touch-performance'
|
|
21
|
+
const feedbackClasses = {
|
|
22
|
+
scale: 'touch-feedback',
|
|
23
|
+
ripple: 'touch-ripple',
|
|
24
|
+
color: 'touch-state-hover touch-state-active',
|
|
25
|
+
none: ''
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const variantClasses = {
|
|
29
|
+
default: 'touch-friendly-button',
|
|
30
|
+
secondary: 'touch-friendly-button-secondary',
|
|
31
|
+
outline: 'touch-target touch-spacing bg-transparent border border-cs-border text-cs-text-primary hover:bg-cs-hover-bg',
|
|
32
|
+
ghost: 'touch-target touch-spacing bg-transparent text-cs-text-primary hover:bg-cs-hover-bg',
|
|
33
|
+
destructive: 'touch-target touch-spacing bg-cs-error text-white hover:bg-cs-error-hover'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const sizeClasses = {
|
|
37
|
+
sm: 'min-h-[44px] min-w-[44px] px-3 py-2 text-sm',
|
|
38
|
+
default: 'min-h-[48px] min-w-[48px] px-4 py-3 text-base',
|
|
39
|
+
lg: 'min-h-[56px] min-w-[56px] px-6 py-4 text-lg',
|
|
40
|
+
xl: 'min-h-[64px] min-w-[64px] px-8 py-5 text-xl'
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<button
|
|
45
|
+
ref={ref}
|
|
46
|
+
className={cn(
|
|
47
|
+
baseClasses,
|
|
48
|
+
feedbackClasses[feedback],
|
|
49
|
+
variantClasses[variant],
|
|
50
|
+
sizeClasses[size],
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
style={{
|
|
54
|
+
minHeight: `${getTouchTargetSize()}px`,
|
|
55
|
+
minWidth: `${getTouchTargetSize()}px`
|
|
56
|
+
}}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
{children}
|
|
60
|
+
{!isTouchTargetCompliant() && (
|
|
61
|
+
<span className="text-xs text-cs-warning ml-2">
|
|
62
|
+
⚠️ Target too small
|
|
63
|
+
</span>
|
|
64
|
+
)}
|
|
65
|
+
</button>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
TouchFriendlyButton.displayName = 'TouchFriendlyButton'
|
|
71
|
+
|
|
72
|
+
// Touch-Friendly Input Component
|
|
73
|
+
export interface TouchFriendlyInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
74
|
+
touchSize?: 'sm' | 'default' | 'lg'
|
|
75
|
+
feedback?: 'scale' | 'ripple' | 'color' | 'none'
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const TouchFriendlyInput = forwardRef<HTMLInputElement, TouchFriendlyInputProps>(
|
|
79
|
+
({ className, touchSize = 'default', feedback = 'scale', ...props }, ref) => {
|
|
80
|
+
const { getTouchTargetSize } = useTouchFriendlyInterface({
|
|
81
|
+
minSize: 44,
|
|
82
|
+
feedback
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const baseClasses = 'touch-target touch-friendly-input touch-interaction touch-performance'
|
|
86
|
+
const feedbackClasses = {
|
|
87
|
+
scale: 'touch-feedback',
|
|
88
|
+
ripple: 'touch-ripple',
|
|
89
|
+
color: 'touch-state-hover touch-state-focus',
|
|
90
|
+
none: ''
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const sizeClasses = {
|
|
94
|
+
sm: 'min-h-[44px] min-w-[44px] px-3 py-2 text-sm',
|
|
95
|
+
default: 'min-h-[48px] min-w-[48px] px-4 py-3 text-base',
|
|
96
|
+
lg: 'min-h-[56px] min-w-[56px] px-6 py-4 text-lg'
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<input
|
|
101
|
+
ref={ref}
|
|
102
|
+
className={cn(
|
|
103
|
+
baseClasses,
|
|
104
|
+
feedbackClasses[feedback],
|
|
105
|
+
sizeClasses[touchSize],
|
|
106
|
+
className
|
|
107
|
+
)}
|
|
108
|
+
style={{
|
|
109
|
+
minHeight: `${getTouchTargetSize()}px`,
|
|
110
|
+
minWidth: `${getTouchTargetSize()}px`
|
|
111
|
+
}}
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
TouchFriendlyInput.displayName = 'TouchFriendlyInput'
|
|
119
|
+
|
|
120
|
+
// Touch-Friendly Card Component
|
|
121
|
+
export interface TouchFriendlyCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
122
|
+
size?: 'sm' | 'default' | 'lg'
|
|
123
|
+
feedback?: 'scale' | 'ripple' | 'color' | 'none'
|
|
124
|
+
interactive?: boolean
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const TouchFriendlyCard = forwardRef<HTMLDivElement, TouchFriendlyCardProps>(
|
|
128
|
+
({ className, size = 'default', feedback = 'scale', interactive = false, children, ...props }, ref) => {
|
|
129
|
+
const { isTouchTargetCompliant, getTouchTargetSize } = useTouchFriendlyInterface({
|
|
130
|
+
minSize: 44,
|
|
131
|
+
feedback
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
const baseClasses = 'touch-friendly-card touch-interaction touch-performance'
|
|
135
|
+
const feedbackClasses = interactive ? {
|
|
136
|
+
scale: 'touch-feedback',
|
|
137
|
+
ripple: 'touch-ripple',
|
|
138
|
+
color: 'touch-state-hover touch-state-active',
|
|
139
|
+
none: ''
|
|
140
|
+
} : { scale: '', ripple: '', color: '', none: '' }
|
|
141
|
+
|
|
142
|
+
const sizeClasses = {
|
|
143
|
+
sm: 'min-h-[44px] min-w-[44px] p-3',
|
|
144
|
+
default: 'min-h-[48px] min-w-[48px] p-4',
|
|
145
|
+
lg: 'min-h-[56px] min-w-[56px] p-6'
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const interactiveClasses = interactive ? 'cursor-pointer' : ''
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<div
|
|
152
|
+
ref={ref}
|
|
153
|
+
className={cn(
|
|
154
|
+
baseClasses,
|
|
155
|
+
feedbackClasses[feedback],
|
|
156
|
+
sizeClasses[size],
|
|
157
|
+
interactiveClasses,
|
|
158
|
+
className
|
|
159
|
+
)}
|
|
160
|
+
style={{
|
|
161
|
+
minHeight: `${getTouchTargetSize()}px`,
|
|
162
|
+
minWidth: `${getTouchTargetSize()}px`
|
|
163
|
+
}}
|
|
164
|
+
{...props}
|
|
165
|
+
>
|
|
166
|
+
{children}
|
|
167
|
+
{interactive && !isTouchTargetCompliant() && (
|
|
168
|
+
<div className="text-xs text-cs-warning mt-2">
|
|
169
|
+
⚠️ Interactive target too small
|
|
170
|
+
</div>
|
|
171
|
+
)}
|
|
172
|
+
</div>
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
TouchFriendlyCard.displayName = 'TouchFriendlyCard'
|
|
178
|
+
|
|
179
|
+
// Touch-Friendly Toggle Component
|
|
180
|
+
export interface TouchFriendlyToggleProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
181
|
+
checked?: boolean
|
|
182
|
+
onCheckedChange?: (checked: boolean) => void
|
|
183
|
+
size?: 'sm' | 'default' | 'lg'
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export const TouchFriendlyToggle = forwardRef<HTMLButtonElement, TouchFriendlyToggleProps>(
|
|
187
|
+
({ className, checked = false, onCheckedChange, size = 'default', ...props }, ref) => {
|
|
188
|
+
const { isTouchTargetCompliant, getTouchTargetSize } = useTouchFriendlyInterface({
|
|
189
|
+
minSize: 44,
|
|
190
|
+
feedback: 'scale'
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
const baseClasses = 'touch-target touch-interaction touch-performance touch-feedback'
|
|
194
|
+
const sizeClasses = {
|
|
195
|
+
sm: 'min-h-[44px] min-w-[44px]',
|
|
196
|
+
default: 'min-h-[48px] min-w-[48px]',
|
|
197
|
+
lg: 'min-h-[56px] min-w-[56px]'
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const handleClick = () => {
|
|
201
|
+
onCheckedChange?.(!checked)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
<button
|
|
206
|
+
ref={ref}
|
|
207
|
+
type="button"
|
|
208
|
+
role="switch"
|
|
209
|
+
aria-checked={checked}
|
|
210
|
+
className={cn(
|
|
211
|
+
baseClasses,
|
|
212
|
+
sizeClasses[size],
|
|
213
|
+
'relative inline-flex items-center justify-center rounded-full transition-colors',
|
|
214
|
+
checked ? 'bg-cs-primary' : 'bg-cs-border',
|
|
215
|
+
'focus:outline-none focus:ring-2 focus:ring-cs-primary focus:ring-offset-2',
|
|
216
|
+
className
|
|
217
|
+
)}
|
|
218
|
+
style={{
|
|
219
|
+
minHeight: `${getTouchTargetSize()}px`,
|
|
220
|
+
minWidth: `${getTouchTargetSize()}px`
|
|
221
|
+
}}
|
|
222
|
+
onClick={handleClick}
|
|
223
|
+
{...props}
|
|
224
|
+
>
|
|
225
|
+
<span
|
|
226
|
+
className={cn(
|
|
227
|
+
'inline-block rounded-full bg-white shadow transform transition-transform',
|
|
228
|
+
size === 'sm' ? 'w-5 h-5' : size === 'default' ? 'w-6 h-6' : 'w-7 h-7',
|
|
229
|
+
checked ? 'translate-x-full' : 'translate-x-0'
|
|
230
|
+
)}
|
|
231
|
+
/>
|
|
232
|
+
{!isTouchTargetCompliant() && (
|
|
233
|
+
<span className="text-xs text-cs-warning absolute -bottom-6 left-1/2 transform -translate-x-1/2">
|
|
234
|
+
⚠️ Target too small
|
|
235
|
+
</span>
|
|
236
|
+
)}
|
|
237
|
+
</button>
|
|
238
|
+
)
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
TouchFriendlyToggle.displayName = 'TouchFriendlyToggle'
|
|
243
|
+
|
|
244
|
+
// Touch-Friendly Slider Component
|
|
245
|
+
export interface TouchFriendlySliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
246
|
+
touchSize?: 'sm' | 'default' | 'lg'
|
|
247
|
+
showValue?: boolean
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export const TouchFriendlySlider = forwardRef<HTMLInputElement, TouchFriendlySliderProps>(
|
|
251
|
+
({ className, touchSize = 'default', showValue = true, ...props }, ref) => {
|
|
252
|
+
const { isTouchTargetCompliant, getTouchTargetSize } = useTouchFriendlyInterface({
|
|
253
|
+
minSize: 44,
|
|
254
|
+
feedback: 'scale'
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
const baseClasses = 'touch-target touch-interaction touch-performance touch-feedback'
|
|
258
|
+
const sizeClasses = {
|
|
259
|
+
sm: 'min-h-[44px] min-w-[44px]',
|
|
260
|
+
default: 'min-h-[48px] min-w-[48px]',
|
|
261
|
+
lg: 'min-h-[56px] min-w-[56px]'
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return (
|
|
265
|
+
<div className="flex flex-col items-center space-y-2">
|
|
266
|
+
<input
|
|
267
|
+
ref={ref}
|
|
268
|
+
type="range"
|
|
269
|
+
className={cn(
|
|
270
|
+
baseClasses,
|
|
271
|
+
sizeClasses[touchSize],
|
|
272
|
+
'w-full h-2 bg-cs-border rounded-lg appearance-none cursor-pointer',
|
|
273
|
+
'focus:outline-none focus:ring-2 focus:ring-cs-primary',
|
|
274
|
+
className
|
|
275
|
+
)}
|
|
276
|
+
style={{
|
|
277
|
+
minHeight: `${getTouchTargetSize()}px`
|
|
278
|
+
}}
|
|
279
|
+
{...props}
|
|
280
|
+
/>
|
|
281
|
+
{showValue && (
|
|
282
|
+
<span className="text-sm text-cs-text-secondary">
|
|
283
|
+
{props.value || props.defaultValue || 0}
|
|
284
|
+
</span>
|
|
285
|
+
)}
|
|
286
|
+
{!isTouchTargetCompliant() && (
|
|
287
|
+
<span className="text-xs text-cs-warning">
|
|
288
|
+
⚠️ Slider target too small
|
|
289
|
+
</span>
|
|
290
|
+
)}
|
|
291
|
+
</div>
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
TouchFriendlySlider.displayName = 'TouchFriendlySlider'
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// Performance monitoring hooks
|
|
2
|
+
export { usePerformance } from './use-performance'
|
|
3
|
+
export type {
|
|
4
|
+
PerformanceMetrics,
|
|
5
|
+
PerformanceThresholds,
|
|
6
|
+
PerformanceCallbacks,
|
|
7
|
+
PerformanceOptions
|
|
8
|
+
} from './use-performance'
|
|
9
|
+
|
|
10
|
+
export { useFrameRate } from './use-frame-rate'
|
|
11
|
+
export type {
|
|
12
|
+
FrameRateMetrics,
|
|
13
|
+
FrameRateThresholds,
|
|
14
|
+
FrameRateCallbacks,
|
|
15
|
+
FrameRateOptions
|
|
16
|
+
} from './use-frame-rate'
|
|
17
|
+
|
|
18
|
+
export { useMemoryUsage } from './use-memory-usage'
|
|
19
|
+
export type {
|
|
20
|
+
MemoryMetrics,
|
|
21
|
+
MemoryThresholds,
|
|
22
|
+
MemoryCallbacks,
|
|
23
|
+
MemoryOptions
|
|
24
|
+
} from './use-memory-usage'
|
|
25
|
+
|
|
26
|
+
export { useBatteryStatus } from './use-battery-status'
|
|
27
|
+
export type {
|
|
28
|
+
BatteryMetrics,
|
|
29
|
+
BatteryThresholds,
|
|
30
|
+
BatteryCallbacks,
|
|
31
|
+
BatteryOptions
|
|
32
|
+
} from './use-battery-status'
|
|
33
|
+
|
|
34
|
+
export { usePerformanceThrottling } from './use-performance-throttling'
|
|
35
|
+
export type {
|
|
36
|
+
PerformanceThrottlingConfig,
|
|
37
|
+
PerformanceThrottlingCallbacks
|
|
38
|
+
} from './use-performance-throttling'
|
|
39
|
+
|
|
40
|
+
// Touch optimization & gesture support hooks
|
|
41
|
+
export { useGestures, useSwipeGesture, usePinchGesture, useTapGesture, useLongPressGesture } from './use-gestures'
|
|
42
|
+
export type {
|
|
43
|
+
GestureConfig,
|
|
44
|
+
SwipeGesture,
|
|
45
|
+
PinchGesture,
|
|
46
|
+
GestureCallbacks,
|
|
47
|
+
GestureState
|
|
48
|
+
} from './use-gestures'
|
|
49
|
+
|
|
50
|
+
export { useTouchOptimization, useBasicTouchOptimization, useBatteryAwareTouchOptimization } from './use-touch-optimization'
|
|
51
|
+
export type {
|
|
52
|
+
TouchOptimizationConfig,
|
|
53
|
+
TouchPerformanceMetrics,
|
|
54
|
+
TouchOptimizationCallbacks,
|
|
55
|
+
TouchOptimizationState
|
|
56
|
+
} from './use-touch-optimization'
|
|
57
|
+
|
|
58
|
+
export { useMobileTouch, useBasicMobileTouch, useEnhancedMobileTouch } from './use-mobile-touch'
|
|
59
|
+
export type {
|
|
60
|
+
MobileTouchConfig,
|
|
61
|
+
TouchFeedbackState,
|
|
62
|
+
GestureHint,
|
|
63
|
+
MobileTouchCallbacks,
|
|
64
|
+
MobileTouchState
|
|
65
|
+
} from './use-mobile-touch'
|
|
66
|
+
|
|
67
|
+
// Animation hooks
|
|
68
|
+
export {
|
|
69
|
+
useAnimationProfile,
|
|
70
|
+
useAnimationDuration,
|
|
71
|
+
useAnimationEasing,
|
|
72
|
+
useAnimationClasses,
|
|
73
|
+
usePerformanceMode
|
|
74
|
+
} from './use-animation-profile'
|
|
75
|
+
export type {
|
|
76
|
+
AnimationProfile,
|
|
77
|
+
PerformanceMetrics as AnimationPerformanceMetrics
|
|
78
|
+
} from './use-animation-profile'
|
|
79
|
+
|
|
80
|
+
// Device hook
|
|
81
|
+
export { useDevice } from './use-device'
|
|
82
|
+
export type { DeviceInfo } from './use-device'
|
|
83
|
+
|
|
84
|
+
// Battery-conscious animation hooks
|
|
85
|
+
export { useBatteryAnimations } from './use-battery-animations'
|
|
86
|
+
export type {
|
|
87
|
+
BatteryAnimationConfig,
|
|
88
|
+
BatteryAnimationState,
|
|
89
|
+
BatteryAnimationCallbacks
|
|
90
|
+
} from './use-battery-animations'
|
|
91
|
+
|
|
92
|
+
// Hardware acceleration hooks
|
|
93
|
+
export { useHardwareAcceleration } from './use-hardware-acceleration'
|
|
94
|
+
export type {
|
|
95
|
+
GPUInfo,
|
|
96
|
+
HardwareAccelerationMetrics,
|
|
97
|
+
HardwareAccelerationConfig,
|
|
98
|
+
HardwareAccelerationCallbacks
|
|
99
|
+
} from './use-hardware-acceleration'
|
|
100
|
+
|
|
101
|
+
// Battery optimization hooks
|
|
102
|
+
export { useBatteryOptimization } from './use-battery-optimization'
|
|
103
|
+
export type {
|
|
104
|
+
BatteryStatus,
|
|
105
|
+
BatteryOptimizationConfig,
|
|
106
|
+
BatteryOptimizationCallbacks
|
|
107
|
+
} from './use-battery-optimization'
|
|
108
|
+
|
|
109
|
+
// Advanced component architecture hooks
|
|
110
|
+
export { useAdvancedPatterns } from './use-advanced-patterns'
|
|
111
|
+
export type {
|
|
112
|
+
AdvancedPatternsConfig,
|
|
113
|
+
AdvancedPatternsCallbacks,
|
|
114
|
+
CompoundComponentContext,
|
|
115
|
+
RenderPropsConfig,
|
|
116
|
+
HigherOrderComponentConfig
|
|
117
|
+
} from './use-advanced-patterns'
|
|
118
|
+
|
|
119
|
+
export { useComponentPerformance } from './use-component-performance'
|
|
120
|
+
export type {
|
|
121
|
+
ComponentPerformanceConfig,
|
|
122
|
+
ComponentPerformanceCallbacks,
|
|
123
|
+
PerformanceMetrics as ComponentPerformanceMetrics
|
|
124
|
+
} from './use-component-performance'
|
|
125
|
+
|
|
126
|
+
export { useMobileOptimization } from './use-mobile-optimization'
|
|
127
|
+
export type {
|
|
128
|
+
MobileOptimizationConfig,
|
|
129
|
+
MobileOptimizationCallbacks,
|
|
130
|
+
MobileOptimizationState
|
|
131
|
+
} from './use-mobile-optimization'
|
|
132
|
+
|
|
133
|
+
export { useReusableArchitecture } from './use-reusable-architecture'
|
|
134
|
+
export type {
|
|
135
|
+
ReusableArchitectureConfig,
|
|
136
|
+
ReusableArchitectureCallbacks,
|
|
137
|
+
ComponentTemplate,
|
|
138
|
+
SharedPattern,
|
|
139
|
+
SharedStyle,
|
|
140
|
+
SharedBehavior
|
|
141
|
+
} from './use-reusable-architecture'
|
|
142
|
+
|
|
143
|
+
export { useAccessibilitySupport } from './use-accessibility-support'
|
|
144
|
+
export type {
|
|
145
|
+
AccessibilitySupportConfig,
|
|
146
|
+
AccessibilitySupportCallbacks,
|
|
147
|
+
AccessibilityState,
|
|
148
|
+
AccessibilityFeatures
|
|
149
|
+
} from './use-accessibility-support'
|
|
150
|
+
|
|
151
|
+
// Mobile skeleton and loading states hooks
|
|
152
|
+
export { default as useMobileSkeleton } from './use-mobile-skeleton'
|
|
153
|
+
export type {
|
|
154
|
+
MobileSkeletonConfig,
|
|
155
|
+
SkeletonVariant,
|
|
156
|
+
DeviceLoadingState,
|
|
157
|
+
MobileSkeletonCallbacks
|
|
158
|
+
} from './use-mobile-skeleton'
|
|
159
|
+
|
|
160
|
+
export { default as useDeviceLoadingStates } from './use-device-loading-states'
|
|
161
|
+
export type {
|
|
162
|
+
DeviceLoadingStatesConfig,
|
|
163
|
+
LoadingState,
|
|
164
|
+
DeviceSpecificState,
|
|
165
|
+
DeviceLoadingStatesCallbacks
|
|
166
|
+
} from './use-device-loading-states'
|
|
167
|
+
|
|
168
|
+
export { default as useLoadingPerformance } from './use-loading-performance'
|
|
169
|
+
export type {
|
|
170
|
+
LoadingPerformanceConfig,
|
|
171
|
+
PerformanceMetrics as LoadingPerformanceMetrics,
|
|
172
|
+
OptimizationStrategy as LoadingOptimizationStrategy,
|
|
173
|
+
LoadingPerformanceCallbacks
|
|
174
|
+
} from './use-loading-performance'
|
|
175
|
+
|
|
176
|
+
export { default as useBatteryConsciousLoading } from './use-battery-conscious-loading'
|
|
177
|
+
export type {
|
|
178
|
+
BatteryConsciousLoadingConfig,
|
|
179
|
+
BatteryState as BatteryLoadingState,
|
|
180
|
+
LoadingOptimization,
|
|
181
|
+
BatteryConsciousLoadingCallbacks
|
|
182
|
+
} from './use-battery-conscious-loading'
|
|
183
|
+
|
|
184
|
+
export { default as useLoadingAccessibility } from './use-loading-accessibility'
|
|
185
|
+
export type {
|
|
186
|
+
LoadingAccessibilityConfig,
|
|
187
|
+
AccessibilityFeature,
|
|
188
|
+
AccessibilityState as LoadingAccessibilityState,
|
|
189
|
+
LoadingAccessibilityCallbacks
|
|
190
|
+
} from './use-loading-accessibility'
|