@saas-ui/forms 2.0.0-next.9 → 2.0.0-rc.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,38 +1,18 @@
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, UseFieldArrayReturn, WatchObserver, SubmitHandler, SubmitErrorHandler } from 'react-hook-form';
6
1
  import * as React$1 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 { FocusableElement } from '@chakra-ui/utils';
2
+ import React$1__default from 'react';
3
+ import * as react_hook_form from 'react-hook-form';
4
+ import { FieldValues, FieldPath, UseFormProps, SubmitHandler, RegisterOptions, UseFormReturn, UseFieldArrayReturn, WatchObserver, SubmitErrorHandler } from 'react-hook-form';
11
5
  import { MaybeRenderProp } from '@chakra-ui/react-utils';
6
+ import { UseStepperProps, UseStepperReturn } from '@saas-ui/core';
7
+ import { HTMLChakraProps, TextareaProps, SwitchProps, CheckboxProps, FormControlProps, ResponsiveValue, InputProps, RadioGroupProps, MenuProps, SelectProps as SelectProps$1, UsePinInputProps, SystemProps, NumberInputProps as NumberInputProps$1, StackDirection, MenuItemOptionProps, ButtonProps, RadioProps } from '@chakra-ui/react';
8
+ import { FocusableElement } from '@chakra-ui/utils';
9
+ import * as _chakra_ui_system_dist_system_types from '@chakra-ui/system/dist/system.types';
12
10
  import * as yup from 'yup';
13
11
  import { ObjectSchema, InferType } from 'yup';
14
- import * as _saas_ui_forms from '@saas-ui/forms';
15
- import { FieldProps as FieldProps$1, GetFieldResolver, FormProps as FormProps$1, CreateFormProps } from '@saas-ui/forms';
12
+ import { FieldProps as FieldProps$1, GetFieldResolver, WithFields, FormProps as FormProps$1, CreateFormProps } from '@saas-ui/forms';
16
13
  import { yupResolver } from '@hookform/resolvers/yup';
17
14
  export { yupResolver } from '@hookform/resolvers/yup';
18
15
 
19
- interface SubmitButtonProps extends ButtonProps {
20
- /**
21
- * Disable the submit button if the form is untouched.
22
- *
23
- * Change the default behavior by updating
24
- * `SubmitButton.defaultProps.disableIfUntouched`
25
- */
26
- disableIfUntouched?: boolean;
27
- /**
28
- * Disable the submit button if the form is invalid.
29
- *
30
- * Change the default behavior by updating
31
- * `SubmitButton.defaultProps.disableIfInvalid`
32
- */
33
- disableIfInvalid?: boolean;
34
- }
35
-
36
16
  interface NumberInputOptions {
37
17
  /**
38
18
  * Hide the stepper.
@@ -51,9 +31,9 @@ interface NumberInputProps extends NumberInputProps$1, NumberInputOptions {
51
31
  }
52
32
 
53
33
  interface PasswordOptions {
54
- viewIcon?: React__default.ReactNode;
55
- viewOffIcon?: React__default.ReactNode;
56
- leftAddon?: React__default.ReactNode;
34
+ viewIcon?: React$1__default.ReactNode;
35
+ viewOffIcon?: React$1__default.ReactNode;
36
+ leftAddon?: React$1__default.ReactNode;
57
37
  }
58
38
  interface PasswordInputProps extends InputProps, PasswordOptions {
59
39
  }
@@ -109,7 +89,7 @@ interface SelectOptions {
109
89
  * @param value The value of the select field.
110
90
  * @returns The rendered value.
111
91
  */
112
- renderValue?: (value: string | string[]) => React__default.ReactNode;
92
+ renderValue?: (value: string | string[]) => React$1__default.ReactNode;
113
93
  }
114
94
 
115
95
  interface SelectProps extends Omit<MenuProps, 'children'>, SelectOptions {
@@ -163,6 +143,23 @@ declare const defaultFieldTypes: {
163
143
  };
164
144
  type DefaultFields = typeof defaultFieldTypes;
165
145
 
146
+ interface SubmitButtonProps extends ButtonProps {
147
+ /**
148
+ * Disable the submit button if the form is untouched.
149
+ *
150
+ * Change the default behavior by updating
151
+ * `SubmitButton.defaultProps.disableIfUntouched`
152
+ */
153
+ disableIfUntouched?: boolean;
154
+ /**
155
+ * Disable the submit button if the form is invalid.
156
+ *
157
+ * Change the default behavior by updating
158
+ * `SubmitButton.defaultProps.disableIfInvalid`
159
+ */
160
+ disableIfInvalid?: boolean;
161
+ }
162
+
166
163
  type FieldOption = {
167
164
  label?: string;
168
165
  value: string;
@@ -298,7 +295,7 @@ interface FormRenderContext<TFieldValues extends FieldValues = FieldValues, TCon
298
295
  ArrayField: React$1.FC<ArrayFieldProps<TFieldValues> & React$1.RefAttributes<UseArrayFieldReturn>>;
299
296
  ObjectField: React$1.FC<ObjectFieldProps<TFieldValues>>;
300
297
  }
301
- interface FormOptions<TFieldValues extends FieldValues = FieldValues, TContext extends object = object, TSchema = any, TFieldTypes = FieldProps<TFieldValues>> {
298
+ interface FormOptions<TSchema = unknown, TFieldValues extends FieldValues = FieldValues, TContext extends object = object, TFieldTypes = FieldProps<TFieldValues>> {
302
299
  /**
303
300
  * The form schema.
304
301
  */
@@ -332,7 +329,62 @@ interface FormOptions<TFieldValues extends FieldValues = FieldValues, TContext e
332
329
  */
333
330
  fields?: DefaultFieldOverrides;
334
331
  }
335
- 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> {
332
+ interface FormProps<TSchema = unknown, TFieldValues extends FieldValues = FieldValues, TContext extends object = object, TFieldTypes = FieldProps<TFieldValues>> extends UseFormProps<TFieldValues, TContext>, Omit<HTMLChakraProps<'form'>, 'children' | 'onChange' | 'onSubmit' | 'onError'>, FormOptions<TSchema, TFieldValues, TContext, TFieldTypes> {
333
+ }
334
+
335
+ type StepsOptions<TSchema, TName extends string = string> = {
336
+ /**
337
+ * The step name
338
+ */
339
+ name: TName;
340
+ /**
341
+ * Schema
342
+ */
343
+ schema?: TSchema;
344
+ }[];
345
+ interface FormStepOptions<TName extends string = string> {
346
+ /**
347
+ * The step name
348
+ */
349
+ name: TName;
350
+ /**
351
+ * Schema
352
+ */
353
+ schema?: any;
354
+ /**
355
+ * Hook Form Resolver
356
+ */
357
+ resolver?: any;
358
+ }
359
+ interface FormStepProps<TName extends string = string> extends FormStepOptions<TName>, Omit<HTMLChakraProps<'div'>, 'onSubmit'> {
360
+ onSubmit?: FormStepSubmitHandler;
361
+ }
362
+ type FormStepSubmitHandler<TFieldValues extends FieldValues = FieldValues> = (data: TFieldValues, stepper: UseStepperReturn) => Promise<void>;
363
+
364
+ type StepName<T extends {
365
+ [k: number]: {
366
+ readonly name: string;
367
+ };
368
+ }> = T[number]['name'];
369
+ interface StepFormRenderContext<TSteps extends StepsOptions<any> = StepsOptions<any>, TFieldValues extends FieldValues = FieldValues, TContext extends object = object, TFieldTypes = FieldProps<TFieldValues>> extends UseStepFormReturn<TFieldValues> {
370
+ Field: React$1.FC<TFieldTypes & React$1.RefAttributes<FocusableElement>>;
371
+ FormStep: React$1.FC<FormStepProps<StepName<TSteps>>>;
372
+ DisplayIf: React$1.FC<DisplayIfProps<TFieldValues>>;
373
+ ArrayField: React$1.FC<ArrayFieldProps<TFieldValues> & React$1.RefAttributes<UseArrayFieldReturn>>;
374
+ ObjectField: React$1.FC<ObjectFieldProps<TFieldValues>>;
375
+ }
376
+ interface UseStepFormProps<TSteps extends StepsOptions<any> = StepsOptions<any>, TFieldValues extends FieldValues = FieldValues, TContext extends object = object, TFieldTypes = FieldProps<TFieldValues>> extends Omit<UseStepperProps, 'onChange'>, Omit<FormProps<any, TFieldValues, TContext, TFieldTypes>, 'children'> {
377
+ steps?: TSteps;
378
+ children: MaybeRenderProp<StepFormRenderContext<TSteps, TFieldValues, TContext, TFieldTypes>>;
379
+ }
380
+ interface UseStepFormReturn<TFieldValues extends FieldValues = FieldValues> extends UseStepperReturn {
381
+ getFormProps(): {
382
+ onSubmit: SubmitHandler<TFieldValues>;
383
+ schema?: any;
384
+ resolver?: any;
385
+ };
386
+ updateStep(step: any): void;
387
+ steps: Record<string, any>;
336
388
  }
337
389
 
338
390
  type AnyObjectSchema = ObjectSchema<any, any, any, ''> | ObjectSchema<any, any, any, 'd'> | ObjectSchema<any, any, any, 's'>;
@@ -356,246 +408,138 @@ interface CreateYupFormProps<FieldDefs> extends CreateFormProps<FieldDefs> {
356
408
  schemaOptions?: ResolverArgs[1];
357
409
  resolverOptions?: ResolverArgs[2];
358
410
  }
359
- declare const createYupForm: <FieldDefs>(options?: CreateYupFormProps<FieldDefs> | undefined) => <TSchema extends AnyObjectSchema = AnyObjectSchema, TContext extends object = object>(props: Omit<FormProps$1<InferType<TSchema>, TContext, TSchema, _saas_ui_forms.FieldProps<InferType<TSchema>>>, "children" | "fields"> & {
360
- children?: React__default.ReactNode | ((props: _saas_ui_forms.FormRenderContext<InferType<TSchema>, TContext, ((FieldDefs extends never ? {
361
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
362
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
363
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
364
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
365
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
366
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
367
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
368
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
369
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
370
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
371
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
372
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
373
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
374
- } : Omit<{
375
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
376
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
377
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
378
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
379
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
380
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
381
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
382
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
383
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
384
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
385
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
386
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
387
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
388
- }, keyof FieldDefs> & FieldDefs) extends infer T ? { [K in keyof T]: (FieldDefs extends never ? {
389
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
390
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
391
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
392
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
393
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
394
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
395
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
396
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
397
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
398
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
399
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
400
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
401
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
402
- } : Omit<{
403
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
404
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
405
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
406
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
407
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
408
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
409
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
410
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
411
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
412
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
413
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
414
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
415
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
416
- }, keyof FieldDefs> & FieldDefs)[K] extends React__default.FC<infer Props> ? {
417
- type?: K | undefined;
418
- } & Omit<Props, keyof _saas_ui_forms.BaseFieldProps<TFieldValues, TName>> & _saas_ui_forms.BaseFieldProps<InferType<TSchema>, react_hook_form.Path<InferType<TSchema>>> : never; } : never)[keyof (FieldDefs extends never ? {
419
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
420
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
421
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
422
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
423
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
424
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
425
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
426
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
427
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
428
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
429
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
430
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
431
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
432
- } : Omit<{
433
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
434
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
435
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
436
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
437
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
438
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
439
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
440
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
441
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
442
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
443
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
444
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
445
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
446
- }, keyof FieldDefs> & FieldDefs)]>) => React__default.ReactNode);
447
- fields?: ({ [K_1 in react_hook_form.Path<InferType<TSchema>> | (react_hook_form.Path<InferType<TSchema>> extends infer T_1 ? T_1 extends react_hook_form.Path<InferType<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 ? {
448
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
449
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
450
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
451
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
452
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
453
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
454
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
455
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
456
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
457
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
458
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
459
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
460
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
461
- } : Omit<{
462
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
463
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
464
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
465
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
466
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
467
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
468
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
469
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
470
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
471
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
472
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
473
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
474
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
475
- }, keyof FieldDefs> & FieldDefs) extends infer T_15 ? { [K_2 in keyof T_15]: (FieldDefs extends never ? {
476
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
477
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
478
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
479
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
480
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
481
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
482
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
483
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
484
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
485
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
486
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
487
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
488
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
489
- } : Omit<{
490
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
491
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
492
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
493
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
494
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
495
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
496
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
497
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
498
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
499
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
500
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
501
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
502
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
503
- }, keyof FieldDefs> & FieldDefs)[K_2] extends React__default.FC<infer Props> ? {
504
- type?: K_2 | undefined;
505
- } & Omit<Props, keyof _saas_ui_forms.BaseFieldProps<TFieldValues, TName>> & _saas_ui_forms.BaseFieldProps<InferType<TSchema>, react_hook_form.Path<InferType<TSchema>>> : never; } : never)[keyof (FieldDefs extends never ? {
506
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
507
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
508
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
509
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
510
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
511
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
512
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
513
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
514
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
515
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
516
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
517
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
518
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
519
- } : Omit<{
520
- text: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
521
- email: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
522
- url: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
523
- phone: React__default.FC<_saas_ui_forms.InputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
524
- number: React__default.FC<_saas_ui_forms.NumberInputFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
525
- password: React__default.FC<_saas_ui_forms.PasswordInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
526
- textarea: React__default.FC<_chakra_ui_textarea_dist_textarea.TextareaProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
527
- switch: React__default.FC<_chakra_ui_switch_dist_switch.SwitchProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
528
- select: React__default.FC<_saas_ui_forms.SelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
529
- checkbox: React__default.FC<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
530
- radio: React__default.FC<_saas_ui_forms.RadioInputProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
531
- pin: React__default.FC<_saas_ui_forms.PinFieldProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
532
- 'native-select': React__default.FC<_saas_ui_forms.NativeSelectProps & _saas_ui_forms.BaseFieldProps<_saas_ui_forms.FieldValues, string>>;
533
- }, keyof FieldDefs> & FieldDefs)], "name"> | undefined; } & {
534
- submit?: _saas_ui_forms.SubmitButtonProps | undefined;
535
- }) | undefined;
536
- } & {
537
- ref?: React__default.ForwardedRef<HTMLFormElement> | undefined;
538
- }) => React__default.ReactElement;
411
+ type YupFormType<FieldDefs, ExtraProps = object, ExtraOverrides = object, Type extends 'yup' = 'yup'> = (<TSchema extends AnyObjectSchema = AnyObjectSchema, TFieldValues extends InferType<TSchema> = InferType<TSchema>, // placeholder
412
+ TContext extends object = object>(props: WithFields<FormProps$1<TFieldValues, TContext, TSchema>, FieldDefs, ExtraOverrides> & {
413
+ ref?: React$1__default.ForwardedRef<HTMLFormElement>;
414
+ } & ExtraProps) => React$1__default.ReactElement) & {
415
+ displayName?: string;
416
+ id?: 'YupForm';
417
+ };
418
+ declare const createYupForm: <FieldDefs>(options?: CreateYupFormProps<FieldDefs> | undefined) => YupFormType<FieldDefs, object, object, "yup">;
539
419
 
540
- declare const Form: <TSchema extends AnyObjectSchema = AnyObjectSchema, TContext extends object = object>(props: Omit<FormProps<yup.Asserts<TSchema>, TContext, TSchema, FieldProps<yup.Asserts<TSchema>>>, "children" | "fields"> & {
541
- children?: React$1.ReactNode | ((props: FormRenderContext<yup.Asserts<TSchema>, TContext, ({
542
- type?: "number" | undefined;
543
- } & Omit<NumberInputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
544
- type?: "text" | undefined;
545
- } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
546
- type?: "email" | undefined;
547
- } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
548
- type?: "url" | undefined;
549
- } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
550
- type?: "phone" | undefined;
551
- } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
552
- type?: "password" | undefined;
553
- } & Omit<PasswordInputProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
554
- type?: "textarea" | undefined;
555
- } & Omit<_chakra_ui_textarea_dist_textarea.TextareaProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
556
- type?: "switch" | undefined;
557
- } & Omit<_chakra_ui_switch_dist_switch.SwitchProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
558
- type?: "select" | undefined;
559
- } & Omit<SelectProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
560
- type?: "checkbox" | undefined;
561
- } & Omit<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
562
- type?: "radio" | undefined;
563
- } & Omit<RadioInputProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
564
- type?: "pin" | undefined;
565
- } & Omit<PinFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
566
- type?: "native-select" | undefined;
567
- } & Omit<NativeSelectProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>)>) => React$1.ReactNode);
568
- fields?: ({ [K in react_hook_form.Path<yup.Asserts<TSchema>> | (react_hook_form.Path<yup.Asserts<TSchema>> extends infer T ? T extends react_hook_form.Path<yup.Asserts<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<({
569
- type?: "number" | undefined;
570
- } & Omit<NumberInputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
571
- type?: "text" | undefined;
572
- } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
573
- type?: "email" | undefined;
574
- } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
575
- type?: "url" | undefined;
576
- } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
577
- type?: "phone" | undefined;
578
- } & Omit<InputFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
579
- type?: "password" | undefined;
580
- } & Omit<PasswordInputProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
581
- type?: "textarea" | undefined;
582
- } & Omit<_chakra_ui_textarea_dist_textarea.TextareaProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
583
- type?: "switch" | undefined;
584
- } & Omit<_chakra_ui_switch_dist_switch.SwitchProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
585
- type?: "select" | undefined;
586
- } & Omit<SelectProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
587
- type?: "checkbox" | undefined;
588
- } & Omit<_chakra_ui_checkbox_dist_checkbox.CheckboxProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
589
- type?: "radio" | undefined;
590
- } & Omit<RadioInputProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
591
- type?: "pin" | undefined;
592
- } & Omit<PinFieldProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>) | ({
593
- type?: "native-select" | undefined;
594
- } & Omit<NativeSelectProps & BaseFieldProps<react_hook_form.FieldValues, string>, keyof BaseFieldProps<TFieldValues, TName>> & BaseFieldProps<yup.Asserts<TSchema>, react_hook_form.Path<yup.Asserts<TSchema>>>), "name"> | undefined; } & {
595
- submit?: SubmitButtonProps | undefined;
596
- }) | undefined;
597
- } & {
420
+ declare const Form: YupFormType<unknown, object, object, "yup">;
421
+ declare const StepForm: (<TSteps extends {
422
+ name: string;
423
+ schema?: AnyObjectSchema | undefined;
424
+ }[] = {
425
+ name: string;
426
+ schema?: AnyObjectSchema | undefined;
427
+ }[], TFieldValues extends TSteps extends [infer Step, ...infer Rest] ? Step extends {
428
+ schema: AnyObjectSchema;
429
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
430
+ name: string;
431
+ schema?: AnyObjectSchema | undefined;
432
+ }[] ? Rest extends infer T ? T extends Rest ? T extends [infer Step, ...infer Rest] ? Step extends {
433
+ schema: AnyObjectSchema;
434
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
435
+ name: string;
436
+ schema?: AnyObjectSchema | undefined;
437
+ }[] ? Rest extends infer T_1 ? T_1 extends Rest ? T_1 extends [infer Step, ...infer Rest] ? Step extends {
438
+ schema: AnyObjectSchema;
439
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
440
+ name: string;
441
+ schema?: AnyObjectSchema | undefined;
442
+ }[] ? Rest extends infer T_2 ? T_2 extends Rest ? T_2 extends [infer Step, ...infer Rest] ? Step extends {
443
+ schema: AnyObjectSchema;
444
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
445
+ name: string;
446
+ schema?: AnyObjectSchema | undefined;
447
+ }[] ? Rest extends infer T_3 ? T_3 extends Rest ? T_3 extends [infer Step, ...infer Rest] ? Step extends {
448
+ schema: AnyObjectSchema;
449
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
450
+ name: string;
451
+ schema?: AnyObjectSchema | undefined;
452
+ }[] ? Rest extends infer T_4 ? T_4 extends Rest ? T_4 extends [infer Step, ...infer Rest] ? Step extends {
453
+ schema: AnyObjectSchema;
454
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
455
+ name: string;
456
+ schema?: AnyObjectSchema | undefined;
457
+ }[] ? Rest extends infer T_5 ? T_5 extends Rest ? T_5 extends [infer Step, ...infer Rest] ? Step extends {
458
+ schema: AnyObjectSchema;
459
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
460
+ name: string;
461
+ schema?: AnyObjectSchema | undefined;
462
+ }[] ? Rest extends infer T_6 ? T_6 extends Rest ? T_6 extends [infer Step, ...infer Rest] ? Step extends {
463
+ schema: AnyObjectSchema;
464
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
465
+ name: string;
466
+ schema?: AnyObjectSchema | undefined;
467
+ }[] ? Rest extends infer T_7 ? T_7 extends Rest ? T_7 extends [infer Step, ...infer Rest] ? Step extends {
468
+ schema: AnyObjectSchema;
469
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
470
+ name: string;
471
+ schema?: AnyObjectSchema | undefined;
472
+ }[] ? Rest extends infer T_8 ? T_8 extends Rest ? T_8 extends [infer Step, ...infer Rest] ? Step extends {
473
+ schema: AnyObjectSchema;
474
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
475
+ name: string;
476
+ schema?: AnyObjectSchema | undefined;
477
+ }[] ? Rest extends infer T_9 ? T_9 extends Rest ? T_9 extends [infer Step, ...infer Rest] ? Step extends {
478
+ schema: AnyObjectSchema;
479
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
480
+ name: string;
481
+ schema?: AnyObjectSchema | undefined;
482
+ }[] ? any : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object = TSteps extends [infer Step, ...infer Rest] ? Step extends {
483
+ schema: AnyObjectSchema;
484
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
485
+ name: string;
486
+ schema?: AnyObjectSchema | undefined;
487
+ }[] ? Rest extends infer T_10 ? T_10 extends Rest ? T_10 extends [infer Step, ...infer Rest] ? Step extends {
488
+ schema: AnyObjectSchema;
489
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
490
+ name: string;
491
+ schema?: AnyObjectSchema | undefined;
492
+ }[] ? Rest extends infer T_11 ? T_11 extends Rest ? T_11 extends [infer Step, ...infer Rest] ? Step extends {
493
+ schema: AnyObjectSchema;
494
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
495
+ name: string;
496
+ schema?: AnyObjectSchema | undefined;
497
+ }[] ? Rest extends infer T_12 ? T_12 extends Rest ? T_12 extends [infer Step, ...infer Rest] ? Step extends {
498
+ schema: AnyObjectSchema;
499
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
500
+ name: string;
501
+ schema?: AnyObjectSchema | undefined;
502
+ }[] ? Rest extends infer T_13 ? T_13 extends Rest ? T_13 extends [infer Step, ...infer Rest] ? Step extends {
503
+ schema: AnyObjectSchema;
504
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
505
+ name: string;
506
+ schema?: AnyObjectSchema | undefined;
507
+ }[] ? Rest extends infer T_14 ? T_14 extends Rest ? T_14 extends [infer Step, ...infer Rest] ? Step extends {
508
+ schema: AnyObjectSchema;
509
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
510
+ name: string;
511
+ schema?: AnyObjectSchema | undefined;
512
+ }[] ? Rest extends infer T_15 ? T_15 extends Rest ? T_15 extends [infer Step, ...infer Rest] ? Step extends {
513
+ schema: AnyObjectSchema;
514
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
515
+ name: string;
516
+ schema?: AnyObjectSchema | undefined;
517
+ }[] ? Rest extends infer T_16 ? T_16 extends Rest ? T_16 extends [infer Step, ...infer Rest] ? Step extends {
518
+ schema: AnyObjectSchema;
519
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
520
+ name: string;
521
+ schema?: AnyObjectSchema | undefined;
522
+ }[] ? Rest extends infer T_17 ? T_17 extends Rest ? T_17 extends [infer Step, ...infer Rest] ? Step extends {
523
+ schema: AnyObjectSchema;
524
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
525
+ name: string;
526
+ schema?: AnyObjectSchema | undefined;
527
+ }[] ? Rest extends infer T_18 ? T_18 extends Rest ? T_18 extends [infer Step, ...infer Rest] ? Step extends {
528
+ schema: AnyObjectSchema;
529
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
530
+ name: string;
531
+ schema?: AnyObjectSchema | undefined;
532
+ }[] ? Rest extends infer T_19 ? T_19 extends Rest ? T_19 extends [infer Step, ...infer Rest] ? Step extends {
533
+ schema: AnyObjectSchema;
534
+ } ? yup.Asserts<Step["schema"]> & (Rest extends {
535
+ name: string;
536
+ schema?: AnyObjectSchema | undefined;
537
+ }[] ? any : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object, TContext extends object = object>(props: UseStepFormProps<TSteps, TFieldValues, TContext, FieldProps<TFieldValues>> & {
538
+ steps: TSteps;
598
539
  ref?: React$1.ForwardedRef<HTMLFormElement> | undefined;
599
- }) => React$1.ReactElement<any, string | React$1.JSXElementConstructor<any>>;
540
+ }) => React$1.ReactElement<any, string | React$1.JSXElementConstructor<any>>) & {
541
+ displayName?: string | undefined;
542
+ id?: string | undefined;
543
+ };
600
544
 
601
- export { Form, Options, createYupForm, getFieldsFromSchema, getNestedSchema, yupFieldResolver };
545
+ export { AnyObjectSchema, Form, Options, StepForm, YupFormType, createYupForm, getFieldsFromSchema, getNestedSchema, yupFieldResolver };