@saas-ui/forms 2.6.6 → 2.6.8

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @saas-ui/forms
2
2
 
3
+ ## 2.6.8
4
+
5
+ ### Patch Changes
6
+
7
+ - fc62212: Fixed type of formRef to accept ref function handler
8
+
9
+ ## 2.6.7
10
+
11
+ ### Patch Changes
12
+
13
+ - 02cac87: Updated dependencies
14
+ - Updated dependencies [02cac87]
15
+ - @saas-ui/core@2.5.5
16
+
3
17
  ## 2.6.6
4
18
 
5
19
  ### Patch Changes
@@ -27,7 +27,7 @@ type AjvFormType<FieldDefs, ExtraProps = object, JsonSchema extends Record<strin
27
27
  * @see Docs https://saas-ui.dev/docs/components/forms/form
28
28
  * @see https://ajv.js.org/json-type-definition.html
29
29
  */
30
- declare function createAjvForm<FieldDefs>(options?: CreateAjvFormProps<FieldDefs>): AjvFormType<FieldDefs, object, Record<string, any>>;
30
+ declare function createAjvForm<FieldDefs>(options?: CreateAjvFormProps<FieldDefs>): AjvFormType<FieldDefs>;
31
31
 
32
32
  declare const Form: AjvFormType<unknown, object, Record<string, any>>;
33
33
 
@@ -27,7 +27,7 @@ type AjvFormType<FieldDefs, ExtraProps = object, JsonSchema extends Record<strin
27
27
  * @see Docs https://saas-ui.dev/docs/components/forms/form
28
28
  * @see https://ajv.js.org/json-type-definition.html
29
29
  */
30
- declare function createAjvForm<FieldDefs>(options?: CreateAjvFormProps<FieldDefs>): AjvFormType<FieldDefs, object, Record<string, any>>;
30
+ declare function createAjvForm<FieldDefs>(options?: CreateAjvFormProps<FieldDefs>): AjvFormType<FieldDefs>;
31
31
 
32
32
  declare const Form: AjvFormType<unknown, object, Record<string, any>>;
33
33
 
package/dist/index.d.mts CHANGED
@@ -9,7 +9,6 @@ import { NumberInputProps as NumberInputProps$1, NumberInputFieldProps as Number
9
9
  import { UseStepperReturn, UseStepperProps, StepsProps, StepsItemProps } from '@saas-ui/core';
10
10
  import { FocusableElement } from '@chakra-ui/utils';
11
11
  import { MaybeRenderProp } from '@chakra-ui/react-utils';
12
- import * as src from 'src';
13
12
 
14
13
  interface NumberInputOptions {
15
14
  /**
@@ -127,7 +126,7 @@ declare const SelectButton: _chakra_ui_react.ComponentWithAs<"button", SelectBut
127
126
  declare const Select: (<Multiple extends boolean = false>(props: SelectProps<Multiple> & {
128
127
  ref?: React$1.ForwardedRef<HTMLFormElement>;
129
128
  }) => React$1.ReactElement) & {
130
- displayName?: string | undefined;
129
+ displayName?: string;
131
130
  };
132
131
  interface SelectListProps extends MenuListProps {
133
132
  }
@@ -162,50 +161,50 @@ interface InputFieldProps extends InputProps {
162
161
  leftAddon?: React$1.ReactNode;
163
162
  rightAddon?: React$1.ReactNode;
164
163
  }
165
- declare const InputField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
164
+ declare const InputField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
166
165
  interface NumberInputFieldProps extends NumberInputProps {
167
166
  type: 'number';
168
167
  }
169
- declare const NumberInputField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof NumberInputFieldProps> & NumberInputFieldProps>;
170
- declare const PasswordInputField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof PasswordInputProps> & PasswordInputProps>;
168
+ declare const NumberInputField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof NumberInputFieldProps> & NumberInputFieldProps>;
169
+ declare const PasswordInputField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof PasswordInputProps> & PasswordInputProps>;
171
170
  interface TextareaFieldProps extends TextareaProps {
172
171
  }
173
- declare const TextareaField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof TextareaFieldProps> & TextareaFieldProps>;
172
+ declare const TextareaField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof TextareaFieldProps> & TextareaFieldProps>;
174
173
  interface SwitchFieldProps extends SwitchProps {
175
174
  }
176
- declare const SwitchField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof SwitchFieldProps> & SwitchFieldProps>;
175
+ declare const SwitchField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof SwitchFieldProps> & SwitchFieldProps>;
177
176
  interface SelectFieldProps extends SelectProps<boolean> {
178
177
  buttonProps?: SelectButtonProps;
179
178
  listProps?: SelectListProps;
180
179
  }
181
- declare const SelectField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof SelectFieldProps> & SelectFieldProps>;
180
+ declare const SelectField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof SelectFieldProps> & SelectFieldProps>;
182
181
  type CheckboxFieldProps = CheckboxProps;
183
- declare const CheckboxField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof CheckboxProps> & CheckboxProps>;
182
+ declare const CheckboxField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof CheckboxProps> & CheckboxProps>;
184
183
  type RadioFieldProps = RadioInputProps;
185
- declare const RadioField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof RadioInputProps> & RadioInputProps>;
184
+ declare const RadioField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof RadioInputProps> & RadioInputProps>;
186
185
  type NativeSelectFieldProps = NativeSelectProps;
187
- declare const NativeSelectField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof NativeSelectProps> & NativeSelectProps>;
186
+ declare const NativeSelectField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof NativeSelectProps> & NativeSelectProps>;
188
187
  interface PinFieldProps extends Omit<UsePinInputProps, 'type'> {
189
188
  pinLength?: number;
190
189
  pinType?: 'alphanumeric' | 'number';
191
190
  spacing?: SystemProps['margin'];
192
191
  }
193
- declare const PinField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof PinFieldProps> & PinFieldProps>;
192
+ declare const PinField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof PinFieldProps> & PinFieldProps>;
194
193
  declare const defaultFieldTypes: {
195
- text: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
196
- email: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
197
- url: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
198
- phone: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
199
- time: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
200
- number: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof NumberInputFieldProps> & NumberInputFieldProps>;
201
- password: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof PasswordInputProps> & PasswordInputProps>;
202
- textarea: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof TextareaFieldProps> & TextareaFieldProps>;
203
- switch: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof SwitchFieldProps> & SwitchFieldProps>;
204
- select: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof SelectFieldProps> & SelectFieldProps>;
205
- checkbox: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof CheckboxProps> & CheckboxProps>;
206
- radio: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof RadioInputProps> & RadioInputProps>;
207
- pin: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof PinFieldProps> & PinFieldProps>;
208
- 'native-select': React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof NativeSelectProps> & NativeSelectProps>;
194
+ text: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
195
+ email: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
196
+ url: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
197
+ phone: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
198
+ time: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
199
+ number: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof NumberInputFieldProps> & NumberInputFieldProps>;
200
+ password: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof PasswordInputProps> & PasswordInputProps>;
201
+ textarea: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof TextareaFieldProps> & TextareaFieldProps>;
202
+ switch: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof SwitchFieldProps> & SwitchFieldProps>;
203
+ select: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof SelectFieldProps> & SelectFieldProps>;
204
+ checkbox: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof CheckboxProps> & CheckboxProps>;
205
+ radio: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof RadioInputProps> & RadioInputProps>;
206
+ pin: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof PinFieldProps> & PinFieldProps>;
207
+ 'native-select': React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof NativeSelectProps> & NativeSelectProps>;
209
208
  };
210
209
  type DefaultFields = typeof defaultFieldTypes;
211
210
 
@@ -608,7 +607,7 @@ interface FormOptions<TSchema = unknown, TFieldValues extends FieldValues = Fiel
608
607
  /**
609
608
  * The Hook Form state ref.
610
609
  */
611
- formRef?: React$1.RefObject<UseFormReturn$1<TFieldValues, TContext>>;
610
+ formRef?: React$1.Ref<UseFormReturn$1<TFieldValues, TContext>>;
612
611
  /**
613
612
  * The form children, can be a render prop or a ReactNode.
614
613
  */
@@ -810,7 +809,7 @@ type FieldRules = Pick<RegisterOptions, 'required' | 'min' | 'max' | 'maxLength'
810
809
  declare const Field: (<TFieldValues extends FieldValues>(props: FieldProps<TFieldValues> & {
811
810
  ref?: React$1.ForwardedRef<FocusableElement>;
812
811
  }) => React$1.ReactElement) & {
813
- displayName?: string | undefined;
812
+ displayName?: string;
814
813
  };
815
814
 
816
815
  interface FieldsProps<TSchema = any> {
@@ -838,11 +837,11 @@ type FormProviderProps<TFieldValues extends FieldValues = FieldValues, TContext
838
837
  };
839
838
  };
840
839
  declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, TContext = any, TSchema = any>() => {
841
- fieldResolver?: FieldResolver | undefined;
840
+ fieldResolver?: FieldResolver;
842
841
  schema?: any;
843
842
  fields?: {
844
843
  [key: string]: unknown;
845
- } | undefined;
844
+ };
846
845
  watch: react_hook_form.UseFormWatch<TFieldValues>;
847
846
  getValues: react_hook_form.UseFormGetValues<TFieldValues>;
848
847
  getFieldState: react_hook_form.UseFormGetFieldState<TFieldValues>;
@@ -853,9 +852,9 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
853
852
  formState: react_hook_form.FormState<TFieldValues>;
854
853
  resetField: react_hook_form.UseFormResetField<TFieldValues>;
855
854
  reset: react_hook_form.UseFormReset<TFieldValues>;
856
- handleSubmit: react_hook_form.UseFormHandleSubmit<TFieldValues, TFieldValues>;
855
+ handleSubmit: react_hook_form.UseFormHandleSubmit<TFieldValues, undefined>;
857
856
  unregister: react_hook_form.UseFormUnregister<TFieldValues>;
858
- control: react_hook_form.Control<TFieldValues, TContext, TFieldValues>;
857
+ control: react_hook_form.Control<TFieldValues, TContext>;
859
858
  register: react_hook_form.UseFormRegister<TFieldValues>;
860
859
  setFocus: react_hook_form.UseFormSetFocus<TFieldValues>;
861
860
  };
@@ -879,9 +878,9 @@ declare const useBaseField: (props: BaseFieldProps) => {
879
878
  error: any;
880
879
  touched: any;
881
880
  name: string;
882
- label?: string | undefined;
883
- hideLabel?: boolean | undefined;
884
- help?: string | undefined;
881
+ label?: string;
882
+ hideLabel?: boolean;
883
+ help?: string;
885
884
  };
886
885
  /**
887
886
  * The default BaseField component
package/dist/index.d.ts CHANGED
@@ -9,7 +9,6 @@ import { NumberInputProps as NumberInputProps$1, NumberInputFieldProps as Number
9
9
  import { UseStepperReturn, UseStepperProps, StepsProps, StepsItemProps } from '@saas-ui/core';
10
10
  import { FocusableElement } from '@chakra-ui/utils';
11
11
  import { MaybeRenderProp } from '@chakra-ui/react-utils';
12
- import * as src from 'src';
13
12
 
14
13
  interface NumberInputOptions {
15
14
  /**
@@ -127,7 +126,7 @@ declare const SelectButton: _chakra_ui_react.ComponentWithAs<"button", SelectBut
127
126
  declare const Select: (<Multiple extends boolean = false>(props: SelectProps<Multiple> & {
128
127
  ref?: React$1.ForwardedRef<HTMLFormElement>;
129
128
  }) => React$1.ReactElement) & {
130
- displayName?: string | undefined;
129
+ displayName?: string;
131
130
  };
132
131
  interface SelectListProps extends MenuListProps {
133
132
  }
@@ -162,50 +161,50 @@ interface InputFieldProps extends InputProps {
162
161
  leftAddon?: React$1.ReactNode;
163
162
  rightAddon?: React$1.ReactNode;
164
163
  }
165
- declare const InputField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
164
+ declare const InputField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
166
165
  interface NumberInputFieldProps extends NumberInputProps {
167
166
  type: 'number';
168
167
  }
169
- declare const NumberInputField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof NumberInputFieldProps> & NumberInputFieldProps>;
170
- declare const PasswordInputField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof PasswordInputProps> & PasswordInputProps>;
168
+ declare const NumberInputField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof NumberInputFieldProps> & NumberInputFieldProps>;
169
+ declare const PasswordInputField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof PasswordInputProps> & PasswordInputProps>;
171
170
  interface TextareaFieldProps extends TextareaProps {
172
171
  }
173
- declare const TextareaField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof TextareaFieldProps> & TextareaFieldProps>;
172
+ declare const TextareaField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof TextareaFieldProps> & TextareaFieldProps>;
174
173
  interface SwitchFieldProps extends SwitchProps {
175
174
  }
176
- declare const SwitchField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof SwitchFieldProps> & SwitchFieldProps>;
175
+ declare const SwitchField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof SwitchFieldProps> & SwitchFieldProps>;
177
176
  interface SelectFieldProps extends SelectProps<boolean> {
178
177
  buttonProps?: SelectButtonProps;
179
178
  listProps?: SelectListProps;
180
179
  }
181
- declare const SelectField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof SelectFieldProps> & SelectFieldProps>;
180
+ declare const SelectField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof SelectFieldProps> & SelectFieldProps>;
182
181
  type CheckboxFieldProps = CheckboxProps;
183
- declare const CheckboxField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof CheckboxProps> & CheckboxProps>;
182
+ declare const CheckboxField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof CheckboxProps> & CheckboxProps>;
184
183
  type RadioFieldProps = RadioInputProps;
185
- declare const RadioField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof RadioInputProps> & RadioInputProps>;
184
+ declare const RadioField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof RadioInputProps> & RadioInputProps>;
186
185
  type NativeSelectFieldProps = NativeSelectProps;
187
- declare const NativeSelectField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof NativeSelectProps> & NativeSelectProps>;
186
+ declare const NativeSelectField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof NativeSelectProps> & NativeSelectProps>;
188
187
  interface PinFieldProps extends Omit<UsePinInputProps, 'type'> {
189
188
  pinLength?: number;
190
189
  pinType?: 'alphanumeric' | 'number';
191
190
  spacing?: SystemProps['margin'];
192
191
  }
193
- declare const PinField: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof PinFieldProps> & PinFieldProps>;
192
+ declare const PinField: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof PinFieldProps> & PinFieldProps>;
194
193
  declare const defaultFieldTypes: {
195
- text: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
196
- email: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
197
- url: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
198
- phone: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
199
- time: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
200
- number: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof NumberInputFieldProps> & NumberInputFieldProps>;
201
- password: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof PasswordInputProps> & PasswordInputProps>;
202
- textarea: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof TextareaFieldProps> & TextareaFieldProps>;
203
- switch: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof SwitchFieldProps> & SwitchFieldProps>;
204
- select: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof SelectFieldProps> & SelectFieldProps>;
205
- checkbox: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof CheckboxProps> & CheckboxProps>;
206
- radio: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof RadioInputProps> & RadioInputProps>;
207
- pin: React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof PinFieldProps> & PinFieldProps>;
208
- 'native-select': React$1.FC<Omit<src.BaseFieldProps<react_hook_form.FieldValues, string>, keyof NativeSelectProps> & NativeSelectProps>;
194
+ text: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
195
+ email: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
196
+ url: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
197
+ phone: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
198
+ time: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof InputFieldProps> & InputFieldProps>;
199
+ number: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof NumberInputFieldProps> & NumberInputFieldProps>;
200
+ password: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof PasswordInputProps> & PasswordInputProps>;
201
+ textarea: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof TextareaFieldProps> & TextareaFieldProps>;
202
+ switch: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof SwitchFieldProps> & SwitchFieldProps>;
203
+ select: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof SelectFieldProps> & SelectFieldProps>;
204
+ checkbox: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof CheckboxProps> & CheckboxProps>;
205
+ radio: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof RadioInputProps> & RadioInputProps>;
206
+ pin: React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof PinFieldProps> & PinFieldProps>;
207
+ 'native-select': React$1.FC<Omit<BaseFieldProps<react_hook_form.FieldValues, string>, keyof NativeSelectProps> & NativeSelectProps>;
209
208
  };
210
209
  type DefaultFields = typeof defaultFieldTypes;
211
210
 
@@ -608,7 +607,7 @@ interface FormOptions<TSchema = unknown, TFieldValues extends FieldValues = Fiel
608
607
  /**
609
608
  * The Hook Form state ref.
610
609
  */
611
- formRef?: React$1.RefObject<UseFormReturn$1<TFieldValues, TContext>>;
610
+ formRef?: React$1.Ref<UseFormReturn$1<TFieldValues, TContext>>;
612
611
  /**
613
612
  * The form children, can be a render prop or a ReactNode.
614
613
  */
@@ -810,7 +809,7 @@ type FieldRules = Pick<RegisterOptions, 'required' | 'min' | 'max' | 'maxLength'
810
809
  declare const Field: (<TFieldValues extends FieldValues>(props: FieldProps<TFieldValues> & {
811
810
  ref?: React$1.ForwardedRef<FocusableElement>;
812
811
  }) => React$1.ReactElement) & {
813
- displayName?: string | undefined;
812
+ displayName?: string;
814
813
  };
815
814
 
816
815
  interface FieldsProps<TSchema = any> {
@@ -838,11 +837,11 @@ type FormProviderProps<TFieldValues extends FieldValues = FieldValues, TContext
838
837
  };
839
838
  };
840
839
  declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, TContext = any, TSchema = any>() => {
841
- fieldResolver?: FieldResolver | undefined;
840
+ fieldResolver?: FieldResolver;
842
841
  schema?: any;
843
842
  fields?: {
844
843
  [key: string]: unknown;
845
- } | undefined;
844
+ };
846
845
  watch: react_hook_form.UseFormWatch<TFieldValues>;
847
846
  getValues: react_hook_form.UseFormGetValues<TFieldValues>;
848
847
  getFieldState: react_hook_form.UseFormGetFieldState<TFieldValues>;
@@ -853,9 +852,9 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
853
852
  formState: react_hook_form.FormState<TFieldValues>;
854
853
  resetField: react_hook_form.UseFormResetField<TFieldValues>;
855
854
  reset: react_hook_form.UseFormReset<TFieldValues>;
856
- handleSubmit: react_hook_form.UseFormHandleSubmit<TFieldValues, TFieldValues>;
855
+ handleSubmit: react_hook_form.UseFormHandleSubmit<TFieldValues, undefined>;
857
856
  unregister: react_hook_form.UseFormUnregister<TFieldValues>;
858
- control: react_hook_form.Control<TFieldValues, TContext, TFieldValues>;
857
+ control: react_hook_form.Control<TFieldValues, TContext>;
859
858
  register: react_hook_form.UseFormRegister<TFieldValues>;
860
859
  setFocus: react_hook_form.UseFormSetFocus<TFieldValues>;
861
860
  };
@@ -879,9 +878,9 @@ declare const useBaseField: (props: BaseFieldProps) => {
879
878
  error: any;
880
879
  touched: any;
881
880
  name: string;
882
- label?: string | undefined;
883
- hideLabel?: boolean | undefined;
884
- help?: string | undefined;
881
+ label?: string;
882
+ hideLabel?: boolean;
883
+ help?: string;
885
884
  };
886
885
  /**
887
886
  * The default BaseField component
package/dist/index.js CHANGED
@@ -1184,8 +1184,7 @@ var DisplayIf = ({
1184
1184
  initializedRef.current = true;
1185
1185
  return;
1186
1186
  }
1187
- if (matchesRef.current === matches)
1188
- return;
1187
+ if (matchesRef.current === matches) return;
1189
1188
  matchesRef.current = matches;
1190
1189
  onToggle == null ? void 0 : onToggle(matches, context);
1191
1190
  }, [value]);
@@ -1394,8 +1393,7 @@ var objectFieldResolver = (schema) => {
1394
1393
  const getNestedFields = (name) => {
1395
1394
  var _a;
1396
1395
  const field = (0, import_utils10.get)(schema, name);
1397
- if (!field)
1398
- return [];
1396
+ if (!field) return [];
1399
1397
  if (((_a = field.items) == null ? void 0 : _a.type) === "object") {
1400
1398
  return mapFields(field.items.properties);
1401
1399
  } else if (field.type === "object") {