optimized-react-component-library-xyz123 0.1.38 → 0.1.40

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
@@ -120,7 +120,14 @@ var PreviewRadio = ({ question }) => {
120
120
  const previewId = `preview-${question.id}`;
121
121
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
122
122
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
123
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: ((_b = question.answer) == null ? void 0 : _b.trim()) ? question.answer : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "no-answer-preview-page", children: "Inget svar" }) })
123
+ ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
124
+ "dd",
125
+ {
126
+ className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
127
+ id: `answer-${previewId}`,
128
+ children: "Inget svar"
129
+ }
130
+ )
124
131
  ] });
125
132
  };
126
133
 
@@ -158,7 +165,7 @@ var MultipleCheckboxes = ({
158
165
  };
159
166
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
160
167
  !showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { role: "group", "aria-labelledby": `label-${questionId}`, children: [
161
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("h4", { id: `label-${questionId}`, children: [
168
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("h3", { id: `label-${questionId}`, children: [
162
169
  question.questionLabel,
163
170
  " ",
164
171
  question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
@@ -195,13 +202,11 @@ var PrevieMultipleCheckboxes = ({
195
202
  const previewId = `preview-${question.id}`;
196
203
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
197
204
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
198
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("dd", { className: "pts-multipleCheckboxes-preview pts-root-answer", id: `answer-${previewId}`, children: [
199
- question.answer ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { "aria-labelledby": previewId, children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
200
- var _a2;
201
- return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
202
- }).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: option.label }, index)) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
203
- " "
204
- ] })
205
+ question.answer ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
206
+ var _a2;
207
+ return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
208
+ }).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { children: option.label }, index)) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
209
+ " "
205
210
  ] });
206
211
  };
207
212
 
@@ -252,7 +257,7 @@ var InputTextarea = ({
252
257
  "aria-required": question.isQuestionMandatory,
253
258
  "aria-invalid": question.hasValidationError,
254
259
  maxLength: ((_a = question.questionExtraAttribute) == null ? void 0 : _a.answerMaxLength) || defaultMaxLength,
255
- "aria-describedby": `${question.aboutText ? aboutId : ""} ${question.hasValidationError ? errorId : ""}`.trim(),
260
+ "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
256
261
  id: inputId
257
262
  }
258
263
  ),
@@ -290,7 +295,14 @@ var PreviewTextarea = ({
290
295
  const previewId = `preview-${question.id}`;
291
296
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
292
297
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
293
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { className: "pts-textArea-preview pts-root-answer", id: `answer-${previewId}`, children: ((_b = question.answer) == null ? void 0 : _b.trim()) ? question.answer : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }) })
298
+ ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { className: "pts-textArea-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
299
+ "dd",
300
+ {
301
+ className: "pts-textArea-preview pts-root-answer no-answer-preview-page",
302
+ id: `answer-${previewId}`,
303
+ children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
304
+ }
305
+ )
294
306
  ] });
295
307
  };
296
308
 
@@ -345,7 +357,7 @@ var TextFieldStandard = ({
345
357
  disabled: (_g = question.questionExtraAttribute) == null ? void 0 : _g.disabled,
346
358
  required: question.isQuestionMandatory,
347
359
  "aria-required": question.isQuestionMandatory,
348
- "aria-describedby": `${question.aboutText ? aboutId : ""} ${question.hasValidationError ? errorId : ""}`.trim(),
360
+ "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
349
361
  "aria-invalid": question.hasValidationError,
350
362
  "aria-errormessage": question.hasValidationError ? errorId : void 0
351
363
  }
@@ -369,7 +381,14 @@ var PreviewTextField = ({
369
381
  const previewId = `preview-${question.id}`;
370
382
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
371
383
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
372
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { className: "pts-textField-preview pts-root-answer", id: `answer-${previewId}`, children: ((_b = question.answer) == null ? void 0 : _b.trim()) ? question.answer : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }) })
384
+ ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { className: "pts-textField-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
385
+ "dd",
386
+ {
387
+ className: "pts-textField-preview pts-root-answer no-answer-preview-page",
388
+ id: `answer-${previewId}`,
389
+ children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
390
+ }
391
+ )
373
392
  ] });
374
393
  };
375
394
 
@@ -1222,7 +1241,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1222
1241
  }
1223
1242
  ),
1224
1243
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1225
- "div",
1244
+ "nav",
1226
1245
  {
1227
1246
  className: "pts-footer-linkList",
1228
1247
  "aria-label": activatedLanguage === "en" ? "Footer navigation" : "Sidfotsnavigering",
package/dist/index.mjs CHANGED
@@ -56,7 +56,14 @@ var PreviewRadio = ({ question }) => {
56
56
  const previewId = `preview-${question.id}`;
57
57
  return /* @__PURE__ */ jsxs(Fragment, { children: [
58
58
  /* @__PURE__ */ jsx("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
59
- /* @__PURE__ */ jsx("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: ((_b = question.answer) == null ? void 0 : _b.trim()) ? question.answer : /* @__PURE__ */ jsx("span", { className: "no-answer-preview-page", children: "Inget svar" }) })
59
+ ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx(
60
+ "dd",
61
+ {
62
+ className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
63
+ id: `answer-${previewId}`,
64
+ children: "Inget svar"
65
+ }
66
+ )
60
67
  ] });
61
68
  };
62
69
 
@@ -94,7 +101,7 @@ var MultipleCheckboxes = ({
94
101
  };
95
102
  return /* @__PURE__ */ jsxs2(Fragment2, { children: [
96
103
  !showPreview && question.visible && /* @__PURE__ */ jsx2("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ jsxs2("section", { role: "group", "aria-labelledby": `label-${questionId}`, children: [
97
- /* @__PURE__ */ jsxs2("h4", { id: `label-${questionId}`, children: [
104
+ /* @__PURE__ */ jsxs2("h3", { id: `label-${questionId}`, children: [
98
105
  question.questionLabel,
99
106
  " ",
100
107
  question.isQuestionMandatory && /* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
@@ -131,13 +138,11 @@ var PrevieMultipleCheckboxes = ({
131
138
  const previewId = `preview-${question.id}`;
132
139
  return /* @__PURE__ */ jsxs2(Fragment2, { children: [
133
140
  /* @__PURE__ */ jsx2("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
134
- /* @__PURE__ */ jsxs2("dd", { className: "pts-multipleCheckboxes-preview pts-root-answer", id: `answer-${previewId}`, children: [
135
- question.answer ? /* @__PURE__ */ jsx2("ul", { "aria-labelledby": previewId, children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
136
- var _a2;
137
- return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
138
- }).map((option, index) => /* @__PURE__ */ jsx2("li", { children: option.label }, index)) }) : /* @__PURE__ */ jsx2("span", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
139
- " "
140
- ] })
141
+ question.answer ? /* @__PURE__ */ jsx2(Fragment2, { children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
142
+ var _a2;
143
+ return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
144
+ }).map((option, index) => /* @__PURE__ */ jsx2("dd", { children: option.label }, index)) }) : /* @__PURE__ */ jsx2("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
145
+ " "
141
146
  ] });
142
147
  };
143
148
 
@@ -188,7 +193,7 @@ var InputTextarea = ({
188
193
  "aria-required": question.isQuestionMandatory,
189
194
  "aria-invalid": question.hasValidationError,
190
195
  maxLength: ((_a = question.questionExtraAttribute) == null ? void 0 : _a.answerMaxLength) || defaultMaxLength,
191
- "aria-describedby": `${question.aboutText ? aboutId : ""} ${question.hasValidationError ? errorId : ""}`.trim(),
196
+ "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
192
197
  id: inputId
193
198
  }
194
199
  ),
@@ -226,7 +231,14 @@ var PreviewTextarea = ({
226
231
  const previewId = `preview-${question.id}`;
227
232
  return /* @__PURE__ */ jsxs3(Fragment3, { children: [
228
233
  /* @__PURE__ */ jsx3("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
229
- /* @__PURE__ */ jsx3("dd", { className: "pts-textArea-preview pts-root-answer", id: `answer-${previewId}`, children: ((_b = question.answer) == null ? void 0 : _b.trim()) ? question.answer : /* @__PURE__ */ jsx3("span", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }) })
234
+ ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx3("dd", { className: "pts-textArea-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx3(
235
+ "dd",
236
+ {
237
+ className: "pts-textArea-preview pts-root-answer no-answer-preview-page",
238
+ id: `answer-${previewId}`,
239
+ children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
240
+ }
241
+ )
230
242
  ] });
231
243
  };
232
244
 
@@ -281,7 +293,7 @@ var TextFieldStandard = ({
281
293
  disabled: (_g = question.questionExtraAttribute) == null ? void 0 : _g.disabled,
282
294
  required: question.isQuestionMandatory,
283
295
  "aria-required": question.isQuestionMandatory,
284
- "aria-describedby": `${question.aboutText ? aboutId : ""} ${question.hasValidationError ? errorId : ""}`.trim(),
296
+ "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
285
297
  "aria-invalid": question.hasValidationError,
286
298
  "aria-errormessage": question.hasValidationError ? errorId : void 0
287
299
  }
@@ -305,7 +317,14 @@ var PreviewTextField = ({
305
317
  const previewId = `preview-${question.id}`;
306
318
  return /* @__PURE__ */ jsxs4(Fragment4, { children: [
307
319
  /* @__PURE__ */ jsx4("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
308
- /* @__PURE__ */ jsx4("dd", { className: "pts-textField-preview pts-root-answer", id: `answer-${previewId}`, children: ((_b = question.answer) == null ? void 0 : _b.trim()) ? question.answer : /* @__PURE__ */ jsx4("span", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }) })
320
+ ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx4("dd", { className: "pts-textField-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx4(
321
+ "dd",
322
+ {
323
+ className: "pts-textField-preview pts-root-answer no-answer-preview-page",
324
+ id: `answer-${previewId}`,
325
+ children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
326
+ }
327
+ )
309
328
  ] });
310
329
  };
311
330
 
@@ -1158,7 +1177,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1158
1177
  }
1159
1178
  ),
1160
1179
  /* @__PURE__ */ jsx9(
1161
- "div",
1180
+ "nav",
1162
1181
  {
1163
1182
  className: "pts-footer-linkList",
1164
1183
  "aria-label": activatedLanguage === "en" ? "Footer navigation" : "Sidfotsnavigering",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
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",