@saas-ui/forms 2.6.0 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +18 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/base-field.tsx +3 -1
- package/src/default-fields.tsx +1 -1
- package/src/number-input/number-input.test.tsx +3 -1
- package/src/select/select.test.tsx +4 -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.2",
|
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.1",
|
108
108
|
"react-hook-form": "^7.50.1"
|
109
109
|
},
|
110
110
|
"peerDependencies": {
|
package/src/base-field.tsx
CHANGED
@@ -57,8 +57,10 @@ export const useBaseField = (props: BaseFieldProps) => {
|
|
57
57
|
export const BaseField: React.FC<BaseFieldProps> = (props) => {
|
58
58
|
const { controlProps, label, help, hideLabel, error } = useBaseField(props)
|
59
59
|
|
60
|
+
const isInvalid = !!error || controlProps.isInvalid
|
61
|
+
|
60
62
|
return (
|
61
|
-
<FormControl {...controlProps} isInvalid={
|
63
|
+
<FormControl {...controlProps} isInvalid={isInvalid}>
|
62
64
|
{label && !hideLabel ? <FormLabel>{label}</FormLabel> : null}
|
63
65
|
<Box>
|
64
66
|
{props.children}
|
package/src/default-fields.tsx
CHANGED
@@ -87,7 +87,7 @@ export const SwitchField = createField<SwitchFieldProps>(
|
|
87
87
|
}
|
88
88
|
)
|
89
89
|
|
90
|
-
export interface SelectFieldProps extends SelectProps {
|
90
|
+
export interface SelectFieldProps extends SelectProps<boolean> {
|
91
91
|
buttonProps?: SelectButtonProps
|
92
92
|
listProps?: SelectListProps
|
93
93
|
}
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import * as React from 'react'
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { testStories } from '@saas-ui/test-utils'
|
4
4
|
import * as stories from './select.stories'
|
5
5
|
|
6
6
|
const { MaxHeight, ...rest } = stories
|
7
7
|
|
8
|
-
testStories
|
8
|
+
testStories(rest, {
|
9
|
+
a11y: false,
|
10
|
+
})
|