optimized-react-component-library-xyz123 0.1.81 → 0.1.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -821,7 +821,7 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
821
821
  var DropFilesStandard_default = DropFiles;
822
822
 
823
823
  // src/NewInputComponentStandard/AddFilesStandard/ExploreFilesStandard.tsx
824
- var import_react4 = __toESM(require("react"));
824
+ var import_react4 = require("react");
825
825
  var import_clsx2 = __toESM(require("clsx"));
826
826
 
827
827
  // src/NewInputComponentStandard/AddFilesStandard/ScreenReaderErrors.tsx
@@ -829,11 +829,7 @@ var import_react3 = __toESM(require("react"));
829
829
  var import_jsx_runtime7 = require("react/jsx-runtime");
830
830
  var ScreenReaderErrors = ({
831
831
  errorMessageAddingFile,
832
- activatedLanguage,
833
- removeUploadErrors,
834
- putFocusOnButton = () => {
835
- alert("no function");
836
- }
832
+ activatedLanguage
837
833
  }) => {
838
834
  const [activateErrorMessagesForScreenReader, setActivateErrorMessagesForScreenReader] = import_react3.default.useState(false);
839
835
  const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = import_react3.default.useState("");
@@ -849,49 +845,7 @@ var ScreenReaderErrors = ({
849
845
  setActivateErrorMessagesForScreenReader(true);
850
846
  }
851
847
  }, [errorMessageAddingFile]);
852
- const handleRemoveErrors = () => {
853
- const errorMessages = activatedLanguage === "sv" ? `Felmeddelande raderat.` : `Error message deleted.`;
854
- setErrorMessagesForScreenReader(errorMessages);
855
- removeUploadErrors();
856
- putFocusOnButton();
857
- setTimeout(() => {
858
- setActivateErrorMessagesForScreenReader(false);
859
- }, 1e3);
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
- ] });
848
+ 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
849
  };
896
850
  var ScreenReaderErrors_default = ScreenReaderErrors;
897
851
 
@@ -899,7 +853,6 @@ var ScreenReaderErrors_default = ScreenReaderErrors;
899
853
  var import_jsx_runtime8 = require("react/jsx-runtime");
900
854
  var ExploreFiles = ({
901
855
  FilesSelected,
902
- //UploadButtonText = 'upload files',
903
856
  numberOfFiles,
904
857
  allowedNumberOfFiles,
905
858
  activatedLanguage,
@@ -909,28 +862,10 @@ var ExploreFiles = ({
909
862
  errorId,
910
863
  questionObject,
911
864
  showErrors,
912
- errorMessageAddingFile,
913
- removeUploadErrors = () => {
914
- alert("finns ingen funktion");
915
- }
865
+ errorMessageAddingFile
916
866
  }) => {
917
867
  const fileInputRef = (0, import_react4.useRef)(null);
918
868
  const buttonInputRef = (0, import_react4.useRef)(null);
919
- const [showErrorMessagesForScreenReader, setShowErrorMessagesForScreenReader] = import_react4.default.useState(false);
920
- const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = import_react4.default.useState("");
921
- (0, import_react4.useEffect)(() => {
922
- const button = buttonInputRef.current;
923
- if (!button) return;
924
- const handleFocus = () => {
925
- setShowErrorMessagesForScreenReader(!showErrorMessagesForScreenReader);
926
- console.log("FOCUS!!");
927
- console.log("Error messages for screen reader: " + errorMessageAddingFile);
928
- };
929
- button.addEventListener("focus", handleFocus);
930
- return () => {
931
- button.removeEventListener("focus", handleFocus);
932
- };
933
- }, []);
934
869
  const handleFiles = (event) => {
935
870
  const files = Array.from(event.target.files || []);
936
871
  FilesSelected(files);
@@ -940,32 +875,18 @@ var ExploreFiles = ({
940
875
  var _a;
941
876
  (_a = fileInputRef.current) == null ? void 0 : _a.click();
942
877
  };
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
- const putFocusOnButton = () => {
953
- var _a;
954
- (_a = buttonInputRef.current) == null ? void 0 : _a.focus();
955
- };
956
878
  let addFilesInfoText = numberOfFiles > 0 ? activatedLanguage === "sv" ? `${numberOfFiles} filer valda (max ${allowedNumberOfFiles})` : `${numberOfFiles} files chosed (max ${allowedNumberOfFiles})` : activatedLanguage === "sv" ? "Ingen fil vald" : "No file chosen";
879
+ const ariaLabelText = `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`;
957
880
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "inputContainer", children: [
958
881
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
959
- "label",
882
+ "div",
960
883
  {
961
- tabIndex: -1,
962
884
  className: (0, import_clsx2.default)(
963
885
  ["form-control"],
964
886
  "filePickLabel",
965
887
  showErrors && questionObject.error ? ["form-control error"] : ""
966
888
  ),
967
889
  id: labelId,
968
- htmlFor: inputId,
969
890
  children: [
970
891
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
971
892
  "button",
@@ -976,34 +897,34 @@ var ExploreFiles = ({
976
897
  "filePickButton",
977
898
  showErrors && questionObject.error ? "filePickButton error" : ""
978
899
  ),
979
- "aria-describedby": `${aboutId} ${showErrors && questionObject.error ? errorId : ""}`.trim(),
980
- "aria-label": `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`,
900
+ "aria-describedby": `${aboutId} ${questionObject.hasValidationError ? errorId : ""}`.trim(),
901
+ "aria-label": ariaLabelText,
981
902
  children: activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"
982
903
  }
983
904
  ),
984
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
985
- "input",
986
- {
987
- ref: fileInputRef,
988
- type: "file",
989
- className: "invisible",
990
- multiple: true,
991
- onChange: handleFiles,
992
- tabIndex: -1,
993
- id: inputId
994
- }
995
- ),
996
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "filePickText", children: addFilesInfoText })
905
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { "aria-hidden": true, className: "filePickText", children: addFilesInfoText }),
906
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", { htmlFor: inputId, "aria-hidden": true, className: "invisible" })
997
907
  ]
998
908
  }
999
909
  ),
910
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
911
+ "input",
912
+ {
913
+ "aria-hidden": true,
914
+ ref: fileInputRef,
915
+ type: "file",
916
+ className: "invisible",
917
+ multiple: true,
918
+ onChange: handleFiles,
919
+ tabIndex: -1,
920
+ id: inputId
921
+ }
922
+ ),
1000
923
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1001
924
  ScreenReaderErrors_default,
1002
925
  {
1003
926
  errorMessageAddingFile,
1004
- removeUploadErrors,
1005
- activatedLanguage,
1006
- putFocusOnButton
927
+ activatedLanguage
1007
928
  }
1008
929
  )
1009
930
  ] }) });
@@ -1037,11 +958,12 @@ var SelectedFiles = ({
1037
958
  errorMessageAddingFile,
1038
959
  activatedLanguage,
1039
960
  numberOfFiles,
1040
- setNumberOfFiles
961
+ setNumberOfFiles,
962
+ removeUploadErrors
1041
963
  }) => {
1042
964
  const theDiv = (0, import_react6.useRef)(null);
1043
965
  const remove = (file) => {
1044
- let newFiles = questionObject.Files.filter((f) => f !== file);
966
+ let newFiles = questionObject.files.filter((f) => f !== file);
1045
967
  const newCountOfFiles = newFiles.length;
1046
968
  setNumberOfFiles(newCountOfFiles);
1047
969
  const e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
@@ -1067,58 +989,54 @@ var SelectedFiles = ({
1067
989
  };
1068
990
  const windowWidth = useWindowWidth();
1069
991
  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",
992
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
993
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { "aria-hidden": true, className: "fileListUnorderedList", children: [
994
+ " ",
995
+ errorMessageAddingFile.map((errorObj, index) => {
996
+ const errorFileName = errorObj.FileName;
997
+ let mobileFirstFileName = errorObj.FileName.split(".").shift();
998
+ mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
999
+ const fileType = errorObj.FileName.split(".").pop();
1000
+ mobileFirstFileName = mobileFirstFileName + "." + fileType;
1001
+ 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: [
1002
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_bootstrap.Row, { children: [
1003
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1004
+ "span",
1005
+ {
1006
+ "aria-hidden": "true",
1007
+ className: (0, import_clsx4.default)("uploadedDot", "uploadFailed"),
1008
+ children: "!"
1009
+ }
1010
+ ) }),
1011
+ /* @__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 }) }),
1012
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol" })
1013
+ ] }),
1014
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1015
+ import_react_bootstrap.Col,
1091
1016
  {
1092
- className: "selectedFilesLinkButton",
1093
- onClick: () => {
1094
- removeError(index);
1017
+ style: {
1018
+ width: "100%",
1019
+ color: "#8e0039"
1095
1020
  },
1096
- "aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelandet f\xF6r ${errorFileName}` : `Close error message for ${errorFileName}`,
1097
- children: activatedLanguage === "sv" ? "St\xE4ng" : "Close"
1021
+ className: "errorMessageAddingFile",
1022
+ ...activatedLanguage === "sv" ? {
1023
+ "aria-label": `${errorFileName} ${errorObj.svMessage}`
1024
+ } : {
1025
+ "aria-label": `${errorFileName} ${errorObj.enMessage}`
1026
+ },
1027
+ children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
1098
1028
  }
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
- ] }) }),
1121
- questionObject.Files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.Files.map((file, index) => {
1029
+ ) }),
1030
+ /* @__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" }) })
1031
+ ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
1032
+ })
1033
+ ] }),
1034
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { onClick: removeUploadErrors, className: "errorMessageAddingFile", children: [
1035
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "X" }),
1036
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Ta bort felmeddelande f\xF6r uppladdning av filer" })
1037
+ ] })
1038
+ ] }),
1039
+ questionObject.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.files.map((file, index) => {
1122
1040
  const indicatorfileName = file.FileName;
1123
1041
  let mobileFirstFileName = file.FileName.split(".").shift();
1124
1042
  mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
@@ -1149,13 +1067,12 @@ var SelectedFiles = ({
1149
1067
  mobileFirstFileName,
1150
1068
  " (",
1151
1069
  Math.ceil(file.FileSize / (1024 * 1024)),
1152
- " MB)"
1070
+ " ",
1071
+ "MB)"
1153
1072
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "desktopFileName", children: [
1154
1073
  file.FileName,
1155
1074
  " (",
1156
- file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(
1157
- 1
1158
- )} MB`,
1075
+ file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(1)} MB`,
1159
1076
  ")"
1160
1077
  ] }) }),
1161
1078
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -1349,7 +1266,6 @@ var AddFiles = ({
1349
1266
  };
1350
1267
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1351
1268
  !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
1269
  questionObject.aboutText && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1354
1270
  "p",
1355
1271
  {
@@ -1369,14 +1285,8 @@ var AddFiles = ({
1369
1285
  ),
1370
1286
  questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "error addfileserror", id: errorId, children: [
1371
1287
  /* @__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
- )
1288
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
1289
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
1380
1290
  ] }),
1381
1291
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1382
1292
  ExploreFilesStandard_default,
@@ -1405,7 +1315,8 @@ var AddFiles = ({
1405
1315
  errorMessageAddingFile,
1406
1316
  activatedLanguage,
1407
1317
  numberOfFiles,
1408
- setNumberOfFiles
1318
+ setNumberOfFiles,
1319
+ removeUploadErrors: handleRemoveErrors
1409
1320
  }
1410
1321
  )
1411
1322
  ] }) }),
@@ -1858,7 +1769,7 @@ var EditPreviewLink = ({
1858
1769
  href: "#",
1859
1770
  onClick: (e) => {
1860
1771
  e.preventDefault();
1861
- changeStepHandler(step);
1772
+ changeStepHandler(step.step);
1862
1773
  },
1863
1774
  children: [
1864
1775
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
@@ -1896,7 +1807,6 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1896
1807
  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1897
1808
  "svg",
1898
1809
  {
1899
- role: "img",
1900
1810
  "aria-label": activatedLanguage === "en" ? "PTS logotype" : "PTS logotyp",
1901
1811
  className: "pts-footer-logo",
1902
1812
  xmlns: "http://www.w3.org/2000/svg",
@@ -1922,63 +1832,56 @@ var Footer = ({ activatedLanguage = "sv" }) => {
1922
1832
  ]
1923
1833
  }
1924
1834
  ),
1925
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1926
- "nav",
1927
- {
1928
- className: "pts-footer-linkList",
1929
- "aria-label": activatedLanguage === "en" ? "Footer navigation" : "Sidfotsnavigering",
1930
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("ul", { children: [
1931
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1932
- "a",
1933
- {
1934
- href: activatedLanguage === "en" ? "https://pts.se/en/contact/" : "https://www.pts.se/kontakt/",
1935
- target: "_blank",
1936
- rel: "noopener noreferrer",
1937
- children: [
1938
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Contact (opens in new tab)" : "PTS Kontakt (\xF6ppnas i ny flik)" }),
1939
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Contact" : "Kontakt" })
1940
- ]
1941
- }
1942
- ) }),
1943
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1944
- "a",
1945
- {
1946
- href: activatedLanguage === "en" ? "https://pts.se/en/gdpr" : "https://www.pts.se/gdpr/",
1947
- target: "_blank",
1948
- rel: "noopener noreferrer",
1949
- children: [
1950
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Processing of personal data (opens in new tab)" : "PTS Behandling av personuppgifter (\xF6ppnas i ny flik)" }),
1951
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Processing of personal data" : "Behandling av personuppgifter" })
1952
- ]
1953
- }
1954
- ) }),
1955
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1956
- "a",
1957
- {
1958
- href: activatedLanguage === "en" ? "https://pts.se/en/accessibility-eservices" : "https://www.pts.se/tillganglighet-etjanster",
1959
- target: "_blank",
1960
- rel: "noopener noreferrer",
1961
- children: [
1962
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Accessibility (opens in new tab)" : "PTS Tillg\xE4nglighetsredog\xF6relse (\xF6ppnas i ny flik)" }),
1963
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Accessibility" : "Tillg\xE4nglighetsredog\xF6relse" })
1964
- ]
1965
- }
1966
- ) }),
1967
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1968
- "a",
1969
- {
1970
- href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",
1971
- target: "_blank",
1972
- rel: "noopener noreferrer",
1973
- children: [
1974
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Cookies (opens in new tab)" : "PTS Kakor (\xF6ppnas i ny flik)" }),
1975
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Cookies" : "Kakor" })
1976
- ]
1977
- }
1978
- ) })
1979
- ] })
1980
- }
1981
- )
1835
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("nav", { className: "pts-footer-linkList", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("ul", { children: [
1836
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1837
+ "a",
1838
+ {
1839
+ href: activatedLanguage === "en" ? "https://pts.se/en/contact/" : "https://www.pts.se/kontakt/",
1840
+ target: "_blank",
1841
+ rel: "noopener noreferrer",
1842
+ children: [
1843
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Contact (opens in new tab)" : "PTS Kontakt (\xF6ppnas i ny flik)" }),
1844
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Contact" : "Kontakt" })
1845
+ ]
1846
+ }
1847
+ ) }),
1848
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1849
+ "a",
1850
+ {
1851
+ href: activatedLanguage === "en" ? "https://pts.se/en/gdpr" : "https://www.pts.se/gdpr/",
1852
+ target: "_blank",
1853
+ rel: "noopener noreferrer",
1854
+ children: [
1855
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Processing of personal data (opens in new tab)" : "PTS Behandling av personuppgifter (\xF6ppnas i ny flik)" }),
1856
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Processing of personal data" : "Behandling av personuppgifter" })
1857
+ ]
1858
+ }
1859
+ ) }),
1860
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1861
+ "a",
1862
+ {
1863
+ href: activatedLanguage === "en" ? "https://pts.se/en/accessibility-eservices" : "https://www.pts.se/tillganglighet-etjanster",
1864
+ target: "_blank",
1865
+ rel: "noopener noreferrer",
1866
+ children: [
1867
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Accessibility (opens in new tab)" : "PTS Tillg\xE4nglighetsredog\xF6relse (\xF6ppnas i ny flik)" }),
1868
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Accessibility" : "Tillg\xE4nglighetsredog\xF6relse" })
1869
+ ]
1870
+ }
1871
+ ) }),
1872
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1873
+ "a",
1874
+ {
1875
+ href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",
1876
+ target: "_blank",
1877
+ rel: "noopener noreferrer",
1878
+ children: [
1879
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Cookies (opens in new tab)" : "PTS Kakor (\xF6ppnas i ny flik)" }),
1880
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Cookies" : "Kakor" })
1881
+ ]
1882
+ }
1883
+ ) })
1884
+ ] }) })
1982
1885
  ] });
1983
1886
  };
1984
1887
  var FooterStandard_default = Footer;
@@ -2394,12 +2297,14 @@ var Header = ({
2394
2297
  useLanguage && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2395
2298
  "button",
2396
2299
  {
2397
- "aria-label": activatedLanguage === "en" ? "Change language to Svenska" : "\xC4ndra spr\xE5k till English",
2300
+ lang: activatedLanguage === "en" ? "en" : "sv",
2398
2301
  className: "pts-languageButton",
2399
2302
  onClick: handleLanguageClick,
2400
2303
  children: [
2401
2304
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LanguageIcon, {}) }),
2402
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "pts-languageButton", children: getLanguageLabel() })
2305
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", className: "pts-languageButton", children: getLanguageLabel() }),
2306
+ activatedLanguage === "en" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: "\xC4ndra spr\xE5k till svenska" }),
2307
+ activatedLanguage === "sv" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: "Change language to English" })
2403
2308
  ]
2404
2309
  }
2405
2310
  )
@@ -2489,7 +2394,6 @@ var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
2489
2394
  "section",
2490
2395
  {
2491
2396
  className: "pts-textHeadlineAndBody-container",
2492
- "aria-labelledby": "textHeadlineAndBody-headline",
2493
2397
  children: [
2494
2398
  data.headline && (0, import_react10.createElement)(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
2495
2399
  data.body && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify5.default.sanitize(data.body) } }),
@@ -2499,7 +2403,6 @@ var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
2499
2403
  href: link.url,
2500
2404
  target: "_blank",
2501
2405
  rel: "noopener noreferrer",
2502
- "aria-label": link.ariaLabel,
2503
2406
  children: [
2504
2407
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2505
2408
  "svg",
@@ -2669,7 +2572,24 @@ var ServiceHeadlineAndBodyStandard_default = ServiceHeadlineAndBody;
2669
2572
  // src/NewTextComponentStandard/SkipLinkStandard/SkipLinkStandard.tsx
2670
2573
  var import_jsx_runtime23 = require("react/jsx-runtime");
2671
2574
  var SkipLink = () => {
2672
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "pts-skipLink-container", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("a", { href: "#main-content", children: "Till huvudinneh\xE5ll" }) });
2575
+ function scrollToMainContent() {
2576
+ const container = document.getElementById(`main-content`);
2577
+ if (container) {
2578
+ container.scrollIntoView({ behavior: "smooth", block: "center" });
2579
+ container.focus();
2580
+ }
2581
+ }
2582
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "pts-skipLink-container", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2583
+ "a",
2584
+ {
2585
+ href: "#",
2586
+ onClick: (e) => {
2587
+ e.preventDefault();
2588
+ scrollToMainContent();
2589
+ },
2590
+ children: "Till huvudinneh\xE5ll"
2591
+ }
2592
+ ) });
2673
2593
  };
2674
2594
  var SkipLinkStandard_default = SkipLink;
2675
2595
 
@@ -2809,7 +2729,7 @@ var ValidationErrorSummaryList = ({
2809
2729
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("ul", { id: "errorSummary-ul", children: filteredIds.map((questionId, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2810
2730
  "a",
2811
2731
  {
2812
- href: `#question-${questionId}`,
2732
+ href: "#",
2813
2733
  onClick: (e) => {
2814
2734
  e.preventDefault();
2815
2735
  scrollToQuestion(questionId);