optimized-react-component-library-xyz123 0.1.57 → 0.1.59

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 CHANGED
@@ -2,336 +2,6 @@
2
2
  /* src/NewInputComponentStandard/MultipleCheckboxesStandard/MultipleCheckboxesStandard.css */
3
3
  /* src/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.css */
4
4
  /* src/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.css */
5
- .files-upload {
6
- width: 100%;
7
- max-width: 800px;
8
- margin: 0 auto;
9
- font-family:
10
- "Segoe UI",
11
- Tahoma,
12
- Geneva,
13
- Verdana,
14
- sans-serif;
15
- }
16
- .files-drop-zone {
17
- border: 2px dashed #6e3282;
18
- border-radius: 12px;
19
- padding: 3rem 2rem;
20
- text-align: center;
21
- transition: all 0.3s ease;
22
- background-color: #fafafa;
23
- cursor: pointer;
24
- position: relative;
25
- overflow: hidden;
26
- }
27
- .files-drop-zone:hover {
28
- border-color: #6e3282;
29
- background-color: #f5ebf8;
30
- transform: translateY(-2px);
31
- box-shadow: 0 4px 12px rgba(220, 148, 253, 0.15);
32
- }
33
- .files-drop-zone.drag-active {
34
- border-color: #6e3282;
35
- background-color: #f5ebf8;
36
- transform: scale(1.02);
37
- box-shadow: 0 8px 25px rgba(30, 167, 253, 0.2);
38
- }
39
- .files-drop-zone:focus {
40
- border: 0.2rem solid #6e3282;
41
- }
42
- .files-drop-zone:focus-visible {
43
- outline-offset: 0 !important;
44
- outline-style: solid !important;
45
- outline-color: #fff !important;
46
- outline-width: 2px !important;
47
- box-shadow: 0 0 0 4px #000 !important;
48
- }
49
- .files-drop-content {
50
- pointer-events: none;
51
- }
52
- .files-icon {
53
- font-size: 4rem;
54
- margin-bottom: 1rem;
55
- opacity: 0.7;
56
- animation: float 3s ease-in-out infinite;
57
- }
58
- @keyframes float {
59
- 0%, 100% {
60
- transform: translateY(0px);
61
- }
62
- 50% {
63
- transform: translateY(-10px);
64
- }
65
- }
66
- .files-drop-text {
67
- font-size: 1.2rem;
68
- margin-bottom: 0.5rem;
69
- color: #333;
70
- font-weight: 500;
71
- }
72
- .files-drop-info {
73
- font-size: 0.9rem;
74
- color: #666;
75
- margin: 0;
76
- }
77
- .files-allowed-types {
78
- font-size: 0.85rem;
79
- color: #555;
80
- margin: 0.75rem 0 0 0;
81
- padding: 0.5rem;
82
- background-color: rgba(146, 64, 252, 0.1);
83
- border-radius: 6px;
84
- border-left: 3px solid #ce95e0;
85
- }
86
- .files-allowed-types strong {
87
- color: #6e3282;
88
- }
89
- .files-input-hidden {
90
- display: none;
91
- }
92
- .files-summary {
93
- margin: 1.5rem 0;
94
- padding: 1rem;
95
- background-color: #f8f9fa;
96
- border-radius: 8px;
97
- border: 1px solid #e9ecef;
98
- }
99
- .files-summary-stats {
100
- display: flex;
101
- gap: 1rem;
102
- margin-bottom: 1rem;
103
- flex-wrap: wrap;
104
- }
105
- .stat {
106
- padding: 0.5rem 1rem;
107
- border-radius: 20px;
108
- background-color: #e9ecef;
109
- font-size: 0.9rem;
110
- display: flex;
111
- align-items: center;
112
- gap: 0.5rem;
113
- }
114
- .stat.pending {
115
- background-color: #fff3cd;
116
- color: #856404;
117
- }
118
- .stat.completed {
119
- background-color: #d1e7dd;
120
- color: #0a3622;
121
- }
122
- .stat.error {
123
- background-color: #f8d7da;
124
- color: #721c24;
125
- }
126
- .files-summary-actions {
127
- display: flex;
128
- gap: 0.5rem;
129
- flex-wrap: wrap;
130
- }
131
- .action-button {
132
- padding: 0.75rem 1.5rem;
133
- border: none;
134
- border-radius: 6px;
135
- cursor: pointer;
136
- font-weight: 500;
137
- transition: all 0.2s ease;
138
- display: flex;
139
- align-items: center;
140
- gap: 0.5rem;
141
- }
142
- .action-button.primary {
143
- background-color: #1ea7fd;
144
- color: white;
145
- }
146
- .action-button.primary:hover {
147
- background-color: #1890ff;
148
- transform: translateY(-1px);
149
- }
150
- .action-button.secondary {
151
- background-color: #6c757d;
152
- color: white;
153
- }
154
- .action-button.secondary:hover {
155
- background-color: #5a6268;
156
- transform: translateY(-1px);
157
- }
158
- .files-list {
159
- margin-top: 1.5rem;
160
- }
161
- .files-list h4 {
162
- margin-bottom: 1rem;
163
- color: #333;
164
- font-size: 1.1rem;
165
- font-weight: 600;
166
- }
167
- .files-items {
168
- list-style: none;
169
- padding: 0;
170
- margin: 0;
171
- }
172
- .file-item {
173
- display: flex;
174
- align-items: center;
175
- gap: 1rem;
176
- padding: 1rem;
177
- border: 1px solid #e9ecef;
178
- border-radius: 8px;
179
- margin-bottom: 0.75rem;
180
- background-color: white;
181
- transition: all 0.2s ease;
182
- position: relative;
183
- }
184
- .file-item:hover {
185
- background-color: #f8f9fa;
186
- border-color: #dee2e6;
187
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
188
- }
189
- .file-item.uploading {
190
- background-color: #e6f7ff;
191
- border-color: #91d5ff;
192
- }
193
- .file-item.completed {
194
- background-color: #f6ffed;
195
- border-color: #b7eb8f;
196
- }
197
- .file-item.error {
198
- background-color: #fff2f0;
199
- border-color: #ffccc7;
200
- }
201
- .file-icon-status {
202
- font-size: 1.5rem;
203
- min-width: 2rem;
204
- text-align: center;
205
- }
206
- .file-info {
207
- flex: 1;
208
- min-width: 0;
209
- }
210
- .file-name {
211
- font-weight: 500;
212
- color: #333;
213
- margin-bottom: 0.5rem;
214
- word-break: break-word;
215
- }
216
- .file-details {
217
- display: flex;
218
- gap: 1rem;
219
- font-size: 0.85rem;
220
- color: #666;
221
- flex-wrap: wrap;
222
- }
223
- .file-size {
224
- color: #666;
225
- }
226
- .file-status {
227
- color: #1ea7fd;
228
- font-weight: 500;
229
- }
230
- .file-error {
231
- color: #dc3545;
232
- font-weight: 500;
233
- }
234
- .progress-bar {
235
- width: 100%;
236
- height: 4px;
237
- background-color: #e9ecef;
238
- border-radius: 2px;
239
- margin-top: 0.5rem;
240
- overflow: hidden;
241
- }
242
- .progress-fill {
243
- height: 100%;
244
- background-color: #1ea7fd;
245
- transition: width 0.3s ease;
246
- border-radius: 2px;
247
- }
248
- .file-actions {
249
- display: flex;
250
- gap: 0.5rem;
251
- }
252
- .action-btn {
253
- background: none;
254
- border: 1px solid transparent;
255
- padding: 0.5rem;
256
- border-radius: 6px;
257
- cursor: pointer;
258
- font-size: 1rem;
259
- transition: all 0.2s ease;
260
- min-width: 2.5rem;
261
- height: 2.5rem;
262
- display: flex;
263
- align-items: center;
264
- justify-content: center;
265
- }
266
- .action-btn.upload {
267
- color: #1ea7fd;
268
- border-color: #1ea7fd;
269
- }
270
- .action-btn.upload:hover {
271
- background-color: #1ea7fd;
272
- color: white;
273
- }
274
- .action-btn.retry {
275
- color: #fd7e14;
276
- border-color: #fd7e14;
277
- }
278
- .action-btn.retry:hover {
279
- background-color: #fd7e14;
280
- color: white;
281
- }
282
- .action-btn.remove {
283
- color: #6e3282;
284
- border-color: #6e3282;
285
- }
286
- .action-btn.remove:hover {
287
- background-color: #6e3282;
288
- color: white;
289
- }
290
- @media (max-width: 768px) {
291
- .files-drop-zone {
292
- padding: 2rem 1rem;
293
- }
294
- .files-icon {
295
- font-size: 3rem;
296
- }
297
- .files-drop-text {
298
- font-size: 1rem;
299
- }
300
- .files-summary-stats {
301
- flex-direction: column;
302
- gap: 0.5rem;
303
- }
304
- .files-summary-actions {
305
- flex-direction: column;
306
- }
307
- .action-button {
308
- justify-content: center;
309
- }
310
- .file-item {
311
- flex-direction: column;
312
- align-items: flex-start;
313
- gap: 0.75rem;
314
- }
315
- .file-details {
316
- flex-direction: column;
317
- gap: 0.25rem;
318
- }
319
- .file-actions {
320
- align-self: flex-end;
321
- }
322
- }
323
- @media (max-width: 480px) {
324
- .files-upload {
325
- padding: 0 0.5rem;
326
- }
327
- .files-drop-zone {
328
- padding: 1.5rem 1rem;
329
- }
330
- .file-item {
331
- padding: 0.75rem;
332
- }
333
- }
334
-
335
5
  /* src/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.css */
336
6
  .invisible {
337
7
  display: none;
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,15 +845,6 @@ 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
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 }) });
862
849
  };
863
850
  var ScreenReaderErrors_default = ScreenReaderErrors;
@@ -875,24 +862,10 @@ var ExploreFiles = ({
875
862
  errorId,
876
863
  questionObject,
877
864
  showErrors,
878
- errorMessageAddingFile,
879
- removeUploadErrors = () => {
880
- }
865
+ errorMessageAddingFile
881
866
  }) => {
882
867
  const fileInputRef = (0, import_react4.useRef)(null);
883
868
  const buttonInputRef = (0, import_react4.useRef)(null);
884
- const [showErrorMessagesForScreenReader, setShowErrorMessagesForScreenReader] = import_react4.default.useState(false);
885
- (0, import_react4.useEffect)(() => {
886
- const button = buttonInputRef.current;
887
- if (!button) return;
888
- const handleFocus = () => {
889
- setShowErrorMessagesForScreenReader(!showErrorMessagesForScreenReader);
890
- };
891
- button.addEventListener("focus", handleFocus);
892
- return () => {
893
- button.removeEventListener("focus", handleFocus);
894
- };
895
- }, []);
896
869
  const handleFiles = (event) => {
897
870
  const files = Array.from(event.target.files || []);
898
871
  FilesSelected(files);
@@ -902,10 +875,6 @@ var ExploreFiles = ({
902
875
  var _a;
903
876
  (_a = fileInputRef.current) == null ? void 0 : _a.click();
904
877
  };
905
- const putFocusOnButton = () => {
906
- var _a;
907
- (_a = buttonInputRef.current) == null ? void 0 : _a.focus();
908
- };
909
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";
910
879
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "inputContainer", children: [
911
880
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
@@ -946,7 +915,7 @@ var ExploreFiles = ({
946
915
  id: inputId
947
916
  }
948
917
  ),
949
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "filePickText", children: addFilesInfoText })
918
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { "aria-hidden": true, className: "filePickText", children: addFilesInfoText })
950
919
  ]
951
920
  }
952
921
  ),
@@ -954,9 +923,7 @@ var ExploreFiles = ({
954
923
  ScreenReaderErrors_default,
955
924
  {
956
925
  errorMessageAddingFile,
957
- removeUploadErrors,
958
- activatedLanguage,
959
- putFocusOnButton
926
+ activatedLanguage
960
927
  }
961
928
  )
962
929
  ] }) });
@@ -990,7 +957,8 @@ var SelectedFiles = ({
990
957
  errorMessageAddingFile,
991
958
  activatedLanguage,
992
959
  numberOfFiles,
993
- setNumberOfFiles
960
+ setNumberOfFiles,
961
+ removeUploadErrors
994
962
  }) => {
995
963
  const theDiv = (0, import_react6.useRef)(null);
996
964
  const remove = (file) => {
@@ -1020,62 +988,53 @@ var SelectedFiles = ({
1020
988
  };
1021
989
  const windowWidth = useWindowWidth();
1022
990
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1023
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { "aria-hidden": true, className: "fileListUnorderedList", children: [
1024
- " ",
1025
- errorMessageAddingFile.map((errorObj, index) => {
1026
- const errorFileName = errorObj.FileName;
1027
- let mobileFirstFileName = errorObj.FileName.split(".").shift();
1028
- mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
1029
- const fileType = errorObj.FileName.split(".").pop();
1030
- mobileFirstFileName = mobileFirstFileName + "." + fileType;
1031
- 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: [
1032
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_bootstrap.Row, { children: [
1033
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1034
- "span",
991
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
992
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { "aria-hidden": true, className: "fileListUnorderedList", children: [
993
+ " ",
994
+ errorMessageAddingFile.map((errorObj, index) => {
995
+ const errorFileName = errorObj.FileName;
996
+ let mobileFirstFileName = errorObj.FileName.split(".").shift();
997
+ mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
998
+ const fileType = errorObj.FileName.split(".").pop();
999
+ mobileFirstFileName = mobileFirstFileName + "." + fileType;
1000
+ 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: [
1001
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_bootstrap.Row, { children: [
1002
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1003
+ "span",
1004
+ {
1005
+ "aria-hidden": "true",
1006
+ className: (0, import_clsx4.default)("uploadedDot", "uploadFailed"),
1007
+ children: "!"
1008
+ }
1009
+ ) }),
1010
+ /* @__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.Col, { className: "lastCol" })
1012
+ ] }),
1013
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1014
+ import_react_bootstrap.Col,
1035
1015
  {
1036
- "aria-hidden": "true",
1037
- className: (0, import_clsx4.default)("uploadedDot", "uploadFailed"),
1038
- children: "!"
1016
+ style: {
1017
+ width: "100%",
1018
+ color: "#8e0039"
1019
+ },
1020
+ className: "errorMessageAddingFile",
1021
+ ...activatedLanguage === "sv" ? {
1022
+ "aria-label": `${errorFileName} ${errorObj.svMessage}`
1023
+ } : {
1024
+ "aria-label": `${errorFileName} ${errorObj.enMessage}`
1025
+ },
1026
+ children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
1039
1027
  }
1040
1028
  ) }),
1041
- /* @__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 }) }),
1042
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol" })
1043
- ] }),
1044
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1045
- import_react_bootstrap.Col,
1046
- {
1047
- style: {
1048
- width: "100%",
1049
- color: "#8e0039"
1050
- },
1051
- className: "errorMessageAddingFile",
1052
- ...activatedLanguage === "sv" ? {
1053
- "aria-label": `${errorFileName} ${errorObj.svMessage}`
1054
- } : {
1055
- "aria-label": `${errorFileName} ${errorObj.enMessage}`
1056
- },
1057
- children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
1058
- }
1059
- ) }),
1060
- errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1061
- "button",
1062
- {
1063
- style: {
1064
- marginRight: "8px",
1065
- backgroundColor: "transparent",
1066
- border: "none",
1067
- textDecoration: "underline",
1068
- cursor: "pointer"
1069
- },
1070
- className: "errorMessageAddingFile",
1071
- "aria-label": activatedLanguage === "sv" ? "Ta bort felmeddelande f\xF6r uppladdning av filer" : "Remove error message for file uploads",
1072
- children: "Ta bort fel! / Remove errors!"
1073
- }
1074
- ),
1075
- /* @__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" }) })
1076
- ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
1077
- })
1078
- ] }) }),
1029
+ /* @__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" }) })
1030
+ ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
1031
+ })
1032
+ ] }),
1033
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { onClick: removeUploadErrors, className: "errorMessageAddingFile", children: [
1034
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "X" }),
1035
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Ta bort felmeddelande f\xF6r uppladdning av filer" })
1036
+ ] })
1037
+ ] }),
1079
1038
  questionObject.Files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.Files.map((file, index) => {
1080
1039
  const indicatorfileName = file.FileName;
1081
1040
  let mobileFirstFileName = file.FileName.split(".").shift();
@@ -1355,7 +1314,8 @@ var AddFiles = ({
1355
1314
  errorMessageAddingFile,
1356
1315
  activatedLanguage,
1357
1316
  numberOfFiles,
1358
- setNumberOfFiles
1317
+ setNumberOfFiles,
1318
+ removeUploadErrors: handleRemoveErrors
1359
1319
  }
1360
1320
  )
1361
1321
  ] }) }),
package/dist/index.mjs CHANGED
@@ -756,7 +756,7 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
756
756
  var DropFilesStandard_default = DropFiles;
757
757
 
758
758
  // src/NewInputComponentStandard/AddFilesStandard/ExploreFilesStandard.tsx
759
- import React3, { useEffect as useEffect3, useRef as useRef2 } from "react";
759
+ import { useRef as useRef2 } from "react";
760
760
  import clsx2 from "clsx";
761
761
 
762
762
  // src/NewInputComponentStandard/AddFilesStandard/ScreenReaderErrors.tsx
@@ -764,11 +764,7 @@ import React2 from "react";
764
764
  import { Fragment as Fragment7, jsx as jsx7 } from "react/jsx-runtime";
765
765
  var ScreenReaderErrors = ({
766
766
  errorMessageAddingFile,
767
- activatedLanguage,
768
- removeUploadErrors,
769
- putFocusOnButton = () => {
770
- alert("no function");
771
- }
767
+ activatedLanguage
772
768
  }) => {
773
769
  const [activateErrorMessagesForScreenReader, setActivateErrorMessagesForScreenReader] = React2.useState(false);
774
770
  const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = React2.useState("");
@@ -784,15 +780,6 @@ var ScreenReaderErrors = ({
784
780
  setActivateErrorMessagesForScreenReader(true);
785
781
  }
786
782
  }, [errorMessageAddingFile]);
787
- const handleRemoveErrors = () => {
788
- const errorMessages = activatedLanguage === "sv" ? `Felmeddelande raderat.` : `Error message deleted.`;
789
- setErrorMessagesForScreenReader(errorMessages);
790
- removeUploadErrors();
791
- putFocusOnButton();
792
- setTimeout(() => {
793
- setActivateErrorMessagesForScreenReader(false);
794
- }, 1e3);
795
- };
796
783
  return /* @__PURE__ */ jsx7(Fragment7, { children: activateErrorMessagesForScreenReader && /* @__PURE__ */ jsx7("p", { role: "alert", className: "sr-only", "aria-atomic": "true", children: errorMessagesForScreenReader }) });
797
784
  };
798
785
  var ScreenReaderErrors_default = ScreenReaderErrors;
@@ -810,24 +797,10 @@ var ExploreFiles = ({
810
797
  errorId,
811
798
  questionObject,
812
799
  showErrors,
813
- errorMessageAddingFile,
814
- removeUploadErrors = () => {
815
- }
800
+ errorMessageAddingFile
816
801
  }) => {
817
802
  const fileInputRef = useRef2(null);
818
803
  const buttonInputRef = useRef2(null);
819
- const [showErrorMessagesForScreenReader, setShowErrorMessagesForScreenReader] = React3.useState(false);
820
- useEffect3(() => {
821
- const button = buttonInputRef.current;
822
- if (!button) return;
823
- const handleFocus = () => {
824
- setShowErrorMessagesForScreenReader(!showErrorMessagesForScreenReader);
825
- };
826
- button.addEventListener("focus", handleFocus);
827
- return () => {
828
- button.removeEventListener("focus", handleFocus);
829
- };
830
- }, []);
831
804
  const handleFiles = (event) => {
832
805
  const files = Array.from(event.target.files || []);
833
806
  FilesSelected(files);
@@ -837,10 +810,6 @@ var ExploreFiles = ({
837
810
  var _a;
838
811
  (_a = fileInputRef.current) == null ? void 0 : _a.click();
839
812
  };
840
- const putFocusOnButton = () => {
841
- var _a;
842
- (_a = buttonInputRef.current) == null ? void 0 : _a.focus();
843
- };
844
813
  let addFilesInfoText = numberOfFiles > 0 ? activatedLanguage === "sv" ? `${numberOfFiles} filer valda (max ${allowedNumberOfFiles})` : `${numberOfFiles} files chosed (max ${allowedNumberOfFiles})` : activatedLanguage === "sv" ? "Ingen fil vald" : "No file chosen";
845
814
  return /* @__PURE__ */ jsx8(Fragment8, { children: /* @__PURE__ */ jsxs7("div", { className: "inputContainer", children: [
846
815
  /* @__PURE__ */ jsxs7(
@@ -881,7 +850,7 @@ var ExploreFiles = ({
881
850
  id: inputId
882
851
  }
883
852
  ),
884
- /* @__PURE__ */ jsx8("span", { className: "filePickText", children: addFilesInfoText })
853
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": true, className: "filePickText", children: addFilesInfoText })
885
854
  ]
886
855
  }
887
856
  ),
@@ -889,9 +858,7 @@ var ExploreFiles = ({
889
858
  ScreenReaderErrors_default,
890
859
  {
891
860
  errorMessageAddingFile,
892
- removeUploadErrors,
893
- activatedLanguage,
894
- putFocusOnButton
861
+ activatedLanguage
895
862
  }
896
863
  )
897
864
  ] }) });
@@ -925,7 +892,8 @@ var SelectedFiles = ({
925
892
  errorMessageAddingFile,
926
893
  activatedLanguage,
927
894
  numberOfFiles,
928
- setNumberOfFiles
895
+ setNumberOfFiles,
896
+ removeUploadErrors
929
897
  }) => {
930
898
  const theDiv = useRef3(null);
931
899
  const remove = (file) => {
@@ -955,62 +923,53 @@ var SelectedFiles = ({
955
923
  };
956
924
  const windowWidth = useWindowWidth();
957
925
  return /* @__PURE__ */ jsxs8(Fragment10, { children: [
958
- /* @__PURE__ */ jsx10("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs8("ul", { "aria-hidden": true, className: "fileListUnorderedList", children: [
959
- " ",
960
- errorMessageAddingFile.map((errorObj, index) => {
961
- const errorFileName = errorObj.FileName;
962
- let mobileFirstFileName = errorObj.FileName.split(".").shift();
963
- mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
964
- const fileType = errorObj.FileName.split(".").pop();
965
- mobileFirstFileName = mobileFirstFileName + "." + fileType;
966
- return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs8("div", { className: "fileInList", children: [
967
- /* @__PURE__ */ jsxs8(Row, { children: [
968
- /* @__PURE__ */ jsx10(Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ jsx10(
969
- "span",
926
+ /* @__PURE__ */ jsxs8("div", { children: [
927
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs8("ul", { "aria-hidden": true, className: "fileListUnorderedList", children: [
928
+ " ",
929
+ errorMessageAddingFile.map((errorObj, index) => {
930
+ const errorFileName = errorObj.FileName;
931
+ let mobileFirstFileName = errorObj.FileName.split(".").shift();
932
+ mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
933
+ const fileType = errorObj.FileName.split(".").pop();
934
+ mobileFirstFileName = mobileFirstFileName + "." + fileType;
935
+ return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs8("div", { className: "fileInList", children: [
936
+ /* @__PURE__ */ jsxs8(Row, { children: [
937
+ /* @__PURE__ */ jsx10(Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ jsx10(
938
+ "span",
939
+ {
940
+ "aria-hidden": "true",
941
+ className: clsx4("uploadedDot", "uploadFailed"),
942
+ children: "!"
943
+ }
944
+ ) }),
945
+ /* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsx10("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ jsx10("span", { className: "desktopFileName", children: errorObj.FileName }) }),
946
+ /* @__PURE__ */ jsx10(Col, { className: "lastCol" })
947
+ ] }),
948
+ /* @__PURE__ */ jsx10(Row, { children: /* @__PURE__ */ jsx10(
949
+ Col,
970
950
  {
971
- "aria-hidden": "true",
972
- className: clsx4("uploadedDot", "uploadFailed"),
973
- children: "!"
951
+ style: {
952
+ width: "100%",
953
+ color: "#8e0039"
954
+ },
955
+ className: "errorMessageAddingFile",
956
+ ...activatedLanguage === "sv" ? {
957
+ "aria-label": `${errorFileName} ${errorObj.svMessage}`
958
+ } : {
959
+ "aria-label": `${errorFileName} ${errorObj.enMessage}`
960
+ },
961
+ children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
974
962
  }
975
963
  ) }),
976
- /* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsx10("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ jsx10("span", { className: "desktopFileName", children: errorObj.FileName }) }),
977
- /* @__PURE__ */ jsx10(Col, { className: "lastCol" })
978
- ] }),
979
- /* @__PURE__ */ jsx10(Row, { children: /* @__PURE__ */ jsx10(
980
- Col,
981
- {
982
- style: {
983
- width: "100%",
984
- color: "#8e0039"
985
- },
986
- className: "errorMessageAddingFile",
987
- ...activatedLanguage === "sv" ? {
988
- "aria-label": `${errorFileName} ${errorObj.svMessage}`
989
- } : {
990
- "aria-label": `${errorFileName} ${errorObj.enMessage}`
991
- },
992
- children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
993
- }
994
- ) }),
995
- errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsx10(
996
- "button",
997
- {
998
- style: {
999
- marginRight: "8px",
1000
- backgroundColor: "transparent",
1001
- border: "none",
1002
- textDecoration: "underline",
1003
- cursor: "pointer"
1004
- },
1005
- className: "errorMessageAddingFile",
1006
- "aria-label": activatedLanguage === "sv" ? "Ta bort felmeddelande f\xF6r uppladdning av filer" : "Remove error message for file uploads",
1007
- children: "Ta bort fel! / Remove errors!"
1008
- }
1009
- ),
1010
- /* @__PURE__ */ jsx10(Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ jsx10(Col, { className: "makeSpace" }) })
1011
- ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
1012
- })
1013
- ] }) }),
964
+ /* @__PURE__ */ jsx10(Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ jsx10(Col, { className: "makeSpace" }) })
965
+ ] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
966
+ })
967
+ ] }),
968
+ errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs8("button", { onClick: removeUploadErrors, className: "errorMessageAddingFile", children: [
969
+ /* @__PURE__ */ jsx10("span", { "aria-hidden": true, className: "errorDot", children: "X" }),
970
+ /* @__PURE__ */ jsx10("span", { className: "sr-only", children: "Ta bort felmeddelande f\xF6r uppladdning av filer" })
971
+ ] })
972
+ ] }),
1014
973
  questionObject.Files.length > 0 && /* @__PURE__ */ jsx10("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.Files.map((file, index) => {
1015
974
  const indicatorfileName = file.FileName;
1016
975
  let mobileFirstFileName = file.FileName.split(".").shift();
@@ -1290,7 +1249,8 @@ var AddFiles = ({
1290
1249
  errorMessageAddingFile,
1291
1250
  activatedLanguage,
1292
1251
  numberOfFiles,
1293
- setNumberOfFiles
1252
+ setNumberOfFiles,
1253
+ removeUploadErrors: handleRemoveErrors
1294
1254
  }
1295
1255
  )
1296
1256
  ] }) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.57",
3
+ "version": "0.1.59",
4
4
  "description": "A modern React component library using TypeScript with React 19 support.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",