optimized-react-component-library-xyz123 0.1.46 → 0.1.47

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.d.mts CHANGED
@@ -222,7 +222,7 @@ declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPre
222
222
  declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
223
223
 
224
224
  interface EditPreviewLinkProps {
225
- step: number;
225
+ step: IStepObject;
226
226
  changeStepHandler: any;
227
227
  activatedLanguage?: string;
228
228
  }
package/dist/index.d.ts CHANGED
@@ -222,7 +222,7 @@ declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPre
222
222
  declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
223
223
 
224
224
  interface EditPreviewLinkProps {
225
- step: number;
225
+ step: IStepObject;
226
226
  changeStepHandler: any;
227
227
  activatedLanguage?: string;
228
228
  }
package/dist/index.js CHANGED
@@ -119,10 +119,17 @@ var RadioMultipleStandard_default = InputRadio;
119
119
  var PreviewRadio = ({ question }) => {
120
120
  var _a, _b;
121
121
  const previewId = `preview-${question.id}`;
122
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pts-question-preview pts-radioMultiple-preview", id: `question-${previewId}`, children: [
123
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { id: previewId, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
124
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pts-root-answer", "aria-labelledby": 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" }) })
125
- ] }) });
122
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
123
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
124
+ ((_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)(
125
+ "dd",
126
+ {
127
+ className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
128
+ id: `answer-${previewId}`,
129
+ children: "Inget svar"
130
+ }
131
+ )
132
+ ] });
126
133
  };
127
134
 
128
135
  // src/NewInputComponentStandard/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
@@ -159,7 +166,7 @@ var MultipleCheckboxes = ({
159
166
  };
160
167
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
161
168
  !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: [
162
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("h4", { id: `label-${questionId}`, children: [
169
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("h3", { id: `label-${questionId}`, children: [
163
170
  question.questionLabel,
164
171
  " ",
165
172
  question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
@@ -194,20 +201,14 @@ var PrevieMultipleCheckboxes = ({
194
201
  }) => {
195
202
  var _a, _b;
196
203
  const previewId = `preview-${question.id}`;
197
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
198
- "div",
199
- {
200
- className: "pts-question-preview pts-multipleCheckboxes-preview",
201
- id: `question-${previewId}`,
202
- children: [
203
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { id: previewId, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
204
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "pts-root-answer", children: question.answer ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { "aria-labelledby": previewId, children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
205
- var _a2;
206
- return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
207
- }).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" }) })
208
- ]
209
- }
210
- ) });
204
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
205
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
206
+ question.answer ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
207
+ var _a2;
208
+ return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
209
+ }).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" }),
210
+ " "
211
+ ] });
211
212
  };
212
213
 
213
214
  // src/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.tsx
@@ -257,7 +258,7 @@ var InputTextarea = ({
257
258
  "aria-required": question.isQuestionMandatory,
258
259
  "aria-invalid": question.hasValidationError,
259
260
  maxLength: ((_a = question.questionExtraAttribute) == null ? void 0 : _a.answerMaxLength) || defaultMaxLength,
260
- "aria-describedby": `${question.aboutText ? aboutId : ""} ${question.hasValidationError ? errorId : ""}`.trim(),
261
+ "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
261
262
  id: inputId
262
263
  }
263
264
  ),
@@ -293,10 +294,17 @@ var PreviewTextarea = ({
293
294
  }) => {
294
295
  var _a, _b;
295
296
  const previewId = `preview-${question.id}`;
296
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "pts-question-preview pts-textArea-preview", id: `question-${previewId}`, children: [
297
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h3", { id: previewId, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
298
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "pts-root-answer", "aria-labelledby": 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" }) })
299
- ] }) });
297
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
298
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
299
+ ((_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)(
300
+ "dd",
301
+ {
302
+ className: "pts-textArea-preview pts-root-answer no-answer-preview-page",
303
+ id: `answer-${previewId}`,
304
+ children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
305
+ }
306
+ )
307
+ ] });
300
308
  };
301
309
 
302
310
  // src/NewInputComponentStandard/TextFieldStandard/TextFieldStandard.tsx
@@ -350,7 +358,7 @@ var TextFieldStandard = ({
350
358
  disabled: (_g = question.questionExtraAttribute) == null ? void 0 : _g.disabled,
351
359
  required: question.isQuestionMandatory,
352
360
  "aria-required": question.isQuestionMandatory,
353
- "aria-describedby": `${question.aboutText ? aboutId : ""} ${question.hasValidationError ? errorId : ""}`.trim(),
361
+ "aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
354
362
  "aria-invalid": question.hasValidationError,
355
363
  "aria-errormessage": question.hasValidationError ? errorId : void 0
356
364
  }
@@ -372,10 +380,17 @@ var PreviewTextField = ({
372
380
  }) => {
373
381
  var _a, _b;
374
382
  const previewId = `preview-${question.id}`;
375
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "pts-question-preview pts-textField-preview", id: `question-${previewId}`, children: [
376
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { id: previewId, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
377
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "pts-root-answer", "aria-labelledby": 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" }) })
378
- ] }) });
383
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
384
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
385
+ ((_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)(
386
+ "dd",
387
+ {
388
+ className: "pts-textField-preview pts-root-answer no-answer-preview-page",
389
+ id: `answer-${previewId}`,
390
+ children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
391
+ }
392
+ )
393
+ ] });
379
394
  };
380
395
 
381
396
  // src/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.tsx
@@ -1836,7 +1851,7 @@ var EditPreviewLink = ({
1836
1851
  changeStepHandler,
1837
1852
  activatedLanguage = "sv"
1838
1853
  }) => {
1839
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", onClick: () => changeStepHandler(step), role: "link", children: [
1854
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { onClick: () => changeStepHandler(step), children: [
1840
1855
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1841
1856
  "svg",
1842
1857
  {
@@ -1858,7 +1873,7 @@ var EditPreviewLink = ({
1858
1873
  )
1859
1874
  }
1860
1875
  ),
1861
- activatedLanguage === "en" ? `Edit step ${step}` : `Redigera steg ${step}`
1876
+ activatedLanguage === "en" ? `Edit step ${step.step}` : `Redigera steg ${step.step}`
1862
1877
  ] }) });
1863
1878
  };
1864
1879
  var EditPreviewLinkStandard_default = EditPreviewLink;
@@ -1897,7 +1912,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1897
1912
  }
1898
1913
  ),
1899
1914
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1900
- "div",
1915
+ "nav",
1901
1916
  {
1902
1917
  className: "pts-footer-linkList",
1903
1918
  "aria-label": activatedLanguage === "en" ? "Footer navigation" : "Sidfotsnavigering",
@@ -2459,40 +2474,77 @@ var import_react10 = require("react");
2459
2474
  var import_dompurify5 = __toESM(require("dompurify"));
2460
2475
  var import_jsx_runtime20 = require("react/jsx-runtime");
2461
2476
  var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
2462
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "pts-textHeadlineAndBody-container", children: [
2463
- data.headline && (0, import_react10.createElement)(headlineType, {}, data.headline),
2464
- data.body && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify5.default.sanitize(data.body) } }),
2465
- data.linksForMoreInfo && data.linksForMoreInfo.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2466
- "a",
2467
- {
2468
- href: link.url,
2469
- target: "_blank",
2470
- rel: "noopener noreferrer",
2471
- "aria-label": link.ariaLabel,
2472
- children: [
2473
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2474
- "svg",
2475
- {
2476
- "aria-hidden": "true",
2477
- xmlns: "http://www.w3.org/2000/svg",
2478
- width: "12",
2479
- height: "10",
2480
- viewBox: "0 0 12 10",
2481
- fill: "none",
2482
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2483
- "path",
2477
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2478
+ "section",
2479
+ {
2480
+ className: "pts-textHeadlineAndBody-container",
2481
+ "aria-labelledby": "textHeadlineAndBody-headline",
2482
+ children: [
2483
+ data.headline && (0, import_react10.createElement)(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
2484
+ data.body && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify5.default.sanitize(data.body) } }),
2485
+ data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2486
+ "a",
2487
+ {
2488
+ href: link.url,
2489
+ target: "_blank",
2490
+ rel: "noopener noreferrer",
2491
+ "aria-label": link.ariaLabel,
2492
+ children: [
2493
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2494
+ "svg",
2484
2495
  {
2485
- d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
2486
- fill: "#ffffff"
2496
+ "aria-hidden": "true",
2497
+ xmlns: "http://www.w3.org/2000/svg",
2498
+ width: "12",
2499
+ height: "10",
2500
+ viewBox: "0 0 12 10",
2501
+ fill: "none",
2502
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2503
+ "path",
2504
+ {
2505
+ d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
2506
+ fill: "#ffffff"
2507
+ }
2508
+ )
2487
2509
  }
2488
- )
2489
- }
2490
- ) }),
2491
- link.title
2492
- ]
2493
- }
2494
- ) }, `more-info-${index}`)) })
2495
- ] });
2510
+ ) }),
2511
+ link.title
2512
+ ]
2513
+ }
2514
+ ) }, `more-info-${index}`)) }),
2515
+ data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2516
+ "a",
2517
+ {
2518
+ href: data.linksForMoreInfo[0].url,
2519
+ target: "_blank",
2520
+ rel: "noopener noreferrer",
2521
+ "aria-label": data.linksForMoreInfo[0].ariaLabel,
2522
+ children: [
2523
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2524
+ "svg",
2525
+ {
2526
+ "aria-hidden": "true",
2527
+ xmlns: "http://www.w3.org/2000/svg",
2528
+ width: "12",
2529
+ height: "10",
2530
+ viewBox: "0 0 12 10",
2531
+ fill: "none",
2532
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2533
+ "path",
2534
+ {
2535
+ d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
2536
+ fill: "#ffffff"
2537
+ }
2538
+ )
2539
+ }
2540
+ ) }),
2541
+ data.linksForMoreInfo[0].title
2542
+ ]
2543
+ }
2544
+ )
2545
+ ]
2546
+ }
2547
+ );
2496
2548
  };
2497
2549
  var TextHeadlineAndBodyStandard_default = TextHeadlineAndBody;
2498
2550
 
@@ -2557,7 +2609,7 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
2557
2609
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "pts-serviceHeadlineAndBody-container", children: [
2558
2610
  data.mainHeadline && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { id: "pts-main-service-headline", children: data.mainHeadline }),
2559
2611
  activeStep === 1 && data.ingressBody && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify6.default.sanitize(data.ingressBody) } }),
2560
- activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((moreInfo, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("a", { href: moreInfo.url, target: "_blank", rel: "noopener noreferrer", children: [
2612
+ activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((moreInfo, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("a", { href: moreInfo.url, target: "_blank", rel: "noopener noreferrer", children: [
2561
2613
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2562
2614
  "svg",
2563
2615
  {
@@ -2577,7 +2629,28 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
2577
2629
  }
2578
2630
  ),
2579
2631
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "pts-moreinfo-link-text", children: moreInfo.title })
2580
- ] }) }, moreInfo.title + index)) })
2632
+ ] }) }, moreInfo.title + index)) }),
2633
+ activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("a", { href: data.linksForMoreInfo[0].url, target: "_blank", rel: "noopener noreferrer", children: [
2634
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2635
+ "svg",
2636
+ {
2637
+ xmlns: "http://www.w3.org/2000/svg",
2638
+ width: "12",
2639
+ height: "10",
2640
+ viewBox: "0 0 12 10",
2641
+ fill: "none",
2642
+ "aria-hidden": "true",
2643
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2644
+ "path",
2645
+ {
2646
+ d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
2647
+ fill: "#ffffff"
2648
+ }
2649
+ )
2650
+ }
2651
+ ),
2652
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "pts-moreinfo-link-text", children: data.linksForMoreInfo[0].title })
2653
+ ] })
2581
2654
  ] });
2582
2655
  };
2583
2656
  var ServiceHeadlineAndBodyStandard_default = ServiceHeadlineAndBody;
@@ -2679,6 +2752,24 @@ var ValidationErrorSummaryList = ({
2679
2752
  }) => {
2680
2753
  console.log(formQuestions);
2681
2754
  console.log(validationErrorsList);
2755
+ function filterIdsByGroupCheck(ids, questions) {
2756
+ var _a;
2757
+ const tailIds = /* @__PURE__ */ new Set();
2758
+ for (const q of questions) {
2759
+ const rules = (_a = q.validationType) != null ? _a : [];
2760
+ for (const rule of rules) {
2761
+ const m = /^groupCheck-(\d+(?:-\d+)*)$/.exec(rule.trim());
2762
+ if (!m) continue;
2763
+ const nums = m[1].split("-").map((s) => Number(s)).filter((n) => Number.isFinite(n));
2764
+ if (nums.length > 1) {
2765
+ for (let i = 1; i < nums.length; i++) {
2766
+ tailIds.add(nums[i]);
2767
+ }
2768
+ }
2769
+ }
2770
+ }
2771
+ return ids.filter((id) => !tailIds.has(id));
2772
+ }
2682
2773
  function scrollToQuestion(questionId) {
2683
2774
  const container = document.getElementById(`question-${questionId}`);
2684
2775
  if (container) {
@@ -2692,35 +2783,31 @@ var ValidationErrorSummaryList = ({
2692
2783
  }
2693
2784
  }
2694
2785
  if (!validationErrorsList.length) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, {});
2695
- const count = validationErrorsList.length;
2786
+ const filteredIds = filterIdsByGroupCheck(validationErrorsList, formQuestions);
2787
+ const count = filteredIds.length;
2696
2788
  const title = summaryText.replace("{count}", count.toString()).replace("{plural}", count === 1 ? "sak" : "saker");
2697
2789
  function getQuestionLabelById(id) {
2698
2790
  const found = formQuestions.find((item) => item.id === id);
2699
2791
  return found == null ? void 0 : found.questionLabel;
2700
2792
  }
2701
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2702
- "div",
2703
- {
2704
- id: "pts-form-id-error-summary",
2705
- className: "pts-errorSummary-container pts-root-error",
2706
- tabIndex: -1,
2707
- children: [
2708
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
2709
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "errorSummary-content", children: [
2710
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { children: title }),
2711
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("ul", { children: validationErrorsList.map((questionId, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2712
- "a",
2713
- {
2714
- href: "#",
2715
- onClick: (e) => scrollToQuestion(questionId),
2716
- className: "errorSummary-text",
2717
- children: getQuestionLabelById(questionId)
2718
- }
2719
- ) }, questionId || i)) })
2720
- ] })
2721
- ]
2722
- }
2723
- );
2793
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "pts-errorSummary-container pts-root-error", children: [
2794
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
2795
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
2796
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { children: title }),
2797
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("ul", { children: filteredIds.map((questionId, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2798
+ "a",
2799
+ {
2800
+ href: `#question-${questionId}`,
2801
+ onClick: (e) => {
2802
+ e.preventDefault();
2803
+ scrollToQuestion(questionId);
2804
+ },
2805
+ className: "errorSummary-text",
2806
+ children: getQuestionLabelById(questionId)
2807
+ }
2808
+ ) }, questionId || i)) })
2809
+ ] })
2810
+ ] });
2724
2811
  };
2725
2812
  var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
2726
2813
 
@@ -2760,7 +2847,7 @@ var CookieBanner = ({
2760
2847
  children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "content", children: [
2761
2848
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { id: "cookie-banner-title", children: "Kakor (cookies)" }),
2762
2849
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { id: "cookie-banner-description", children: "PTS skulle vilja anv\xE4nda en statistikkaka i syfte att l\xF6pande f\xF6rb\xE4ttra webbplatsen. Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt samtycke klickar du p\xE5 \u201DKakor\u201D i avsnittet l\xE4ngst ned p\xE5 webbplatsen." }),
2763
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { id: "cookie-banner-description", className: "pts-cookieBanner-Links", children: [
2850
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "pts-cookieBanner-Links", children: [
2764
2851
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2765
2852
  "svg",
2766
2853
  {
package/dist/index.mjs CHANGED
@@ -54,10 +54,17 @@ var RadioMultipleStandard_default = InputRadio;
54
54
  var PreviewRadio = ({ question }) => {
55
55
  var _a, _b;
56
56
  const previewId = `preview-${question.id}`;
57
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "pts-question-preview pts-radioMultiple-preview", id: `question-${previewId}`, children: [
58
- /* @__PURE__ */ jsx("h3", { id: previewId, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
59
- /* @__PURE__ */ jsx("div", { className: "pts-root-answer", "aria-labelledby": previewId, children: ((_b = question.answer) == null ? void 0 : _b.trim()) ? question.answer : /* @__PURE__ */ jsx("span", { className: "no-answer-preview-page", children: "Inget svar" }) })
60
- ] }) });
57
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
58
+ /* @__PURE__ */ jsx("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
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
+ )
67
+ ] });
61
68
  };
62
69
 
63
70
  // src/NewInputComponentStandard/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
@@ -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: "*" }),
@@ -129,20 +136,14 @@ var PrevieMultipleCheckboxes = ({
129
136
  }) => {
130
137
  var _a, _b;
131
138
  const previewId = `preview-${question.id}`;
132
- return /* @__PURE__ */ jsx2(Fragment2, { children: /* @__PURE__ */ jsxs2(
133
- "div",
134
- {
135
- className: "pts-question-preview pts-multipleCheckboxes-preview",
136
- id: `question-${previewId}`,
137
- children: [
138
- /* @__PURE__ */ jsx2("h3", { id: previewId, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
139
- /* @__PURE__ */ jsx2("div", { className: "pts-root-answer", children: question.answer ? /* @__PURE__ */ jsx2("ul", { "aria-labelledby": previewId, children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
140
- var _a2;
141
- return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
142
- }).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" }) })
143
- ]
144
- }
145
- ) });
139
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
140
+ /* @__PURE__ */ jsx2("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
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
+ " "
146
+ ] });
146
147
  };
147
148
 
148
149
  // src/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.tsx
@@ -192,7 +193,7 @@ var InputTextarea = ({
192
193
  "aria-required": question.isQuestionMandatory,
193
194
  "aria-invalid": question.hasValidationError,
194
195
  maxLength: ((_a = question.questionExtraAttribute) == null ? void 0 : _a.answerMaxLength) || defaultMaxLength,
195
- "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,
196
197
  id: inputId
197
198
  }
198
199
  ),
@@ -228,10 +229,17 @@ var PreviewTextarea = ({
228
229
  }) => {
229
230
  var _a, _b;
230
231
  const previewId = `preview-${question.id}`;
231
- return /* @__PURE__ */ jsx3(Fragment3, { children: /* @__PURE__ */ jsxs3("div", { className: "pts-question-preview pts-textArea-preview", id: `question-${previewId}`, children: [
232
- /* @__PURE__ */ jsx3("h3", { id: previewId, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
233
- /* @__PURE__ */ jsx3("div", { className: "pts-root-answer", "aria-labelledby": 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
- ] }) });
232
+ return /* @__PURE__ */ jsxs3(Fragment3, { children: [
233
+ /* @__PURE__ */ jsx3("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
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
+ )
242
+ ] });
235
243
  };
236
244
 
237
245
  // src/NewInputComponentStandard/TextFieldStandard/TextFieldStandard.tsx
@@ -285,7 +293,7 @@ var TextFieldStandard = ({
285
293
  disabled: (_g = question.questionExtraAttribute) == null ? void 0 : _g.disabled,
286
294
  required: question.isQuestionMandatory,
287
295
  "aria-required": question.isQuestionMandatory,
288
- "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,
289
297
  "aria-invalid": question.hasValidationError,
290
298
  "aria-errormessage": question.hasValidationError ? errorId : void 0
291
299
  }
@@ -307,10 +315,17 @@ var PreviewTextField = ({
307
315
  }) => {
308
316
  var _a, _b;
309
317
  const previewId = `preview-${question.id}`;
310
- return /* @__PURE__ */ jsx4(Fragment4, { children: /* @__PURE__ */ jsxs4("div", { className: "pts-question-preview pts-textField-preview", id: `question-${previewId}`, children: [
311
- /* @__PURE__ */ jsx4("h3", { id: previewId, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
312
- /* @__PURE__ */ jsx4("div", { className: "pts-root-answer", "aria-labelledby": 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" }) })
313
- ] }) });
318
+ return /* @__PURE__ */ jsxs4(Fragment4, { children: [
319
+ /* @__PURE__ */ jsx4("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
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
+ )
328
+ ] });
314
329
  };
315
330
 
316
331
  // src/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.tsx
@@ -1771,7 +1786,7 @@ var EditPreviewLink = ({
1771
1786
  changeStepHandler,
1772
1787
  activatedLanguage = "sv"
1773
1788
  }) => {
1774
- return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ jsxs13("button", { type: "button", onClick: () => changeStepHandler(step), role: "link", children: [
1789
+ return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ jsxs13("a", { onClick: () => changeStepHandler(step), children: [
1775
1790
  /* @__PURE__ */ jsx14(
1776
1791
  "svg",
1777
1792
  {
@@ -1793,7 +1808,7 @@ var EditPreviewLink = ({
1793
1808
  )
1794
1809
  }
1795
1810
  ),
1796
- activatedLanguage === "en" ? `Edit step ${step}` : `Redigera steg ${step}`
1811
+ activatedLanguage === "en" ? `Edit step ${step.step}` : `Redigera steg ${step.step}`
1797
1812
  ] }) });
1798
1813
  };
1799
1814
  var EditPreviewLinkStandard_default = EditPreviewLink;
@@ -1832,7 +1847,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1832
1847
  }
1833
1848
  ),
1834
1849
  /* @__PURE__ */ jsx15(
1835
- "div",
1850
+ "nav",
1836
1851
  {
1837
1852
  className: "pts-footer-linkList",
1838
1853
  "aria-label": activatedLanguage === "en" ? "Footer navigation" : "Sidfotsnavigering",
@@ -2394,40 +2409,77 @@ import { createElement } from "react";
2394
2409
  import DOMPurify5 from "dompurify";
2395
2410
  import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2396
2411
  var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
2397
- return /* @__PURE__ */ jsxs19("section", { className: "pts-textHeadlineAndBody-container", children: [
2398
- data.headline && createElement(headlineType, {}, data.headline),
2399
- data.body && /* @__PURE__ */ jsx20("div", { dangerouslySetInnerHTML: { __html: DOMPurify5.sanitize(data.body) } }),
2400
- data.linksForMoreInfo && data.linksForMoreInfo.length > 0 && /* @__PURE__ */ jsx20("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ jsx20("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs19(
2401
- "a",
2402
- {
2403
- href: link.url,
2404
- target: "_blank",
2405
- rel: "noopener noreferrer",
2406
- "aria-label": link.ariaLabel,
2407
- children: [
2408
- /* @__PURE__ */ jsx20("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ jsx20(
2409
- "svg",
2410
- {
2411
- "aria-hidden": "true",
2412
- xmlns: "http://www.w3.org/2000/svg",
2413
- width: "12",
2414
- height: "10",
2415
- viewBox: "0 0 12 10",
2416
- fill: "none",
2417
- children: /* @__PURE__ */ jsx20(
2418
- "path",
2412
+ return /* @__PURE__ */ jsxs19(
2413
+ "section",
2414
+ {
2415
+ className: "pts-textHeadlineAndBody-container",
2416
+ "aria-labelledby": "textHeadlineAndBody-headline",
2417
+ children: [
2418
+ data.headline && createElement(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
2419
+ data.body && /* @__PURE__ */ jsx20("div", { dangerouslySetInnerHTML: { __html: DOMPurify5.sanitize(data.body) } }),
2420
+ data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ jsx20("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ jsx20("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs19(
2421
+ "a",
2422
+ {
2423
+ href: link.url,
2424
+ target: "_blank",
2425
+ rel: "noopener noreferrer",
2426
+ "aria-label": link.ariaLabel,
2427
+ children: [
2428
+ /* @__PURE__ */ jsx20("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ jsx20(
2429
+ "svg",
2419
2430
  {
2420
- d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
2421
- fill: "#ffffff"
2431
+ "aria-hidden": "true",
2432
+ xmlns: "http://www.w3.org/2000/svg",
2433
+ width: "12",
2434
+ height: "10",
2435
+ viewBox: "0 0 12 10",
2436
+ fill: "none",
2437
+ children: /* @__PURE__ */ jsx20(
2438
+ "path",
2439
+ {
2440
+ d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
2441
+ fill: "#ffffff"
2442
+ }
2443
+ )
2422
2444
  }
2423
- )
2424
- }
2425
- ) }),
2426
- link.title
2427
- ]
2428
- }
2429
- ) }, `more-info-${index}`)) })
2430
- ] });
2445
+ ) }),
2446
+ link.title
2447
+ ]
2448
+ }
2449
+ ) }, `more-info-${index}`)) }),
2450
+ data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs19(
2451
+ "a",
2452
+ {
2453
+ href: data.linksForMoreInfo[0].url,
2454
+ target: "_blank",
2455
+ rel: "noopener noreferrer",
2456
+ "aria-label": data.linksForMoreInfo[0].ariaLabel,
2457
+ children: [
2458
+ /* @__PURE__ */ jsx20("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ jsx20(
2459
+ "svg",
2460
+ {
2461
+ "aria-hidden": "true",
2462
+ xmlns: "http://www.w3.org/2000/svg",
2463
+ width: "12",
2464
+ height: "10",
2465
+ viewBox: "0 0 12 10",
2466
+ fill: "none",
2467
+ children: /* @__PURE__ */ jsx20(
2468
+ "path",
2469
+ {
2470
+ d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
2471
+ fill: "#ffffff"
2472
+ }
2473
+ )
2474
+ }
2475
+ ) }),
2476
+ data.linksForMoreInfo[0].title
2477
+ ]
2478
+ }
2479
+ )
2480
+ ]
2481
+ }
2482
+ );
2431
2483
  };
2432
2484
  var TextHeadlineAndBodyStandard_default = TextHeadlineAndBody;
2433
2485
 
@@ -2492,7 +2544,7 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
2492
2544
  return /* @__PURE__ */ jsxs20("div", { className: "pts-serviceHeadlineAndBody-container", children: [
2493
2545
  data.mainHeadline && /* @__PURE__ */ jsx22("h1", { id: "pts-main-service-headline", children: data.mainHeadline }),
2494
2546
  activeStep === 1 && data.ingressBody && /* @__PURE__ */ jsx22("div", { dangerouslySetInnerHTML: { __html: DOMPurify6.sanitize(data.ingressBody) } }),
2495
- activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length > 0 && /* @__PURE__ */ jsx22("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((moreInfo, index) => /* @__PURE__ */ jsx22("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs20("a", { href: moreInfo.url, target: "_blank", rel: "noopener noreferrer", children: [
2547
+ activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ jsx22("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((moreInfo, index) => /* @__PURE__ */ jsx22("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs20("a", { href: moreInfo.url, target: "_blank", rel: "noopener noreferrer", children: [
2496
2548
  /* @__PURE__ */ jsx22(
2497
2549
  "svg",
2498
2550
  {
@@ -2512,7 +2564,28 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
2512
2564
  }
2513
2565
  ),
2514
2566
  /* @__PURE__ */ jsx22("span", { className: "pts-moreinfo-link-text", children: moreInfo.title })
2515
- ] }) }, moreInfo.title + index)) })
2567
+ ] }) }, moreInfo.title + index)) }),
2568
+ activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs20("a", { href: data.linksForMoreInfo[0].url, target: "_blank", rel: "noopener noreferrer", children: [
2569
+ /* @__PURE__ */ jsx22(
2570
+ "svg",
2571
+ {
2572
+ xmlns: "http://www.w3.org/2000/svg",
2573
+ width: "12",
2574
+ height: "10",
2575
+ viewBox: "0 0 12 10",
2576
+ fill: "none",
2577
+ "aria-hidden": "true",
2578
+ children: /* @__PURE__ */ jsx22(
2579
+ "path",
2580
+ {
2581
+ d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
2582
+ fill: "#ffffff"
2583
+ }
2584
+ )
2585
+ }
2586
+ ),
2587
+ /* @__PURE__ */ jsx22("span", { className: "pts-moreinfo-link-text", children: data.linksForMoreInfo[0].title })
2588
+ ] })
2516
2589
  ] });
2517
2590
  };
2518
2591
  var ServiceHeadlineAndBodyStandard_default = ServiceHeadlineAndBody;
@@ -2614,6 +2687,24 @@ var ValidationErrorSummaryList = ({
2614
2687
  }) => {
2615
2688
  console.log(formQuestions);
2616
2689
  console.log(validationErrorsList);
2690
+ function filterIdsByGroupCheck(ids, questions) {
2691
+ var _a;
2692
+ const tailIds = /* @__PURE__ */ new Set();
2693
+ for (const q of questions) {
2694
+ const rules = (_a = q.validationType) != null ? _a : [];
2695
+ for (const rule of rules) {
2696
+ const m = /^groupCheck-(\d+(?:-\d+)*)$/.exec(rule.trim());
2697
+ if (!m) continue;
2698
+ const nums = m[1].split("-").map((s) => Number(s)).filter((n) => Number.isFinite(n));
2699
+ if (nums.length > 1) {
2700
+ for (let i = 1; i < nums.length; i++) {
2701
+ tailIds.add(nums[i]);
2702
+ }
2703
+ }
2704
+ }
2705
+ }
2706
+ return ids.filter((id) => !tailIds.has(id));
2707
+ }
2617
2708
  function scrollToQuestion(questionId) {
2618
2709
  const container = document.getElementById(`question-${questionId}`);
2619
2710
  if (container) {
@@ -2627,35 +2718,31 @@ var ValidationErrorSummaryList = ({
2627
2718
  }
2628
2719
  }
2629
2720
  if (!validationErrorsList.length) return /* @__PURE__ */ jsx26(Fragment15, {});
2630
- const count = validationErrorsList.length;
2721
+ const filteredIds = filterIdsByGroupCheck(validationErrorsList, formQuestions);
2722
+ const count = filteredIds.length;
2631
2723
  const title = summaryText.replace("{count}", count.toString()).replace("{plural}", count === 1 ? "sak" : "saker");
2632
2724
  function getQuestionLabelById(id) {
2633
2725
  const found = formQuestions.find((item) => item.id === id);
2634
2726
  return found == null ? void 0 : found.questionLabel;
2635
2727
  }
2636
- return /* @__PURE__ */ jsxs23(
2637
- "div",
2638
- {
2639
- id: "pts-form-id-error-summary",
2640
- className: "pts-errorSummary-container pts-root-error",
2641
- tabIndex: -1,
2642
- children: [
2643
- /* @__PURE__ */ jsx26("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
2644
- /* @__PURE__ */ jsxs23("div", { className: "errorSummary-content", children: [
2645
- /* @__PURE__ */ jsx26("h2", { children: title }),
2646
- /* @__PURE__ */ jsx26("ul", { children: validationErrorsList.map((questionId, i) => /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsx26(
2647
- "a",
2648
- {
2649
- href: "#",
2650
- onClick: (e) => scrollToQuestion(questionId),
2651
- className: "errorSummary-text",
2652
- children: getQuestionLabelById(questionId)
2653
- }
2654
- ) }, questionId || i)) })
2655
- ] })
2656
- ]
2657
- }
2658
- );
2728
+ return /* @__PURE__ */ jsxs23("div", { className: "pts-errorSummary-container pts-root-error", children: [
2729
+ /* @__PURE__ */ jsx26("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
2730
+ /* @__PURE__ */ jsxs23("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
2731
+ /* @__PURE__ */ jsx26("h2", { children: title }),
2732
+ /* @__PURE__ */ jsx26("ul", { children: filteredIds.map((questionId, i) => /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsx26(
2733
+ "a",
2734
+ {
2735
+ href: `#question-${questionId}`,
2736
+ onClick: (e) => {
2737
+ e.preventDefault();
2738
+ scrollToQuestion(questionId);
2739
+ },
2740
+ className: "errorSummary-text",
2741
+ children: getQuestionLabelById(questionId)
2742
+ }
2743
+ ) }, questionId || i)) })
2744
+ ] })
2745
+ ] });
2659
2746
  };
2660
2747
  var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
2661
2748
 
@@ -2695,7 +2782,7 @@ var CookieBanner = ({
2695
2782
  children: /* @__PURE__ */ jsxs24("div", { className: "content", children: [
2696
2783
  /* @__PURE__ */ jsx27("h3", { id: "cookie-banner-title", children: "Kakor (cookies)" }),
2697
2784
  /* @__PURE__ */ jsx27("p", { id: "cookie-banner-description", children: "PTS skulle vilja anv\xE4nda en statistikkaka i syfte att l\xF6pande f\xF6rb\xE4ttra webbplatsen. Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt samtycke klickar du p\xE5 \u201DKakor\u201D i avsnittet l\xE4ngst ned p\xE5 webbplatsen." }),
2698
- /* @__PURE__ */ jsxs24("div", { id: "cookie-banner-description", className: "pts-cookieBanner-Links", children: [
2785
+ /* @__PURE__ */ jsxs24("div", { className: "pts-cookieBanner-Links", children: [
2699
2786
  /* @__PURE__ */ jsxs24(
2700
2787
  "svg",
2701
2788
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
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",