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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { FieldFlowRules, FieldFlowOption, FieldFlowVariant } from '../types';
|
|
2
|
+
import type { FieldFlowAutofillRole } from '../autofill/profiles';
|
|
3
|
+
import type { FieldFlowIconSource } from '../icons';
|
|
4
|
+
export type FieldFlowSchemaFieldType = 'text' | 'email' | 'phone' | 'password' | 'number' | 'decimal' | 'search' | 'multiline' | 'switch' | 'checkbox' | 'radio' | 'segmented' | 'dropdown' | 'tags' | 'rating' | 'slider' | 'stepper';
|
|
5
|
+
export interface FieldFlowSchemaField {
|
|
6
|
+
name: string;
|
|
7
|
+
type: FieldFlowSchemaFieldType;
|
|
8
|
+
label?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
rules?: FieldFlowRules;
|
|
13
|
+
variant?: FieldFlowVariant;
|
|
14
|
+
autofill?: FieldFlowAutofillRole;
|
|
15
|
+
leftIcon?: FieldFlowIconSource;
|
|
16
|
+
options?: FieldFlowOption[];
|
|
17
|
+
/** For slider / stepper / rating. */
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
step?: number;
|
|
21
|
+
/** Show when predicate returns true (values bag). */
|
|
22
|
+
showWhen?: string;
|
|
23
|
+
/** JSON-serializable expression keys — resolved by `showWhenFns` map on the renderer. */
|
|
24
|
+
section?: string;
|
|
25
|
+
suggestions?: boolean | 'email' | 'phone' | 'currency';
|
|
26
|
+
showStrength?: boolean;
|
|
27
|
+
prefix?: string;
|
|
28
|
+
suffix?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface FieldFlowSchemaSection {
|
|
31
|
+
id: string;
|
|
32
|
+
title?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
icon?: FieldFlowIconSource;
|
|
35
|
+
collapsible?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface FieldFlowFormSchema {
|
|
38
|
+
fields: FieldFlowSchemaField[];
|
|
39
|
+
sections?: FieldFlowSchemaSection[];
|
|
40
|
+
/** Initial string values for text-like fields. */
|
|
41
|
+
initialValues?: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,OAAO,GACP,OAAO,GACP,UAAU,GACV,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,UAAU,GACV,OAAO,GACP,WAAW,GACX,UAAU,GACV,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,wBAAwB,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,qCAAqC;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;IACvD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACpC,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC"}
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { DeepPartial, FieldFlowTheme } from '../types';
|
|
2
|
+
import type { DeepPartial, FieldFlowControlSize, FieldFlowDensity, FieldFlowFocusRing, FieldFlowShape, FieldFlowSurface, FieldFlowTheme } from '../types';
|
|
3
3
|
declare function mergeDeep<T extends Record<string, any>>(base: T, override?: DeepPartial<T>): T;
|
|
4
4
|
export interface FieldFlowThemeProviderProps {
|
|
5
5
|
theme?: DeepPartial<FieldFlowTheme>;
|
|
6
|
+
/** Form-wide density. Default: comfortable. */
|
|
7
|
+
density?: FieldFlowDensity;
|
|
8
|
+
/** Control size scale. Default: md. */
|
|
9
|
+
size?: FieldFlowControlSize;
|
|
10
|
+
/** Surface depth language. Default: flat. */
|
|
11
|
+
surface?: FieldFlowSurface;
|
|
12
|
+
/** Corner shape. Default: rounded. */
|
|
13
|
+
shape?: FieldFlowShape;
|
|
14
|
+
/** Focus ring style. Default: softGlow. */
|
|
15
|
+
focusRing?: FieldFlowFocusRing;
|
|
16
|
+
/**
|
|
17
|
+
* Soft crossfade when the resolved theme changes (e.g. switching presets).
|
|
18
|
+
* Default: true. Skipped when Reduce Motion is on.
|
|
19
|
+
*/
|
|
20
|
+
animateTheme?: boolean;
|
|
6
21
|
children: React.ReactNode;
|
|
7
22
|
}
|
|
8
23
|
/**
|
|
9
24
|
* Wrap your app (or a screen/form) in this provider to apply a custom theme.
|
|
10
|
-
*
|
|
11
|
-
* so you only need to specify what you want to change.
|
|
25
|
+
* Density / size / shape / surface / focusRing are one-liner visual knobs.
|
|
12
26
|
*/
|
|
13
|
-
export declare function FieldFlowThemeProvider({ theme, children }: FieldFlowThemeProviderProps): React.JSX.Element;
|
|
27
|
+
export declare function FieldFlowThemeProvider({ theme, density, size, surface, shape, focusRing, animateTheme, children, }: FieldFlowThemeProviderProps): React.JSX.Element;
|
|
14
28
|
export declare function useFieldFlowTheme(): FieldFlowTheme;
|
|
15
29
|
export { mergeDeep };
|
|
16
30
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAErF,OAAO,KAAK,EACV,WAAW,EAEX,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACf,MAAM,UAAU,CAAC;AAOlB,iBAAS,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAmBvF;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IACpC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,uCAAuC;IACvC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,sCAAsC;IACtC,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EACL,SAAS,EACT,YAAmB,EACnB,QAAQ,GACT,EAAE,2BAA2B,qBA2D7B;AAED,wBAAgB,iBAAiB,IAAI,cAAc,CAElD;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FieldFlowAppearance, FieldFlowControlSize, FieldFlowDensity, FieldFlowFocusRing, FieldFlowShape, FieldFlowSurface, FieldFlowTheme } from '../types';
|
|
2
|
+
export declare const defaultAppearance: FieldFlowAppearance;
|
|
3
|
+
/**
|
|
4
|
+
* Apply density / size / shape onto spacing + typography.
|
|
5
|
+
* Surface and focusRing stay as appearance flags for components to read.
|
|
6
|
+
*/
|
|
7
|
+
export declare function applyAppearance(theme: FieldFlowTheme, appearance?: Partial<FieldFlowAppearance>): FieldFlowTheme;
|
|
8
|
+
export declare function surfaceShadow(surface: FieldFlowSurface): {
|
|
9
|
+
shadowColor?: string;
|
|
10
|
+
shadowOpacity?: number;
|
|
11
|
+
shadowRadius?: number;
|
|
12
|
+
shadowOffset?: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
elevation?: number;
|
|
17
|
+
} | null;
|
|
18
|
+
export type { FieldFlowDensity, FieldFlowControlSize, FieldFlowSurface, FieldFlowShape, FieldFlowFocusRing };
|
|
19
|
+
//# sourceMappingURL=appearance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../../src/theme/appearance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,iBAAiB,EAAE,mBAM/B,CAAC;AAwBF;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,EACrB,UAAU,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAC5C,cAAc,CA0BhB;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,gBAAgB,GAAG;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAqBP;AAED,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../../src/theme/defaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../../src/theme/defaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,eAAO,MAAM,YAAY,EAAE,cAwC1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,cAuBvB,CAAC"}
|
|
@@ -3,4 +3,5 @@ export { FieldFlowThemeProvider, useFieldFlowTheme, mergeDeep } from './ThemePro
|
|
|
3
3
|
export type { FieldFlowThemeProviderProps } from './ThemeProvider';
|
|
4
4
|
export { themePresets, getThemePreset } from './presets';
|
|
5
5
|
export type { FieldFlowThemePresetName } from './presets';
|
|
6
|
+
export { applyAppearance, defaultAppearance, surfaceShadow } from './appearance';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -51,6 +51,14 @@ export interface FieldFlowColors {
|
|
|
51
51
|
success: string;
|
|
52
52
|
icon: string;
|
|
53
53
|
iconFocused: string;
|
|
54
|
+
/** Soft warning (amber). */
|
|
55
|
+
warning: string;
|
|
56
|
+
/** Informational blue/teal. */
|
|
57
|
+
info: string;
|
|
58
|
+
/** Muted surface for soft / inset wells. */
|
|
59
|
+
surfaceMuted: string;
|
|
60
|
+
/** Elevated card surface. */
|
|
61
|
+
surfaceElevated: string;
|
|
54
62
|
}
|
|
55
63
|
export interface FieldFlowSpacing {
|
|
56
64
|
paddingHorizontal: number;
|
|
@@ -71,11 +79,29 @@ export interface FieldFlowAnimationConfig {
|
|
|
71
79
|
duration: number;
|
|
72
80
|
useNativeDriver: boolean;
|
|
73
81
|
}
|
|
82
|
+
/** Form-wide visual rhythm. */
|
|
83
|
+
export type FieldFlowDensity = 'compact' | 'comfortable' | 'spacious';
|
|
84
|
+
/** Control scale. */
|
|
85
|
+
export type FieldFlowControlSize = 'sm' | 'md' | 'lg';
|
|
86
|
+
/** Chrome depth. */
|
|
87
|
+
export type FieldFlowSurface = 'flat' | 'elevated' | 'soft' | 'inset';
|
|
88
|
+
/** Corner language. */
|
|
89
|
+
export type FieldFlowShape = 'square' | 'rounded' | 'pill';
|
|
90
|
+
/** Focus treatment. */
|
|
91
|
+
export type FieldFlowFocusRing = 'solid' | 'softGlow' | 'underlinePulse';
|
|
92
|
+
export interface FieldFlowAppearance {
|
|
93
|
+
density: FieldFlowDensity;
|
|
94
|
+
size: FieldFlowControlSize;
|
|
95
|
+
surface: FieldFlowSurface;
|
|
96
|
+
shape: FieldFlowShape;
|
|
97
|
+
focusRing: FieldFlowFocusRing;
|
|
98
|
+
}
|
|
74
99
|
export interface FieldFlowTheme {
|
|
75
100
|
colors: FieldFlowColors;
|
|
76
101
|
spacing: FieldFlowSpacing;
|
|
77
102
|
typography: FieldFlowTypography;
|
|
78
103
|
animation: FieldFlowAnimationConfig;
|
|
104
|
+
appearance: FieldFlowAppearance;
|
|
79
105
|
}
|
|
80
106
|
export type DeepPartial<T> = {
|
|
81
107
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEnF,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,IAAI,CAAC,EAAE,OAAO,UAAU,EAAE,mBAAmB,CAAC;CAC/C;AAED,mDAAmD;AACnD,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAEhF,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,GACT,OAAO,GACP,UAAU,GACV,QAAQ,GACR,WAAW,GACX,aAAa,GACb,MAAM,CAAC;AAEX,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,UAAU,GACV,UAAU,GACV,SAAS,CAAC;AAEd,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,gBAAgB,CAAC;AAE5D,MAAM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package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rn-inputforge",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "A production-ready React Native input/form system (bare CLI & Expo) —
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "A production-ready React Native input/form system (bare CLI & Expo) — density/size/shape/surface theming, calm alerts, skeletons, form headers, autofill, wizard, drafts, motion, and a full field kit. Pure JS/TS, no native modules.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export type FieldFlowA11ySeverity = 'error' | 'warn' | 'info';
|
|
2
|
+
|
|
3
|
+
export interface FieldFlowA11yIssue {
|
|
4
|
+
id: string;
|
|
5
|
+
severity: FieldFlowA11ySeverity;
|
|
6
|
+
message: string;
|
|
7
|
+
field?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface FieldFlowA11yFieldSnapshot {
|
|
11
|
+
name: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
hasError?: boolean;
|
|
14
|
+
errorText?: string;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
/** Approximate hit target height in px (optional). */
|
|
17
|
+
hitHeight?: number;
|
|
18
|
+
/** True if accessibilityLabel / labelledBy is set. */
|
|
19
|
+
hasAccessibilityLabel?: boolean;
|
|
20
|
+
placeholderOnly?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface FieldFlowA11yAuditInput {
|
|
24
|
+
fields: FieldFlowA11yFieldSnapshot[];
|
|
25
|
+
/** Form uses Reduce Motion–aware animations. */
|
|
26
|
+
respectsReducedMotion?: boolean;
|
|
27
|
+
/** Min touch target. Default: 44. */
|
|
28
|
+
minHitTarget?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Dev-time accessibility audit for FieldFlow forms.
|
|
33
|
+
* Call in `__DEV__` and log / render via `FieldFlowA11yAudit`.
|
|
34
|
+
*/
|
|
35
|
+
export function runA11yAudit(input: FieldFlowA11yAuditInput): FieldFlowA11yIssue[] {
|
|
36
|
+
const minHit = input.minHitTarget ?? 44;
|
|
37
|
+
const issues: FieldFlowA11yIssue[] = [];
|
|
38
|
+
|
|
39
|
+
for (const field of input.fields) {
|
|
40
|
+
if (!field.label && !field.hasAccessibilityLabel) {
|
|
41
|
+
issues.push({
|
|
42
|
+
id: `label-${field.name}`,
|
|
43
|
+
severity: 'error',
|
|
44
|
+
field: field.name,
|
|
45
|
+
message: `Field "${field.name}" has no visible label or accessibilityLabel`,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (field.placeholderOnly && !field.label) {
|
|
49
|
+
issues.push({
|
|
50
|
+
id: `placeholder-${field.name}`,
|
|
51
|
+
severity: 'warn',
|
|
52
|
+
field: field.name,
|
|
53
|
+
message: `Field "${field.name}" relies on placeholder as the only label`,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (field.required && field.label && !/\*|required/i.test(field.label) && !field.hasAccessibilityLabel) {
|
|
57
|
+
issues.push({
|
|
58
|
+
id: `required-${field.name}`,
|
|
59
|
+
severity: 'info',
|
|
60
|
+
field: field.name,
|
|
61
|
+
message: `Required field "${field.name}" — ensure required state is announced`,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (field.hasError && !field.errorText) {
|
|
65
|
+
issues.push({
|
|
66
|
+
id: `error-text-${field.name}`,
|
|
67
|
+
severity: 'error',
|
|
68
|
+
field: field.name,
|
|
69
|
+
message: `Field "${field.name}" is in error state without errorText for screen readers`,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (field.hitHeight != null && field.hitHeight < minHit) {
|
|
73
|
+
issues.push({
|
|
74
|
+
id: `hit-${field.name}`,
|
|
75
|
+
severity: 'warn',
|
|
76
|
+
field: field.name,
|
|
77
|
+
message: `Field "${field.name}" hit target ~${field.hitHeight}px (min ${minHit})`,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (input.respectsReducedMotion === false) {
|
|
83
|
+
issues.push({
|
|
84
|
+
id: 'reduced-motion',
|
|
85
|
+
severity: 'warn',
|
|
86
|
+
message: 'Animations may not respect Reduce Motion — use motion={false} or useReducedMotion',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (input.fields.length === 0) {
|
|
91
|
+
issues.push({
|
|
92
|
+
id: 'empty',
|
|
93
|
+
severity: 'info',
|
|
94
|
+
message: 'No fields registered for audit',
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return issues;
|
|
99
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import type { TextInputProps } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Semantic autofill roles — map to platform `autoComplete` + iOS `textContentType`.
|
|
5
|
+
* Pass as `autofill="email"` on `FieldFlowInput`, or use a profile bundle.
|
|
6
|
+
*/
|
|
7
|
+
export type FieldFlowAutofillRole =
|
|
8
|
+
| 'off'
|
|
9
|
+
| 'name'
|
|
10
|
+
| 'givenName'
|
|
11
|
+
| 'familyName'
|
|
12
|
+
| 'email'
|
|
13
|
+
| 'username'
|
|
14
|
+
| 'password'
|
|
15
|
+
| 'newPassword'
|
|
16
|
+
| 'oneTimeCode'
|
|
17
|
+
| 'tel'
|
|
18
|
+
| 'streetAddress'
|
|
19
|
+
| 'postalCode'
|
|
20
|
+
| 'addressCity'
|
|
21
|
+
| 'addressState'
|
|
22
|
+
| 'country'
|
|
23
|
+
| 'ccNumber'
|
|
24
|
+
| 'ccExp'
|
|
25
|
+
| 'ccCsc'
|
|
26
|
+
| 'ccName'
|
|
27
|
+
| 'organization'
|
|
28
|
+
| 'url'
|
|
29
|
+
| 'birthdate';
|
|
30
|
+
|
|
31
|
+
export type FieldFlowAutofillProps = Pick<
|
|
32
|
+
TextInputProps,
|
|
33
|
+
'autoComplete' | 'textContentType' | 'importantForAutofill' | 'autoCorrect' | 'autoCapitalize'
|
|
34
|
+
>;
|
|
35
|
+
|
|
36
|
+
const ROLE_MAP: Record<FieldFlowAutofillRole, FieldFlowAutofillProps> = {
|
|
37
|
+
off: {
|
|
38
|
+
autoComplete: 'off',
|
|
39
|
+
textContentType: 'none',
|
|
40
|
+
importantForAutofill: 'no',
|
|
41
|
+
},
|
|
42
|
+
name: {
|
|
43
|
+
autoComplete: 'name',
|
|
44
|
+
textContentType: 'name',
|
|
45
|
+
importantForAutofill: 'yes',
|
|
46
|
+
autoCapitalize: 'words',
|
|
47
|
+
},
|
|
48
|
+
givenName: {
|
|
49
|
+
autoComplete: 'given-name',
|
|
50
|
+
textContentType: 'givenName',
|
|
51
|
+
importantForAutofill: 'yes',
|
|
52
|
+
autoCapitalize: 'words',
|
|
53
|
+
},
|
|
54
|
+
familyName: {
|
|
55
|
+
autoComplete: 'family-name',
|
|
56
|
+
textContentType: 'familyName',
|
|
57
|
+
importantForAutofill: 'yes',
|
|
58
|
+
autoCapitalize: 'words',
|
|
59
|
+
},
|
|
60
|
+
email: {
|
|
61
|
+
autoComplete: 'email',
|
|
62
|
+
textContentType: 'emailAddress',
|
|
63
|
+
importantForAutofill: 'yes',
|
|
64
|
+
autoCapitalize: 'none',
|
|
65
|
+
autoCorrect: false,
|
|
66
|
+
},
|
|
67
|
+
username: {
|
|
68
|
+
autoComplete: 'username',
|
|
69
|
+
textContentType: 'username',
|
|
70
|
+
importantForAutofill: 'yes',
|
|
71
|
+
autoCapitalize: 'none',
|
|
72
|
+
autoCorrect: false,
|
|
73
|
+
},
|
|
74
|
+
password: {
|
|
75
|
+
autoComplete: 'password',
|
|
76
|
+
textContentType: 'password',
|
|
77
|
+
importantForAutofill: 'yes',
|
|
78
|
+
autoCapitalize: 'none',
|
|
79
|
+
autoCorrect: false,
|
|
80
|
+
},
|
|
81
|
+
newPassword: {
|
|
82
|
+
autoComplete: 'password-new',
|
|
83
|
+
textContentType: 'newPassword',
|
|
84
|
+
importantForAutofill: 'yes',
|
|
85
|
+
autoCapitalize: 'none',
|
|
86
|
+
autoCorrect: false,
|
|
87
|
+
},
|
|
88
|
+
oneTimeCode: {
|
|
89
|
+
autoComplete: 'sms-otp',
|
|
90
|
+
textContentType: 'oneTimeCode',
|
|
91
|
+
importantForAutofill: 'yes',
|
|
92
|
+
autoCapitalize: 'none',
|
|
93
|
+
autoCorrect: false,
|
|
94
|
+
},
|
|
95
|
+
tel: {
|
|
96
|
+
autoComplete: 'tel',
|
|
97
|
+
textContentType: 'telephoneNumber',
|
|
98
|
+
importantForAutofill: 'yes',
|
|
99
|
+
},
|
|
100
|
+
streetAddress: {
|
|
101
|
+
autoComplete: 'street-address',
|
|
102
|
+
textContentType: 'fullStreetAddress',
|
|
103
|
+
importantForAutofill: 'yes',
|
|
104
|
+
},
|
|
105
|
+
postalCode: {
|
|
106
|
+
autoComplete: 'postal-code',
|
|
107
|
+
textContentType: 'postalCode',
|
|
108
|
+
importantForAutofill: 'yes',
|
|
109
|
+
},
|
|
110
|
+
addressCity: {
|
|
111
|
+
autoComplete: 'postal-address-locality',
|
|
112
|
+
textContentType: 'addressCity',
|
|
113
|
+
importantForAutofill: 'yes',
|
|
114
|
+
autoCapitalize: 'words',
|
|
115
|
+
},
|
|
116
|
+
addressState: {
|
|
117
|
+
autoComplete: 'postal-address-region',
|
|
118
|
+
textContentType: 'addressState',
|
|
119
|
+
importantForAutofill: 'yes',
|
|
120
|
+
},
|
|
121
|
+
country: {
|
|
122
|
+
autoComplete: 'country',
|
|
123
|
+
textContentType: 'countryName',
|
|
124
|
+
importantForAutofill: 'yes',
|
|
125
|
+
},
|
|
126
|
+
ccNumber: {
|
|
127
|
+
autoComplete: 'cc-number',
|
|
128
|
+
textContentType: 'creditCardNumber',
|
|
129
|
+
importantForAutofill: 'yes',
|
|
130
|
+
},
|
|
131
|
+
ccExp: {
|
|
132
|
+
autoComplete: 'cc-exp',
|
|
133
|
+
textContentType: 'creditCardExpiration',
|
|
134
|
+
importantForAutofill: 'yes',
|
|
135
|
+
},
|
|
136
|
+
ccCsc: {
|
|
137
|
+
autoComplete: 'cc-csc',
|
|
138
|
+
textContentType: 'creditCardSecurityCode',
|
|
139
|
+
importantForAutofill: 'yes',
|
|
140
|
+
},
|
|
141
|
+
ccName: {
|
|
142
|
+
autoComplete: 'cc-name',
|
|
143
|
+
textContentType: 'creditCardName',
|
|
144
|
+
importantForAutofill: 'yes',
|
|
145
|
+
autoCapitalize: 'words',
|
|
146
|
+
},
|
|
147
|
+
organization: {
|
|
148
|
+
autoComplete: 'organization',
|
|
149
|
+
textContentType: 'organizationName',
|
|
150
|
+
importantForAutofill: 'yes',
|
|
151
|
+
autoCapitalize: 'words',
|
|
152
|
+
},
|
|
153
|
+
url: {
|
|
154
|
+
autoComplete: 'url',
|
|
155
|
+
textContentType: 'URL',
|
|
156
|
+
importantForAutofill: 'yes',
|
|
157
|
+
autoCapitalize: 'none',
|
|
158
|
+
autoCorrect: false,
|
|
159
|
+
},
|
|
160
|
+
birthdate: {
|
|
161
|
+
autoComplete: 'birthdate-full',
|
|
162
|
+
textContentType: 'none',
|
|
163
|
+
importantForAutofill: 'yes',
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/** Resolve platform autofill props for a semantic role. */
|
|
168
|
+
export function getAutofillProps(role: FieldFlowAutofillRole): FieldFlowAutofillProps {
|
|
169
|
+
return ROLE_MAP[role] ?? ROLE_MAP.off;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Infer a sensible autofill role from FieldFlow `type` when no explicit role is set. */
|
|
173
|
+
export function autofillRoleFromFieldType(
|
|
174
|
+
type?: string,
|
|
175
|
+
): FieldFlowAutofillRole | undefined {
|
|
176
|
+
switch (type) {
|
|
177
|
+
case 'email':
|
|
178
|
+
return 'email';
|
|
179
|
+
case 'phone':
|
|
180
|
+
return 'tel';
|
|
181
|
+
case 'password':
|
|
182
|
+
return 'password';
|
|
183
|
+
default:
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Named screen profiles — spread onto multiple fields.
|
|
190
|
+
* Example: `autofillProfiles.signup.email` → role `'email'`.
|
|
191
|
+
*/
|
|
192
|
+
export const autofillProfiles = {
|
|
193
|
+
login: {
|
|
194
|
+
email: 'email' as const,
|
|
195
|
+
username: 'username' as const,
|
|
196
|
+
password: 'password' as const,
|
|
197
|
+
},
|
|
198
|
+
signup: {
|
|
199
|
+
name: 'name' as const,
|
|
200
|
+
email: 'email' as const,
|
|
201
|
+
password: 'newPassword' as const,
|
|
202
|
+
phone: 'tel' as const,
|
|
203
|
+
},
|
|
204
|
+
shipping: {
|
|
205
|
+
name: 'name' as const,
|
|
206
|
+
street: 'streetAddress' as const,
|
|
207
|
+
city: 'addressCity' as const,
|
|
208
|
+
state: 'addressState' as const,
|
|
209
|
+
postalCode: 'postalCode' as const,
|
|
210
|
+
country: 'country' as const,
|
|
211
|
+
phone: 'tel' as const,
|
|
212
|
+
},
|
|
213
|
+
payment: {
|
|
214
|
+
name: 'ccName' as const,
|
|
215
|
+
number: 'ccNumber' as const,
|
|
216
|
+
expiry: 'ccExp' as const,
|
|
217
|
+
cvc: 'ccCsc' as const,
|
|
218
|
+
},
|
|
219
|
+
otp: {
|
|
220
|
+
code: 'oneTimeCode' as const,
|
|
221
|
+
},
|
|
222
|
+
} as const;
|
|
223
|
+
|
|
224
|
+
export type FieldFlowAutofillProfileName = keyof typeof autofillProfiles;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { StyleSheet, Text, View, type ViewStyle } from 'react-native';
|
|
3
|
+
import { runA11yAudit, type FieldFlowA11yAuditInput, type FieldFlowA11yIssue } from '../../a11y';
|
|
4
|
+
import { useFieldFlowTheme, mergeDeep } from '../../theme/ThemeProvider';
|
|
5
|
+
import { defaultTheme } from '../../theme/defaultTheme';
|
|
6
|
+
import type { DeepPartial, FieldFlowTheme } from '../../types';
|
|
7
|
+
|
|
8
|
+
export interface FieldFlowA11yAuditProps {
|
|
9
|
+
/** Audit input — or pass precomputed `issues`. */
|
|
10
|
+
audit?: FieldFlowA11yAuditInput;
|
|
11
|
+
issues?: FieldFlowA11yIssue[];
|
|
12
|
+
/** Only render in __DEV__ when true (default). */
|
|
13
|
+
devOnly?: boolean;
|
|
14
|
+
title?: string;
|
|
15
|
+
containerStyle?: ViewStyle;
|
|
16
|
+
theme?: DeepPartial<FieldFlowTheme>;
|
|
17
|
+
testID?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Dev overlay listing accessibility issues for the current form.
|
|
22
|
+
* No-ops in production when `devOnly` is true.
|
|
23
|
+
*/
|
|
24
|
+
export function FieldFlowA11yAudit({
|
|
25
|
+
audit,
|
|
26
|
+
issues: issuesProp,
|
|
27
|
+
devOnly = true,
|
|
28
|
+
title = 'FieldFlow a11y audit',
|
|
29
|
+
containerStyle,
|
|
30
|
+
theme: themeOverride,
|
|
31
|
+
testID,
|
|
32
|
+
}: FieldFlowA11yAuditProps) {
|
|
33
|
+
// Prefer RN `__DEV__`; fall back without assuming Node `process` types.
|
|
34
|
+
const isDev =
|
|
35
|
+
typeof __DEV__ !== 'undefined'
|
|
36
|
+
? __DEV__
|
|
37
|
+
: typeof process !== 'undefined' &&
|
|
38
|
+
typeof process.env !== 'undefined' &&
|
|
39
|
+
process.env.NODE_ENV !== 'production';
|
|
40
|
+
|
|
41
|
+
const issues = useMemo(() => {
|
|
42
|
+
if (issuesProp) return issuesProp;
|
|
43
|
+
if (audit) return runA11yAudit(audit);
|
|
44
|
+
return [];
|
|
45
|
+
}, [audit, issuesProp]);
|
|
46
|
+
|
|
47
|
+
const contextTheme = useFieldFlowTheme();
|
|
48
|
+
const theme = useMemo(
|
|
49
|
+
() => (themeOverride ? mergeDeep(contextTheme ?? defaultTheme, themeOverride) : contextTheme ?? defaultTheme),
|
|
50
|
+
[contextTheme, themeOverride],
|
|
51
|
+
);
|
|
52
|
+
const styles = useMemo(() => createStyles(theme), [theme]);
|
|
53
|
+
|
|
54
|
+
if (devOnly && !isDev) return null;
|
|
55
|
+
if (issues.length === 0) {
|
|
56
|
+
return (
|
|
57
|
+
<View style={[styles.wrap, styles.ok, containerStyle]} testID={testID}>
|
|
58
|
+
<Text style={styles.title}>{title}</Text>
|
|
59
|
+
<Text style={styles.okText}>No issues found</Text>
|
|
60
|
+
</View>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<View style={[styles.wrap, containerStyle]} testID={testID}>
|
|
66
|
+
<Text style={styles.title}>
|
|
67
|
+
{title} ({issues.length})
|
|
68
|
+
</Text>
|
|
69
|
+
{issues.map(issue => (
|
|
70
|
+
<Text
|
|
71
|
+
key={issue.id}
|
|
72
|
+
style={[
|
|
73
|
+
styles.item,
|
|
74
|
+
issue.severity === 'error' && styles.error,
|
|
75
|
+
issue.severity === 'warn' && styles.warn,
|
|
76
|
+
]}
|
|
77
|
+
>
|
|
78
|
+
[{issue.severity}] {issue.field ? `${issue.field}: ` : ''}
|
|
79
|
+
{issue.message}
|
|
80
|
+
</Text>
|
|
81
|
+
))}
|
|
82
|
+
</View>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function createStyles(theme: FieldFlowTheme) {
|
|
87
|
+
return StyleSheet.create({
|
|
88
|
+
wrap: {
|
|
89
|
+
marginVertical: 8,
|
|
90
|
+
padding: 12,
|
|
91
|
+
borderRadius: 8,
|
|
92
|
+
borderWidth: 1,
|
|
93
|
+
borderColor: theme.colors.borderError,
|
|
94
|
+
backgroundColor: theme.colors.background,
|
|
95
|
+
},
|
|
96
|
+
ok: { borderColor: theme.colors.borderSuccess },
|
|
97
|
+
title: {
|
|
98
|
+
fontWeight: '700',
|
|
99
|
+
marginBottom: 6,
|
|
100
|
+
color: theme.colors.text,
|
|
101
|
+
fontSize: theme.typography.helperFontSize + 1,
|
|
102
|
+
},
|
|
103
|
+
item: {
|
|
104
|
+
fontSize: theme.typography.helperFontSize,
|
|
105
|
+
color: theme.colors.label,
|
|
106
|
+
marginBottom: 4,
|
|
107
|
+
},
|
|
108
|
+
error: { color: theme.colors.error },
|
|
109
|
+
warn: { color: '#B45309' },
|
|
110
|
+
okText: { color: theme.colors.success, fontSize: theme.typography.helperFontSize },
|
|
111
|
+
});
|
|
112
|
+
}
|