optimized-react-component-library-xyz123 0.1.24 → 0.1.26

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
@@ -924,10 +924,13 @@ function groupQuestionsByStepCategoryGroup(questions, steps, validationErrorsLis
924
924
  questionGroups.push({
925
925
  questionGroupId: groupId,
926
926
  questionGroupType: questions2[0].questionGroupType,
927
- questions: questions2
927
+ questions: questions2,
928
+ legend: questions2[0].categoryDescription
928
929
  });
929
930
  }
930
- const isVisible = questionGroups.some((group) => group.questions.some((question) => question.visible));
931
+ const isVisible = questionGroups.some(
932
+ (group) => group.questions.some((question) => question.visible)
933
+ );
931
934
  categories.push({
932
935
  category,
933
936
  visible: isVisible,
@@ -1038,10 +1041,31 @@ var RenderQuestionGroup = ({
1038
1041
  }) });
1039
1042
  switch (wrapper) {
1040
1043
  case "fieldset":
1041
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { className: "pts-root-question-group-fieldset", children: [
1042
- legend && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("legend", { children: legend }),
1043
- questions
1044
- ] });
1044
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1045
+ "fieldset",
1046
+ {
1047
+ className: "pts-root-question-group-fieldset",
1048
+ "aria-required": questionArray[0].isQuestionMandatory,
1049
+ "aria-invalid": questionArray[0].hasValidationError,
1050
+ "aria-errormessage": questionArray[0].validationDefaultMessesege + "-error",
1051
+ "aria-describedby": questionArray[0].validationDefaultMessesege + "-error",
1052
+ children: [
1053
+ legend && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("legend", { children: legend }),
1054
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1055
+ "div",
1056
+ {
1057
+ className: "pts-root-error",
1058
+ id: questionArray[0].validationDefaultMessesege + "-error",
1059
+ children: questionArray[0].hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1060
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
1061
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { "aria-label": "Felmeddelande.", className: "errorText", children: questionArray[0].validationDefaultMessesege })
1062
+ ] })
1063
+ }
1064
+ ),
1065
+ questions
1066
+ ]
1067
+ }
1068
+ );
1045
1069
  case "section":
1046
1070
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("section", { className: "pts-root-question-group-section", children: questions });
1047
1071
  case "div":
package/dist/index.mjs CHANGED
@@ -860,10 +860,13 @@ function groupQuestionsByStepCategoryGroup(questions, steps, validationErrorsLis
860
860
  questionGroups.push({
861
861
  questionGroupId: groupId,
862
862
  questionGroupType: questions2[0].questionGroupType,
863
- questions: questions2
863
+ questions: questions2,
864
+ legend: questions2[0].categoryDescription
864
865
  });
865
866
  }
866
- const isVisible = questionGroups.some((group) => group.questions.some((question) => question.visible));
867
+ const isVisible = questionGroups.some(
868
+ (group) => group.questions.some((question) => question.visible)
869
+ );
867
870
  categories.push({
868
871
  category,
869
872
  visible: isVisible,
@@ -974,10 +977,31 @@ var RenderQuestionGroup = ({
974
977
  }) });
975
978
  switch (wrapper) {
976
979
  case "fieldset":
977
- return /* @__PURE__ */ jsxs7("fieldset", { className: "pts-root-question-group-fieldset", children: [
978
- legend && /* @__PURE__ */ jsx7("legend", { children: legend }),
979
- questions
980
- ] });
980
+ return /* @__PURE__ */ jsxs7(
981
+ "fieldset",
982
+ {
983
+ className: "pts-root-question-group-fieldset",
984
+ "aria-required": questionArray[0].isQuestionMandatory,
985
+ "aria-invalid": questionArray[0].hasValidationError,
986
+ "aria-errormessage": questionArray[0].validationDefaultMessesege + "-error",
987
+ "aria-describedby": questionArray[0].validationDefaultMessesege + "-error",
988
+ children: [
989
+ legend && /* @__PURE__ */ jsx7("legend", { children: legend }),
990
+ /* @__PURE__ */ jsx7(
991
+ "div",
992
+ {
993
+ className: "pts-root-error",
994
+ id: questionArray[0].validationDefaultMessesege + "-error",
995
+ children: questionArray[0].hasValidationError && /* @__PURE__ */ jsxs7(Fragment7, { children: [
996
+ /* @__PURE__ */ jsx7("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
997
+ /* @__PURE__ */ jsx7("span", { "aria-label": "Felmeddelande.", className: "errorText", children: questionArray[0].validationDefaultMessesege })
998
+ ] })
999
+ }
1000
+ ),
1001
+ questions
1002
+ ]
1003
+ }
1004
+ );
981
1005
  case "section":
982
1006
  return /* @__PURE__ */ jsx7("section", { className: "pts-root-question-group-section", children: questions });
983
1007
  case "div":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
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",