optimized-react-component-library-xyz123 0.1.113 → 0.1.115

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
@@ -772,12 +772,12 @@ var FilesUploadStandard_default = FilesUpload;
772
772
 
773
773
  // src/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.tsx
774
774
  var import_react7 = require("react");
775
- var import_clsx5 = __toESM(require("clsx"));
775
+ var import_clsx4 = __toESM(require("clsx"));
776
776
 
777
777
  // src/NewInputComponentStandard/AddFilesStandard/DropFilesStandard.tsx
778
778
  var import_react_dropzone = require("react-dropzone");
779
779
  var import_jsx_runtime6 = require("react/jsx-runtime");
780
- var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r" }) => {
780
+ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r", language }) => {
781
781
  const onDrop = FilesSelected;
782
782
  const { getRootProps, getInputProps, isDragActive } = (0, import_react_dropzone.useDropzone)({ onDrop, noKeyboard: true });
783
783
  const handleFileExplorer = (event) => {
@@ -798,34 +798,22 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
798
798
  }
799
799
  )
800
800
  ] }),
801
- isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { className: "dropFilesNowText", children: "Sl\xE4pp filerna, nu ...!" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
802
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
801
+ isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { className: "dropFilesNowText", children: language === "sv" ? "Sl\xE4pp filerna, nu ...!" : "Drop files here!" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "DropZone-label-container", children: [
802
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
803
803
  "svg",
804
804
  {
805
- "aria-hidden": "true",
806
805
  xmlns: "http://www.w3.org/2000/svg",
807
- width: "72",
808
- height: "48",
809
- viewBox: "0 0 72 48",
810
- fill: "none",
811
- children: [
812
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("g", { clipPath: "url(#clip0_247_596)", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
813
- "path",
814
- {
815
- d: "M66.6084 23.0844C64.6397 21.6247 62.2209 20.5531 59.6672 19.9752C59.2479 19.8808 58.8641 19.6692 58.5605 19.3649C58.257 19.0606 58.0463 18.6763 57.953 18.2567C56.8561 13.37 54.495 9.1794 51.0244 6.00409C46.9898 2.30706 41.6545 0.273621 36 0.273621C31.0289 0.273621 26.4375 1.83174 22.7292 4.78065C20.216 6.78238 18.193 9.33154 16.8145 12.2338C16.6651 12.5513 16.4434 12.8295 16.1672 13.0461C15.8911 13.2627 15.5681 13.4117 15.2241 13.4811C11.4623 14.2405 8.06625 15.8535 5.47312 18.1386C1.89281 21.3027 0 25.5088 0 30.3111C0 35.1655 2.03766 39.5924 5.73609 42.793C9.26859 45.8431 14.0245 47.5236 19.125 47.5236H33.75V25.956L28.5905 31.1155C28.3751 31.3309 28.1182 31.5003 27.8354 31.6134C27.5525 31.7266 27.2497 31.7811 26.9452 31.7738C26.6406 31.7664 26.3408 31.6973 26.0638 31.5706C25.7867 31.4439 25.5383 31.2623 25.3336 31.0367C24.518 30.141 24.5967 28.7446 25.4531 27.8881L34.4095 18.9331C34.8314 18.5115 35.4035 18.2747 36 18.2747C36.5965 18.2747 37.1686 18.5115 37.5905 18.9331L46.5469 27.8853C47.43 28.7699 47.4806 30.2197 46.6017 31.107C46.3932 31.3176 46.1451 31.485 45.8718 31.5994C45.5984 31.7139 45.3051 31.7732 45.0088 31.774C44.7124 31.7748 44.4188 31.717 44.1449 31.604C43.8709 31.491 43.622 31.325 43.4123 31.1155L38.25 25.956V47.5236H55.6875C60.0947 47.5236 64.1124 46.2861 67.0008 44.0403C70.2717 41.495 72 37.8528 72 33.5174C72 29.3071 70.1353 25.6972 66.6084 23.0844Z",
816
- fill: "#6E3282"
817
- }
818
- ) }),
819
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("clipPath", { id: "clip0_247_596", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
820
- "rect",
821
- {
822
- width: "72",
823
- height: "47.1064",
824
- fill: "white",
825
- transform: "translate(0 0.446777)"
826
- }
827
- ) }) })
828
- ]
806
+ width: "2.4rem",
807
+ height: "2.4rem",
808
+ viewBox: "0 0 7 15",
809
+ fill: "#fff",
810
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
811
+ "path",
812
+ {
813
+ d: "M0 2.5C0 1.83696 0.263392 1.20107 0.732233 0.732233C1.20107 0.263392 1.83696 0 2.5 0C3.16304 0 3.79893 0.263392 4.26777 0.732233C4.73661 1.20107 5 1.83696 5 2.5V11.5C5 11.8978 4.84196 12.2794 4.56066 12.5607C4.27936 12.842 3.89782 13 3.5 13C3.10218 13 2.72064 12.842 2.43934 12.5607C2.15804 12.2794 2 11.8978 2 11.5V4.5C2 4.36739 2.05268 4.24021 2.14645 4.14645C2.24021 4.05268 2.36739 4 2.5 4C2.63261 4 2.75979 4.05268 2.85355 4.14645C2.94732 4.24021 3 4.36739 3 4.5V11.5C3 11.6326 3.05268 11.7598 3.14645 11.8536C3.24021 11.9473 3.36739 12 3.5 12C3.63261 12 3.75979 11.9473 3.85355 11.8536C3.94732 11.7598 4 11.6326 4 11.5V2.5C4 2.30302 3.9612 2.10796 3.88582 1.92597C3.81044 1.74399 3.69995 1.57863 3.56066 1.43934C3.42137 1.30005 3.25601 1.18956 3.07403 1.11418C2.89204 1.0388 2.69698 1 2.5 1C2.30302 1 2.10796 1.0388 1.92597 1.11418C1.74399 1.18956 1.57863 1.30005 1.43934 1.43934C1.30005 1.57863 1.18956 1.74399 1.11418 1.92597C1.0388 2.10796 1 2.30302 1 2.5V11.5C1 12.163 1.26339 12.7989 1.73223 13.2678C2.20107 13.7366 2.83696 14 3.5 14C4.16304 14 4.79893 13.7366 5.26777 13.2678C5.73661 12.7989 6 12.163 6 11.5V4.5C6 4.36739 6.05268 4.24021 6.14645 4.14645C6.24021 4.05268 6.36739 4 6.5 4C6.63261 4 6.75979 4.05268 6.85355 4.14645C6.94732 4.24021 7 4.36739 7 4.5V11.5C7 12.4283 6.63125 13.3185 5.97487 13.9749C5.3185 14.6313 4.42826 15 3.5 15C2.57174 15 1.6815 14.6313 1.02513 13.9749C0.368749 13.3185 0 12.4283 0 11.5V2.5Z",
814
+ fill: "#fff"
815
+ }
816
+ )
829
817
  }
830
818
  ),
831
819
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dropFilesText", children: DropFilesText })
@@ -961,7 +949,6 @@ var Indicator = (filename) => {
961
949
  var IndicatorStandard_default = Indicator;
962
950
 
963
951
  // src/NewInputComponentStandard/AddFilesStandard/SelectedFilesStandard.tsx
964
- var import_clsx4 = __toESM(require("clsx"));
965
952
  var import_jsx_runtime10 = require("react/jsx-runtime");
966
953
  var SelectedFiles = ({
967
954
  questionObject,
@@ -1003,53 +990,53 @@ var SelectedFiles = ({
1003
990
  };
1004
991
  const windowWidth = useWindowWidth();
1005
992
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1006
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
1007
- errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { "aria-hidden": true, className: "fileListUnorderedList", children: [
1008
- " ",
1009
- errorMessageAddingFile.map((errorObj, index) => {
1010
- const errorFileName = errorObj.FileName;
1011
- let mobileFirstFileName = errorObj.FileName.split(".").shift();
1012
- mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
1013
- const fileType = errorObj.FileName.split(".").pop();
1014
- mobileFirstFileName = mobileFirstFileName + "." + fileType;
1015
- 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: [
1016
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_bootstrap.Row, { children: [
1017
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1018
- "span",
1019
- {
1020
- "aria-hidden": "true",
1021
- className: (0, import_clsx4.default)("uploadedDot", "uploadFailed"),
1022
- children: "!"
1023
- }
1024
- ) }),
1025
- /* @__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 }) }),
1026
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol" })
1027
- ] }),
1028
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1029
- import_react_bootstrap.Col,
1030
- {
1031
- style: {
1032
- width: "100%",
1033
- color: "#8e0039"
1034
- },
1035
- className: "errorMessageAddingFile",
1036
- ...activatedLanguage === "sv" ? {
1037
- "aria-label": `${errorFileName} ${errorObj.svMessage}`
1038
- } : {
1039
- "aria-label": `${errorFileName} ${errorObj.enMessage}`
1040
- },
1041
- children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
1042
- }
1043
- ) }),
1044
- /* @__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" }) })
1045
- ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
1046
- })
1047
- ] }),
1048
- errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { onClick: removeUploadErrors, className: "errorMessageAddingFile", children: [
1049
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "X" }),
1050
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Ta bort felmeddelande f\xF6r uppladdning av filer" })
1051
- ] })
1052
- ] }),
993
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "pts-errorSummary-container pts-addFile-error-container", children: [
994
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
995
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "addFile-error-list-container", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
996
+ "ul",
997
+ {
998
+ "aria-hidden": true,
999
+ className: "fileListUnorderedList",
1000
+ id: "errorSummary-ul",
1001
+ children: [
1002
+ " ",
1003
+ errorMessageAddingFile.map((errorObj, index) => {
1004
+ const errorFileName = errorObj.FileName;
1005
+ let mobileFirstFileName = errorObj.FileName.split(".").shift();
1006
+ mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
1007
+ const fileType = errorObj.FileName.split(".").pop();
1008
+ mobileFirstFileName = mobileFirstFileName + "." + fileType;
1009
+ 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: [
1010
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__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 }) }) }),
1011
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1012
+ import_react_bootstrap.Col,
1013
+ {
1014
+ className: "errorMessageAddingFile",
1015
+ ...activatedLanguage === "sv" ? {
1016
+ "aria-label": `${errorFileName} ${errorObj.svMessage}`
1017
+ } : {
1018
+ "aria-label": `${errorFileName} ${errorObj.enMessage}`
1019
+ },
1020
+ children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
1021
+ }
1022
+ ) })
1023
+ ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
1024
+ })
1025
+ ]
1026
+ }
1027
+ ) }),
1028
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "addFile-error-close-button", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1029
+ "button",
1030
+ {
1031
+ className: "selectedFilesLinkButton error-close",
1032
+ onClick: () => {
1033
+ removeError();
1034
+ },
1035
+ "aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelandet` : `Close error message`,
1036
+ children: activatedLanguage === "sv" ? "St\xE4ng" : "Close"
1037
+ }
1038
+ ) })
1039
+ ] }) }),
1053
1040
  questionObject.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.files.map((file, index) => {
1054
1041
  const indicatorfileName = file.FileName;
1055
1042
  let mobileFirstFileName = file.FileName.split(".").shift();
@@ -1057,7 +1044,7 @@ var SelectedFiles = ({
1057
1044
  const fileType = file.FileName.split(".").pop();
1058
1045
  mobileFirstFileName = mobileFirstFileName + "." + fileType;
1059
1046
  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: [
1060
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_bootstrap.Row, { children: [
1047
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "fileItem", children: [
1061
1048
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", className: "uploadedDot", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1062
1049
  "svg",
1063
1050
  {
@@ -1086,8 +1073,8 @@ var SelectedFiles = ({
1086
1073
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "desktopFileName", children: [
1087
1074
  file.FileName,
1088
1075
  " (",
1089
- file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(1)} MB`,
1090
- ")"
1076
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "fileSizeText", children: file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(1)} MB` }),
1077
+ " )"
1091
1078
  ] }) }),
1092
1079
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1093
1080
  "button",
@@ -1271,10 +1258,13 @@ var AddFiles = ({
1271
1258
  const removeFileFromNumberOfFiles = (newCount) => {
1272
1259
  setNumberOfFiles(newCount);
1273
1260
  };
1274
- const removeError = (errorIndex) => {
1261
+ const removeOneError = (errorIndex) => {
1275
1262
  let newErrors = errorMessageAddingFile.filter((e, index) => index !== errorIndex);
1276
1263
  setErrorMessageAddingFile(newErrors);
1277
1264
  };
1265
+ const removeError = () => {
1266
+ setErrorMessageAddingFile([]);
1267
+ };
1278
1268
  const handleRemoveErrors = () => {
1279
1269
  setErrorMessageAddingFile([]);
1280
1270
  };
@@ -1284,20 +1274,20 @@ var AddFiles = ({
1284
1274
  "p",
1285
1275
  {
1286
1276
  id: aboutId,
1287
- className: (0, import_clsx5.default)(
1277
+ className: (0, import_clsx4.default)(
1288
1278
  "addFilesMandatory",
1289
1279
  questionObject.hasValidationError ? " error" : ""
1290
1280
  ),
1291
1281
  children: [
1292
1282
  questionObject.aboutText,
1293
- questionObject.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "mandatoryAsterisk", "aria-hidden": "true", children: [
1283
+ questionObject.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "pts-root-mandatoryAsterisk", "aria-hidden": "true", children: [
1294
1284
  " ",
1295
1285
  "*"
1296
1286
  ] })
1297
1287
  ]
1298
1288
  }
1299
1289
  ),
1300
- questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "error addfileserror", id: errorId, children: [
1290
+ questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "pts-root-error error addfileserror", id: errorId, children: [
1301
1291
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
1302
1292
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
1303
1293
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
@@ -1318,7 +1308,7 @@ var AddFiles = ({
1318
1308
  removeUploadErrors: handleRemoveErrors
1319
1309
  }
1320
1310
  ),
1321
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DropFilesStandard_default, { FilesSelected: onDrop, DropFilesText: dropFilesText }),
1311
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DropFilesStandard_default, { FilesSelected: onDrop, DropFilesText: dropFilesText, language: activatedLanguage }),
1322
1312
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1323
1313
  SelectedFilesStandard_default,
1324
1314
  {
@@ -2140,7 +2130,7 @@ var RenderQuestionGroup = ({
2140
2130
  "aria-describedby": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
2141
2131
  children: [
2142
2132
  legend && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("legend", { children: [
2143
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: legend }),
2133
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "pts-legend", children: legend }),
2144
2134
  questionArray[0].hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "sr-only", children: [
2145
2135
  "Valideringsfel. ",
2146
2136
  questionArray[0].validationDefaultMessesege