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.d.mts CHANGED
@@ -733,8 +733,6 @@ declare const CookieBanner: React$1.FC<CookieBannerProps>;
733
733
 
734
734
  interface FooterProps {
735
735
  activatedLanguage?: string;
736
- appUsesCookies?: boolean;
737
- openCookieBanner?: () => void;
738
736
  }
739
737
 
740
738
  declare const Footer: FC<FooterProps>;
package/dist/index.d.ts CHANGED
@@ -733,8 +733,6 @@ declare const CookieBanner: React$1.FC<CookieBannerProps>;
733
733
 
734
734
  interface FooterProps {
735
735
  activatedLanguage?: string;
736
- appUsesCookies?: boolean;
737
- openCookieBanner?: () => void;
738
736
  }
739
737
 
740
738
  declare const Footer: FC<FooterProps>;
package/dist/index.js CHANGED
@@ -992,10 +992,13 @@ var AddFiles = ({
992
992
  const currentFiles = questionObject.files ? questionObject.files : [];
993
993
  const e = {
994
994
  target: {
995
- value: `${currentFiles.length + newFiles.length} files`,
995
+ value: currentFiles.length + newFiles.length > 0 ? `${currentFiles.length + newFiles.length} files` : "",
996
996
  files: [...currentFiles, ...newFiles]
997
997
  }
998
998
  };
999
+ if (e.target.value === "0 files") {
1000
+ e.target.value = "";
1001
+ }
999
1002
  handleQuestionInputChange(e, questionObject);
1000
1003
  setNumberOfFiles(currentFiles.length + newFiles.length);
1001
1004
  setNewFiles([]);
@@ -1015,68 +1018,75 @@ var AddFiles = ({
1015
1018
  setErrorMessageAddingFile([]);
1016
1019
  };
1017
1020
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1018
- !showPreview && visible && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "root-question addFile-question-container", id: `question-${questionObject.id}`, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { role: "group", children: [
1019
- questionObject.aboutText && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1020
- "p",
1021
- {
1022
- id: aboutId,
1023
- className: (0, import_clsx3.default)(
1024
- "addFilesMandatory",
1025
- questionObject.hasValidationError ? " error" : ""
1021
+ !showPreview && visible && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1022
+ "div",
1023
+ {
1024
+ className: "root-question addFile-question-container",
1025
+ id: `question-${questionObject.id}`,
1026
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { role: "group", children: [
1027
+ questionObject.aboutText && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1028
+ "p",
1029
+ {
1030
+ id: aboutId,
1031
+ className: (0, import_clsx3.default)(
1032
+ "addFilesMandatory",
1033
+ questionObject.hasValidationError ? " error" : ""
1034
+ ),
1035
+ children: [
1036
+ questionObject.aboutText,
1037
+ questionObject.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "pts-root-mandatoryAsterisk", "aria-label": "Obligatorisk fr\xE5ga", children: [
1038
+ " ",
1039
+ "*"
1040
+ ] })
1041
+ ]
1042
+ }
1026
1043
  ),
1027
- children: [
1028
- questionObject.aboutText,
1029
- questionObject.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "pts-root-mandatoryAsterisk", "aria-label": "Obligatorisk fr\xE5ga", children: [
1030
- " ",
1031
- "*"
1032
- ] })
1033
- ]
1034
- }
1035
- ),
1036
- questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "pts-root-error error addfileserror", id: errorId, children: [
1037
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
1038
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
1039
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
1040
- ] }),
1041
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1042
- ExploreFilesStandard_default,
1043
- {
1044
- FilesSelected: onDrop,
1045
- numberOfFiles,
1046
- allowedNumberOfFiles,
1047
- activatedLanguage,
1048
- inputId,
1049
- labelId,
1050
- aboutId,
1051
- errorId,
1052
- questionObject,
1053
- errorMessageAddingFile,
1054
- removeUploadErrors: handleRemoveErrors
1055
- }
1056
- ),
1057
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1058
- DropFilesStandard_default,
1059
- {
1060
- FilesSelected: onDrop,
1061
- DropFilesText: dropFilesText,
1062
- language: activatedLanguage
1063
- }
1064
- ),
1065
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1066
- SelectedFilesStandard_default,
1067
- {
1068
- questionObject,
1069
- isTouched: handleQuestionInputChange,
1070
- removeFile: removeFileFromNumberOfFiles,
1071
- removeError,
1072
- errorMessageAddingFile,
1073
- activatedLanguage,
1074
- numberOfFiles,
1075
- setNumberOfFiles,
1076
- removeUploadErrors: handleRemoveErrors
1077
- }
1078
- )
1079
- ] }) }),
1044
+ questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "pts-root-error error addfileserror", id: errorId, children: [
1045
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
1046
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
1047
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
1048
+ ] }),
1049
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1050
+ ExploreFilesStandard_default,
1051
+ {
1052
+ FilesSelected: onDrop,
1053
+ numberOfFiles,
1054
+ allowedNumberOfFiles,
1055
+ activatedLanguage,
1056
+ inputId,
1057
+ labelId,
1058
+ aboutId,
1059
+ errorId,
1060
+ questionObject,
1061
+ errorMessageAddingFile,
1062
+ removeUploadErrors: handleRemoveErrors
1063
+ }
1064
+ ),
1065
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1066
+ DropFilesStandard_default,
1067
+ {
1068
+ FilesSelected: onDrop,
1069
+ DropFilesText: dropFilesText,
1070
+ language: activatedLanguage
1071
+ }
1072
+ ),
1073
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1074
+ SelectedFilesStandard_default,
1075
+ {
1076
+ questionObject,
1077
+ isTouched: handleQuestionInputChange,
1078
+ removeFile: removeFileFromNumberOfFiles,
1079
+ removeError,
1080
+ errorMessageAddingFile,
1081
+ activatedLanguage,
1082
+ numberOfFiles,
1083
+ setNumberOfFiles,
1084
+ removeUploadErrors: handleRemoveErrors
1085
+ }
1086
+ )
1087
+ ] })
1088
+ }
1089
+ ),
1080
1090
  showPreview && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PreviewAddFiles, { activatedLanguage, questionObject })
1081
1091
  ] });
1082
1092
  };
@@ -2123,7 +2133,7 @@ var CookieBanner_default = CookieBanner;
2123
2133
 
2124
2134
  // src/components/layout/FooterStandard/FooterStandard.tsx
2125
2135
  var import_jsx_runtime16 = require("react/jsx-runtime");
2126
- var Footer = ({ activatedLanguage = "sv", appUsesCookies = false, openCookieBanner }) => {
2136
+ var Footer = ({ activatedLanguage = "sv" }) => {
2127
2137
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("footer", { className: "pts-footer-container", children: [
2128
2138
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "pts-footer-slogan-text-container", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "pts-footer-slogan-text", children: activatedLanguage === "sv" ? "S\xE4ker och tillg\xE4nglig kommunikation f\xF6r Sverige" : "Secure and accessible communication for Sweden" }) }),
2129
2139
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "pts-footer-content", children: [
@@ -2192,18 +2202,7 @@ var Footer = ({ activatedLanguage = "sv", appUsesCookies = false, openCookieBann
2192
2202
  ]
2193
2203
  }
2194
2204
  ) }),
2195
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: appUsesCookies ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2196
- "button",
2197
- {
2198
- "aria-controls": activatedLanguage === "en" ? "Kakbanner" : '"cookie-banner"',
2199
- "aria-haspopup": "dialog",
2200
- onClick: openCookieBanner,
2201
- children: [
2202
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Cookies (opens cookie banner)" : "PTS Kakor (\xF6ppnar kakbanner)" }),
2203
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Cookies" : "Kakor" })
2204
- ]
2205
- }
2206
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2205
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2207
2206
  "a",
2208
2207
  {
2209
2208
  href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",