rn-inputforge 0.3.1 → 0.4.0
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 +224 -19
- package/lib/commonjs/components/FieldFlowCheckbox/FieldFlowCheckbox.js +131 -0
- package/lib/commonjs/components/FieldFlowCheckbox/FieldFlowCheckbox.js.map +1 -0
- package/lib/commonjs/components/FieldFlowCheckbox/index.js +13 -0
- package/lib/commonjs/components/FieldFlowCheckbox/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowDateTimePicker/FieldFlowDateTimePicker.js +536 -0
- package/lib/commonjs/components/FieldFlowDateTimePicker/FieldFlowDateTimePicker.js.map +1 -0
- package/lib/commonjs/components/FieldFlowDateTimePicker/index.js +13 -0
- package/lib/commonjs/components/FieldFlowDateTimePicker/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowDateTimePicker/types.js +6 -0
- package/lib/commonjs/components/FieldFlowDateTimePicker/types.js.map +1 -0
- package/lib/commonjs/components/FieldFlowDropdown/FieldFlowDropdown.js +24 -9
- package/lib/commonjs/components/FieldFlowDropdown/FieldFlowDropdown.js.map +1 -1
- package/lib/commonjs/components/FieldFlowInput/FieldFlowInput.js +55 -24
- package/lib/commonjs/components/FieldFlowInput/FieldFlowInput.js.map +1 -1
- package/lib/commonjs/components/FieldFlowInput/styles.js +32 -11
- package/lib/commonjs/components/FieldFlowInput/styles.js.map +1 -1
- package/lib/commonjs/components/FieldFlowMaskedInput/FieldFlowMaskedInput.js +66 -0
- package/lib/commonjs/components/FieldFlowMaskedInput/FieldFlowMaskedInput.js.map +1 -0
- package/lib/commonjs/components/FieldFlowMaskedInput/index.js +13 -0
- package/lib/commonjs/components/FieldFlowMaskedInput/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowMaskedInput/types.js +6 -0
- package/lib/commonjs/components/FieldFlowMaskedInput/types.js.map +1 -0
- package/lib/commonjs/components/FieldFlowOTP/FieldFlowOTP.js +255 -0
- package/lib/commonjs/components/FieldFlowOTP/FieldFlowOTP.js.map +1 -0
- package/lib/commonjs/components/FieldFlowOTP/index.js +13 -0
- package/lib/commonjs/components/FieldFlowOTP/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowOTP/types.js +6 -0
- package/lib/commonjs/components/FieldFlowOTP/types.js.map +1 -0
- package/lib/commonjs/components/FieldFlowRadio/FieldFlowRadio.js +164 -0
- package/lib/commonjs/components/FieldFlowRadio/FieldFlowRadio.js.map +1 -0
- package/lib/commonjs/components/FieldFlowRadio/index.js +13 -0
- package/lib/commonjs/components/FieldFlowRadio/index.js.map +1 -0
- package/lib/commonjs/components/FieldFlowSwitch/FieldFlowSwitch.js +152 -0
- package/lib/commonjs/components/FieldFlowSwitch/FieldFlowSwitch.js.map +1 -0
- package/lib/commonjs/components/FieldFlowSwitch/index.js +13 -0
- package/lib/commonjs/components/FieldFlowSwitch/index.js.map +1 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useFieldFlowForm.js +146 -31
- package/lib/commonjs/hooks/useFieldFlowForm.js.map +1 -1
- package/lib/commonjs/icons/Icon.js +719 -30
- package/lib/commonjs/icons/Icon.js.map +1 -1
- package/lib/commonjs/icons/index.js +7 -0
- package/lib/commonjs/icons/index.js.map +1 -1
- package/lib/commonjs/icons/renderIcon.js +24 -0
- package/lib/commonjs/icons/renderIcon.js.map +1 -0
- package/lib/commonjs/index.js +127 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/masks.js +130 -0
- package/lib/commonjs/utils/masks.js.map +1 -0
- package/lib/commonjs/validation/index.js +25 -0
- package/lib/commonjs/validation/index.js.map +1 -1
- package/lib/commonjs/validation/zodAdapter.js +91 -0
- package/lib/commonjs/validation/zodAdapter.js.map +1 -0
- package/lib/module/components/FieldFlowCheckbox/FieldFlowCheckbox.js +126 -0
- package/lib/module/components/FieldFlowCheckbox/FieldFlowCheckbox.js.map +1 -0
- package/lib/module/components/FieldFlowCheckbox/index.js +4 -0
- package/lib/module/components/FieldFlowCheckbox/index.js.map +1 -0
- package/lib/module/components/FieldFlowDateTimePicker/FieldFlowDateTimePicker.js +531 -0
- package/lib/module/components/FieldFlowDateTimePicker/FieldFlowDateTimePicker.js.map +1 -0
- package/lib/module/components/FieldFlowDateTimePicker/index.js +4 -0
- package/lib/module/components/FieldFlowDateTimePicker/index.js.map +1 -0
- package/lib/module/components/FieldFlowDateTimePicker/types.js +4 -0
- package/lib/module/components/FieldFlowDateTimePicker/types.js.map +1 -0
- package/lib/module/components/FieldFlowDropdown/FieldFlowDropdown.js +24 -9
- package/lib/module/components/FieldFlowDropdown/FieldFlowDropdown.js.map +1 -1
- package/lib/module/components/FieldFlowInput/FieldFlowInput.js +59 -28
- package/lib/module/components/FieldFlowInput/FieldFlowInput.js.map +1 -1
- package/lib/module/components/FieldFlowInput/styles.js +32 -11
- package/lib/module/components/FieldFlowInput/styles.js.map +1 -1
- package/lib/module/components/FieldFlowMaskedInput/FieldFlowMaskedInput.js +61 -0
- package/lib/module/components/FieldFlowMaskedInput/FieldFlowMaskedInput.js.map +1 -0
- package/lib/module/components/FieldFlowMaskedInput/index.js +4 -0
- package/lib/module/components/FieldFlowMaskedInput/index.js.map +1 -0
- package/lib/module/components/FieldFlowMaskedInput/types.js +4 -0
- package/lib/module/components/FieldFlowMaskedInput/types.js.map +1 -0
- package/lib/module/components/FieldFlowOTP/FieldFlowOTP.js +250 -0
- package/lib/module/components/FieldFlowOTP/FieldFlowOTP.js.map +1 -0
- package/lib/module/components/FieldFlowOTP/index.js +4 -0
- package/lib/module/components/FieldFlowOTP/index.js.map +1 -0
- package/lib/module/components/FieldFlowOTP/types.js +4 -0
- package/lib/module/components/FieldFlowOTP/types.js.map +1 -0
- package/lib/module/components/FieldFlowRadio/FieldFlowRadio.js +159 -0
- package/lib/module/components/FieldFlowRadio/FieldFlowRadio.js.map +1 -0
- package/lib/module/components/FieldFlowRadio/index.js +4 -0
- package/lib/module/components/FieldFlowRadio/index.js.map +1 -0
- package/lib/module/components/FieldFlowSwitch/FieldFlowSwitch.js +147 -0
- package/lib/module/components/FieldFlowSwitch/FieldFlowSwitch.js.map +1 -0
- package/lib/module/components/FieldFlowSwitch/index.js +4 -0
- package/lib/module/components/FieldFlowSwitch/index.js.map +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useFieldFlowForm.js +147 -32
- package/lib/module/hooks/useFieldFlowForm.js.map +1 -1
- package/lib/module/icons/Icon.js +720 -31
- package/lib/module/icons/Icon.js.map +1 -1
- package/lib/module/icons/index.js +1 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/icons/renderIcon.js +19 -0
- package/lib/module/icons/renderIcon.js.map +1 -0
- package/lib/module/index.js +11 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/masks.js +118 -0
- package/lib/module/utils/masks.js.map +1 -0
- package/lib/module/validation/index.js +1 -0
- package/lib/module/validation/index.js.map +1 -1
- package/lib/module/validation/zodAdapter.js +84 -0
- package/lib/module/validation/zodAdapter.js.map +1 -0
- package/lib/typescript/components/FieldFlowCheckbox/FieldFlowCheckbox.d.ts +36 -0
- package/lib/typescript/components/FieldFlowCheckbox/FieldFlowCheckbox.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowCheckbox/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowCheckbox/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowDateTimePicker/FieldFlowDateTimePicker.d.ts +4 -0
- package/lib/typescript/components/FieldFlowDateTimePicker/FieldFlowDateTimePicker.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowDateTimePicker/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowDateTimePicker/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowDateTimePicker/types.d.ts +55 -0
- package/lib/typescript/components/FieldFlowDateTimePicker/types.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowDropdown/FieldFlowDropdown.d.ts.map +1 -1
- package/lib/typescript/components/FieldFlowDropdown/types.d.ts +7 -1
- package/lib/typescript/components/FieldFlowDropdown/types.d.ts.map +1 -1
- package/lib/typescript/components/FieldFlowInput/FieldFlowInput.d.ts.map +1 -1
- package/lib/typescript/components/FieldFlowInput/styles.d.ts +19 -2
- package/lib/typescript/components/FieldFlowInput/styles.d.ts.map +1 -1
- package/lib/typescript/components/FieldFlowInput/types.d.ts +24 -5
- package/lib/typescript/components/FieldFlowInput/types.d.ts.map +1 -1
- package/lib/typescript/components/FieldFlowMaskedInput/FieldFlowMaskedInput.d.ts +5 -0
- package/lib/typescript/components/FieldFlowMaskedInput/FieldFlowMaskedInput.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowMaskedInput/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowMaskedInput/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowMaskedInput/types.d.ts +20 -0
- package/lib/typescript/components/FieldFlowMaskedInput/types.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowOTP/FieldFlowOTP.d.ts +4 -0
- package/lib/typescript/components/FieldFlowOTP/FieldFlowOTP.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowOTP/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowOTP/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowOTP/types.d.ts +52 -0
- package/lib/typescript/components/FieldFlowOTP/types.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowRadio/FieldFlowRadio.d.ts +39 -0
- package/lib/typescript/components/FieldFlowRadio/FieldFlowRadio.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowRadio/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowRadio/index.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowSwitch/FieldFlowSwitch.d.ts +31 -0
- package/lib/typescript/components/FieldFlowSwitch/FieldFlowSwitch.d.ts.map +1 -0
- package/lib/typescript/components/FieldFlowSwitch/index.d.ts +3 -0
- package/lib/typescript/components/FieldFlowSwitch/index.d.ts.map +1 -0
- package/lib/typescript/hooks/index.d.ts +1 -1
- package/lib/typescript/hooks/index.d.ts.map +1 -1
- package/lib/typescript/hooks/useFieldFlowForm.d.ts +46 -7
- package/lib/typescript/hooks/useFieldFlowForm.d.ts.map +1 -1
- package/lib/typescript/icons/Icon.d.ts +2 -2
- package/lib/typescript/icons/Icon.d.ts.map +1 -1
- package/lib/typescript/icons/index.d.ts +2 -0
- package/lib/typescript/icons/index.d.ts.map +1 -1
- package/lib/typescript/icons/renderIcon.d.ts +6 -0
- package/lib/typescript/icons/renderIcon.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +20 -6
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/types/index.d.ts +4 -0
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/utils/masks.d.ts +37 -0
- package/lib/typescript/utils/masks.d.ts.map +1 -0
- package/lib/typescript/validation/index.d.ts +2 -0
- package/lib/typescript/validation/index.d.ts.map +1 -1
- package/lib/typescript/validation/zodAdapter.d.ts +53 -0
- package/lib/typescript/validation/zodAdapter.d.ts.map +1 -0
- package/package.json +17 -3
- package/src/components/FieldFlowCheckbox/FieldFlowCheckbox.tsx +174 -0
- package/src/components/FieldFlowCheckbox/index.ts +2 -0
- package/src/components/FieldFlowDateTimePicker/FieldFlowDateTimePicker.tsx +585 -0
- package/src/components/FieldFlowDateTimePicker/index.ts +2 -0
- package/src/components/FieldFlowDateTimePicker/types.ts +57 -0
- package/src/components/FieldFlowDropdown/FieldFlowDropdown.tsx +17 -7
- package/src/components/FieldFlowDropdown/types.ts +8 -1
- package/src/components/FieldFlowInput/FieldFlowInput.tsx +69 -26
- package/src/components/FieldFlowInput/styles.ts +41 -6
- package/src/components/FieldFlowInput/types.ts +24 -5
- package/src/components/FieldFlowMaskedInput/FieldFlowMaskedInput.tsx +76 -0
- package/src/components/FieldFlowMaskedInput/index.ts +2 -0
- package/src/components/FieldFlowMaskedInput/types.ts +22 -0
- package/src/components/FieldFlowOTP/FieldFlowOTP.tsx +305 -0
- package/src/components/FieldFlowOTP/index.ts +2 -0
- package/src/components/FieldFlowOTP/types.ts +57 -0
- package/src/components/FieldFlowRadio/FieldFlowRadio.tsx +215 -0
- package/src/components/FieldFlowRadio/index.ts +2 -0
- package/src/components/FieldFlowSwitch/FieldFlowSwitch.tsx +172 -0
- package/src/components/FieldFlowSwitch/index.ts +2 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useFieldFlowForm.ts +209 -33
- package/src/icons/Icon.tsx +451 -5
- package/src/icons/index.ts +2 -0
- package/src/icons/renderIcon.tsx +17 -0
- package/src/index.ts +47 -4
- package/src/types/index.ts +5 -0
- package/src/utils/masks.ts +137 -0
- package/src/validation/index.ts +7 -0
- package/src/validation/zodAdapter.ts +103 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { FieldFlowState, FieldFlowTheme } from '../../types';
|
|
1
|
+
import type { FieldFlowState, FieldFlowTheme, FieldFlowVariant } from '../../types';
|
|
2
2
|
export declare function borderColorFor(theme: FieldFlowTheme, state: FieldFlowState): string;
|
|
3
3
|
export declare function labelColorFor(theme: FieldFlowTheme, state: FieldFlowState): string;
|
|
4
4
|
export declare function iconColorFor(theme: FieldFlowTheme, state: FieldFlowState): string;
|
|
5
|
-
export declare function createStyles(theme: FieldFlowTheme, state: FieldFlowState, multiline: boolean): {
|
|
5
|
+
export declare function createStyles(theme: FieldFlowTheme, state: FieldFlowState, multiline: boolean, variant?: FieldFlowVariant): {
|
|
6
6
|
wrapper: {
|
|
7
7
|
marginBottom: number;
|
|
8
8
|
};
|
|
@@ -11,6 +11,7 @@ export declare function createStyles(theme: FieldFlowTheme, state: FieldFlowStat
|
|
|
11
11
|
marginBottom: number;
|
|
12
12
|
color: string;
|
|
13
13
|
fontWeight: "500";
|
|
14
|
+
fontFamily: string | undefined;
|
|
14
15
|
};
|
|
15
16
|
inputContainer: {
|
|
16
17
|
flexDirection: "row";
|
|
@@ -18,10 +19,20 @@ export declare function createStyles(theme: FieldFlowTheme, state: FieldFlowStat
|
|
|
18
19
|
backgroundColor: string;
|
|
19
20
|
borderRadius: number;
|
|
20
21
|
borderWidth: number;
|
|
22
|
+
borderBottomWidth: number;
|
|
21
23
|
borderColor: string;
|
|
22
24
|
paddingHorizontal: number;
|
|
23
25
|
paddingVertical: number;
|
|
24
26
|
minHeight: number | undefined;
|
|
27
|
+
paddingTop: number | undefined;
|
|
28
|
+
};
|
|
29
|
+
floatingLabel: {
|
|
30
|
+
position: "absolute";
|
|
31
|
+
left: number;
|
|
32
|
+
backgroundColor: string;
|
|
33
|
+
paddingHorizontal: number;
|
|
34
|
+
zIndex: number;
|
|
35
|
+
fontFamily: string | undefined;
|
|
25
36
|
};
|
|
26
37
|
input: {
|
|
27
38
|
flex: number;
|
|
@@ -30,6 +41,8 @@ export declare function createStyles(theme: FieldFlowTheme, state: FieldFlowStat
|
|
|
30
41
|
paddingVertical: number;
|
|
31
42
|
textAlignVertical: "center" | "top";
|
|
32
43
|
minHeight: number | undefined;
|
|
44
|
+
fontFamily: string | undefined;
|
|
45
|
+
fontWeight: "bold" | "normal" | 800 | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black" | undefined;
|
|
33
46
|
};
|
|
34
47
|
iconSlot: {
|
|
35
48
|
alignItems: "center";
|
|
@@ -51,21 +64,25 @@ export declare function createStyles(theme: FieldFlowTheme, state: FieldFlowStat
|
|
|
51
64
|
fontSize: number;
|
|
52
65
|
color: string;
|
|
53
66
|
flexShrink: number;
|
|
67
|
+
fontFamily: string | undefined;
|
|
54
68
|
};
|
|
55
69
|
errorText: {
|
|
56
70
|
fontSize: number;
|
|
57
71
|
color: string;
|
|
58
72
|
flexShrink: number;
|
|
73
|
+
fontFamily: string | undefined;
|
|
59
74
|
};
|
|
60
75
|
successText: {
|
|
61
76
|
fontSize: number;
|
|
62
77
|
color: string;
|
|
63
78
|
flexShrink: number;
|
|
79
|
+
fontFamily: string | undefined;
|
|
64
80
|
};
|
|
65
81
|
charCount: {
|
|
66
82
|
fontSize: number;
|
|
67
83
|
color: string;
|
|
68
84
|
marginLeft: number;
|
|
85
|
+
fontFamily: string | undefined;
|
|
69
86
|
};
|
|
70
87
|
};
|
|
71
88
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowInput/styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowInput/styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpF,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,GAAG,MAAM,CAWnF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,GAAG,MAAM,CAIlF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,GAAG,MAAM,CAEjF;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,OAAO,EAClB,OAAO,GAAE,gBAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkGvC"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import type { TextInputProps, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
import type { FieldFlowFieldType, FieldFlowRules, DeepPartial, FieldFlowTheme } from '../../types';
|
|
4
|
-
import type {
|
|
2
|
+
import type { FieldFlowFieldType, FieldFlowRules, FieldFlowVariant, DeepPartial, FieldFlowTheme } from '../../types';
|
|
3
|
+
import type { FieldFlowIconSource } from '../../icons';
|
|
5
4
|
export interface FieldFlowInputProps extends Omit<TextInputProps, 'style' | 'onChangeText' | 'onFocus' | 'onBlur' | 'onSubmitEditing'> {
|
|
6
5
|
/** Determines keyboard, secure entry, validation defaults, and default icon behavior. */
|
|
7
6
|
type?: FieldFlowFieldType;
|
|
7
|
+
/**
|
|
8
|
+
* Visual style.
|
|
9
|
+
* - `outlined` (default) — bordered box
|
|
10
|
+
* - `filled` — filled background, no/soft border
|
|
11
|
+
* - `underline` — bottom border only
|
|
12
|
+
* - `floating` — label animates into the border when focused/filled
|
|
13
|
+
*/
|
|
14
|
+
variant?: FieldFlowVariant;
|
|
8
15
|
label?: string;
|
|
9
16
|
helperText?: string;
|
|
10
17
|
errorText?: string;
|
|
@@ -30,10 +37,20 @@ export interface FieldFlowInputProps extends Omit<TextInputProps, 'style' | 'onC
|
|
|
30
37
|
valid: boolean;
|
|
31
38
|
message?: string;
|
|
32
39
|
}) => void;
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Built-in icon name or any custom React node.
|
|
42
|
+
* Pass `null` to hide the type’s default icon (e.g. mail for email).
|
|
43
|
+
*/
|
|
44
|
+
leftIcon?: FieldFlowIconSource | null;
|
|
45
|
+
/**
|
|
46
|
+
* Built-in icon name or any custom React node.
|
|
47
|
+
* Pass `null` to suppress automatic right icons (clear / password toggle / status).
|
|
48
|
+
*/
|
|
49
|
+
rightIcon?: FieldFlowIconSource | null;
|
|
35
50
|
onLeftIconPress?: () => void;
|
|
36
51
|
onRightIconPress?: () => void;
|
|
52
|
+
/** Override default icon size. Default: 18. */
|
|
53
|
+
iconSize?: number;
|
|
37
54
|
/** Shows an "x" clear button when there's text (defaults to true for `search`, false otherwise). */
|
|
38
55
|
clearable?: boolean;
|
|
39
56
|
maxLength?: number;
|
|
@@ -41,9 +58,11 @@ export interface FieldFlowInputProps extends Omit<TextInputProps, 'style' | 'onC
|
|
|
41
58
|
/** Return-key handling used by useKeyboardManager; if provided, overrides default onSubmitEditing wiring. */
|
|
42
59
|
onSubmitEditing?: () => void;
|
|
43
60
|
containerStyle?: ViewStyle;
|
|
61
|
+
inputContainerStyle?: ViewStyle;
|
|
44
62
|
inputStyle?: TextStyle;
|
|
45
63
|
labelStyle?: TextStyle;
|
|
46
64
|
helperStyle?: TextStyle;
|
|
65
|
+
errorStyle?: TextStyle;
|
|
47
66
|
theme?: DeepPartial<FieldFlowTheme>;
|
|
48
67
|
testID?: string;
|
|
49
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,iBAAiB,CAAC;IACjG,yFAAyF;IACzF,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,M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,MAAM,IAAI,CAAC;IAE7B,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IAEpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TextInput } from 'react-native';
|
|
3
|
+
import type { FieldFlowMaskedInputProps } from './types';
|
|
4
|
+
export declare const FieldFlowMaskedInput: React.ForwardRefExoticComponent<FieldFlowMaskedInputProps & React.RefAttributes<TextInput>>;
|
|
5
|
+
//# sourceMappingURL=FieldFlowMaskedInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldFlowMaskedInput.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowMaskedInput/FieldFlowMaskedInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAqBzD,eAAO,MAAM,oBAAoB,6FAiDhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowMaskedInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FieldFlowInputProps } from '../FieldFlowInput/types';
|
|
2
|
+
import type { ApplyMaskOptions, FieldFlowMaskType } from '../../utils/masks';
|
|
3
|
+
export interface FieldFlowMaskedInputProps extends Omit<FieldFlowInputProps, 'type' | 'onChangeText' | 'value' | 'defaultValue'> {
|
|
4
|
+
/** Built-in mask. Use `custom` with `maskOptions.pattern` for your own pattern (`#` = digit). */
|
|
5
|
+
mask: FieldFlowMaskType;
|
|
6
|
+
maskOptions?: ApplyMaskOptions;
|
|
7
|
+
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Called with both the formatted display value and the raw unmasked value.
|
|
11
|
+
* Prefer `raw` when posting to an API.
|
|
12
|
+
*/
|
|
13
|
+
onChangeText?: (formatted: string, raw: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Which value to keep in controlled `value` / emit as the primary string.
|
|
16
|
+
* Default: `'formatted'`.
|
|
17
|
+
*/
|
|
18
|
+
valueMode?: 'formatted' | 'raw';
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowMaskedInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,cAAc,GAAG,OAAO,GAAG,cAAc,CAAC;IACrF,iGAAiG;IACjG,IAAI,EAAE,iBAAiB,CAAC;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAE/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;CACjC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FieldFlowOTPProps } from './types';
|
|
3
|
+
export declare function FieldFlowOTP({ length, value, onChangeText, onComplete, label, helperText, errorText, hasError, successText, isSuccess, disabled, required, secure, autoFocus, leftIcon, rightIcon, iconSize, onLeftIconPress, onRightIconPress, cellGap, cellSize, containerStyle, rowStyle, cellStyle, cellFocusedStyle, cellTextStyle, labelStyle, helperStyle, errorStyle, theme: themeOverride, testID, renderCell, }: FieldFlowOTPProps): React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=FieldFlowOTP.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldFlowOTP.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowOTP/FieldFlowOTP.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAgBtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,wBAAgB,YAAY,CAAC,EAC3B,MAAU,EACV,KAAK,EACL,YAAY,EACZ,UAAU,EACV,KAAK,EACL,UAAU,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAc,EACd,SAAgB,EAChB,QAAgB,EAChB,SAAS,EACT,QAAa,EACb,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,KAAK,EAAE,aAAa,EACpB,MAAM,EACN,UAAU,GACX,EAAE,iBAAiB,qBAsLnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowOTP/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import type { DeepPartial, FieldFlowTheme } from '../../types';
|
|
4
|
+
import type { FieldFlowIconSource } from '../../icons';
|
|
5
|
+
export interface FieldFlowOTPProps {
|
|
6
|
+
/** Number of digit cells. Default: 6. */
|
|
7
|
+
length?: number;
|
|
8
|
+
value?: string;
|
|
9
|
+
onChangeText?: (value: string) => void;
|
|
10
|
+
/** Fired once every cell is filled. */
|
|
11
|
+
onComplete?: (value: string) => void;
|
|
12
|
+
label?: string;
|
|
13
|
+
helperText?: string;
|
|
14
|
+
errorText?: string;
|
|
15
|
+
hasError?: boolean;
|
|
16
|
+
successText?: string;
|
|
17
|
+
isSuccess?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
/** Mask digits (password-style). Default: false. */
|
|
21
|
+
secure?: boolean;
|
|
22
|
+
/** Auto-focus the first empty cell on mount. Default: true. */
|
|
23
|
+
autoFocus?: boolean;
|
|
24
|
+
/** Icon shown before the label / row. Built-in name or custom node. */
|
|
25
|
+
leftIcon?: FieldFlowIconSource;
|
|
26
|
+
rightIcon?: FieldFlowIconSource;
|
|
27
|
+
iconSize?: number;
|
|
28
|
+
onLeftIconPress?: () => void;
|
|
29
|
+
onRightIconPress?: () => void;
|
|
30
|
+
/** Gap between cells. */
|
|
31
|
+
cellGap?: number;
|
|
32
|
+
/** Override cell size (width/height). */
|
|
33
|
+
cellSize?: number;
|
|
34
|
+
containerStyle?: ViewStyle;
|
|
35
|
+
rowStyle?: ViewStyle;
|
|
36
|
+
cellStyle?: ViewStyle;
|
|
37
|
+
cellFocusedStyle?: ViewStyle;
|
|
38
|
+
cellTextStyle?: TextStyle;
|
|
39
|
+
labelStyle?: TextStyle;
|
|
40
|
+
helperStyle?: TextStyle;
|
|
41
|
+
errorStyle?: TextStyle;
|
|
42
|
+
theme?: DeepPartial<FieldFlowTheme>;
|
|
43
|
+
testID?: string;
|
|
44
|
+
/** Render a custom cell. */
|
|
45
|
+
renderCell?: (args: {
|
|
46
|
+
index: number;
|
|
47
|
+
digit: string;
|
|
48
|
+
isFocused: boolean;
|
|
49
|
+
onChangeText: (text: string) => void;
|
|
50
|
+
}) => React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowOTP/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,uCAAuC;IACvC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO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le } from 'react-native';
|
|
3
|
+
import { type FieldFlowIconSource } from '../../icons';
|
|
4
|
+
import type { DeepPartial, FieldFlowOption, FieldFlowTheme } from '../../types';
|
|
5
|
+
export interface FieldFlowRadioProps {
|
|
6
|
+
options: FieldFlowOption[];
|
|
7
|
+
value?: string | null;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
errorText?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
direction?: 'vertical' | 'horizontal';
|
|
15
|
+
/** Leading icon next to the group label. */
|
|
16
|
+
leftIcon?: FieldFlowIconSource;
|
|
17
|
+
/** Override selected indicator (default filled radio). */
|
|
18
|
+
selectedIcon?: FieldFlowIconSource;
|
|
19
|
+
/** Override unselected indicator. */
|
|
20
|
+
unselectedIcon?: FieldFlowIconSource;
|
|
21
|
+
iconSize?: number;
|
|
22
|
+
selectedColor?: string;
|
|
23
|
+
containerStyle?: ViewStyle;
|
|
24
|
+
optionStyle?: ViewStyle;
|
|
25
|
+
labelStyle?: TextStyle;
|
|
26
|
+
helperStyle?: TextStyle;
|
|
27
|
+
errorStyle?: TextStyle;
|
|
28
|
+
theme?: DeepPartial<FieldFlowTheme>;
|
|
29
|
+
testID?: string;
|
|
30
|
+
/** Fully custom option renderer. */
|
|
31
|
+
renderOption?: (args: {
|
|
32
|
+
option: FieldFlowOption;
|
|
33
|
+
selected: boolean;
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
onPress: () => void;
|
|
36
|
+
}) => ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export declare function FieldFlowRadio({ options, value, onChange, label, helperText, errorText, disabled, required, direction, leftIcon, selectedIcon, unselectedIcon, iconSize, selectedColor, containerStyle, optionStyle, labelStyle, helperStyle, errorStyle, theme: themeOverride, testID, renderOption, }: FieldFlowRadioProps): React.JSX.Element;
|
|
39
|
+
//# sourceMappingURL=FieldFlowRadio.d.ts.map
|
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,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,MAAM,EAAE,eAAe,CAAC;QACxB,QAAQ,EAAE,OAAO,CAAC;QAClB,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,KAAK,SAAS,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,EACL,UAAU,EACV,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,SAAsB,EACtB,QAAQ,EACR,YAA4B,EAC5B,cAAwB,EACxB,QAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,WAAW,EACX,UAAU,EACV,KAAK,EAAE,aAAa,EACpB,MAAM,EACN,YAAY,GACb,EAAE,mBAAmB,qBAoFrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowRadio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import { type FieldFlowIconSource } from '../../icons';
|
|
4
|
+
import type { DeepPartial, FieldFlowTheme } from '../../types';
|
|
5
|
+
export interface FieldFlowSwitchProps {
|
|
6
|
+
value: boolean;
|
|
7
|
+
onChange: (value: boolean) => void;
|
|
8
|
+
label?: string;
|
|
9
|
+
helperText?: string;
|
|
10
|
+
errorText?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
switchPosition?: 'left' | 'right';
|
|
14
|
+
leftIcon?: FieldFlowIconSource;
|
|
15
|
+
iconSize?: number;
|
|
16
|
+
/** Track color when on. */
|
|
17
|
+
onTrackColor?: string;
|
|
18
|
+
/** Track color when off. */
|
|
19
|
+
offTrackColor?: string;
|
|
20
|
+
thumbColor?: string;
|
|
21
|
+
trackStyle?: ViewStyle;
|
|
22
|
+
thumbStyle?: ViewStyle;
|
|
23
|
+
containerStyle?: ViewStyle;
|
|
24
|
+
labelStyle?: TextStyle;
|
|
25
|
+
helperStyle?: TextStyle;
|
|
26
|
+
errorStyle?: TextStyle;
|
|
27
|
+
theme?: DeepPartial<FieldFlowTheme>;
|
|
28
|
+
testID?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function FieldFlowSwitch({ value, onChange, label, helperText, errorText, disabled, required, switchPosition, leftIcon, iconSize, onTrackColor, offTrackColor, thumbColor, trackStyle, thumbStyle, containerStyle, labelStyle, helperStyle, errorStyle, theme: themeOverride, testID, }: FieldFlowSwitchProps): React.JSX.Element;
|
|
31
|
+
//# sourceMappingURL=FieldFlowSwitch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldFlowSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldFlowSwitch/FieldFlowSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAA+C,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGjG,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,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1,7 @@
|
|
|
1
1
|
export { useKeyboardManager } from './useKeyboardManager';
|
|
2
2
|
export type { UseKeyboardManagerOptions, UseKeyboardManagerResult, KeyboardManagerField } from './useKeyboardManager';
|
|
3
3
|
export { useFieldFlowForm } from './useFieldFlowForm';
|
|
4
|
-
export type { UseFieldFlowFormOptions, UseFieldFlowFormResult, FieldFlowFormRules, } from './useFieldFlowForm';
|
|
4
|
+
export type { UseFieldFlowFormOptions, UseFieldFlowFormResult, FieldFlowFormRules, AsyncFieldValidator, AsyncFieldValidators, CrossFieldRule, } from './useFieldFlowForm';
|
|
5
5
|
export { useFieldState } from './useFieldState';
|
|
6
6
|
export type { UseFieldStateOptions } from './useFieldState';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEtH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEtH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,31 +1,70 @@
|
|
|
1
|
-
import type { FieldFlowRules } from '../types';
|
|
1
|
+
import type { FieldFlowRules, ValidationResult } from '../types';
|
|
2
2
|
export type FieldFlowFormRules<T extends Record<string, string>> = {
|
|
3
3
|
[K in keyof T]?: FieldFlowRules;
|
|
4
4
|
};
|
|
5
|
+
export type AsyncFieldValidator<T extends Record<string, string>> = (value: string, values: T) => Promise<ValidationResult> | ValidationResult;
|
|
6
|
+
export type AsyncFieldValidators<T extends Record<string, string>> = {
|
|
7
|
+
[K in keyof T]?: AsyncFieldValidator<T>;
|
|
8
|
+
};
|
|
9
|
+
export interface CrossFieldRule<T extends Record<string, string>> {
|
|
10
|
+
/** Field that receives the error message when validation fails. */
|
|
11
|
+
target: keyof T;
|
|
12
|
+
/** When set, this rule re-runs when any of these fields change (in addition to `target`). */
|
|
13
|
+
deps?: (keyof T)[];
|
|
14
|
+
validate: (values: T) => ValidationResult;
|
|
15
|
+
}
|
|
5
16
|
export interface UseFieldFlowFormOptions<T extends Record<string, string>> {
|
|
6
17
|
initialValues: T;
|
|
7
18
|
rules?: FieldFlowFormRules<T>;
|
|
8
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Cross-field rules (e.g. password confirm). Run after per-field sync rules.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* crossFieldRules: [{
|
|
24
|
+
* target: 'confirm',
|
|
25
|
+
* deps: ['password'],
|
|
26
|
+
* validate: v => v.password === v.confirm
|
|
27
|
+
* ? { valid: true }
|
|
28
|
+
* : { valid: false, message: 'Passwords must match' },
|
|
29
|
+
* }]
|
|
30
|
+
*/
|
|
31
|
+
crossFieldRules?: CrossFieldRule<T>[];
|
|
32
|
+
/**
|
|
33
|
+
* Whole-form validator (e.g. from `zodFormValidate(schema)`).
|
|
34
|
+
* Merged after sync + cross-field rules; field keys map to error messages.
|
|
35
|
+
*/
|
|
36
|
+
formValidate?: (values: T) => Partial<Record<keyof T, string | undefined>> | Promise<Partial<Record<keyof T, string | undefined>>>;
|
|
37
|
+
/**
|
|
38
|
+
* Per-field async validators (e.g. "email already taken").
|
|
39
|
+
* Debounced on change after the field has been touched; always awaited on submit.
|
|
40
|
+
*/
|
|
41
|
+
asyncValidators?: AsyncFieldValidators<T>;
|
|
42
|
+
/** Debounce for async field validators on change. Default: 400ms. */
|
|
43
|
+
asyncDebounceMs?: number;
|
|
44
|
+
/** Called only when every field passes sync + cross-field + form + async validation. */
|
|
9
45
|
onSubmit?: (values: T) => void | Promise<void>;
|
|
10
46
|
}
|
|
11
47
|
export interface UseFieldFlowFormResult<T extends Record<string, string>> {
|
|
12
48
|
values: T;
|
|
13
49
|
errors: Partial<Record<keyof T, string>>;
|
|
14
50
|
touched: Partial<Record<keyof T, boolean>>;
|
|
51
|
+
/** Fields currently waiting on an async validator. */
|
|
52
|
+
validating: Partial<Record<keyof T, boolean>>;
|
|
15
53
|
isSubmitting: boolean;
|
|
16
54
|
isValid: boolean;
|
|
55
|
+
/** True while any async field validator is in flight. */
|
|
56
|
+
isValidating: boolean;
|
|
17
57
|
setValue: (field: keyof T, value: string) => void;
|
|
18
58
|
handleChange: (field: keyof T) => (value: string) => void;
|
|
19
59
|
handleBlur: (field: keyof T) => () => void;
|
|
20
|
-
validateField: (field: keyof T) => boolean
|
|
21
|
-
validateAll: () => boolean
|
|
60
|
+
validateField: (field: keyof T) => Promise<boolean>;
|
|
61
|
+
validateAll: () => Promise<boolean>;
|
|
22
62
|
submit: () => Promise<void>;
|
|
23
63
|
reset: () => void;
|
|
24
64
|
}
|
|
25
65
|
/**
|
|
26
66
|
* Drop-in form state manager for a set of FieldFlow inputs. Handles values,
|
|
27
|
-
* per-field +
|
|
28
|
-
* the input components), touched-state, and submission.
|
|
67
|
+
* per-field + cross-field + async validation, touched-state, and submission.
|
|
29
68
|
*/
|
|
30
|
-
export declare function useFieldFlowForm<T extends Record<string, string>>({ initialValues, rules, onSubmit, }: UseFieldFlowFormOptions<T>): UseFieldFlowFormResult<T>;
|
|
69
|
+
export declare function useFieldFlowForm<T extends Record<string, string>>({ initialValues, rules, crossFieldRules, formValidate, asyncValidators, asyncDebounceMs, onSubmit, }: UseFieldFlowFormOptions<T>): UseFieldFlowFormResult<T>;
|
|
31
70
|
//# sourceMappingURL=useFieldFlowForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldFlowForm.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFieldFlowForm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useFieldFlowForm.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFieldFlowForm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjE,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI;KAChE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc;CAChC,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAClE,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,CAAC,KACN,OAAO,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;AAElD,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI;KAClE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAC9D,mEAAmE;IACnE,MAAM,EAAE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AAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC9C,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,MAAM,IAAI,CAAC;IAC3C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACpD,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EACjE,aAAa,EACb,KAAK,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,eAAqB,EACrB,QAAQ,GACT,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CA0NxD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
export type FieldFlowIconName = 'eye' | 'eyeOff' | 'clear' | 'check' | 'alert' | 'search' | 'send' | 'camera' | 'image' | 'paperclip' | 'mic' | 'mapPin' | 'chevronDown' | 'spinner';
|
|
3
|
+
export type FieldFlowIconName = 'eye' | 'eyeOff' | 'clear' | 'check' | 'alert' | 'search' | 'send' | 'camera' | 'image' | 'paperclip' | 'mic' | 'mapPin' | 'chevronDown' | 'chevronUp' | 'chevronLeft' | 'chevronRight' | 'calendar' | 'clock' | 'creditCard' | 'currency' | 'phone' | 'mail' | 'lock' | 'user' | 'key' | 'hash' | 'otp' | 'radio' | 'radioFilled' | 'switch' | 'star' | 'plus' | 'minus' | 'info' | 'home' | 'settings' | 'edit' | 'trash' | 'link' | 'globe' | 'file' | 'folder' | 'bell' | 'heart' | 'spinner';
|
|
4
4
|
export interface FieldFlowIconProps {
|
|
5
5
|
name: FieldFlowIconName;
|
|
6
6
|
size?: number;
|
|
@@ -11,7 +11,7 @@ export interface FieldFlowIconProps {
|
|
|
11
11
|
* A minimal, dependency-free icon set built out of basic Views. Ships so consumers
|
|
12
12
|
* don't need to install react-native-svg / vector-icons just to use FieldFlow.
|
|
13
13
|
* Every icon accepts `size` and `color`, and you can always render your own
|
|
14
|
-
* icon via the `leftIcon` / `rightIcon`
|
|
14
|
+
* icon via the `leftIcon` / `rightIcon` (or component-specific icon) props.
|
|
15
15
|
*/
|
|
16
16
|
export declare function FieldFlowIcon({ name, size, color, style }: FieldFlowIconProps): React.JSX.Element;
|
|
17
17
|
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/icons/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAA0B,SAAS,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GACzB,KAAK,GACL,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,OAAO,GACP,WAAW,GACX,KAAK,GACL,QAAQ,GACR,aAAa,GACb,SAAS,CAAC;AAEd,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAiB,EAAE,KAAK,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/icons/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAA0B,SAAS,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GACzB,KAAK,GACL,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,OAAO,GACP,WAAW,GACX,KAAK,GACL,QAAQ,GACR,aAAa,GACb,WAAW,GACX,aAAa,GACb,cAAc,GACd,UAAU,GACV,OAAO,GACP,YAAY,GACZ,UAAU,GACV,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,GACN,KAAK,GACL,OAAO,GACP,aAAa,GACb,QAAQ,GACR,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,GACV,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAiB,EAAE,KAAK,EAAE,EAAE,kBAAkB,qBAssB9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FieldFlowIconName } from './Icon';
|
|
3
|
+
/** Built-in icon name or any custom React node (vector icons, images, etc.). */
|
|
4
|
+
export type FieldFlowIconSource = FieldFlowIconName | React.ReactNode;
|
|
5
|
+
export declare function renderFieldFlowIcon(icon: FieldFlowIconSource | undefined, color: string, size?: number): React.ReactNode;
|
|
6
|
+
//# sourceMappingURL=renderIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderIcon.d.ts","sourceRoot":"","sources":["../../../src/icons/renderIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE/D,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,KAAK,CAAC,SAAS,CAAC;AAEtE,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,mBAAmB,GAAG,SAAS,EACrC,KAAK,EAAE,MAAM,EACb,IAAI,SAAK,GACR,KAAK,CAAC,SAAS,CAMjB"}
|
|
@@ -8,13 +8,27 @@ export { KeyboardAwareFormWrapper } from './components/KeyboardAwareFormWrapper'
|
|
|
8
8
|
export type { KeyboardAwareFormWrapperProps } from './components/KeyboardAwareFormWrapper';
|
|
9
9
|
export { FieldFlowDropdown } from './components/FieldFlowDropdown';
|
|
10
10
|
export type { FieldFlowDropdownProps, FieldFlowDropdownSingleProps, FieldFlowDropdownMultiProps, FieldFlowDropdownPresentation, } from './components/FieldFlowDropdown';
|
|
11
|
+
export { FieldFlowOTP } from './components/FieldFlowOTP';
|
|
12
|
+
export type { FieldFlowOTPProps } from './components/FieldFlowOTP';
|
|
13
|
+
export { FieldFlowMaskedInput } from './components/FieldFlowMaskedInput';
|
|
14
|
+
export type { FieldFlowMaskedInputProps } from './components/FieldFlowMaskedInput';
|
|
15
|
+
export { FieldFlowCheckbox } from './components/FieldFlowCheckbox';
|
|
16
|
+
export type { FieldFlowCheckboxProps } from './components/FieldFlowCheckbox';
|
|
17
|
+
export { FieldFlowRadio } from './components/FieldFlowRadio';
|
|
18
|
+
export type { FieldFlowRadioProps } from './components/FieldFlowRadio';
|
|
19
|
+
export { FieldFlowSwitch } from './components/FieldFlowSwitch';
|
|
20
|
+
export type { FieldFlowSwitchProps } from './components/FieldFlowSwitch';
|
|
21
|
+
export { FieldFlowDateTimePicker } from './components/FieldFlowDateTimePicker';
|
|
22
|
+
export type { FieldFlowDateTimePickerProps, FieldFlowDateTimeMode, } from './components/FieldFlowDateTimePicker';
|
|
11
23
|
export { FieldFlowThemeProvider, useFieldFlowTheme, defaultTheme, darkTheme } from './theme';
|
|
12
24
|
export type { FieldFlowThemeProviderProps } from './theme';
|
|
13
25
|
export { useFieldFlowForm, useKeyboardManager, useFieldState } from './hooks';
|
|
14
|
-
export type { UseFieldFlowFormOptions, UseFieldFlowFormResult, FieldFlowFormRules, UseKeyboardManagerOptions, UseKeyboardManagerResult, UseFieldStateOptions, } from './hooks';
|
|
15
|
-
export { useValidation, runRules, isValidEmail, isValidNumber, isValidPhone, requiredValidator, emailValidator, numberValidator, phoneValidator, minLengthValidator, maxLengthValidator, patternValidator, } from './validation';
|
|
16
|
-
export type { UseValidationResult } from './validation';
|
|
17
|
-
export {
|
|
18
|
-
export type {
|
|
19
|
-
export
|
|
26
|
+
export type { UseFieldFlowFormOptions, UseFieldFlowFormResult, FieldFlowFormRules, AsyncFieldValidator, AsyncFieldValidators, CrossFieldRule, UseKeyboardManagerOptions, UseKeyboardManagerResult, UseFieldStateOptions, } from './hooks';
|
|
27
|
+
export { useValidation, runRules, isValidEmail, isValidNumber, isValidPhone, requiredValidator, emailValidator, numberValidator, phoneValidator, minLengthValidator, maxLengthValidator, patternValidator, zodToFormErrors, zodFormValidate, createZodSubmitGuard, fieldRulesFromZodString, } from './validation';
|
|
28
|
+
export type { UseValidationResult, ZodSchemaLike, ZodIssueLike, ZodErrorLike } from './validation';
|
|
29
|
+
export { applyMask, applyPattern, formatMasked, unmask, digitsOnly, applyPhoneMask, applyCardMask, applyDateMask, applyCurrencyMask, } from './utils/masks';
|
|
30
|
+
export type { FieldFlowMaskType, MaskResult, ApplyMaskOptions } from './utils/masks';
|
|
31
|
+
export { FieldFlowIcon, renderFieldFlowIcon } from './icons';
|
|
32
|
+
export type { FieldFlowIconName, FieldFlowIconProps, FieldFlowIconSource } from './icons';
|
|
33
|
+
export type { FieldFlowFieldType, FieldFlowState, FieldFlowRules, FieldFlowOption, FieldFlowVariant, ValidationResult, Validator, FieldFlowColors, FieldFlowSpacing, FieldFlowTypography, FieldFlowAnimationConfig, FieldFlowTheme, DeepPartial, } from './types';
|
|
20
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,YAAY,EAAE,qBAAqB,EAAE,MAAM,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YAAY,EACZ,YAAY,EACZ,MAAM,EACN,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGrF,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC7D,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAG1F,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -6,7 +6,11 @@ export interface FieldFlowOption {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
/** Optional secondary line of text shown under the label in the option list. */
|
|
8
8
|
description?: string;
|
|
9
|
+
/** Built-in icon name or a custom React node shown beside the option. */
|
|
10
|
+
icon?: import('../icons').FieldFlowIconSource;
|
|
9
11
|
}
|
|
12
|
+
/** Visual style for text-like FieldFlow fields. */
|
|
13
|
+
export type FieldFlowVariant = 'outlined' | 'filled' | 'underline' | 'floating';
|
|
10
14
|
export type FieldFlowFieldType = 'text' | 'email' | 'number' | 'decimal' | 'phone' | 'password' | 'search' | 'multiline' | 'description' | 'chat';
|
|
11
15
|
export type FieldFlowState = 'idle' | 'focused' | 'error' | 'success' | 'disabled' | 'readonly' | 'loading';
|
|
12
16
|
export interface ValidationResult {
|
|
@@ -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,sEA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