@ultraviolet/form 2.0.0-next.8 → 2.0.0-next.9

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.
@@ -3,26 +3,25 @@ import { useController } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
  import { useErrors } from '../../providers/ErrorContext/index.js';
5
5
 
6
- const CheckboxField = _ref => {
7
- let {
8
- name,
9
- label,
10
- size,
11
- progress,
12
- disabled,
13
- required,
14
- className,
15
- children,
16
- onChange,
17
- onBlur,
18
- onFocus,
19
- rules,
20
- helper,
21
- tooltip,
22
- 'data-testid': dataTestId,
23
- value,
24
- shouldUnregister = false
25
- } = _ref;
6
+ const CheckboxField = ({
7
+ name,
8
+ label,
9
+ size,
10
+ progress,
11
+ disabled,
12
+ required,
13
+ className,
14
+ children,
15
+ onChange,
16
+ onBlur,
17
+ onFocus,
18
+ rules,
19
+ helper,
20
+ tooltip,
21
+ 'data-testid': dataTestId,
22
+ value,
23
+ shouldUnregister = false
24
+ }) => {
26
25
  const {
27
26
  getError
28
27
  } = useErrors();
@@ -3,20 +3,19 @@ import { useController } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
  import { useErrors } from '../../providers/ErrorContext/index.js';
5
5
 
6
- const CheckboxGroupField = _ref => {
7
- let {
8
- legend,
9
- className,
10
- helper,
11
- direction,
12
- children,
13
- onChange,
14
- label = '',
15
- error: customError,
16
- name,
17
- required = false,
18
- shouldUnregister = false
19
- } = _ref;
6
+ const CheckboxGroupField = ({
7
+ legend,
8
+ className,
9
+ helper,
10
+ direction,
11
+ children,
12
+ onChange,
13
+ label = '',
14
+ error: customError,
15
+ name,
16
+ required = false,
17
+ shouldUnregister = false
18
+ }) => {
20
19
  const {
21
20
  getError
22
21
  } = useErrors();
@@ -7,26 +7,25 @@ import { useErrors } from '../../providers/ErrorContext/index.js';
7
7
 
8
8
  const parseDate = value => typeof value === 'string' ? new Date(value) : value;
9
9
  const isEmpty = value => typeof value === 'string' ? value === '' : value === undefined;
10
- const DateField = _ref => {
11
- let {
12
- required,
13
- name,
14
- label = '',
15
- format,
16
- locale,
17
- maxDate,
18
- minDate,
19
- disabled,
20
- onChange,
21
- onBlur,
22
- onFocus,
23
- rules,
24
- autoFocus = false,
25
- excludeDates,
26
- selectsRange,
27
- 'data-testid': dataTestId,
28
- shouldUnregister = false
29
- } = _ref;
10
+ const DateField = ({
11
+ required,
12
+ name,
13
+ label = '',
14
+ format,
15
+ locale,
16
+ maxDate,
17
+ minDate,
18
+ disabled,
19
+ onChange,
20
+ onBlur,
21
+ onFocus,
22
+ rules,
23
+ autoFocus = false,
24
+ excludeDates,
25
+ selectsRange,
26
+ 'data-testid': dataTestId,
27
+ shouldUnregister = false
28
+ }) => {
30
29
  const {
31
30
  getError
32
31
  } = useErrors();
@@ -6,15 +6,14 @@ import { jsx } from '@emotion/react/jsx-runtime';
6
6
  import { ErrorProvider } from '../../providers/ErrorContext/index.js';
7
7
 
8
8
  const FormSubmitContext = /*#__PURE__*/React.createContext({});
9
- const Form = _ref => {
10
- let {
11
- children,
12
- methods: methodsProp,
13
- initialValues,
14
- errors,
15
- onRawSubmit,
16
- name
17
- } = _ref;
9
+ const Form = ({
10
+ children,
11
+ methods: methodsProp,
12
+ initialValues,
13
+ errors,
14
+ onRawSubmit,
15
+ name
16
+ }) => {
18
17
  const methodsHook = useForm({
19
18
  defaultValues: initialValues,
20
19
  mode: 'onChange'
@@ -3,26 +3,25 @@ import { useController } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
  import { useErrors } from '../../providers/ErrorContext/index.js';
5
5
 
6
- const NumberInputField = _ref => {
7
- let {
8
- disabled,
9
- maxValue,
10
- minValue,
11
- name,
12
- onChange,
13
- onBlur,
14
- onFocus,
15
- onMaxCrossed,
16
- onMinCrossed,
17
- required,
18
- size,
19
- step,
20
- text,
21
- rules,
22
- className,
23
- label,
24
- shouldUnregister = false
25
- } = _ref;
6
+ const NumberInputField = ({
7
+ disabled,
8
+ maxValue,
9
+ minValue,
10
+ name,
11
+ onChange,
12
+ onBlur,
13
+ onFocus,
14
+ onMaxCrossed,
15
+ onMinCrossed,
16
+ required,
17
+ size,
18
+ step,
19
+ text,
20
+ rules,
21
+ className,
22
+ label,
23
+ shouldUnregister = false
24
+ }) => {
26
25
  const {
27
26
  getError
28
27
  } = useErrors();
@@ -3,23 +3,22 @@ import { useController } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
  import { useErrors } from '../../providers/ErrorContext/index.js';
5
5
 
6
- const RadioField = _ref => {
7
- let {
8
- className,
9
- 'data-testid': dataTestId,
10
- disabled,
11
- id,
12
- name,
13
- onBlur,
14
- label = '',
15
- onChange,
16
- onFocus,
17
- required,
18
- value,
19
- rules,
20
- tooltip,
21
- shouldUnregister = false
22
- } = _ref;
6
+ const RadioField = ({
7
+ className,
8
+ 'data-testid': dataTestId,
9
+ disabled,
10
+ id,
11
+ name,
12
+ onBlur,
13
+ label = '',
14
+ onChange,
15
+ onFocus,
16
+ required,
17
+ value,
18
+ rules,
19
+ tooltip,
20
+ shouldUnregister = false
21
+ }) => {
23
22
  const {
24
23
  getError
25
24
  } = useErrors();
@@ -3,21 +3,20 @@ import { useController } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
  import { useErrors } from '../../providers/ErrorContext/index.js';
5
5
 
6
- const RadioGroupField = _ref => {
7
- let {
8
- className,
9
- legend = '',
10
- name,
11
- onChange,
12
- required,
13
- rules,
14
- children,
15
- label = '',
16
- error: customError,
17
- helper,
18
- direction,
19
- shouldUnregister = false
20
- } = _ref;
6
+ const RadioGroupField = ({
7
+ className,
8
+ legend = '',
9
+ name,
10
+ onChange,
11
+ required,
12
+ rules,
13
+ children,
14
+ label = '',
15
+ error: customError,
16
+ helper,
17
+ direction,
18
+ shouldUnregister = false
19
+ }) => {
21
20
  const {
22
21
  getError
23
22
  } = useErrors();
@@ -7,54 +7,51 @@ import { useErrors } from '../../providers/ErrorContext/index.js';
7
7
  const identity = x => x;
8
8
  // const identity = <T,>(x: T) => x
9
9
 
10
- const SelectInputField = _ref => {
11
- let {
12
- animation,
13
- animationDuration,
14
- animationOnChange,
15
- children,
16
- className,
17
- disabled,
18
- // error: errorProp,
19
- format: formatProp = identity,
20
- // formatOnBlur,
21
- id,
22
- inputId,
23
- isClearable,
24
- isLoading,
25
- isSearchable,
26
- label = '',
27
- maxLength,
28
- menuPortalTarget,
29
- minLength,
30
- multiple,
31
- name,
32
- onBlur,
33
- onChange,
34
- onFocus,
35
- options: optionsProp,
36
- parse: parseProp = identity,
37
- placeholder,
38
- readOnly,
39
- required,
40
- rules,
41
- noTopLabel,
42
- noOptionsMessage,
43
- customStyle,
44
- shouldUnregister = false
45
- } = _ref;
46
- const options = useMemo(() => optionsProp || Children.toArray(children).flat().filter(Boolean).map(_ref2 => {
47
- let {
48
- props: {
49
- children: labelChild,
50
- ...option
51
- }
52
- } = _ref2;
53
- return {
54
- ...option,
55
- label: labelChild
56
- };
57
- }), [optionsProp, children]);
10
+ const SelectInputField = ({
11
+ animation,
12
+ animationDuration,
13
+ animationOnChange,
14
+ children,
15
+ className,
16
+ disabled,
17
+ // error: errorProp,
18
+ format: formatProp = identity,
19
+ // formatOnBlur,
20
+ id,
21
+ inputId,
22
+ isClearable,
23
+ isLoading,
24
+ isSearchable,
25
+ label = '',
26
+ maxLength,
27
+ menuPortalTarget,
28
+ minLength,
29
+ multiple,
30
+ name,
31
+ onBlur,
32
+ onChange,
33
+ onFocus,
34
+ options: optionsProp,
35
+ parse: parseProp = identity,
36
+ placeholder,
37
+ readOnly,
38
+ required,
39
+ rules,
40
+ noTopLabel,
41
+ noOptionsMessage,
42
+ customStyle,
43
+ shouldUnregister = false,
44
+ 'data-testid': dataTestId
45
+ }) => {
46
+ const options = useMemo(() => optionsProp || Children.toArray(children).flat().filter(Boolean).map(({
47
+ props: {
48
+ children: labelChild,
49
+ ...option
50
+ }
51
+ }) => ({
52
+ ...option,
53
+ label: labelChild
54
+ })), [optionsProp, children]);
58
55
  const parse = useMemo(() => multiple ? parseProp : option => parseProp(option?.value ?? null, name), [multiple, parseProp, name]);
59
56
  const format = useCallback(val => {
60
57
  if (multiple) return formatProp(val, name);
@@ -126,6 +123,7 @@ const SelectInputField = _ref => {
126
123
  required: required,
127
124
  value: format(field.value),
128
125
  noOptionsMessage: noOptionsMessage,
126
+ "data-testid": dataTestId,
129
127
  children: children
130
128
  });
131
129
  };
@@ -2,25 +2,25 @@ import { SelectableCard } from '@ultraviolet/ui';
2
2
  import { useController } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
 
5
- const SelectableCardField = _ref => {
6
- let {
7
- name,
8
- value,
9
- onChange,
10
- showTick,
11
- type,
12
- disabled,
13
- children,
14
- className,
15
- onFocus,
16
- onBlur,
17
- required,
18
- tooltip,
19
- id,
20
- label,
21
- rules,
22
- shouldUnregister = false
23
- } = _ref;
5
+ const SelectableCardField = ({
6
+ name,
7
+ value,
8
+ onChange,
9
+ showTick,
10
+ type,
11
+ disabled,
12
+ children,
13
+ className,
14
+ onFocus,
15
+ onBlur,
16
+ required,
17
+ tooltip,
18
+ id,
19
+ label,
20
+ rules,
21
+ shouldUnregister = false,
22
+ 'data-testid': dataTestId
23
+ }) => {
24
24
  const {
25
25
  field,
26
26
  fieldState: {
@@ -57,6 +57,7 @@ const SelectableCardField = _ref => {
57
57
  label: label,
58
58
  value: value ?? '',
59
59
  name: field.name,
60
+ "data-testid": dataTestId,
60
61
  children: children
61
62
  });
62
63
  };
@@ -2,20 +2,19 @@ import { Button } from '@ultraviolet/ui';
2
2
  import { useFormState } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
 
5
- const Submit = _ref => {
6
- let {
7
- children,
8
- className,
9
- disabled = false,
10
- icon,
11
- iconPosition,
12
- size,
13
- variant = 'filled',
14
- sentiment = 'primary',
15
- tooltip,
16
- fullWidth,
17
- onClick
18
- } = _ref;
5
+ const Submit = ({
6
+ children,
7
+ className,
8
+ disabled = false,
9
+ icon,
10
+ iconPosition,
11
+ size,
12
+ variant = 'filled',
13
+ sentiment = 'primary',
14
+ tooltip,
15
+ fullWidth,
16
+ onClick
17
+ }) => {
19
18
  const {
20
19
  isSubmitting,
21
20
  isValid
@@ -2,10 +2,9 @@ import { Alert } from '@ultraviolet/ui';
2
2
  import { useFormState } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
 
5
- const SubmitErrorAlert = _ref => {
6
- let {
7
- className
8
- } = _ref;
5
+ const SubmitErrorAlert = ({
6
+ className
7
+ }) => {
9
8
  const {
10
9
  errors
11
10
  } = useFormState();
@@ -2,19 +2,19 @@ import { TagInput } from '@ultraviolet/ui';
2
2
  import { useController } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
 
5
- const TagInputField = _ref => {
6
- let {
7
- className,
8
- disabled,
9
- id,
10
- name,
11
- onChange,
12
- placeholder,
13
- required,
14
- rules,
15
- variant,
16
- shouldUnregister = false
17
- } = _ref;
5
+ const TagInputField = ({
6
+ className,
7
+ disabled,
8
+ id,
9
+ name,
10
+ onChange,
11
+ placeholder,
12
+ required,
13
+ rules,
14
+ variant,
15
+ shouldUnregister = false,
16
+ 'data-testid': dataTestId
17
+ }) => {
18
18
  const {
19
19
  field
20
20
  } = useController({
@@ -36,7 +36,8 @@ const TagInputField = _ref => {
36
36
  },
37
37
  placeholder: placeholder,
38
38
  variant: variant,
39
- tags: field.value
39
+ tags: field.value,
40
+ "data-testid": dataTestId
40
41
  });
41
42
  };
42
43
 
@@ -3,54 +3,54 @@ import { useController } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
  import { useErrors } from '../../providers/ErrorContext/index.js';
5
5
 
6
- const TextInputField = _ref => {
7
- let {
8
- autoCapitalize,
9
- autoComplete,
10
- autoCorrect,
11
- autoFocus,
12
- autoSave,
13
- className,
14
- cols,
15
- disabled,
16
- fillAvailable,
17
- generated,
18
- id,
19
- label = '',
20
- multiline,
21
- name,
22
- noTopLabel,
23
- notice,
24
- onChange,
25
- onFocus,
26
- onKeyDown,
27
- onKeyUp,
28
- onBlur,
29
- placeholder,
30
- random,
31
- readOnly,
32
- required,
33
- resizable,
34
- rows,
35
- type,
36
- unit,
37
- size,
38
- rules,
39
- valid,
40
- parse,
41
- format,
42
- formatOnBlur = false,
43
- regex: regexes,
44
- min,
45
- max,
46
- minLength,
47
- maxLength,
48
- validate,
49
- defaultValue,
50
- customError,
51
- innerRef,
52
- shouldUnregister = false
53
- } = _ref;
6
+ const TextInputField = ({
7
+ autoCapitalize,
8
+ autoComplete,
9
+ autoCorrect,
10
+ autoFocus,
11
+ autoSave,
12
+ className,
13
+ cols,
14
+ disabled,
15
+ fillAvailable,
16
+ generated,
17
+ id,
18
+ label = '',
19
+ multiline,
20
+ name,
21
+ noTopLabel,
22
+ notice,
23
+ onChange,
24
+ onFocus,
25
+ onKeyDown,
26
+ onKeyUp,
27
+ onBlur,
28
+ placeholder,
29
+ random,
30
+ readOnly,
31
+ required,
32
+ resizable,
33
+ rows,
34
+ type,
35
+ unit,
36
+ size,
37
+ rules,
38
+ valid,
39
+ parse,
40
+ format,
41
+ formatOnBlur = false,
42
+ regex: regexes,
43
+ min,
44
+ max,
45
+ minLength,
46
+ maxLength,
47
+ validate,
48
+ defaultValue,
49
+ customError,
50
+ innerRef,
51
+ shouldUnregister = false,
52
+ 'data-testid': dataTestId
53
+ }) => {
54
54
  const {
55
55
  getError
56
56
  } = useErrors();
@@ -142,7 +142,8 @@ const TextInputField = _ref => {
142
142
  valid: valid,
143
143
  size: size,
144
144
  value: transformedValue(),
145
- ref: innerRef
145
+ ref: innerRef,
146
+ "data-testid": dataTestId
146
147
  });
147
148
  };
148
149
 
@@ -9,31 +9,30 @@ const parseTime = date => {
9
9
  value: timeStr
10
10
  };
11
11
  };
12
- const TimeField = _ref => {
13
- let {
14
- required,
15
- name,
16
- schedule,
17
- placeholder,
18
- disabled,
19
- readOnly,
20
- onBlur,
21
- onFocus,
22
- onChange,
23
- isLoading,
24
- isClearable,
25
- inputId,
26
- id,
27
- animation,
28
- animationDuration,
29
- animationOnChange,
30
- className,
31
- isSearchable,
32
- rules,
33
- options,
34
- 'data-testid': dataTestId,
35
- shouldUnregister = false
36
- } = _ref;
12
+ const TimeField = ({
13
+ required,
14
+ name,
15
+ schedule,
16
+ placeholder,
17
+ disabled,
18
+ readOnly,
19
+ onBlur,
20
+ onFocus,
21
+ onChange,
22
+ isLoading,
23
+ isClearable,
24
+ inputId,
25
+ id,
26
+ animation,
27
+ animationDuration,
28
+ animationOnChange,
29
+ className,
30
+ isSearchable,
31
+ rules,
32
+ options,
33
+ 'data-testid': dataTestId,
34
+ shouldUnregister = false
35
+ }) => {
37
36
  const {
38
37
  field,
39
38
  fieldState: {
@@ -2,23 +2,22 @@ import { Toggle } from '@ultraviolet/ui';
2
2
  import { useController } from 'react-hook-form';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
 
5
- const ToggleField = _ref => {
6
- let {
7
- className,
8
- disabled,
9
- label,
10
- name,
11
- onChange,
12
- required,
13
- size,
14
- tooltip,
15
- rules,
16
- labelPosition,
17
- parse,
18
- format,
19
- 'data-testid': dataTestId,
20
- shouldUnregister = false
21
- } = _ref;
5
+ const ToggleField = ({
6
+ className,
7
+ disabled,
8
+ label,
9
+ name,
10
+ onChange,
11
+ required,
12
+ size,
13
+ tooltip,
14
+ rules,
15
+ labelPosition,
16
+ parse,
17
+ format,
18
+ 'data-testid': dataTestId,
19
+ shouldUnregister = false
20
+ }) => {
22
21
  const {
23
22
  field
24
23
  } = useController({
@@ -1,8 +1,5 @@
1
1
  import validators from '../validators/index.js';
2
2
 
3
- const pickValidators = args => Object.entries(args).map(_ref => {
4
- let [key, value] = _ref;
5
- return value !== undefined ? validators[key]?.(value) : undefined;
6
- }).filter(validator => !!validator);
3
+ const pickValidators = args => Object.entries(args).map(([key, value]) => value !== undefined ? validators[key]?.(value) : undefined).filter(validator => !!validator);
7
4
 
8
5
  export { pickValidators };
@@ -3,33 +3,32 @@ import { useField } from 'react-final-form';
3
3
  import { useValidation } from './useValidation.js';
4
4
  import { pickValidators } from '../helpers/pickValidators.js';
5
5
 
6
- const useFormField = (name, _ref) => {
7
- let {
8
- afterSubmit,
9
- disabled,
10
- allowNull,
11
- beforeSubmit,
12
- defaultValue,
13
- format,
14
- formatOnBlur,
15
- initialValue,
16
- isEqual,
17
- multiple,
18
- parse,
19
- subscription,
20
- type,
21
- validate,
22
- validateFields,
23
- value,
24
- max,
25
- maxLength,
26
- min,
27
- minLength,
28
- regex,
29
- required,
30
- maxDate,
31
- minDate
32
- } = _ref;
6
+ const useFormField = (name, {
7
+ afterSubmit,
8
+ disabled,
9
+ allowNull,
10
+ beforeSubmit,
11
+ defaultValue,
12
+ format,
13
+ formatOnBlur,
14
+ initialValue,
15
+ isEqual,
16
+ multiple,
17
+ parse,
18
+ subscription,
19
+ type,
20
+ validate,
21
+ validateFields,
22
+ value,
23
+ max,
24
+ maxLength,
25
+ min,
26
+ minLength,
27
+ regex,
28
+ required,
29
+ maxDate,
30
+ minDate
31
+ }) => {
33
32
  const serializedRegex = useMemo(() => regex?.toString(), [regex]);
34
33
  const validators = useMemo(() => pickValidators({
35
34
  max,
@@ -1,10 +1,7 @@
1
1
  import { useRef, useEffect } from 'react';
2
2
  import { useFormContext } from 'react-hook-form';
3
3
 
4
- const useOnFieldChange = function (fieldName, callback, enabled) {
5
- if (enabled === void 0) {
6
- enabled = true;
7
- }
4
+ const useOnFieldChange = (fieldName, callback, enabled = true) => {
8
5
  const {
9
6
  watch,
10
7
  getValues
@@ -1,25 +1,19 @@
1
1
  import { useCallback } from 'react';
2
2
 
3
- const useValidation = _ref => {
4
- let {
5
- validators,
6
- validate
7
- } = _ref;
8
- return useCallback((value, allValues, meta) => {
9
- if (validate) {
10
- const validateErr = validate(value, allValues, meta);
11
- if (validateErr !== undefined && validateErr !== true) {
12
- return validateErr;
13
- }
3
+ const useValidation = ({
4
+ validators,
5
+ validate
6
+ }) => useCallback((value, allValues, meta) => {
7
+ if (validate) {
8
+ const validateErr = validate(value, allValues, meta);
9
+ if (validateErr !== undefined && validateErr !== true) {
10
+ return validateErr;
14
11
  }
15
- const errors = validators.filter(validator => !validator.validate(value, allValues, meta)).map(_ref2 => {
16
- let {
17
- error
18
- } = _ref2;
19
- return error;
20
- });
21
- return errors.length > 0 ? errors : undefined;
22
- }, [validate, validators]);
23
- };
12
+ }
13
+ const errors = validators.filter(validator => !validator.validate(value, allValues, meta)).map(({
14
+ error
15
+ }) => error);
16
+ return errors.length > 0 ? errors : undefined;
17
+ }, [validate, validators]);
24
18
 
25
19
  export { useValidation };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
2
- import { Checkbox, CheckboxGroup, DateInput, Radio, SelectableCard, NumberInput, TagInput, TextInput, TimeInput, Toggle, Button, RadioGroup } from '@ultraviolet/ui';
2
+ import { Checkbox, CheckboxGroup, DateInput, Radio, SelectInput, SelectableCard, NumberInput, TagInput, TextInput, TimeInput, Toggle, Button, RadioGroup } from '@ultraviolet/ui';
3
3
  import * as react from 'react';
4
4
  import { ComponentProps, ReactNode, FocusEvent, ForwardedRef, FocusEventHandler, Ref, JSX } from 'react';
5
5
  import * as react_hook_form from 'react-hook-form';
@@ -27,7 +27,7 @@ type RequiredErrors = {
27
27
  type FormErrors = {
28
28
  [key in 'required' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'minDate' | 'maxDate']: RequiredErrors[key];
29
29
  };
30
- type BaseFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
30
+ type BaseFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = {
31
31
  name: TName;
32
32
  required?: boolean;
33
33
  /**
@@ -42,15 +42,15 @@ type BaseFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TF
42
42
  shouldUnregister?: UseControllerProps<TFieldValues, TName>['shouldUnregister'];
43
43
  };
44
44
 
45
- type CheckboxFieldProps<TFieldValues extends FieldValues> = BaseFieldProps<TFieldValues> & Partial<Pick<ComponentProps<typeof Checkbox>, 'disabled' | 'onBlur' | 'onFocus' | 'progress' | 'size' | 'data-testid' | 'helper' | 'tooltip'>> & {
45
+ type CheckboxFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TName> & Partial<Pick<ComponentProps<typeof Checkbox>, 'disabled' | 'onBlur' | 'onFocus' | 'progress' | 'size' | 'data-testid' | 'helper' | 'tooltip'>> & {
46
46
  className?: string;
47
47
  children?: ReactNode;
48
48
  };
49
- declare const CheckboxField: <TFieldValues extends FieldValues>({ name, label, size, progress, disabled, required, className, children, onChange, onBlur, onFocus, rules, helper, tooltip, "data-testid": dataTestId, value, shouldUnregister, }: CheckboxFieldProps<TFieldValues>) => _emotion_react_jsx_runtime.JSX.Element;
49
+ declare const CheckboxField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, size, progress, disabled, required, className, children, onChange, onBlur, onFocus, rules, helper, tooltip, "data-testid": dataTestId, value, shouldUnregister, }: CheckboxFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
50
50
 
51
- type CheckboxGroupFieldProps<TFieldValues extends FieldValues> = BaseFieldProps<TFieldValues> & Partial<Pick<ComponentProps<typeof CheckboxGroup>, 'className' | 'helper' | 'required' | 'direction' | 'children' | 'error' | 'legend'>> & Required<Pick<ComponentProps<typeof CheckboxGroup>, 'legend'>>;
51
+ type CheckboxGroupFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TName> & Partial<Pick<ComponentProps<typeof CheckboxGroup>, 'className' | 'helper' | 'required' | 'direction' | 'children' | 'error' | 'legend'>> & Required<Pick<ComponentProps<typeof CheckboxGroup>, 'legend'>>;
52
52
  declare const CheckboxGroupField: {
53
- <TFieldValues extends FieldValues>({ legend, className, helper, direction, children, onChange, label, error: customError, name, required, shouldUnregister, }: CheckboxGroupFieldProps<TFieldValues>): _emotion_react_jsx_runtime.JSX.Element;
53
+ <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ legend, className, helper, direction, children, onChange, label, error: customError, name, required, shouldUnregister, }: CheckboxGroupFieldProps<TFieldValues, TName>): _emotion_react_jsx_runtime.JSX.Element;
54
54
  Checkbox: ({ onFocus, onBlur, disabled, error, name, value, children, helper, className, autoFocus, "data-testid": dataTestId, }: Omit<({
55
55
  error?: react.ReactNode;
56
56
  size?: number | undefined;
@@ -76,7 +76,7 @@ declare const CheckboxGroupField: {
76
76
  }) => _emotion_react_jsx_runtime.JSX.Element;
77
77
  };
78
78
 
79
- type DateFieldProps<TFieldValues extends FieldValues> = BaseFieldProps<TFieldValues> & Omit<ComponentProps<typeof DateInput>, 'maxDate' | 'minDate' | 'disabled' | 'required' | 'locale' | 'name' | 'onChange' | 'onFocus' | 'onBlur' | 'autoFocus' | 'stardDate' | 'endDate'> & {
79
+ type DateFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TName> & Omit<ComponentProps<typeof DateInput>, 'maxDate' | 'minDate' | 'disabled' | 'required' | 'locale' | 'name' | 'onChange' | 'onFocus' | 'onBlur' | 'autoFocus' | 'stardDate' | 'endDate'> & {
80
80
  maxDate?: Date;
81
81
  minDate?: Date;
82
82
  disabled?: boolean;
@@ -86,7 +86,7 @@ type DateFieldProps<TFieldValues extends FieldValues> = BaseFieldProps<TFieldVal
86
86
  onFocus?: (value: FocusEvent<HTMLElement>) => void;
87
87
  autoFocus?: boolean;
88
88
  };
89
- declare const DateField: <TFieldValues extends FieldValues>({ required, name, label, format, locale, maxDate, minDate, disabled, onChange, onBlur, onFocus, rules, autoFocus, excludeDates, selectsRange, "data-testid": dataTestId, shouldUnregister, }: DateFieldProps<TFieldValues>) => _emotion_react_jsx_runtime.JSX.Element;
89
+ declare const DateField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ required, name, label, format, locale, maxDate, minDate, disabled, onChange, onBlur, onFocus, rules, autoFocus, excludeDates, selectsRange, "data-testid": dataTestId, shouldUnregister, }: DateFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
90
90
 
91
91
  type Without<T, U> = {
92
92
  [P in Exclude<keyof T, keyof U>]?: never;
@@ -148,10 +148,10 @@ type FormProps<TFormValues extends FieldValues = FieldValues> = {
148
148
  ]>;
149
149
  declare const Form: <TFormValues extends FieldValues>({ children, methods: methodsProp, initialValues, errors, onRawSubmit, name, }: FormProps<TFormValues>) => _emotion_react_jsx_runtime.JSX.Element;
150
150
 
151
- type RadioFieldProps<TFieldValues extends FieldValues> = Omit<BaseFieldProps<TFieldValues>, 'label'> & Partial<Pick<ComponentProps<typeof Radio>, 'disabled' | 'id' | 'onBlur' | 'onFocus' | 'data-testid' | 'tooltip' | 'label'>> & {
151
+ type RadioFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = Omit<BaseFieldProps<TFieldValues, TName>, 'label'> & Partial<Pick<ComponentProps<typeof Radio>, 'disabled' | 'id' | 'onBlur' | 'onFocus' | 'data-testid' | 'tooltip' | 'label'>> & {
152
152
  className?: string;
153
153
  };
154
- declare const RadioField: <TFieldValues extends FieldValues>({ className, "data-testid": dataTestId, disabled, id, name, onBlur, label, onChange, onFocus, required, value, rules, tooltip, shouldUnregister, }: RadioFieldProps<TFieldValues>) => _emotion_react_jsx_runtime.JSX.Element;
154
+ declare const RadioField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ className, "data-testid": dataTestId, disabled, id, name, onBlur, label, onChange, onFocus, required, value, rules, tooltip, shouldUnregister, }: RadioFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
155
155
 
156
156
  type SelectOption = {
157
157
  value: string;
@@ -193,7 +193,7 @@ type SelectProps = StyledContainerProps & Omit<Props<SelectOption>, 'value'> & C
193
193
  time?: boolean;
194
194
  };
195
195
  type StateManagedSelect = typeof Select;
196
- type SelectInputProps = Partial<SelectProps & SelectStyleProps & {
196
+ type SelectInputProps = Partial<SelectProps & SelectStyleProps & Pick<ComponentProps<typeof SelectInput>, 'data-testid'> & {
197
197
  /**
198
198
  * Name of the animation
199
199
  */
@@ -212,7 +212,7 @@ type SelectInputProps = Partial<SelectProps & SelectStyleProps & {
212
212
  children: ReactNode;
213
213
  emptyState?: ComponentProps<Select>['noOptionsMessage'];
214
214
  }>;
215
- type SelectInputFieldProps<TFieldValues extends FieldValues = FieldValues> = Omit<BaseFieldProps<TFieldValues>, 'onChange'> & Partial<Pick<SelectInputProps, 'animation' | 'animationDuration' | 'animationOnChange' | 'children' | 'className' | 'disabled' | 'error' | 'id' | 'inputId' | 'isClearable' | 'isLoading' | 'isSearchable' | 'menuPortalTarget' | 'onBlur' | 'onChange' | 'onFocus' | 'options' | 'placeholder' | 'readOnly' | 'required' | 'value' | 'noTopLabel' | 'noOptionsMessage' | 'customStyle'>> & {
215
+ type SelectInputFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = Omit<BaseFieldProps<TFieldValues, TName>, 'onChange'> & Partial<Pick<SelectInputProps, 'animation' | 'animationDuration' | 'animationOnChange' | 'children' | 'className' | 'disabled' | 'error' | 'id' | 'inputId' | 'isClearable' | 'isLoading' | 'isSearchable' | 'menuPortalTarget' | 'onBlur' | 'onChange' | 'onFocus' | 'options' | 'placeholder' | 'readOnly' | 'required' | 'value' | 'noTopLabel' | 'noOptionsMessage' | 'customStyle' | 'data-testid'>> & {
216
216
  multiple?: boolean;
217
217
  parse?: (value: unknown, name?: string) => unknown;
218
218
  format?: (value: unknown, name: string) => unknown;
@@ -220,7 +220,7 @@ type SelectInputFieldProps<TFieldValues extends FieldValues = FieldValues> = Omi
220
220
  minLength?: number;
221
221
  };
222
222
  declare const SelectInputField: {
223
- <TFieldValues extends FieldValues>({ animation, animationDuration, animationOnChange, children, className, disabled, format: formatProp, id, inputId, isClearable, isLoading, isSearchable, label, maxLength, menuPortalTarget, minLength, multiple, name, onBlur, onChange, onFocus, options: optionsProp, parse: parseProp, placeholder, readOnly, required, rules, noTopLabel, noOptionsMessage, customStyle, shouldUnregister, }: SelectInputFieldProps<TFieldValues>): _emotion_react_jsx_runtime.JSX.Element;
223
+ <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ animation, animationDuration, animationOnChange, children, className, disabled, format: formatProp, id, inputId, isClearable, isLoading, isSearchable, label, maxLength, menuPortalTarget, minLength, multiple, name, onBlur, onChange, onFocus, options: optionsProp, parse: parseProp, placeholder, readOnly, required, rules, noTopLabel, noOptionsMessage, customStyle, shouldUnregister, "data-testid": dataTestId, }: SelectInputFieldProps<TFieldValues, TName>): _emotion_react_jsx_runtime.JSX.Element;
224
224
  Option: (props: Partial<OptionProps<{
225
225
  value: string;
226
226
  label: ReactNode;
@@ -242,25 +242,25 @@ declare const SelectInputField: {
242
242
  }>) => react.JSX.Element;
243
243
  };
244
244
 
245
- type SelectableCardFieldProps<TFieldValues extends FieldValues> = Omit<BaseFieldProps<TFieldValues>, 'label' | 'onChange'> & Partial<Pick<ComponentProps<typeof SelectableCard>, 'disabled' | 'onBlur' | 'onChange' | 'onFocus' | 'showTick' | 'type' | 'id' | 'children' | 'tooltip' | 'label'>> & {
245
+ type SelectableCardFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = Omit<BaseFieldProps<TFieldValues, TName>, 'label' | 'onChange'> & Partial<Pick<ComponentProps<typeof SelectableCard>, 'disabled' | 'onBlur' | 'onChange' | 'onFocus' | 'showTick' | 'type' | 'id' | 'children' | 'tooltip' | 'label' | 'data-testid'>> & {
246
246
  className?: string;
247
247
  };
248
- declare const SelectableCardField: <TFieldValues extends FieldValues>({ name, value, onChange, showTick, type, disabled, children, className, onFocus, onBlur, required, tooltip, id, label, rules, shouldUnregister, }: SelectableCardFieldProps<TFieldValues>) => _emotion_react_jsx_runtime.JSX.Element;
248
+ declare const SelectableCardField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, value, onChange, showTick, type, disabled, children, className, onFocus, onBlur, required, tooltip, id, label, rules, shouldUnregister, "data-testid": dataTestId, }: SelectableCardFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
249
249
 
250
- type NumberInputValueFieldProps<TFieldValues extends FieldValues> = BaseFieldProps<TFieldValues> & Partial<Pick<ComponentProps<typeof NumberInput>, 'disabled' | 'maxValue' | 'minValue' | 'onMaxCrossed' | 'onMinCrossed' | 'size' | 'step' | 'text' | 'className'>> & {
250
+ type NumberInputValueFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TName> & Partial<Pick<ComponentProps<typeof NumberInput>, 'disabled' | 'maxValue' | 'minValue' | 'onMaxCrossed' | 'onMinCrossed' | 'size' | 'step' | 'text' | 'className'>> & {
251
251
  onBlur?: FocusEventHandler<HTMLInputElement>;
252
252
  onFocus?: FocusEventHandler<HTMLInputElement>;
253
253
  };
254
- declare const NumberInputField: <TFieldValues extends FieldValues>({ disabled, maxValue, minValue, name, onChange, onBlur, onFocus, onMaxCrossed, onMinCrossed, required, size, step, text, rules, className, label, shouldUnregister, }: NumberInputValueFieldProps<TFieldValues>) => _emotion_react_jsx_runtime.JSX.Element;
254
+ declare const NumberInputField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ disabled, maxValue, minValue, name, onChange, onBlur, onFocus, onMaxCrossed, onMinCrossed, required, size, step, text, rules, className, label, shouldUnregister, }: NumberInputValueFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
255
255
 
256
256
  declare const SubmitErrorAlert: ({ className }: {
257
257
  className?: string | undefined;
258
258
  }) => _emotion_react_jsx_runtime.JSX.Element | null;
259
259
 
260
- type TagInputFieldProps<TFieldValues extends FieldValues = FieldValues> = BaseFieldProps<TFieldValues> & Partial<Pick<ComponentProps<typeof TagInput>, 'tags' | 'variant' | 'placeholder' | 'disabled' | 'className' | 'id'>>;
261
- declare const TagInputField: <TFieldValues extends FieldValues>({ className, disabled, id, name, onChange, placeholder, required, rules, variant, shouldUnregister, }: TagInputFieldProps<TFieldValues>) => _emotion_react_jsx_runtime.JSX.Element;
260
+ type TagInputFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TName> & Partial<Pick<ComponentProps<typeof TagInput>, 'tags' | 'variant' | 'placeholder' | 'disabled' | 'className' | 'id' | 'data-testid'>>;
261
+ declare const TagInputField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ className, disabled, id, name, onChange, placeholder, required, rules, variant, shouldUnregister, "data-testid": dataTestId, }: TagInputFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
262
262
 
263
- type TextInputFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TName> & Partial<Pick<ComponentProps<typeof TextInput>, 'autoCapitalize' | 'autoComplete' | 'autoCorrect' | 'autoFocus' | 'autoSave' | 'cols' | 'disabled' | 'fillAvailable' | 'generated' | 'id' | 'multiline' | 'notice' | 'onBlur' | 'onFocus' | 'onKeyDown' | 'onKeyUp' | 'placeholder' | 'random' | 'readOnly' | 'resizable' | 'rows' | 'type' | 'noTopLabel' | 'unit' | 'valid' | 'size' | 'maxLength' | 'minLength' | 'min' | 'max'>> & {
263
+ type TextInputFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TName> & Partial<Pick<ComponentProps<typeof TextInput>, 'autoCapitalize' | 'autoComplete' | 'autoCorrect' | 'autoFocus' | 'autoSave' | 'cols' | 'disabled' | 'fillAvailable' | 'generated' | 'id' | 'multiline' | 'notice' | 'onBlur' | 'onFocus' | 'onKeyDown' | 'onKeyUp' | 'placeholder' | 'random' | 'readOnly' | 'resizable' | 'rows' | 'type' | 'noTopLabel' | 'unit' | 'valid' | 'size' | 'maxLength' | 'minLength' | 'min' | 'max' | 'data-testid'>> & {
264
264
  className?: string;
265
265
  regex?: (RegExp | RegExp[])[];
266
266
  format?: (value: unknown) => PathValue<TFieldValues, Path<TFieldValues>>;
@@ -269,18 +269,18 @@ type TextInputFieldProps<TFieldValues extends FieldValues, TName extends FieldPa
269
269
  formatOnBlur?: boolean;
270
270
  innerRef?: Ref<HTMLInputElement>;
271
271
  };
272
- declare const TextInputField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ autoCapitalize, autoComplete, autoCorrect, autoFocus, autoSave, className, cols, disabled, fillAvailable, generated, id, label, multiline, name, noTopLabel, notice, onChange, onFocus, onKeyDown, onKeyUp, onBlur, placeholder, random, readOnly, required, resizable, rows, type, unit, size, rules, valid, parse, format, formatOnBlur, regex: regexes, min, max, minLength, maxLength, validate, defaultValue, customError, innerRef, shouldUnregister, }: TextInputFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
272
+ declare const TextInputField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ autoCapitalize, autoComplete, autoCorrect, autoFocus, autoSave, className, cols, disabled, fillAvailable, generated, id, label, multiline, name, noTopLabel, notice, onChange, onFocus, onKeyDown, onKeyUp, onBlur, placeholder, random, readOnly, required, resizable, rows, type, unit, size, rules, valid, parse, format, formatOnBlur, regex: regexes, min, max, minLength, maxLength, validate, defaultValue, customError, innerRef, shouldUnregister, "data-testid": dataTestId, }: TextInputFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
273
273
 
274
- type TimeFieldProps<TFieldValues extends FieldValues> = BaseFieldProps<TFieldValues> & Omit<ComponentProps<typeof TimeInput>, 'onChange'> & {
274
+ type TimeFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TName> & Omit<ComponentProps<typeof TimeInput>, 'onChange'> & {
275
275
  name: string;
276
276
  };
277
- declare const TimeField: <TFieldValues extends FieldValues>({ required, name, schedule, placeholder, disabled, readOnly, onBlur, onFocus, onChange, isLoading, isClearable, inputId, id, animation, animationDuration, animationOnChange, className, isSearchable, rules, options, "data-testid": dataTestId, shouldUnregister, }: TimeFieldProps<TFieldValues>) => _emotion_react_jsx_runtime.JSX.Element;
277
+ declare const TimeField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ required, name, schedule, placeholder, disabled, readOnly, onBlur, onFocus, onChange, isLoading, isClearable, inputId, id, animation, animationDuration, animationOnChange, className, isSearchable, rules, options, "data-testid": dataTestId, shouldUnregister, }: TimeFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
278
278
 
279
- type ToggleFieldProps<TFieldValues extends FieldValues> = Omit<BaseFieldProps<TFieldValues>, 'label'> & Pick<ComponentProps<typeof Toggle>, 'disabled' | 'label' | 'onChange' | 'size' | 'tooltip' | 'labelPosition' | 'className' | 'data-testid'> & {
279
+ type ToggleFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = Omit<BaseFieldProps<TFieldValues, TName>, 'label'> & Pick<ComponentProps<typeof Toggle>, 'disabled' | 'label' | 'onChange' | 'size' | 'tooltip' | 'labelPosition' | 'className' | 'data-testid'> & {
280
280
  parse?: (value: boolean) => any;
281
281
  format?: (value: any) => boolean;
282
282
  };
283
- declare const ToggleField: <TFieldValues extends FieldValues>({ className, disabled, label, name, onChange, required, size, tooltip, rules, labelPosition, parse, format, "data-testid": dataTestId, shouldUnregister, }: ToggleFieldProps<TFieldValues>) => _emotion_react_jsx_runtime.JSX.Element;
283
+ declare const ToggleField: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ className, disabled, label, name, onChange, required, size, tooltip, rules, labelPosition, parse, format, "data-testid": dataTestId, shouldUnregister, }: ToggleFieldProps<TFieldValues, TName>) => _emotion_react_jsx_runtime.JSX.Element;
284
284
 
285
285
  type SubmitProps = {
286
286
  children?: ReactNode;
@@ -297,11 +297,11 @@ type SubmitProps = {
297
297
  };
298
298
  declare const Submit: ({ children, className, disabled, icon, iconPosition, size, variant, sentiment, tooltip, fullWidth, onClick, }: SubmitProps) => _emotion_react_jsx_runtime.JSX.Element;
299
299
 
300
- type RadioGroupFieldProps<TFieldValues extends FieldValues> = BaseFieldProps<TFieldValues> & Partial<Pick<ComponentProps<typeof RadioGroup>, 'legend' | 'children' | 'error' | 'helper' | 'direction'>> & {
300
+ type RadioGroupFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TName> & Partial<Pick<ComponentProps<typeof RadioGroup>, 'legend' | 'children' | 'error' | 'helper' | 'direction'>> & {
301
301
  className?: string;
302
302
  };
303
303
  declare const RadioGroupField: {
304
- <TFieldValues extends FieldValues>({ className, legend, name, onChange, required, rules, children, label, error: customError, helper, direction, shouldUnregister, }: RadioGroupFieldProps<TFieldValues>): JSX.Element;
304
+ <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ className, legend, name, onChange, required, rules, children, label, error: customError, helper, direction, shouldUnregister, }: RadioGroupFieldProps<TFieldValues, TName>): JSX.Element;
305
305
  Radio: ({ onFocus, onBlur, disabled, error, name, value, label, helper, className, autoFocus, onKeyDown, "data-testid": dataTestId, }: {
306
306
  value: string | number;
307
307
  onBlur?: react.FocusEventHandler<HTMLInputElement> | undefined;
@@ -2,11 +2,10 @@ import { useCallback, useMemo, useContext, createContext } from 'react';
2
2
  import { jsx } from '@emotion/react/jsx-runtime';
3
3
 
4
4
  const ErrorContext = /*#__PURE__*/createContext(undefined);
5
- const ErrorProvider = _ref => {
6
- let {
7
- children,
8
- errors
9
- } = _ref;
5
+ const ErrorProvider = ({
6
+ children,
7
+ errors
8
+ }) => {
10
9
  const getError = useCallback((meta, error) => {
11
10
  if (!error) {
12
11
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/form",
3
- "version": "2.0.0-next.8",
3
+ "version": "2.0.0-next.9",
4
4
  "description": "Ultraviolet Form",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -39,21 +39,21 @@
39
39
  "react-hook-form": "7.47.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@babel/core": "7.23.5",
42
+ "@babel/core": "7.23.6",
43
43
  "@types/final-form-focus": "1.1.7",
44
- "@types/react": "18.2.43",
45
- "@types/react-dom": "18.2.17",
44
+ "@types/react": "18.2.45",
45
+ "@types/react-dom": "18.2.18",
46
46
  "react": "18.2.0",
47
47
  "react-dom": "18.2.0"
48
48
  },
49
49
  "dependencies": {
50
- "@babel/runtime": "7.23.5",
50
+ "@babel/runtime": "7.23.6",
51
51
  "@emotion/babel-plugin": "11.11.0",
52
52
  "@emotion/react": "11.11.1",
53
53
  "@emotion/styled": "11.11.0",
54
54
  "react-select": "5.8.0",
55
55
  "react-hook-form": "^7.47.0",
56
- "@ultraviolet/ui": "1.28.0"
56
+ "@ultraviolet/ui": "1.29.1"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "rollup -c ../../rollup.config.mjs"