optimized-react-component-library-xyz123 0.1.54 → 0.1.56

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/index.js CHANGED
@@ -78,8 +78,8 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
78
78
  !showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
79
79
  "fieldset",
80
80
  {
81
+ "aria-required": question.isQuestionMandatory,
81
82
  "aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
82
- "aria-describedby": question.hasValidationError ? errorId : void 0,
83
83
  "aria-errormessage": question.hasValidationError ? errorId : void 0,
84
84
  children: [
85
85
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("legend", { id: `label-${groupId}`, children: [
@@ -96,16 +96,15 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
96
96
  id: `${groupId}-option-${index}`,
97
97
  value: option.value,
98
98
  checked: question.answer === option.value,
99
- onChange: handleInputChange,
100
- required: question.isQuestionMandatory
101
- },
102
- index
99
+ onChange: handleInputChange
100
+ }
103
101
  ),
104
102
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: `${groupId}-option-${index}`, children: option.label }),
105
103
  " "
106
104
  ] }, index)),
107
105
  question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
108
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
106
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
107
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
109
108
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
110
109
  ] })
111
110
  ]
@@ -357,7 +356,7 @@ var TextFieldStandard = ({
357
356
  disabled: (_i = question.questionExtraAttribute) == null ? void 0 : _i.disabled,
358
357
  required: question.isQuestionMandatory,
359
358
  "aria-required": question.isQuestionMandatory,
360
- "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
359
+ "aria-describedby": [question.aboutText ? aboutId : null].filter(Boolean).join(" ") || void 0,
361
360
  "aria-invalid": question.hasValidationError,
362
361
  "aria-errormessage": question.hasValidationError ? errorId : void 0,
363
362
  spellCheck: (_k = (_j = question.questionExtraAttribute) == null ? void 0 : _j.spellCheck) != null ? _k : void 0,
@@ -365,7 +364,8 @@ var TextFieldStandard = ({
365
364
  }
366
365
  ),
367
366
  question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
368
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
367
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
368
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
369
369
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
370
370
  ] })
371
371
  ]
package/dist/index.mjs CHANGED
@@ -13,8 +13,8 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
13
13
  !showPreview && question.visible && /* @__PURE__ */ jsx("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: /* @__PURE__ */ jsxs(
14
14
  "fieldset",
15
15
  {
16
+ "aria-required": question.isQuestionMandatory,
16
17
  "aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
17
- "aria-describedby": question.hasValidationError ? errorId : void 0,
18
18
  "aria-errormessage": question.hasValidationError ? errorId : void 0,
19
19
  children: [
20
20
  /* @__PURE__ */ jsxs("legend", { id: `label-${groupId}`, children: [
@@ -31,16 +31,15 @@ var InputRadio = ({ question, isTouched, showPreview = false }) => {
31
31
  id: `${groupId}-option-${index}`,
32
32
  value: option.value,
33
33
  checked: question.answer === option.value,
34
- onChange: handleInputChange,
35
- required: question.isQuestionMandatory
36
- },
37
- index
34
+ onChange: handleInputChange
35
+ }
38
36
  ),
39
37
  /* @__PURE__ */ jsx("label", { htmlFor: `${groupId}-option-${index}`, children: option.label }),
40
38
  " "
41
39
  ] }, index)),
42
40
  question.hasValidationError && /* @__PURE__ */ jsxs("div", { className: "pts-root-error", id: errorId, children: [
43
- /* @__PURE__ */ jsx("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
41
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
42
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Valideringsfel" }),
44
43
  /* @__PURE__ */ jsx("span", { className: "errorText", children: question.validationDefaultMessesege })
45
44
  ] })
46
45
  ]
@@ -292,7 +291,7 @@ var TextFieldStandard = ({
292
291
  disabled: (_i = question.questionExtraAttribute) == null ? void 0 : _i.disabled,
293
292
  required: question.isQuestionMandatory,
294
293
  "aria-required": question.isQuestionMandatory,
295
- "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
294
+ "aria-describedby": [question.aboutText ? aboutId : null].filter(Boolean).join(" ") || void 0,
296
295
  "aria-invalid": question.hasValidationError,
297
296
  "aria-errormessage": question.hasValidationError ? errorId : void 0,
298
297
  spellCheck: (_k = (_j = question.questionExtraAttribute) == null ? void 0 : _j.spellCheck) != null ? _k : void 0,
@@ -300,7 +299,8 @@ var TextFieldStandard = ({
300
299
  }
301
300
  ),
302
301
  question.hasValidationError && /* @__PURE__ */ jsxs4("div", { className: "pts-root-error", id: errorId, children: [
303
- /* @__PURE__ */ jsx4("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
302
+ /* @__PURE__ */ jsx4("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
303
+ /* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Valideringsfel" }),
304
304
  /* @__PURE__ */ jsx4("span", { className: "errorText", children: question.validationDefaultMessesege })
305
305
  ] })
306
306
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.54",
3
+ "version": "0.1.56",
4
4
  "description": "A modern React component library using TypeScript with React 19 support.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",