@ultraviolet/form 3.17.0 → 3.17.2

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.
@@ -7,42 +7,17 @@ const react = require("react");
7
7
  const reactHookForm = require("react-hook-form");
8
8
  const index = require("../../providers/ErrorContext/index.cjs");
9
9
  const SelectInputFieldV2 = ({
10
- autofocus,
11
- className,
12
- id,
13
10
  label = "",
14
- onFocus,
15
11
  onBlur,
16
- placeholder,
17
- readOnly,
18
12
  required,
19
- size,
20
- "data-testid": dataTestId,
21
- disabled,
22
- placeholderSearch,
23
- helper,
24
- options,
25
- emptyState,
26
- onChange,
27
- searchable,
28
- clearable,
29
- multiselect,
30
- descriptionDirection,
31
- footer,
32
- labelDescription,
33
- success,
34
- loadMore,
35
- isLoading,
36
- selectAll,
37
- selectAllGroup,
38
13
  name,
39
14
  "aria-label": ariaLabel,
40
- optionalInfoPlacement,
41
15
  shouldUnregister = false,
42
16
  control,
43
17
  validate,
44
- tooltip,
45
- dropdownAlign
18
+ onChange,
19
+ multiselect,
20
+ ...props
46
21
  }) => {
47
22
  const {
48
23
  field,
@@ -65,11 +40,11 @@ const SelectInputFieldV2 = ({
65
40
  onChange?.(value);
66
41
  field.onChange(value);
67
42
  }, [onChange, field]);
68
- return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectInputV2, { name: field.name, options, required, size, "data-testid": dataTestId, className, disabled, id, label, onFocus, onBlur: (event) => {
43
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectInputV2, { name: field.name, multiselect, required, onBlur: (event) => {
69
44
  field.onBlur();
70
45
  onBlur?.(event);
71
- }, placeholder, readOnly, multiselect, value: field.value, placeholderSearch, helper, emptyState, searchable, clearable, descriptionDirection, footer, labelDescription, error: getError({
46
+ }, value: field.value, error: getError({
72
47
  label: label ?? ariaLabel ?? name
73
- }, error), success, loadMore, isLoading, selectAll, selectAllGroup, autofocus, optionalInfoPlacement, "aria-label": ariaLabel, onChange: handleChange, tooltip, dropdownAlign });
48
+ }, error), label, "aria-label": ariaLabel, onChange: handleChange, ...props });
74
49
  };
75
50
  exports.SelectInputFieldV2 = SelectInputFieldV2;
@@ -2,6 +2,6 @@ import { SelectInputV2 } from '@ultraviolet/ui';
2
2
  import { type ComponentProps } from 'react';
3
3
  import type { FieldPath, FieldValues } from 'react-hook-form';
4
4
  import type { BaseFieldProps } from '../../types';
5
- type SelectInputFieldV2Props<TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TFieldName> & Pick<ComponentProps<typeof SelectInputV2>, 'placeholder' | 'placeholderSearch' | 'label' | 'helper' | 'options' | 'emptyState' | 'searchable' | 'readOnly' | 'clearable' | 'size' | 'multiselect' | 'required' | 'descriptionDirection' | 'footer' | 'labelDescription' | 'success' | 'loadMore' | 'isLoading' | 'selectAll' | 'selectAllGroup' | 'autofocus' | 'data-testid' | 'id' | 'onBlur' | 'aria-label' | 'className' | 'onFocus' | 'optionalInfoPlacement' | 'disabled' | 'tooltip' | 'dropdownAlign'>;
6
- export declare const SelectInputFieldV2: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ autofocus, className, id, label, onFocus, onBlur, placeholder, readOnly, required, size, "data-testid": dataTestId, disabled, placeholderSearch, helper, options, emptyState, onChange, searchable, clearable, multiselect, descriptionDirection, footer, labelDescription, success, loadMore, isLoading, selectAll, selectAllGroup, name, "aria-label": ariaLabel, optionalInfoPlacement, shouldUnregister, control, validate, tooltip, dropdownAlign, }: SelectInputFieldV2Props<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
5
+ type SelectInputFieldV2Props<TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TFieldName> & Omit<ComponentProps<typeof SelectInputV2>, 'value' | 'onChange'>;
6
+ export declare const SelectInputFieldV2: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, onBlur, required, name, "aria-label": ariaLabel, shouldUnregister, control, validate, onChange, multiselect, ...props }: SelectInputFieldV2Props<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -5,42 +5,17 @@ import { useCallback } from "react";
5
5
  import { useController } from "react-hook-form";
6
6
  import { useErrors } from "../../providers/ErrorContext/index.js";
7
7
  const SelectInputFieldV2 = ({
8
- autofocus,
9
- className,
10
- id,
11
8
  label = "",
12
- onFocus,
13
9
  onBlur,
14
- placeholder,
15
- readOnly,
16
10
  required,
17
- size,
18
- "data-testid": dataTestId,
19
- disabled,
20
- placeholderSearch,
21
- helper,
22
- options,
23
- emptyState,
24
- onChange,
25
- searchable,
26
- clearable,
27
- multiselect,
28
- descriptionDirection,
29
- footer,
30
- labelDescription,
31
- success,
32
- loadMore,
33
- isLoading,
34
- selectAll,
35
- selectAllGroup,
36
11
  name,
37
12
  "aria-label": ariaLabel,
38
- optionalInfoPlacement,
39
13
  shouldUnregister = false,
40
14
  control,
41
15
  validate,
42
- tooltip,
43
- dropdownAlign
16
+ onChange,
17
+ multiselect,
18
+ ...props
44
19
  }) => {
45
20
  const {
46
21
  field,
@@ -63,12 +38,12 @@ const SelectInputFieldV2 = ({
63
38
  onChange?.(value);
64
39
  field.onChange(value);
65
40
  }, [onChange, field]);
66
- return /* @__PURE__ */ jsx(SelectInputV2, { name: field.name, options, required, size, "data-testid": dataTestId, className, disabled, id, label, onFocus, onBlur: (event) => {
41
+ return /* @__PURE__ */ jsx(SelectInputV2, { name: field.name, multiselect, required, onBlur: (event) => {
67
42
  field.onBlur();
68
43
  onBlur?.(event);
69
- }, placeholder, readOnly, multiselect, value: field.value, placeholderSearch, helper, emptyState, searchable, clearable, descriptionDirection, footer, labelDescription, error: getError({
44
+ }, value: field.value, error: getError({
70
45
  label: label ?? ariaLabel ?? name
71
- }, error), success, loadMore, isLoading, selectAll, selectAllGroup, autofocus, optionalInfoPlacement, "aria-label": ariaLabel, onChange: handleChange, tooltip, dropdownAlign });
46
+ }, error), label, "aria-label": ariaLabel, onChange: handleChange, ...props });
72
47
  };
73
48
  export {
74
49
  SelectInputFieldV2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/form",
3
- "version": "3.17.0",
3
+ "version": "3.17.2",
4
4
  "description": "Ultraviolet Form",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -72,7 +72,7 @@
72
72
  "react-hook-form": "7.55.0",
73
73
  "react-select": "5.10.0",
74
74
  "@ultraviolet/themes": "1.17.0",
75
- "@ultraviolet/ui": "1.94.0"
75
+ "@ultraviolet/ui": "1.94.2"
76
76
  },
77
77
  "scripts": {
78
78
  "build:profile": "npx vite-bundle-visualizer -c vite.config.ts",