optimized-react-component-library-xyz123 0.1.78 → 0.1.81
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.css +842 -0
- package/dist/index.js +233 -153
- package/dist/index.mjs +295 -215
- package/package.json +1 -1
- package/src/css/darkMode.css +1 -25
- package/src/css/styles.css +62 -57
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 = require("react");
|
|
824
|
+
var import_react4 = __toESM(require("react"));
|
|
825
825
|
var import_clsx2 = __toESM(require("clsx"));
|
|
826
826
|
|
|
827
827
|
// src/NewInputComponentStandard/AddFilesStandard/ScreenReaderErrors.tsx
|
|
@@ -829,7 +829,11 @@ 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
|
|
832
|
+
activatedLanguage,
|
|
833
|
+
removeUploadErrors,
|
|
834
|
+
putFocusOnButton = () => {
|
|
835
|
+
alert("no function");
|
|
836
|
+
}
|
|
833
837
|
}) => {
|
|
834
838
|
const [activateErrorMessagesForScreenReader, setActivateErrorMessagesForScreenReader] = import_react3.default.useState(false);
|
|
835
839
|
const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = import_react3.default.useState("");
|
|
@@ -845,7 +849,49 @@ var ScreenReaderErrors = ({
|
|
|
845
849
|
setActivateErrorMessagesForScreenReader(true);
|
|
846
850
|
}
|
|
847
851
|
}, [errorMessageAddingFile]);
|
|
848
|
-
|
|
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
|
+
] });
|
|
849
895
|
};
|
|
850
896
|
var ScreenReaderErrors_default = ScreenReaderErrors;
|
|
851
897
|
|
|
@@ -853,6 +899,7 @@ var ScreenReaderErrors_default = ScreenReaderErrors;
|
|
|
853
899
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
854
900
|
var ExploreFiles = ({
|
|
855
901
|
FilesSelected,
|
|
902
|
+
//UploadButtonText = 'upload files',
|
|
856
903
|
numberOfFiles,
|
|
857
904
|
allowedNumberOfFiles,
|
|
858
905
|
activatedLanguage,
|
|
@@ -862,10 +909,28 @@ var ExploreFiles = ({
|
|
|
862
909
|
errorId,
|
|
863
910
|
questionObject,
|
|
864
911
|
showErrors,
|
|
865
|
-
errorMessageAddingFile
|
|
912
|
+
errorMessageAddingFile,
|
|
913
|
+
removeUploadErrors = () => {
|
|
914
|
+
alert("finns ingen funktion");
|
|
915
|
+
}
|
|
866
916
|
}) => {
|
|
867
917
|
const fileInputRef = (0, import_react4.useRef)(null);
|
|
868
918
|
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
|
+
}, []);
|
|
869
934
|
const handleFiles = (event) => {
|
|
870
935
|
const files = Array.from(event.target.files || []);
|
|
871
936
|
FilesSelected(files);
|
|
@@ -875,18 +940,32 @@ var ExploreFiles = ({
|
|
|
875
940
|
var _a;
|
|
876
941
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
877
942
|
};
|
|
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
|
+
};
|
|
878
956
|
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}`;
|
|
880
957
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "inputContainer", children: [
|
|
881
958
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
882
|
-
"
|
|
959
|
+
"label",
|
|
883
960
|
{
|
|
961
|
+
tabIndex: -1,
|
|
884
962
|
className: (0, import_clsx2.default)(
|
|
885
963
|
["form-control"],
|
|
886
964
|
"filePickLabel",
|
|
887
965
|
showErrors && questionObject.error ? ["form-control error"] : ""
|
|
888
966
|
),
|
|
889
967
|
id: labelId,
|
|
968
|
+
htmlFor: inputId,
|
|
890
969
|
children: [
|
|
891
970
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
892
971
|
"button",
|
|
@@ -897,34 +976,34 @@ var ExploreFiles = ({
|
|
|
897
976
|
"filePickButton",
|
|
898
977
|
showErrors && questionObject.error ? "filePickButton error" : ""
|
|
899
978
|
),
|
|
900
|
-
"aria-describedby": `${aboutId} ${questionObject.
|
|
901
|
-
"aria-label":
|
|
979
|
+
"aria-describedby": `${aboutId} ${showErrors && questionObject.error ? errorId : ""}`.trim(),
|
|
980
|
+
"aria-label": `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`,
|
|
902
981
|
children: activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"
|
|
903
982
|
}
|
|
904
983
|
),
|
|
905
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
906
|
-
|
|
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 })
|
|
907
997
|
]
|
|
908
998
|
}
|
|
909
999
|
),
|
|
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
|
-
),
|
|
923
1000
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
924
1001
|
ScreenReaderErrors_default,
|
|
925
1002
|
{
|
|
926
1003
|
errorMessageAddingFile,
|
|
927
|
-
|
|
1004
|
+
removeUploadErrors,
|
|
1005
|
+
activatedLanguage,
|
|
1006
|
+
putFocusOnButton
|
|
928
1007
|
}
|
|
929
1008
|
)
|
|
930
1009
|
] }) });
|
|
@@ -958,12 +1037,11 @@ var SelectedFiles = ({
|
|
|
958
1037
|
errorMessageAddingFile,
|
|
959
1038
|
activatedLanguage,
|
|
960
1039
|
numberOfFiles,
|
|
961
|
-
setNumberOfFiles
|
|
962
|
-
removeUploadErrors
|
|
1040
|
+
setNumberOfFiles
|
|
963
1041
|
}) => {
|
|
964
1042
|
const theDiv = (0, import_react6.useRef)(null);
|
|
965
1043
|
const remove = (file) => {
|
|
966
|
-
let newFiles = questionObject.
|
|
1044
|
+
let newFiles = questionObject.Files.filter((f) => f !== file);
|
|
967
1045
|
const newCountOfFiles = newFiles.length;
|
|
968
1046
|
setNumberOfFiles(newCountOfFiles);
|
|
969
1047
|
const e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
|
|
@@ -989,54 +1067,58 @@ var SelectedFiles = ({
|
|
|
989
1067
|
};
|
|
990
1068
|
const windowWidth = useWindowWidth();
|
|
991
1069
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
992
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
1003
|
-
|
|
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,
|
|
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",
|
|
1016
1082
|
{
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
},
|
|
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
|
|
1083
|
+
"aria-hidden": "true",
|
|
1084
|
+
className: (0, import_clsx4.default)("uploadedDot", "uploadFailed"),
|
|
1085
|
+
children: "!"
|
|
1028
1086
|
}
|
|
1029
1087
|
) }),
|
|
1030
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
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",
|
|
1091
|
+
{
|
|
1092
|
+
className: "selectedFilesLinkButton",
|
|
1093
|
+
onClick: () => {
|
|
1094
|
+
removeError(index);
|
|
1095
|
+
},
|
|
1096
|
+
"aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelandet f\xF6r ${errorFileName}` : `Close error message for ${errorFileName}`,
|
|
1097
|
+
children: activatedLanguage === "sv" ? "St\xE4ng" : "Close"
|
|
1098
|
+
}
|
|
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) => {
|
|
1040
1122
|
const indicatorfileName = file.FileName;
|
|
1041
1123
|
let mobileFirstFileName = file.FileName.split(".").shift();
|
|
1042
1124
|
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
@@ -1067,12 +1149,13 @@ var SelectedFiles = ({
|
|
|
1067
1149
|
mobileFirstFileName,
|
|
1068
1150
|
" (",
|
|
1069
1151
|
Math.ceil(file.FileSize / (1024 * 1024)),
|
|
1070
|
-
" "
|
|
1071
|
-
"MB)"
|
|
1152
|
+
" MB)"
|
|
1072
1153
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "desktopFileName", children: [
|
|
1073
1154
|
file.FileName,
|
|
1074
1155
|
" (",
|
|
1075
|
-
file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(
|
|
1156
|
+
file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(
|
|
1157
|
+
1
|
|
1158
|
+
)} MB`,
|
|
1076
1159
|
")"
|
|
1077
1160
|
] }) }),
|
|
1078
1161
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -1266,6 +1349,7 @@ var AddFiles = ({
|
|
|
1266
1349
|
};
|
|
1267
1350
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1268
1351
|
!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,
|
|
1269
1353
|
questionObject.aboutText && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1270
1354
|
"p",
|
|
1271
1355
|
{
|
|
@@ -1285,8 +1369,14 @@ var AddFiles = ({
|
|
|
1285
1369
|
),
|
|
1286
1370
|
questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "error addfileserror", id: errorId, children: [
|
|
1287
1371
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1288
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1289
|
-
|
|
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
|
+
)
|
|
1290
1380
|
] }),
|
|
1291
1381
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1292
1382
|
ExploreFilesStandard_default,
|
|
@@ -1315,8 +1405,7 @@ var AddFiles = ({
|
|
|
1315
1405
|
errorMessageAddingFile,
|
|
1316
1406
|
activatedLanguage,
|
|
1317
1407
|
numberOfFiles,
|
|
1318
|
-
setNumberOfFiles
|
|
1319
|
-
removeUploadErrors: handleRemoveErrors
|
|
1408
|
+
setNumberOfFiles
|
|
1320
1409
|
}
|
|
1321
1410
|
)
|
|
1322
1411
|
] }) }),
|
|
@@ -1769,7 +1858,7 @@ var EditPreviewLink = ({
|
|
|
1769
1858
|
href: "#",
|
|
1770
1859
|
onClick: (e) => {
|
|
1771
1860
|
e.preventDefault();
|
|
1772
|
-
changeStepHandler(step
|
|
1861
|
+
changeStepHandler(step);
|
|
1773
1862
|
},
|
|
1774
1863
|
children: [
|
|
1775
1864
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
@@ -1807,6 +1896,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
|
|
|
1807
1896
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1808
1897
|
"svg",
|
|
1809
1898
|
{
|
|
1899
|
+
role: "img",
|
|
1810
1900
|
"aria-label": activatedLanguage === "en" ? "PTS logotype" : "PTS logotyp",
|
|
1811
1901
|
className: "pts-footer-logo",
|
|
1812
1902
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1832,56 +1922,63 @@ var Footer = ({ activatedLanguage = "sv" }) => {
|
|
|
1832
1922
|
]
|
|
1833
1923
|
}
|
|
1834
1924
|
),
|
|
1835
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
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
|
+
)
|
|
1885
1982
|
] });
|
|
1886
1983
|
};
|
|
1887
1984
|
var FooterStandard_default = Footer;
|
|
@@ -2297,14 +2394,12 @@ var Header = ({
|
|
|
2297
2394
|
useLanguage && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2298
2395
|
"button",
|
|
2299
2396
|
{
|
|
2300
|
-
|
|
2397
|
+
"aria-label": activatedLanguage === "en" ? "Change language to Svenska" : "\xC4ndra spr\xE5k till English",
|
|
2301
2398
|
className: "pts-languageButton",
|
|
2302
2399
|
onClick: handleLanguageClick,
|
|
2303
2400
|
children: [
|
|
2304
2401
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LanguageIcon, {}) }),
|
|
2305
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", {
|
|
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" })
|
|
2402
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "pts-languageButton", children: getLanguageLabel() })
|
|
2308
2403
|
]
|
|
2309
2404
|
}
|
|
2310
2405
|
)
|
|
@@ -2394,6 +2489,7 @@ var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
|
2394
2489
|
"section",
|
|
2395
2490
|
{
|
|
2396
2491
|
className: "pts-textHeadlineAndBody-container",
|
|
2492
|
+
"aria-labelledby": "textHeadlineAndBody-headline",
|
|
2397
2493
|
children: [
|
|
2398
2494
|
data.headline && (0, import_react10.createElement)(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
|
|
2399
2495
|
data.body && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify5.default.sanitize(data.body) } }),
|
|
@@ -2403,6 +2499,7 @@ var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
|
2403
2499
|
href: link.url,
|
|
2404
2500
|
target: "_blank",
|
|
2405
2501
|
rel: "noopener noreferrer",
|
|
2502
|
+
"aria-label": link.ariaLabel,
|
|
2406
2503
|
children: [
|
|
2407
2504
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2408
2505
|
"svg",
|
|
@@ -2572,24 +2669,7 @@ var ServiceHeadlineAndBodyStandard_default = ServiceHeadlineAndBody;
|
|
|
2572
2669
|
// src/NewTextComponentStandard/SkipLinkStandard/SkipLinkStandard.tsx
|
|
2573
2670
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2574
2671
|
var SkipLink = () => {
|
|
2575
|
-
|
|
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
|
-
) });
|
|
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" }) });
|
|
2593
2673
|
};
|
|
2594
2674
|
var SkipLinkStandard_default = SkipLink;
|
|
2595
2675
|
|
|
@@ -2729,7 +2809,7 @@ var ValidationErrorSummaryList = ({
|
|
|
2729
2809
|
/* @__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)(
|
|
2730
2810
|
"a",
|
|
2731
2811
|
{
|
|
2732
|
-
href:
|
|
2812
|
+
href: `#question-${questionId}`,
|
|
2733
2813
|
onClick: (e) => {
|
|
2734
2814
|
e.preventDefault();
|
|
2735
2815
|
scrollToQuestion(questionId);
|