@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saas-ui/forms",
3
- "version": "2.6.0",
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.0",
107
+ "@saas-ui/core": "2.5.1",
108
108
  "react-hook-form": "^7.50.1"
109
109
  },
110
110
  "peerDependencies": {
@@ -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={!!error}>
63
+ <FormControl {...controlProps} isInvalid={isInvalid}>
62
64
  {label && !hideLabel ? <FormLabel>{label}</FormLabel> : null}
63
65
  <Box>
64
66
  {props.children}
@@ -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
  }
@@ -3,4 +3,6 @@ import * as React from 'react'
3
3
  import { render, testStories } from '@saas-ui/test-utils'
4
4
  import * as stories from './number-input.stories'
5
5
 
6
- testStories<typeof stories>(stories)
6
+ testStories<typeof stories>(stories, {
7
+ a11y: false,
8
+ })
@@ -1,8 +1,10 @@
1
1
  import * as React from 'react'
2
2
 
3
- import { render, testStories } from '@saas-ui/test-utils'
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<typeof rest>(rest)
8
+ testStories(rest, {
9
+ a11y: false,
10
+ })