@ultraviolet/form 3.9.1 → 3.9.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.
@@ -31,7 +31,8 @@ const TextAreaField = ({
31
31
  tooltip,
32
32
  regex: regexes,
33
33
  submitOnEnter,
34
- validate
34
+ validate,
35
+ "aria-label": ariaLabel
35
36
  }) => {
36
37
  const {
37
38
  getError
@@ -78,14 +79,18 @@ const TextAreaField = ({
78
79
  regex: regexes,
79
80
  minLength,
80
81
  maxLength,
81
- label,
82
+ label: label ?? ariaLabel,
82
83
  value: field.value
83
- }, error), helper, label, labelDescription, minLength, maxLength, name, onBlur: (event) => {
84
+ }, error), helper, labelDescription, minLength, maxLength, name, onBlur: (event) => {
84
85
  onBlur?.(event);
85
86
  field.onBlur();
86
87
  }, onChange: (event) => {
87
88
  field.onChange(event);
88
89
  onChange?.(event);
89
- }, onFocus, onKeyDown: onKeyDownHandler, placeholder, readOnly, required, rows, success, tabIndex, tooltip, value: field.value });
90
+ }, onFocus, onKeyDown: onKeyDownHandler, placeholder, readOnly, required, rows, success, tabIndex, tooltip, value: field.value, ...label ? {
91
+ label
92
+ } : {
93
+ "aria-label": ariaLabel
94
+ } });
90
95
  };
91
96
  exports.TextAreaField = TextAreaField;
@@ -9,4 +9,4 @@ export type TextAreaFieldProps<TFieldValues extends FieldValues, TFieldName exte
9
9
  /**
10
10
  * This component offers a form field based on Ultraviolet UI TextArea component
11
11
  */
12
- export declare const TextAreaField: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ autoFocus, clearable, className, tabIndex, control, "data-testid": dataTestId, disabled, helper, label, labelDescription, onChange, minLength, maxLength, name, onFocus, onBlur, onKeyDown, placeholder, readOnly, required, rows, success, tooltip, regex: regexes, submitOnEnter, validate, }: TextAreaFieldProps<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
12
+ export declare const TextAreaField: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ autoFocus, clearable, className, tabIndex, control, "data-testid": dataTestId, disabled, helper, label, labelDescription, onChange, minLength, maxLength, name, onFocus, onBlur, onKeyDown, placeholder, readOnly, required, rows, success, tooltip, regex: regexes, submitOnEnter, validate, "aria-label": ariaLabel, }: TextAreaFieldProps<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -29,7 +29,8 @@ const TextAreaField = ({
29
29
  tooltip,
30
30
  regex: regexes,
31
31
  submitOnEnter,
32
- validate
32
+ validate,
33
+ "aria-label": ariaLabel
33
34
  }) => {
34
35
  const {
35
36
  getError
@@ -76,15 +77,19 @@ const TextAreaField = ({
76
77
  regex: regexes,
77
78
  minLength,
78
79
  maxLength,
79
- label,
80
+ label: label ?? ariaLabel,
80
81
  value: field.value
81
- }, error), helper, label, labelDescription, minLength, maxLength, name, onBlur: (event) => {
82
+ }, error), helper, labelDescription, minLength, maxLength, name, onBlur: (event) => {
82
83
  onBlur?.(event);
83
84
  field.onBlur();
84
85
  }, onChange: (event) => {
85
86
  field.onChange(event);
86
87
  onChange?.(event);
87
- }, onFocus, onKeyDown: onKeyDownHandler, placeholder, readOnly, required, rows, success, tabIndex, tooltip, value: field.value });
88
+ }, onFocus, onKeyDown: onKeyDownHandler, placeholder, readOnly, required, rows, success, tabIndex, tooltip, value: field.value, ...label ? {
89
+ label
90
+ } : {
91
+ "aria-label": ariaLabel
92
+ } });
88
93
  };
89
94
  export {
90
95
  TextAreaField
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/form",
3
- "version": "3.9.1",
3
+ "version": "3.9.2",
4
4
  "description": "Ultraviolet Form",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -61,7 +61,7 @@
61
61
  "@emotion/react": "11.13.3",
62
62
  "@emotion/styled": "11.13.0",
63
63
  "@types/final-form-focus": "1.1.7",
64
- "@types/react": "18.3.9",
64
+ "@types/react": "18.3.10",
65
65
  "@types/react-dom": "18.3.0",
66
66
  "react": "18.3.1",
67
67
  "react-dom": "18.3.1",
@@ -72,7 +72,7 @@
72
72
  "react-hook-form": "7.53.0",
73
73
  "react-select": "5.8.1",
74
74
  "@ultraviolet/themes": "1.14.2",
75
- "@ultraviolet/ui": "1.71.1"
75
+ "@ultraviolet/ui": "1.72.0"
76
76
  },
77
77
  "scripts": {
78
78
  "build:profile": "npx vite-bundle-visualizer -c vite.config.ts",