optimized-react-component-library-xyz123 2.5.9 → 2.5.11

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.mjs CHANGED
@@ -1425,10 +1425,10 @@ var InputInfoOnly = ({
1425
1425
  };
1426
1426
  var InfoOnlyStandard_default = InputInfoOnly;
1427
1427
 
1428
- // src/components/input-components/RadioMultipleWithInfoStandard/RadioMultipleWithInfoStandard.tsx
1428
+ // src/components/input-components/RadioMultipleWithInfo2Standard/RadioMultipleWithInfo2Standard.tsx
1429
1429
  import React7 from "react";
1430
1430
 
1431
- // src/components/input-components/RadioMultipleWithInfoStandard/RadioCollapseItem.tsx
1431
+ // src/components/input-components/RadioMultipleWithInfo2Standard/RadioCollapseItem.tsx
1432
1432
  import { useEffect as useEffect7, useState as useState7 } from "react";
1433
1433
  import DOMPurify6 from "dompurify";
1434
1434
 
@@ -1873,7 +1873,7 @@ var Logo_en = () => /* @__PURE__ */ jsxs15("svg", { width: "189.0", height: "40"
1873
1873
  )
1874
1874
  ] });
1875
1875
 
1876
- // src/components/input-components/RadioMultipleWithInfoStandard/RadioCollapseItem.tsx
1876
+ // src/components/input-components/RadioMultipleWithInfo2Standard/RadioCollapseItem.tsx
1877
1877
  import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
1878
1878
  var RadioCollapseItem = ({
1879
1879
  index,
@@ -1951,7 +1951,7 @@ var RadioCollapseItem = ({
1951
1951
  };
1952
1952
  var RadioCollapseItem_default = RadioCollapseItem;
1953
1953
 
1954
- // src/components/input-components/RadioMultipleWithInfoStandard/RadioMultipleWithInfoStandard.tsx
1954
+ // src/components/input-components/RadioMultipleWithInfo2Standard/RadioMultipleWithInfo2Standard.tsx
1955
1955
  import { Fragment as Fragment14, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
1956
1956
  var RadioWithInfo = ({
1957
1957
  question,
@@ -1985,7 +1985,7 @@ var RadioWithInfo = ({
1985
1985
  }
1986
1986
  const groupedOptionArray = groupByCategoryArray((_a = question.options) != null ? _a : []);
1987
1987
  return /* @__PURE__ */ jsxs17(Fragment14, { children: [
1988
- !showPreview && question.visible && /* @__PURE__ */ jsx21("div", { className: "pts-root-question pts-radioMultipleWithInfo-container", id: questionId, children: /* @__PURE__ */ jsxs17(
1988
+ !showPreview && question.visible && /* @__PURE__ */ jsx21("div", { className: "pts-root-question pts-radioMultipleWithInfo2-container", id: questionId, children: /* @__PURE__ */ jsxs17(
1989
1989
  "fieldset",
1990
1990
  {
1991
1991
  "aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
@@ -2001,28 +2001,26 @@ var RadioWithInfo = ({
2001
2001
  let subId = "subheading-" + g_index;
2002
2002
  return /* @__PURE__ */ jsxs17(React7.Fragment, { children: [
2003
2003
  /* @__PURE__ */ jsx21("p", { className: "pts-radioWithInfo-sub-headline", id: subId, children: group.category }),
2004
- /* @__PURE__ */ jsx21("div", { role: "group", "aria-labelledby": subId, children: (_a2 = group.items) == null ? void 0 : _a2.map(
2005
- (option, o_index) => {
2006
- var _a3, _b2, _c2, _d, _e;
2007
- index++;
2008
- return /* @__PURE__ */ jsx21(
2009
- RadioCollapseItem_default,
2010
- {
2011
- label: option.label,
2012
- index,
2013
- questionId,
2014
- groupId,
2015
- value: (_a3 = option.value) != null ? _a3 : "",
2016
- questionAnswer: (_b2 = question.answer) != null ? _b2 : "",
2017
- handleInputChange,
2018
- initialOpen: question.answer === option.value,
2019
- questionIsMandatory: (_c2 = question.isQuestionMandatory) != null ? _c2 : false,
2020
- optionText: (_e = (_d = group.items.find((optionInfo) => optionInfo.value === option.value)) == null ? void 0 : _d.info) != null ? _e : "",
2021
- activatedLanguage
2022
- }
2023
- );
2024
- }
2025
- ) })
2004
+ /* @__PURE__ */ jsx21("div", { role: "group", "aria-labelledby": subId, children: (_a2 = group.items) == null ? void 0 : _a2.map((option, o_index) => {
2005
+ var _a3, _b2, _c2, _d, _e;
2006
+ index++;
2007
+ return /* @__PURE__ */ jsx21(
2008
+ RadioCollapseItem_default,
2009
+ {
2010
+ label: option.label,
2011
+ index,
2012
+ questionId,
2013
+ groupId,
2014
+ value: (_a3 = option.value) != null ? _a3 : "",
2015
+ questionAnswer: (_b2 = question.answer) != null ? _b2 : "",
2016
+ handleInputChange,
2017
+ initialOpen: question.answer === option.value,
2018
+ questionIsMandatory: (_c2 = question.isQuestionMandatory) != null ? _c2 : false,
2019
+ optionText: (_e = (_d = group.items.find((optionInfo) => optionInfo.value === option.value)) == null ? void 0 : _d.info) != null ? _e : "",
2020
+ activatedLanguage
2021
+ }
2022
+ );
2023
+ }) })
2026
2024
  ] }, subId);
2027
2025
  }),
2028
2026
  /* @__PURE__ */ jsx21(
@@ -2040,16 +2038,23 @@ var RadioWithInfo = ({
2040
2038
  showPreview && /* @__PURE__ */ jsx21(PreviewRadio2, { question })
2041
2039
  ] });
2042
2040
  };
2043
- var RadioMultipleWithInfoStandard_default = RadioWithInfo;
2041
+ var RadioMultipleWithInfo2Standard_default = RadioWithInfo;
2044
2042
  var PreviewRadio2 = ({ question }) => {
2045
2043
  var _a, _b;
2046
2044
  const previewId = `preview-${question.id}`;
2047
2045
  return /* @__PURE__ */ jsxs17(Fragment14, { children: [
2048
2046
  /* @__PURE__ */ jsx21("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
2049
- ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx21("dd", { className: "pts-radioMultipleWithInfo-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx21(
2047
+ ((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx21(
2050
2048
  "dd",
2051
2049
  {
2052
- className: "pts-radioMultipleWithInfo-preview pts-root-answer no-answer-preview-page",
2050
+ className: "pts-radioMultipleWithInfo2-preview pts-root-answer",
2051
+ id: `answer-${previewId}`,
2052
+ children: question.answer
2053
+ }
2054
+ ) : /* @__PURE__ */ jsx21(
2055
+ "dd",
2056
+ {
2057
+ className: "pts-radioMultipleWithInfo2-preview pts-root-answer no-answer-preview-page",
2053
2058
  id: `answer-${previewId}`,
2054
2059
  children: "Inget svar"
2055
2060
  }
@@ -2302,7 +2307,8 @@ var createGlobalLanguageSlice = (initialConfig, options) => {
2302
2307
  languageSupportLoaded: true,
2303
2308
  backButton: initialLang.backButton,
2304
2309
  forwardButton: initialLang.forwardButton,
2305
- sendButton: initialLang.sendButton
2310
+ sendButton: initialLang.sendButton,
2311
+ restartButton: initialLang.restartButton
2306
2312
  };
2307
2313
  const slice = createSlice({
2308
2314
  name,
@@ -2317,6 +2323,7 @@ var createGlobalLanguageSlice = (initialConfig, options) => {
2317
2323
  state.backButton = lang.backButton;
2318
2324
  state.forwardButton = lang.forwardButton;
2319
2325
  state.sendButton = lang.sendButton;
2326
+ state.restartButton = lang.restartButton;
2320
2327
  },
2321
2328
  setGlobalLangauage: (state, action) => {
2322
2329
  state.languageSupport = action.payload.languageSupport;
@@ -2325,6 +2332,7 @@ var createGlobalLanguageSlice = (initialConfig, options) => {
2325
2332
  state.backButton = lang.backButton;
2326
2333
  state.forwardButton = lang.forwardButton;
2327
2334
  state.sendButton = lang.sendButton;
2335
+ state.restartButton = lang.restartButton;
2328
2336
  state.languageSupportLoaded = true;
2329
2337
  }
2330
2338
  }
@@ -2347,7 +2355,8 @@ var makeglobalLanguageSelectors = (selectSlice) => {
2347
2355
  ...applicationContent,
2348
2356
  backButton: match.backButton,
2349
2357
  forwardButton: match.forwardButton,
2350
- sendButton: match.sendButton
2358
+ sendButton: match.sendButton,
2359
+ restartButton: match.restartButton
2351
2360
  };
2352
2361
  }
2353
2362
  );
@@ -2798,7 +2807,7 @@ var QuestionRenderer = ({
2798
2807
  }
2799
2808
  ),
2800
2809
  question.questionType === "RadioWithInfo" && /* @__PURE__ */ jsx22(
2801
- RadioMultipleWithInfoStandard_default,
2810
+ RadioMultipleWithInfo2Standard_default,
2802
2811
  {
2803
2812
  question,
2804
2813
  handleQuestionInputChange,
@@ -4170,8 +4179,55 @@ var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
4170
4179
  };
4171
4180
  var StepperStandard_default = Stepper;
4172
4181
 
4173
- // src/components/validation-and-status/ValidationErrorSummaryList/ValidationErrorSummaryList.tsx
4182
+ // src/components/stepper/StepperButtonsNoApiStandard/StepperButtonsNoApiStandard.tsx
4174
4183
  import { Fragment as Fragment20, jsx as jsx41, jsxs as jsxs33 } from "react/jsx-runtime";
4184
+ var StepperButtonsNoApi = ({
4185
+ globalLanguageState,
4186
+ changeStepHandler,
4187
+ nextStepButtonHandler,
4188
+ onSubmitHandler,
4189
+ steps,
4190
+ activeStep,
4191
+ appUsesResetButton = true
4192
+ }) => {
4193
+ const totalSteps = steps ? steps.length : "";
4194
+ return /* @__PURE__ */ jsxs33("div", { className: "pts-stepperButtons-container", children: [
4195
+ activeStep === 0 && /* @__PURE__ */ jsx41(Fragment20, { children: /* @__PURE__ */ jsx41(
4196
+ "button",
4197
+ {
4198
+ type: "button",
4199
+ className: "pts-forwardButton",
4200
+ onClick: activeStep !== totalSteps ? nextStepButtonHandler : onSubmitHandler,
4201
+ children: activeStep !== totalSteps && globalLanguageState ? globalLanguageState.forwardButton : ""
4202
+ }
4203
+ ) }),
4204
+ activeStep !== 0 && activeStep !== totalSteps && /* @__PURE__ */ jsxs33(Fragment20, { children: [
4205
+ /* @__PURE__ */ jsx41(
4206
+ "button",
4207
+ {
4208
+ onClick: () => changeStepHandler(activeStep - 1),
4209
+ className: "pts-backButton",
4210
+ type: "button",
4211
+ children: globalLanguageState ? globalLanguageState.backButton : "<<"
4212
+ }
4213
+ ),
4214
+ /* @__PURE__ */ jsx41(
4215
+ "button",
4216
+ {
4217
+ type: "button",
4218
+ className: "pts-forwardButton",
4219
+ onClick: activeStep !== totalSteps ? nextStepButtonHandler : onSubmitHandler,
4220
+ children: activeStep !== totalSteps && globalLanguageState ? globalLanguageState.forwardButton : ""
4221
+ }
4222
+ )
4223
+ ] }),
4224
+ appUsesResetButton && activeStep === totalSteps && /* @__PURE__ */ jsx41("button", { onClick: () => changeStepHandler(0), className: "pts-backButton", type: "button", children: globalLanguageState && globalLanguageState.restartButton ? globalLanguageState.restartButton : "Starta om" })
4225
+ ] });
4226
+ };
4227
+ var StepperButtonsNoApiStandard_default = StepperButtonsNoApi;
4228
+
4229
+ // src/components/validation-and-status/ValidationErrorSummaryList/ValidationErrorSummaryList.tsx
4230
+ import { Fragment as Fragment21, jsx as jsx42, jsxs as jsxs34 } from "react/jsx-runtime";
4175
4231
  var ValidationErrorSummaryList = ({
4176
4232
  validationErrorsList,
4177
4233
  questions,
@@ -4208,7 +4264,7 @@ var ValidationErrorSummaryList = ({
4208
4264
  }, 300);
4209
4265
  }
4210
4266
  }
4211
- if (!validationErrorsList.length) return /* @__PURE__ */ jsx41(Fragment20, {});
4267
+ if (!validationErrorsList.length) return /* @__PURE__ */ jsx42(Fragment21, {});
4212
4268
  const filteredIds = filterIdsByGroupCheck(validationErrorsList, questions);
4213
4269
  const count = filteredIds.length;
4214
4270
  const title = summaryText.replace("{count}", count.toString()).replace(
@@ -4220,11 +4276,11 @@ var ValidationErrorSummaryList = ({
4220
4276
  const found = questions.find((item) => item.id === id);
4221
4277
  return (_a = found == null ? void 0 : found.validationSummaryLabel) != null ? _a : found == null ? void 0 : found.questionLabel;
4222
4278
  }
4223
- return /* @__PURE__ */ jsxs33("div", { className: `pts-errorSummary-container pts-root-error ${validationErrorsList.length === 0 ? "cleanPadding" : ""}`, children: [
4224
- /* @__PURE__ */ jsx41("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
4225
- /* @__PURE__ */ jsxs33("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
4226
- /* @__PURE__ */ jsx41("h2", { id: "errorSummary-headline", children: title }),
4227
- /* @__PURE__ */ jsx41("ul", { id: "errorSummary-ul", children: filteredIds.map((questionId, i) => /* @__PURE__ */ jsx41("li", { children: /* @__PURE__ */ jsx41(
4279
+ return /* @__PURE__ */ jsxs34("div", { className: `pts-errorSummary-container pts-root-error ${validationErrorsList.length === 0 ? "cleanPadding" : ""}`, children: [
4280
+ /* @__PURE__ */ jsx42("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
4281
+ /* @__PURE__ */ jsxs34("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
4282
+ /* @__PURE__ */ jsx42("h2", { id: "errorSummary-headline", children: title }),
4283
+ /* @__PURE__ */ jsx42("ul", { id: "errorSummary-ul", children: filteredIds.map((questionId, i) => /* @__PURE__ */ jsx42("li", { children: /* @__PURE__ */ jsx42(
4228
4284
  "a",
4229
4285
  {
4230
4286
  href: "#",
@@ -4242,11 +4298,11 @@ var ValidationErrorSummaryList = ({
4242
4298
  var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
4243
4299
 
4244
4300
  // src/components/validation-and-status/FormStatusMessagesScreenReader/FormStatusMessagesScreenReader.tsx
4245
- import { Fragment as Fragment21, jsx as jsx42, jsxs as jsxs34 } from "react/jsx-runtime";
4301
+ import { Fragment as Fragment22, jsx as jsx43, jsxs as jsxs35 } from "react/jsx-runtime";
4246
4302
  var FormStatusMessagesScreenReader = ({ formStatus, activatedLanguage = "sv" }) => {
4247
- return /* @__PURE__ */ jsxs34(Fragment21, { children: [
4248
- /* @__PURE__ */ jsx42("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ jsx42("span", { className: "pts-root-mandatoryAsterisk", children: activatedLanguage === "en" ? "Something went wrong, please try again later or contact us!" : "N\xE5got gick fel, f\xF6rs\xF6k igen senare eller kontakta oss!" }) }),
4249
- /* @__PURE__ */ jsx42("div", { "aria-live": "polite", className: "visually-hidden", children: formStatus === "loading" ? activatedLanguage === "en" ? "Your case is being registered. Please do not refresh or close the page." : "Ditt \xE4rende registreras. Uppdatera eller st\xE4ng inte sidan." : "" })
4303
+ return /* @__PURE__ */ jsxs35(Fragment22, { children: [
4304
+ /* @__PURE__ */ jsx43("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ jsx43("span", { className: "pts-root-mandatoryAsterisk", children: activatedLanguage === "en" ? "Something went wrong, please try again later or contact us!" : "N\xE5got gick fel, f\xF6rs\xF6k igen senare eller kontakta oss!" }) }),
4305
+ /* @__PURE__ */ jsx43("div", { "aria-live": "polite", className: "visually-hidden", children: formStatus === "loading" ? activatedLanguage === "en" ? "Your case is being registered. Please do not refresh or close the page." : "Ditt \xE4rende registreras. Uppdatera eller st\xE4ng inte sidan." : "" })
4250
4306
  ] });
4251
4307
  };
4252
4308
  var FormStatusMessagesScreenReader_default = FormStatusMessagesScreenReader;
@@ -4271,11 +4327,12 @@ export {
4271
4327
  QuestionGroup_default as QuestionGroup,
4272
4328
  QuestionRenderer_default as QuestionRenderer,
4273
4329
  RadioMultipleStandard_default as RadioMultipleStandard,
4274
- RadioMultipleWithInfoStandard_default as RadioMultipleWithInfoStandard,
4330
+ RadioMultipleWithInfo2Standard_default as RadioMultipleWithInfo2Standard,
4275
4331
  SearchBarStandard_default as SearchBar,
4276
4332
  SingleCheckboxStandard_default as SingleCheckboxStandard,
4277
4333
  SkipLinkStandard_default as SkipLinkStandard,
4278
4334
  StartApplicationButton_default as StartApplicationButton,
4335
+ StepperButtonsNoApiStandard_default as StepperButtonsNoApiStandard,
4279
4336
  StepperButtonsStandard_default as StepperButtonsStandard,
4280
4337
  StepperStandard_default as StepperStandard,
4281
4338
  TextAreaStandard_default as TextAreaStandard,