@saas-ui/forms 1.3.1 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import { FieldProps } from './field';
2
- export declare type FieldResolver = {
2
+ export type FieldResolver = {
3
3
  getFields(): FieldProps[];
4
4
  getNestedFields(name: string): FieldProps[];
5
5
  };
@@ -7,7 +7,7 @@ interface SchemaField extends FieldProps {
7
7
  items?: SchemaField[];
8
8
  properties?: Record<string, SchemaField>;
9
9
  }
10
- export declare type ObjectSchema = Record<string, SchemaField>;
10
+ export type ObjectSchema = Record<string, SchemaField>;
11
11
  export declare const objectFieldResolver: (schema: ObjectSchema) => FieldResolver;
12
12
  export {};
13
13
  //# sourceMappingURL=field-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"field-resolver.d.ts","sourceRoot":"","sources":["../src/field-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIpC,oBAAY,aAAa,GAAG;IAC1B,SAAS,IAAI,UAAU,EAAE,CAAA;IACzB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAAA;CAC5C,CAAA;AAED,UAAU,WAAY,SAAQ,UAAU;IACtC,KAAK,CAAC,EAAE,WAAW,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;CACzC;AAED,oBAAY,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;AAYtD,eAAO,MAAM,mBAAmB,WAAY,YAAY,KAAG,aAkB1D,CAAA"}
1
+ {"version":3,"file":"field-resolver.d.ts","sourceRoot":"","sources":["../src/field-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIpC,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,IAAI,UAAU,EAAE,CAAA;IACzB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAAA;CAC5C,CAAA;AAED,UAAU,WAAY,SAAQ,UAAU;IACtC,KAAK,CAAC,EAAE,WAAW,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;CACzC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;AAYtD,eAAO,MAAM,mBAAmB,WAAY,YAAY,KAAG,aAkB1D,CAAA"}
package/dist/field.d.ts CHANGED
@@ -11,7 +11,7 @@ export interface Option {
11
11
  label?: string;
12
12
  [key: string]: unknown;
13
13
  }
14
- export declare type FieldRules = Pick<RegisterOptions, 'required' | 'min' | 'max' | 'maxLength' | 'minLength' | 'pattern'>;
14
+ export type FieldRules = Pick<RegisterOptions, 'required' | 'min' | 'max' | 'maxLength' | 'minLength' | 'pattern'>;
15
15
  export interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<FormControlProps, 'label' | 'type'> {
16
16
  /**
17
17
  * The field name
@@ -55,8 +55,8 @@ export interface FieldProps<TFieldValues extends FieldValues = FieldValues, TNam
55
55
  placeholder?: string;
56
56
  }
57
57
  export declare const BaseField: React.FC<FieldProps>;
58
- export declare type As<Props = any> = React.ElementType<Props>;
59
- export declare type PropsOf<T extends As> = React.ComponentPropsWithoutRef<T> & {
58
+ export type As<Props = any> = React.ElementType<Props>;
59
+ export type PropsOf<T extends As> = React.ComponentPropsWithoutRef<T> & {
60
60
  type?: FieldTypes;
61
61
  };
62
62
  /**
@@ -79,8 +79,8 @@ export declare const Field: (<TFieldValues extends FieldValues>(props: FieldProp
79
79
  }) => React.ReactElement) & {
80
80
  displayName?: string | undefined;
81
81
  };
82
- export declare const withControlledInput: (InputComponent: React.FC<any>) => import("@chakra-ui/react").ComponentWithAs<React.FC<any>, FieldProps<FieldValues, string>>;
83
- export declare const withUncontrolledInput: (InputComponent: React.FC<any>) => import("@chakra-ui/react").ComponentWithAs<React.FC<any>, FieldProps<FieldValues, string>>;
82
+ export declare const withControlledInput: (InputComponent: React.FC<any>) => import("@chakra-ui/system").ComponentWithAs<React.FC<any>, FieldProps<FieldValues, string>>;
83
+ export declare const withUncontrolledInput: (InputComponent: React.FC<any>) => import("@chakra-ui/system").ComponentWithAs<React.FC<any>, FieldProps<FieldValues, string>>;
84
84
  export interface RegisterFieldTypeOptions {
85
85
  isControlled?: boolean;
86
86
  hideLabel?: boolean;
@@ -133,12 +133,12 @@ declare const fieldTypes: {
133
133
  select: React.FC<SelectProps & FieldProps<FieldValues, string>>;
134
134
  'native-select': React.FC<NativeSelectProps & FieldProps<FieldValues, string>>;
135
135
  };
136
- declare type FieldTypes = typeof fieldTypes;
137
- declare type FieldType<Props = any> = React.ElementType<Props>;
138
- declare type TypeProps<P extends FieldType, T> = React.ComponentPropsWithoutRef<P> & {
136
+ type FieldTypes = typeof fieldTypes;
137
+ type FieldType<Props = any> = React.ElementType<Props>;
138
+ type TypeProps<P extends FieldType, T> = React.ComponentPropsWithoutRef<P> & {
139
139
  type: T;
140
140
  };
141
- declare type FieldTypeProps = {
141
+ type FieldTypeProps = {
142
142
  [Property in keyof FieldTypes]: TypeProps<FieldTypes[Property], Property>;
143
143
  }[keyof FieldTypes] | {
144
144
  type?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../src/field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAKL,eAAe,EACf,WAAW,EACX,SAAS,EACV,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAIL,gBAAgB,EAUhB,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EAIb,gBAAgB,EAChB,WAAW,EACZ,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAW,gBAAgB,EAAmB,MAAM,kBAAkB,CAAA;AAE7E,OAAO,EAAe,gBAAgB,EAAE,MAAM,u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MtB,CAAA;AAED,eAAO,MAAM,iBAAiB,+DAI7B,CAAA;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,cAAc,GAAG,QAAQ,CAAA;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;CAChC;AAED,eAAO,MAAM,QAAQ,2DAqBpB,CAAA;AAED,QAAA,MAAM,UAAU;;;;;;;;;;;;;;CAcf,CAAA;AAED,KAAK,UAAU,GAAG,OAAO,UAAU,CAAA;AAEnC,KAAK,SAAS,CAAC,KAAK,GAAG,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AAEtD,KAAK,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,GAAG;IAC3E,IAAI,EAAE,CAAC,CAAA;CACR,CAAA;AAED,KAAK,cAAc,GACf;KACG,QAAQ,IAAI,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CAC1E,CAAC,MAAM,UAAU,CAAC,GACnB;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
package/dist/form.d.ts CHANGED
@@ -39,6 +39,6 @@ export declare const Form: (<TFieldValues extends FieldValues>(props: FormProps<
39
39
  getResolver?: GetResolver | undefined;
40
40
  getFieldResolver: GetFieldResolver;
41
41
  };
42
- export declare type GetResolver = (schema: any) => <TFieldValues extends FieldValues, TContext>(values: TFieldValues, context: TContext | undefined, options: ResolverOptions<TFieldValues>) => Promise<ResolverResult<TFieldValues>>;
43
- export declare type GetFieldResolver = (schema: any) => FieldResolver;
42
+ export type GetResolver = (schema: any) => <TFieldValues extends FieldValues, TContext>(values: TFieldValues, context: TContext | undefined, options: ResolverOptions<TFieldValues>) => Promise<ResolverResult<TFieldValues>>;
43
+ export type GetFieldResolver = (schema: any) => FieldResolver;
44
44
  //# sourceMappingURL=form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../src/form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAU,eAAe,EAAc,MAAM,kBAAkB,CAAA;AAGtE,OAAO,EAGL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EAEd,aAAa,EACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAuB,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,CAAA;AAEzD,UAAU,WAAW,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW;IAClE;;OAEG;IACH,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ;;OAEG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IACtC;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAA;IAC1C;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IAC1C;;OAEG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAA;CACxD;AAID,MAAM,WAAW,SAAS,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW,CACvE,SAAQ,YAAY,CAAC,YAAY,CAAC,EAChC,IAAI,CACF,eAAe,CAAC,MAAM,CAAC,EACvB,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CACjD,EACD,WAAW,C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AS,CAAC,eAAe,CAAC,CAAA;IAC1C;;OAEG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAA;CACxD;AAID,MAAM,WAAW,SAAS,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW,CACvE,SAAQ,YAAY,CAAC,YAAY,CAAC,EAChC,IAAI,CACF,eAAe,CAAC,MAAM,CAAC,EACvB,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CACjD,EACD,WAAW,CAAC,YAAY,CAAC;CAAG;AAEhC,eAAO,MAAM,IAAI;;MAuEZ,MAAM,YAAY;;;sBAGH,gBAAgB;CACnC,CAAA;AAQD,MAAM,MAAM,WAAW,GAAG,CACxB,MAAM,EAAE,GAAG,KACR,CAAC,YAAY,SAAS,WAAW,EAAE,QAAQ,EAC9C,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,QAAQ,GAAG,SAAS,EAC7B,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,KACnC,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAA;AAE1C,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK,aAAa,CAAA"}
package/dist/layout.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SimpleGridProps } from '@chakra-ui/react';
2
- export declare type FormLayoutProps = SimpleGridProps;
2
+ export type FormLayoutProps = SimpleGridProps;
3
3
  /**
4
4
  * FormLayout
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,eAAe,EAAY,MAAM,kBAAkB,CAAA;AAGhF,oBAAY,eAAe,GAAG,eAAe,CAAA;AAc7C;;;;;GAKG;AACH,eAAO,MAAM,UAAU;6BAA4B,eAAe;;CAyBjE,CAAA"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,eAAe,EAAY,MAAM,kBAAkB,CAAA;AAGhF,MAAM,MAAM,eAAe,GAAG,eAAe,CAAA;AAc7C;;;;;GAKG;AACH,eAAO,MAAM,UAAU;6BAA4B,eAAe;;CAyBjE,CAAA"}
@@ -10,7 +10,7 @@ export interface StepState {
10
10
  isCompleted?: boolean;
11
11
  onSubmit?: FormStepSubmitHandler;
12
12
  }
13
- export declare type FormStepSubmitHandler<TFieldValues extends FieldValues = FieldValues> = (data: TFieldValues, stepper: UseStepperReturn) => Promise<void>;
13
+ export type FormStepSubmitHandler<TFieldValues extends FieldValues = FieldValues> = (data: TFieldValues, stepper: UseStepperReturn) => Promise<void>;
14
14
  export interface StepFormContext extends UseStepperReturn {
15
15
  updateStep(state: StepState): void;
16
16
  steps: Record<string, StepState>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-step-form.d.ts","sourceRoot":"","sources":["../src/use-step-form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAiB,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAGL,eAAe,EACf,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAEzB,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,qBAAqB,CAAA;CACjC;AAED,oBAAY,qBAAqB,CAC/B,YAAY,SAAS,WAAW,GAAG,WAAW,IAC5C,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAEpE,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AA;CAC3D;AAED,MAAM,WAAW,iBAAiB,CAChC,YAAY,SAAS,WAAW,GAAG,WAAW,CAC9C,SAAQ,gBAAgB;IACxB,YAAY,IAAI;QACd,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;QACrC,MAAM,CAAC,EAAE,GAAG,CAAA;QACZ,QAAQ,CAAC,EAAE,GAAG,CAAA;KACf,CAAA;IACD,UAAU,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC3B;AAED,wBAAgB,WAAW,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW,EACxE,KAAK,EAAE,gBAAgB,CAAC,YAAY,CAAC,GACpC,iBAAiB,CAAC,YAAY,CAAC,CA8DjC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,QAAQ,CAAC,EAAE,qBAAqB,CAAA;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAc9D"}
@@ -2,7 +2,7 @@ import { AnyObjectSchema } from 'yup';
2
2
  import { yupResolver } from '@hookform/resolvers/yup';
3
3
  import { FieldProps } from '@saas-ui/forms';
4
4
  export { yupResolver };
5
- export declare type Options = {
5
+ export type Options = {
6
6
  min?: number;
7
7
  max?: number;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"yup-resolver.d.ts","sourceRoot":"","sources":["../../yup/src/yup-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,eAAe,EAAE,MAAM,KAAK,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,oBAAY,OAAO,GAAG;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AA6BD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,+BAA8B,UAAU,EA4BvE,CAAA;AAED,eAAO,MAAM,eAAe,kCAAmC,MAAM,QAEpE,CAAA;AAED,eAAO,MAAM,gBAAgB;;0BAKH,MAAM;CAI/B,CAAA;AAED,eAAO,MAAM,OAAO;;;;;8BANM,MAAM;;CAgB/B,CAAA"}
1
+ {"version":3,"file":"yup-resolver.d.ts","sourceRoot":"","sources":["../../yup/src/yup-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,eAAe,EAAE,MAAM,KAAK,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AA6BD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,+BAA8B,UAAU,EA4BvE,CAAA;AAED,eAAO,MAAM,eAAe,kCAAmC,MAAM,QAEpE,CAAA;AAED,eAAO,MAAM,gBAAgB;;0BAKH,MAAM;CAI/B,CAAA;AAED,eAAO,MAAM,OAAO;;;;;8BANM,MAAM;;CAgB/B,CAAA"}
@@ -2,7 +2,7 @@ import * as z from 'zod';
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
3
  import { FieldProps } from '@saas-ui/forms';
4
4
  export { zodResolver };
5
- export declare type Options = {
5
+ export type Options = {
6
6
  min?: number;
7
7
  max?: number;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"zod-resolver.d.ts","sourceRoot":"","sources":["../../zod/src/zod-resolver.ts"],"names":[],"mappings":"AAAA,OAAO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,UAAU,QAAQ,MAAM,QAEjE,CAAA;AAED,eAAO,MAAM,gBAAgB;;0BAKH,MAAM;CAI/B,CAAA;AAED,eAAO,MAAM,OAAO;;;;;8BANM,MAAM;;CAgB/B,CAAA;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,OAAO,SAAU,OAAO,WAEpC,CAAA;AAED,eAAO,MAAM,YAAY,SAAU,MAAM,QAMxC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saas-ui/forms",
3
- "version": "1.3.1",
3
+ "version": "1.4.1",
4
4
  "description": "Fully functional forms for Chakra UI.",
5
5
  "source": "src/index.ts",
6
6
  "exports": {
@@ -89,20 +89,20 @@
89
89
  "url": "https://storybook.saas-ui.dev"
90
90
  },
91
91
  "dependencies": {
92
- "@chakra-ui/icons": "^2.0.11",
93
- "@chakra-ui/react-utils": "^2.0.8",
94
- "@chakra-ui/utils": "^2.0.11",
92
+ "@chakra-ui/icons": "^2.0.12",
93
+ "@chakra-ui/react-utils": "^2.0.9",
94
+ "@chakra-ui/utils": "^2.0.12",
95
95
  "@hookform/resolvers": "^2.9.10",
96
- "@saas-ui/button": "1.2.0",
97
- "@saas-ui/input-right-button": "1.2.0",
98
- "@saas-ui/number-input": "1.2.0",
99
- "@saas-ui/password-input": "1.2.0",
100
- "@saas-ui/pin-input": "1.2.0",
101
- "@saas-ui/radio": "1.2.0",
102
- "@saas-ui/react-utils": "1.1.1",
103
- "@saas-ui/select": "1.2.0",
104
- "@saas-ui/stepper": "1.2.1",
105
- "react-hook-form": "^7.38.0"
96
+ "@saas-ui/button": "1.3.0",
97
+ "@saas-ui/input-right-button": "1.3.0",
98
+ "@saas-ui/number-input": "1.3.0",
99
+ "@saas-ui/password-input": "1.3.0",
100
+ "@saas-ui/pin-input": "1.3.0",
101
+ "@saas-ui/radio": "1.3.0",
102
+ "@saas-ui/react-utils": "1.1.2",
103
+ "@saas-ui/select": "1.3.0",
104
+ "@saas-ui/stepper": "1.3.1",
105
+ "react-hook-form": "^7.39.4"
106
106
  },
107
107
  "peerDependencies": {
108
108
  "@chakra-ui/react": ">=2.1.0",
@@ -110,7 +110,7 @@
110
110
  "react": ">=18.0.0"
111
111
  },
112
112
  "devDependencies": {
113
- "ajv": "^8.11.0",
113
+ "ajv": "^8.11.2",
114
114
  "yup": "^0.32.11",
115
115
  "zod": "^3.19.1"
116
116
  }