rn-inputforge 0.5.0 → 0.5.1
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/README.md +236 -0
- package/lib/commonjs/a11y/audit.js +72 -0
- package/lib/commonjs/a11y/audit.js.map +1 -0
- package/lib/commonjs/a11y/index.js +13 -0
- package/lib/commonjs/a11y/index.js.map +1 -0
- package/lib/commonjs/autofill/index.js +25 -0
- package/lib/commonjs/autofill/index.js.map +1 -0
- package/lib/commonjs/autofill/profiles.js +199 -0
- package/lib/commonjs/autofill/profiles.js.map +1 -0
- package/lib/commonjs/components/FieldFlowA11yAudit/FieldFlowA11yAudit.js +99 -0
- package/lib/commonjs/components/FieldFlowA11yAudit/FieldFlowA11yAudit.js.map +1 -0
- package/lib/commonjs/components/FieldFlowA11yAudit/index.js +13 -0
- package/lib/commonjs/components/FieldFlowA11yAudit/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowAuthActions/FieldFlowAuthActions.js +130 -0
- package/lib/commonjs/components/FieldFlowAuthActions/FieldFlowAuthActions.js.map +1 -0
- package/lib/commonjs/components/FieldFlowAuthActions/index.js +13 -0
- package/lib/commonjs/components/FieldFlowAuthActions/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowCompleteness/FieldFlowCompleteness.js +100 -0
- package/lib/commonjs/components/FieldFlowCompleteness/FieldFlowCompleteness.js.map +1 -0
- package/lib/commonjs/components/FieldFlowCompleteness/index.js +13 -0
- package/lib/commonjs/components/FieldFlowCompleteness/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowFormHeader/FieldFlowFormHeader.js +102 -0
- package/lib/commonjs/components/FieldFlowFormHeader/FieldFlowFormHeader.js.map +1 -0
- package/lib/commonjs/components/FieldFlowFormHeader/index.js +13 -0
- package/lib/commonjs/components/FieldFlowFormHeader/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowInfoTip/FieldFlowInfoTip.js +121 -0
- package/lib/commonjs/components/FieldFlowInfoTip/FieldFlowInfoTip.js.map +1 -0
- package/lib/commonjs/components/FieldFlowInfoTip/index.js +13 -0
- package/lib/commonjs/components/FieldFlowInfoTip/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowInlineAlert/FieldFlowInlineAlert.js +142 -0
- package/lib/commonjs/components/FieldFlowInlineAlert/FieldFlowInlineAlert.js.map +1 -0
- package/lib/commonjs/components/FieldFlowInlineAlert/index.js +13 -0
- package/lib/commonjs/components/FieldFlowInlineAlert/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowInput/FieldFlowInput.js +44 -18
- package/lib/commonjs/components/FieldFlowInput/FieldFlowInput.js.map +1 -1
- package/lib/commonjs/components/FieldFlowInput/styles.js +49 -13
- package/lib/commonjs/components/FieldFlowInput/styles.js.map +1 -1
- package/lib/commonjs/components/FieldFlowKeyboardToolbar/FieldFlowKeyboardToolbar.js +137 -0
- package/lib/commonjs/components/FieldFlowKeyboardToolbar/FieldFlowKeyboardToolbar.js.map +1 -0
- package/lib/commonjs/components/FieldFlowKeyboardToolbar/index.js +19 -0
- package/lib/commonjs/components/FieldFlowKeyboardToolbar/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowSkeleton/FieldFlowSkeleton.js +101 -0
- package/lib/commonjs/components/FieldFlowSkeleton/FieldFlowSkeleton.js.map +1 -0
- package/lib/commonjs/components/FieldFlowSkeleton/index.js +13 -0
- package/lib/commonjs/components/FieldFlowSkeleton/index.js.map +1 -0
- package/lib/commonjs/components/KeyboardAwareFormWrapper/KeyboardAwareFormWrapper.js +6 -4
- package/lib/commonjs/components/KeyboardAwareFormWrapper/KeyboardAwareFormWrapper.js.map +1 -1
- package/lib/commonjs/hooks/index.js +21 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useFieldFlowCompleteness.js +46 -0
- package/lib/commonjs/hooks/useFieldFlowCompleteness.js.map +1 -0
- package/lib/commonjs/hooks/useFieldFlowSubmitQueue.js +145 -0
- package/lib/commonjs/hooks/useFieldFlowSubmitQueue.js.map +1 -0
- package/lib/commonjs/hooks/useKeyboardManager.js +15 -0
- package/lib/commonjs/hooks/useKeyboardManager.js.map +1 -1
- package/lib/commonjs/hooks/useSmartPaste.js +27 -0
- package/lib/commonjs/hooks/useSmartPaste.js.map +1 -0
- package/lib/commonjs/index.js +144 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/paste/index.js +19 -0
- package/lib/commonjs/paste/index.js.map +1 -0
- package/lib/commonjs/paste/smartPaste.js +113 -0
- package/lib/commonjs/paste/smartPaste.js.map +1 -0
- package/lib/commonjs/schema/FieldFlowSchemaForm.js +219 -0
- package/lib/commonjs/schema/FieldFlowSchemaForm.js.map +1 -0
- package/lib/commonjs/schema/index.js +13 -0
- package/lib/commonjs/schema/index.js.map +1 -0
- package/lib/commonjs/schema/types.js +6 -0
- package/lib/commonjs/schema/types.js.map +1 -0
- package/lib/commonjs/theme/ThemeProvider.js +65 -4
- package/lib/commonjs/theme/ThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/appearance.js +93 -0
- package/lib/commonjs/theme/appearance.js.map +1 -0
- package/lib/commonjs/theme/defaultTheme.js +17 -2
- package/lib/commonjs/theme/defaultTheme.js.map +1 -1
- package/lib/commonjs/theme/index.js +19 -0
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/commonjs/types/globals.d.js +2 -0
- package/lib/commonjs/types/globals.d.js.map +1 -0
- package/lib/module/a11y/audit.js +68 -0
- package/lib/module/a11y/audit.js.map +1 -0
- package/lib/module/a11y/index.js +4 -0
- package/lib/module/a11y/index.js.map +1 -0
- package/lib/module/autofill/index.js +4 -0
- package/lib/module/autofill/index.js.map +1 -0
- package/lib/module/autofill/profiles.js +193 -0
- package/lib/module/autofill/profiles.js.map +1 -0
- package/lib/module/components/FieldFlowA11yAudit/FieldFlowA11yAudit.js +94 -0
- package/lib/module/components/FieldFlowA11yAudit/FieldFlowA11yAudit.js.map +1 -0
- package/lib/module/components/FieldFlowA11yAudit/index.js +4 -0
- package/lib/module/components/FieldFlowA11yAudit/index.js.map +1 -0
- package/lib/module/components/FieldFlowAuthActions/FieldFlowAuthActions.js +125 -0
- package/lib/module/components/FieldFlowAuthActions/FieldFlowAuthActions.js.map +1 -0
- package/lib/module/components/FieldFlowAuthActions/index.js +4 -0
- package/lib/module/components/FieldFlowAuthActions/index.js.map +1 -0
- package/lib/module/components/FieldFlowCompleteness/FieldFlowCompleteness.js +95 -0
- package/lib/module/components/FieldFlowCompleteness/FieldFlowCompleteness.js.map +1 -0
- package/lib/module/components/FieldFlowCompleteness/index.js +4 -0
- package/lib/module/components/FieldFlowCompleteness/index.js.map +1 -0
- package/lib/module/components/FieldFlowFormHeader/FieldFlowFormHeader.js +97 -0
- package/lib/module/components/FieldFlowFormHeader/FieldFlowFormHeader.js.map +1 -0
- package/lib/module/components/FieldFlowFormHeader/index.js +4 -0
- package/lib/module/components/FieldFlowFormHeader/index.js.map +1 -0
- package/lib/module/components/FieldFlowInfoTip/FieldFlowInfoTip.js +116 -0
- package/lib/module/components/FieldFlowInfoTip/FieldFlowInfoTip.js.map +1 -0
- package/lib/module/components/FieldFlowInfoTip/index.js +4 -0
- package/lib/module/components/FieldFlowInfoTip/index.js.map +1 -0
- package/lib/module/components/FieldFlowInlineAlert/FieldFlowInlineAlert.js +137 -0
- package/lib/module/components/FieldFlowInlineAlert/FieldFlowInlineAlert.js.map +1 -0
- package/lib/module/components/FieldFlowInlineAlert/index.js +4 -0
- package/lib/module/components/FieldFlowInlineAlert/index.js.map +1 -0
- package/lib/module/components/FieldFlowInput/FieldFlowInput.js +44 -18
- package/lib/module/components/FieldFlowInput/FieldFlowInput.js.map +1 -1
- package/lib/module/components/FieldFlowInput/styles.js +49 -13
- package/lib/module/components/FieldFlowInput/styles.js.map +1 -1
- package/lib/module/components/FieldFlowKeyboardToolbar/FieldFlowKeyboardToolbar.js +131 -0
- package/lib/module/components/FieldFlowKeyboardToolbar/FieldFlowKeyboardToolbar.js.map +1 -0
- package/lib/module/components/FieldFlowKeyboardToolbar/index.js +4 -0
- package/lib/module/components/FieldFlowKeyboardToolbar/index.js.map +1 -0
- package/lib/module/components/FieldFlowSkeleton/FieldFlowSkeleton.js +96 -0
- package/lib/module/components/FieldFlowSkeleton/FieldFlowSkeleton.js.map +1 -0
- package/lib/module/components/FieldFlowSkeleton/index.js +4 -0
- package/lib/module/components/FieldFlowSkeleton/index.js.map +1 -0
- package/lib/module/components/KeyboardAwareFormWrapper/KeyboardAwareFormWrapper.js +5 -3
- package/lib/module/components/KeyboardAwareFormWrapper/KeyboardAwareFormWrapper.js.map +1 -1
- package/lib/module/hooks/index.js +3 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useFieldFlowCompleteness.js +42 -0
- package/lib/module/hooks/useFieldFlowCompleteness.js.map +1 -0
- package/lib/module/hooks/useFieldFlowSubmitQueue.js +141 -0
- package/lib/module/hooks/useFieldFlowSubmitQueue.js.map +1 -0
- package/lib/module/hooks/useKeyboardManager.js +15 -0
- package/lib/module/hooks/useKeyboardManager.js.map +1 -1
- package/lib/module/hooks/useSmartPaste.js +23 -0
- package/lib/module/hooks/useSmartPaste.js.map +1 -0
- package/lib/module/index.js +17 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/paste/index.js +4 -0
- package/lib/module/paste/index.js.map +1 -0
- package/lib/module/paste/smartPaste.js +108 -0
- package/lib/module/paste/smartPaste.js.map +1 -0
- package/lib/module/schema/FieldFlowSchemaForm.js +214 -0
- package/lib/module/schema/FieldFlowSchemaForm.js.map +1 -0
- package/lib/module/schema/index.js +4 -0
- package/lib/module/schema/index.js.map +1 -0
- package/lib/module/schema/types.js +4 -0
- package/lib/module/schema/types.js.map +1 -0
- package/lib/module/theme/ThemeProvider.js +66 -5
- package/lib/module/theme/ThemeProvider.js.map +1 -1
- package/lib/module/theme/appearance.js +87 -0
- package/lib/module/theme/appearance.js.map +1 -0
- package/lib/module/theme/defaultTheme.js +17 -2
- package/lib/module/theme/defaultTheme.js.map +1 -1
- package/lib/module/theme/index.js +1 -0
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/types/globals.d.js +2 -0
- package/lib/module/types/globals.d.js.map +1 -0
- package/lib/typescript/a11y/audit.d.ts +32 -0
- package/lib/typescript/a11y/audit.d.ts.map +1 -0
- package/lib/typescript/a11y/index.d.ts +3 -0
- package/lib/typescript/a11y/index.d.ts.map +1 -0
- package/lib/typescript/autofill/index.d.ts +3 -0
- package/lib/typescript/autofill/index.d.ts.map +1 -0
- package/lib/typescript/autofill/profiles.d.ts +48 -0
- package/lib/typescript/autofill/profiles.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowA11yAudit/FieldFlowA11yAudit.d.ts +21 -0
- package/lib/typescript/components/FieldFlowA11yAudit/FieldFlowA11yAudit.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowA11yAudit/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowA11yAudit/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowAuthActions/FieldFlowAuthActions.d.ts +29 -0
- package/lib/typescript/components/FieldFlowAuthActions/FieldFlowAuthActions.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowAuthActions/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowAuthActions/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowCompleteness/FieldFlowCompleteness.d.ts +25 -0
- package/lib/typescript/components/FieldFlowCompleteness/FieldFlowCompleteness.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowCompleteness/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowCompleteness/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowFormHeader/FieldFlowFormHeader.d.ts +23 -0
- package/lib/typescript/components/FieldFlowFormHeader/FieldFlowFormHeader.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowFormHeader/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowFormHeader/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowInfoTip/FieldFlowInfoTip.d.ts +19 -0
- package/lib/typescript/components/FieldFlowInfoTip/FieldFlowInfoTip.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowInfoTip/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowInfoTip/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowInlineAlert/FieldFlowInlineAlert.d.ts +22 -0
- package/lib/typescript/components/FieldFlowInlineAlert/FieldFlowInlineAlert.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowInlineAlert/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowInlineAlert/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowInput/FieldFlowInput.d.ts.map +1 -1
- package/lib/typescript/components/FieldFlowInput/styles.d.ts +36 -1
- package/lib/typescript/components/FieldFlowInput/styles.d.ts.map +1 -1
- package/lib/typescript/components/FieldFlowInput/types.d.ts +18 -0
- package/lib/typescript/components/FieldFlowInput/types.d.ts.map +1 -1
- package/lib/typescript/components/FieldFlowKeyboardToolbar/FieldFlowKeyboardToolbar.d.ts +30 -0
- package/lib/typescript/components/FieldFlowKeyboardToolbar/FieldFlowKeyboardToolbar.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowKeyboardToolbar/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowKeyboardToolbar/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowSkeleton/FieldFlowSkeleton.d.ts +21 -0
- package/lib/typescript/components/FieldFlowSkeleton/FieldFlowSkeleton.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowSkeleton/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowSkeleton/index.d.ts.map +1 -0
- package/lib/typescript/components/KeyboardAwareFormWrapper/KeyboardAwareFormWrapper.d.ts +3 -2
- package/lib/typescript/components/KeyboardAwareFormWrapper/KeyboardAwareFormWrapper.d.ts.map +1 -1
- package/lib/typescript/hooks/index.d.ts +6 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -1
- package/lib/typescript/hooks/useFieldFlowCompleteness.d.ts +28 -0
- package/lib/typescript/hooks/useFieldFlowCompleteness.d.ts.map +1 -0
- package/lib/typescript/hooks/useFieldFlowSubmitQueue.d.ts +45 -0
- package/lib/typescript/hooks/useFieldFlowSubmitQueue.d.ts.map +1 -0
- package/lib/typescript/hooks/useKeyboardManager.d.ts +6 -0
- package/lib/typescript/hooks/useKeyboardManager.d.ts.map +1 -1
- package/lib/typescript/hooks/useSmartPaste.d.ts +14 -0
- package/lib/typescript/hooks/useSmartPaste.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +28 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/paste/index.d.ts +3 -0
- package/lib/typescript/paste/index.d.ts.map +1 -0
- package/lib/typescript/paste/smartPaste.d.ts +32 -0
- package/lib/typescript/paste/smartPaste.d.ts.map +1 -0
- package/lib/typescript/schema/FieldFlowSchemaForm.d.ts +28 -0
- package/lib/typescript/schema/FieldFlowSchemaForm.d.ts.map +1 -0
- package/lib/typescript/schema/index.d.ts +4 -0
- package/lib/typescript/schema/index.d.ts.map +1 -0
- package/lib/typescript/schema/types.d.ts +43 -0
- package/lib/typescript/schema/types.d.ts.map +1 -0
- package/lib/typescript/theme/ThemeProvider.d.ts +18 -4
- package/lib/typescript/theme/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/theme/appearance.d.ts +19 -0
- package/lib/typescript/theme/appearance.d.ts.map +1 -0
- package/lib/typescript/theme/defaultTheme.d.ts.map +1 -1
- package/lib/typescript/theme/index.d.ts +1 -0
- package/lib/typescript/theme/index.d.ts.map +1 -1
- package/lib/typescript/types/index.d.ts +26 -0
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/a11y/audit.ts +99 -0
- package/src/a11y/index.ts +7 -0
- package/src/autofill/index.ts +10 -0
- package/src/autofill/profiles.ts +224 -0
- package/src/components/FieldFlowA11yAudit/FieldFlowA11yAudit.tsx +112 -0
- package/src/components/FieldFlowA11yAudit/index.ts +2 -0
- package/src/components/FieldFlowAuthActions/FieldFlowAuthActions.tsx +146 -0
- package/src/components/FieldFlowAuthActions/index.ts +6 -0
- package/src/components/FieldFlowCompleteness/FieldFlowCompleteness.tsx +109 -0
- package/src/components/FieldFlowCompleteness/index.ts +2 -0
- package/src/components/FieldFlowFormHeader/FieldFlowFormHeader.tsx +106 -0
- package/src/components/FieldFlowFormHeader/index.ts +2 -0
- package/src/components/FieldFlowInfoTip/FieldFlowInfoTip.tsx +120 -0
- package/src/components/FieldFlowInfoTip/index.ts +2 -0
- package/src/components/FieldFlowInlineAlert/FieldFlowInlineAlert.tsx +134 -0
- package/src/components/FieldFlowInlineAlert/index.ts +2 -0
- package/src/components/FieldFlowInput/FieldFlowInput.tsx +71 -13
- package/src/components/FieldFlowInput/styles.ts +58 -16
- package/src/components/FieldFlowInput/types.ts +21 -0
- package/src/components/FieldFlowKeyboardToolbar/FieldFlowKeyboardToolbar.tsx +150 -0
- package/src/components/FieldFlowKeyboardToolbar/index.ts +5 -0
- package/src/components/FieldFlowSkeleton/FieldFlowSkeleton.tsx +105 -0
- package/src/components/FieldFlowSkeleton/index.ts +2 -0
- package/src/components/KeyboardAwareFormWrapper/KeyboardAwareFormWrapper.tsx +8 -4
- package/src/hooks/index.ts +17 -0
- package/src/hooks/useFieldFlowCompleteness.ts +69 -0
- package/src/hooks/useFieldFlowSubmitQueue.ts +206 -0
- package/src/hooks/useKeyboardManager.ts +26 -0
- package/src/hooks/useSmartPaste.ts +33 -0
- package/src/index.ts +90 -0
- package/src/paste/index.ts +7 -0
- package/src/paste/smartPaste.ts +132 -0
- package/src/schema/FieldFlowSchemaForm.tsx +274 -0
- package/src/schema/index.ts +8 -0
- package/src/schema/types.ts +63 -0
- package/src/theme/ThemeProvider.tsx +96 -7
- package/src/theme/appearance.ts +105 -0
- package/src/theme/defaultTheme.ts +11 -0
- package/src/theme/index.ts +1 -0
- package/src/types/globals.d.ts +2 -0
- package/src/types/index.ts +28 -0
package/README.md
CHANGED
|
@@ -48,6 +48,14 @@ Everything ships from `rn-inputforge`. Use this map to find the right export.
|
|
|
48
48
|
| Resume unfinished forms | [`useFieldFlowDraft`](#draft-resume) + [`FieldFlowDraftBanner`](#draft-resume) |
|
|
49
49
|
| Keyboard next / done across fields | [`useKeyboardManager`](#keyboard--form-navigation) + [`KeyboardAwareFormWrapper`](#keyboard--form-navigation) |
|
|
50
50
|
| Friction analytics + a11y on failed submit | [Form intelligence](#form-intelligence) |
|
|
51
|
+
| Autofill / password manager hints | [`autofill` / `autofillProfiles`](#autofill-profiles) |
|
|
52
|
+
| Keyboard Prev/Next/Done bar | [`FieldFlowKeyboardToolbar`](#keyboard-toolbar) |
|
|
53
|
+
| Smart paste (OTP / card / address) | [`routeSmartPaste`](#smart-paste) |
|
|
54
|
+
| “N fields left” progress coach | [`FieldFlowCompleteness`](#completeness-coach) |
|
|
55
|
+
| Passkey / SSO / biometric strip | [`FieldFlowAuthActions`](#auth-actions) |
|
|
56
|
+
| JSON schema → form UI | [`FieldFlowSchemaForm`](#schema-form-renderer) |
|
|
57
|
+
| Dev accessibility audit | [`FieldFlowA11yAudit`](#a11y-auditor) |
|
|
58
|
+
| Offline submit retry queue | [`useFieldFlowSubmitQueue`](#offline-submit-queue) |
|
|
51
59
|
| Already on React Hook Form | [`FieldFlowController`](#react-hook-form-adapter) |
|
|
52
60
|
|
|
53
61
|
### UI polish & branding
|
|
@@ -62,6 +70,10 @@ Everything ships from `rn-inputforge`. Use this map to find the right export.
|
|
|
62
70
|
| Look: outlined / filled / underline / floating | [Variants](#variants) |
|
|
63
71
|
| Built-in icons (no icon pack) | [Icons](#icons) |
|
|
64
72
|
| Brand colors in one line | [`themePresets`](#theming) · [`FieldFlowThemeProvider`](#theming) |
|
|
73
|
+
| Density / size / shape / surface | [`density` `size` `shape` `surface` `focusRing`](#visual-system) |
|
|
74
|
+
| Calm tips & alerts | [`FieldFlowInlineAlert`](#visual-system) · [`FieldFlowInfoTip`](#visual-system) |
|
|
75
|
+
| Loading skeletons | [`FieldFlowSkeleton`](#visual-system) |
|
|
76
|
+
| Form intro header | [`FieldFlowFormHeader`](#visual-system) |
|
|
65
77
|
|
|
66
78
|
### Helpers (also exported)
|
|
67
79
|
|
|
@@ -98,6 +110,18 @@ Masks (`applyMask`, `unmask`, …) · password strength (`evaluatePasswordStreng
|
|
|
98
110
|
| **i18n messages** | `locale` / `messages` (`en` `es` `fr` `de` `pt` `ar`) |
|
|
99
111
|
| **Credit card group** | `FieldFlowCreditCard` |
|
|
100
112
|
| **Signature pad** | `FieldFlowSignature` |
|
|
113
|
+
| **Autofill profiles** | `autofill` prop + `autofillProfiles.login/signup/…` |
|
|
114
|
+
| **Keyboard toolbar** | `FieldFlowKeyboardToolbar` Prev/Next/Done |
|
|
115
|
+
| **Smart paste** | `routeSmartPaste` / `useSmartPaste` |
|
|
116
|
+
| **Completeness coach** | `useFieldFlowCompleteness` + `FieldFlowCompleteness` |
|
|
117
|
+
| **Auth actions** | `FieldFlowAuthActions` (passkey / SSO / biometric slots) |
|
|
118
|
+
| **Schema form** | `FieldFlowSchemaForm` JSON → UI |
|
|
119
|
+
| **A11y auditor** | `runA11yAudit` + `FieldFlowA11yAudit` (dev) |
|
|
120
|
+
| **Submit queue** | `useFieldFlowSubmitQueue` offline / retry |
|
|
121
|
+
| **Visual system** | Density, size, shape, surface, focus rings |
|
|
122
|
+
| **Inline alert / skeleton / header** | `FieldFlowInlineAlert`, `FieldFlowSkeleton`, `FieldFlowFormHeader` |
|
|
123
|
+
| **Info tips + helper status** | `infoTip`, `helperStatus`, `FieldFlowInfoTip` |
|
|
124
|
+
| **Theme crossfade** | Soft fade when switching presets (`animateTheme`) |
|
|
101
125
|
|
|
102
126
|
Still from **0.4.0:** OTP, masks, date/time, checkbox/radio/switch, variants, icons, async + cross-field validation, Zod, Expo.
|
|
103
127
|
|
|
@@ -951,6 +975,172 @@ Handles expandable height, keyboard-avoiding behavior, and a send button that's
|
|
|
951
975
|
|
|
952
976
|
---
|
|
953
977
|
|
|
978
|
+
## Autofill profiles
|
|
979
|
+
|
|
980
|
+
```tsx
|
|
981
|
+
import { FieldFlowInput, autofillProfiles } from 'rn-inputforge';
|
|
982
|
+
|
|
983
|
+
<FieldFlowInput type="email" label="Email" autofill={autofillProfiles.signup.email} ... />
|
|
984
|
+
<FieldFlowInput type="password" label="Password" autofill="newPassword" ... />
|
|
985
|
+
<FieldFlowOTP autofill="oneTimeCode" ... /> // or pass through TextInput props
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
Roles: `email`, `password`, `newPassword`, `oneTimeCode`, `tel`, `name`, `streetAddress`, `ccNumber`, … — see `getAutofillProps` / `autofillProfiles`.
|
|
989
|
+
|
|
990
|
+
---
|
|
991
|
+
|
|
992
|
+
## Keyboard toolbar
|
|
993
|
+
|
|
994
|
+
```tsx
|
|
995
|
+
import {
|
|
996
|
+
FieldFlowKeyboardToolbar,
|
|
997
|
+
FIELD_FLOW_KEYBOARD_TOOLBAR_ID,
|
|
998
|
+
useKeyboardManager,
|
|
999
|
+
} from 'rn-inputforge';
|
|
1000
|
+
|
|
1001
|
+
const kb = useKeyboardManager({ order: ['email', 'password'], onSubmit: form.submit });
|
|
1002
|
+
|
|
1003
|
+
<>
|
|
1004
|
+
<FieldFlowInput
|
|
1005
|
+
inputAccessoryViewID={FIELD_FLOW_KEYBOARD_TOOLBAR_ID}
|
|
1006
|
+
...
|
|
1007
|
+
/>
|
|
1008
|
+
<FieldFlowKeyboardToolbar
|
|
1009
|
+
nativeID={FIELD_FLOW_KEYBOARD_TOOLBAR_ID}
|
|
1010
|
+
onPrevious={() => kb.focusPrevious(activeId)}
|
|
1011
|
+
onNext={() => kb.focusNext(activeId)}
|
|
1012
|
+
onDone={form.submit}
|
|
1013
|
+
canPrevious={kb.canGoPrevious(activeId)}
|
|
1014
|
+
canNext={kb.canGoNext(activeId)}
|
|
1015
|
+
/>
|
|
1016
|
+
</>
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
---
|
|
1020
|
+
|
|
1021
|
+
## Smart paste
|
|
1022
|
+
|
|
1023
|
+
```tsx
|
|
1024
|
+
import { routeSmartPaste, useSmartPaste } from 'rn-inputforge';
|
|
1025
|
+
|
|
1026
|
+
const { handlePaste } = useSmartPaste({
|
|
1027
|
+
targets: {
|
|
1028
|
+
otp: r => setCode(r.value),
|
|
1029
|
+
card: r => setCardNumber(r.raw ?? r.value),
|
|
1030
|
+
email: r => form.handleChange('email')(r.value),
|
|
1031
|
+
addressFields: addr => {
|
|
1032
|
+
form.handleChange('street')(addr.street ?? '');
|
|
1033
|
+
form.handleChange('city')(addr.city ?? '');
|
|
1034
|
+
},
|
|
1035
|
+
},
|
|
1036
|
+
});
|
|
1037
|
+
|
|
1038
|
+
// After Clipboard.getString():
|
|
1039
|
+
handlePaste(pastedText);
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
---
|
|
1043
|
+
|
|
1044
|
+
## Completeness coach
|
|
1045
|
+
|
|
1046
|
+
```tsx
|
|
1047
|
+
import { useFieldFlowCompleteness, FieldFlowCompleteness } from 'rn-inputforge';
|
|
1048
|
+
|
|
1049
|
+
const completeness = useFieldFlowCompleteness({
|
|
1050
|
+
values: form.values,
|
|
1051
|
+
requiredFields: ['name', 'email', 'password'],
|
|
1052
|
+
});
|
|
1053
|
+
|
|
1054
|
+
<FieldFlowCompleteness completeness={completeness} />;
|
|
1055
|
+
```
|
|
1056
|
+
|
|
1057
|
+
---
|
|
1058
|
+
|
|
1059
|
+
## Auth actions
|
|
1060
|
+
|
|
1061
|
+
```tsx
|
|
1062
|
+
import { FieldFlowAuthActions } from 'rn-inputforge';
|
|
1063
|
+
|
|
1064
|
+
<FieldFlowAuthActions
|
|
1065
|
+
actions={[
|
|
1066
|
+
{ id: 'passkey', label: 'Passkey', icon: 'key', onPress: signInWithPasskey },
|
|
1067
|
+
{ id: 'apple', label: 'Apple', icon: 'user', onPress: signInWithApple },
|
|
1068
|
+
{ id: 'google', label: 'Google', icon: 'globe', onPress: signInWithGoogle },
|
|
1069
|
+
]}
|
|
1070
|
+
/>
|
|
1071
|
+
```
|
|
1072
|
+
|
|
1073
|
+
---
|
|
1074
|
+
|
|
1075
|
+
## Schema form renderer
|
|
1076
|
+
|
|
1077
|
+
```tsx
|
|
1078
|
+
import { FieldFlowSchemaForm, type FieldFlowFormSchema } from 'rn-inputforge';
|
|
1079
|
+
|
|
1080
|
+
const schema: FieldFlowFormSchema = {
|
|
1081
|
+
fields: [
|
|
1082
|
+
{ name: 'name', type: 'text', label: 'Name', required: true, section: 'profile', autofill: 'name' },
|
|
1083
|
+
{ name: 'email', type: 'email', label: 'Email', required: true, section: 'profile' },
|
|
1084
|
+
{ name: 'plan', type: 'segmented', label: 'Plan', options: [
|
|
1085
|
+
{ label: 'Free', value: 'free' },
|
|
1086
|
+
{ label: 'Pro', value: 'pro' },
|
|
1087
|
+
]},
|
|
1088
|
+
],
|
|
1089
|
+
sections: [{ id: 'profile', title: 'Profile', icon: 'user' }],
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
<FieldFlowSchemaForm
|
|
1093
|
+
schema={schema}
|
|
1094
|
+
onSubmit={async values => api.save(values)}
|
|
1095
|
+
renderFooter={({ submit, isSubmitting }) => (
|
|
1096
|
+
<Button title={isSubmitting ? '…' : 'Save'} onPress={() => void submit()} />
|
|
1097
|
+
)}
|
|
1098
|
+
/>;
|
|
1099
|
+
```
|
|
1100
|
+
|
|
1101
|
+
---
|
|
1102
|
+
|
|
1103
|
+
## A11y auditor
|
|
1104
|
+
|
|
1105
|
+
```tsx
|
|
1106
|
+
import { FieldFlowA11yAudit, runA11yAudit } from 'rn-inputforge';
|
|
1107
|
+
|
|
1108
|
+
<FieldFlowA11yAudit
|
|
1109
|
+
audit={{
|
|
1110
|
+
fields: [
|
|
1111
|
+
{ name: 'email', label: 'Email', required: true, hasAccessibilityLabel: true },
|
|
1112
|
+
{ name: 'bio', placeholderOnly: true, hitHeight: 36 },
|
|
1113
|
+
],
|
|
1114
|
+
respectsReducedMotion: true,
|
|
1115
|
+
}}
|
|
1116
|
+
/>;
|
|
1117
|
+
```
|
|
1118
|
+
|
|
1119
|
+
Dev-only by default (`devOnly`).
|
|
1120
|
+
|
|
1121
|
+
---
|
|
1122
|
+
|
|
1123
|
+
## Offline submit queue
|
|
1124
|
+
|
|
1125
|
+
```tsx
|
|
1126
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
1127
|
+
import { useFieldFlowSubmitQueue } from 'rn-inputforge';
|
|
1128
|
+
|
|
1129
|
+
const queue = useFieldFlowSubmitQueue({
|
|
1130
|
+
key: 'signup-queue',
|
|
1131
|
+
storage: AsyncStorage,
|
|
1132
|
+
submit: async payload => {
|
|
1133
|
+
await api.signup(payload);
|
|
1134
|
+
},
|
|
1135
|
+
});
|
|
1136
|
+
|
|
1137
|
+
// Instead of failing hard when offline:
|
|
1138
|
+
await queue.enqueue(form.values);
|
|
1139
|
+
// queue.pendingCount / queue.flush() / queue.clear()
|
|
1140
|
+
```
|
|
1141
|
+
|
|
1142
|
+
---
|
|
1143
|
+
|
|
954
1144
|
## Custom render slots
|
|
955
1145
|
|
|
956
1146
|
Most controls accept optional render props so apps can keep FieldFlow behavior and swap chrome:
|
|
@@ -991,6 +1181,52 @@ Defaults stay unchanged when you omit these props.
|
|
|
991
1181
|
|
|
992
1182
|
---
|
|
993
1183
|
|
|
1184
|
+
## Visual system
|
|
1185
|
+
|
|
1186
|
+
One-liner knobs on `FieldFlowThemeProvider` — easy on the eyes, fully customizable:
|
|
1187
|
+
|
|
1188
|
+
```tsx
|
|
1189
|
+
<FieldFlowThemeProvider
|
|
1190
|
+
theme={themePresets.soft}
|
|
1191
|
+
density="comfortable" // compact | comfortable | spacious
|
|
1192
|
+
size="md" // sm | md | lg
|
|
1193
|
+
shape="rounded" // square | rounded | pill
|
|
1194
|
+
surface="soft" // flat | elevated | soft | inset
|
|
1195
|
+
focusRing="softGlow" // solid | softGlow | underlinePulse
|
|
1196
|
+
animateTheme // soft crossfade when theme changes
|
|
1197
|
+
>
|
|
1198
|
+
<App />
|
|
1199
|
+
</FieldFlowThemeProvider>
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
### Inline alert / skeleton / form header
|
|
1203
|
+
|
|
1204
|
+
```tsx
|
|
1205
|
+
<FieldFlowFormHeader
|
|
1206
|
+
title="Create account"
|
|
1207
|
+
subtitle="A calm start — we’ll guide you through a few short steps."
|
|
1208
|
+
progress={0.35}
|
|
1209
|
+
/>
|
|
1210
|
+
|
|
1211
|
+
<FieldFlowInlineAlert tone="info" title="Privacy" message="We’ll never share your email." />
|
|
1212
|
+
|
|
1213
|
+
{loading ? <FieldFlowSkeleton count={4} lastMultiline /> : <FormFields />}
|
|
1214
|
+
```
|
|
1215
|
+
|
|
1216
|
+
### Info tip + helper status
|
|
1217
|
+
|
|
1218
|
+
```tsx
|
|
1219
|
+
<FieldFlowInput
|
|
1220
|
+
label="Tax ID"
|
|
1221
|
+
infoTip="Used only for invoices. Never shown publicly."
|
|
1222
|
+
helperText="Optional for personal accounts"
|
|
1223
|
+
helperStatus="info"
|
|
1224
|
+
...
|
|
1225
|
+
/>
|
|
1226
|
+
```
|
|
1227
|
+
|
|
1228
|
+
---
|
|
1229
|
+
|
|
994
1230
|
## Motion & UI
|
|
995
1231
|
|
|
996
1232
|
### Field motion
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.runA11yAudit = runA11yAudit;
|
|
7
|
+
/**
|
|
8
|
+
* Dev-time accessibility audit for FieldFlow forms.
|
|
9
|
+
* Call in `__DEV__` and log / render via `FieldFlowA11yAudit`.
|
|
10
|
+
*/
|
|
11
|
+
function runA11yAudit(input) {
|
|
12
|
+
const minHit = input.minHitTarget ?? 44;
|
|
13
|
+
const issues = [];
|
|
14
|
+
for (const field of input.fields) {
|
|
15
|
+
if (!field.label && !field.hasAccessibilityLabel) {
|
|
16
|
+
issues.push({
|
|
17
|
+
id: `label-${field.name}`,
|
|
18
|
+
severity: 'error',
|
|
19
|
+
field: field.name,
|
|
20
|
+
message: `Field "${field.name}" has no visible label or accessibilityLabel`
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (field.placeholderOnly && !field.label) {
|
|
24
|
+
issues.push({
|
|
25
|
+
id: `placeholder-${field.name}`,
|
|
26
|
+
severity: 'warn',
|
|
27
|
+
field: field.name,
|
|
28
|
+
message: `Field "${field.name}" relies on placeholder as the only label`
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (field.required && field.label && !/\*|required/i.test(field.label) && !field.hasAccessibilityLabel) {
|
|
32
|
+
issues.push({
|
|
33
|
+
id: `required-${field.name}`,
|
|
34
|
+
severity: 'info',
|
|
35
|
+
field: field.name,
|
|
36
|
+
message: `Required field "${field.name}" — ensure required state is announced`
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (field.hasError && !field.errorText) {
|
|
40
|
+
issues.push({
|
|
41
|
+
id: `error-text-${field.name}`,
|
|
42
|
+
severity: 'error',
|
|
43
|
+
field: field.name,
|
|
44
|
+
message: `Field "${field.name}" is in error state without errorText for screen readers`
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (field.hitHeight != null && field.hitHeight < minHit) {
|
|
48
|
+
issues.push({
|
|
49
|
+
id: `hit-${field.name}`,
|
|
50
|
+
severity: 'warn',
|
|
51
|
+
field: field.name,
|
|
52
|
+
message: `Field "${field.name}" hit target ~${field.hitHeight}px (min ${minHit})`
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (input.respectsReducedMotion === false) {
|
|
57
|
+
issues.push({
|
|
58
|
+
id: 'reduced-motion',
|
|
59
|
+
severity: 'warn',
|
|
60
|
+
message: 'Animations may not respect Reduce Motion — use motion={false} or useReducedMotion'
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (input.fields.length === 0) {
|
|
64
|
+
issues.push({
|
|
65
|
+
id: 'empty',
|
|
66
|
+
severity: 'info',
|
|
67
|
+
message: 'No fields registered for audit'
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return issues;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["runA11yAudit","input","minHit","minHitTarget","issues","field","fields","label","hasAccessibilityLabel","push","id","name","severity","message","placeholderOnly","required","test","hasError","errorText","hitHeight","respectsReducedMotion","length"],"sourceRoot":"../../../src","sources":["a11y/audit.ts"],"mappings":";;;;;;AA8BA;AACA;AACA;AACA;AACO,SAASA,YAAYA,CAACC,KAA8B,EAAwB;EACjF,MAAMC,MAAM,GAAGD,KAAK,CAACE,YAAY,IAAI,EAAE;EACvC,MAAMC,MAA4B,GAAG,EAAE;EAEvC,KAAK,MAAMC,KAAK,IAAIJ,KAAK,CAACK,MAAM,EAAE;IAChC,IAAI,CAACD,KAAK,CAACE,KAAK,IAAI,CAACF,KAAK,CAACG,qBAAqB,EAAE;MAChDJ,MAAM,CAACK,IAAI,CAAC;QACVC,EAAE,EAAE,SAASL,KAAK,CAACM,IAAI,EAAE;QACzBC,QAAQ,EAAE,OAAO;QACjBP,KAAK,EAAEA,KAAK,CAACM,IAAI;QACjBE,OAAO,EAAE,UAAUR,KAAK,CAACM,IAAI;MAC/B,CAAC,CAAC;IACJ;IACA,IAAIN,KAAK,CAACS,eAAe,IAAI,CAACT,KAAK,CAACE,KAAK,EAAE;MACzCH,MAAM,CAACK,IAAI,CAAC;QACVC,EAAE,EAAE,eAAeL,KAAK,CAACM,IAAI,EAAE;QAC/BC,QAAQ,EAAE,MAAM;QAChBP,KAAK,EAAEA,KAAK,CAACM,IAAI;QACjBE,OAAO,EAAE,UAAUR,KAAK,CAACM,IAAI;MAC/B,CAAC,CAAC;IACJ;IACA,IAAIN,KAA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IAC7BjB,MAAM,CAACK,IAAI,CAAC;MACVC,EAAE,EAAE,OAAO;MACXE,QAAQ,EAAE,MAAM;MAChBC,OAAO,EAAE;IACX,CAAC,CAAC;EACJ;EAEA,OAAOT,MAAM;AACf","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "runA11yAudit", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _audit.runA11yAudit;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _audit = require("./audit");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_audit","require"],"sourceRoot":"../../../src","sources":["a11y/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "autofillProfiles", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _profiles.autofillProfiles;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "autofillRoleFromFieldType", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _profiles.autofillRoleFromFieldType;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "getAutofillProps", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _profiles.getAutofillProps;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var _profiles = require("./profiles");
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_profiles","require"],"sourceRoot":"../../../src","sources":["autofill/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.autofillProfiles = void 0;
|
|
7
|
+
exports.autofillRoleFromFieldType = autofillRoleFromFieldType;
|
|
8
|
+
exports.getAutofillProps = getAutofillProps;
|
|
9
|
+
/**
|
|
10
|
+
* Semantic autofill roles — map to platform `autoComplete` + iOS `textContentType`.
|
|
11
|
+
* Pass as `autofill="email"` on `FieldFlowInput`, or use a profile bundle.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const ROLE_MAP = {
|
|
15
|
+
off: {
|
|
16
|
+
autoComplete: 'off',
|
|
17
|
+
textContentType: 'none',
|
|
18
|
+
importantForAutofill: 'no'
|
|
19
|
+
},
|
|
20
|
+
name: {
|
|
21
|
+
autoComplete: 'name',
|
|
22
|
+
textContentType: 'name',
|
|
23
|
+
importantForAutofill: 'yes',
|
|
24
|
+
autoCapitalize: 'words'
|
|
25
|
+
},
|
|
26
|
+
givenName: {
|
|
27
|
+
autoComplete: 'given-name',
|
|
28
|
+
textContentType: 'givenName',
|
|
29
|
+
importantForAutofill: 'yes',
|
|
30
|
+
autoCapitalize: 'words'
|
|
31
|
+
},
|
|
32
|
+
familyName: {
|
|
33
|
+
autoComplete: 'family-name',
|
|
34
|
+
textContentType: 'familyName',
|
|
35
|
+
importantForAutofill: 'yes',
|
|
36
|
+
autoCapitalize: 'words'
|
|
37
|
+
},
|
|
38
|
+
email: {
|
|
39
|
+
autoComplete: 'email',
|
|
40
|
+
textContentType: 'emailAddress',
|
|
41
|
+
importantForAutofill: 'yes',
|
|
42
|
+
autoCapitalize: 'none',
|
|
43
|
+
autoCorrect: false
|
|
44
|
+
},
|
|
45
|
+
username: {
|
|
46
|
+
autoComplete: 'username',
|
|
47
|
+
textContentType: 'username',
|
|
48
|
+
importantForAutofill: 'yes',
|
|
49
|
+
autoCapitalize: 'none',
|
|
50
|
+
autoCorrect: false
|
|
51
|
+
},
|
|
52
|
+
password: {
|
|
53
|
+
autoComplete: 'password',
|
|
54
|
+
textContentType: 'password',
|
|
55
|
+
importantForAutofill: 'yes',
|
|
56
|
+
autoCapitalize: 'none',
|
|
57
|
+
autoCorrect: false
|
|
58
|
+
},
|
|
59
|
+
newPassword: {
|
|
60
|
+
autoComplete: 'password-new',
|
|
61
|
+
textContentType: 'newPassword',
|
|
62
|
+
importantForAutofill: 'yes',
|
|
63
|
+
autoCapitalize: 'none',
|
|
64
|
+
autoCorrect: false
|
|
65
|
+
},
|
|
66
|
+
oneTimeCode: {
|
|
67
|
+
autoComplete: 'sms-otp',
|
|
68
|
+
textContentType: 'oneTimeCode',
|
|
69
|
+
importantForAutofill: 'yes',
|
|
70
|
+
autoCapitalize: 'none',
|
|
71
|
+
autoCorrect: false
|
|
72
|
+
},
|
|
73
|
+
tel: {
|
|
74
|
+
autoComplete: 'tel',
|
|
75
|
+
textContentType: 'telephoneNumber',
|
|
76
|
+
importantForAutofill: 'yes'
|
|
77
|
+
},
|
|
78
|
+
streetAddress: {
|
|
79
|
+
autoComplete: 'street-address',
|
|
80
|
+
textContentType: 'fullStreetAddress',
|
|
81
|
+
importantForAutofill: 'yes'
|
|
82
|
+
},
|
|
83
|
+
postalCode: {
|
|
84
|
+
autoComplete: 'postal-code',
|
|
85
|
+
textContentType: 'postalCode',
|
|
86
|
+
importantForAutofill: 'yes'
|
|
87
|
+
},
|
|
88
|
+
addressCity: {
|
|
89
|
+
autoComplete: 'postal-address-locality',
|
|
90
|
+
textContentType: 'addressCity',
|
|
91
|
+
importantForAutofill: 'yes',
|
|
92
|
+
autoCapitalize: 'words'
|
|
93
|
+
},
|
|
94
|
+
addressState: {
|
|
95
|
+
autoComplete: 'postal-address-region',
|
|
96
|
+
textContentType: 'addressState',
|
|
97
|
+
importantForAutofill: 'yes'
|
|
98
|
+
},
|
|
99
|
+
country: {
|
|
100
|
+
autoComplete: 'country',
|
|
101
|
+
textContentType: 'countryName',
|
|
102
|
+
importantForAutofill: 'yes'
|
|
103
|
+
},
|
|
104
|
+
ccNumber: {
|
|
105
|
+
autoComplete: 'cc-number',
|
|
106
|
+
textContentType: 'creditCardNumber',
|
|
107
|
+
importantForAutofill: 'yes'
|
|
108
|
+
},
|
|
109
|
+
ccExp: {
|
|
110
|
+
autoComplete: 'cc-exp',
|
|
111
|
+
textContentType: 'creditCardExpiration',
|
|
112
|
+
importantForAutofill: 'yes'
|
|
113
|
+
},
|
|
114
|
+
ccCsc: {
|
|
115
|
+
autoComplete: 'cc-csc',
|
|
116
|
+
textContentType: 'creditCardSecurityCode',
|
|
117
|
+
importantForAutofill: 'yes'
|
|
118
|
+
},
|
|
119
|
+
ccName: {
|
|
120
|
+
autoComplete: 'cc-name',
|
|
121
|
+
textContentType: 'creditCardName',
|
|
122
|
+
importantForAutofill: 'yes',
|
|
123
|
+
autoCapitalize: 'words'
|
|
124
|
+
},
|
|
125
|
+
organization: {
|
|
126
|
+
autoComplete: 'organization',
|
|
127
|
+
textContentType: 'organizationName',
|
|
128
|
+
importantForAutofill: 'yes',
|
|
129
|
+
autoCapitalize: 'words'
|
|
130
|
+
},
|
|
131
|
+
url: {
|
|
132
|
+
autoComplete: 'url',
|
|
133
|
+
textContentType: 'URL',
|
|
134
|
+
importantForAutofill: 'yes',
|
|
135
|
+
autoCapitalize: 'none',
|
|
136
|
+
autoCorrect: false
|
|
137
|
+
},
|
|
138
|
+
birthdate: {
|
|
139
|
+
autoComplete: 'birthdate-full',
|
|
140
|
+
textContentType: 'none',
|
|
141
|
+
importantForAutofill: 'yes'
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/** Resolve platform autofill props for a semantic role. */
|
|
146
|
+
function getAutofillProps(role) {
|
|
147
|
+
return ROLE_MAP[role] ?? ROLE_MAP.off;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Infer a sensible autofill role from FieldFlow `type` when no explicit role is set. */
|
|
151
|
+
function autofillRoleFromFieldType(type) {
|
|
152
|
+
switch (type) {
|
|
153
|
+
case 'email':
|
|
154
|
+
return 'email';
|
|
155
|
+
case 'phone':
|
|
156
|
+
return 'tel';
|
|
157
|
+
case 'password':
|
|
158
|
+
return 'password';
|
|
159
|
+
default:
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Named screen profiles — spread onto multiple fields.
|
|
166
|
+
* Example: `autofillProfiles.signup.email` → role `'email'`.
|
|
167
|
+
*/
|
|
168
|
+
const autofillProfiles = exports.autofillProfiles = {
|
|
169
|
+
login: {
|
|
170
|
+
email: 'email',
|
|
171
|
+
username: 'username',
|
|
172
|
+
password: 'password'
|
|
173
|
+
},
|
|
174
|
+
signup: {
|
|
175
|
+
name: 'name',
|
|
176
|
+
email: 'email',
|
|
177
|
+
password: 'newPassword',
|
|
178
|
+
phone: 'tel'
|
|
179
|
+
},
|
|
180
|
+
shipping: {
|
|
181
|
+
name: 'name',
|
|
182
|
+
street: 'streetAddress',
|
|
183
|
+
city: 'addressCity',
|
|
184
|
+
state: 'addressState',
|
|
185
|
+
postalCode: 'postalCode',
|
|
186
|
+
country: 'country',
|
|
187
|
+
phone: 'tel'
|
|
188
|
+
},
|
|
189
|
+
payment: {
|
|
190
|
+
name: 'ccName',
|
|
191
|
+
number: 'ccNumber',
|
|
192
|
+
expiry: 'ccExp',
|
|
193
|
+
cvc: 'ccCsc'
|
|
194
|
+
},
|
|
195
|
+
otp: {
|
|
196
|
+
code: 'oneTimeCode'
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=profiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ROLE_MAP","off","autoComplete","textContentType","importantForAutofill","name","autoCapitalize","givenName","familyName","email","autoCorrect","username","password","newPassword","oneTimeCode","tel","streetAddress","postalCode","addressCity","addressState","country","ccNumber","ccExp","ccCsc","ccName","organization","url","birthdate","getAutofillProps","role","autofillRoleFromFieldType","type","undefined","autofillProfiles","exports","login","signup","phone","shipping","street","city","state","payment","number","expiry","cvc","otp","code"],"sourceRoot":"../../../src","sources":["autofill/profiles.ts"],"mappings":";;;;;;;;AAEA;AACA;AACA;AACA;;AA8BA,MAAMA,QAA+D,GAAG;EACtEC,GAAG,EAAE;IACHC,YAAY,EAAE,KAAK;IACnBC,eAAe,EAAE,MAAM;IACvBC,oBAAoB,EAAE;EACxB,CAAC;EACDC,IAAI,EAAE;IACJH,YAAY,EAAE,MAAM;IACpBC,eAAe,EAAE,MAAM;IACvBC,oBAAoB,EAAE,KAAK;IAC3BE,cAAc,EAAE;EAClB,CAAC;EACDC,SAAS,EAAE;IACTL,YAAY,EAAE,YAAY;IAC1BC,eAAe,EAAE,WAAW;IAC5BC,oBAAoB,EAAE,KAAK;IAC3BE,cAAc,EAAE;EAClB,CAAC;EACDE,UAAU,EAAE;IACVN,YAAY,EAAE,aAAa;IAC3BC,eAAe,EAAE,YAAY;IAC7BC,oBAAoB,EAAE,KAAK;IAC3BE,cAAc,EAAE;EAClB,CAAC;EACDG,KAAK,EAAE;IACLP,YAAY,EAAE,OAAO;IACrBC,eAAe,EAAE,cAAc;IAC/BC,oBAAoB,EAAE,KAAK;IAC3BE,cAAc,EAAE,MAAM;IACtBI,WAAW,EAAE;EACf,CAAC;EACDC,QAAQ,EAAE;IACRT,YAAY,EAAE,UAAU;IACxBC,eAAe,EAAE,UAAU;IAC3BC,oBAAoB,EAAE,KAAK;IAC3BE,cAAc,EAAE,MAAM;IACtBI,WAAW,EAAE;EACf,CAAC;EACDE,QAAQ,EAAE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