@saas-ui/forms 2.6.2 → 2.6.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +9 -0
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/create-field.tsx +1 -0
- package/src/layout.tsx +11 -2
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@saas-ui/forms",
|
3
|
-
"version": "2.6.
|
3
|
+
"version": "2.6.3",
|
4
4
|
"description": "Fully functional forms for Chakra UI.",
|
5
5
|
"source": "src/index.ts",
|
6
6
|
"exports": {
|
@@ -104,7 +104,7 @@
|
|
104
104
|
"@chakra-ui/react-utils": "^2.0.12",
|
105
105
|
"@chakra-ui/utils": "^2.0.15",
|
106
106
|
"@hookform/resolvers": "^3.3.4",
|
107
|
-
"@saas-ui/core": "2.5.
|
107
|
+
"@saas-ui/core": "2.5.2",
|
108
108
|
"react-hook-form": "^7.50.1"
|
109
109
|
},
|
110
110
|
"peerDependencies": {
|
package/src/create-field.tsx
CHANGED
package/src/layout.tsx
CHANGED
@@ -5,11 +5,15 @@ import {
|
|
5
5
|
omitThemingProps,
|
6
6
|
SimpleGrid,
|
7
7
|
SimpleGridProps,
|
8
|
+
ThemingProps,
|
9
|
+
useStyleConfig,
|
8
10
|
useTheme,
|
9
11
|
} from '@chakra-ui/react'
|
10
12
|
import { cx } from '@chakra-ui/utils'
|
11
13
|
|
12
|
-
export interface FormLayoutProps
|
14
|
+
export interface FormLayoutProps
|
15
|
+
extends ThemingProps<'SuiFormLayout'>,
|
16
|
+
SimpleGridProps {}
|
13
17
|
|
14
18
|
interface FormLayoutItemProps {
|
15
19
|
children: React.ReactNode
|
@@ -24,7 +28,6 @@ FormLayoutItem.displayName = 'FormLayoutItem'
|
|
24
28
|
/**
|
25
29
|
* Create consistent field spacing and positioning.
|
26
30
|
*
|
27
|
-
*
|
28
31
|
* Renders form items in a `SimpleGrid`
|
29
32
|
* @see https://chakra-ui.com/docs/layout/simple-grid
|
30
33
|
*
|
@@ -37,6 +40,8 @@ export const FormLayout = ({ children, ...props }: FormLayoutProps) => {
|
|
37
40
|
spacing: 4,
|
38
41
|
}
|
39
42
|
|
43
|
+
const styles = useStyleConfig('SuiFormLayout', props)
|
44
|
+
|
40
45
|
const gridProps = omitThemingProps({
|
41
46
|
...defaultProps,
|
42
47
|
...props,
|
@@ -46,6 +51,10 @@ export const FormLayout = ({ children, ...props }: FormLayoutProps) => {
|
|
46
51
|
<SimpleGrid
|
47
52
|
{...gridProps}
|
48
53
|
className={cx('sui-form__layout', props.className)}
|
54
|
+
sx={{
|
55
|
+
...styles,
|
56
|
+
...props.sx,
|
57
|
+
}}
|
49
58
|
>
|
50
59
|
{children}
|
51
60
|
</SimpleGrid>
|