@alfadocs/ui-kit 1.118.0 → 1.119.0
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/_chunks/bill-line-table-DUMEHnQ4.js +1754 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-BEmBcb61.js → calendar-appointment-editor-dialog-rw02sXGw.js} +4 -4
- package/dist/_chunks/{compact-editor-fields-6sTWRLtf.js → compact-editor-fields-cP6yh7xv.js} +3 -3
- package/dist/_chunks/counts-BXtzNv_G.js +92 -0
- package/dist/_chunks/{data-grid-DiBSbN2Y.js → data-grid-Bbf8t4z3.js} +2 -2
- package/dist/_chunks/{default-tabs-CD285u0C.js → default-tabs-Cxkw1Ws0.js} +332 -368
- package/dist/_chunks/{document-scanner-5p-Uu8dy.js → document-scanner-CETscDea.js} +2 -2
- package/dist/_chunks/file-code-Cf-_gSzd.js +23 -0
- package/dist/_chunks/{file-manager-CV1_GtjC.js → file-manager-DNq-sEsy.js} +2 -2
- package/dist/_chunks/{file-upload-CxjCs7TX.js → file-upload-DQc0LsBM.js} +385 -311
- package/dist/_chunks/invoice-upload-list-CsFsRgbt.js +952 -0
- package/dist/_chunks/maps-MpMxTBov.js +63 -0
- package/dist/_chunks/{notes-panel-CHR-Jv6N.js → notes-panel-BOwlTz2-.js} +2 -2
- package/dist/_chunks/package-plus-CTecQK3x.js +25 -0
- package/dist/_chunks/{public-footer-CB7ruuLI.js → public-footer-C8UIzqLJ.js} +326 -243
- package/dist/_chunks/{radiograph-panel.agent-9jwXlOXB.js → radiograph-panel.agent-Dcv16n7u.js} +2 -2
- package/dist/_chunks/{rich-text-editor-CMPA5Wgy.js → rich-text-editor-BLEdXJ0l.js} +2 -2
- package/dist/_chunks/{signed-out-frame-bh7fn_Px.js → signed-out-frame-fUf7tqs3.js} +2 -2
- package/dist/_chunks/{task-editor-WdDCqbIL.js → task-editor-Czcx9B-3.js} +2 -2
- package/dist/_chunks/{toolbar-z8vXnpXz.js → toolbar-DoKcoE2q.js} +2 -2
- package/dist/_chunks/types-BrJRsnSG.js +291 -0
- package/dist/_chunks/warehouse-load-summary-D88M4Ii7.js +255 -0
- package/dist/agent-catalog.json +360 -14
- package/dist/agent-i18n/en.json +31 -2
- package/dist/browser-support.js +1 -1
- package/dist/components/_shared/warehouse-load/counts.d.ts +82 -0
- package/dist/components/_shared/warehouse-load/index.d.ts +4 -0
- package/dist/components/_shared/warehouse-load/maps.d.ts +67 -0
- package/dist/components/_shared/warehouse-load/types.d.ts +18 -0
- package/dist/components/bill-line-table/bill-line-table.columns.d.ts +2 -0
- package/dist/components/bill-line-table/bill-line-table.header.d.ts +7 -0
- package/dist/components/bill-line-table/bill-line-table.model.d.ts +10 -1
- package/dist/components/bill-line-table/bill-line-table.types.d.ts +66 -1
- package/dist/components/bill-line-table/bill-line-table.variants.d.ts +12 -0
- package/dist/components/bill-line-table/index.d.ts +2 -2
- package/dist/components/bill-line-table/index.js +10 -8
- package/dist/components/bill-table/index.js +1 -1
- package/dist/components/data-grid/data-grid.variants.d.ts +1 -1
- package/dist/components/data-grid/index.js +2 -2
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/file-upload/file-upload.d.ts +30 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/flag/flag-view.d.ts +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/invoice-upload/index.d.ts +5 -0
- package/dist/components/invoice-upload/index.js +7 -0
- package/dist/components/invoice-upload/invoice-upload.agent.d.ts +4 -0
- package/dist/components/invoice-upload/invoice-upload.d.ts +3 -0
- package/dist/components/invoice-upload/types.d.ts +72 -0
- package/dist/components/invoice-upload-list/cells.d.ts +36 -0
- package/dist/components/invoice-upload-list/columns.d.ts +14 -0
- package/dist/components/invoice-upload-list/handle.d.ts +18 -0
- package/dist/components/invoice-upload-list/index.d.ts +5 -0
- package/dist/components/invoice-upload-list/index.js +10 -0
- package/dist/components/invoice-upload-list/invoice-upload-list.agent.d.ts +4 -0
- package/dist/components/invoice-upload-list/invoice-upload-list.d.ts +10 -0
- package/dist/components/invoice-upload-list/invoice-upload-list.variants.d.ts +28 -0
- package/dist/components/invoice-upload-list/model.d.ts +40 -0
- package/dist/components/invoice-upload-list/types.d.ts +154 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/public-footer/index.js +1 -1
- package/dist/components/public-footer/public-footer.d.ts +24 -0
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/warehouse-load-summary/index.d.ts +4 -0
- package/dist/components/warehouse-load-summary/index.js +6 -0
- package/dist/components/warehouse-load-summary/model.d.ts +8 -0
- package/dist/components/warehouse-load-summary/types.d.ts +50 -0
- package/dist/components/warehouse-load-summary/warehouse-load-summary.agent.d.ts +4 -0
- package/dist/components/warehouse-load-summary/warehouse-load-summary.d.ts +7 -0
- package/dist/core.css +1 -1
- package/dist/i18n/locales/ar.d.ts +203 -0
- package/dist/i18n/locales/ar.js +197 -4
- package/dist/i18n/locales/de.d.ts +203 -0
- package/dist/i18n/locales/de.js +201 -4
- package/dist/i18n/locales/el.d.ts +203 -0
- package/dist/i18n/locales/el.js +201 -4
- package/dist/i18n/locales/en.d.ts +203 -0
- package/dist/i18n/locales/en.js +203 -0
- package/dist/i18n/locales/es.d.ts +203 -0
- package/dist/i18n/locales/es.js +199 -4
- package/dist/i18n/locales/fr.d.ts +203 -0
- package/dist/i18n/locales/fr.js +199 -4
- package/dist/i18n/locales/hi.d.ts +203 -0
- package/dist/i18n/locales/hi.js +197 -4
- package/dist/i18n/locales/it.d.ts +203 -0
- package/dist/i18n/locales/it.js +197 -4
- package/dist/i18n/locales/ja.d.ts +203 -0
- package/dist/i18n/locales/ja.js +197 -4
- package/dist/i18n/locales/nl.d.ts +203 -0
- package/dist/i18n/locales/nl.js +197 -4
- package/dist/i18n/locales/pl.d.ts +203 -0
- package/dist/i18n/locales/pl.js +197 -4
- package/dist/i18n/locales/pt.d.ts +203 -0
- package/dist/i18n/locales/pt.js +199 -4
- package/dist/i18n/locales/ro.d.ts +203 -0
- package/dist/i18n/locales/ro.js +197 -4
- package/dist/i18n/locales/ru.d.ts +203 -0
- package/dist/i18n/locales/ru.js +197 -4
- package/dist/i18n/locales/sq.d.ts +203 -0
- package/dist/i18n/locales/sq.js +199 -4
- package/dist/i18n/locales/sv.d.ts +203 -0
- package/dist/i18n/locales/sv.js +197 -4
- package/dist/i18n/locales/tr.d.ts +203 -0
- package/dist/i18n/locales/tr.js +197 -4
- package/dist/i18n/locales/zh.d.ts +203 -0
- package/dist/i18n/locales/zh.js +197 -4
- package/dist/index.js +1189 -1173
- package/dist/locales/ar.json +207 -4
- package/dist/locales/de.json +207 -4
- package/dist/locales/el.json +207 -4
- package/dist/locales/en.json +203 -0
- package/dist/locales/es.json +207 -4
- package/dist/locales/fr.json +207 -4
- package/dist/locales/hi.json +207 -4
- package/dist/locales/it.json +207 -4
- package/dist/locales/ja.json +207 -4
- package/dist/locales/nl.json +207 -4
- package/dist/locales/pl.json +207 -4
- package/dist/locales/pt.json +207 -4
- package/dist/locales/ro.json +207 -4
- package/dist/locales/ru.json +207 -4
- package/dist/locales/sq.json +207 -4
- package/dist/locales/sv.json +207 -4
- package/dist/locales/tr.json +207 -4
- package/dist/locales/zh.json +207 -4
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/signed-out-frame/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +13 -1
- package/dist/_chunks/bill-line-table-vCnVo7_a.js +0 -1565
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsxs as m, jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { u as
|
|
4
|
-
import { c as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { C as
|
|
9
|
-
import { U as
|
|
10
|
-
import { X as
|
|
11
|
-
import { F as
|
|
12
|
-
import { c as
|
|
13
|
-
import { F as
|
|
14
|
-
import { F as
|
|
15
|
-
import { F as
|
|
16
|
-
import { C as
|
|
17
|
-
import { L as
|
|
1
|
+
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as De, useId as Me, useState as ue, useRef as G, useCallback as w, useMemo as H, useEffect as Be } from "react";
|
|
3
|
+
import { u as Ee } from "./index-BcMWc8W2.js";
|
|
4
|
+
import { c as q } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { useTranslation as He } from "react-i18next";
|
|
6
|
+
import { u as Oe, a as qe } from "./form-field-context-DtiROUJV.js";
|
|
7
|
+
import { u as Ve } from "./registry-DvAUVLHh.js";
|
|
8
|
+
import { C as he } from "./circle-alert-rGDZ73Wh.js";
|
|
9
|
+
import { U as O } from "./upload-BfT2hzMg.js";
|
|
10
|
+
import { X as pe } from "./x-B5YnXwCz.js";
|
|
11
|
+
import { F as Ke } from "./file-text-5yv6r2ls.js";
|
|
12
|
+
import { c as Te } from "./createLucideIcon-DhHxpK9K.js";
|
|
13
|
+
import { F as $e } from "./file-spreadsheet-DmwyfV4O.js";
|
|
14
|
+
import { F as Pe } from "./file-image-cDgE-BTy.js";
|
|
15
|
+
import { F as _e } from "./file-BuG1VMAy.js";
|
|
16
|
+
import { C as We } from "./circle-check-BN6rz4NV.js";
|
|
17
|
+
import { L as Ge } from "./loader-circle-BECIU_8N.js";
|
|
18
18
|
/**
|
|
19
19
|
* @license lucide-react v1.22.0 - ISC
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the ISC license.
|
|
22
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/
|
|
24
|
-
const
|
|
24
|
+
const Xe = [
|
|
25
25
|
[
|
|
26
26
|
"path",
|
|
27
27
|
{
|
|
@@ -34,7 +34,7 @@ const Me = [
|
|
|
34
34
|
["path", { d: "M8 18v-2", key: "qcmpov" }],
|
|
35
35
|
["path", { d: "M8 7V6", key: "1nbb54" }],
|
|
36
36
|
["circle", { cx: "8", cy: "20", r: "2", key: "ckkr5m" }]
|
|
37
|
-
],
|
|
37
|
+
], Ye = Te("file-archive", Xe), Je = {
|
|
38
38
|
id: "file-upload",
|
|
39
39
|
capabilities: ["dismiss"],
|
|
40
40
|
state: {
|
|
@@ -65,8 +65,8 @@ const Me = [
|
|
|
65
65
|
examples: [
|
|
66
66
|
{ args: { id: "file-1" }, note: "Remove the first tracked file." }
|
|
67
67
|
],
|
|
68
|
-
invoke: (a,
|
|
69
|
-
a.removeFile(
|
|
68
|
+
invoke: (a, t) => {
|
|
69
|
+
a.removeFile(t.id);
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
clear: {
|
|
@@ -91,7 +91,7 @@ const Me = [
|
|
|
91
91
|
description: "Each tracked file emits its id as data-file-id."
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
},
|
|
94
|
+
}, Qe = q(
|
|
95
95
|
[
|
|
96
96
|
"ds:relative ds:flex ds:flex-col ds:items-center ds:justify-center",
|
|
97
97
|
"ds:min-h-48 ds:px-[var(--spacing-lg)] ds:py-[var(--spacing-xl)]",
|
|
@@ -124,7 +124,7 @@ const Me = [
|
|
|
124
124
|
isDisabled: !1
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
),
|
|
127
|
+
), fe = q(
|
|
128
128
|
[
|
|
129
129
|
"ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]",
|
|
130
130
|
// Full-width on phone so the affordance stacks cleanly; natural width
|
|
@@ -140,7 +140,7 @@ const Me = [
|
|
|
140
140
|
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
141
141
|
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
|
|
142
142
|
].join(" ")
|
|
143
|
-
),
|
|
143
|
+
), Ze = q(
|
|
144
144
|
[
|
|
145
145
|
"ds:flex ds:items-center ds:gap-[var(--spacing-md)]",
|
|
146
146
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)] ds:bg-background",
|
|
@@ -161,7 +161,7 @@ const Me = [
|
|
|
161
161
|
status: "pending"
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
),
|
|
164
|
+
), me = q(
|
|
165
165
|
[
|
|
166
166
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
167
167
|
"ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
|
|
@@ -173,68 +173,68 @@ const Me = [
|
|
|
173
173
|
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
|
|
174
174
|
].join(" ")
|
|
175
175
|
);
|
|
176
|
-
function
|
|
176
|
+
function Se() {
|
|
177
177
|
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function es(a) {
|
|
180
180
|
return a.type.startsWith("image/");
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
var
|
|
184
|
-
const
|
|
185
|
-
return ["pdf", "doc", "docx", "txt", "rtf"].includes(
|
|
186
|
-
|
|
182
|
+
function ss(a) {
|
|
183
|
+
var p;
|
|
184
|
+
const t = ((p = a.name.split(".").pop()) == null ? void 0 : p.toLowerCase()) ?? "";
|
|
185
|
+
return ["pdf", "doc", "docx", "txt", "rtf"].includes(t) ? /* @__PURE__ */ o(
|
|
186
|
+
Ke,
|
|
187
187
|
{
|
|
188
188
|
"aria-hidden": "true",
|
|
189
189
|
className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
|
|
190
190
|
}
|
|
191
|
-
) : ["zip", "rar", "7z", "tar", "gz"].includes(
|
|
192
|
-
|
|
191
|
+
) : ["zip", "rar", "7z", "tar", "gz"].includes(t) ? /* @__PURE__ */ o(
|
|
192
|
+
Ye,
|
|
193
193
|
{
|
|
194
194
|
"aria-hidden": "true",
|
|
195
195
|
className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
|
|
196
196
|
}
|
|
197
|
-
) : ["xls", "xlsx", "csv"].includes(
|
|
198
|
-
|
|
197
|
+
) : ["xls", "xlsx", "csv"].includes(t) ? /* @__PURE__ */ o(
|
|
198
|
+
$e,
|
|
199
199
|
{
|
|
200
200
|
"aria-hidden": "true",
|
|
201
201
|
className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
|
|
202
202
|
}
|
|
203
|
-
) : ["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"].includes(
|
|
204
|
-
|
|
203
|
+
) : ["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"].includes(t) ? /* @__PURE__ */ o(
|
|
204
|
+
Pe,
|
|
205
205
|
{
|
|
206
206
|
"aria-hidden": "true",
|
|
207
207
|
className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
|
|
208
208
|
}
|
|
209
|
-
) : /* @__PURE__ */
|
|
210
|
-
|
|
209
|
+
) : /* @__PURE__ */ o(
|
|
210
|
+
_e,
|
|
211
211
|
{
|
|
212
212
|
"aria-hidden": "true",
|
|
213
213
|
className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
|
|
214
214
|
}
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function ts(a) {
|
|
218
218
|
switch (a) {
|
|
219
219
|
case "uploading":
|
|
220
|
-
return /* @__PURE__ */
|
|
221
|
-
|
|
220
|
+
return /* @__PURE__ */ o(
|
|
221
|
+
Ge,
|
|
222
222
|
{
|
|
223
223
|
"aria-hidden": "true",
|
|
224
224
|
className: "ds:size-4 ds:shrink-0 ds:text-primary ds:animate-spin"
|
|
225
225
|
}
|
|
226
226
|
);
|
|
227
227
|
case "complete":
|
|
228
|
-
return /* @__PURE__ */
|
|
229
|
-
|
|
228
|
+
return /* @__PURE__ */ o(
|
|
229
|
+
We,
|
|
230
230
|
{
|
|
231
231
|
"aria-hidden": "true",
|
|
232
232
|
className: "ds:size-4 ds:shrink-0 ds:text-[var(--success)]"
|
|
233
233
|
}
|
|
234
234
|
);
|
|
235
235
|
case "error":
|
|
236
|
-
return /* @__PURE__ */
|
|
237
|
-
|
|
236
|
+
return /* @__PURE__ */ o(
|
|
237
|
+
he,
|
|
238
238
|
{
|
|
239
239
|
"aria-hidden": "true",
|
|
240
240
|
className: "ds:size-4 ds:shrink-0 ds:text-destructive"
|
|
@@ -244,22 +244,22 @@ function Ke(a) {
|
|
|
244
244
|
return null;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
const
|
|
247
|
+
const rs = [
|
|
248
248
|
"inputs.fileUpload.units.bytes",
|
|
249
249
|
"inputs.fileUpload.units.kilobytes",
|
|
250
250
|
"inputs.fileUpload.units.megabytes",
|
|
251
251
|
"inputs.fileUpload.units.gigabytes"
|
|
252
|
-
],
|
|
253
|
-
function
|
|
254
|
-
let
|
|
255
|
-
for (;
|
|
256
|
-
|
|
257
|
-
const
|
|
252
|
+
], ge = ["B", "KB", "MB", "GB"];
|
|
253
|
+
function F(a, t, p) {
|
|
254
|
+
let c = a, u = 0;
|
|
255
|
+
for (; c >= 1024 && u < ge.length - 1; )
|
|
256
|
+
c /= 1024, u++;
|
|
257
|
+
const f = new Intl.NumberFormat(t, {
|
|
258
258
|
maximumFractionDigits: u === 0 ? 0 : 1
|
|
259
|
-
}).format(
|
|
260
|
-
return `${
|
|
259
|
+
}).format(c), y = p(rs[u], ge[u]);
|
|
260
|
+
return `${f} ${y}`;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function is(a) {
|
|
263
263
|
switch (a) {
|
|
264
264
|
case "file-too-large":
|
|
265
265
|
return "file-too-large";
|
|
@@ -269,175 +269,202 @@ function Pe(a) {
|
|
|
269
269
|
return "file-invalid-type";
|
|
270
270
|
case "too-many-files":
|
|
271
271
|
return "too-many-files";
|
|
272
|
+
case "total-too-large":
|
|
273
|
+
return "total-too-large";
|
|
272
274
|
default:
|
|
273
275
|
return "file-invalid-type";
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
|
-
function
|
|
277
|
-
const
|
|
278
|
-
return
|
|
278
|
+
function os(a) {
|
|
279
|
+
const t = a.split(".");
|
|
280
|
+
return t.length > 1 ? `.${t.pop().toLowerCase()}` : "";
|
|
279
281
|
}
|
|
280
|
-
function
|
|
281
|
-
const
|
|
282
|
-
for (const [
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
282
|
+
function ve(a, t) {
|
|
283
|
+
const p = os(a.name);
|
|
284
|
+
for (const [c, u] of Object.entries(t)) {
|
|
285
|
+
const f = c === "*/*" || c.endsWith("/*") && a.type.startsWith(c.replace("/*", "/")) || a.type === c, y = u.length === 0 || u.some((V) => V.toLowerCase() === p);
|
|
286
|
+
if (f && y) return !0;
|
|
285
287
|
}
|
|
286
288
|
return !1;
|
|
287
289
|
}
|
|
288
|
-
function
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
o.push(u.toUpperCase().replace(".", ""));
|
|
293
|
-
if (o.length > 0) return o.join(", ");
|
|
294
|
-
const c = [];
|
|
295
|
-
for (const l of Object.keys(a))
|
|
296
|
-
l.endsWith("/*") ? c.push(l.replace("/*", "").split("/").pop() ?? l) : c.push(l.split("/").pop() ?? l);
|
|
297
|
-
return c.join(", ");
|
|
290
|
+
function ns(a) {
|
|
291
|
+
if (!a) return [];
|
|
292
|
+
const t = Object.values(a).flat().map((p) => p.toLowerCase());
|
|
293
|
+
return Array.from(new Set(t));
|
|
298
294
|
}
|
|
299
|
-
|
|
295
|
+
function as(a) {
|
|
296
|
+
const t = [];
|
|
297
|
+
for (const c of Object.values(a))
|
|
298
|
+
for (const u of c)
|
|
299
|
+
t.push(u.toUpperCase().replace(".", ""));
|
|
300
|
+
if (t.length > 0) return t.join(", ");
|
|
301
|
+
const p = [];
|
|
302
|
+
for (const c of Object.keys(a))
|
|
303
|
+
c.endsWith("/*") ? p.push(c.replace("/*", "").split("/").pop() ?? c) : p.push(c.split("/").pop() ?? c);
|
|
304
|
+
return p.join(", ");
|
|
305
|
+
}
|
|
306
|
+
const ds = De(
|
|
300
307
|
({
|
|
301
308
|
id: a,
|
|
302
|
-
accept:
|
|
303
|
-
maxSize:
|
|
304
|
-
minSize:
|
|
309
|
+
accept: t,
|
|
310
|
+
maxSize: p,
|
|
311
|
+
minSize: c,
|
|
305
312
|
maxFiles: u = 1,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}, []), G =
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
313
|
+
maxTotalSize: f,
|
|
314
|
+
showFileList: y = !0,
|
|
315
|
+
describedBy: V,
|
|
316
|
+
listedFiles: K,
|
|
317
|
+
multiple: v = !1,
|
|
318
|
+
disabled: be,
|
|
319
|
+
strictAccept: X = !1,
|
|
320
|
+
onDrop: R,
|
|
321
|
+
onUpload: T,
|
|
322
|
+
onRemove: A,
|
|
323
|
+
onReject: D,
|
|
324
|
+
variant: h = "both",
|
|
325
|
+
showPreview: ye = !0,
|
|
326
|
+
className: Y
|
|
327
|
+
}, I) => {
|
|
328
|
+
const { t: i, i18n: x } = He("ui"), N = Oe(), xe = Me(), j = N.disabled || be, Ue = N.invalid, J = qe(N) || xe, [M, U] = ue([]), [Q, we] = ue([]), B = G(/* @__PURE__ */ new Map()), $ = G(null), z = G(M);
|
|
329
|
+
z.current = M;
|
|
330
|
+
const C = w((e) => {
|
|
331
|
+
$.current && ($.current.textContent = e);
|
|
332
|
+
}, []), Z = w(
|
|
333
|
+
(e) => !X || !t ? !0 : ve(e, t),
|
|
334
|
+
[X, t]
|
|
335
|
+
), S = w(
|
|
325
336
|
async (e) => {
|
|
326
|
-
if (!
|
|
337
|
+
if (!T) return;
|
|
327
338
|
const s = new AbortController();
|
|
328
|
-
|
|
329
|
-
(
|
|
330
|
-
(
|
|
339
|
+
B.current.set(e.id, s), U(
|
|
340
|
+
(n) => n.map(
|
|
341
|
+
(r) => r.id === e.id ? { ...r, status: "uploading", progress: 0 } : r
|
|
331
342
|
)
|
|
332
|
-
),
|
|
343
|
+
), C(i("inputs.fileUpload.uploading", "Uploading…"));
|
|
333
344
|
try {
|
|
334
|
-
await
|
|
345
|
+
await T(e.file, {
|
|
335
346
|
signal: s.signal,
|
|
336
|
-
onProgress: (
|
|
337
|
-
|
|
338
|
-
(
|
|
339
|
-
(
|
|
347
|
+
onProgress: (n) => {
|
|
348
|
+
U(
|
|
349
|
+
(r) => r.map(
|
|
350
|
+
(d) => d.id === e.id ? { ...d, progress: n } : d
|
|
340
351
|
)
|
|
341
|
-
),
|
|
352
|
+
), C(
|
|
342
353
|
i("inputs.fileUpload.progress", "{{percent}}% uploaded", {
|
|
343
|
-
percent:
|
|
354
|
+
percent: n
|
|
344
355
|
})
|
|
345
356
|
);
|
|
346
357
|
}
|
|
347
|
-
}),
|
|
348
|
-
(
|
|
349
|
-
(
|
|
358
|
+
}), U(
|
|
359
|
+
(n) => n.map(
|
|
360
|
+
(r) => r.id === e.id ? { ...r, status: "complete", progress: 100 } : r
|
|
350
361
|
)
|
|
351
|
-
),
|
|
352
|
-
} catch (
|
|
362
|
+
), C(i("inputs.fileUpload.complete", "Upload complete"));
|
|
363
|
+
} catch (n) {
|
|
353
364
|
if (s.signal.aborted) {
|
|
354
|
-
|
|
365
|
+
U((d) => d.filter((g) => g.id !== e.id));
|
|
355
366
|
return;
|
|
356
367
|
}
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
(
|
|
360
|
-
(
|
|
368
|
+
const r = n instanceof Error ? n.message : i("inputs.fileUpload.errors.uploadFailed", "Upload failed");
|
|
369
|
+
U(
|
|
370
|
+
(d) => d.map(
|
|
371
|
+
(g) => g.id === e.id ? { ...g, status: "error", error: r } : g
|
|
361
372
|
)
|
|
362
373
|
);
|
|
363
374
|
} finally {
|
|
364
|
-
|
|
375
|
+
B.current.delete(e.id);
|
|
365
376
|
}
|
|
366
377
|
},
|
|
367
|
-
[
|
|
368
|
-
),
|
|
378
|
+
[T, C, i]
|
|
379
|
+
), ee = [N.describedBy, V].filter(Boolean).join(" ") || void 0, Ne = H(() => {
|
|
380
|
+
if (!t || !("*/*" in t)) return t;
|
|
381
|
+
const { "*/*": e, ...s } = t;
|
|
382
|
+
return e.length > 0 ? { ...s, "application/octet-stream": e } : s;
|
|
383
|
+
}, [t]), P = w(
|
|
369
384
|
(e, s) => {
|
|
370
|
-
const
|
|
371
|
-
(
|
|
372
|
-
file:
|
|
373
|
-
reason:
|
|
385
|
+
const n = s.flatMap(
|
|
386
|
+
(l) => l.errors.map((b) => ({
|
|
387
|
+
file: l.file,
|
|
388
|
+
reason: is(b.code)
|
|
374
389
|
}))
|
|
375
|
-
),
|
|
376
|
-
for (const
|
|
377
|
-
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
390
|
+
), r = [], d = [];
|
|
391
|
+
for (const l of e)
|
|
392
|
+
Z(l) ? d.push(l) : r.push({ file: l, reason: "file-invalid-type" });
|
|
393
|
+
const g = !v && u === 1, de = K ?? z.current.filter((l) => l.status !== "error").map((l) => ({ size: l.file.size })), Le = g ? 0 : de.length, Re = g ? 0 : de.reduce((l, b) => l + b.size, 0);
|
|
394
|
+
let k = d;
|
|
395
|
+
const le = [], ce = K !== void 0 && v && Le + k.length > u, Ae = f !== void 0 && Re + k.reduce((l, b) => l + b.size, 0) > f;
|
|
396
|
+
if (k.length > 0 && (ce || Ae)) {
|
|
397
|
+
const l = ce ? "too-many-files" : "total-too-large";
|
|
398
|
+
for (const b of k) le.push({ file: b, reason: l });
|
|
399
|
+
k = [];
|
|
400
|
+
}
|
|
401
|
+
const E = [...n, ...r, ...le];
|
|
402
|
+
we(E), E.length > 0 && (D == null || D(E));
|
|
403
|
+
const W = k.map((l) => ({
|
|
404
|
+
file: l,
|
|
405
|
+
id: Se(),
|
|
383
406
|
status: "pending",
|
|
384
407
|
progress: 0,
|
|
385
|
-
preview:
|
|
408
|
+
preview: y && es(l) ? URL.createObjectURL(l) : void 0
|
|
386
409
|
}));
|
|
387
|
-
|
|
388
|
-
if (!
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
410
|
+
if (U((l) => {
|
|
411
|
+
if (!y) return l;
|
|
412
|
+
if (!v && u === 1) {
|
|
413
|
+
for (const b of l)
|
|
414
|
+
b.preview && URL.revokeObjectURL(b.preview);
|
|
415
|
+
return W;
|
|
392
416
|
}
|
|
393
|
-
return [...
|
|
394
|
-
}),
|
|
417
|
+
return [...l, ...W];
|
|
418
|
+
}), R == null || R(k, E), C(
|
|
395
419
|
i("inputs.fileUpload.filesSelected", "{{count}} file(s) selected", {
|
|
396
|
-
count:
|
|
420
|
+
count: k.length
|
|
397
421
|
})
|
|
398
|
-
)
|
|
399
|
-
|
|
400
|
-
|
|
422
|
+
), y)
|
|
423
|
+
for (const l of W)
|
|
424
|
+
S(l);
|
|
401
425
|
},
|
|
402
426
|
[
|
|
403
|
-
|
|
427
|
+
v,
|
|
404
428
|
u,
|
|
405
|
-
|
|
429
|
+
f,
|
|
430
|
+
y,
|
|
431
|
+
K,
|
|
406
432
|
R,
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
433
|
+
D,
|
|
434
|
+
Z,
|
|
435
|
+
C,
|
|
436
|
+
S,
|
|
410
437
|
i
|
|
411
438
|
]
|
|
412
|
-
), { getRootProps:
|
|
413
|
-
accept:
|
|
414
|
-
maxSize:
|
|
415
|
-
minSize:
|
|
416
|
-
maxFiles:
|
|
417
|
-
multiple:
|
|
418
|
-
disabled:
|
|
419
|
-
onDrop:
|
|
420
|
-
noClick:
|
|
421
|
-
noKeyboard:
|
|
422
|
-
}),
|
|
423
|
-
const s =
|
|
424
|
-
s == null || s.abort(),
|
|
425
|
-
const
|
|
426
|
-
return
|
|
439
|
+
), { getRootProps: ke, getInputProps: se, isDragActive: L, open: te } = Ee({
|
|
440
|
+
accept: Ne,
|
|
441
|
+
maxSize: p,
|
|
442
|
+
minSize: c,
|
|
443
|
+
maxFiles: v ? u : 1,
|
|
444
|
+
multiple: v,
|
|
445
|
+
disabled: j,
|
|
446
|
+
onDrop: P,
|
|
447
|
+
noClick: h === "button",
|
|
448
|
+
noKeyboard: h === "button"
|
|
449
|
+
}), je = w((e) => {
|
|
450
|
+
const s = B.current.get(e);
|
|
451
|
+
s == null || s.abort(), U((n) => {
|
|
452
|
+
const r = n.find((d) => d.id === e);
|
|
453
|
+
return r != null && r.preview && URL.revokeObjectURL(r.preview), n.filter((d) => d.id !== e);
|
|
427
454
|
});
|
|
428
|
-
}, []),
|
|
455
|
+
}, []), _ = w(
|
|
429
456
|
(e) => {
|
|
430
|
-
const s = z.current.find((
|
|
431
|
-
s != null && s.preview && URL.revokeObjectURL(s.preview),
|
|
457
|
+
const s = z.current.find((n) => n.id === e);
|
|
458
|
+
s != null && s.preview && URL.revokeObjectURL(s.preview), U((n) => n.filter((r) => r.id !== e)), s && (A == null || A(s));
|
|
432
459
|
},
|
|
433
|
-
[
|
|
434
|
-
),
|
|
460
|
+
[A]
|
|
461
|
+
), re = w(() => {
|
|
435
462
|
for (const e of z.current) {
|
|
436
|
-
const s =
|
|
463
|
+
const s = B.current.get(e.id);
|
|
437
464
|
s == null || s.abort(), e.preview && URL.revokeObjectURL(e.preview);
|
|
438
465
|
}
|
|
439
|
-
|
|
440
|
-
}, []),
|
|
466
|
+
U([]);
|
|
467
|
+
}, []), ze = H(
|
|
441
468
|
() => ({
|
|
442
469
|
getFiles: () => z.current.map((e) => ({
|
|
443
470
|
id: e.id,
|
|
@@ -445,106 +472,152 @@ const Ge = ye(
|
|
|
445
472
|
size: e.file.size,
|
|
446
473
|
status: e.status
|
|
447
474
|
})),
|
|
448
|
-
removeFile: (e) =>
|
|
449
|
-
clear: () =>
|
|
475
|
+
removeFile: (e) => _(e),
|
|
476
|
+
clear: () => re()
|
|
450
477
|
}),
|
|
451
|
-
[
|
|
478
|
+
[_, re]
|
|
452
479
|
);
|
|
453
|
-
|
|
454
|
-
const
|
|
480
|
+
Ve(Je, ze, a);
|
|
481
|
+
const ie = w(
|
|
455
482
|
(e) => {
|
|
456
|
-
const s = [],
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
483
|
+
const s = [], n = [], r = v ? u : 1;
|
|
484
|
+
if (e.length > r)
|
|
485
|
+
return {
|
|
486
|
+
accepted: s,
|
|
487
|
+
rejected: e.map((d) => ({
|
|
488
|
+
file: d,
|
|
489
|
+
reason: "too-many-files"
|
|
490
|
+
}))
|
|
491
|
+
};
|
|
492
|
+
for (const d of e) {
|
|
493
|
+
if (p !== void 0 && d.size > p) {
|
|
494
|
+
n.push({ file: d, reason: "file-too-large" });
|
|
460
495
|
continue;
|
|
461
496
|
}
|
|
462
|
-
if (c !== void 0 &&
|
|
463
|
-
|
|
497
|
+
if (c !== void 0 && d.size < c) {
|
|
498
|
+
n.push({ file: d, reason: "file-too-small" });
|
|
464
499
|
continue;
|
|
465
500
|
}
|
|
466
|
-
if (
|
|
467
|
-
|
|
501
|
+
if (t && !ve(d, t)) {
|
|
502
|
+
n.push({ file: d, reason: "file-invalid-type" });
|
|
468
503
|
continue;
|
|
469
504
|
}
|
|
470
|
-
|
|
471
|
-
d.push({ file: n, reason: "file-invalid-type" });
|
|
472
|
-
continue;
|
|
473
|
-
}
|
|
474
|
-
s.push(n);
|
|
505
|
+
s.push(d);
|
|
475
506
|
}
|
|
476
|
-
return { accepted: s, rejected:
|
|
507
|
+
return { accepted: s, rejected: n };
|
|
477
508
|
},
|
|
478
|
-
[
|
|
479
|
-
),
|
|
509
|
+
[t, p, c, u, v]
|
|
510
|
+
), oe = w(
|
|
480
511
|
(e) => {
|
|
481
|
-
if (
|
|
512
|
+
if (j) return;
|
|
482
513
|
const s = Array.from(e.clipboardData.files);
|
|
483
514
|
if (s.length > 0) {
|
|
484
515
|
e.preventDefault();
|
|
485
|
-
const { accepted:
|
|
486
|
-
file:
|
|
487
|
-
errors: [{ code:
|
|
516
|
+
const { accepted: n, rejected: r } = ie(s), d = r.map((g) => ({
|
|
517
|
+
file: g.file,
|
|
518
|
+
errors: [{ code: g.reason, message: g.reason }]
|
|
488
519
|
}));
|
|
489
|
-
|
|
520
|
+
P(n, d);
|
|
490
521
|
}
|
|
491
522
|
},
|
|
492
|
-
[
|
|
523
|
+
[j, P, ie]
|
|
493
524
|
);
|
|
494
|
-
|
|
525
|
+
Be(() => () => {
|
|
495
526
|
for (const e of z.current)
|
|
496
527
|
e.preview && URL.revokeObjectURL(e.preview);
|
|
497
528
|
}, []);
|
|
498
|
-
const
|
|
529
|
+
const ne = H(() => {
|
|
499
530
|
const e = [];
|
|
500
|
-
return
|
|
531
|
+
return t && e.push(as(t)), p && e.push(
|
|
501
532
|
i("inputs.fileUpload.maxSizeHint", "Max {{size}}", {
|
|
502
|
-
size:
|
|
533
|
+
size: F(p, x.language, i)
|
|
503
534
|
})
|
|
504
|
-
),
|
|
535
|
+
), v && u > 1 && Number.isFinite(u) && e.push(
|
|
505
536
|
i("inputs.fileUpload.maxFilesHint", "Up to {{count}} files", {
|
|
506
537
|
count: u
|
|
507
538
|
})
|
|
539
|
+
), f && e.push(
|
|
540
|
+
i("inputs.fileUpload.maxTotalSizeHint", "Up to {{size}} in total", {
|
|
541
|
+
size: F(f, x.language, i)
|
|
542
|
+
})
|
|
508
543
|
), e;
|
|
509
|
-
}, [
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
544
|
+
}, [t, p, f, v, u, i, x.language]), ae = H(() => {
|
|
545
|
+
const e = /* @__PURE__ */ new Set();
|
|
546
|
+
return Q.filter((n) => e.has(n.reason) ? !1 : (e.add(n.reason), !0)).map((n) => {
|
|
547
|
+
switch (n.reason) {
|
|
548
|
+
case "file-too-large":
|
|
549
|
+
return i(
|
|
550
|
+
"inputs.fileUpload.errors.fileTooLarge",
|
|
551
|
+
"File exceeds {{maxSize}}",
|
|
552
|
+
{
|
|
553
|
+
maxSize: p ? F(p, x.language, i) : ""
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
case "file-too-small":
|
|
557
|
+
return i(
|
|
558
|
+
"inputs.fileUpload.errors.fileTooSmall",
|
|
559
|
+
"File is smaller than {{minSize}}",
|
|
560
|
+
{
|
|
561
|
+
minSize: c ? F(c, x.language, i) : ""
|
|
562
|
+
}
|
|
563
|
+
);
|
|
564
|
+
case "file-invalid-type": {
|
|
565
|
+
const r = ns(t);
|
|
566
|
+
if (r.length > 0) {
|
|
567
|
+
let d;
|
|
568
|
+
try {
|
|
569
|
+
d = new Intl.ListFormat(x.language, {
|
|
570
|
+
style: "long",
|
|
571
|
+
type: "conjunction"
|
|
572
|
+
}).format(r);
|
|
573
|
+
} catch {
|
|
574
|
+
d = r.join(", ");
|
|
575
|
+
}
|
|
576
|
+
return i(
|
|
577
|
+
"inputs.fileUpload.errors.fileInvalidTypeNamed",
|
|
578
|
+
"Only {{types}} files can be uploaded",
|
|
579
|
+
{ types: d }
|
|
580
|
+
);
|
|
538
581
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
582
|
+
return i(
|
|
583
|
+
"inputs.fileUpload.errors.fileInvalidType",
|
|
584
|
+
"File type not accepted"
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
case "too-many-files":
|
|
588
|
+
return i(
|
|
589
|
+
"inputs.fileUpload.errors.tooManyFiles",
|
|
590
|
+
"Maximum {{maxFiles}} files allowed",
|
|
591
|
+
{
|
|
592
|
+
maxFiles: u
|
|
593
|
+
}
|
|
594
|
+
);
|
|
595
|
+
case "total-too-large":
|
|
596
|
+
return i(
|
|
597
|
+
"inputs.fileUpload.errors.totalTooLarge",
|
|
598
|
+
"Files exceed {{maxTotalSize}} in total",
|
|
599
|
+
{
|
|
600
|
+
maxTotalSize: f ? F(f, x.language, i) : ""
|
|
601
|
+
}
|
|
602
|
+
);
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
}, [
|
|
606
|
+
Q,
|
|
607
|
+
i,
|
|
608
|
+
t,
|
|
609
|
+
p,
|
|
610
|
+
c,
|
|
611
|
+
u,
|
|
612
|
+
f,
|
|
613
|
+
x.language
|
|
614
|
+
]), Ce = () => !y || M.length === 0 ? null : /* @__PURE__ */ o("ul", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:list-none ds:p-0 ds:m-0", children: M.map((e) => /* @__PURE__ */ m(
|
|
542
615
|
"li",
|
|
543
616
|
{
|
|
544
617
|
"data-file-id": e.id,
|
|
545
|
-
className:
|
|
618
|
+
className: Ze({ status: e.status }),
|
|
546
619
|
children: [
|
|
547
|
-
|
|
620
|
+
ye && e.preview ? /* @__PURE__ */ o(
|
|
548
621
|
"img",
|
|
549
622
|
{
|
|
550
623
|
src: e.preview,
|
|
@@ -552,21 +625,21 @@ const Ge = ye(
|
|
|
552
625
|
"aria-hidden": "true",
|
|
553
626
|
className: "ds:size-12 ds:shrink-0 ds:rounded-[var(--radius-md)] ds:object-cover ds:border ds:border-border"
|
|
554
627
|
}
|
|
555
|
-
) :
|
|
628
|
+
) : ss(e.file),
|
|
556
629
|
/* @__PURE__ */ m("div", { className: "ds:flex-1 ds:min-w-0", children: [
|
|
557
630
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
|
|
631
|
+
/* @__PURE__ */ o("p", { className: "ds:truncate type-label ds:m-0", children: e.file.name }),
|
|
632
|
+
ts(e.status)
|
|
560
633
|
] }),
|
|
561
634
|
/* @__PURE__ */ m("p", { className: "type-meta ds:text-muted-foreground ds:m-0 ds:mt-0.5", children: [
|
|
562
|
-
|
|
635
|
+
F(e.file.size, x.language, i),
|
|
563
636
|
e.status === "uploading" && /* @__PURE__ */ m("span", { className: "ds:ms-[var(--spacing-sm)] ds:text-primary ds:font-medium", children: [
|
|
564
637
|
e.progress,
|
|
565
638
|
"%"
|
|
566
639
|
] }),
|
|
567
|
-
e.status === "complete" && /* @__PURE__ */
|
|
640
|
+
e.status === "complete" && /* @__PURE__ */ o("span", { className: "ds:ms-[var(--spacing-sm)] ds:text-[var(--success)] ds:font-medium", children: i("inputs.fileUpload.complete", "Complete") })
|
|
568
641
|
] }),
|
|
569
|
-
e.status === "uploading" && /* @__PURE__ */
|
|
642
|
+
e.status === "uploading" && /* @__PURE__ */ o(
|
|
570
643
|
"div",
|
|
571
644
|
{
|
|
572
645
|
role: "progressbar",
|
|
@@ -575,7 +648,7 @@ const Ge = ye(
|
|
|
575
648
|
"aria-valuemin": 0,
|
|
576
649
|
"aria-valuemax": 100,
|
|
577
650
|
className: "ds:mt-[var(--spacing-sm)] ds:h-1.5 ds:w-full ds:rounded-[var(--radius-full)] ds:bg-muted ds:overflow-hidden",
|
|
578
|
-
children: /* @__PURE__ */
|
|
651
|
+
children: /* @__PURE__ */ o(
|
|
579
652
|
"div",
|
|
580
653
|
{
|
|
581
654
|
className: "ds:h-full ds:rounded-[var(--radius-full)] ds:bg-primary ds:transition-[inline-size] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
@@ -584,7 +657,7 @@ const Ge = ye(
|
|
|
584
657
|
)
|
|
585
658
|
}
|
|
586
659
|
),
|
|
587
|
-
e.status === "error" && e.error && /* @__PURE__ */
|
|
660
|
+
e.status === "error" && e.error && /* @__PURE__ */ o(
|
|
588
661
|
"p",
|
|
589
662
|
{
|
|
590
663
|
role: "alert",
|
|
@@ -593,62 +666,62 @@ const Ge = ye(
|
|
|
593
666
|
}
|
|
594
667
|
)
|
|
595
668
|
] }),
|
|
596
|
-
e.status === "uploading" && /* @__PURE__ */
|
|
669
|
+
e.status === "uploading" && /* @__PURE__ */ o(
|
|
597
670
|
"button",
|
|
598
671
|
{
|
|
599
672
|
type: "button",
|
|
600
|
-
onClick: () =>
|
|
673
|
+
onClick: () => je(e.id),
|
|
601
674
|
"aria-label": i("inputs.fileUpload.cancel", "Cancel upload"),
|
|
602
|
-
className:
|
|
603
|
-
children: /* @__PURE__ */
|
|
675
|
+
className: me(),
|
|
676
|
+
children: /* @__PURE__ */ o(pe, { "aria-hidden": "true", className: "ds:size-4" })
|
|
604
677
|
}
|
|
605
678
|
),
|
|
606
|
-
(e.status === "complete" || e.status === "pending" || e.status === "error") && /* @__PURE__ */
|
|
679
|
+
(e.status === "complete" || e.status === "pending" || e.status === "error") && /* @__PURE__ */ o(
|
|
607
680
|
"button",
|
|
608
681
|
{
|
|
609
682
|
type: "button",
|
|
610
|
-
onClick: () =>
|
|
683
|
+
onClick: () => _(e.id),
|
|
611
684
|
"aria-label": i("inputs.fileUpload.remove", "Remove file"),
|
|
612
|
-
className:
|
|
613
|
-
children: /* @__PURE__ */
|
|
685
|
+
className: me(),
|
|
686
|
+
children: /* @__PURE__ */ o(pe, { "aria-hidden": "true", className: "ds:size-4" })
|
|
614
687
|
}
|
|
615
688
|
)
|
|
616
689
|
]
|
|
617
690
|
},
|
|
618
691
|
e.id
|
|
619
|
-
)) }),
|
|
620
|
-
if (
|
|
621
|
-
const e =
|
|
622
|
-
className:
|
|
623
|
-
isDragActive:
|
|
624
|
-
hasError:
|
|
625
|
-
isDisabled:
|
|
626
|
-
className:
|
|
692
|
+
)) }), Fe = () => {
|
|
693
|
+
if (h === "button") return null;
|
|
694
|
+
const e = ke({
|
|
695
|
+
className: Qe({
|
|
696
|
+
isDragActive: L,
|
|
697
|
+
hasError: Ue ?? !1,
|
|
698
|
+
isDisabled: j ?? !1,
|
|
699
|
+
className: Y
|
|
627
700
|
}),
|
|
628
|
-
tabIndex:
|
|
701
|
+
tabIndex: j ? -1 : 0
|
|
629
702
|
}), s = e.ref;
|
|
630
703
|
return /* @__PURE__ */ m(
|
|
631
704
|
"div",
|
|
632
705
|
{
|
|
633
706
|
...e,
|
|
634
|
-
ref: (
|
|
635
|
-
typeof s == "function" ? s(
|
|
707
|
+
ref: (r) => {
|
|
708
|
+
typeof s == "function" ? s(r) : s && (s.current = r), typeof I == "function" ? I(r) : I && (I.current = r);
|
|
636
709
|
},
|
|
637
|
-
onPaste:
|
|
638
|
-
id:
|
|
710
|
+
onPaste: oe,
|
|
711
|
+
id: J,
|
|
639
712
|
"aria-label": i(
|
|
640
713
|
"inputs.fileUpload.dropHere",
|
|
641
714
|
"Drop files here or click to browse"
|
|
642
715
|
),
|
|
643
|
-
"aria-describedby":
|
|
644
|
-
"aria-invalid":
|
|
645
|
-
"aria-required":
|
|
716
|
+
"aria-describedby": ee,
|
|
717
|
+
"aria-invalid": N.invalid || void 0,
|
|
718
|
+
"aria-required": N.required || void 0,
|
|
646
719
|
"data-testid": "file-upload-dropzone",
|
|
647
720
|
children: [
|
|
648
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ o(
|
|
649
722
|
"input",
|
|
650
723
|
{
|
|
651
|
-
...
|
|
724
|
+
...se({
|
|
652
725
|
"aria-label": i(
|
|
653
726
|
"inputs.fileUpload.dropHere",
|
|
654
727
|
"Drop files here or click to browse"
|
|
@@ -657,27 +730,27 @@ const Ge = ye(
|
|
|
657
730
|
}
|
|
658
731
|
),
|
|
659
732
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
660
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ o("div", { className: "ds:flex ds:items-center ds:justify-center ds:size-14 ds:rounded-[var(--radius-full)] ds:bg-primary/10 ds:text-primary ds:transition-colors ds:duration-[var(--animation-duration)] ds:group-hover:bg-primary/15 ds:motion-reduce:transition-none", children: L ? /* @__PURE__ */ o(O, { "aria-hidden": "true", className: "ds:size-7" }) : /* @__PURE__ */ o(O, { "aria-hidden": "true", className: "ds:size-7" }) }),
|
|
661
734
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
662
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ o("p", { className: "type-label ds:text-foreground ds:text-center ds:m-0", children: L ? i("inputs.fileUpload.dropActive", "Drop files here") : i(
|
|
663
736
|
"inputs.fileUpload.dropHere",
|
|
664
737
|
"Drop files here or click to browse"
|
|
665
738
|
) }),
|
|
666
|
-
|
|
739
|
+
ne.length > 0 && !L && /* @__PURE__ */ o("p", { className: "type-meta ds:text-muted-foreground ds:text-center ds:m-0", children: ne.join(" · ") })
|
|
667
740
|
] }),
|
|
668
|
-
|
|
741
|
+
h === "both" && !L && /* @__PURE__ */ m(
|
|
669
742
|
"button",
|
|
670
743
|
{
|
|
671
744
|
type: "button",
|
|
672
|
-
onClick: (
|
|
673
|
-
|
|
745
|
+
onClick: (r) => {
|
|
746
|
+
r.stopPropagation(), te();
|
|
674
747
|
},
|
|
675
|
-
disabled:
|
|
676
|
-
className:
|
|
748
|
+
disabled: j,
|
|
749
|
+
className: fe({
|
|
677
750
|
className: "ds:mt-[var(--spacing-xs)]"
|
|
678
751
|
}),
|
|
679
752
|
children: [
|
|
680
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ o(O, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
681
754
|
i("inputs.fileUpload.browse", "Browse files")
|
|
682
755
|
]
|
|
683
756
|
}
|
|
@@ -686,11 +759,11 @@ const Ge = ye(
|
|
|
686
759
|
]
|
|
687
760
|
}
|
|
688
761
|
);
|
|
689
|
-
},
|
|
690
|
-
/* @__PURE__ */
|
|
762
|
+
}, Ie = () => h === "dropzone" ? null : h === "button" ? /* @__PURE__ */ m("div", { onPaste: oe, ref: I, children: [
|
|
763
|
+
/* @__PURE__ */ o(
|
|
691
764
|
"input",
|
|
692
765
|
{
|
|
693
|
-
...
|
|
766
|
+
...se({
|
|
694
767
|
"aria-label": i("inputs.fileUpload.browse", "Browse files")
|
|
695
768
|
})
|
|
696
769
|
}
|
|
@@ -699,52 +772,52 @@ const Ge = ye(
|
|
|
699
772
|
"button",
|
|
700
773
|
{
|
|
701
774
|
type: "button",
|
|
702
|
-
onClick:
|
|
703
|
-
disabled:
|
|
704
|
-
className:
|
|
705
|
-
id:
|
|
706
|
-
"aria-describedby":
|
|
707
|
-
"aria-invalid":
|
|
708
|
-
"aria-required":
|
|
775
|
+
onClick: te,
|
|
776
|
+
disabled: j,
|
|
777
|
+
className: fe({ className: Y }),
|
|
778
|
+
id: h === "button" ? J : void 0,
|
|
779
|
+
"aria-describedby": h === "button" ? ee : void 0,
|
|
780
|
+
"aria-invalid": h === "button" && N.invalid || void 0,
|
|
781
|
+
"aria-required": h === "button" && N.required || void 0,
|
|
709
782
|
children: [
|
|
710
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ o(O, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
711
784
|
i("inputs.fileUpload.browse", "Browse files")
|
|
712
785
|
]
|
|
713
786
|
}
|
|
714
787
|
)
|
|
715
788
|
] }) : null;
|
|
716
789
|
return /* @__PURE__ */ m("div", { "data-component": "file-upload", "data-component-id": a, children: [
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
790
|
+
Fe(),
|
|
791
|
+
Ie(),
|
|
792
|
+
Ce(),
|
|
793
|
+
ae.length > 0 && /* @__PURE__ */ o(
|
|
721
794
|
"div",
|
|
722
795
|
{
|
|
723
796
|
role: "alert",
|
|
724
797
|
className: "ds:mt-[var(--spacing-sm)] ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
725
|
-
children:
|
|
798
|
+
children: ae.map((e, s) => /* @__PURE__ */ m(
|
|
726
799
|
"div",
|
|
727
800
|
{
|
|
728
801
|
className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
729
802
|
children: [
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
|
|
803
|
+
/* @__PURE__ */ o(
|
|
804
|
+
he,
|
|
732
805
|
{
|
|
733
806
|
"aria-hidden": "true",
|
|
734
807
|
className: "ds:size-3.5 ds:shrink-0 ds:text-destructive"
|
|
735
808
|
}
|
|
736
809
|
),
|
|
737
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ o("p", { className: "type-meta ds:text-destructive ds:m-0", children: e })
|
|
738
811
|
]
|
|
739
812
|
},
|
|
740
813
|
s
|
|
741
814
|
))
|
|
742
815
|
}
|
|
743
816
|
),
|
|
744
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ o(
|
|
745
818
|
"span",
|
|
746
819
|
{
|
|
747
|
-
ref:
|
|
820
|
+
ref: $,
|
|
748
821
|
role: "status",
|
|
749
822
|
"aria-live": "polite",
|
|
750
823
|
className: "ds:sr-only"
|
|
@@ -753,11 +826,12 @@ const Ge = ye(
|
|
|
753
826
|
] });
|
|
754
827
|
}
|
|
755
828
|
);
|
|
756
|
-
|
|
829
|
+
ds.displayName = "FileUpload";
|
|
757
830
|
export {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
831
|
+
ds as F,
|
|
832
|
+
F as a,
|
|
833
|
+
fe as b,
|
|
834
|
+
Ye as c,
|
|
835
|
+
Je as f
|
|
762
836
|
};
|
|
763
|
-
//# sourceMappingURL=file-upload-
|
|
837
|
+
//# sourceMappingURL=file-upload-DQc0LsBM.js.map
|