@saas-ui/forms 2.0.0-next.3 → 2.0.0-next.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +53 -6
  3. package/dist/ajv/index.d.ts +358 -11
  4. package/dist/ajv/index.js +7 -9
  5. package/dist/ajv/index.js.map +1 -1
  6. package/dist/ajv/index.mjs +7 -10
  7. package/dist/ajv/index.mjs.map +1 -1
  8. package/dist/index.d.ts +448 -247
  9. package/dist/index.js +707 -682
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +691 -666
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/yup/index.d.ts +580 -21
  14. package/dist/yup/index.js +6 -10
  15. package/dist/yup/index.js.map +1 -1
  16. package/dist/yup/index.mjs +4 -8
  17. package/dist/yup/index.mjs.map +1 -1
  18. package/dist/zod/index.d.ts +580 -11
  19. package/dist/zod/index.js +5 -0
  20. package/dist/zod/index.js.map +1 -1
  21. package/dist/zod/index.mjs +5 -1
  22. package/dist/zod/index.mjs.map +1 -1
  23. package/package.json +19 -10
  24. package/src/array-field.tsx +82 -45
  25. package/src/auto-form.tsx +7 -3
  26. package/src/base-field.tsx +54 -0
  27. package/src/create-field.tsx +144 -0
  28. package/src/create-form.tsx +54 -0
  29. package/src/default-fields.tsx +163 -0
  30. package/src/display-field.tsx +9 -11
  31. package/src/display-if.tsx +20 -13
  32. package/src/field-resolver.ts +10 -8
  33. package/src/field.tsx +18 -445
  34. package/src/fields-context.tsx +23 -0
  35. package/src/fields.tsx +34 -21
  36. package/src/form-context.tsx +84 -0
  37. package/src/form.tsx +69 -52
  38. package/src/index.ts +44 -4
  39. package/src/input-right-button/input-right-button.stories.tsx +1 -1
  40. package/src/input-right-button/input-right-button.tsx +0 -2
  41. package/src/layout.tsx +16 -11
  42. package/src/number-input/number-input.tsx +9 -5
  43. package/src/object-field.tsx +13 -8
  44. package/src/password-input/password-input.stories.tsx +23 -2
  45. package/src/password-input/password-input.tsx +6 -6
  46. package/src/pin-input/pin-input.tsx +1 -5
  47. package/src/radio/radio-input.stories.tsx +1 -1
  48. package/src/radio/radio-input.tsx +12 -10
  49. package/src/select/native-select.tsx +1 -4
  50. package/src/select/select-context.tsx +130 -0
  51. package/src/select/select.stories.tsx +116 -85
  52. package/src/select/select.test.tsx +1 -1
  53. package/src/select/select.tsx +160 -146
  54. package/src/step-form.tsx +29 -11
  55. package/src/submit-button.tsx +5 -1
  56. package/src/types.ts +144 -0
  57. package/src/use-array-field.tsx +9 -3
  58. package/src/utils.ts +23 -1
  59. package/src/watch-field.tsx +2 -6
  60. /package/src/radio/{radio.test.tsx → radio-input.test.tsx} +0 -0
@@ -1,10 +1,339 @@
1
+ import * as _chakra_ui_checkbox_dist_checkbox from '@chakra-ui/checkbox/dist/checkbox';
2
+ import * as _chakra_ui_switch_dist_switch from '@chakra-ui/switch/dist/switch';
3
+ import * as _chakra_ui_textarea_dist_textarea from '@chakra-ui/textarea/dist/textarea';
4
+ import * as react_hook_form from 'react-hook-form';
5
+ import { FieldValues, FieldPath, RegisterOptions, UseFormReturn, UseFormProps, WatchObserver, SubmitHandler, SubmitErrorHandler, UseFieldArrayReturn } from 'react-hook-form';
6
+ import * as react from 'react';
7
+ import react__default from 'react';
8
+ import * as _chakra_ui_system_dist_system_types from '@chakra-ui/system/dist/system.types';
9
+ import { ButtonProps, InputProps, RadioGroupProps, MenuProps, SelectProps as SelectProps$1, UsePinInputProps, SystemProps, FormControlProps, HTMLChakraProps, NumberInputProps as NumberInputProps$1, StackDirection, MenuItemOptionProps, ResponsiveValue, TextareaProps, SwitchProps, CheckboxProps, RadioProps } from '@chakra-ui/react';
10
+ import { MaybeRenderProp } from '@chakra-ui/react-utils';
11
+ import * as zod from 'zod';
12
+ import { z } from 'zod';
1
13
  import * as _saas_ui_forms from '@saas-ui/forms';
2
- import { FieldProps, FormProps, CreateFormProps } from '@saas-ui/forms';
3
- import * as z from 'zod';
4
- import { z as z$1 } from 'zod';
14
+ import { FieldProps as FieldProps$1, FormProps as FormProps$1, CreateFormProps } from '@saas-ui/forms';
5
15
  import { zodResolver } from '@hookform/resolvers/zod';
6
16
  export { zodResolver } from '@hookform/resolvers/zod';
7
17
 
18
+ interface SubmitButtonProps extends ButtonProps {
19
+ /**
20
+ * Disable the submit button if the form is untouched.
21
+ *
22
+ * Change the default behavior by updating
23
+ * `SubmitButton.defaultProps.disableIfUntouched`
24
+ */
25
+ disableIfUntouched?: boolean;
26
+ /**
27
+ * Disable the submit button if the form is invalid.
28
+ *
29
+ * Change the default behavior by updating
30
+ * `SubmitButton.defaultProps.disableIfInvalid`
31
+ */
32
+ disableIfInvalid?: boolean;
33
+ }
34
+
35
+ interface NumberInputOptions {
36
+ /**
37
+ * Hide the stepper.
38
+ */
39
+ hideStepper?: boolean;
40
+ /**
41
+ * Render a custom increment icon.
42
+ */
43
+ incrementIcon?: react.ReactNode;
44
+ /**
45
+ * Render a custom decrement icon.
46
+ */
47
+ decrementIcon?: react.ReactNode;
48
+ }
49
+ interface NumberInputProps extends NumberInputProps$1, NumberInputOptions {
50
+ }
51
+
52
+ interface PasswordOptions {
53
+ viewIcon?: react__default.ReactNode;
54
+ viewOffIcon?: react__default.ReactNode;
55
+ leftAddon?: react__default.ReactNode;
56
+ }
57
+ interface PasswordInputProps extends InputProps, PasswordOptions {
58
+ }
59
+
60
+ interface RadioOption extends Omit<RadioProps, 'value' | 'label'>, FieldOption {
61
+ }
62
+ type RadioOptions = FieldOptions<RadioOption>;
63
+ interface RadioInputOptions {
64
+ options: RadioOptions;
65
+ spacing?: SystemProps['margin'];
66
+ direction?: StackDirection;
67
+ }
68
+ interface RadioInputProps extends Omit<RadioGroupProps, 'children'>, RadioInputOptions {
69
+ }
70
+
71
+ interface SelectOptions {
72
+ /**
73
+ * The name of the input field in a native form.
74
+ */
75
+ name: string;
76
+ /**
77
+ * The value of the select field.
78
+ */
79
+ value?: string | string[];
80
+ /**
81
+ * The initial value of the select field.
82
+ */
83
+ defaultValue?: string | string[];
84
+ /**
85
+ * The callback invoked when the value of the select field changes.
86
+ * @param value The value of the select field.
87
+ */
88
+ onChange?: (value: string | string[]) => void;
89
+ /**
90
+ * The placeholder text when there's no value.
91
+ */
92
+ placeholder?: string;
93
+ /**
94
+ * If `true`, the select will be disabled.
95
+ */
96
+ isDisabled?: boolean;
97
+ /**
98
+ * An array of options
99
+ * If you leave this empty the children prop will be rendered.
100
+ */
101
+ options?: FieldOptions<SelectOption>;
102
+ /**
103
+ * Enable multiple select.
104
+ */
105
+ multiple?: boolean;
106
+ /**
107
+ * The function used to render the value of the select field.
108
+ * @param value The value of the select field.
109
+ * @returns The rendered value.
110
+ */
111
+ renderValue?: (value: string | string[]) => react__default.ReactNode;
112
+ }
113
+
114
+ interface SelectProps extends Omit<MenuProps, 'children'>, SelectOptions {
115
+ }
116
+ interface SelectOption extends Omit<MenuItemOptionProps, 'value'>, FieldOption {
117
+ }
118
+ /**
119
+ * An option in a select list
120
+ *
121
+ * @see https://saas-ui.dev/docs/components/forms/select
122
+ */
123
+ declare const SelectOption: _chakra_ui_system_dist_system_types.ComponentWithAs<"button", MenuItemOptionProps>;
124
+
125
+ interface Option$1 {
126
+ value: string;
127
+ label?: string;
128
+ }
129
+ interface NativeSelectOptions {
130
+ options?: Option$1[];
131
+ }
132
+ interface NativeSelectProps extends SelectProps$1, NativeSelectOptions {
133
+ }
134
+
135
+ interface InputFieldProps extends InputProps {
136
+ type?: string;
137
+ leftAddon?: react.ReactNode;
138
+ rightAddon?: react.ReactNode;
139
+ }
140
+ interface NumberInputFieldProps extends NumberInputProps {
141
+ type: 'number';
142
+ }
143
+ interface PinFieldProps extends Omit<UsePinInputProps, 'type'> {
144
+ pinLength?: number;
145
+ pinType?: 'alphanumeric' | 'number';
146
+ spacing?: SystemProps['margin'];
147
+ }
148
+ declare const defaultFieldTypes: {
149
+ text: react.FC<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
150
+ email: react.FC<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
151
+ url: react.FC<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
152
+ phone: react.FC<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
153
+ number: react.FC<NumberInputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
154
+ password: react.FC<PasswordInputProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
155
+ textarea: react.FC<TextareaProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
156
+ switch: react.FC<SwitchProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
157
+ select: react.FC<SelectProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
158
+ checkbox: react.FC<CheckboxProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
159
+ radio: react.FC<RadioInputProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
160
+ pin: react.FC<PinFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
161
+ 'native-select': react.FC<NativeSelectProps & BaseFieldProps<react_hook_form.FieldValues, string>>;
162
+ };
163
+ type DefaultFields = typeof defaultFieldTypes;
164
+
165
+ type FieldOption = {
166
+ label?: string;
167
+ value: string;
168
+ };
169
+ type FieldOptions<TOption extends FieldOption = FieldOption> = Array<string> | Array<TOption>;
170
+ type ValueOf<T> = T[keyof T];
171
+ type ShallowMerge<A, B> = Omit<A, keyof B> & B;
172
+ type Split<S extends string, D extends string> = string extends S ? string[] : S extends '' ? [] : S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
173
+ type MapPath<T extends string[]> = T extends [infer U, ...infer R] ? U extends string ? `${U extends `${number}` ? '$' : U}${R[0] extends string ? '.' : ''}${R extends string[] ? MapPath<R> : ''}` : '' : '';
174
+ type TransformPath<T extends string> = MapPath<Split<T, '.'>>;
175
+ type ArrayFieldPath<Name extends string> = Name extends string ? TransformPath<Name> : never;
176
+ interface BaseFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<FormControlProps, 'label' | 'type'> {
177
+ /**
178
+ * The field name
179
+ */
180
+ name: TName | ArrayFieldPath<TName>;
181
+ /**
182
+ * The field label
183
+ */
184
+ label?: string;
185
+ /**
186
+ * Hide the field label
187
+ */
188
+ hideLabel?: boolean;
189
+ /**
190
+ * Field help text
191
+ */
192
+ help?: string;
193
+ /**
194
+ * React hook form rules
195
+ */
196
+ rules?: Omit<RegisterOptions<TFieldValues, TName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs' | 'disabled'>;
197
+ /**
198
+ * Build-in types:
199
+ * text, number, password, textarea, select, native-select, checkbox, radio, switch, pin
200
+ *
201
+ * Will default to a text field if there is no matching type.
202
+ */
203
+ type?: string;
204
+ /**
205
+ * The input placeholder
206
+ */
207
+ placeholder?: string;
208
+ }
209
+ type MergeFieldProps<FieldDefs, TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = ValueOf<{
210
+ [K in keyof FieldDefs]: FieldDefs[K] extends React.FC<infer Props> ? {
211
+ type?: K;
212
+ } & ShallowMerge<Props, BaseFieldProps<TFieldValues, TName>> : never;
213
+ }>;
214
+ type FieldProps<TFieldValues extends FieldValues = FieldValues> = MergeFieldProps<DefaultFields, TFieldValues>;
215
+ type DefaultFieldOverrides = {
216
+ submit?: SubmitButtonProps;
217
+ [key: string]: any;
218
+ };
219
+
220
+ type FieldResolver = {
221
+ getFields(): BaseFieldProps[];
222
+ getNestedFields(name: string): BaseFieldProps[];
223
+ };
224
+
225
+ interface DisplayIfProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> {
226
+ children: react.ReactElement;
227
+ name: TName;
228
+ defaultValue?: unknown;
229
+ isDisabled?: boolean;
230
+ isExact?: boolean;
231
+ condition?: (value: unknown, context: UseFormReturn<TFieldValues>) => boolean;
232
+ }
233
+
234
+ interface UseArrayFieldReturn extends UseFieldArrayReturn {
235
+ /**
236
+ * The array field name
237
+ */
238
+ name: string;
239
+ /**
240
+ * The default value for new items
241
+ */
242
+ defaultValue: Record<string, any>;
243
+ /**
244
+ * Min amount of items
245
+ */
246
+ min?: number;
247
+ /**
248
+ * Max amount of items
249
+ */
250
+ max?: number;
251
+ }
252
+ interface ArrayFieldOptions<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> {
253
+ /**
254
+ * The field name
255
+ */
256
+ name: TName;
257
+ /**
258
+ * Default value for new values in the array
259
+ */
260
+ defaultValue?: Record<string, any>;
261
+ /**
262
+ * Default key name for rows, change this if your data uses a different 'id' field
263
+ * @default "id"
264
+ */
265
+ keyName?: string;
266
+ min?: number;
267
+ max?: number;
268
+ }
269
+ interface ArrayFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends ArrayFieldOptions<TFieldValues, TName>, Omit<BaseFieldProps<TFieldValues, TName>, 'name' | 'defaultValue' | 'children'> {
270
+ children: MaybeRenderProp<ArrayField[]>;
271
+ }
272
+ interface ArrayField {
273
+ id: string;
274
+ [key: string]: unknown;
275
+ }
276
+ /**
277
+ * The wrapper component that composes the default ArrayField functionality.
278
+ *
279
+ * @see Docs https://saas-ui.dev/docs/components/forms/array-field
280
+ */
281
+ declare const ArrayField: ((props: ArrayFieldProps & {
282
+ ref?: react.ForwardedRef<UseArrayFieldReturn>;
283
+ }) => react.ReactElement) & {
284
+ displayName: string;
285
+ };
286
+
287
+ interface ObjectFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends BaseFieldProps {
288
+ name: TName;
289
+ children: react.ReactNode;
290
+ columns?: ResponsiveValue<number>;
291
+ spacing?: ResponsiveValue<string | number>;
292
+ }
293
+
294
+ interface FormRenderContext<TFieldValues extends FieldValues = FieldValues, TContext extends object = object, TFieldTypes = FieldProps<TFieldValues>> extends UseFormReturn<TFieldValues, TContext> {
295
+ Field: react.FC<TFieldTypes>;
296
+ DisplayIf: react.FC<DisplayIfProps<TFieldValues>>;
297
+ ArrayField: react.FC<ArrayFieldProps<TFieldValues>>;
298
+ ObjectField: react.FC<ObjectFieldProps<TFieldValues>>;
299
+ }
300
+ interface FormOptions<TFieldValues extends FieldValues = FieldValues, TContext extends object = object, TSchema = any, TFieldTypes = FieldProps<TFieldValues>> {
301
+ /**
302
+ * The form schema.
303
+ */
304
+ schema?: TSchema;
305
+ /**
306
+ * Triggers when any of the field change.
307
+ */
308
+ onChange?: WatchObserver<TFieldValues>;
309
+ /**
310
+ * The submit handler.
311
+ */
312
+ onSubmit: SubmitHandler<TFieldValues>;
313
+ /**
314
+ * Triggers when there are validation errors.
315
+ */
316
+ onError?: SubmitErrorHandler<TFieldValues>;
317
+ /**
318
+ * The Hook Form state ref.
319
+ */
320
+ formRef?: react.RefObject<UseFormReturn<TFieldValues, TContext>>;
321
+ /**
322
+ * The form children, can be a render prop or a ReactNode.
323
+ */
324
+ children?: MaybeRenderProp<FormRenderContext<TFieldValues, TContext, TFieldTypes>>;
325
+ /**
326
+ * The field resolver, used to resolve the fields from schemas.
327
+ */
328
+ fieldResolver?: FieldResolver;
329
+ /**
330
+ * Field overrides
331
+ */
332
+ fields?: DefaultFieldOverrides;
333
+ }
334
+ interface FormProps<TFieldValues extends FieldValues = FieldValues, TContext extends object = object, TSchema = any, TFieldTypes = FieldProps<TFieldValues>> extends UseFormProps<TFieldValues, TContext>, Omit<HTMLChakraProps<'form'>, 'children' | 'onChange' | 'onSubmit' | 'onError'>, FormOptions<TFieldValues, TContext, TSchema, TFieldTypes> {
335
+ }
336
+
8
337
  type Options = {
9
338
  min?: number;
10
339
  max?: number;
@@ -15,11 +344,11 @@ type Options = {
15
344
  * @param schema The Yup schema
16
345
  * @returns {FieldProps[]}
17
346
  */
18
- declare const getFieldsFromSchema: (schema: z.ZodTypeAny) => FieldProps[];
19
- declare const getNestedSchema: (schema: z.ZodTypeAny, path: string) => any;
20
- declare const zodFieldResolver: <T extends z.ZodTypeAny>(schema: T) => {
21
- getFields(): FieldProps<_saas_ui_forms.FieldValues, string>[];
22
- getNestedFields(name: string): FieldProps<_saas_ui_forms.FieldValues, string>[];
347
+ declare const getFieldsFromSchema: (schema: zod.ZodTypeAny) => FieldProps$1[];
348
+ declare const getNestedSchema: (schema: zod.ZodTypeAny, path: string) => any;
349
+ declare const zodFieldResolver: <T extends zod.ZodTypeAny>(schema: T) => {
350
+ getFields(): FieldProps$1<_saas_ui_forms.FieldValues>[];
351
+ getNestedFields(name: string): FieldProps$1<_saas_ui_forms.FieldValues>[];
23
352
  };
24
353
  interface ZodMeta {
25
354
  label: string;
@@ -29,10 +358,250 @@ declare const zodMeta: (meta: ZodMeta) => string;
29
358
  declare const zodParseMeta: (meta: string) => any;
30
359
 
31
360
  type ResolverArgs = Parameters<typeof zodResolver>;
32
- interface CreateZodFormProps extends CreateFormProps {
361
+ interface CreateZodFormProps<FieldDefs> extends CreateFormProps<FieldDefs> {
33
362
  schemaOptions?: ResolverArgs[1];
34
363
  resolverOptions?: ResolverArgs[2];
35
364
  }
36
- declare const createZodForm: (options?: CreateZodFormProps) => <TSchema extends z$1.AnyZodObject = z$1.AnyZodObject, TContext extends object = object>(props: FormProps<z$1.TypeOf<TSchema>, TContext, TSchema>) => React.ReactElement;
365
+ declare const createZodForm: <FieldDefs>(options?: CreateZodFormProps<FieldDefs> | undefined) => <TSchema extends z.AnyZodObject = z.AnyZodObject, TContext extends object = object>(props: Omit<FormProps$1<z.TypeOf<TSchema>, TContext, TSchema, _saas_ui_forms.FieldProps<z.TypeOf<TSchema>>>, "children" | "fields"> & {
366
+ children?: react.ReactNode | ((props: _saas_ui_forms.FormRenderContext<z.TypeOf<TSchema>, TContext, ((FieldDefs extends never ? {
367
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
368
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
369
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
370
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
371
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
372
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
373
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
374
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
375
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
376
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
377
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
378
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
379
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
380
+ } : Omit<{
381
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
382
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
383
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
384
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
385
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
386
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
387
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
388
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
389
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
390
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
391
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
392
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
393
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
394
+ }, keyof FieldDefs> & FieldDefs) extends infer T ? { [K in keyof T]: (FieldDefs extends never ? {
395
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
396
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
397
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
398
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
399
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
400
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
401
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
402
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
403
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
404
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
405
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
406
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
407
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
408
+ } : Omit<{
409
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
410
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
411
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
412
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
413
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
414
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
415
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
416
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
417
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
418
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
419
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
420
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
421
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
422
+ }, keyof FieldDefs> & FieldDefs)[K] extends react.FC<infer Props> ? {
423
+ type?: K | undefined;
424
+ } & Omit<Props, keyof _saas_ui_forms.BaseFieldProps<TFieldValues, TName>> & _saas_ui_forms.BaseFieldProps<z.TypeOf<TSchema>, react_hook_form.Path<z.TypeOf<TSchema>>> : never; } : never)[keyof (FieldDefs extends never ? {
425
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
426
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
427
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
428
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
429
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
430
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
431
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
432
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
433
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
434
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
435
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
436
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
437
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
438
+ } : Omit<{
439
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
440
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
441
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
442
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
443
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
444
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
445
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
446
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
447
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
448
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
449
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
450
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
451
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
452
+ }, keyof FieldDefs> & FieldDefs)]>) => react.ReactNode);
453
+ fields?: ({ [K_1 in react_hook_form.Path<z.TypeOf<TSchema>> | (react_hook_form.Path<z.TypeOf<TSchema>> extends infer T_1 ? T_1 extends react_hook_form.Path<z.TypeOf<TSchema>> ? T_1 extends string ? (string extends T_1 ? (T_1 & string)[] : T_1 extends infer T_2 ? T_2 extends T_1 ? T_2 extends "" ? [] : T_2 extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...any] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [T_2] : never : never) extends infer T_4 ? T_4 extends (string extends T_1 ? (T_1 & string)[] : T_1 extends infer T_2 ? T_2 extends T_1 ? T_2 extends "" ? [] : T_2 extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_3}.${infer U}` ? [T_3, ...any] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [T_2] : never : never) ? T_4 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_5 ? T_5 extends R ? T_5 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_6 ? T_6 extends R ? T_6 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_7 ? T_7 extends R ? T_7 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_8 ? T_8 extends R ? T_8 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_9 ? T_9 extends R ? T_9 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_10 ? T_10 extends R ? T_10 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_11 ? T_11 extends R ? T_11 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_12 ? T_12 extends R ? T_12 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_13 ? T_13 extends R ? T_13 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_14 ? T_14 extends R ? T_14 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? any : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : never : never : never)]?: Omit<((FieldDefs extends never ? {
454
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
455
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
456
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
457
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
458
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
459
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
460
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
461
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
462
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
463
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
464
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
465
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
466
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
467
+ } : Omit<{
468
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
469
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
470
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
471
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
472
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
473
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
474
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
475
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
476
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
477
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
478
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
479
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
480
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
481
+ }, keyof FieldDefs> & FieldDefs) extends infer T_15 ? { [K_2 in keyof T_15]: (FieldDefs extends never ? {
482
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
483
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
484
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
485
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
486
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
487
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
488
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
489
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
490
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
491
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
492
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
493
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
494
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
495
+ } : Omit<{
496
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
497
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
498
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
499
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
500
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
501
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
502
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
503
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
504
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
505
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
506
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
507
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
508
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
509
+ }, keyof FieldDefs> & FieldDefs)[K_2] extends react.FC<infer Props> ? {
510
+ type?: K_2 | undefined;
511
+ } & Omit<Props, keyof _saas_ui_forms.BaseFieldProps<TFieldValues, TName>> & _saas_ui_forms.BaseFieldProps<z.TypeOf<TSchema>, react_hook_form.Path<z.TypeOf<TSchema>>> : never; } : never)[keyof (FieldDefs extends never ? {
512
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
513
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
514
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
515
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
516
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
517
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
518
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
519
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
520
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
521
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
522
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
523
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
524
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
525
+ } : Omit<{
526
+ text: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
527
+ email: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
528
+ url: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
529
+ phone: react.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
530
+ number: react.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
531
+ password: react.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
532
+ textarea: react.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
533
+ switch: react.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
534
+ select: react.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
535
+ checkbox: react.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
536
+ radio: react.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
537
+ pin: react.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
538
+ 'native-select': react.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
539
+ }, keyof FieldDefs> & FieldDefs)], "name"> | undefined; } & {
540
+ submit?: _saas_ui_forms.SubmitButtonProps | undefined;
541
+ }) | undefined;
542
+ } & {
543
+ ref?: react.ForwardedRef<HTMLFormElement> | undefined;
544
+ }) => React.ReactElement;
545
+
546
+ declare const Form: <TSchema extends zod.AnyZodObject = zod.AnyZodObject, TContext extends object = object>(props: Omit<FormProps<zod.TypeOf<TSchema>, TContext, TSchema, FieldProps<zod.TypeOf<TSchema>>>, "children" | "fields"> & {
547
+ children?: react.ReactNode | ((props: FormRenderContext<zod.TypeOf<TSchema>, TContext, ({
548
+ type?: "number" | undefined;
549
+ } & Omit<NumberInputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
550
+ type?: "text" | undefined;
551
+ } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
552
+ type?: "email" | undefined;
553
+ } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
554
+ type?: "url" | undefined;
555
+ } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
556
+ type?: "phone" | undefined;
557
+ } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
558
+ type?: "password" | undefined;
559
+ } & Omit<PasswordInputProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
560
+ type?: "textarea" | undefined;
561
+ } & Omit<_chakra_ui_textarea_dist_textarea.TextareaProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
562
+ type?: "switch" | undefined;
563
+ } & Omit<_chakra_ui_switch_dist_switch.SwitchProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
564
+ type?: "select" | undefined;
565
+ } & Omit<SelectProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
566
+ type?: "checkbox" | undefined;
567
+ } & Omit<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
568
+ type?: "radio" | undefined;
569
+ } & Omit<RadioInputProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
570
+ type?: "pin" | undefined;
571
+ } & Omit<PinFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
572
+ type?: "native-select" | undefined;
573
+ } & Omit<NativeSelectProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>)>) => react.ReactNode);
574
+ fields?: ({ [K in react_hook_form.Path<zod.TypeOf<TSchema>> | (react_hook_form.Path<zod.TypeOf<TSchema>> extends infer T ? T extends react_hook_form.Path<zod.TypeOf<TSchema>> ? T extends string ? (string extends T ? (T & string)[] : T extends infer T_1 ? T_1 extends T ? T_1 extends "" ? [] : T_1 extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...any] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [T_1] : never : never) extends infer T_3 ? T_3 extends (string extends T ? (T & string)[] : T extends infer T_1 ? T_1 extends T ? T_1 extends "" ? [] : T_1 extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...string extends U ? (U & string)[] : U extends "" ? [] : U extends `${infer T_2}.${infer U}` ? [T_2, ...any] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [T_1] : never : never) ? T_3 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_4 ? T_4 extends R ? T_4 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_5 ? T_5 extends R ? T_5 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_6 ? T_6 extends R ? T_6 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_7 ? T_7 extends R ? T_7 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_8 ? T_8 extends R ? T_8 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_9 ? T_9 extends R ? T_9 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_10 ? T_10 extends R ? T_10 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_11 ? T_11 extends R ? T_11 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_12 ? T_12 extends R ? T_12 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_13 ? T_13 extends R ? T_13 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? any : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : never : never : never)]?: Omit<({
575
+ type?: "number" | undefined;
576
+ } & Omit<NumberInputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
577
+ type?: "text" | undefined;
578
+ } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
579
+ type?: "email" | undefined;
580
+ } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
581
+ type?: "url" | undefined;
582
+ } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
583
+ type?: "phone" | undefined;
584
+ } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
585
+ type?: "password" | undefined;
586
+ } & Omit<PasswordInputProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
587
+ type?: "textarea" | undefined;
588
+ } & Omit<_chakra_ui_textarea_dist_textarea.TextareaProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
589
+ type?: "switch" | undefined;
590
+ } & Omit<_chakra_ui_switch_dist_switch.SwitchProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
591
+ type?: "select" | undefined;
592
+ } & Omit<SelectProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
593
+ type?: "checkbox" | undefined;
594
+ } & Omit<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
595
+ type?: "radio" | undefined;
596
+ } & Omit<RadioInputProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
597
+ type?: "pin" | undefined;
598
+ } & Omit<PinFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>) | ({
599
+ type?: "native-select" | undefined;
600
+ } & Omit<NativeSelectProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<zod.TypeOf<TSchema>, react_hook_form.Path<zod.TypeOf<TSchema>>>), "name"> | undefined; } & {
601
+ submit?: SubmitButtonProps | undefined;
602
+ }) | undefined;
603
+ } & {
604
+ ref?: react.ForwardedRef<HTMLFormElement> | undefined;
605
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
37
606
 
38
- export { Options, ZodMeta, createZodForm, getFieldsFromSchema, getNestedSchema, zodFieldResolver, zodMeta, zodParseMeta };
607
+ export { Form, Options, ZodMeta, createZodForm, getFieldsFromSchema, getNestedSchema, zodFieldResolver, zodMeta, zodParseMeta };