@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.8 → 0.2.10
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/components/ui/accessibility-demo.esm.js +30 -24
- package/dist/components/ui/accessibility-demo.js +30 -24
- package/dist/components/ui/advanced-component-architecture-demo.esm.js +235 -179
- package/dist/components/ui/advanced-component-architecture-demo.js +235 -179
- package/dist/components/ui/advanced-transition-system-demo.esm.js +110 -64
- package/dist/components/ui/advanced-transition-system-demo.js +110 -64
- package/dist/components/ui/advanced-transition-system.esm.js +166 -122
- package/dist/components/ui/advanced-transition-system.js +166 -122
- package/dist/components/ui/animation/animated-container.esm.js +52 -29
- package/dist/components/ui/animation/animated-container.js +52 -29
- package/dist/components/ui/animation/staggered-container.esm.js +18 -9
- package/dist/components/ui/animation/staggered-container.js +18 -9
- package/dist/components/ui/animation-demo.esm.js +67 -35
- package/dist/components/ui/animation-demo.js +67 -35
- package/dist/components/ui/badge.esm.js +9 -6
- package/dist/components/ui/badge.js +9 -6
- package/dist/components/ui/battery-conscious-animation-demo.esm.js +122 -87
- package/dist/components/ui/battery-conscious-animation-demo.js +122 -87
- package/dist/components/ui/border-radius-shadow-demo.esm.js +23 -12
- package/dist/components/ui/border-radius-shadow-demo.js +23 -12
- package/dist/components/ui/button.esm.js +8 -2
- package/dist/components/ui/button.js +8 -2
- package/dist/components/ui/card.esm.js +33 -8
- package/dist/components/ui/card.js +33 -8
- package/dist/components/ui/checkbox.esm.js +3 -3
- package/dist/components/ui/checkbox.js +3 -3
- package/dist/components/ui/color-preview.esm.js +68 -45
- package/dist/components/ui/color-preview.js +68 -45
- package/dist/components/ui/data-display/chart.esm.js +112 -84
- package/dist/components/ui/data-display/chart.js +112 -84
- package/dist/components/ui/data-display/data-grid-simple.esm.js +1 -1
- package/dist/components/ui/data-display/data-grid-simple.js +1 -1
- package/dist/components/ui/data-display/data-grid.esm.js +80 -67
- package/dist/components/ui/data-display/data-grid.js +80 -67
- package/dist/components/ui/data-display/list.esm.js +53 -45
- package/dist/components/ui/data-display/list.js +53 -45
- package/dist/components/ui/data-display/table.esm.js +62 -54
- package/dist/components/ui/data-display/table.js +62 -54
- package/dist/components/ui/data-display/timeline.esm.js +39 -34
- package/dist/components/ui/data-display/timeline.js +39 -34
- package/dist/components/ui/data-display/tree.esm.js +116 -84
- package/dist/components/ui/data-display/tree.js +116 -84
- package/dist/components/ui/data-display/types.esm.js +389 -364
- package/dist/components/ui/data-display/types.js +389 -364
- package/dist/components/ui/enterprise-mobile-experience-demo.esm.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience-demo.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience.esm.js +124 -73
- package/dist/components/ui/enterprise-mobile-experience.js +124 -73
- package/dist/components/ui/feedback/alert.esm.js +22 -15
- package/dist/components/ui/feedback/alert.js +22 -15
- package/dist/components/ui/feedback/progress.esm.js +47 -24
- package/dist/components/ui/feedback/progress.js +47 -24
- package/dist/components/ui/feedback/skeleton.esm.js +39 -29
- package/dist/components/ui/feedback/skeleton.js +39 -29
- package/dist/components/ui/feedback/toast.esm.js +62 -38
- package/dist/components/ui/feedback/toast.js +62 -38
- package/dist/components/ui/feedback/types.esm.js +83 -83
- package/dist/components/ui/feedback/types.js +83 -83
- package/dist/components/ui/font-preview.esm.js +41 -39
- package/dist/components/ui/font-preview.js +41 -39
- package/dist/components/ui/form-demo.esm.js +150 -113
- package/dist/components/ui/form-demo.js +150 -113
- package/dist/components/ui/hardware-acceleration-demo.esm.js +137 -87
- package/dist/components/ui/hardware-acceleration-demo.js +137 -87
- package/dist/components/ui/input.esm.js +4 -1
- package/dist/components/ui/input.js +4 -1
- package/dist/components/ui/layout-demo.esm.js +81 -56
- package/dist/components/ui/layout-demo.js +81 -56
- package/dist/components/ui/layouts/adaptive-layout.esm.js +27 -8
- package/dist/components/ui/layouts/adaptive-layout.js +27 -8
- package/dist/components/ui/layouts/desktop-layout.esm.js +39 -19
- package/dist/components/ui/layouts/desktop-layout.js +39 -19
- package/dist/components/ui/layouts/mobile-layout.esm.js +19 -9
- package/dist/components/ui/layouts/mobile-layout.js +19 -9
- package/dist/components/ui/layouts/tablet-layout.esm.js +28 -14
- package/dist/components/ui/layouts/tablet-layout.js +28 -14
- package/dist/components/ui/mobile-form-validation.esm.js +120 -87
- package/dist/components/ui/mobile-form-validation.js +120 -87
- package/dist/components/ui/mobile-input-demo.esm.js +19 -13
- package/dist/components/ui/mobile-input-demo.js +19 -13
- package/dist/components/ui/mobile-input.esm.js +185 -120
- package/dist/components/ui/mobile-input.js +185 -120
- package/dist/components/ui/mobile-skeleton-loading-demo.esm.js +128 -111
- package/dist/components/ui/mobile-skeleton-loading-demo.js +128 -111
- package/dist/components/ui/navigation/breadcrumb.esm.js +17 -14
- package/dist/components/ui/navigation/breadcrumb.js +17 -14
- package/dist/components/ui/navigation/index.esm.js +23 -1
- package/dist/components/ui/navigation/index.js +23 -1
- package/dist/components/ui/navigation/menu.esm.js +49 -35
- package/dist/components/ui/navigation/menu.js +49 -35
- package/dist/components/ui/navigation/navigation-demo.esm.js +81 -74
- package/dist/components/ui/navigation/navigation-demo.js +81 -74
- package/dist/components/ui/navigation/pagination.esm.js +62 -50
- package/dist/components/ui/navigation/pagination.js +62 -50
- package/dist/components/ui/navigation/sidebar.esm.js +56 -42
- package/dist/components/ui/navigation/sidebar.js +56 -42
- package/dist/components/ui/navigation/stepper.esm.js +34 -23
- package/dist/components/ui/navigation/stepper.js +34 -23
- package/dist/components/ui/navigation/tabs.esm.js +32 -21
- package/dist/components/ui/navigation/tabs.js +32 -21
- package/dist/components/ui/navigation/types.esm.js +196 -195
- package/dist/components/ui/navigation/types.js +196 -195
- package/dist/components/ui/overlay/backdrop.esm.js +17 -16
- package/dist/components/ui/overlay/backdrop.js +17 -16
- package/dist/components/ui/overlay/focus-manager.esm.js +21 -19
- package/dist/components/ui/overlay/focus-manager.js +21 -19
- package/dist/components/ui/overlay/index.esm.js +22 -2
- package/dist/components/ui/overlay/index.js +22 -2
- package/dist/components/ui/overlay/modal.esm.js +38 -34
- package/dist/components/ui/overlay/modal.js +38 -34
- package/dist/components/ui/overlay/overlay-manager.esm.js +25 -20
- package/dist/components/ui/overlay/overlay-manager.js +25 -20
- package/dist/components/ui/overlay/popover.esm.js +74 -58
- package/dist/components/ui/overlay/popover.js +74 -58
- package/dist/components/ui/overlay/portal.esm.js +7 -7
- package/dist/components/ui/overlay/portal.js +7 -7
- package/dist/components/ui/overlay/tooltip.esm.js +54 -39
- package/dist/components/ui/overlay/tooltip.js +54 -39
- package/dist/components/ui/overlay/types.esm.js +132 -131
- package/dist/components/ui/overlay/types.js +132 -131
- package/dist/components/ui/performance-demo.esm.js +135 -88
- package/dist/components/ui/performance-demo.js +135 -88
- package/dist/components/ui/semantic-input-system-demo.esm.js +117 -80
- package/dist/components/ui/semantic-input-system-demo.js +117 -80
- package/dist/components/ui/theme-customizer.esm.js +84 -52
- package/dist/components/ui/theme-customizer.js +84 -52
- package/dist/components/ui/theme-preview.esm.js +95 -43
- package/dist/components/ui/theme-preview.js +95 -43
- package/dist/components/ui/theme-switcher.esm.js +70 -44
- package/dist/components/ui/theme-switcher.js +70 -44
- package/dist/components/ui/theme-toggle.esm.js +3 -3
- package/dist/components/ui/theme-toggle.js +3 -3
- package/dist/components/ui/token-demo.esm.js +33 -21
- package/dist/components/ui/token-demo.js +33 -21
- package/dist/components/ui/touch-demo.esm.js +102 -73
- package/dist/components/ui/touch-demo.js +102 -73
- package/dist/components/ui/touch-friendly-interface-demo.esm.js +102 -64
- package/dist/components/ui/touch-friendly-interface-demo.js +102 -64
- package/dist/components/ui/touch-friendly-interface.esm.js +85 -61
- package/dist/components/ui/touch-friendly-interface.js +85 -61
- package/dist/hooks/use-accessibility-support.esm.js +115 -85
- package/dist/hooks/use-accessibility-support.js +115 -85
- package/dist/hooks/use-adaptive-layout.esm.js +56 -33
- package/dist/hooks/use-adaptive-layout.js +56 -33
- package/dist/hooks/use-advanced-patterns.esm.js +57 -42
- package/dist/hooks/use-advanced-patterns.js +57 -42
- package/dist/hooks/use-advanced-transition-system.esm.js +112 -71
- package/dist/hooks/use-advanced-transition-system.js +112 -71
- package/dist/hooks/use-animation-profile.esm.js +63 -34
- package/dist/hooks/use-animation-profile.js +63 -34
- package/dist/hooks/use-battery-animations.esm.js +80 -55
- package/dist/hooks/use-battery-animations.js +80 -55
- package/dist/hooks/use-battery-conscious-loading.esm.js +166 -123
- package/dist/hooks/use-battery-conscious-loading.js +166 -123
- package/dist/hooks/use-battery-optimization.esm.js +78 -55
- package/dist/hooks/use-battery-optimization.js +78 -55
- package/dist/hooks/use-battery-status.esm.js +73 -51
- package/dist/hooks/use-battery-status.js +73 -51
- package/dist/hooks/use-component-performance.esm.js +62 -47
- package/dist/hooks/use-component-performance.js +62 -47
- package/dist/hooks/use-device-loading-states.esm.js +152 -109
- package/dist/hooks/use-device-loading-states.js +152 -109
- package/dist/hooks/use-device.esm.js +25 -14
- package/dist/hooks/use-device.js +25 -14
- package/dist/hooks/use-enterprise-mobile-experience.esm.js +137 -88
- package/dist/hooks/use-enterprise-mobile-experience.js +137 -88
- package/dist/hooks/use-form-feedback.esm.js +124 -81
- package/dist/hooks/use-form-feedback.js +124 -81
- package/dist/hooks/use-form-performance.esm.js +127 -92
- package/dist/hooks/use-form-performance.js +127 -92
- package/dist/hooks/use-frame-rate.esm.js +56 -37
- package/dist/hooks/use-frame-rate.js +56 -37
- package/dist/hooks/use-gestures.esm.js +96 -72
- package/dist/hooks/use-gestures.js +96 -72
- package/dist/hooks/use-hardware-acceleration.esm.js +65 -37
- package/dist/hooks/use-hardware-acceleration.js +65 -37
- package/dist/hooks/use-input-accessibility.esm.js +157 -119
- package/dist/hooks/use-input-accessibility.js +157 -119
- package/dist/hooks/use-input-performance.esm.js +139 -104
- package/dist/hooks/use-input-performance.js +139 -104
- package/dist/hooks/use-layout-performance.esm.js +50 -29
- package/dist/hooks/use-layout-performance.js +50 -29
- package/dist/hooks/use-loading-accessibility.esm.js +209 -169
- package/dist/hooks/use-loading-accessibility.js +209 -169
- package/dist/hooks/use-loading-performance.esm.js +117 -93
- package/dist/hooks/use-loading-performance.js +117 -93
- package/dist/hooks/use-memory-usage.esm.js +57 -38
- package/dist/hooks/use-memory-usage.js +57 -38
- package/dist/hooks/use-mobile-form-layout.esm.js +111 -74
- package/dist/hooks/use-mobile-form-layout.js +111 -74
- package/dist/hooks/use-mobile-form-validation.esm.js +211 -144
- package/dist/hooks/use-mobile-form-validation.js +211 -144
- package/dist/hooks/use-mobile-keyboard-optimization.esm.js +154 -113
- package/dist/hooks/use-mobile-keyboard-optimization.js +154 -113
- package/dist/hooks/use-mobile-layout.esm.js +73 -51
- package/dist/hooks/use-mobile-layout.js +73 -51
- package/dist/hooks/use-mobile-optimization.esm.js +72 -44
- package/dist/hooks/use-mobile-optimization.js +72 -44
- package/dist/hooks/use-mobile-skeleton.esm.js +97 -64
- package/dist/hooks/use-mobile-skeleton.js +97 -64
- package/dist/hooks/use-mobile-touch.esm.js +128 -93
- package/dist/hooks/use-mobile-touch.js +128 -93
- package/dist/hooks/use-performance-throttling.esm.js +72 -48
- package/dist/hooks/use-performance-throttling.js +72 -48
- package/dist/hooks/use-performance.esm.js +90 -52
- package/dist/hooks/use-performance.js +90 -52
- package/dist/hooks/use-reusable-architecture.esm.js +94 -65
- package/dist/hooks/use-reusable-architecture.js +94 -65
- package/dist/hooks/use-semantic-input-types.esm.js +166 -124
- package/dist/hooks/use-semantic-input-types.js +166 -124
- package/dist/hooks/use-semantic-input.esm.js +178 -126
- package/dist/hooks/use-semantic-input.js +178 -126
- package/dist/hooks/use-tablet-layout.esm.js +67 -38
- package/dist/hooks/use-tablet-layout.js +67 -38
- package/dist/hooks/use-touch-friendly-input.esm.js +193 -149
- package/dist/hooks/use-touch-friendly-input.js +193 -149
- package/dist/hooks/use-touch-friendly-interface.esm.js +99 -67
- package/dist/hooks/use-touch-friendly-interface.js +99 -67
- package/dist/hooks/use-touch-optimization.esm.js +99 -72
- package/dist/hooks/use-touch-optimization.js +99 -72
- package/dist/index.esm.js +289 -280
- package/dist/index.js +289 -280
- package/dist/lib/utils.esm.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/plugins/theme-css-generator.esm.js +104 -55
- package/dist/plugins/theme-css-generator.js +104 -55
- package/dist/provider.esm.js +4 -4
- package/dist/provider.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/theme.esm.js +633 -468
- package/dist/theme.js +633 -468
- package/dist/themes/ThemeContext.esm.js +15 -15
- package/dist/themes/ThemeContext.js +15 -15
- package/dist/themes/ThemeProvider.esm.js +25 -22
- package/dist/themes/ThemeProvider.js +25 -22
- package/dist/themes/accessibility.esm.js +147 -108
- package/dist/themes/accessibility.js +147 -108
- package/dist/themes/aria-patterns.esm.js +198 -162
- package/dist/themes/aria-patterns.js +198 -162
- package/dist/themes/base-themes.esm.js +14 -11
- package/dist/themes/base-themes.js +14 -11
- package/dist/themes/colorManager.esm.js +101 -83
- package/dist/themes/colorManager.js +101 -83
- package/dist/themes/examples/dark-theme.esm.js +133 -103
- package/dist/themes/examples/dark-theme.js +133 -103
- package/dist/themes/examples/minimal-theme.esm.js +83 -61
- package/dist/themes/examples/minimal-theme.js +83 -61
- package/dist/themes/focus-management.esm.js +202 -143
- package/dist/themes/focus-management.js +202 -143
- package/dist/themes/fontLoader.esm.js +28 -19
- package/dist/themes/fontLoader.js +28 -19
- package/dist/themes/high-contrast.esm.js +152 -104
- package/dist/themes/high-contrast.js +152 -104
- package/dist/themes/inheritance.esm.js +35 -27
- package/dist/themes/inheritance.js +35 -27
- package/dist/themes/keyboard-navigation.esm.js +152 -123
- package/dist/themes/keyboard-navigation.js +152 -123
- package/dist/themes/motion-reduction.esm.js +193 -133
- package/dist/themes/motion-reduction.js +193 -133
- package/dist/themes/navigation.esm.js +146 -146
- package/dist/themes/navigation.js +146 -146
- package/dist/themes/screen-reader.esm.js +159 -94
- package/dist/themes/screen-reader.js +159 -94
- package/dist/themes/systemThemeDetector.esm.js +42 -34
- package/dist/themes/systemThemeDetector.js +42 -34
- package/dist/themes/themeCSSUpdater.esm.js +21 -9
- package/dist/themes/themeCSSUpdater.js +21 -9
- package/dist/themes/themePersistence.esm.js +68 -47
- package/dist/themes/themePersistence.js +68 -47
- package/dist/themes/themes/stan-design.esm.js +633 -468
- package/dist/themes/themes/stan-design.js +633 -468
- package/dist/themes/types.esm.js +301 -287
- package/dist/themes/types.js +301 -287
- package/dist/themes/useSystemTheme.esm.js +4 -4
- package/dist/themes/useSystemTheme.js +4 -4
- package/dist/themes/useTheme.esm.js +4 -4
- package/dist/themes/useTheme.js +4 -4
- package/dist/themes/validation.esm.js +128 -77
- package/dist/themes/validation.js +128 -77
- package/dist/tokens/index.esm.js +15 -4
- package/dist/tokens/index.js +15 -4
- package/dist/tokens/tokenExporter.esm.js +87 -61
- package/dist/tokens/tokenExporter.js +87 -61
- package/dist/tokens/tokenGenerator.esm.js +86 -77
- package/dist/tokens/tokenGenerator.js +86 -77
- package/dist/tokens/tokenManager.esm.js +64 -51
- package/dist/tokens/tokenManager.js +64 -51
- package/dist/tokens/tokenValidator.esm.js +193 -147
- package/dist/tokens/tokenValidator.js +193 -147
- package/dist/tokens/types.esm.js +49 -35
- package/dist/tokens/types.js +49 -35
- package/dist/utils/bundle-analyzer.esm.js +83 -65
- package/dist/utils/bundle-analyzer.js +83 -65
- package/dist/utils/bundle-splitting.esm.js +142 -117
- package/dist/utils/bundle-splitting.js +142 -117
- package/dist/utils/lazy-loading.esm.js +132 -106
- package/dist/utils/lazy-loading.js +132 -106
- package/dist/utils/performance-monitor.esm.js +170 -129
- package/dist/utils/performance-monitor.js +170 -129
- package/dist/utils/tree-shaking.esm.js +69 -61
- package/dist/utils/tree-shaking.js +69 -61
- package/package.json +1 -1
- package/src/index.ts +146 -146
|
@@ -11,17 +11,27 @@ import { useSemanticInput, InputType } from '../../hooks/use-semantic-input'
|
|
|
11
11
|
import { useFormPerformance } from '../../hooks/use-form-performance'
|
|
12
12
|
|
|
13
13
|
export interface MobileFormValidationProps {
|
|
14
|
-
title
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
title?: string
|
|
15
|
+
description?: string
|
|
16
|
+
fields: Array<{
|
|
17
|
+
name: string
|
|
18
|
+
label: string
|
|
19
|
+
type: InputType
|
|
20
|
+
placeholder?: string
|
|
21
|
+
rules: ValidationRule[]
|
|
22
|
+
initialValue?: any
|
|
23
|
+
}>
|
|
24
|
+
onSubmit?: (formData: Record<string, any>) => void
|
|
25
|
+
onValidationChange?: (isValid: boolean) => void
|
|
26
|
+
className?: string
|
|
27
|
+
enableEnhancedFeatures?: boolean
|
|
28
|
+
}
|
|
19
29
|
|
|
20
30
|
export interface MobileFormValidationRef {
|
|
21
|
-
submit) => Promise<{ success; data, any>; errors] }>
|
|
22
|
-
reset) => void
|
|
23
|
-
validate) => Promise<boolean>
|
|
24
|
-
getFieldValidation) => any
|
|
31
|
+
submit: () => Promise<{ success: boolean; data: Record<string, any>; errors: string[] }>
|
|
32
|
+
reset: () => void
|
|
33
|
+
validate: () => Promise<boolean>
|
|
34
|
+
getFieldValidation: (fieldName: string) => any
|
|
25
35
|
}
|
|
26
36
|
|
|
27
37
|
export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFormValidationProps>(
|
|
@@ -50,110 +60,116 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
50
60
|
// Initialize hooks with configuration based on enhanced features
|
|
51
61
|
const initialFields = fields.reduce((acc, field) => {
|
|
52
62
|
acc[field.name] = {
|
|
53
|
-
name,
|
|
54
|
-
value,
|
|
55
|
-
rules
|
|
63
|
+
name: field.name,
|
|
64
|
+
value: field.initialValue || '',
|
|
65
|
+
rules: field.rules
|
|
66
|
+
}
|
|
56
67
|
return acc
|
|
57
68
|
}, {} as Record<string, any>)
|
|
58
69
|
|
|
59
70
|
// Form feedback hook
|
|
60
71
|
const feedback = useFormFeedback({
|
|
61
|
-
onFeedbackShow) => {
|
|
62
|
-
console.log('Feedback shown, feedbackState)
|
|
72
|
+
onFeedbackShow: (feedbackState) => {
|
|
73
|
+
console.log('Feedback shown:', feedbackState)
|
|
63
74
|
}
|
|
64
75
|
}, {
|
|
65
|
-
enableAnimations,
|
|
66
|
-
enableTouchFeedback,
|
|
67
|
-
enableHapticFeedback,
|
|
68
|
-
enableSoundFeedback,
|
|
69
|
-
enableAccessibility
|
|
76
|
+
enableAnimations: true,
|
|
77
|
+
enableTouchFeedback: true,
|
|
78
|
+
enableHapticFeedback: enableEnhancedFeatures,
|
|
79
|
+
enableSoundFeedback: enableEnhancedFeatures,
|
|
80
|
+
enableAccessibility: true
|
|
81
|
+
})
|
|
70
82
|
|
|
71
83
|
// Form validation hook
|
|
72
84
|
const {
|
|
73
85
|
updateField,
|
|
74
86
|
touchField,
|
|
75
87
|
validateAllFields,
|
|
76
|
-
submitForm,
|
|
88
|
+
submitForm: submitFormHook,
|
|
77
89
|
resetForm,
|
|
78
90
|
getFieldValidation,
|
|
79
91
|
isFormValid,
|
|
80
92
|
isFormDirty
|
|
81
93
|
} = useMobileFormValidation(initialFields, {
|
|
82
|
-
onFormSubmit, isValid) => {
|
|
94
|
+
onFormSubmit: (data, isValid) => {
|
|
83
95
|
if (isValid && onSubmit) {
|
|
84
96
|
onSubmit(data)
|
|
85
97
|
}
|
|
86
98
|
},
|
|
87
|
-
onValidationComplete, isValid, errors) => {
|
|
99
|
+
onValidationComplete: (fieldName, isValid, errors) => {
|
|
88
100
|
// Trigger feedback based on validation result
|
|
89
101
|
if (isValid) {
|
|
90
102
|
feedback.showSuccess(`${fieldName} is valid`)
|
|
91
103
|
} else {
|
|
92
|
-
feedback.showError(`${fieldName}, ')}`)
|
|
104
|
+
feedback.showError(`${fieldName}: ${errors.join(', ')}`)
|
|
93
105
|
}
|
|
94
106
|
}
|
|
95
107
|
}, {
|
|
96
|
-
enableTouchFeedback,
|
|
97
|
-
enableHapticFeedback,
|
|
98
|
-
enableSoundFeedback,
|
|
99
|
-
validationDelay,
|
|
100
|
-
enablePerformanceOptimization,
|
|
101
|
-
maxValidationRetries
|
|
108
|
+
enableTouchFeedback: true,
|
|
109
|
+
enableHapticFeedback: enableEnhancedFeatures,
|
|
110
|
+
enableSoundFeedback: enableEnhancedFeatures,
|
|
111
|
+
validationDelay: enableEnhancedFeatures ? 300 : 500,
|
|
112
|
+
enablePerformanceOptimization: enableEnhancedFeatures,
|
|
113
|
+
maxValidationRetries: enableEnhancedFeatures ? 3 : 1
|
|
114
|
+
})
|
|
102
115
|
|
|
103
116
|
// Mobile form layout hook
|
|
104
117
|
const layout = useMobileFormLayout({
|
|
105
|
-
onLayoutChange) => {
|
|
106
|
-
console.log('Layout changed, layoutState)
|
|
118
|
+
onLayoutChange: (layoutState) => {
|
|
119
|
+
console.log('Layout changed:', layoutState)
|
|
107
120
|
}
|
|
108
121
|
}, {
|
|
109
|
-
enableTouchOptimization,
|
|
110
|
-
enableKeyboardOptimization,
|
|
111
|
-
enableResponsiveBehavior,
|
|
112
|
-
enablePerformanceOptimization,
|
|
113
|
-
enableAutoFocus
|
|
122
|
+
enableTouchOptimization: true,
|
|
123
|
+
enableKeyboardOptimization: enableEnhancedFeatures,
|
|
124
|
+
enableResponsiveBehavior: true,
|
|
125
|
+
enablePerformanceOptimization: enableEnhancedFeatures,
|
|
126
|
+
enableAutoFocus: enableEnhancedFeatures
|
|
127
|
+
})
|
|
114
128
|
|
|
115
129
|
// Form performance hook
|
|
116
130
|
const performance = useFormPerformance({
|
|
117
|
-
onPerformanceWarning, metrics) => {
|
|
118
|
-
console.warn('Performance warning, warning, metrics)
|
|
131
|
+
onPerformanceWarning: (warning, metrics) => {
|
|
132
|
+
console.warn('Performance warning:', warning, metrics)
|
|
119
133
|
feedback.showWarning(warning)
|
|
120
134
|
},
|
|
121
|
-
onMemoryWarning, _threshold) => {
|
|
122
|
-
feedback.showWarning(`Memory usage high).toFixed(1)}%`)
|
|
135
|
+
onMemoryWarning: (usage, _threshold) => {
|
|
136
|
+
feedback.showWarning(`Memory usage high: ${(usage * 100).toFixed(1)}%`)
|
|
123
137
|
},
|
|
124
|
-
onBatteryWarning, isLow) => {
|
|
138
|
+
onBatteryWarning: (level, isLow) => {
|
|
125
139
|
if (isLow) {
|
|
126
|
-
feedback.showWarning(`Low battery).toFixed(0)}%`)
|
|
140
|
+
feedback.showWarning(`Low battery: ${(level * 100).toFixed(0)}%`)
|
|
127
141
|
}
|
|
128
142
|
}
|
|
129
143
|
}, {
|
|
130
|
-
enableValidationThrottling,
|
|
131
|
-
enableTouchEventOptimization,
|
|
132
|
-
enableMemoryManagement,
|
|
133
|
-
enableBatteryOptimization
|
|
144
|
+
enableValidationThrottling: true,
|
|
145
|
+
enableTouchEventOptimization: enableEnhancedFeatures,
|
|
146
|
+
enableMemoryManagement: enableEnhancedFeatures,
|
|
147
|
+
enableBatteryOptimization: enableEnhancedFeatures
|
|
148
|
+
})
|
|
134
149
|
|
|
135
150
|
// Semantic input hooks for each field
|
|
136
151
|
const semanticInputs = fields.reduce((acc, field) => {
|
|
137
152
|
acc[field.name] = useSemanticInput(field.type, {
|
|
138
|
-
onInputTypeDetected) => {
|
|
139
|
-
console.log(`Input type detected for ${field.name}
|
|
153
|
+
onInputTypeDetected: (inputType) => {
|
|
154
|
+
console.log(`Input type detected for ${field.name}:`, inputType)
|
|
140
155
|
},
|
|
141
|
-
onKeyboardOptimization) => {
|
|
142
|
-
console.log(`Keyboard optimization for ${field.name}
|
|
156
|
+
onKeyboardOptimization: (optimized) => {
|
|
157
|
+
console.log(`Keyboard optimization for ${field.name}:`, optimized)
|
|
143
158
|
}
|
|
144
159
|
}, {
|
|
145
|
-
enableAutoDetection,
|
|
146
|
-
enableKeyboardOptimization,
|
|
147
|
-
enableAutocomplete,
|
|
148
|
-
enableTouchOptimization,
|
|
149
|
-
enableAccessibility,
|
|
150
|
-
enablePerformanceMonitoring
|
|
160
|
+
enableAutoDetection: true,
|
|
161
|
+
enableKeyboardOptimization: enableEnhancedFeatures,
|
|
162
|
+
enableAutocomplete: enableEnhancedFeatures,
|
|
163
|
+
enableTouchOptimization: true,
|
|
164
|
+
enableAccessibility: true,
|
|
165
|
+
enablePerformanceMonitoring: enableEnhancedFeatures
|
|
166
|
+
})
|
|
151
167
|
return acc
|
|
152
168
|
}, {} as Record<string, any>)
|
|
153
169
|
|
|
154
170
|
// Handle field changes
|
|
155
|
-
const handleFieldChange = (fieldName, value) => {
|
|
156
|
-
setFormData(prev => ({ ...prev, [fieldName]}))
|
|
171
|
+
const handleFieldChange = (fieldName: string, value: any) => {
|
|
172
|
+
setFormData(prev => ({ ...prev, [fieldName]: value }))
|
|
157
173
|
|
|
158
174
|
// Update validation state
|
|
159
175
|
updateField(fieldName, value)
|
|
@@ -171,12 +187,12 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
171
187
|
}
|
|
172
188
|
|
|
173
189
|
// Handle field blur
|
|
174
|
-
const handleFieldBlur = (fieldName) => {
|
|
190
|
+
const handleFieldBlur = (fieldName: string) => {
|
|
175
191
|
touchField(fieldName)
|
|
176
192
|
}
|
|
177
193
|
|
|
178
194
|
// Handle form submission
|
|
179
|
-
const handleSubmit = async (e) => {
|
|
195
|
+
const handleSubmit = async (e: React.FormEvent) => {
|
|
180
196
|
e.preventDefault()
|
|
181
197
|
setIsSubmitting(true)
|
|
182
198
|
|
|
@@ -189,11 +205,11 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
189
205
|
onSubmit(result.data)
|
|
190
206
|
}
|
|
191
207
|
} else {
|
|
192
|
-
feedback.showError(`Form submission failed, ')}`)
|
|
208
|
+
feedback.showError(`Form submission failed: ${result.errors.join(', ')}`)
|
|
193
209
|
}
|
|
194
210
|
} catch (error) {
|
|
195
211
|
feedback.showError('An unexpected error occurred')
|
|
196
|
-
console.error('Form submission error, error)
|
|
212
|
+
console.error('Form submission error:', error)
|
|
197
213
|
} finally {
|
|
198
214
|
setIsSubmitting(false)
|
|
199
215
|
}
|
|
@@ -208,7 +224,7 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
208
224
|
}, {} as Record<string, any>))
|
|
209
225
|
|
|
210
226
|
// Reset semantic inputs
|
|
211
|
-
Object.values(semanticInputs).forEach((semanticInput) => {
|
|
227
|
+
Object.values(semanticInputs).forEach((semanticInput: any) => {
|
|
212
228
|
semanticInput.resetOptimizations()
|
|
213
229
|
})
|
|
214
230
|
|
|
@@ -223,9 +239,9 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
223
239
|
|
|
224
240
|
// Expose methods via ref
|
|
225
241
|
React.useImperativeHandle(ref, () => ({
|
|
226
|
-
submit,
|
|
227
|
-
reset,
|
|
228
|
-
validate,
|
|
242
|
+
submit: submitFormHook,
|
|
243
|
+
reset: handleReset,
|
|
244
|
+
validate: validateAllFields,
|
|
229
245
|
getFieldValidation
|
|
230
246
|
}))
|
|
231
247
|
|
|
@@ -248,13 +264,15 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
248
264
|
<div className="mb-4 p-3 bg-gray-50 rounded-lg">
|
|
249
265
|
<div className="flex items-center justify-between text-sm">
|
|
250
266
|
<div className="flex items-center gap-2">
|
|
251
|
-
<span>Performance
|
|
252
|
-
|
|
267
|
+
<span>Performance:</span>
|
|
268
|
+
<Badge variant={performance.performanceState.isOptimized ? 'default' : 'secondary'}>
|
|
269
|
+
{performance.performanceState.isOptimized ? 'Optimized' : 'Not Optimized'}
|
|
253
270
|
</Badge>
|
|
254
271
|
</div>
|
|
255
272
|
<div className="flex items-center gap-2">
|
|
256
|
-
<span>Layout
|
|
257
|
-
|
|
273
|
+
<span>Layout:</span>
|
|
274
|
+
<Badge variant={layout.isOptimized ? 'default' : 'secondary'}>
|
|
275
|
+
{layout.isOptimized ? 'Optimized' : 'Not Optimized'}
|
|
258
276
|
</Badge>
|
|
259
277
|
</div>
|
|
260
278
|
</div>
|
|
@@ -315,10 +333,15 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
315
333
|
onBlur={() => handleFieldBlur(field.name)}
|
|
316
334
|
className={`w-full transition-all duration-200 ${
|
|
317
335
|
isFieldTouched && !isFieldValid
|
|
318
|
-
? 'border-red-500 focus
|
|
336
|
+
? 'border-red-500 focus:border-red-500 focus:ring-red-500'
|
|
337
|
+
: isFieldTouched && isFieldValid
|
|
338
|
+
? 'border-green-500 focus:border-green-500 focus:ring-green-500'
|
|
339
|
+
: 'border-gray-300 focus:border-blue-500 focus:ring-blue-500'
|
|
340
|
+
} ${semanticInput?.getSemanticClasses() || ''}`}
|
|
319
341
|
style={{
|
|
320
|
-
minHeight,
|
|
321
|
-
width
|
|
342
|
+
minHeight: layout.currentSpacing,
|
|
343
|
+
width: layout.currentFieldWidth
|
|
344
|
+
}}
|
|
322
345
|
{...semanticInput?.getOptimizedAttributes(field.type)}
|
|
323
346
|
/>
|
|
324
347
|
|
|
@@ -327,7 +350,8 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
327
350
|
<div className="absolute right-3 top-1/2 transform -translate-y-1/2">
|
|
328
351
|
{isFieldValid ? (
|
|
329
352
|
<span className="text-green-500 text-lg">✓</span>
|
|
330
|
-
)
|
|
353
|
+
) : (
|
|
354
|
+
<span className="text-red-500 text-lg">✗</span>
|
|
331
355
|
)}
|
|
332
356
|
</div>
|
|
333
357
|
)}
|
|
@@ -336,7 +360,7 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
336
360
|
{/* Field Errors */}
|
|
337
361
|
{isFieldTouched && !isFieldValid && fieldErrors.length > 0 && (
|
|
338
362
|
<div className="text-red-500 text-sm space-y-1">
|
|
339
|
-
{fieldErrors.map((error, index) => (
|
|
363
|
+
{fieldErrors.map((error: string, index: number) => (
|
|
340
364
|
<div key={index} className="flex items-center gap-1">
|
|
341
365
|
<span>•</span>
|
|
342
366
|
<span>{error}</span>
|
|
@@ -349,13 +373,15 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
349
373
|
{enableEnhancedFeatures && semanticInput && (
|
|
350
374
|
<div className="text-xs text-gray-500 space-y-1">
|
|
351
375
|
<div className="flex items-center gap-2">
|
|
352
|
-
<span>Type
|
|
376
|
+
<span>Type:</span>
|
|
377
|
+
<Badge variant="outline" className="text-xs">
|
|
353
378
|
{semanticInput.semanticState.detectedType?.type || field.type.type}
|
|
354
379
|
</Badge>
|
|
355
380
|
</div>
|
|
356
381
|
{semanticInput.semanticState.isOptimized && (
|
|
357
382
|
<div className="flex items-center gap-2">
|
|
358
|
-
<span>Optimized
|
|
383
|
+
<span>Optimized:</span>
|
|
384
|
+
<Badge variant="default" className="text-xs">Yes</Badge>
|
|
359
385
|
</div>
|
|
360
386
|
)}
|
|
361
387
|
</div>
|
|
@@ -365,12 +391,14 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
365
391
|
})}
|
|
366
392
|
|
|
367
393
|
{/* Form Actions */}
|
|
368
|
-
<div className="flex flex-col sm
|
|
394
|
+
<div className="flex flex-col sm:flex-row gap-3 pt-4">
|
|
395
|
+
<Button
|
|
396
|
+
type="submit"
|
|
369
397
|
disabled={!isFormValid || isSubmitting}
|
|
370
398
|
className="flex-1 touch-button"
|
|
371
|
-
style={{ minHeight}}
|
|
399
|
+
style={{ minHeight: layout.currentSpacing }}
|
|
372
400
|
>
|
|
373
|
-
{isSubmitting ? 'Submitting...' }
|
|
401
|
+
{isSubmitting ? 'Submitting...' : 'Submit'}
|
|
374
402
|
</Button>
|
|
375
403
|
|
|
376
404
|
<Button
|
|
@@ -378,7 +406,7 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
378
406
|
variant="outline"
|
|
379
407
|
onClick={handleReset}
|
|
380
408
|
className="flex-1 touch-button"
|
|
381
|
-
style={{ minHeight}}
|
|
409
|
+
style={{ minHeight: layout.currentSpacing }}
|
|
382
410
|
>
|
|
383
411
|
Reset
|
|
384
412
|
</Button>
|
|
@@ -387,19 +415,24 @@ export const MobileFormValidation = forwardRef<MobileFormValidationRef, MobileFo
|
|
|
387
415
|
{/* Form Status */}
|
|
388
416
|
<div className="text-sm text-gray-500 space-y-1">
|
|
389
417
|
<div className="flex items-center gap-2">
|
|
390
|
-
<span>Form Status
|
|
391
|
-
|
|
418
|
+
<span>Form Status:</span>
|
|
419
|
+
<Badge variant={isFormValid ? 'default' : 'secondary'}>
|
|
420
|
+
{isFormValid ? 'Valid' : 'Invalid'}
|
|
392
421
|
</Badge>
|
|
393
422
|
</div>
|
|
394
423
|
<div className="flex items-center gap-2">
|
|
395
|
-
<span>Dirty
|
|
396
|
-
|
|
424
|
+
<span>Dirty:</span>
|
|
425
|
+
<Badge variant={isFormDirty ? 'default' : 'secondary'}>
|
|
426
|
+
{isFormDirty ? 'Yes' : 'No'}
|
|
397
427
|
</Badge>
|
|
398
428
|
</div>
|
|
399
429
|
{enableEnhancedFeatures && (
|
|
400
430
|
<div className="flex items-center gap-2">
|
|
401
|
-
<span>Performance Score
|
|
402
|
-
|
|
431
|
+
<span>Performance Score:</span>
|
|
432
|
+
<Badge variant={
|
|
433
|
+
performance.performanceState.performanceMetrics.optimizationScore >= 0.8 ? 'default' :
|
|
434
|
+
performance.performanceState.performanceMetrics.optimizationScore >= 0.6 ? 'secondary' : 'destructive'
|
|
435
|
+
}>
|
|
403
436
|
{(performance.performanceState.performanceMetrics.optimizationScore * 100).toFixed(0)}%
|
|
404
437
|
</Badge>
|
|
405
438
|
</div>
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Card } from './card';
|
|
3
3
|
import { MobileInput, mobileInputConfigs } from './mobile-input';
|
|
4
4
|
|
|
5
|
-
export const MobileInputDemo= () => {
|
|
5
|
+
export const MobileInputDemo: React.FC = () => {
|
|
6
6
|
return (
|
|
7
7
|
<div className="space-y-6">
|
|
8
8
|
<div className="text-center">
|
|
@@ -18,7 +18,8 @@ export const MobileInputDemo= () => {
|
|
|
18
18
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
19
19
|
Semantic Input Types
|
|
20
20
|
</h3>
|
|
21
|
-
<div className="grid grid-cols-1 md
|
|
21
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
22
|
+
<div className="space-y-2">
|
|
22
23
|
<label className="text-sm font-medium text-cs-text-secondary">Name Input</label>
|
|
23
24
|
<MobileInput
|
|
24
25
|
placeholder="Enter your full name"
|
|
@@ -96,15 +97,17 @@ export const MobileInputDemo= () => {
|
|
|
96
97
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
97
98
|
Custom Mobile Configurations
|
|
98
99
|
</h3>
|
|
99
|
-
<div className="grid grid-cols-1 md
|
|
100
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
101
|
+
<div className="space-y-2">
|
|
100
102
|
<label className="text-sm font-medium text-cs-text-secondary">Custom Input Mode</label>
|
|
101
103
|
<MobileInput
|
|
102
104
|
placeholder="Custom input mode"
|
|
103
105
|
mobileConfig={{
|
|
104
|
-
semanticType,
|
|
105
|
-
inputMode,
|
|
106
|
-
spellCheck,
|
|
107
|
-
autoCapitalize
|
|
106
|
+
semanticType: 'email',
|
|
107
|
+
inputMode: 'tel',
|
|
108
|
+
spellCheck: true,
|
|
109
|
+
autoCapitalize: 'characters'
|
|
110
|
+
}}
|
|
108
111
|
className="w-full"
|
|
109
112
|
/>
|
|
110
113
|
<p className="text-xs text-cs-text-muted">
|
|
@@ -117,8 +120,9 @@ export const MobileInputDemo= () => {
|
|
|
117
120
|
<MobileInput
|
|
118
121
|
placeholder="No autocomplete"
|
|
119
122
|
mobileConfig={{
|
|
120
|
-
semanticType,
|
|
121
|
-
enableAutocomplete
|
|
123
|
+
semanticType: 'name',
|
|
124
|
+
enableAutocomplete: false
|
|
125
|
+
}}
|
|
122
126
|
className="w-full"
|
|
123
127
|
/>
|
|
124
128
|
<p className="text-xs text-cs-text-muted">
|
|
@@ -132,12 +136,13 @@ export const MobileInputDemo= () => {
|
|
|
132
136
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
133
137
|
Props Override Behavior
|
|
134
138
|
</h3>
|
|
135
|
-
<div className="grid grid-cols-1 md
|
|
139
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
140
|
+
<div className="space-y-2">
|
|
136
141
|
<label className="text-sm font-medium text-cs-text-secondary">Explicit Type Override</label>
|
|
137
142
|
<MobileInput
|
|
138
143
|
type="password"
|
|
139
144
|
placeholder="Password type overrides semantic"
|
|
140
|
-
mobileConfig={{ semanticType}}
|
|
145
|
+
mobileConfig={{ semanticType: 'email' }}
|
|
141
146
|
className="w-full"
|
|
142
147
|
/>
|
|
143
148
|
<p className="text-xs text-cs-text-muted">
|
|
@@ -149,7 +154,7 @@ export const MobileInputDemo= () => {
|
|
|
149
154
|
<label className="text-sm font-medium text-cs-text-secondary">Custom Attributes</label>
|
|
150
155
|
<MobileInput
|
|
151
156
|
placeholder="Custom attributes"
|
|
152
|
-
mobileConfig={{ semanticType}}
|
|
157
|
+
mobileConfig={{ semanticType: 'name' }}
|
|
153
158
|
autoComplete="off"
|
|
154
159
|
spellCheck={true}
|
|
155
160
|
className="w-full"
|
|
@@ -166,7 +171,8 @@ export const MobileInputDemo= () => {
|
|
|
166
171
|
Mobile Optimization Features
|
|
167
172
|
</h3>
|
|
168
173
|
<div className="space-y-4">
|
|
169
|
-
<div className="grid grid-cols-1 md
|
|
174
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 text-center">
|
|
175
|
+
<div className="p-4 bg-cs-surface-bg rounded-lg">
|
|
170
176
|
<div className="text-2xl mb-2">📱</div>
|
|
171
177
|
<h4 className="font-medium text-cs-text-primary">Touch Optimized</h4>
|
|
172
178
|
<p className="text-sm text-cs-text-secondary">
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Card } from './card';
|
|
3
3
|
import { MobileInput, mobileInputConfigs } from './mobile-input';
|
|
4
4
|
|
|
5
|
-
export const MobileInputDemo= () => {
|
|
5
|
+
export const MobileInputDemo: React.FC = () => {
|
|
6
6
|
return (
|
|
7
7
|
<div className="space-y-6">
|
|
8
8
|
<div className="text-center">
|
|
@@ -18,7 +18,8 @@ export const MobileInputDemo= () => {
|
|
|
18
18
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
19
19
|
Semantic Input Types
|
|
20
20
|
</h3>
|
|
21
|
-
<div className="grid grid-cols-1 md
|
|
21
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
22
|
+
<div className="space-y-2">
|
|
22
23
|
<label className="text-sm font-medium text-cs-text-secondary">Name Input</label>
|
|
23
24
|
<MobileInput
|
|
24
25
|
placeholder="Enter your full name"
|
|
@@ -96,15 +97,17 @@ export const MobileInputDemo= () => {
|
|
|
96
97
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
97
98
|
Custom Mobile Configurations
|
|
98
99
|
</h3>
|
|
99
|
-
<div className="grid grid-cols-1 md
|
|
100
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
101
|
+
<div className="space-y-2">
|
|
100
102
|
<label className="text-sm font-medium text-cs-text-secondary">Custom Input Mode</label>
|
|
101
103
|
<MobileInput
|
|
102
104
|
placeholder="Custom input mode"
|
|
103
105
|
mobileConfig={{
|
|
104
|
-
semanticType,
|
|
105
|
-
inputMode,
|
|
106
|
-
spellCheck,
|
|
107
|
-
autoCapitalize
|
|
106
|
+
semanticType: 'email',
|
|
107
|
+
inputMode: 'tel',
|
|
108
|
+
spellCheck: true,
|
|
109
|
+
autoCapitalize: 'characters'
|
|
110
|
+
}}
|
|
108
111
|
className="w-full"
|
|
109
112
|
/>
|
|
110
113
|
<p className="text-xs text-cs-text-muted">
|
|
@@ -117,8 +120,9 @@ export const MobileInputDemo= () => {
|
|
|
117
120
|
<MobileInput
|
|
118
121
|
placeholder="No autocomplete"
|
|
119
122
|
mobileConfig={{
|
|
120
|
-
semanticType,
|
|
121
|
-
enableAutocomplete
|
|
123
|
+
semanticType: 'name',
|
|
124
|
+
enableAutocomplete: false
|
|
125
|
+
}}
|
|
122
126
|
className="w-full"
|
|
123
127
|
/>
|
|
124
128
|
<p className="text-xs text-cs-text-muted">
|
|
@@ -132,12 +136,13 @@ export const MobileInputDemo= () => {
|
|
|
132
136
|
<h3 className="text-lg font-semibold text-cs-text-primary mb-4">
|
|
133
137
|
Props Override Behavior
|
|
134
138
|
</h3>
|
|
135
|
-
<div className="grid grid-cols-1 md
|
|
139
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
140
|
+
<div className="space-y-2">
|
|
136
141
|
<label className="text-sm font-medium text-cs-text-secondary">Explicit Type Override</label>
|
|
137
142
|
<MobileInput
|
|
138
143
|
type="password"
|
|
139
144
|
placeholder="Password type overrides semantic"
|
|
140
|
-
mobileConfig={{ semanticType}}
|
|
145
|
+
mobileConfig={{ semanticType: 'email' }}
|
|
141
146
|
className="w-full"
|
|
142
147
|
/>
|
|
143
148
|
<p className="text-xs text-cs-text-muted">
|
|
@@ -149,7 +154,7 @@ export const MobileInputDemo= () => {
|
|
|
149
154
|
<label className="text-sm font-medium text-cs-text-secondary">Custom Attributes</label>
|
|
150
155
|
<MobileInput
|
|
151
156
|
placeholder="Custom attributes"
|
|
152
|
-
mobileConfig={{ semanticType}}
|
|
157
|
+
mobileConfig={{ semanticType: 'name' }}
|
|
153
158
|
autoComplete="off"
|
|
154
159
|
spellCheck={true}
|
|
155
160
|
className="w-full"
|
|
@@ -166,7 +171,8 @@ export const MobileInputDemo= () => {
|
|
|
166
171
|
Mobile Optimization Features
|
|
167
172
|
</h3>
|
|
168
173
|
<div className="space-y-4">
|
|
169
|
-
<div className="grid grid-cols-1 md
|
|
174
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 text-center">
|
|
175
|
+
<div className="p-4 bg-cs-surface-bg rounded-lg">
|
|
170
176
|
<div className="text-2xl mb-2">📱</div>
|
|
171
177
|
<h4 className="font-medium text-cs-text-primary">Touch Optimized</h4>
|
|
172
178
|
<p className="text-sm text-cs-text-secondary">
|