optimized-react-component-library-xyz123 0.19.8 → 0.19.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -910,10 +910,13 @@ var AddFiles = ({
910
910
  const currentFiles = questionObject.files ? questionObject.files : [];
911
911
  const e = {
912
912
  target: {
913
- value: `${currentFiles.length + newFiles.length} files`,
913
+ value: currentFiles.length + newFiles.length > 0 ? `${currentFiles.length + newFiles.length} files` : "",
914
914
  files: [...currentFiles, ...newFiles]
915
915
  }
916
916
  };
917
+ if (e.target.value === "0 files") {
918
+ e.target.value = "";
919
+ }
917
920
  handleQuestionInputChange(e, questionObject);
918
921
  setNumberOfFiles(currentFiles.length + newFiles.length);
919
922
  setNewFiles([]);
@@ -933,68 +936,75 @@ var AddFiles = ({
933
936
  setErrorMessageAddingFile([]);
934
937
  };
935
938
  return /* @__PURE__ */ jsxs9(Fragment11, { children: [
936
- !showPreview && visible && /* @__PURE__ */ jsx11("div", { className: "root-question addFile-question-container", id: `question-${questionObject.id}`, children: /* @__PURE__ */ jsxs9("div", { role: "group", children: [
937
- questionObject.aboutText && /* @__PURE__ */ jsxs9(
938
- "p",
939
- {
940
- id: aboutId,
941
- className: clsx3(
942
- "addFilesMandatory",
943
- questionObject.hasValidationError ? " error" : ""
939
+ !showPreview && visible && /* @__PURE__ */ jsx11(
940
+ "div",
941
+ {
942
+ className: "root-question addFile-question-container",
943
+ id: `question-${questionObject.id}`,
944
+ children: /* @__PURE__ */ jsxs9("div", { role: "group", children: [
945
+ questionObject.aboutText && /* @__PURE__ */ jsxs9(
946
+ "p",
947
+ {
948
+ id: aboutId,
949
+ className: clsx3(
950
+ "addFilesMandatory",
951
+ questionObject.hasValidationError ? " error" : ""
952
+ ),
953
+ children: [
954
+ questionObject.aboutText,
955
+ questionObject.isQuestionMandatory && /* @__PURE__ */ jsxs9("span", { className: "pts-root-mandatoryAsterisk", "aria-label": "Obligatorisk fr\xE5ga", children: [
956
+ " ",
957
+ "*"
958
+ ] })
959
+ ]
960
+ }
944
961
  ),
945
- children: [
946
- questionObject.aboutText,
947
- questionObject.isQuestionMandatory && /* @__PURE__ */ jsxs9("span", { className: "pts-root-mandatoryAsterisk", "aria-label": "Obligatorisk fr\xE5ga", children: [
948
- " ",
949
- "*"
950
- ] })
951
- ]
952
- }
953
- ),
954
- questionObject.hasValidationError && /* @__PURE__ */ jsxs9("div", { className: "pts-root-error error addfileserror", id: errorId, children: [
955
- /* @__PURE__ */ jsx11("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
956
- /* @__PURE__ */ jsx11("span", { className: "sr-only", children: "Valideringsfel" }),
957
- /* @__PURE__ */ jsx11("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
958
- ] }),
959
- /* @__PURE__ */ jsx11(
960
- ExploreFilesStandard_default,
961
- {
962
- FilesSelected: onDrop,
963
- numberOfFiles,
964
- allowedNumberOfFiles,
965
- activatedLanguage,
966
- inputId,
967
- labelId,
968
- aboutId,
969
- errorId,
970
- questionObject,
971
- errorMessageAddingFile,
972
- removeUploadErrors: handleRemoveErrors
973
- }
974
- ),
975
- /* @__PURE__ */ jsx11(
976
- DropFilesStandard_default,
977
- {
978
- FilesSelected: onDrop,
979
- DropFilesText: dropFilesText,
980
- language: activatedLanguage
981
- }
982
- ),
983
- /* @__PURE__ */ jsx11(
984
- SelectedFilesStandard_default,
985
- {
986
- questionObject,
987
- isTouched: handleQuestionInputChange,
988
- removeFile: removeFileFromNumberOfFiles,
989
- removeError,
990
- errorMessageAddingFile,
991
- activatedLanguage,
992
- numberOfFiles,
993
- setNumberOfFiles,
994
- removeUploadErrors: handleRemoveErrors
995
- }
996
- )
997
- ] }) }),
962
+ questionObject.hasValidationError && /* @__PURE__ */ jsxs9("div", { className: "pts-root-error error addfileserror", id: errorId, children: [
963
+ /* @__PURE__ */ jsx11("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
964
+ /* @__PURE__ */ jsx11("span", { className: "sr-only", children: "Valideringsfel" }),
965
+ /* @__PURE__ */ jsx11("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
966
+ ] }),
967
+ /* @__PURE__ */ jsx11(
968
+ ExploreFilesStandard_default,
969
+ {
970
+ FilesSelected: onDrop,
971
+ numberOfFiles,
972
+ allowedNumberOfFiles,
973
+ activatedLanguage,
974
+ inputId,
975
+ labelId,
976
+ aboutId,
977
+ errorId,
978
+ questionObject,
979
+ errorMessageAddingFile,
980
+ removeUploadErrors: handleRemoveErrors
981
+ }
982
+ ),
983
+ /* @__PURE__ */ jsx11(
984
+ DropFilesStandard_default,
985
+ {
986
+ FilesSelected: onDrop,
987
+ DropFilesText: dropFilesText,
988
+ language: activatedLanguage
989
+ }
990
+ ),
991
+ /* @__PURE__ */ jsx11(
992
+ SelectedFilesStandard_default,
993
+ {
994
+ questionObject,
995
+ isTouched: handleQuestionInputChange,
996
+ removeFile: removeFileFromNumberOfFiles,
997
+ removeError,
998
+ errorMessageAddingFile,
999
+ activatedLanguage,
1000
+ numberOfFiles,
1001
+ setNumberOfFiles,
1002
+ removeUploadErrors: handleRemoveErrors
1003
+ }
1004
+ )
1005
+ ] })
1006
+ }
1007
+ ),
998
1008
  showPreview && /* @__PURE__ */ jsx11(PreviewAddFiles, { activatedLanguage, questionObject })
999
1009
  ] });
1000
1010
  };
@@ -2044,7 +2054,7 @@ var CookieBanner_default = CookieBanner;
2044
2054
 
2045
2055
  // src/components/layout/FooterStandard/FooterStandard.tsx
2046
2056
  import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
2047
- var Footer = ({ activatedLanguage = "sv", appUsesCookies = false, openCookieBanner }) => {
2057
+ var Footer = ({ activatedLanguage = "sv" }) => {
2048
2058
  return /* @__PURE__ */ jsxs14("footer", { className: "pts-footer-container", children: [
2049
2059
  /* @__PURE__ */ jsx16("div", { className: "pts-footer-slogan-text-container", children: /* @__PURE__ */ jsx16("p", { className: "pts-footer-slogan-text", children: activatedLanguage === "sv" ? "S\xE4ker och tillg\xE4nglig kommunikation f\xF6r Sverige" : "Secure and accessible communication for Sweden" }) }),
2050
2060
  /* @__PURE__ */ jsxs14("div", { className: "pts-footer-content", children: [
@@ -2113,18 +2123,7 @@ var Footer = ({ activatedLanguage = "sv", appUsesCookies = false, openCookieBann
2113
2123
  ]
2114
2124
  }
2115
2125
  ) }),
2116
- /* @__PURE__ */ jsx16("li", { children: appUsesCookies ? /* @__PURE__ */ jsxs14(
2117
- "button",
2118
- {
2119
- "aria-controls": activatedLanguage === "en" ? "Kakbanner" : '"cookie-banner"',
2120
- "aria-haspopup": "dialog",
2121
- onClick: openCookieBanner,
2122
- children: [
2123
- /* @__PURE__ */ jsx16("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Cookies (opens cookie banner)" : "PTS Kakor (\xF6ppnar kakbanner)" }),
2124
- /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Cookies" : "Kakor" })
2125
- ]
2126
- }
2127
- ) : /* @__PURE__ */ jsxs14(
2126
+ /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsxs14(
2128
2127
  "a",
2129
2128
  {
2130
2129
  href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",