@ttoss/forms 0.18.7 → 0.18.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.
package/dist/esm/index.js CHANGED
@@ -263,8 +263,7 @@ var FormFieldInput = ({
263
263
  return /* @__PURE__ */jsx5(Input, {
264
264
  ...inputProps,
265
265
  ...field,
266
- "aria-invalid": hasError.valueOf(),
267
- trailingIcon: hasError ? "warning-alt" : void 0
266
+ "aria-invalid": hasError.valueOf()
268
267
  });
269
268
  }
270
269
  });
@@ -414,7 +413,8 @@ var FormFieldSelect = ({
414
413
  sx,
415
414
  defaultValue: checkedDefaultValue,
416
415
  render: ({
417
- field
416
+ field,
417
+ fieldState
418
418
  }) => {
419
419
  return /* @__PURE__ */jsx8(Select, {
420
420
  ...selectProps,
@@ -423,6 +423,7 @@ var FormFieldSelect = ({
423
423
  ...selectProps,
424
424
  defaultValue: void 0
425
425
  },
426
+ "aria-invalid": fieldState.error ? "true" : void 0,
426
427
  children: options.map(option => {
427
428
  return /* @__PURE__ */jsx8("option", {
428
429
  value: option.value,
package/dist/index.js CHANGED
@@ -299,8 +299,7 @@ var FormFieldInput = ({
299
299
  return /* @__PURE__ */(0, import_jsx_runtime5.jsx)(import_ui5.Input, {
300
300
  ...inputProps,
301
301
  ...field,
302
- "aria-invalid": hasError.valueOf(),
303
- trailingIcon: hasError ? "warning-alt" : void 0
302
+ "aria-invalid": hasError.valueOf()
304
303
  });
305
304
  }
306
305
  });
@@ -450,7 +449,8 @@ var FormFieldSelect = ({
450
449
  sx,
451
450
  defaultValue: checkedDefaultValue,
452
451
  render: ({
453
- field
452
+ field,
453
+ fieldState
454
454
  }) => {
455
455
  return /* @__PURE__ */(0, import_jsx_runtime8.jsx)(import_ui8.Select, {
456
456
  ...selectProps,
@@ -459,6 +459,7 @@ var FormFieldSelect = ({
459
459
  ...selectProps,
460
460
  defaultValue: void 0
461
461
  },
462
+ "aria-invalid": fieldState.error ? "true" : void 0,
462
463
  children: options.map(option => {
463
464
  return /* @__PURE__ */(0, import_jsx_runtime8.jsx)("option", {
464
465
  value: option.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/forms",
3
- "version": "0.18.7",
3
+ "version": "0.18.9",
4
4
  "license": "UNLICENSED",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -28,7 +28,7 @@
28
28
  "peerDependencies": {
29
29
  "react": ">=16.8.0",
30
30
  "@ttoss/react-i18n": "^1.23.5",
31
- "@ttoss/ui": "^2.0.1"
31
+ "@ttoss/ui": "^2.0.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/jest": "^29.5.2",
@@ -44,7 +44,7 @@
44
44
  "@ttoss/i18n-cli": "^0.6.3",
45
45
  "@ttoss/react-i18n": "^1.23.5",
46
46
  "@ttoss/test-utils": "^1.23.5",
47
- "@ttoss/ui": "^2.0.1"
47
+ "@ttoss/ui": "^2.0.2"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public",
@@ -33,12 +33,7 @@ export const FormFieldInput = <
33
33
  const hasError = !!formState.errors[name]?.message;
34
34
 
35
35
  return (
36
- <Input
37
- {...inputProps}
38
- {...field}
39
- aria-invalid={hasError.valueOf()}
40
- trailingIcon={hasError ? 'warning-alt' : undefined}
41
- />
36
+ <Input {...inputProps} {...field} aria-invalid={hasError.valueOf()} />
42
37
  );
43
38
  }}
44
39
  />
@@ -89,12 +89,13 @@ export const FormFieldSelect = <
89
89
  onTooltipClick={selectProps.onTooltipClick}
90
90
  sx={sx}
91
91
  defaultValue={checkedDefaultValue}
92
- render={({ field }) => {
92
+ render={({ field, fieldState }) => {
93
93
  return (
94
94
  <Select
95
95
  {...selectProps}
96
96
  {...field}
97
97
  {...{ ...selectProps, defaultValue: undefined }}
98
+ aria-invalid={fieldState.error ? 'true' : undefined}
98
99
  >
99
100
  {options.map((option: FormRadioOption) => {
100
101
  return (