beez-ui 0.9.0 → 0.9.1
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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/dist/components/account-menu.d.ts +10 -0
- package/dist/components/account-menu.js +139 -118
- package/dist/components/file-upload.d.ts +14 -4
- package/dist/components/file-upload.js +304 -206
- package/dist/components/filter-presets-bar.d.ts +3 -1
- package/dist/components/filter-presets-bar.js +62 -60
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -12,10 +12,11 @@ import { classifyFiles } from "../lib/file-acceptance.js";
|
|
|
12
12
|
import { formatFileSize } from "../lib/format-file-size.js";
|
|
13
13
|
import { AnimatedListItem } from "./animated-list-item.js";
|
|
14
14
|
import { Button } from "./button.js";
|
|
15
|
-
import { jsx as _jsx,
|
|
15
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const COMPLETE_PROGRESS = 100;
|
|
17
17
|
const FILE_UPLOAD_DROP_ZONE_DEFAULT_LABELS = {
|
|
18
18
|
uploadAction: "Elegí un archivo",
|
|
19
|
+
uploadActionMobileSuffix: "",
|
|
19
20
|
dragAndDrop: "o arrastralo acá",
|
|
20
21
|
input: "Subir archivos"
|
|
21
22
|
};
|
|
@@ -26,7 +27,7 @@ const FILE_UPLOAD_DROP_ZONE_DEFAULT_LABELS = {
|
|
|
26
27
|
* @returns The drop zone.
|
|
27
28
|
*/
|
|
28
29
|
export function FileUploadDropZone(t0) {
|
|
29
|
-
const $ = _c(
|
|
30
|
+
const $ = _c(66);
|
|
30
31
|
const { hint, isDisabled: t1, accept, allowsMultiple: t2, maxSize, onDropFiles, onDropUnacceptedFiles, onSizeLimitExceed, inputId, labels, className } = t0;
|
|
31
32
|
const isDisabled = t1 === undefined ? false : t1;
|
|
32
33
|
const allowsMultiple = t2 === undefined ? true : t2;
|
|
@@ -223,79 +224,91 @@ export function FileUploadDropZone(t0) {
|
|
|
223
224
|
t20 = $[35];
|
|
224
225
|
}
|
|
225
226
|
let t21;
|
|
226
|
-
if ($[36] !==
|
|
227
|
-
t21 = /* @__PURE__ */ _jsx(
|
|
227
|
+
if ($[36] !== resolvedLabels.uploadActionMobileSuffix) {
|
|
228
|
+
t21 = resolvedLabels.uploadActionMobileSuffix ? /* @__PURE__ */ _jsxs(_Fragment, { children: [" ", /* @__PURE__ */ _jsx("span", {
|
|
229
|
+
className: "md:hidden",
|
|
230
|
+
children: resolvedLabels.uploadActionMobileSuffix
|
|
231
|
+
})] }) : null;
|
|
232
|
+
$[36] = resolvedLabels.uploadActionMobileSuffix;
|
|
233
|
+
$[37] = t21;
|
|
234
|
+
} else {
|
|
235
|
+
t21 = $[37];
|
|
236
|
+
}
|
|
237
|
+
let t22;
|
|
238
|
+
if ($[38] !== isDisabled || $[39] !== resolvedLabels.uploadAction || $[40] !== t20 || $[41] !== t21) {
|
|
239
|
+
t22 = /* @__PURE__ */ _jsxs(Button, {
|
|
228
240
|
className: "h-auto p-0 font-semibold",
|
|
229
241
|
disabled: isDisabled,
|
|
230
242
|
type: "button",
|
|
231
243
|
variant: "link",
|
|
232
244
|
onClick: t20,
|
|
233
|
-
children: resolvedLabels.uploadAction
|
|
245
|
+
children: [resolvedLabels.uploadAction, t21]
|
|
234
246
|
});
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
247
|
+
$[38] = isDisabled;
|
|
248
|
+
$[39] = resolvedLabels.uploadAction;
|
|
249
|
+
$[40] = t20;
|
|
250
|
+
$[41] = t21;
|
|
251
|
+
$[42] = t22;
|
|
239
252
|
} else {
|
|
240
|
-
|
|
253
|
+
t22 = $[42];
|
|
241
254
|
}
|
|
242
|
-
let
|
|
243
|
-
if ($[
|
|
244
|
-
|
|
255
|
+
let t23;
|
|
256
|
+
if ($[43] !== resolvedLabels.dragAndDrop) {
|
|
257
|
+
t23 = /* @__PURE__ */ _jsx("span", {
|
|
245
258
|
className: "text-sm max-md:hidden",
|
|
246
259
|
children: resolvedLabels.dragAndDrop
|
|
247
260
|
});
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
261
|
+
$[43] = resolvedLabels.dragAndDrop;
|
|
262
|
+
$[44] = t23;
|
|
250
263
|
} else {
|
|
251
|
-
|
|
264
|
+
t23 = $[44];
|
|
252
265
|
}
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
266
|
+
let t24;
|
|
267
|
+
if ($[45] !== t19 || $[46] !== t22 || $[47] !== t23) {
|
|
268
|
+
t24 = /* @__PURE__ */ _jsxs("div", {
|
|
256
269
|
className: "flex flex-wrap items-center justify-center gap-1",
|
|
257
270
|
children: [
|
|
258
271
|
t19,
|
|
259
|
-
|
|
260
|
-
|
|
272
|
+
t22,
|
|
273
|
+
t23
|
|
261
274
|
]
|
|
262
275
|
});
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
276
|
+
$[45] = t19;
|
|
277
|
+
$[46] = t22;
|
|
278
|
+
$[47] = t23;
|
|
279
|
+
$[48] = t24;
|
|
267
280
|
} else {
|
|
268
|
-
|
|
281
|
+
t24 = $[48];
|
|
269
282
|
}
|
|
270
|
-
let
|
|
271
|
-
if ($[
|
|
272
|
-
|
|
283
|
+
let t25;
|
|
284
|
+
if ($[49] !== hint || $[50] !== hintId || $[51] !== isInvalid) {
|
|
285
|
+
t25 = hint ? /* @__PURE__ */ _jsx("p", {
|
|
273
286
|
id: hintId,
|
|
274
287
|
className: cn("m-0 text-xs transition-colors", isInvalid && "text-destructive"),
|
|
275
288
|
children: hint
|
|
276
289
|
}) : null;
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
$[49] = t24;
|
|
281
|
-
} else {
|
|
282
|
-
t24 = $[49];
|
|
283
|
-
}
|
|
284
|
-
let t25;
|
|
285
|
-
if ($[50] !== t23 || $[51] !== t24) {
|
|
286
|
-
t25 = /* @__PURE__ */ _jsxs("div", {
|
|
287
|
-
className: "flex flex-col gap-1 text-center",
|
|
288
|
-
children: [t23, t24]
|
|
289
|
-
});
|
|
290
|
-
$[50] = t23;
|
|
291
|
-
$[51] = t24;
|
|
290
|
+
$[49] = hint;
|
|
291
|
+
$[50] = hintId;
|
|
292
|
+
$[51] = isInvalid;
|
|
292
293
|
$[52] = t25;
|
|
293
294
|
} else {
|
|
294
295
|
t25 = $[52];
|
|
295
296
|
}
|
|
296
297
|
let t26;
|
|
297
|
-
if ($[53] !==
|
|
298
|
+
if ($[53] !== t24 || $[54] !== t25) {
|
|
298
299
|
t26 = /* @__PURE__ */ _jsxs("div", {
|
|
300
|
+
className: "flex flex-col gap-1 text-center",
|
|
301
|
+
children: [t24, t25]
|
|
302
|
+
});
|
|
303
|
+
$[53] = t24;
|
|
304
|
+
$[54] = t25;
|
|
305
|
+
$[55] = t26;
|
|
306
|
+
} else {
|
|
307
|
+
t26 = $[55];
|
|
308
|
+
}
|
|
309
|
+
let t27;
|
|
310
|
+
if ($[56] !== handleDragOver || $[57] !== handleDrop || $[58] !== openFilePicker || $[59] !== t10 || $[60] !== t11 || $[61] !== t12 || $[62] !== t16 || $[63] !== t26 || $[64] !== t9) {
|
|
311
|
+
t27 = /* @__PURE__ */ _jsxs("div", {
|
|
299
312
|
"data-slot": "file-upload-drop-zone",
|
|
300
313
|
"data-dragging": t9,
|
|
301
314
|
"data-disabled": t10,
|
|
@@ -307,22 +320,22 @@ export function FileUploadDropZone(t0) {
|
|
|
307
320
|
onDragLeave: handleDragLeave,
|
|
308
321
|
onDragEnd: handleDragLeave,
|
|
309
322
|
onDrop: handleDrop,
|
|
310
|
-
children: [t16,
|
|
323
|
+
children: [t16, t26]
|
|
311
324
|
});
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
} else {
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
return
|
|
325
|
+
$[56] = handleDragOver;
|
|
326
|
+
$[57] = handleDrop;
|
|
327
|
+
$[58] = openFilePicker;
|
|
328
|
+
$[59] = t10;
|
|
329
|
+
$[60] = t11;
|
|
330
|
+
$[61] = t12;
|
|
331
|
+
$[62] = t16;
|
|
332
|
+
$[63] = t26;
|
|
333
|
+
$[64] = t9;
|
|
334
|
+
$[65] = t27;
|
|
335
|
+
} else {
|
|
336
|
+
t27 = $[65];
|
|
337
|
+
}
|
|
338
|
+
return t27;
|
|
326
339
|
}
|
|
327
340
|
function _temp(event_3) {
|
|
328
341
|
return event_3.stopPropagation();
|
|
@@ -336,154 +349,233 @@ const FILE_UPLOAD_ITEM_DEFAULT_LABELS = {
|
|
|
336
349
|
progress: "Progreso de subida"
|
|
337
350
|
};
|
|
338
351
|
/**
|
|
339
|
-
* Renders one file with its size, status, progress bar
|
|
340
|
-
* retry action. Place it inside `FileUploadList` so additions and removals animate.
|
|
352
|
+
* Renders one file with its size, status, progress (a bar or a background fill), delete action
|
|
353
|
+
* and, after a failure, a retry action. Place it inside `FileUploadList` so additions and removals animate.
|
|
341
354
|
* @param props - File metadata, progress, callbacks and optional copy.
|
|
342
355
|
* @returns The list item.
|
|
343
356
|
*/
|
|
344
357
|
export function FileUploadItem(t0) {
|
|
345
|
-
const $ = _c(
|
|
346
|
-
const { name, size, progress, failed: t1, onDelete, isDeleteDisabled, onRetry, locale, labels, className } = t0;
|
|
358
|
+
const $ = _c(70);
|
|
359
|
+
const { name, size, progress, failed: t1, onDelete, isDeleteDisabled, onRetry, locale, labels, icon, progressVariant: t2, className } = t0;
|
|
347
360
|
const failed = t1 === undefined ? false : t1;
|
|
348
|
-
|
|
361
|
+
const progressVariant = t2 === undefined ? "bar" : t2;
|
|
362
|
+
let t3;
|
|
349
363
|
if ($[0] !== labels) {
|
|
350
|
-
|
|
364
|
+
t3 = {
|
|
351
365
|
...FILE_UPLOAD_ITEM_DEFAULT_LABELS,
|
|
352
366
|
...labels
|
|
353
367
|
};
|
|
354
368
|
$[0] = labels;
|
|
355
|
-
$[1] =
|
|
369
|
+
$[1] = t3;
|
|
356
370
|
} else {
|
|
357
|
-
|
|
371
|
+
t3 = $[1];
|
|
358
372
|
}
|
|
359
|
-
const resolvedLabels =
|
|
373
|
+
const resolvedLabels = t3;
|
|
360
374
|
const clampedProgress = Math.min(Math.max(progress, 0), COMPLETE_PROGRESS);
|
|
361
375
|
const isComplete = clampedProgress === COMPLETE_PROGRESS && !failed;
|
|
362
|
-
const
|
|
376
|
+
const isFillVariant = progressVariant === "fill";
|
|
363
377
|
let t4;
|
|
364
|
-
if ($[2] !==
|
|
365
|
-
t4 =
|
|
366
|
-
|
|
367
|
-
|
|
378
|
+
if ($[2] !== clampedProgress || $[3] !== resolvedLabels.progress) {
|
|
379
|
+
t4 = {
|
|
380
|
+
"aria-label": resolvedLabels.progress,
|
|
381
|
+
"aria-valuemax": COMPLETE_PROGRESS,
|
|
382
|
+
"aria-valuemin": 0,
|
|
383
|
+
"aria-valuenow": clampedProgress,
|
|
384
|
+
role: "progressbar"
|
|
385
|
+
};
|
|
386
|
+
$[2] = clampedProgress;
|
|
387
|
+
$[3] = resolvedLabels.progress;
|
|
388
|
+
$[4] = t4;
|
|
368
389
|
} else {
|
|
369
|
-
t4 = $[
|
|
390
|
+
t4 = $[4];
|
|
370
391
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
392
|
+
const progressBarProps = t4;
|
|
393
|
+
const t5 = failed || undefined;
|
|
394
|
+
let t6;
|
|
395
|
+
if ($[5] !== className) {
|
|
396
|
+
t6 = cn("group/file-item relative flex w-full min-w-0 gap-3 overflow-hidden rounded-xl bg-background p-4", className);
|
|
397
|
+
$[5] = className;
|
|
398
|
+
$[6] = t6;
|
|
399
|
+
} else {
|
|
400
|
+
t6 = $[6];
|
|
401
|
+
}
|
|
402
|
+
let t7;
|
|
403
|
+
if ($[7] !== clampedProgress || $[8] !== failed || $[9] !== isComplete || $[10] !== isFillVariant || $[11] !== progressBarProps) {
|
|
404
|
+
t7 = isFillVariant && !failed ? /* @__PURE__ */ _jsx("div", {
|
|
405
|
+
...progressBarProps,
|
|
406
|
+
className: cn("absolute inset-0 bg-muted transition-[translate,opacity] duration-150", isComplete && "opacity-0"),
|
|
407
|
+
style: { translate: `${clampedProgress - COMPLETE_PROGRESS}% 0` }
|
|
408
|
+
}) : null;
|
|
409
|
+
$[7] = clampedProgress;
|
|
410
|
+
$[8] = failed;
|
|
411
|
+
$[9] = isComplete;
|
|
412
|
+
$[10] = isFillVariant;
|
|
413
|
+
$[11] = progressBarProps;
|
|
414
|
+
$[12] = t7;
|
|
415
|
+
} else {
|
|
416
|
+
t7 = $[12];
|
|
417
|
+
}
|
|
418
|
+
let t8;
|
|
419
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
420
|
+
t8 = /* @__PURE__ */ _jsx("span", {
|
|
421
|
+
"data-slot": "file-upload-item-outline",
|
|
422
|
+
"aria-hidden": true,
|
|
423
|
+
className: "pointer-events-none absolute inset-0 z-[1] rounded-[inherit] ring-1 ring-border ring-inset group-data-failed/file-item:ring-2 group-data-failed/file-item:ring-destructive"
|
|
424
|
+
});
|
|
425
|
+
$[13] = t8;
|
|
426
|
+
} else {
|
|
427
|
+
t8 = $[13];
|
|
428
|
+
}
|
|
429
|
+
let t9;
|
|
430
|
+
if ($[14] !== icon) {
|
|
431
|
+
t9 = icon ?? /* @__PURE__ */ _jsx(FileIcon, {
|
|
374
432
|
"aria-hidden": true,
|
|
375
433
|
className: "size-10 shrink-0 stroke-[1.25] text-muted-foreground"
|
|
376
434
|
});
|
|
377
|
-
$[
|
|
435
|
+
$[14] = icon;
|
|
436
|
+
$[15] = t9;
|
|
378
437
|
} else {
|
|
379
|
-
|
|
438
|
+
t9 = $[15];
|
|
380
439
|
}
|
|
381
|
-
let
|
|
382
|
-
if ($[
|
|
383
|
-
|
|
440
|
+
let t10;
|
|
441
|
+
if ($[16] !== t9) {
|
|
442
|
+
t10 = /* @__PURE__ */ _jsx("span", {
|
|
443
|
+
className: "relative flex shrink-0",
|
|
444
|
+
children: t9
|
|
445
|
+
});
|
|
446
|
+
$[16] = t9;
|
|
447
|
+
$[17] = t10;
|
|
448
|
+
} else {
|
|
449
|
+
t10 = $[17];
|
|
450
|
+
}
|
|
451
|
+
let t11;
|
|
452
|
+
if ($[18] !== name) {
|
|
453
|
+
t11 = /* @__PURE__ */ _jsx("p", {
|
|
384
454
|
className: "m-0 max-w-full text-sm font-medium break-words text-foreground",
|
|
385
455
|
children: name
|
|
386
456
|
});
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
457
|
+
$[18] = name;
|
|
458
|
+
$[19] = t11;
|
|
389
459
|
} else {
|
|
390
|
-
|
|
460
|
+
t11 = $[19];
|
|
391
461
|
}
|
|
392
|
-
let
|
|
393
|
-
if ($[
|
|
394
|
-
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
462
|
+
let t12;
|
|
463
|
+
if ($[20] !== locale || $[21] !== size) {
|
|
464
|
+
t12 = formatFileSize(size, { locale });
|
|
465
|
+
$[20] = locale;
|
|
466
|
+
$[21] = size;
|
|
467
|
+
$[22] = t12;
|
|
398
468
|
} else {
|
|
399
|
-
|
|
469
|
+
t12 = $[22];
|
|
400
470
|
}
|
|
401
|
-
let
|
|
402
|
-
if ($[
|
|
403
|
-
|
|
471
|
+
let t13;
|
|
472
|
+
if ($[23] !== t12) {
|
|
473
|
+
t13 = /* @__PURE__ */ _jsx("span", {
|
|
404
474
|
className: "truncate whitespace-nowrap text-muted-foreground",
|
|
405
|
-
children:
|
|
475
|
+
children: t12
|
|
406
476
|
});
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
477
|
+
$[23] = t12;
|
|
478
|
+
$[24] = t13;
|
|
409
479
|
} else {
|
|
410
|
-
|
|
480
|
+
t13 = $[24];
|
|
411
481
|
}
|
|
412
|
-
let
|
|
413
|
-
if ($[
|
|
414
|
-
|
|
482
|
+
let t14;
|
|
483
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
484
|
+
t14 = /* @__PURE__ */ _jsx("span", {
|
|
415
485
|
"aria-hidden": true,
|
|
416
486
|
className: "h-3 w-px rounded-full bg-border"
|
|
417
487
|
});
|
|
418
|
-
$[
|
|
488
|
+
$[25] = t14;
|
|
419
489
|
} else {
|
|
420
|
-
|
|
490
|
+
t14 = $[25];
|
|
421
491
|
}
|
|
422
|
-
let
|
|
423
|
-
if ($[
|
|
424
|
-
|
|
492
|
+
let t15;
|
|
493
|
+
if ($[26] !== failed || $[27] !== isComplete || $[28] !== resolvedLabels.complete || $[29] !== resolvedLabels.failed || $[30] !== resolvedLabels.uploading) {
|
|
494
|
+
t15 = failed ? /* @__PURE__ */ _jsxs(_Fragment, { children: [/* @__PURE__ */ _jsx(XCircleIcon, {
|
|
495
|
+
"aria-hidden": true,
|
|
496
|
+
className: "size-4 text-destructive"
|
|
497
|
+
}), /* @__PURE__ */ _jsx("span", {
|
|
498
|
+
className: "text-destructive",
|
|
499
|
+
children: resolvedLabels.failed
|
|
500
|
+
})] }) : isComplete ? /* @__PURE__ */ _jsxs(_Fragment, { children: [/* @__PURE__ */ _jsx(CheckCircle2Icon, {
|
|
501
|
+
"aria-hidden": true,
|
|
502
|
+
className: "size-4 text-green-600 dark:text-green-500"
|
|
503
|
+
}), /* @__PURE__ */ _jsx("span", {
|
|
504
|
+
className: "text-green-700 dark:text-green-400",
|
|
505
|
+
children: resolvedLabels.complete
|
|
506
|
+
})] }) : /* @__PURE__ */ _jsxs(_Fragment, { children: [/* @__PURE__ */ _jsx(UploadCloudIcon, {
|
|
507
|
+
"aria-hidden": true,
|
|
508
|
+
className: "size-4 text-muted-foreground"
|
|
509
|
+
}), /* @__PURE__ */ _jsx("span", {
|
|
510
|
+
className: "text-muted-foreground",
|
|
511
|
+
children: resolvedLabels.uploading
|
|
512
|
+
})] });
|
|
513
|
+
$[26] = failed;
|
|
514
|
+
$[27] = isComplete;
|
|
515
|
+
$[28] = resolvedLabels.complete;
|
|
516
|
+
$[29] = resolvedLabels.failed;
|
|
517
|
+
$[30] = resolvedLabels.uploading;
|
|
518
|
+
$[31] = t15;
|
|
519
|
+
} else {
|
|
520
|
+
t15 = $[31];
|
|
521
|
+
}
|
|
522
|
+
let t16;
|
|
523
|
+
if ($[32] !== clampedProgress || $[33] !== failed || $[34] !== isFillVariant) {
|
|
524
|
+
t16 = isFillVariant && !failed ? /* @__PURE__ */ _jsxs("span", {
|
|
525
|
+
className: "font-normal text-muted-foreground tabular-nums",
|
|
526
|
+
children: [clampedProgress, "%"]
|
|
527
|
+
}) : null;
|
|
528
|
+
$[32] = clampedProgress;
|
|
529
|
+
$[33] = failed;
|
|
530
|
+
$[34] = isFillVariant;
|
|
531
|
+
$[35] = t16;
|
|
532
|
+
} else {
|
|
533
|
+
t16 = $[35];
|
|
534
|
+
}
|
|
535
|
+
let t17;
|
|
536
|
+
if ($[36] !== t15 || $[37] !== t16) {
|
|
537
|
+
t17 = /* @__PURE__ */ _jsxs("span", {
|
|
425
538
|
className: "flex items-center gap-1 font-medium",
|
|
426
539
|
role: "status",
|
|
427
|
-
children:
|
|
428
|
-
"aria-hidden": true,
|
|
429
|
-
className: "size-4 text-destructive"
|
|
430
|
-
}), /* @__PURE__ */ _jsx("span", {
|
|
431
|
-
className: "text-destructive",
|
|
432
|
-
children: resolvedLabels.failed
|
|
433
|
-
})] }) : isComplete ? /* @__PURE__ */ _jsxs(_Fragment, { children: [/* @__PURE__ */ _jsx(CheckCircle2Icon, {
|
|
434
|
-
"aria-hidden": true,
|
|
435
|
-
className: "size-4 text-green-600 dark:text-green-500"
|
|
436
|
-
}), /* @__PURE__ */ _jsx("span", {
|
|
437
|
-
className: "text-green-700 dark:text-green-400",
|
|
438
|
-
children: resolvedLabels.complete
|
|
439
|
-
})] }) : /* @__PURE__ */ _jsxs(_Fragment, { children: [/* @__PURE__ */ _jsx(UploadCloudIcon, {
|
|
440
|
-
"aria-hidden": true,
|
|
441
|
-
className: "size-4 text-muted-foreground"
|
|
442
|
-
}), /* @__PURE__ */ _jsx("span", {
|
|
443
|
-
className: "text-muted-foreground",
|
|
444
|
-
children: resolvedLabels.uploading
|
|
445
|
-
})] })
|
|
540
|
+
children: [t15, t16]
|
|
446
541
|
});
|
|
447
|
-
$[
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
450
|
-
$[16] = resolvedLabels.failed;
|
|
451
|
-
$[17] = resolvedLabels.uploading;
|
|
452
|
-
$[18] = t10;
|
|
542
|
+
$[36] = t15;
|
|
543
|
+
$[37] = t16;
|
|
544
|
+
$[38] = t17;
|
|
453
545
|
} else {
|
|
454
|
-
|
|
546
|
+
t17 = $[38];
|
|
455
547
|
}
|
|
456
|
-
let
|
|
457
|
-
if ($[
|
|
458
|
-
|
|
548
|
+
let t18;
|
|
549
|
+
if ($[39] !== t13 || $[40] !== t17) {
|
|
550
|
+
t18 = /* @__PURE__ */ _jsxs("div", {
|
|
459
551
|
className: "mt-0.5 flex items-center gap-2 text-sm",
|
|
460
552
|
children: [
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
553
|
+
t13,
|
|
554
|
+
t14,
|
|
555
|
+
t17
|
|
464
556
|
]
|
|
465
557
|
});
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
468
|
-
$[
|
|
558
|
+
$[39] = t13;
|
|
559
|
+
$[40] = t17;
|
|
560
|
+
$[41] = t18;
|
|
469
561
|
} else {
|
|
470
|
-
|
|
562
|
+
t18 = $[41];
|
|
471
563
|
}
|
|
472
|
-
let
|
|
473
|
-
if ($[
|
|
474
|
-
|
|
564
|
+
let t19;
|
|
565
|
+
if ($[42] !== t11 || $[43] !== t18) {
|
|
566
|
+
t19 = /* @__PURE__ */ _jsxs("div", {
|
|
475
567
|
className: "min-w-0 flex-1",
|
|
476
|
-
children: [
|
|
568
|
+
children: [t11, t18]
|
|
477
569
|
});
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
570
|
+
$[42] = t11;
|
|
571
|
+
$[43] = t18;
|
|
572
|
+
$[44] = t19;
|
|
481
573
|
} else {
|
|
482
|
-
|
|
574
|
+
t19 = $[44];
|
|
483
575
|
}
|
|
484
|
-
let
|
|
485
|
-
if ($[
|
|
486
|
-
|
|
576
|
+
let t20;
|
|
577
|
+
if ($[45] !== isDeleteDisabled || $[46] !== name || $[47] !== onDelete || $[48] !== resolvedLabels.delete) {
|
|
578
|
+
t20 = onDelete ? /* @__PURE__ */ _jsx(Button, {
|
|
487
579
|
"aria-label": `${resolvedLabels.delete} ${name}`,
|
|
488
580
|
className: "-mt-2 -mr-2 self-start text-muted-foreground",
|
|
489
581
|
disabled: isDeleteDisabled,
|
|
@@ -493,44 +585,40 @@ export function FileUploadItem(t0) {
|
|
|
493
585
|
onClick: onDelete,
|
|
494
586
|
children: /* @__PURE__ */ _jsx(Trash2Icon, { "aria-hidden": true })
|
|
495
587
|
}) : null;
|
|
496
|
-
$[
|
|
497
|
-
$[
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
588
|
+
$[45] = isDeleteDisabled;
|
|
589
|
+
$[46] = name;
|
|
590
|
+
$[47] = onDelete;
|
|
591
|
+
$[48] = resolvedLabels.delete;
|
|
592
|
+
$[49] = t20;
|
|
501
593
|
} else {
|
|
502
|
-
|
|
594
|
+
t20 = $[49];
|
|
503
595
|
}
|
|
504
|
-
let
|
|
505
|
-
if ($[
|
|
506
|
-
|
|
596
|
+
let t21;
|
|
597
|
+
if ($[50] !== t19 || $[51] !== t20) {
|
|
598
|
+
t21 = /* @__PURE__ */ _jsxs("div", {
|
|
507
599
|
className: "flex w-full min-w-0 flex-1",
|
|
508
|
-
children: [
|
|
600
|
+
children: [t19, t20]
|
|
509
601
|
});
|
|
510
|
-
$[
|
|
511
|
-
$[
|
|
512
|
-
$[
|
|
602
|
+
$[50] = t19;
|
|
603
|
+
$[51] = t20;
|
|
604
|
+
$[52] = t21;
|
|
513
605
|
} else {
|
|
514
|
-
|
|
606
|
+
t21 = $[52];
|
|
515
607
|
}
|
|
516
|
-
let
|
|
517
|
-
if ($[
|
|
518
|
-
|
|
608
|
+
let t22;
|
|
609
|
+
if ($[53] !== clampedProgress || $[54] !== failed || $[55] !== isFillVariant || $[56] !== onRetry || $[57] !== progressBarProps || $[58] !== resolvedLabels.retry) {
|
|
610
|
+
t22 = failed ? onRetry ? /* @__PURE__ */ _jsx(Button, {
|
|
519
611
|
className: "mt-1.5 h-auto p-0 text-destructive",
|
|
520
612
|
size: "sm",
|
|
521
613
|
type: "button",
|
|
522
614
|
variant: "link",
|
|
523
615
|
onClick: onRetry,
|
|
524
616
|
children: resolvedLabels.retry
|
|
525
|
-
}) : null : /* @__PURE__ */ _jsxs("div", {
|
|
617
|
+
}) : null : isFillVariant ? null : /* @__PURE__ */ _jsxs("div", {
|
|
526
618
|
className: "mt-1 flex w-full items-center gap-3",
|
|
527
619
|
children: [/* @__PURE__ */ _jsx("div", {
|
|
528
|
-
|
|
529
|
-
"aria-valuemax": COMPLETE_PROGRESS,
|
|
530
|
-
"aria-valuemin": 0,
|
|
531
|
-
"aria-valuenow": clampedProgress,
|
|
620
|
+
...progressBarProps,
|
|
532
621
|
className: "h-2 flex-1 overflow-hidden rounded-full bg-muted",
|
|
533
|
-
role: "progressbar",
|
|
534
622
|
children: /* @__PURE__ */ _jsx("div", {
|
|
535
623
|
className: "h-full rounded-full bg-primary transition-[width] duration-150",
|
|
536
624
|
style: { width: `${clampedProgress}%` }
|
|
@@ -540,43 +628,53 @@ export function FileUploadItem(t0) {
|
|
|
540
628
|
children: [clampedProgress, "%"]
|
|
541
629
|
})]
|
|
542
630
|
});
|
|
543
|
-
$[
|
|
544
|
-
$[
|
|
545
|
-
$[
|
|
546
|
-
$[
|
|
547
|
-
$[
|
|
548
|
-
$[
|
|
631
|
+
$[53] = clampedProgress;
|
|
632
|
+
$[54] = failed;
|
|
633
|
+
$[55] = isFillVariant;
|
|
634
|
+
$[56] = onRetry;
|
|
635
|
+
$[57] = progressBarProps;
|
|
636
|
+
$[58] = resolvedLabels.retry;
|
|
637
|
+
$[59] = t22;
|
|
549
638
|
} else {
|
|
550
|
-
|
|
639
|
+
t22 = $[59];
|
|
551
640
|
}
|
|
552
|
-
let
|
|
553
|
-
if ($[
|
|
554
|
-
|
|
555
|
-
className: "flex min-w-0 flex-1 flex-col items-start",
|
|
556
|
-
children: [
|
|
641
|
+
let t23;
|
|
642
|
+
if ($[60] !== t21 || $[61] !== t22) {
|
|
643
|
+
t23 = /* @__PURE__ */ _jsxs("div", {
|
|
644
|
+
className: "relative flex min-w-0 flex-1 flex-col items-start",
|
|
645
|
+
children: [t21, t22]
|
|
557
646
|
});
|
|
558
|
-
$[
|
|
559
|
-
$[
|
|
560
|
-
$[
|
|
647
|
+
$[60] = t21;
|
|
648
|
+
$[61] = t22;
|
|
649
|
+
$[62] = t23;
|
|
561
650
|
} else {
|
|
562
|
-
|
|
651
|
+
t23 = $[62];
|
|
563
652
|
}
|
|
564
|
-
let
|
|
565
|
-
if ($[
|
|
566
|
-
|
|
653
|
+
let t24;
|
|
654
|
+
if ($[63] !== progressVariant || $[64] !== t10 || $[65] !== t23 || $[66] !== t5 || $[67] !== t6 || $[68] !== t7) {
|
|
655
|
+
t24 = /* @__PURE__ */ _jsxs(AnimatedListItem, {
|
|
567
656
|
"data-slot": "file-upload-item",
|
|
568
|
-
"data-failed":
|
|
569
|
-
|
|
570
|
-
|
|
657
|
+
"data-failed": t5,
|
|
658
|
+
"data-progress-variant": progressVariant,
|
|
659
|
+
className: t6,
|
|
660
|
+
children: [
|
|
661
|
+
t7,
|
|
662
|
+
t8,
|
|
663
|
+
t10,
|
|
664
|
+
t23
|
|
665
|
+
]
|
|
571
666
|
});
|
|
572
|
-
$[
|
|
573
|
-
$[
|
|
574
|
-
$[
|
|
575
|
-
$[
|
|
667
|
+
$[63] = progressVariant;
|
|
668
|
+
$[64] = t10;
|
|
669
|
+
$[65] = t23;
|
|
670
|
+
$[66] = t5;
|
|
671
|
+
$[67] = t6;
|
|
672
|
+
$[68] = t7;
|
|
673
|
+
$[69] = t24;
|
|
576
674
|
} else {
|
|
577
|
-
|
|
675
|
+
t24 = $[69];
|
|
578
676
|
}
|
|
579
|
-
return
|
|
677
|
+
return t24;
|
|
580
678
|
}
|
|
581
679
|
/**
|
|
582
680
|
* Lays out a drop zone and its file list.
|