@saas-ui/forms 2.7.1 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saas-ui/forms",
3
- "version": "2.7.1",
3
+ "version": "2.8.1",
4
4
  "description": "Fully functional forms for Chakra UI.",
5
5
  "source": "src/index.ts",
6
6
  "exports": {
@@ -101,10 +101,9 @@
101
101
  "url": "https://storybook.saas-ui.dev"
102
102
  },
103
103
  "dependencies": {
104
- "@chakra-ui/react-utils": "^2.0.12",
105
104
  "@chakra-ui/utils": "^2.2.1",
106
105
  "@hookform/resolvers": "^3.9.0",
107
- "@saas-ui/core": "2.6.1",
106
+ "@saas-ui/core": "2.7.1",
108
107
  "react-hook-form": "^7.53.0"
109
108
  },
110
109
  "peerDependencies": {
@@ -28,8 +28,7 @@ import {
28
28
  UseArrayFieldReturn,
29
29
  } from './use-array-field'
30
30
  import { FieldPath, FieldValues } from 'react-hook-form'
31
- import { isFunction } from '@chakra-ui/utils'
32
- import { MaybeRenderProp } from '@chakra-ui/react-utils'
31
+ import { isFunction, MaybeRenderProp } from '@chakra-ui/utils'
33
32
  import { useFieldProps } from './form-context'
34
33
 
35
34
  export interface ArrayFieldButtonProps extends ButtonProps {}
@@ -180,7 +179,7 @@ ArrayFieldAddButton.displayName = 'ArrayFieldAddButton'
180
179
 
181
180
  export interface ArrayFieldProps<
182
181
  TFieldValues extends FieldValues = FieldValues,
183
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
182
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
184
183
  > extends ArrayFieldOptions<TFieldValues, TName>,
185
184
  Omit<
186
185
  BaseFieldProps<TFieldValues, TName>,
package/src/form.tsx CHANGED
@@ -1,7 +1,12 @@
1
1
  import * as React from 'react'
2
2
 
3
3
  import { chakra, HTMLChakraProps, forwardRef } from '@chakra-ui/react'
4
- import { FocusableElement, cx, runIfFn } from '@chakra-ui/utils'
4
+ import {
5
+ FocusableElement,
6
+ cx,
7
+ runIfFn,
8
+ MaybeRenderProp,
9
+ } from '@chakra-ui/utils'
5
10
 
6
11
  import {
7
12
  useForm,
@@ -16,7 +21,6 @@ import {
16
21
  } from 'react-hook-form'
17
22
  import { FormProvider } from './form-context'
18
23
  import { FieldResolver } from './field-resolver'
19
- import { MaybeRenderProp } from '@chakra-ui/react-utils'
20
24
 
21
25
  export type { UseFormReturn, FieldValues, SubmitHandler }
22
26
 
@@ -4,7 +4,7 @@ import {
4
4
  useControllableState,
5
5
  useFormControl,
6
6
  } from '@chakra-ui/react'
7
- import { createContext } from '@chakra-ui/react-utils'
7
+ import { createContext } from '@chakra-ui/utils'
8
8
  import React from 'react'
9
9
  import { FieldOptions } from '../types'
10
10
  import { mapOptions } from '../utils'
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { FormControlProps } from '@chakra-ui/react'
2
- import type { MaybeRenderProp } from '@chakra-ui/react-utils'
2
+ import type { MaybeRenderProp } from '@chakra-ui/utils'
3
3
  import type { FieldPath, FieldValues, RegisterOptions } from 'react-hook-form'
4
4
  import type { DefaultFields } from './default-fields'
5
5
  import type { FormProps, FormRenderContext } from './form'
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  import { useFormContext } from './form-context'
10
10
 
11
- import { createContext } from '@chakra-ui/react-utils'
11
+ import { createContext } from '@chakra-ui/utils'
12
12
 
13
13
  export interface UseArrayFieldReturn extends UseFieldArrayReturn {
14
14
  /**
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { FieldValues, SubmitHandler } from 'react-hook-form'
3
- import { createContext } from '@chakra-ui/react-utils'
3
+ import { createContext } from '@chakra-ui/utils'
4
4
  import {
5
5
  useStepper,
6
6
  useStep,
@@ -18,7 +18,7 @@ export interface StepState {
18
18
  }
19
19
 
20
20
  export type FormStepSubmitHandler<
21
- TFieldValues extends FieldValues = FieldValues
21
+ TFieldValues extends FieldValues = FieldValues,
22
22
  > = (data: TFieldValues, stepper: UseStepperReturn) => Promise<void>
23
23
 
24
24
  export interface StepFormContext extends UseStepperReturn {
@@ -49,7 +49,7 @@ export interface StepFormRenderContext<
49
49
  TSteps extends StepsOptions<any> = StepsOptions<any>,
50
50
  TFieldValues extends FieldValues = FieldValues,
51
51
  TContext extends object = object,
52
- TFieldTypes = FieldProps<TFieldValues>
52
+ TFieldTypes = FieldProps<TFieldValues>,
53
53
  > extends UseStepFormReturn<TFieldValues> {
54
54
  Field: React.FC<TFieldTypes & React.RefAttributes<FocusableElement>>
55
55
  FormStep: React.FC<FormStepProps<StepName<TSteps>>>
@@ -63,7 +63,7 @@ export interface StepFormRenderContext<
63
63
  export interface UseStepFormProps<
64
64
  TSteps extends StepsOptions<any> = StepsOptions<any>,
65
65
  TFieldValues extends FieldValues = FieldValues,
66
- TContext extends object = object
66
+ TContext extends object = object,
67
67
  > extends Omit<UseStepperProps, 'onChange'>,
68
68
  Omit<FormProps<any, TFieldValues, TContext>, 'children'> {
69
69
  steps?: TSteps
@@ -71,7 +71,7 @@ export interface UseStepFormProps<
71
71
  }
72
72
 
73
73
  export interface UseStepFormReturn<
74
- TFieldValues extends FieldValues = FieldValues
74
+ TFieldValues extends FieldValues = FieldValues,
75
75
  > extends UseStepperReturn {
76
76
  getFormProps(): {
77
77
  onSubmit: SubmitHandler<TFieldValues>
@@ -85,7 +85,7 @@ export interface UseStepFormReturn<
85
85
  export function useStepForm<
86
86
  TSteps extends StepsOptions<any> = StepsOptions<any>,
87
87
  TFieldValues extends FieldValues = FieldValues,
88
- TContext extends object = object
88
+ TContext extends object = object,
89
89
  >(
90
90
  props: UseStepFormProps<TSteps, TFieldValues, TContext>
91
91
  ): UseStepFormReturn<TFieldValues> {