optimized-react-component-library-xyz123 0.1.56 → 0.1.58

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.
Files changed (3) hide show
  1. package/dist/index.js +60 -112
  2. package/dist/index.mjs +127 -179
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -858,40 +858,7 @@ var ScreenReaderErrors = ({
858
858
  setActivateErrorMessagesForScreenReader(false);
859
859
  }, 1e3);
860
860
  };
861
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
862
- errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
863
- "button",
864
- {
865
- onClick: handleRemoveErrors,
866
- style: {
867
- marginRight: "8px",
868
- backgroundColor: "transparent",
869
- border: "none",
870
- textDecoration: "underline",
871
- cursor: "pointer"
872
- },
873
- className: "errorMessageAddingFile",
874
- "aria-label": activatedLanguage === "sv" ? "Ta bort felmeddelande f\xF6r uppladdning av filer" : "Remove error message for file uploads",
875
- children: "Ta bort fel! / Remove errors!"
876
- }
877
- ),
878
- activateErrorMessagesForScreenReader && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
879
- "p",
880
- {
881
- role: "alert",
882
- style: {
883
- position: "absolute",
884
- left: "-9999px",
885
- top: "auto",
886
- width: "1px",
887
- height: "1px",
888
- overflow: "hidden"
889
- },
890
- "aria-atomic": "true",
891
- children: errorMessagesForScreenReader
892
- }
893
- )
894
- ] });
861
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: activateErrorMessagesForScreenReader && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", className: "sr-only", "aria-atomic": "true", children: errorMessagesForScreenReader }) });
895
862
  };
896
863
  var ScreenReaderErrors_default = ScreenReaderErrors;
897
864
 
@@ -899,7 +866,6 @@ var ScreenReaderErrors_default = ScreenReaderErrors;
899
866
  var import_jsx_runtime8 = require("react/jsx-runtime");
900
867
  var ExploreFiles = ({
901
868
  FilesSelected,
902
- //UploadButtonText = 'upload files',
903
869
  numberOfFiles,
904
870
  allowedNumberOfFiles,
905
871
  activatedLanguage,
@@ -911,20 +877,16 @@ var ExploreFiles = ({
911
877
  showErrors,
912
878
  errorMessageAddingFile,
913
879
  removeUploadErrors = () => {
914
- alert("finns ingen funktion");
915
880
  }
916
881
  }) => {
917
882
  const fileInputRef = (0, import_react4.useRef)(null);
918
883
  const buttonInputRef = (0, import_react4.useRef)(null);
919
884
  const [showErrorMessagesForScreenReader, setShowErrorMessagesForScreenReader] = import_react4.default.useState(false);
920
- const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = import_react4.default.useState("");
921
885
  (0, import_react4.useEffect)(() => {
922
886
  const button = buttonInputRef.current;
923
887
  if (!button) return;
924
888
  const handleFocus = () => {
925
889
  setShowErrorMessagesForScreenReader(!showErrorMessagesForScreenReader);
926
- console.log("FOCUS!!");
927
- console.log("Error messages for screen reader: " + errorMessageAddingFile);
928
890
  };
929
891
  button.addEventListener("focus", handleFocus);
930
892
  return () => {
@@ -940,15 +902,6 @@ var ExploreFiles = ({
940
902
  var _a;
941
903
  (_a = fileInputRef.current) == null ? void 0 : _a.click();
942
904
  };
943
- const handleRemoveErrors = () => {
944
- const errorMessages = activatedLanguage === "sv" ? `Felmeddelande raderat.` : `Error message deleted.`;
945
- setErrorMessagesForScreenReader(errorMessages);
946
- removeUploadErrors();
947
- putFocusOnButton();
948
- setTimeout(() => {
949
- setShowErrorMessagesForScreenReader(false);
950
- }, 1e3);
951
- };
952
905
  const putFocusOnButton = () => {
953
906
  var _a;
954
907
  (_a = buttonInputRef.current) == null ? void 0 : _a.focus();
@@ -976,7 +929,7 @@ var ExploreFiles = ({
976
929
  "filePickButton",
977
930
  showErrors && questionObject.error ? "filePickButton error" : ""
978
931
  ),
979
- "aria-describedby": `${aboutId} ${showErrors && questionObject.error ? errorId : ""}`.trim(),
932
+ "aria-describedby": `${aboutId} ${questionObject.hasValidationError ? errorId : ""}`.trim(),
980
933
  "aria-label": `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`,
981
934
  children: activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"
982
935
  }
@@ -1037,7 +990,8 @@ var SelectedFiles = ({
1037
990
  errorMessageAddingFile,
1038
991
  activatedLanguage,
1039
992
  numberOfFiles,
1040
- setNumberOfFiles
993
+ setNumberOfFiles,
994
+ removeUploadErrors
1041
995
  }) => {
1042
996
  const theDiv = (0, import_react6.useRef)(null);
1043
997
  const remove = (file) => {
@@ -1067,57 +1021,58 @@ var SelectedFiles = ({
1067
1021
  };
1068
1022
  const windowWidth = useWindowWidth();
1069
1023
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1070
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { className: "fileListUnorderedList", "aria-label": "Valideringsfelmeddelanden f\xF6r uppladdade filer", children: [
1071
- " ",
1072
- errorMessageAddingFile.map((errorObj, index) => {
1073
- const errorFileName = errorObj.FileName;
1074
- let mobileFirstFileName = errorObj.FileName.split(".").shift();
1075
- mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
1076
- const fileType = errorObj.FileName.split(".").pop();
1077
- mobileFirstFileName = mobileFirstFileName + "." + fileType;
1078
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react6.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "fileInListContainer", role: "alert", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "fileInList", children: [
1079
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_bootstrap.Row, { children: [
1080
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1081
- "span",
1082
- {
1083
- "aria-hidden": "true",
1084
- className: (0, import_clsx4.default)("uploadedDot", "uploadFailed"),
1085
- children: "!"
1086
- }
1087
- ) }),
1088
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { children: windowWidth < 768 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "desktopFileName", children: errorObj.FileName }) }),
1089
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1090
- "button",
1024
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
1025
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { "aria-hidden": true, className: "fileListUnorderedList", children: [
1026
+ " ",
1027
+ errorMessageAddingFile.map((errorObj, index) => {
1028
+ const errorFileName = errorObj.FileName;
1029
+ let mobileFirstFileName = errorObj.FileName.split(".").shift();
1030
+ mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
1031
+ const fileType = errorObj.FileName.split(".").pop();
1032
+ mobileFirstFileName = mobileFirstFileName + "." + fileType;
1033
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react6.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "fileInListContainer", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "fileInList", children: [
1034
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_bootstrap.Row, { children: [
1035
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1036
+ "span",
1037
+ {
1038
+ "aria-hidden": "true",
1039
+ className: (0, import_clsx4.default)("uploadedDot", "uploadFailed"),
1040
+ children: "!"
1041
+ }
1042
+ ) }),
1043
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { children: windowWidth < 768 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "desktopFileName", children: errorObj.FileName }) }),
1044
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol" })
1045
+ ] }),
1046
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1047
+ import_react_bootstrap.Col,
1091
1048
  {
1092
- className: "selectedFilesLinkButton",
1093
- onClick: () => {
1094
- removeError(index);
1049
+ style: {
1050
+ width: "100%",
1051
+ color: "#8e0039"
1052
+ },
1053
+ className: "errorMessageAddingFile",
1054
+ ...activatedLanguage === "sv" ? {
1055
+ "aria-label": `${errorFileName} ${errorObj.svMessage}`
1056
+ } : {
1057
+ "aria-label": `${errorFileName} ${errorObj.enMessage}`
1095
1058
  },
1096
- "aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelandet f\xF6r ${errorFileName}` : `Close error message for ${errorFileName}`,
1097
- children: activatedLanguage === "sv" ? "St\xE4ng" : "Close"
1059
+ children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
1098
1060
  }
1099
- ) })
1100
- ] }),
1101
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1102
- import_react_bootstrap.Col,
1103
- {
1104
- style: {
1105
- width: "100%",
1106
- color: "#8e0039"
1107
- },
1108
- className: "errorMessageAddingFile",
1109
- ...activatedLanguage === "sv" ? {
1110
- "aria-label": `${errorFileName} ${errorObj.svMessage}`
1111
- } : {
1112
- "aria-label": `${errorFileName} ${errorObj.enMessage}`
1113
- },
1114
- children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
1115
- }
1116
- ) }),
1117
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "makeSpace" }) })
1118
- ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
1119
- })
1120
- ] }) }),
1061
+ ) }),
1062
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "makeSpace" }) })
1063
+ ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
1064
+ })
1065
+ ] }),
1066
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1067
+ "button",
1068
+ {
1069
+ onClick: removeUploadErrors,
1070
+ className: "errorMessageAddingFile",
1071
+ "aria-label": activatedLanguage === "sv" ? "Ta bort felmeddelande f\xF6r uppladdning av filer" : "Remove error message for file uploads",
1072
+ children: "X"
1073
+ }
1074
+ )
1075
+ ] }),
1121
1076
  questionObject.Files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.Files.map((file, index) => {
1122
1077
  const indicatorfileName = file.FileName;
1123
1078
  let mobileFirstFileName = file.FileName.split(".").shift();
@@ -1149,13 +1104,12 @@ var SelectedFiles = ({
1149
1104
  mobileFirstFileName,
1150
1105
  " (",
1151
1106
  Math.ceil(file.FileSize / (1024 * 1024)),
1152
- " MB)"
1107
+ " ",
1108
+ "MB)"
1153
1109
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "desktopFileName", children: [
1154
1110
  file.FileName,
1155
1111
  " (",
1156
- file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(
1157
- 1
1158
- )} MB`,
1112
+ file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(1)} MB`,
1159
1113
  ")"
1160
1114
  ] }) }),
1161
1115
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -1349,7 +1303,6 @@ var AddFiles = ({
1349
1303
  };
1350
1304
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1351
1305
  !showPreview && visible && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { role: "group", children: [
1352
- !questionObject.hideQuestion && questionObject.questionLabel,
1353
1306
  questionObject.aboutText && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1354
1307
  "p",
1355
1308
  {
@@ -1369,14 +1322,8 @@ var AddFiles = ({
1369
1322
  ),
1370
1323
  questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "error addfileserror", id: errorId, children: [
1371
1324
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
1372
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1373
- "span",
1374
- {
1375
- "aria-label": `Felmeddelande. ${questionObject.validationDefaultMessesege}`,
1376
- className: "errorText",
1377
- children: questionObject.validationDefaultMessesege
1378
- }
1379
- )
1325
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
1326
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
1380
1327
  ] }),
1381
1328
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1382
1329
  ExploreFilesStandard_default,
@@ -1405,7 +1352,8 @@ var AddFiles = ({
1405
1352
  errorMessageAddingFile,
1406
1353
  activatedLanguage,
1407
1354
  numberOfFiles,
1408
- setNumberOfFiles
1355
+ setNumberOfFiles,
1356
+ removeUploadErrors: handleRemoveErrors
1409
1357
  }
1410
1358
  )
1411
1359
  ] }) }),
package/dist/index.mjs CHANGED
@@ -761,7 +761,7 @@ import clsx2 from "clsx";
761
761
 
762
762
  // src/NewInputComponentStandard/AddFilesStandard/ScreenReaderErrors.tsx
763
763
  import React2 from "react";
764
- import { Fragment as Fragment7, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
764
+ import { Fragment as Fragment7, jsx as jsx7 } from "react/jsx-runtime";
765
765
  var ScreenReaderErrors = ({
766
766
  errorMessageAddingFile,
767
767
  activatedLanguage,
@@ -793,48 +793,14 @@ var ScreenReaderErrors = ({
793
793
  setActivateErrorMessagesForScreenReader(false);
794
794
  }, 1e3);
795
795
  };
796
- return /* @__PURE__ */ jsxs7(Fragment7, { children: [
797
- errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsx7(
798
- "button",
799
- {
800
- onClick: handleRemoveErrors,
801
- style: {
802
- marginRight: "8px",
803
- backgroundColor: "transparent",
804
- border: "none",
805
- textDecoration: "underline",
806
- cursor: "pointer"
807
- },
808
- className: "errorMessageAddingFile",
809
- "aria-label": activatedLanguage === "sv" ? "Ta bort felmeddelande f\xF6r uppladdning av filer" : "Remove error message for file uploads",
810
- children: "Ta bort fel! / Remove errors!"
811
- }
812
- ),
813
- activateErrorMessagesForScreenReader && /* @__PURE__ */ jsx7(
814
- "p",
815
- {
816
- role: "alert",
817
- style: {
818
- position: "absolute",
819
- left: "-9999px",
820
- top: "auto",
821
- width: "1px",
822
- height: "1px",
823
- overflow: "hidden"
824
- },
825
- "aria-atomic": "true",
826
- children: errorMessagesForScreenReader
827
- }
828
- )
829
- ] });
796
+ return /* @__PURE__ */ jsx7(Fragment7, { children: activateErrorMessagesForScreenReader && /* @__PURE__ */ jsx7("p", { role: "alert", className: "sr-only", "aria-atomic": "true", children: errorMessagesForScreenReader }) });
830
797
  };
831
798
  var ScreenReaderErrors_default = ScreenReaderErrors;
832
799
 
833
800
  // src/NewInputComponentStandard/AddFilesStandard/ExploreFilesStandard.tsx
834
- import { Fragment as Fragment8, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
801
+ import { Fragment as Fragment8, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
835
802
  var ExploreFiles = ({
836
803
  FilesSelected,
837
- //UploadButtonText = 'upload files',
838
804
  numberOfFiles,
839
805
  allowedNumberOfFiles,
840
806
  activatedLanguage,
@@ -846,20 +812,16 @@ var ExploreFiles = ({
846
812
  showErrors,
847
813
  errorMessageAddingFile,
848
814
  removeUploadErrors = () => {
849
- alert("finns ingen funktion");
850
815
  }
851
816
  }) => {
852
817
  const fileInputRef = useRef2(null);
853
818
  const buttonInputRef = useRef2(null);
854
819
  const [showErrorMessagesForScreenReader, setShowErrorMessagesForScreenReader] = React3.useState(false);
855
- const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = React3.useState("");
856
820
  useEffect3(() => {
857
821
  const button = buttonInputRef.current;
858
822
  if (!button) return;
859
823
  const handleFocus = () => {
860
824
  setShowErrorMessagesForScreenReader(!showErrorMessagesForScreenReader);
861
- console.log("FOCUS!!");
862
- console.log("Error messages for screen reader: " + errorMessageAddingFile);
863
825
  };
864
826
  button.addEventListener("focus", handleFocus);
865
827
  return () => {
@@ -875,22 +837,13 @@ var ExploreFiles = ({
875
837
  var _a;
876
838
  (_a = fileInputRef.current) == null ? void 0 : _a.click();
877
839
  };
878
- const handleRemoveErrors = () => {
879
- const errorMessages = activatedLanguage === "sv" ? `Felmeddelande raderat.` : `Error message deleted.`;
880
- setErrorMessagesForScreenReader(errorMessages);
881
- removeUploadErrors();
882
- putFocusOnButton();
883
- setTimeout(() => {
884
- setShowErrorMessagesForScreenReader(false);
885
- }, 1e3);
886
- };
887
840
  const putFocusOnButton = () => {
888
841
  var _a;
889
842
  (_a = buttonInputRef.current) == null ? void 0 : _a.focus();
890
843
  };
891
844
  let addFilesInfoText = numberOfFiles > 0 ? activatedLanguage === "sv" ? `${numberOfFiles} filer valda (max ${allowedNumberOfFiles})` : `${numberOfFiles} files chosed (max ${allowedNumberOfFiles})` : activatedLanguage === "sv" ? "Ingen fil vald" : "No file chosen";
892
- return /* @__PURE__ */ jsx8(Fragment8, { children: /* @__PURE__ */ jsxs8("div", { className: "inputContainer", children: [
893
- /* @__PURE__ */ jsxs8(
845
+ return /* @__PURE__ */ jsx8(Fragment8, { children: /* @__PURE__ */ jsxs7("div", { className: "inputContainer", children: [
846
+ /* @__PURE__ */ jsxs7(
894
847
  "label",
895
848
  {
896
849
  tabIndex: -1,
@@ -911,7 +864,7 @@ var ExploreFiles = ({
911
864
  "filePickButton",
912
865
  showErrors && questionObject.error ? "filePickButton error" : ""
913
866
  ),
914
- "aria-describedby": `${aboutId} ${showErrors && questionObject.error ? errorId : ""}`.trim(),
867
+ "aria-describedby": `${aboutId} ${questionObject.hasValidationError ? errorId : ""}`.trim(),
915
868
  "aria-label": `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`,
916
869
  children: activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"
917
870
  }
@@ -962,7 +915,7 @@ var IndicatorStandard_default = Indicator;
962
915
 
963
916
  // src/NewInputComponentStandard/AddFilesStandard/SelectedFilesStandard.tsx
964
917
  import clsx4 from "clsx";
965
- import { Fragment as Fragment10, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
918
+ import { Fragment as Fragment10, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
966
919
  var SelectedFiles = ({
967
920
  questionObject,
968
921
  isTouched,
@@ -972,7 +925,8 @@ var SelectedFiles = ({
972
925
  errorMessageAddingFile,
973
926
  activatedLanguage,
974
927
  numberOfFiles,
975
- setNumberOfFiles
928
+ setNumberOfFiles,
929
+ removeUploadErrors
976
930
  }) => {
977
931
  const theDiv = useRef3(null);
978
932
  const remove = (file) => {
@@ -1001,66 +955,67 @@ var SelectedFiles = ({
1001
955
  return windowWidth2;
1002
956
  };
1003
957
  const windowWidth = useWindowWidth();
1004
- return /* @__PURE__ */ jsxs9(Fragment10, { children: [
1005
- /* @__PURE__ */ jsx10("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs9("ul", { className: "fileListUnorderedList", "aria-label": "Valideringsfelmeddelanden f\xF6r uppladdade filer", children: [
1006
- " ",
1007
- errorMessageAddingFile.map((errorObj, index) => {
1008
- const errorFileName = errorObj.FileName;
1009
- let mobileFirstFileName = errorObj.FileName.split(".").shift();
1010
- mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
1011
- const fileType = errorObj.FileName.split(".").pop();
1012
- mobileFirstFileName = mobileFirstFileName + "." + fileType;
1013
- return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", role: "alert", children: /* @__PURE__ */ jsxs9("div", { className: "fileInList", children: [
1014
- /* @__PURE__ */ jsxs9(Row, { children: [
1015
- /* @__PURE__ */ jsx10(Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ jsx10(
1016
- "span",
1017
- {
1018
- "aria-hidden": "true",
1019
- className: clsx4("uploadedDot", "uploadFailed"),
1020
- children: "!"
1021
- }
1022
- ) }),
1023
- /* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsx10("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ jsx10("span", { className: "desktopFileName", children: errorObj.FileName }) }),
1024
- /* @__PURE__ */ jsx10(Col, { className: "lastCol", children: /* @__PURE__ */ jsx10(
1025
- "button",
958
+ return /* @__PURE__ */ jsxs8(Fragment10, { children: [
959
+ /* @__PURE__ */ jsxs8("div", { children: [
960
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs8("ul", { "aria-hidden": true, className: "fileListUnorderedList", children: [
961
+ " ",
962
+ errorMessageAddingFile.map((errorObj, index) => {
963
+ const errorFileName = errorObj.FileName;
964
+ let mobileFirstFileName = errorObj.FileName.split(".").shift();
965
+ mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
966
+ const fileType = errorObj.FileName.split(".").pop();
967
+ mobileFirstFileName = mobileFirstFileName + "." + fileType;
968
+ return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs8("div", { className: "fileInList", children: [
969
+ /* @__PURE__ */ jsxs8(Row, { children: [
970
+ /* @__PURE__ */ jsx10(Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ jsx10(
971
+ "span",
972
+ {
973
+ "aria-hidden": "true",
974
+ className: clsx4("uploadedDot", "uploadFailed"),
975
+ children: "!"
976
+ }
977
+ ) }),
978
+ /* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsx10("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ jsx10("span", { className: "desktopFileName", children: errorObj.FileName }) }),
979
+ /* @__PURE__ */ jsx10(Col, { className: "lastCol" })
980
+ ] }),
981
+ /* @__PURE__ */ jsx10(Row, { children: /* @__PURE__ */ jsx10(
982
+ Col,
1026
983
  {
1027
- className: "selectedFilesLinkButton",
1028
- onClick: () => {
1029
- removeError(index);
984
+ style: {
985
+ width: "100%",
986
+ color: "#8e0039"
987
+ },
988
+ className: "errorMessageAddingFile",
989
+ ...activatedLanguage === "sv" ? {
990
+ "aria-label": `${errorFileName} ${errorObj.svMessage}`
991
+ } : {
992
+ "aria-label": `${errorFileName} ${errorObj.enMessage}`
1030
993
  },
1031
- "aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelandet f\xF6r ${errorFileName}` : `Close error message for ${errorFileName}`,
1032
- children: activatedLanguage === "sv" ? "St\xE4ng" : "Close"
994
+ children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
1033
995
  }
1034
- ) })
1035
- ] }),
1036
- /* @__PURE__ */ jsx10(Row, { children: /* @__PURE__ */ jsx10(
1037
- Col,
1038
- {
1039
- style: {
1040
- width: "100%",
1041
- color: "#8e0039"
1042
- },
1043
- className: "errorMessageAddingFile",
1044
- ...activatedLanguage === "sv" ? {
1045
- "aria-label": `${errorFileName} ${errorObj.svMessage}`
1046
- } : {
1047
- "aria-label": `${errorFileName} ${errorObj.enMessage}`
1048
- },
1049
- children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
1050
- }
1051
- ) }),
1052
- /* @__PURE__ */ jsx10(Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ jsx10(Col, { className: "makeSpace" }) })
1053
- ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
1054
- })
1055
- ] }) }),
996
+ ) }),
997
+ /* @__PURE__ */ jsx10(Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ jsx10(Col, { className: "makeSpace" }) })
998
+ ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
999
+ })
1000
+ ] }),
1001
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsx10(
1002
+ "button",
1003
+ {
1004
+ onClick: removeUploadErrors,
1005
+ className: "errorMessageAddingFile",
1006
+ "aria-label": activatedLanguage === "sv" ? "Ta bort felmeddelande f\xF6r uppladdning av filer" : "Remove error message for file uploads",
1007
+ children: "X"
1008
+ }
1009
+ )
1010
+ ] }),
1056
1011
  questionObject.Files.length > 0 && /* @__PURE__ */ jsx10("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.Files.map((file, index) => {
1057
1012
  const indicatorfileName = file.FileName;
1058
1013
  let mobileFirstFileName = file.FileName.split(".").shift();
1059
1014
  mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
1060
1015
  const fileType = file.FileName.split(".").pop();
1061
1016
  mobileFirstFileName = mobileFirstFileName + "." + fileType;
1062
- return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs9("div", { className: "fileInList", children: [
1063
- /* @__PURE__ */ jsxs9(Row, { children: [
1017
+ return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs8("div", { className: "fileInList", children: [
1018
+ /* @__PURE__ */ jsxs8(Row, { children: [
1064
1019
  /* @__PURE__ */ jsx10(Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", className: "uploadedDot", children: /* @__PURE__ */ jsx10(
1065
1020
  "svg",
1066
1021
  {
@@ -1080,17 +1035,16 @@ var SelectedFiles = ({
1080
1035
  )
1081
1036
  }
1082
1037
  ) }) }),
1083
- /* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsxs9("span", { className: "mobileFirstFileName", children: [
1038
+ /* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsxs8("span", { className: "mobileFirstFileName", children: [
1084
1039
  mobileFirstFileName,
1085
1040
  " (",
1086
1041
  Math.ceil(file.FileSize / (1024 * 1024)),
1087
- " MB)"
1088
- ] }) : /* @__PURE__ */ jsxs9("span", { className: "desktopFileName", children: [
1042
+ " ",
1043
+ "MB)"
1044
+ ] }) : /* @__PURE__ */ jsxs8("span", { className: "desktopFileName", children: [
1089
1045
  file.FileName,
1090
1046
  " (",
1091
- file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(
1092
- 1
1093
- )} MB`,
1047
+ file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(1)} MB`,
1094
1048
  ")"
1095
1049
  ] }) }),
1096
1050
  /* @__PURE__ */ jsx10(Col, { className: "lastCol", children: /* @__PURE__ */ jsx10(
@@ -1113,7 +1067,7 @@ var SelectedFiles = ({
1113
1067
  var SelectedFilesStandard_default = SelectedFiles;
1114
1068
 
1115
1069
  // src/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.tsx
1116
- import { Fragment as Fragment11, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1070
+ import { Fragment as Fragment11, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
1117
1071
  var AddFiles = ({
1118
1072
  questionObject,
1119
1073
  isTouched = (e, questionObject2) => {
@@ -1282,10 +1236,9 @@ var AddFiles = ({
1282
1236
  const handleRemoveErrors = () => {
1283
1237
  setErrorMessageAddingFile([]);
1284
1238
  };
1285
- return /* @__PURE__ */ jsxs10(Fragment11, { children: [
1286
- !showPreview && visible && /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsxs10("div", { role: "group", children: [
1287
- !questionObject.hideQuestion && questionObject.questionLabel,
1288
- questionObject.aboutText && /* @__PURE__ */ jsxs10(
1239
+ return /* @__PURE__ */ jsxs9(Fragment11, { children: [
1240
+ !showPreview && visible && /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsxs9("div", { role: "group", children: [
1241
+ questionObject.aboutText && /* @__PURE__ */ jsxs9(
1289
1242
  "p",
1290
1243
  {
1291
1244
  id: aboutId,
@@ -1295,23 +1248,17 @@ var AddFiles = ({
1295
1248
  ),
1296
1249
  children: [
1297
1250
  questionObject.aboutText,
1298
- questionObject.isQuestionMandatory && /* @__PURE__ */ jsxs10("span", { className: "mandatoryAsterisk", "aria-hidden": "true", children: [
1251
+ questionObject.isQuestionMandatory && /* @__PURE__ */ jsxs9("span", { className: "mandatoryAsterisk", "aria-hidden": "true", children: [
1299
1252
  " ",
1300
1253
  "*"
1301
1254
  ] })
1302
1255
  ]
1303
1256
  }
1304
1257
  ),
1305
- questionObject.hasValidationError && /* @__PURE__ */ jsxs10("div", { className: "error addfileserror", id: errorId, children: [
1258
+ questionObject.hasValidationError && /* @__PURE__ */ jsxs9("div", { className: "error addfileserror", id: errorId, children: [
1306
1259
  /* @__PURE__ */ jsx11("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
1307
- /* @__PURE__ */ jsx11(
1308
- "span",
1309
- {
1310
- "aria-label": `Felmeddelande. ${questionObject.validationDefaultMessesege}`,
1311
- className: "errorText",
1312
- children: questionObject.validationDefaultMessesege
1313
- }
1314
- )
1260
+ /* @__PURE__ */ jsx11("span", { className: "sr-only", children: "Valideringsfel" }),
1261
+ /* @__PURE__ */ jsx11("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
1315
1262
  ] }),
1316
1263
  /* @__PURE__ */ jsx11(
1317
1264
  ExploreFilesStandard_default,
@@ -1340,7 +1287,8 @@ var AddFiles = ({
1340
1287
  errorMessageAddingFile,
1341
1288
  activatedLanguage,
1342
1289
  numberOfFiles,
1343
- setNumberOfFiles
1290
+ setNumberOfFiles,
1291
+ removeUploadErrors: handleRemoveErrors
1344
1292
  }
1345
1293
  )
1346
1294
  ] }) }),
@@ -1353,7 +1301,7 @@ var PreviewAddFiles = ({
1353
1301
  activatedLanguage
1354
1302
  }) => {
1355
1303
  const previewId = `preview-${questionObject.Id}`;
1356
- return /* @__PURE__ */ jsxs10("div", { className: "pts-question-preview pts-addFiles-preview", id: `question-${previewId}`, children: [
1304
+ return /* @__PURE__ */ jsxs9("div", { className: "pts-question-preview pts-addFiles-preview", id: `question-${previewId}`, children: [
1357
1305
  /* @__PURE__ */ jsx11("h3", { id: previewId, children: questionObject.Question }),
1358
1306
  /* @__PURE__ */ jsx11("div", { className: "pts-root-answer", children: questionObject.Files && questionObject.Files.length > 0 ? /* @__PURE__ */ jsx11("ul", { "aria-labelledby": previewId, children: questionObject.Files.map((file, index) => {
1359
1307
  return /* @__PURE__ */ jsx11("li", { children: file.FileName }, `file-${index}-${file.FileName}`);
@@ -1579,7 +1527,7 @@ function groupQuestionsByStepCategoryGroup(questions, steps, validationErrorsLis
1579
1527
  var GroupQuestionsByStepCategoryGroup_default = groupQuestionsByStepCategoryGroup;
1580
1528
 
1581
1529
  // src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
1582
- import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1530
+ import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1583
1531
  var RenderQuestion = ({
1584
1532
  question,
1585
1533
  isTouched,
@@ -1587,7 +1535,7 @@ var RenderQuestion = ({
1587
1535
  showPreview = false,
1588
1536
  hideValidationMessage
1589
1537
  }) => {
1590
- return /* @__PURE__ */ jsxs11(Fragment12, { children: [
1538
+ return /* @__PURE__ */ jsxs10(Fragment12, { children: [
1591
1539
  question.questionType === "Radio" && /* @__PURE__ */ jsx12(
1592
1540
  RadioMultipleStandard_default,
1593
1541
  {
@@ -1631,7 +1579,7 @@ var RenderQuestion_default = RenderQuestion;
1631
1579
 
1632
1580
  // src/NewRenderFormComponentStandard/RenderQuestionGroup/RenderQuestionGroup.tsx
1633
1581
  import React7 from "react";
1634
- import { Fragment as Fragment13, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1582
+ import { Fragment as Fragment13, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
1635
1583
  var RenderQuestionGroup = ({
1636
1584
  questionArray,
1637
1585
  wrapper,
@@ -1663,7 +1611,7 @@ var RenderQuestionGroup = ({
1663
1611
  }) });
1664
1612
  switch (wrapper) {
1665
1613
  case "fieldset":
1666
- return /* @__PURE__ */ jsxs12(
1614
+ return /* @__PURE__ */ jsxs11(
1667
1615
  "fieldset",
1668
1616
  {
1669
1617
  className: "pts-root-question-group-fieldset",
@@ -1672,14 +1620,14 @@ var RenderQuestionGroup = ({
1672
1620
  "aria-errormessage": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
1673
1621
  "aria-describedby": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
1674
1622
  children: [
1675
- legend && /* @__PURE__ */ jsxs12("legend", { children: [
1623
+ legend && /* @__PURE__ */ jsxs11("legend", { children: [
1676
1624
  /* @__PURE__ */ jsx13("span", { children: legend }),
1677
- questionArray[0].hasValidationError && /* @__PURE__ */ jsxs12("span", { className: "sr-only", children: [
1625
+ questionArray[0].hasValidationError && /* @__PURE__ */ jsxs11("span", { className: "sr-only", children: [
1678
1626
  "Valideringsfel. ",
1679
1627
  questionArray[0].validationDefaultMessesege
1680
1628
  ] })
1681
1629
  ] }),
1682
- questionArray[0].hasValidationError && /* @__PURE__ */ jsxs12("div", { className: "pts-root-error", id: questionArray[0].id + "-error", children: [
1630
+ questionArray[0].hasValidationError && /* @__PURE__ */ jsxs11("div", { className: "pts-root-error", id: questionArray[0].id + "-error", children: [
1683
1631
  /* @__PURE__ */ jsx13("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
1684
1632
  /* @__PURE__ */ jsx13("span", { className: "errorText", children: questionArray[0].validationDefaultMessesege })
1685
1633
  ] }),
@@ -1781,13 +1729,13 @@ var ILanguageSupportinitialState = {
1781
1729
  };
1782
1730
 
1783
1731
  // src/NewTextComponentStandard/EditPreviewLinkStandard/EditPreviewLinkStandard.tsx
1784
- import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1732
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
1785
1733
  var EditPreviewLink = ({
1786
1734
  step,
1787
1735
  changeStepHandler,
1788
1736
  activatedLanguage = "sv"
1789
1737
  }) => {
1790
- return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ jsxs13(
1738
+ return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ jsxs12(
1791
1739
  "a",
1792
1740
  {
1793
1741
  href: "#",
@@ -1825,10 +1773,10 @@ var EditPreviewLink = ({
1825
1773
  var EditPreviewLinkStandard_default = EditPreviewLink;
1826
1774
 
1827
1775
  // src/NewTextComponentStandard/FooterStandard/FooterStandard.tsx
1828
- import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1776
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
1829
1777
  var Footer = ({ activatedLanguage = "sv" }) => {
1830
- return /* @__PURE__ */ jsxs14("footer", { className: "pts-footer-container", children: [
1831
- /* @__PURE__ */ jsxs14(
1778
+ return /* @__PURE__ */ jsxs13("footer", { className: "pts-footer-container", children: [
1779
+ /* @__PURE__ */ jsxs13(
1832
1780
  "svg",
1833
1781
  {
1834
1782
  role: "img",
@@ -1862,8 +1810,8 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1862
1810
  {
1863
1811
  className: "pts-footer-linkList",
1864
1812
  "aria-label": activatedLanguage === "en" ? "Footer navigation" : "Sidfotsnavigering",
1865
- children: /* @__PURE__ */ jsxs14("ul", { children: [
1866
- /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs14(
1813
+ children: /* @__PURE__ */ jsxs13("ul", { children: [
1814
+ /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs13(
1867
1815
  "a",
1868
1816
  {
1869
1817
  href: activatedLanguage === "en" ? "https://pts.se/en/contact/" : "https://www.pts.se/kontakt/",
@@ -1875,7 +1823,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1875
1823
  ]
1876
1824
  }
1877
1825
  ) }),
1878
- /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs14(
1826
+ /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs13(
1879
1827
  "a",
1880
1828
  {
1881
1829
  href: activatedLanguage === "en" ? "https://pts.se/en/gdpr" : "https://www.pts.se/gdpr/",
@@ -1887,7 +1835,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1887
1835
  ]
1888
1836
  }
1889
1837
  ) }),
1890
- /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs14(
1838
+ /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs13(
1891
1839
  "a",
1892
1840
  {
1893
1841
  href: activatedLanguage === "en" ? "https://pts.se/en/accessibility-eservices" : "https://www.pts.se/tillganglighet-etjanster",
@@ -1899,7 +1847,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1899
1847
  ]
1900
1848
  }
1901
1849
  ) }),
1902
- /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs14(
1850
+ /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs13(
1903
1851
  "a",
1904
1852
  {
1905
1853
  href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",
@@ -1919,7 +1867,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1919
1867
  var FooterStandard_default = Footer;
1920
1868
 
1921
1869
  // src/NewTextComponentStandard/HeaderStandard/Icons.tsx
1922
- import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
1870
+ import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
1923
1871
  var LanguageIcon = () => /* @__PURE__ */ jsx16("svg", { width: "15", height: "15", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx16(
1924
1872
  "path",
1925
1873
  {
@@ -1927,7 +1875,7 @@ var LanguageIcon = () => /* @__PURE__ */ jsx16("svg", { width: "15", height: "15
1927
1875
  fill: "#6E3282"
1928
1876
  }
1929
1877
  ) });
1930
- var Logo_sv = () => /* @__PURE__ */ jsxs15("svg", { width: "168.8", height: "46.67", viewBox: "0 0 168.8 46.67", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1878
+ var Logo_sv = () => /* @__PURE__ */ jsxs14("svg", { width: "168.8", height: "46.67", viewBox: "0 0 168.8 46.67", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1931
1879
  /* @__PURE__ */ jsx16(
1932
1880
  "path",
1933
1881
  {
@@ -2073,7 +2021,7 @@ var Logo_sv = () => /* @__PURE__ */ jsxs15("svg", { width: "168.8", height: "46.
2073
2021
  ),
2074
2022
  /* @__PURE__ */ jsx16("path", { d: "M82.2223 18.3335V37.2224", stroke: "black", strokeWidth: "0.8", strokeMiterlimit: "10" })
2075
2023
  ] });
2076
- var Logo_en = () => /* @__PURE__ */ jsxs15("svg", { width: "189.0", height: "46.67", viewBox: "0 0 189 46.67", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", children: [
2024
+ var Logo_en = () => /* @__PURE__ */ jsxs14("svg", { width: "189.0", height: "46.67", viewBox: "0 0 189 46.67", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", children: [
2077
2025
  /* @__PURE__ */ jsx16(
2078
2026
  "path",
2079
2027
  {
@@ -2296,7 +2244,7 @@ var Logo_en = () => /* @__PURE__ */ jsxs15("svg", { width: "189.0", height: "46.
2296
2244
  ] });
2297
2245
 
2298
2246
  // src/NewTextComponentStandard/HeaderStandard/HeaderStandard.tsx
2299
- import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
2247
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
2300
2248
  var Header = ({
2301
2249
  activatedLanguage = "sv",
2302
2250
  useLanguage = true,
@@ -2315,7 +2263,7 @@ var Header = ({
2315
2263
  if (activatedLanguage === "sv") return "English";
2316
2264
  else return "Svenska";
2317
2265
  };
2318
- return /* @__PURE__ */ jsxs16("header", { className: "pts-header-container", children: [
2266
+ return /* @__PURE__ */ jsxs15("header", { className: "pts-header-container", children: [
2319
2267
  /* @__PURE__ */ jsx17(
2320
2268
  "a",
2321
2269
  {
@@ -2326,7 +2274,7 @@ var Header = ({
2326
2274
  children: activatedLanguage === "en" ? /* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx17(Logo_en, {}) }) : /* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx17(Logo_sv, {}) })
2327
2275
  }
2328
2276
  ),
2329
- useLanguage && /* @__PURE__ */ jsxs16(
2277
+ useLanguage && /* @__PURE__ */ jsxs15(
2330
2278
  "button",
2331
2279
  {
2332
2280
  "aria-label": activatedLanguage === "en" ? "Change language to Svenska" : "\xC4ndra spr\xE5k till English",
@@ -2345,7 +2293,7 @@ var HeaderStandard_default = Header;
2345
2293
  // src/NewTextComponentStandard/InfoOnlyStandard/InfoOnlyStandard.tsx
2346
2294
  import { useEffect as useEffect6 } from "react";
2347
2295
  import DOMPurify4 from "dompurify";
2348
- import { Fragment as Fragment14, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
2296
+ import { Fragment as Fragment14, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
2349
2297
  var cleanText = (text) => DOMPurify4.sanitize(text, { ADD_ATTR: ["target", "class"] });
2350
2298
  var InfoOnly = ({
2351
2299
  questionObject,
@@ -2365,7 +2313,7 @@ var InfoOnly = ({
2365
2313
  const e = { target: { value: questionObject2.questionLabel + avoidBugInRedux } };
2366
2314
  isTouched(e, questionObject2);
2367
2315
  };
2368
- return /* @__PURE__ */ jsxs17(Fragment14, { children: [
2316
+ return /* @__PURE__ */ jsxs16(Fragment14, { children: [
2369
2317
  showConfigure && visible && /* @__PURE__ */ jsx18("div", { className: "pts-infoOnly-container", children: /* @__PURE__ */ jsx18("div", { className: "InfoOnlyText", tabIndex, children: questionObject.questionLabel && /* @__PURE__ */ jsx18(
2370
2318
  "p",
2371
2319
  {
@@ -2390,7 +2338,7 @@ var PreviewInfoOnly = ({ questionObject }) => {
2390
2338
  };
2391
2339
 
2392
2340
  // src/NewTextComponentStandard/ModalStandard/ModalStandard.tsx
2393
- import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
2341
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
2394
2342
  var CONTENT = {
2395
2343
  en: {
2396
2344
  heading: "Please wait",
@@ -2404,8 +2352,8 @@ var CONTENT = {
2404
2352
  var Modal = ({ showModal: isOpen, activatedLanguage = "" }) => {
2405
2353
  const currentContent = activatedLanguage === "en" ? CONTENT.en : CONTENT.sv;
2406
2354
  if (!isOpen) return null;
2407
- return /* @__PURE__ */ jsxs18("div", { className: "pts-modal-overlay", children: [
2408
- /* @__PURE__ */ jsxs18("div", { "aria-hidden": true, className: "pts-modal-content", children: [
2355
+ return /* @__PURE__ */ jsxs17("div", { className: "pts-modal-overlay", children: [
2356
+ /* @__PURE__ */ jsxs17("div", { "aria-hidden": true, className: "pts-modal-content", children: [
2409
2357
  /* @__PURE__ */ jsx19("h1", { children: currentContent.heading }),
2410
2358
  /* @__PURE__ */ jsx19("p", { children: currentContent.message }),
2411
2359
  /* @__PURE__ */ jsx19("div", { className: "pts-spinner-border" })
@@ -2418,9 +2366,9 @@ var ModalStandard_default = Modal;
2418
2366
  // src/NewTextComponentStandard/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.tsx
2419
2367
  import { createElement } from "react";
2420
2368
  import DOMPurify5 from "dompurify";
2421
- import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2369
+ import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
2422
2370
  var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
2423
- return /* @__PURE__ */ jsxs19(
2371
+ return /* @__PURE__ */ jsxs18(
2424
2372
  "section",
2425
2373
  {
2426
2374
  className: "pts-textHeadlineAndBody-container",
@@ -2428,7 +2376,7 @@ var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
2428
2376
  children: [
2429
2377
  data.headline && createElement(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
2430
2378
  data.body && /* @__PURE__ */ jsx20("div", { dangerouslySetInnerHTML: { __html: DOMPurify5.sanitize(data.body) } }),
2431
- 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(
2379
+ 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__ */ jsxs18(
2432
2380
  "a",
2433
2381
  {
2434
2382
  href: link.url,
@@ -2458,7 +2406,7 @@ var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
2458
2406
  ]
2459
2407
  }
2460
2408
  ) }, `more-info-${index}`)) }),
2461
- data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs19(
2409
+ data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs18(
2462
2410
  "a",
2463
2411
  {
2464
2412
  href: data.linksForMoreInfo[0].url,
@@ -2550,12 +2498,12 @@ var PrincipleOfPublicityStandard_default = PrincipleOfPublicity;
2550
2498
 
2551
2499
  // src/NewTextComponentStandard/ServiceHeadlineAndBodyStandard/ServiceHeadlineAndBodyStandard.tsx
2552
2500
  import DOMPurify6 from "dompurify";
2553
- import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
2501
+ import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
2554
2502
  var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
2555
- return /* @__PURE__ */ jsxs20("div", { className: "pts-serviceHeadlineAndBody-container", children: [
2503
+ return /* @__PURE__ */ jsxs19("div", { className: "pts-serviceHeadlineAndBody-container", children: [
2556
2504
  data.mainHeadline && /* @__PURE__ */ jsx22("h1", { id: "pts-main-service-headline", children: data.mainHeadline }),
2557
2505
  activeStep === 1 && data.ingressBody && /* @__PURE__ */ jsx22("div", { dangerouslySetInnerHTML: { __html: DOMPurify6.sanitize(data.ingressBody) } }),
2558
- 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: [
2506
+ 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__ */ jsxs19("a", { href: moreInfo.url, target: "_blank", rel: "noopener noreferrer", children: [
2559
2507
  /* @__PURE__ */ jsx22(
2560
2508
  "svg",
2561
2509
  {
@@ -2576,7 +2524,7 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
2576
2524
  ),
2577
2525
  /* @__PURE__ */ jsx22("span", { className: "pts-moreinfo-link-text", children: moreInfo.title })
2578
2526
  ] }) }, moreInfo.title + index)) }),
2579
- activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs20("a", { href: data.linksForMoreInfo[0].url, target: "_blank", rel: "noopener noreferrer", children: [
2527
+ activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs19("a", { href: data.linksForMoreInfo[0].url, target: "_blank", rel: "noopener noreferrer", children: [
2580
2528
  /* @__PURE__ */ jsx22(
2581
2529
  "svg",
2582
2530
  {
@@ -2609,7 +2557,7 @@ var SkipLink = () => {
2609
2557
  var SkipLinkStandard_default = SkipLink;
2610
2558
 
2611
2559
  // src/NewTextComponentStandard/StepperButtonsStandard/StepperButtonsStandard.tsx
2612
- import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
2560
+ import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
2613
2561
  var StepperButtons = ({
2614
2562
  languageSupported,
2615
2563
  handleActiveStep,
@@ -2619,7 +2567,7 @@ var StepperButtons = ({
2619
2567
  activeStep
2620
2568
  }) => {
2621
2569
  const totalSteps = arraySteps ? arraySteps.length : "";
2622
- return /* @__PURE__ */ jsxs21("div", { className: "pts-stepperButtons-container", children: [
2570
+ return /* @__PURE__ */ jsxs20("div", { className: "pts-stepperButtons-container", children: [
2623
2571
  activeStep !== 0 && /* @__PURE__ */ jsx24(
2624
2572
  "button",
2625
2573
  {
@@ -2629,7 +2577,7 @@ var StepperButtons = ({
2629
2577
  children: languageSupported ? languageSupported.backButton : "<<"
2630
2578
  }
2631
2579
  ),
2632
- /* @__PURE__ */ jsxs21(
2580
+ /* @__PURE__ */ jsxs20(
2633
2581
  "button",
2634
2582
  {
2635
2583
  type: activeStep === totalSteps ? "submit" : "button",
@@ -2647,14 +2595,14 @@ var StepperButtonsStandard_default = StepperButtons;
2647
2595
 
2648
2596
  // src/NewTextComponentStandard/StepperStandard/StepperStandard.tsx
2649
2597
  import React10 from "react";
2650
- import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
2598
+ import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
2651
2599
  var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
2652
2600
  return /* @__PURE__ */ jsx25("div", { className: "pts-stepper-container", "aria-hidden": "true", children: arraySteps.map((step, index) => {
2653
2601
  const isActive = step.step === activeStep;
2654
2602
  const lastElement = arraySteps.length;
2655
2603
  const isDone = step.step < activeStep;
2656
- return /* @__PURE__ */ jsxs22(React10.Fragment, { children: [
2657
- /* @__PURE__ */ jsxs22("div", { className: "pts-stepper-step", children: [
2604
+ return /* @__PURE__ */ jsxs21(React10.Fragment, { children: [
2605
+ /* @__PURE__ */ jsxs21("div", { className: "pts-stepper-step", children: [
2658
2606
  /* @__PURE__ */ jsx25(
2659
2607
  "div",
2660
2608
  {
@@ -2689,7 +2637,7 @@ var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
2689
2637
  var StepperStandard_default = Stepper;
2690
2638
 
2691
2639
  // src/NewTextComponentStandard/ValidationErrorSummaryList/ValidationErrorSummaryList.tsx
2692
- import { Fragment as Fragment15, jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
2640
+ import { Fragment as Fragment15, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
2693
2641
  var ValidationErrorSummaryList = ({
2694
2642
  validationErrorsList,
2695
2643
  formQuestions,
@@ -2737,9 +2685,9 @@ var ValidationErrorSummaryList = ({
2737
2685
  const found = formQuestions.find((item) => item.id === id);
2738
2686
  return (_a = found == null ? void 0 : found.validationSummaryLabel) != null ? _a : found == null ? void 0 : found.questionLabel;
2739
2687
  }
2740
- return /* @__PURE__ */ jsxs23("div", { className: "pts-errorSummary-container pts-root-error", children: [
2688
+ return /* @__PURE__ */ jsxs22("div", { className: "pts-errorSummary-container pts-root-error", children: [
2741
2689
  /* @__PURE__ */ jsx26("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
2742
- /* @__PURE__ */ jsxs23("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
2690
+ /* @__PURE__ */ jsxs22("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
2743
2691
  /* @__PURE__ */ jsx26("h2", { id: "errorSummary-headline", children: title }),
2744
2692
  /* @__PURE__ */ jsx26("ul", { id: "errorSummary-ul", children: filteredIds.map((questionId, i) => /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsx26(
2745
2693
  "a",
@@ -2759,7 +2707,7 @@ var ValidationErrorSummaryList = ({
2759
2707
  var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
2760
2708
 
2761
2709
  // src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
2762
- import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
2710
+ import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
2763
2711
  var CookieBanner = ({
2764
2712
  visible = false,
2765
2713
  onCookieStateChange,
@@ -2791,11 +2739,11 @@ var CookieBanner = ({
2791
2739
  "aria-modal": "true",
2792
2740
  id: "cookie-banner",
2793
2741
  tabIndex: -1,
2794
- children: /* @__PURE__ */ jsxs24("div", { className: "content", children: [
2742
+ children: /* @__PURE__ */ jsxs23("div", { className: "content", children: [
2795
2743
  /* @__PURE__ */ jsx27("h3", { id: "cookie-banner-title", children: "Kakor (cookies)" }),
2796
2744
  /* @__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." }),
2797
- /* @__PURE__ */ jsxs24("div", { className: "pts-cookieBanner-Links", children: [
2798
- /* @__PURE__ */ jsxs24(
2745
+ /* @__PURE__ */ jsxs23("div", { className: "pts-cookieBanner-Links", children: [
2746
+ /* @__PURE__ */ jsxs23(
2799
2747
  "svg",
2800
2748
  {
2801
2749
  width: "27",
@@ -2818,7 +2766,7 @@ var CookieBanner = ({
2818
2766
  ),
2819
2767
  /* @__PURE__ */ jsx27("a", { href: "www.pts.se", target: "_blank", rel: "noopener noreferrer", children: "Kakor (cookies) p\xE5 pts.se (\xD6ppnas i nytt f\xF6nster)" })
2820
2768
  ] }),
2821
- /* @__PURE__ */ jsxs24("div", { className: "pts-cookieBanner-Buttons", children: [
2769
+ /* @__PURE__ */ jsxs23("div", { className: "pts-cookieBanner-Buttons", children: [
2822
2770
  /* @__PURE__ */ jsx27("button", { onClick: () => handleCookieChoice(true), children: "Ja, jag samtycker" }),
2823
2771
  /* @__PURE__ */ jsx27("button", { onClick: () => handleCookieChoice(false), children: "Nej, jag samtycker inte" })
2824
2772
  ] })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
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",