optimized-react-component-library-xyz123 2.12.9 → 2.14.1

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
@@ -235,14 +235,14 @@ interface InfoOnlyProps {
235
235
 
236
236
  declare const InputInfoOnly: FC<InfoOnlyProps>;
237
237
 
238
- interface RadioMultipleWithInfo2Props {
238
+ interface RadioMultipleWithInfoProps {
239
239
  question: IQuestion;
240
240
  handleQuestionInputChange: any;
241
241
  showPreview?: boolean;
242
242
  activatedLanguage?: string;
243
243
  }
244
244
 
245
- declare const RadioWithInfo: FC<RadioMultipleWithInfo2Props>;
245
+ declare const RadioWithInfo: FC<RadioMultipleWithInfoProps>;
246
246
 
247
247
  interface DropdownProps {
248
248
  question: IQuestion;
@@ -823,8 +823,6 @@ declare const CookieBanner: React$1.FC<CookieBannerProps>;
823
823
 
824
824
  interface FooterProps {
825
825
  activatedLanguage?: string;
826
- appUsesCookies?: boolean;
827
- openCookieBanner?: () => void;
828
826
  }
829
827
 
830
828
  declare const Footer: FC<FooterProps>;
@@ -1078,4 +1076,4 @@ interface FormStatusMessagesProps {
1078
1076
  */
1079
1077
  declare const FormStatusMessagesScreenReader: React$1.FC<FormStatusMessagesProps>;
1080
1078
 
1081
- export { AddFiles as AddFilesStandard, AlertInTextStandard, CheckboxGroup as CheckboxGroupStandard, Collapse, CookieBanner, type CookieConsentConfig, CustomDropdownStandard as DropdownStandard, EditPreviewLink as EditPreviewLinkStandard, Footer as FooterStandard, FormStatusMessagesScreenReader, Header as HeaderStandard, type IAppSettings, type IAppSettingsCookies, type IApplicationContent, type IFormState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InputInfoOnly as InfoOnlyStandard, type LanguageSupportConfig, LinkList as LinkListStandard, LinkStandard, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, Navigation, NavigationHeader, OptionTextBody, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, RadioWithInfo as RadioMultipleWithInfo2Standard, SearchBar, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtonsNoApi as StepperButtonsNoApiStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createFormSlice, createGlobalLanguageSlice, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeFormSelectors, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, makeglobalLanguageSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
1079
+ export { AddFiles as AddFilesStandard, AlertInTextStandard, CheckboxGroup as CheckboxGroupStandard, Collapse, CookieBanner, type CookieConsentConfig, CustomDropdownStandard as DropdownStandard, EditPreviewLink as EditPreviewLinkStandard, Footer as FooterStandard, FormStatusMessagesScreenReader, Header as HeaderStandard, type IAppSettings, type IAppSettingsCookies, type IApplicationContent, type IFormState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InputInfoOnly as InfoOnlyStandard, type LanguageSupportConfig, LinkList as LinkListStandard, LinkStandard, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, Navigation, NavigationHeader, OptionTextBody, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, RadioWithInfo as RadioMultipleWithInfoStandard, SearchBar, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtonsNoApi as StepperButtonsNoApiStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createFormSlice, createGlobalLanguageSlice, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeFormSelectors, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, makeglobalLanguageSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
package/dist/index.d.ts CHANGED
@@ -235,14 +235,14 @@ interface InfoOnlyProps {
235
235
 
236
236
  declare const InputInfoOnly: FC<InfoOnlyProps>;
237
237
 
238
- interface RadioMultipleWithInfo2Props {
238
+ interface RadioMultipleWithInfoProps {
239
239
  question: IQuestion;
240
240
  handleQuestionInputChange: any;
241
241
  showPreview?: boolean;
242
242
  activatedLanguage?: string;
243
243
  }
244
244
 
245
- declare const RadioWithInfo: FC<RadioMultipleWithInfo2Props>;
245
+ declare const RadioWithInfo: FC<RadioMultipleWithInfoProps>;
246
246
 
247
247
  interface DropdownProps {
248
248
  question: IQuestion;
@@ -823,8 +823,6 @@ declare const CookieBanner: React$1.FC<CookieBannerProps>;
823
823
 
824
824
  interface FooterProps {
825
825
  activatedLanguage?: string;
826
- appUsesCookies?: boolean;
827
- openCookieBanner?: () => void;
828
826
  }
829
827
 
830
828
  declare const Footer: FC<FooterProps>;
@@ -1078,4 +1076,4 @@ interface FormStatusMessagesProps {
1078
1076
  */
1079
1077
  declare const FormStatusMessagesScreenReader: React$1.FC<FormStatusMessagesProps>;
1080
1078
 
1081
- export { AddFiles as AddFilesStandard, AlertInTextStandard, CheckboxGroup as CheckboxGroupStandard, Collapse, CookieBanner, type CookieConsentConfig, CustomDropdownStandard as DropdownStandard, EditPreviewLink as EditPreviewLinkStandard, Footer as FooterStandard, FormStatusMessagesScreenReader, Header as HeaderStandard, type IAppSettings, type IAppSettingsCookies, type IApplicationContent, type IFormState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InputInfoOnly as InfoOnlyStandard, type LanguageSupportConfig, LinkList as LinkListStandard, LinkStandard, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, Navigation, NavigationHeader, OptionTextBody, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, RadioWithInfo as RadioMultipleWithInfo2Standard, SearchBar, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtonsNoApi as StepperButtonsNoApiStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createFormSlice, createGlobalLanguageSlice, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeFormSelectors, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, makeglobalLanguageSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
1079
+ export { AddFiles as AddFilesStandard, AlertInTextStandard, CheckboxGroup as CheckboxGroupStandard, Collapse, CookieBanner, type CookieConsentConfig, CustomDropdownStandard as DropdownStandard, EditPreviewLink as EditPreviewLinkStandard, Footer as FooterStandard, FormStatusMessagesScreenReader, Header as HeaderStandard, type IAppSettings, type IAppSettingsCookies, type IApplicationContent, type IFormState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InputInfoOnly as InfoOnlyStandard, type LanguageSupportConfig, LinkList as LinkListStandard, LinkStandard, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, Navigation, NavigationHeader, OptionTextBody, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, RadioWithInfo as RadioMultipleWithInfoStandard, SearchBar, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtonsNoApi as StepperButtonsNoApiStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createFormSlice, createGlobalLanguageSlice, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeFormSelectors, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, makeglobalLanguageSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ __export(index_exports, {
52
52
  QuestionGroup: () => QuestionGroup_default,
53
53
  QuestionRenderer: () => QuestionRenderer_default,
54
54
  RadioMultipleStandard: () => RadioMultipleStandard_default,
55
- RadioMultipleWithInfo2Standard: () => RadioMultipleWithInfo2Standard_default,
55
+ RadioMultipleWithInfoStandard: () => RadioMultipleWithInfoStandard_default,
56
56
  SearchBar: () => SearchBarStandard_default,
57
57
  SingleCheckboxStandard: () => SingleCheckboxStandard_default,
58
58
  SkipLinkStandard: () => SkipLinkStandard_default,
@@ -112,6 +112,22 @@ var ValidationMessage = ({
112
112
  };
113
113
  var ValidationMessage_default = ValidationMessage;
114
114
 
115
+ // src/helpers/setPreviewAnswerLabel/setPreviewAnswerLabel.ts
116
+ var setPreviewAnswerLabel = (question, activatedLanguage) => {
117
+ var _a;
118
+ if ((question == null ? void 0 : question.answer) && question.answer.length > 0) {
119
+ const language = question.languageSupport.find((lang) => lang.language === activatedLanguage);
120
+ if (language && setPreviewAnswerLabel.length > 0) {
121
+ const answerOption = language.options.find(
122
+ (option) => option.value === question.answer
123
+ );
124
+ return (_a = answerOption.label) != null ? _a : "";
125
+ }
126
+ }
127
+ return "";
128
+ };
129
+ var setPreviewAnswerLabel_default = setPreviewAnswerLabel;
130
+
115
131
  // src/components/input-components/RadioMultipleStandard/RadioMultipleStandard.tsx
116
132
  var import_jsx_runtime2 = require("react/jsx-runtime");
117
133
  var InputRadio = ({
@@ -175,9 +191,10 @@ var RadioMultipleStandard_default = InputRadio;
175
191
  var PreviewRadio = ({ question, activatedLanguage }) => {
176
192
  var _a, _b;
177
193
  const previewId = `preview-${question.id}`;
194
+ const questionAnswer = setPreviewAnswerLabel_default(question, activatedLanguage);
178
195
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
179
196
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
180
- ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
197
+ ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: questionAnswer.length > 0 ? questionAnswer : question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
181
198
  "dd",
182
199
  {
183
200
  className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
@@ -1393,7 +1410,6 @@ __export(icons_exports, {
1393
1410
  ChevronRightIcon: () => ChevronRightIcon,
1394
1411
  CloseIcon: () => CloseIcon,
1395
1412
  CollapseIcon: () => CollapseIcon,
1396
- Cookie_icon: () => Cookie_icon,
1397
1413
  ExpandIcon: () => ExpandIcon,
1398
1414
  FileIcon: () => FileIcon,
1399
1415
  LanguageIcon: () => LanguageIcon,
@@ -1979,13 +1995,6 @@ var Logo_en = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1979
1995
  ]
1980
1996
  }
1981
1997
  );
1982
- var Cookie_icon = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "13", height: "16", viewBox: "0 0 13 16", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1983
- "path",
1984
- {
1985
- d: "M4.67907 11.2981H8.32186C8.53419 11.2981 8.71217 11.228 8.85579 11.0878C8.9994 10.9476 9.07121 10.7736 9.07121 10.5658V7.91662C9.07121 7.70938 8.9994 7.53567 8.85579 7.39549C8.71217 7.25532 8.53388 7.18523 8.32093 7.18523H8.16029V6.27892C8.16029 5.82637 8.00243 5.44572 7.68671 5.13697C7.371 4.82882 6.98131 4.67475 6.51764 4.67475C6.05398 4.67475 5.66429 4.82882 5.34857 5.13697C5.03286 5.44511 4.875 5.82576 4.875 6.27892V7.18523H4.67814C4.46581 7.18523 4.28783 7.25532 4.14421 7.39549C4.0006 7.53567 3.92879 7.70938 3.92879 7.91662V10.5658C3.92879 10.7736 4.0006 10.9476 4.14421 11.0878C4.28783 11.228 4.46612 11.2981 4.67907 11.2981ZM5.58907 7.18523V6.27892C5.58907 6.02213 5.67821 5.80673 5.8565 5.63272C6.03479 5.45871 6.25517 5.3717 6.51764 5.3717C6.78012 5.3717 7.00081 5.45871 7.17971 5.63272C7.35862 5.80673 7.44745 6.02213 7.44621 6.27892V7.18523H5.58907ZM6.2335 15.9773C6.14064 15.9622 6.05398 15.9396 5.9735 15.9094C4.14607 15.2296 2.69379 14.0768 1.61664 12.4509C0.5395 10.825 0.000619048 9.06491 0 7.17073V3.289C0 2.97844 0.0906907 2.69869 0.272072 2.44976C0.452834 2.20082 0.687143 2.02047 0.975 1.90869L5.97536 0.0960688C6.15612 0.0320229 6.331 0 6.5 0C6.669 0 6.84419 0.0320229 7.02557 0.0960688L12.025 1.90869C12.3122 2.02107 12.5465 2.20143 12.7279 2.44976C12.9093 2.69869 13 2.97844 13 3.289V7.17073C13 9.06491 12.4614 10.825 11.3843 12.4509C10.3071 14.0768 8.85486 15.2296 7.02743 15.9094C6.94633 15.9396 6.85936 15.9622 6.7665 15.9773C6.67364 15.9924 6.58481 16 6.5 16C6.41519 16 6.32636 15.9924 6.2335 15.9773ZM6.5 15.1463C8.10952 14.6478 9.44048 13.6508 10.4929 12.1554C11.5452 10.66 12.0714 8.99845 12.0714 7.17073V3.27178C12.0714 3.15577 12.0386 3.05124 11.973 2.9582C11.908 2.86515 11.8158 2.79567 11.6963 2.74975L6.69686 0.937125C6.63743 0.912957 6.57181 0.900873 6.5 0.900873C6.42819 0.900873 6.36257 0.912957 6.30314 0.937125L1.30371 2.74975C1.18424 2.79567 1.092 2.86515 1.027 2.9582C0.961381 3.05124 0.928571 3.15577 0.928571 3.27178V7.17073C0.928571 8.99845 1.45476 10.66 2.50714 12.1554C3.55952 13.6508 4.89048 14.6478 6.5 15.1463Z",
1986
- fill: "white"
1987
- }
1988
- ) });
1989
1998
 
1990
1999
  // src/components/layout/AlertInTextStandard/AlertInTextStandard.tsx
1991
2000
  var import_dompurify5 = __toESM(require("dompurify"));
@@ -2008,7 +2017,9 @@ var import_jsx_runtime18 = require("react/jsx-runtime");
2008
2017
  var TextBody = ({ data }) => {
2009
2018
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "pts-textBody-container", children: [
2010
2019
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: `${!data.body || !data.linksForMoreInfo || !data.alertInText ? "" : "pts-textbody-createspace"}`, children: [
2011
- data.body && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify6.default.sanitize(data.body) } }),
2020
+ data.body && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify6.default.sanitize(data.body, {
2021
+ ALLOWED_ATTR: ["target", "href", "style"]
2022
+ }) } }),
2012
2023
  data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2013
2024
  "a",
2014
2025
  {
@@ -2107,10 +2118,10 @@ var InputInfoOnly = ({
2107
2118
  };
2108
2119
  var InfoOnlyStandard_default = InputInfoOnly;
2109
2120
 
2110
- // src/components/input-components/RadioMultipleWithInfo2Standard/RadioMultipleWithInfo2Standard.tsx
2121
+ // src/components/input-components/RadioMultipleWithInfoStandard/RadioMultipleWithInfoStandard.tsx
2111
2122
  var import_react11 = __toESM(require("react"));
2112
2123
 
2113
- // src/components/input-components/RadioMultipleWithInfo2Standard/RadioCollapseItem.tsx
2124
+ // src/components/input-components/RadioMultipleWithInfoStandard/RadioCollapseItem.tsx
2114
2125
  var import_react10 = require("react");
2115
2126
  var import_dompurify7 = __toESM(require("dompurify"));
2116
2127
  var import_jsx_runtime20 = require("react/jsx-runtime");
@@ -2136,6 +2147,8 @@ var RadioCollapseItem = ({
2136
2147
  (0, import_react10.useEffect)(() => {
2137
2148
  if (questionAnswer === value) {
2138
2149
  setIsOpen(true);
2150
+ } else {
2151
+ setIsOpen(false);
2139
2152
  }
2140
2153
  }, [questionAnswer, value]);
2141
2154
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pts-radio-option", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "pts-radio-collapse", children: [
@@ -2154,7 +2167,7 @@ var RadioCollapseItem = ({
2154
2167
  }
2155
2168
  ),
2156
2169
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { htmlFor: `${groupId}-option-${index}`, id: `${groupId}-label-${index}`, children: label }),
2157
- optionText && optionText.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2170
+ optionText && optionText.length > 0 && questionAnswer === value && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2158
2171
  "button",
2159
2172
  {
2160
2173
  className: `pts-radio-collapse-button ${isOpen ? "open" : ""}`,
@@ -2165,7 +2178,7 @@ var RadioCollapseItem = ({
2165
2178
  "aria-controls": contentId,
2166
2179
  "aria-label": buttonLabel,
2167
2180
  "aria-describedby": isOpen ? contentId : void 0,
2168
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "pts-open-close-icon", "aria-hidden": "true", children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CollapseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandIcon, {}) })
2181
+ tabIndex: questionAnswer === value ? 0 : -1
2169
2182
  }
2170
2183
  )
2171
2184
  ] }),
@@ -2174,15 +2187,23 @@ var RadioCollapseItem = ({
2174
2187
  {
2175
2188
  className: `pts-radio-collapse-body ${isOpen ? "open" : "hidden"}`,
2176
2189
  id: contentId,
2190
+ hidden: !isOpen,
2177
2191
  role: "region",
2178
2192
  "aria-labelledby": `${groupId}-label-${index}`,
2179
2193
  inert: !isOpen,
2180
2194
  children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: `pts-radio-collapse-content `, children: [
2181
2195
  isOpen && //TODO??
2182
2196
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sr-only", children: activatedLanguage === "sv" ? `Visar informationstext om svarsalternativet ${label}` : `Displays informational text about the answer option ${label}` }),
2183
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { dangerouslySetInnerHTML: {
2184
- __html: import_dompurify7.default.sanitize(optionText != null ? optionText : "")
2185
- } })
2197
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2198
+ "div",
2199
+ {
2200
+ dangerouslySetInnerHTML: {
2201
+ __html: import_dompurify7.default.sanitize(optionText != null ? optionText : "", {
2202
+ ADD_ATTR: ["target", "style"]
2203
+ })
2204
+ }
2205
+ }
2206
+ )
2186
2207
  ] })
2187
2208
  }
2188
2209
  )
@@ -2190,7 +2211,7 @@ var RadioCollapseItem = ({
2190
2211
  };
2191
2212
  var RadioCollapseItem_default = RadioCollapseItem;
2192
2213
 
2193
- // src/components/input-components/RadioMultipleWithInfo2Standard/RadioMultipleWithInfo2Standard.tsx
2214
+ // src/components/input-components/RadioMultipleWithInfoStandard/RadioMultipleWithInfoStandard.tsx
2194
2215
  var import_jsx_runtime21 = require("react/jsx-runtime");
2195
2216
  var RadioWithInfo = ({
2196
2217
  question,
@@ -2230,16 +2251,11 @@ var RadioWithInfo = ({
2230
2251
  "aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
2231
2252
  "aria-describedby": question.hasValidationError ? errorId : void 0,
2232
2253
  children: [
2233
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("legend", { id: `label-${groupId}`, children: [
2234
- question.questionLabel,
2235
- " ",
2236
- question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
2237
- ] }),
2238
2254
  groupedOptionArray.map((group, g_index) => {
2239
2255
  var _a2;
2240
2256
  let subId = "subheading-" + g_index;
2241
2257
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react11.default.Fragment, { children: [
2242
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "pts-radioWithInfo-sub-headline", id: subId, children: group.category }),
2258
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("legend", { className: "pts-radioWithInfo-sub-headline", id: subId, children: group.category }),
2243
2259
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { role: "group", "aria-labelledby": subId, children: (_a2 = group.items) == null ? void 0 : _a2.map((option, o_index) => {
2244
2260
  var _a3, _b2, _c2, _d, _e;
2245
2261
  index++;
@@ -2274,13 +2290,14 @@ var RadioWithInfo = ({
2274
2290
  ]
2275
2291
  }
2276
2292
  ) }),
2277
- showPreview && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PreviewRadio2, { question })
2293
+ showPreview && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PreviewRadio2, { question, activatedLanguage })
2278
2294
  ] });
2279
2295
  };
2280
- var RadioMultipleWithInfo2Standard_default = RadioWithInfo;
2281
- var PreviewRadio2 = ({ question }) => {
2296
+ var RadioMultipleWithInfoStandard_default = RadioWithInfo;
2297
+ var PreviewRadio2 = ({ question, activatedLanguage }) => {
2282
2298
  var _a, _b;
2283
2299
  const previewId = `preview-${question.id}`;
2300
+ const questionAnswer = setPreviewAnswerLabel_default(question, activatedLanguage);
2284
2301
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
2285
2302
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
2286
2303
  ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -2288,7 +2305,7 @@ var PreviewRadio2 = ({ question }) => {
2288
2305
  {
2289
2306
  className: "pts-radioMultipleWithInfo2-preview pts-root-answer",
2290
2307
  id: `answer-${previewId}`,
2291
- children: question.answer
2308
+ children: questionAnswer.length > 0 ? questionAnswer : question.answer
2292
2309
  }
2293
2310
  ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2294
2311
  "dd",
@@ -2427,16 +2444,17 @@ var CustomDropdownStandard = ({
2427
2444
  ),
2428
2445
  hasOptionInfoText && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(OptionTextBody_default, { ...optionTextProps })
2429
2446
  ] }),
2430
- showPreview && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PreviewDropdown, { question })
2447
+ showPreview && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PreviewDropdown, { question, activatedLanguage })
2431
2448
  ] });
2432
2449
  };
2433
2450
  var DropdownStandard_default = CustomDropdownStandard;
2434
- var PreviewDropdown = ({ question, activatedLanguage = "sv" }) => {
2451
+ var PreviewDropdown = ({ question, activatedLanguage }) => {
2435
2452
  var _a, _b;
2436
2453
  const previewId = `preview-${question.id}`;
2454
+ const questionAnswer = setPreviewAnswerLabel_default(question, activatedLanguage);
2437
2455
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
2438
2456
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
2439
- ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("dd", { className: "pts-dropdown-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2457
+ ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("dd", { className: "pts-dropdown-preview pts-root-answer", id: `answer-${previewId}`, children: questionAnswer.length > 0 ? questionAnswer : question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2440
2458
  "dd",
2441
2459
  {
2442
2460
  className: "pts-dropdown-preview pts-root-answer no-answer-preview-page",
@@ -3192,15 +3210,17 @@ var QuestionRenderer = ({
3192
3210
  {
3193
3211
  question,
3194
3212
  handleQuestionInputChange,
3195
- showPreview
3213
+ showPreview,
3214
+ activatedLanguage
3196
3215
  }
3197
3216
  ),
3198
3217
  question.questionType === "RadioWithInfo" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3199
- RadioMultipleWithInfo2Standard_default,
3218
+ RadioMultipleWithInfoStandard_default,
3200
3219
  {
3201
3220
  question,
3202
3221
  handleQuestionInputChange,
3203
- showPreview
3222
+ showPreview,
3223
+ activatedLanguage
3204
3224
  }
3205
3225
  ),
3206
3226
  question.questionType === "TextField" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
@@ -3254,7 +3274,8 @@ var QuestionRenderer = ({
3254
3274
  {
3255
3275
  question,
3256
3276
  handleQuestionInputChange,
3257
- showPreview
3277
+ showPreview,
3278
+ activatedLanguage
3258
3279
  }
3259
3280
  ),
3260
3281
  question.questionType === "InfoOnly" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
@@ -3448,11 +3469,7 @@ var CookieBanner_default = CookieBanner;
3448
3469
 
3449
3470
  // src/components/layout/FooterStandard/FooterStandard.tsx
3450
3471
  var import_jsx_runtime27 = require("react/jsx-runtime");
3451
- var Footer = ({
3452
- activatedLanguage = "sv",
3453
- appUsesCookies = false,
3454
- openCookieBanner
3455
- }) => {
3472
+ var Footer = ({ activatedLanguage = "sv" }) => {
3456
3473
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("footer", { className: "pts-footer-container", children: [
3457
3474
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "pts-footer-slogan-text-container", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "pts-footer-slogan-text", children: activatedLanguage === "sv" ? "S\xE4ker och tillg\xE4nglig kommunikation f\xF6r Sverige" : "Secure and accessible communication for Sweden" }) }),
3458
3475
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "pts-footer-content", children: [
@@ -3521,20 +3538,7 @@ var Footer = ({
3521
3538
  ]
3522
3539
  }
3523
3540
  ) }),
3524
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { children: appUsesCookies ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3525
- "button",
3526
- {
3527
- type: "button",
3528
- "aria-controls": "cookie-banner",
3529
- onClick: openCookieBanner,
3530
- className: "pts-footer-button pts-secondary-button",
3531
- children: [
3532
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Cookies (opens cookie banner)" : "PTS Kakor (\xF6ppnar kakbanner)" }),
3533
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "aria-hidden": "true", className: "secondary_icon", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Cookie_icon, {}) }),
3534
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Cookies" : "Kakor" })
3535
- ]
3536
- }
3537
- ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3541
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3538
3542
  "a",
3539
3543
  {
3540
3544
  href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",
@@ -3964,7 +3968,7 @@ var Header = ({
3964
3968
  "button",
3965
3969
  {
3966
3970
  lang: activatedLanguage === "en" ? "en" : "sv",
3967
- className: "pts-languageButton pts-secondary-button",
3971
+ className: "pts-languageButton",
3968
3972
  onClick: handleLanguageClick,
3969
3973
  children: [
3970
3974
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "languageIcon", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LanguageIcon2, {}) }) }),
@@ -4012,10 +4016,12 @@ var Navigation = ({
4012
4016
  setOpenSubMenu(null);
4013
4017
  return;
4014
4018
  }
4015
- const defaultOpenSubMenu = activePath == null ? null : (_b = (_a = menuLinks.find((link) => {
4016
- var _a2;
4017
- return (_a2 = link.children) == null ? void 0 : _a2.some((child) => child.href.includes(activePath));
4018
- })) == null ? void 0 : _a.label[activatedLanguage]) != null ? _b : null;
4019
+ const defaultOpenSubMenu = activePath == null ? null : (_b = (_a = menuLinks.find(
4020
+ (link) => {
4021
+ var _a2;
4022
+ return (_a2 = link.children) == null ? void 0 : _a2.some((child) => child.href.includes(activePath));
4023
+ }
4024
+ )) == null ? void 0 : _a.label[activatedLanguage]) != null ? _b : null;
4019
4025
  setOpenSubMenu(defaultOpenSubMenu);
4020
4026
  }, [isOpen, activePath, menuLinks, activatedLanguage]);
4021
4027
  (0, import_react16.useEffect)(() => {
@@ -4096,7 +4102,7 @@ var Navigation = ({
4096
4102
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "pts-navigation-close-container ", id: "menu-close", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
4097
4103
  "button",
4098
4104
  {
4099
- className: "pts-navigation-close-button pts-secondary-button",
4105
+ className: "pts-navigation-close-button",
4100
4106
  onClick: () => handleMenuClick("close"),
4101
4107
  type: "button",
4102
4108
  children: [
@@ -4112,7 +4118,14 @@ var Navigation = ({
4112
4118
  lang: activatedLanguage,
4113
4119
  children: [
4114
4120
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "pts-navigation-button", children: [
4115
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: href && href.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: label[activatedLanguage] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LinkComponent, { onClick: () => handleMenuClick("link"), href, children: label[activatedLanguage] }) }),
4121
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: href && href.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: label[activatedLanguage] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4122
+ LinkComponent,
4123
+ {
4124
+ onClick: () => handleMenuClick("link"),
4125
+ href,
4126
+ children: label[activatedLanguage]
4127
+ }
4128
+ ) }),
4116
4129
  children && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4117
4130
  "button",
4118
4131
  {
@@ -4135,15 +4148,14 @@ var Navigation = ({
4135
4148
  className: "pts-sub-navigation-container",
4136
4149
  id: "sub-menu-" + index,
4137
4150
  role: "region",
4138
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { className: "pts-sub-navigation-list", lang: activatedLanguage, children: children.map(({ label: label2, href: href2 }, index2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4139
- "li",
4151
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ul", { className: "pts-sub-navigation-list", lang: activatedLanguage, children: children.map(({ label: label2, href: href2 }, index2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("li", { className: "pts-sub-navigation-item", lang: activatedLanguage, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4152
+ LinkComponent,
4140
4153
  {
4141
- className: "pts-sub-navigation-item",
4142
- lang: activatedLanguage,
4143
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LinkComponent, { onClick: () => handleMenuClick("link"), href: href2, children: label2[activatedLanguage] })
4144
- },
4145
- "nav-child-" + index2
4146
- )) })
4154
+ onClick: () => handleMenuClick("link"),
4155
+ href: href2,
4156
+ children: label2[activatedLanguage]
4157
+ }
4158
+ ) }, "nav-child-" + index2)) })
4147
4159
  }
4148
4160
  )
4149
4161
  ]
@@ -4210,7 +4222,7 @@ var import_jsx_runtime33 = require("react/jsx-runtime");
4210
4222
  var NavigationHeader = ({
4211
4223
  headline = void 0,
4212
4224
  homelink = "",
4213
- //??
4225
+ //??
4214
4226
  activatedLanguage = "sv",
4215
4227
  useLanguage = false,
4216
4228
  useNavigationMenu = true,
@@ -4284,23 +4296,14 @@ var NavigationHeader = ({
4284
4296
  ) }),
4285
4297
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `${hasHeadline ? "pts-navigation-header-headline-container" : ""}`, children: hasHeadline && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "pts-site-headline", children: headline }) }),
4286
4298
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "pts-navigation-header-nav-container", children: (useLanguage || useNavigationMenu || useSearch) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
4287
- useSearch && !isMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4288
- "button",
4289
- {
4290
- type: "button",
4291
- className: "pts-secondary-button",
4292
- onClick: handleSearchClick,
4293
- children: [
4294
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true", className: "pts-navigation-header-icons", children: getSearchIcon() }),
4295
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pts-navigation-header-button-label", children: getSearchLabel() })
4296
- ]
4297
- }
4298
- ) }),
4299
+ useSearch && !isMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", onClick: handleSearchClick, children: [
4300
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true", className: "pts-navigation-header-icons", children: getSearchIcon() }),
4301
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pts-navigation-header-button-label", children: getSearchLabel() })
4302
+ ] }) }),
4299
4303
  useLanguage && !isMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4300
4304
  "button",
4301
4305
  {
4302
4306
  type: "button",
4303
- className: "pts-secondary-button",
4304
4307
  lang: activatedLanguage === "en" ? "en" : "sv",
4305
4308
  onClick: handleLanguageClick,
4306
4309
  "aria-label": activatedLanguage === "sv" ? "Change language to English" : "\xC4ndra spr\xE5k till svenska",
@@ -4314,20 +4317,12 @@ var NavigationHeader = ({
4314
4317
  "button",
4315
4318
  {
4316
4319
  type: "button",
4317
- className: "pts-secondary-button",
4318
4320
  onClick: handleMenuClick,
4319
4321
  "aria-expanded": isMenuOpen,
4320
4322
  "aria-controls": "main-navigation",
4321
4323
  ref: menuButtonFocusRef,
4322
4324
  children: [
4323
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4324
- "span",
4325
- {
4326
- "aria-hidden": "true",
4327
- className: isMenuOpen ? "pts-close-icon" : "pts-open-icon",
4328
- children: getMenuIcon()
4329
- }
4330
- ),
4325
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true", className: isMenuOpen ? "pts-close-icon" : "pts-open-icon", children: getMenuIcon() }),
4331
4326
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pts-navigation-header-button-label", children: getMenuLabel() })
4332
4327
  ]
4333
4328
  }
@@ -4794,7 +4789,7 @@ var FormStatusMessagesScreenReader_default = FormStatusMessagesScreenReader;
4794
4789
  QuestionGroup,
4795
4790
  QuestionRenderer,
4796
4791
  RadioMultipleStandard,
4797
- RadioMultipleWithInfo2Standard,
4792
+ RadioMultipleWithInfoStandard,
4798
4793
  SearchBar,
4799
4794
  SingleCheckboxStandard,
4800
4795
  SkipLinkStandard,