@alfadocs/ui-kit 0.8.1 → 0.9.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/{agenda-card-CalZqycc.js → agenda-card-DU13wUTA.js} +4 -4
- package/dist/_chunks/{agenda-tray-3ffFDQZC.js → agenda-tray-gQUXklO4.js} +9 -9
- package/dist/_chunks/{ai-prompt-input-DLgY8lrW.js → ai-prompt-input-bAJwYu84.js} +45 -45
- package/dist/_chunks/{alert-CVMq99Cq.js → alert-pgdXrEO5.js} +2 -2
- package/dist/_chunks/{app-frame-CDJOgPXe.js → app-frame-BYx1gcV7.js} +2 -2
- package/dist/_chunks/{audio-recorder-cOl_Z_Pk.js → audio-recorder-BHBonrFf.js} +54 -54
- package/dist/_chunks/{audio-visualiser-ByDEFLNm.js → audio-visualiser-I-T4Z7EU.js} +2 -2
- package/dist/_chunks/{autocomplete-D4oUZbsP.js → autocomplete-C34hbfKh.js} +6 -6
- package/dist/_chunks/{avatar-Dcr6XuDQ.js → avatar-I10iCDs8.js} +2 -2
- package/dist/_chunks/{badge-DKFbntoa.js → badge-cLYVGlMh.js} +2 -2
- package/dist/_chunks/{balance-cell-renderer-BuExGe6u.js → balance-cell-renderer-DWWtX-VM.js} +5 -5
- package/dist/_chunks/{breadcrumb-D1snXjPb.js → breadcrumb--YI7lcHA.js} +4 -4
- package/dist/_chunks/{button-group-CONver7M.js → button-group-Bh2g_Ng-.js} +2 -2
- package/dist/_chunks/{chat-container-ClzsWXp2.js → chat-container-izziXViv.js} +4 -4
- package/dist/_chunks/{chat-message-DoAhgUTj.js → chat-message-g3lxpXM_.js} +2 -2
- package/dist/_chunks/{checkbox-group-CarPLDIC.js → checkbox-group-Qkm3Rg1S.js} +6 -6
- package/dist/_chunks/{color-picker-CTIcHlDF.js → color-picker-BPfcByHH.js} +13 -13
- package/dist/_chunks/{combobox-BLWruOxK.js → combobox-DUpWoPPk.js} +6 -6
- package/dist/_chunks/{contact-card-DNyATxKv.js → contact-card-VJIUqKB2.js} +13 -13
- package/dist/_chunks/{date-picker-B1PO1ZQP.js → date-picker-BD5FYW08.js} +3 -3
- package/dist/_chunks/{date-range-picker-mix2nEVC.js → date-range-picker-BZLVgcXE.js} +27 -27
- package/dist/_chunks/{date-time-picker-Dnong_BY.js → date-time-picker-CCoRWX7R.js} +5 -5
- package/dist/_chunks/{description-list-BYA77Yud.js → description-list-y7Hk51KI.js} +16 -16
- package/dist/_chunks/{dialog-W8uDfXD8.js → dialog-DRp6Dejy.js} +2 -2
- package/dist/_chunks/{file-upload-C947ACDK.js → file-upload-BVbfiANR.js} +81 -81
- package/dist/_chunks/{floating-action-button-C8OYj8mE.js → floating-action-button-pojvb9gG.js} +6 -6
- package/dist/_chunks/{form-field-Bmkeh7WY.js → form-field-BOm9hK35.js} +2 -2
- package/dist/_chunks/{freemium-paywall-B9kIDtm1.js → freemium-paywall-BTEiVkes.js} +29 -29
- package/dist/_chunks/{key-value-pair-CgWvAIGb.js → key-value-pair-AbrRwesr.js} +14 -14
- package/dist/_chunks/{leo-sidebar-BWECDYpu.js → leo-sidebar-B054wsZm.js} +8 -8
- package/dist/_chunks/{link-BcYW1eNM.js → link-BGpwaFik.js} +2 -2
- package/dist/_chunks/{list-qP6p0NTw.js → list-DcjV0m5B.js} +2 -2
- package/dist/_chunks/{message-card-DjvsB_3U.js → message-card-c6R0-qXq.js} +6 -6
- package/dist/_chunks/{message-tray-BbnAzlLH.js → message-tray-Fsend-du.js} +21 -21
- package/dist/_chunks/{multi-select-wqqrgjUQ.js → multi-select-Bh-xR8kP.js} +10 -10
- package/dist/_chunks/{navigation-menu-ClbHeawy.js → navigation-menu-Bav1d_wA.js} +2 -2
- package/dist/_chunks/{notification-card-uTPEvAQS.js → notification-card-CRIE2Cuk.js} +3 -3
- package/dist/_chunks/{notification-tray-PGtMqXbP.js → notification-tray-CfXNYrxv.js} +21 -21
- package/dist/_chunks/{number-input-Q7wkHnvQ.js → number-input-mpSLk-ld.js} +3 -3
- package/dist/_chunks/{otp-input-C9gUByF0.js → otp-input-CI-Zv5q6.js} +2 -2
- package/dist/_chunks/{pagination-3AC4zTsi.js → pagination-OQBlnb1H.js} +7 -7
- package/dist/_chunks/{patient-shell-IhMULVrt.js → patient-shell-BS2V6V1b.js} +3 -3
- package/dist/_chunks/{payment-form-C3HMAsGG.js → payment-form-CI77oIx1.js} +3 -3
- package/dist/_chunks/{pdf-viewer-DO95bm2o.js → pdf-viewer-CNETPubN.js} +3 -3
- package/dist/_chunks/{phone-input-CSHJOJ13.js → phone-input-DtBVs5fz.js} +7 -7
- package/dist/_chunks/{popover-DekUKNBk.js → popover--derJ_wq.js} +2 -2
- package/dist/_chunks/{progress-C11tqhoI.js → progress-B-PSO5OS.js} +4 -4
- package/dist/_chunks/{recaptcha-widget-NyfOfLII.js → recaptcha-widget-Kp1XntuE.js} +3 -3
- package/dist/_chunks/{resizable-mpXXyIsN.js → resizable-COV-cnth.js} +3 -3
- package/dist/_chunks/{search-bar-BTDfgYtg.js → search-bar-DmZZ9UvV.js} +2 -2
- package/dist/_chunks/{search-input-CdJIEjFo.js → search-input-BBtSRH-Q.js} +4 -4
- package/dist/_chunks/{select-BOU_Osnf.js → select-i9MwQeQy.js} +20 -20
- package/dist/_chunks/{sheet-BAg7GY9j.js → sheet-BT0izeoI.js} +9 -9
- package/dist/_chunks/{sidebar-Bx3wCDyy.js → sidebar-CoLHtVrP.js} +83 -83
- package/dist/_chunks/{sign-in-with-alfadocs-button-B9UrqOqH.js → sign-in-with-alfadocs-button-4zZC-I6y.js} +3 -3
- package/dist/_chunks/{skip-link-DmZ3c6cb.js → skip-link-BaSMtPwB.js} +2 -2
- package/dist/_chunks/{slider-BT2bZWsy.js → slider-CkR6CLun.js} +3 -3
- package/dist/_chunks/{sparkline-_gy8aJDG.js → sparkline-D4Np8ikf.js} +15 -15
- package/dist/_chunks/{spinner-DLaYfLPl.js → spinner-DirtWZNG.js} +2 -2
- package/dist/_chunks/{stat-B9PHSPbN.js → stat-CDQ_a0vk.js} +4 -4
- package/dist/_chunks/{switch-C0psfIQF.js → switch-D916VW86.js} +2 -2
- package/dist/_chunks/{tabs-BZQy_Rmb.js → tabs-Cg794H0Q.js} +3 -3
- package/dist/_chunks/{tag-DuLMjRbF.js → tag-CQmHRM4Y.js} +3 -3
- package/dist/_chunks/{task-card-Dw_ZJDL8.js → task-card-BUVMh6HN.js} +2 -2
- package/dist/_chunks/{task-tray-XlIW9ueh.js → task-tray-B3A2fRGR.js} +13 -13
- package/dist/_chunks/{text-area-CO9Dz0qX.js → text-area-DHtcpcLv.js} +13 -13
- package/dist/_chunks/{text-input-DZwt9L8H.js → text-input-1oqFRbVI.js} +2 -2
- package/dist/_chunks/{theme-toggle-B3UR6ouK.js → theme-toggle-B3meAb3y.js} +14 -14
- package/dist/_chunks/{time-picker-DvPUmHH-.js → time-picker-DeVZkIY2.js} +2 -2
- package/dist/_chunks/{timeline-BvmnQadS.js → timeline-BaSULpSJ.js} +2 -2
- package/dist/_chunks/{toast.agent-DihA6MON.js → toast.agent-32WNQ-_x.js} +2 -2
- package/dist/_chunks/{transaction-chip-DE6DITun.js → transaction-chip-eVbolm0B.js} +2 -2
- package/dist/_chunks/{transcript-panel-Bx5ANMsv.js → transcript-panel-BpJqPr7I.js} +8 -8
- package/dist/_chunks/{typing-indicator-BZ5jXZPn.js → typing-indicator-DHeVN4ob.js} +9 -9
- package/dist/_chunks/{use-password-requirements-DgEYdN4H.js → use-password-requirements-B1M8lE2t.js} +29 -32
- package/dist/_chunks/{warning-stack-CdLIe534.js → warning-stack-CeRihME9.js} +15 -15
- package/dist/_chunks/{workflow-map-CESZNNZe.js → workflow-map-D3MvrsZV.js} +4 -4
- package/dist/agent-catalog.json +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/app-frame/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/audio-visualiser/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/chat-container/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/contact-card/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/floating-action-button/index.js +1 -1
- package/dist/components/form-field/index.js +1 -1
- package/dist/components/freemium-paywall/freemium-paywall.d.ts +2 -2
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/list/index.js +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/navigation-menu/index.js +2 -2
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/progress/index.js +1 -1
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/resizable/index.js +1 -1
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sidebar/sidebar.d.ts +1 -1
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/skip-link/index.js +1 -1
- package/dist/components/skip-link/skip-link.d.ts +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/stat/index.js +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/typing-indicator/index.js +1 -1
- package/dist/components/typing-indicator/typing-indicator.d.ts +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/config.d.ts +2 -1
- package/dist/i18n/config.js +49 -31
- package/dist/i18n/registerUiBundle.d.ts +15 -0
- package/dist/index.js +77 -77
- package/dist/patterns/leo-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as m, jsx as
|
|
2
|
-
import { forwardRef as Ne, useId as Ue, useState as
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ne, useId as Ue, useState as re, useRef as V, useCallback as y, useMemo as q, useEffect as ze } from "react";
|
|
3
3
|
import { u as je } from "./index-CeY1nNvd.js";
|
|
4
4
|
import { c as _ } from "./index-D2ZczOXr.js";
|
|
5
5
|
import { useTranslation as Me } from "react-i18next";
|
|
@@ -7,7 +7,7 @@ import { u as Ce } from "./form-field-context-B3APVHKx.js";
|
|
|
7
7
|
import { u as Le } from "./registry-C9nwlNyL.js";
|
|
8
8
|
import { C as le } from "./circle-alert-ChA9opNA.js";
|
|
9
9
|
import { c as w } from "./createLucideIcon-CrFbzy84.js";
|
|
10
|
-
import { X as
|
|
10
|
+
import { X as ie } from "./x-CCcI3eJp.js";
|
|
11
11
|
import { F as Fe } from "./file-text-DSNuv2B8.js";
|
|
12
12
|
import { C as Ae } from "./circle-check-9AeSgJD_.js";
|
|
13
13
|
/**
|
|
@@ -239,31 +239,31 @@ function Ye(d) {
|
|
|
239
239
|
function Je(d) {
|
|
240
240
|
var c;
|
|
241
241
|
const n = ((c = d.name.split(".").pop()) == null ? void 0 : c.toLowerCase()) ?? "";
|
|
242
|
-
return ["pdf", "doc", "docx", "txt", "rtf"].includes(n) ? /* @__PURE__ */
|
|
242
|
+
return ["pdf", "doc", "docx", "txt", "rtf"].includes(n) ? /* @__PURE__ */ r(
|
|
243
243
|
Fe,
|
|
244
244
|
{
|
|
245
245
|
"aria-hidden": "true",
|
|
246
246
|
className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
|
|
247
247
|
}
|
|
248
|
-
) : ["zip", "rar", "7z", "tar", "gz"].includes(n) ? /* @__PURE__ */
|
|
248
|
+
) : ["zip", "rar", "7z", "tar", "gz"].includes(n) ? /* @__PURE__ */ r(
|
|
249
249
|
_e,
|
|
250
250
|
{
|
|
251
251
|
"aria-hidden": "true",
|
|
252
252
|
className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
|
|
253
253
|
}
|
|
254
|
-
) : ["xls", "xlsx", "csv"].includes(n) ? /* @__PURE__ */
|
|
254
|
+
) : ["xls", "xlsx", "csv"].includes(n) ? /* @__PURE__ */ r(
|
|
255
255
|
$e,
|
|
256
256
|
{
|
|
257
257
|
"aria-hidden": "true",
|
|
258
258
|
className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
|
|
259
259
|
}
|
|
260
|
-
) : ["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"].includes(n) ? /* @__PURE__ */
|
|
260
|
+
) : ["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"].includes(n) ? /* @__PURE__ */ r(
|
|
261
261
|
He,
|
|
262
262
|
{
|
|
263
263
|
"aria-hidden": "true",
|
|
264
264
|
className: "ds:size-10 ds:shrink-0 ds:text-muted-foreground"
|
|
265
265
|
}
|
|
266
|
-
) : /* @__PURE__ */
|
|
266
|
+
) : /* @__PURE__ */ r(
|
|
267
267
|
Ve,
|
|
268
268
|
{
|
|
269
269
|
"aria-hidden": "true",
|
|
@@ -274,7 +274,7 @@ function Je(d) {
|
|
|
274
274
|
function Qe(d) {
|
|
275
275
|
switch (d) {
|
|
276
276
|
case "uploading":
|
|
277
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ r(
|
|
278
278
|
Te,
|
|
279
279
|
{
|
|
280
280
|
"aria-hidden": "true",
|
|
@@ -282,7 +282,7 @@ function Qe(d) {
|
|
|
282
282
|
}
|
|
283
283
|
);
|
|
284
284
|
case "complete":
|
|
285
|
-
return /* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ r(
|
|
286
286
|
Ae,
|
|
287
287
|
{
|
|
288
288
|
"aria-hidden": "true",
|
|
@@ -290,7 +290,7 @@ function Qe(d) {
|
|
|
290
290
|
}
|
|
291
291
|
);
|
|
292
292
|
case "error":
|
|
293
|
-
return /* @__PURE__ */
|
|
293
|
+
return /* @__PURE__ */ r(
|
|
294
294
|
le,
|
|
295
295
|
{
|
|
296
296
|
"aria-hidden": "true",
|
|
@@ -302,10 +302,10 @@ function Qe(d) {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
const Ze = [
|
|
305
|
-
"
|
|
306
|
-
"
|
|
307
|
-
"
|
|
308
|
-
"
|
|
305
|
+
"inputs.fileUpload.units.bytes",
|
|
306
|
+
"inputs.fileUpload.units.kilobytes",
|
|
307
|
+
"inputs.fileUpload.units.megabytes",
|
|
308
|
+
"inputs.fileUpload.units.gigabytes"
|
|
309
309
|
], ne = ["B", "KB", "MB", "GB"];
|
|
310
310
|
function I(d, n, c) {
|
|
311
311
|
let u = d, p = 0;
|
|
@@ -363,7 +363,7 @@ const ss = Ne(
|
|
|
363
363
|
showPreview: ce = !0,
|
|
364
364
|
className: P
|
|
365
365
|
}, j) => {
|
|
366
|
-
const { t: o, i18n: N } = Me(), v = Ce(), ue = Ue(), x = v.disabled || B, pe = v.invalid, K = v.id || ue, [R, b] =
|
|
366
|
+
const { t: o, i18n: N } = Me(), v = Ce(), ue = Ue(), x = v.disabled || B, pe = v.invalid, K = v.id || ue, [R, b] = re([]), [G, fe] = re([]), D = V(/* @__PURE__ */ new Map()), O = V(null), M = V(R);
|
|
367
367
|
M.current = R;
|
|
368
368
|
const U = y((e) => {
|
|
369
369
|
O.current && (O.current.textContent = e);
|
|
@@ -371,7 +371,7 @@ const ss = Ne(
|
|
|
371
371
|
(e) => {
|
|
372
372
|
if (!W || !n) return !0;
|
|
373
373
|
for (const [s, a] of Object.entries(n)) {
|
|
374
|
-
const t = s === "*/*" || s.endsWith("/*") && e.type.startsWith(s.replace("/*", "/")) || e.type === s,
|
|
374
|
+
const t = s === "*/*" || s.endsWith("/*") && e.type.startsWith(s.replace("/*", "/")) || e.type === s, i = de(e.name), f = a.length === 0 || a.some((z) => z.toLowerCase() === i);
|
|
375
375
|
if (t && f) return !0;
|
|
376
376
|
}
|
|
377
377
|
return !1;
|
|
@@ -385,17 +385,17 @@ const ss = Ne(
|
|
|
385
385
|
(a) => a.map(
|
|
386
386
|
(t) => t.id === e.id ? { ...t, status: "uploading", progress: 0 } : t
|
|
387
387
|
)
|
|
388
|
-
), U(o("
|
|
388
|
+
), U(o("inputs.fileUpload.uploading", "Uploading…"));
|
|
389
389
|
try {
|
|
390
390
|
await H(e.file, {
|
|
391
391
|
signal: s.signal,
|
|
392
392
|
onProgress: (a) => {
|
|
393
393
|
b(
|
|
394
394
|
(t) => t.map(
|
|
395
|
-
(
|
|
395
|
+
(i) => i.id === e.id ? { ...i, progress: a } : i
|
|
396
396
|
)
|
|
397
397
|
), U(
|
|
398
|
-
o("
|
|
398
|
+
o("inputs.fileUpload.progress", "{{percent}}% uploaded", {
|
|
399
399
|
percent: a
|
|
400
400
|
})
|
|
401
401
|
);
|
|
@@ -404,15 +404,15 @@ const ss = Ne(
|
|
|
404
404
|
(a) => a.map(
|
|
405
405
|
(t) => t.id === e.id ? { ...t, status: "complete", progress: 100 } : t
|
|
406
406
|
)
|
|
407
|
-
), U(o("
|
|
407
|
+
), U(o("inputs.fileUpload.complete", "Upload complete"));
|
|
408
408
|
} catch (a) {
|
|
409
409
|
if (s.signal.aborted) {
|
|
410
|
-
b((
|
|
410
|
+
b((i) => i.filter((f) => f.id !== e.id));
|
|
411
411
|
return;
|
|
412
412
|
}
|
|
413
|
-
const t = a instanceof Error ? a.message : o("
|
|
413
|
+
const t = a instanceof Error ? a.message : o("inputs.fileUpload.errors.uploadFailed", "Upload failed");
|
|
414
414
|
b(
|
|
415
|
-
(
|
|
415
|
+
(i) => i.map(
|
|
416
416
|
(f) => f.id === e.id ? { ...f, status: "error", error: t } : f
|
|
417
417
|
)
|
|
418
418
|
);
|
|
@@ -428,12 +428,12 @@ const ss = Ne(
|
|
|
428
428
|
file: l.file,
|
|
429
429
|
reason: Se(k.code)
|
|
430
430
|
}))
|
|
431
|
-
), t = [],
|
|
431
|
+
), t = [], i = [];
|
|
432
432
|
for (const l of e)
|
|
433
|
-
X(l) ?
|
|
433
|
+
X(l) ? i.push(l) : t.push({ file: l, reason: "file-invalid-type" });
|
|
434
434
|
const f = [...a, ...t];
|
|
435
435
|
fe(f), f.length > 0 && (A == null || A(f));
|
|
436
|
-
const z =
|
|
436
|
+
const z = i.map((l) => ({
|
|
437
437
|
file: l,
|
|
438
438
|
id: Xe(),
|
|
439
439
|
status: "pending",
|
|
@@ -447,12 +447,12 @@ const ss = Ne(
|
|
|
447
447
|
return z;
|
|
448
448
|
}
|
|
449
449
|
return [...l, ...z];
|
|
450
|
-
}), L == null || L(
|
|
450
|
+
}), L == null || L(i, f), U(
|
|
451
451
|
o(
|
|
452
|
-
"
|
|
452
|
+
"inputs.fileUpload.filesSelected",
|
|
453
453
|
"{{count}} file(s) selected",
|
|
454
454
|
{
|
|
455
|
-
count:
|
|
455
|
+
count: i.length
|
|
456
456
|
}
|
|
457
457
|
)
|
|
458
458
|
);
|
|
@@ -482,8 +482,8 @@ const ss = Ne(
|
|
|
482
482
|
}), he = y((e) => {
|
|
483
483
|
const s = D.current.get(e);
|
|
484
484
|
s == null || s.abort(), b((a) => {
|
|
485
|
-
const t = a.find((
|
|
486
|
-
return t != null && t.preview && URL.revokeObjectURL(t.preview), a.filter((
|
|
485
|
+
const t = a.find((i) => i.id === e);
|
|
486
|
+
return t != null && t.preview && URL.revokeObjectURL(t.preview), a.filter((i) => i.id !== e);
|
|
487
487
|
});
|
|
488
488
|
}, []), E = y(
|
|
489
489
|
(e) => {
|
|
@@ -514,32 +514,32 @@ const ss = Ne(
|
|
|
514
514
|
const S = y(
|
|
515
515
|
(e) => {
|
|
516
516
|
const s = [], a = [], t = h ? p : 1;
|
|
517
|
-
for (const
|
|
517
|
+
for (const i of e) {
|
|
518
518
|
if (s.length >= t) {
|
|
519
|
-
a.push({ file:
|
|
519
|
+
a.push({ file: i, reason: "too-many-files" });
|
|
520
520
|
continue;
|
|
521
521
|
}
|
|
522
|
-
if (c !== void 0 &&
|
|
523
|
-
a.push({ file:
|
|
522
|
+
if (c !== void 0 && i.size > c) {
|
|
523
|
+
a.push({ file: i, reason: "file-too-large" });
|
|
524
524
|
continue;
|
|
525
525
|
}
|
|
526
|
-
if (u !== void 0 &&
|
|
527
|
-
a.push({ file:
|
|
526
|
+
if (u !== void 0 && i.size < u) {
|
|
527
|
+
a.push({ file: i, reason: "file-too-small" });
|
|
528
528
|
continue;
|
|
529
529
|
}
|
|
530
530
|
if (n) {
|
|
531
|
-
const f = de(
|
|
531
|
+
const f = de(i.name);
|
|
532
532
|
if (!Object.entries(n).some(
|
|
533
533
|
([l, k]) => {
|
|
534
|
-
const xe = l === "*/*" || l.endsWith("/*") &&
|
|
534
|
+
const xe = l === "*/*" || l.endsWith("/*") && i.type.startsWith(l.replace("/*", "/")) || i.type === l, ke = k.length > 0 && k.some((we) => we.toLowerCase() === f);
|
|
535
535
|
return xe || ke;
|
|
536
536
|
}
|
|
537
537
|
)) {
|
|
538
|
-
a.push({ file:
|
|
538
|
+
a.push({ file: i, reason: "file-invalid-type" });
|
|
539
539
|
continue;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
s.push(
|
|
542
|
+
s.push(i);
|
|
543
543
|
}
|
|
544
544
|
return { accepted: s, rejected: a };
|
|
545
545
|
},
|
|
@@ -550,11 +550,11 @@ const ss = Ne(
|
|
|
550
550
|
const s = Array.from(e.clipboardData.files);
|
|
551
551
|
if (s.length > 0) {
|
|
552
552
|
e.preventDefault();
|
|
553
|
-
const { accepted: a, rejected: t } = S(s),
|
|
553
|
+
const { accepted: a, rejected: t } = S(s), i = t.map((f) => ({
|
|
554
554
|
file: f.file,
|
|
555
555
|
errors: [{ code: f.reason, message: f.reason }]
|
|
556
556
|
}));
|
|
557
|
-
$(a,
|
|
557
|
+
$(a, i);
|
|
558
558
|
}
|
|
559
559
|
},
|
|
560
560
|
[x, $, S]
|
|
@@ -566,11 +566,11 @@ const ss = Ne(
|
|
|
566
566
|
const se = q(() => {
|
|
567
567
|
const e = [];
|
|
568
568
|
return n && e.push(es(n)), c && e.push(
|
|
569
|
-
o("
|
|
569
|
+
o("inputs.fileUpload.maxSizeHint", "Max {{size}}", {
|
|
570
570
|
size: I(c, N.language, o)
|
|
571
571
|
})
|
|
572
572
|
), h && p > 1 && e.push(
|
|
573
|
-
o("
|
|
573
|
+
o("inputs.fileUpload.maxFilesHint", "Up to {{count}} files", {
|
|
574
574
|
count: p
|
|
575
575
|
})
|
|
576
576
|
), e;
|
|
@@ -578,7 +578,7 @@ const ss = Ne(
|
|
|
578
578
|
switch (e.reason) {
|
|
579
579
|
case "file-too-large":
|
|
580
580
|
return o(
|
|
581
|
-
"
|
|
581
|
+
"inputs.fileUpload.errors.fileTooLarge",
|
|
582
582
|
"File exceeds {{maxSize}}",
|
|
583
583
|
{
|
|
584
584
|
maxSize: c ? I(c, N.language, o) : ""
|
|
@@ -586,7 +586,7 @@ const ss = Ne(
|
|
|
586
586
|
);
|
|
587
587
|
case "file-too-small":
|
|
588
588
|
return o(
|
|
589
|
-
"
|
|
589
|
+
"inputs.fileUpload.errors.fileTooSmall",
|
|
590
590
|
"File is smaller than {{minSize}}",
|
|
591
591
|
{
|
|
592
592
|
minSize: u ? I(u, N.language, o) : ""
|
|
@@ -594,25 +594,25 @@ const ss = Ne(
|
|
|
594
594
|
);
|
|
595
595
|
case "file-invalid-type":
|
|
596
596
|
return o(
|
|
597
|
-
"
|
|
597
|
+
"inputs.fileUpload.errors.fileInvalidType",
|
|
598
598
|
"File type not accepted"
|
|
599
599
|
);
|
|
600
600
|
case "too-many-files":
|
|
601
601
|
return o(
|
|
602
|
-
"
|
|
602
|
+
"inputs.fileUpload.errors.tooManyFiles",
|
|
603
603
|
"Maximum {{maxFiles}} files allowed",
|
|
604
604
|
{
|
|
605
605
|
maxFiles: p
|
|
606
606
|
}
|
|
607
607
|
);
|
|
608
608
|
}
|
|
609
|
-
}), [G, o, c, u, p, N.language]), ve = () => R.length === 0 ? null : /* @__PURE__ */
|
|
609
|
+
}), [G, o, c, u, p, N.language]), ve = () => R.length === 0 ? null : /* @__PURE__ */ r("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: R.map((e) => /* @__PURE__ */ m(
|
|
610
610
|
"li",
|
|
611
611
|
{
|
|
612
612
|
"data-file-id": e.id,
|
|
613
613
|
className: Ge({ status: e.status }),
|
|
614
614
|
children: [
|
|
615
|
-
ce && e.preview ? /* @__PURE__ */
|
|
615
|
+
ce && e.preview ? /* @__PURE__ */ r(
|
|
616
616
|
"img",
|
|
617
617
|
{
|
|
618
618
|
src: e.preview,
|
|
@@ -623,7 +623,7 @@ const ss = Ne(
|
|
|
623
623
|
) : Je(e.file),
|
|
624
624
|
/* @__PURE__ */ m("div", { className: "ds:flex-1 ds:min-w-0", children: [
|
|
625
625
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
626
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ r("p", { className: "ds:truncate type-label ds:m-0", children: e.file.name }),
|
|
627
627
|
Qe(e.status)
|
|
628
628
|
] }),
|
|
629
629
|
/* @__PURE__ */ m("p", { className: "type-meta ds:text-muted-foreground ds:m-0 ds:mt-0.5", children: [
|
|
@@ -632,9 +632,9 @@ const ss = Ne(
|
|
|
632
632
|
e.progress,
|
|
633
633
|
"%"
|
|
634
634
|
] }),
|
|
635
|
-
e.status === "complete" && /* @__PURE__ */
|
|
635
|
+
e.status === "complete" && /* @__PURE__ */ r("span", { className: "ds:ms-[var(--spacing-sm)] ds:text-[var(--success)] ds:font-medium", children: o("inputs.fileUpload.complete", "Complete") })
|
|
636
636
|
] }),
|
|
637
|
-
e.status === "uploading" && /* @__PURE__ */
|
|
637
|
+
e.status === "uploading" && /* @__PURE__ */ r(
|
|
638
638
|
"div",
|
|
639
639
|
{
|
|
640
640
|
role: "progressbar",
|
|
@@ -643,7 +643,7 @@ const ss = Ne(
|
|
|
643
643
|
"aria-valuemin": 0,
|
|
644
644
|
"aria-valuemax": 100,
|
|
645
645
|
className: "ds:mt-[var(--spacing-sm)] ds:h-1.5 ds:w-full ds:rounded-[var(--radius-full)] ds:bg-muted ds:overflow-hidden",
|
|
646
|
-
children: /* @__PURE__ */
|
|
646
|
+
children: /* @__PURE__ */ r(
|
|
647
647
|
"div",
|
|
648
648
|
{
|
|
649
649
|
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",
|
|
@@ -652,7 +652,7 @@ const ss = Ne(
|
|
|
652
652
|
)
|
|
653
653
|
}
|
|
654
654
|
),
|
|
655
|
-
e.status === "error" && e.error && /* @__PURE__ */
|
|
655
|
+
e.status === "error" && e.error && /* @__PURE__ */ r(
|
|
656
656
|
"p",
|
|
657
657
|
{
|
|
658
658
|
role: "alert",
|
|
@@ -661,24 +661,24 @@ const ss = Ne(
|
|
|
661
661
|
}
|
|
662
662
|
)
|
|
663
663
|
] }),
|
|
664
|
-
e.status === "uploading" && /* @__PURE__ */
|
|
664
|
+
e.status === "uploading" && /* @__PURE__ */ r(
|
|
665
665
|
"button",
|
|
666
666
|
{
|
|
667
667
|
type: "button",
|
|
668
668
|
onClick: () => he(e.id),
|
|
669
|
-
"aria-label": o("
|
|
669
|
+
"aria-label": o("inputs.fileUpload.cancel", "Cancel upload"),
|
|
670
670
|
className: oe(),
|
|
671
|
-
children: /* @__PURE__ */
|
|
671
|
+
children: /* @__PURE__ */ r(ie, { "aria-hidden": "true", className: "ds:size-4" })
|
|
672
672
|
}
|
|
673
673
|
),
|
|
674
|
-
(e.status === "complete" || e.status === "pending" || e.status === "error") && /* @__PURE__ */
|
|
674
|
+
(e.status === "complete" || e.status === "pending" || e.status === "error") && /* @__PURE__ */ r(
|
|
675
675
|
"button",
|
|
676
676
|
{
|
|
677
677
|
type: "button",
|
|
678
678
|
onClick: () => E(e.id),
|
|
679
|
-
"aria-label": o("
|
|
679
|
+
"aria-label": o("inputs.fileUpload.remove", "Remove file"),
|
|
680
680
|
className: oe(),
|
|
681
|
-
children: /* @__PURE__ */
|
|
681
|
+
children: /* @__PURE__ */ r(ie, { "aria-hidden": "true", className: "ds:size-4" })
|
|
682
682
|
}
|
|
683
683
|
)
|
|
684
684
|
]
|
|
@@ -705,7 +705,7 @@ const ss = Ne(
|
|
|
705
705
|
onPaste: ee,
|
|
706
706
|
id: K,
|
|
707
707
|
"aria-label": o(
|
|
708
|
-
"
|
|
708
|
+
"inputs.fileUpload.dropHere",
|
|
709
709
|
"Drop files here or click to browse"
|
|
710
710
|
),
|
|
711
711
|
"aria-describedby": v.describedBy || void 0,
|
|
@@ -713,25 +713,25 @@ const ss = Ne(
|
|
|
713
713
|
"aria-required": v.required || void 0,
|
|
714
714
|
"data-testid": "file-upload-dropzone",
|
|
715
715
|
children: [
|
|
716
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ r(
|
|
717
717
|
"input",
|
|
718
718
|
{
|
|
719
719
|
...J({
|
|
720
720
|
"aria-label": o(
|
|
721
|
-
"
|
|
721
|
+
"inputs.fileUpload.dropHere",
|
|
722
722
|
"Drop files here or click to browse"
|
|
723
723
|
)
|
|
724
724
|
})
|
|
725
725
|
}
|
|
726
726
|
),
|
|
727
727
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
728
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ r("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: C ? /* @__PURE__ */ r(De, { "aria-hidden": "true", className: "ds:size-7" }) : /* @__PURE__ */ r(T, { "aria-hidden": "true", className: "ds:size-7" }) }),
|
|
729
729
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
"
|
|
730
|
+
/* @__PURE__ */ r("p", { className: "type-label ds:text-foreground ds:text-center ds:m-0", children: C ? o("inputs.fileUpload.dropActive", "Drop files here") : o(
|
|
731
|
+
"inputs.fileUpload.dropHere",
|
|
732
732
|
"Drop files here or click to browse"
|
|
733
733
|
) }),
|
|
734
|
-
se.length > 0 && !C && /* @__PURE__ */
|
|
734
|
+
se.length > 0 && !C && /* @__PURE__ */ r("p", { className: "type-meta ds:text-muted-foreground ds:text-center ds:m-0", children: se.join(" · ") })
|
|
735
735
|
] }),
|
|
736
736
|
g === "both" && !C && /* @__PURE__ */ m(
|
|
737
737
|
"button",
|
|
@@ -745,8 +745,8 @@ const ss = Ne(
|
|
|
745
745
|
className: "ds:mt-[var(--spacing-xs)]"
|
|
746
746
|
}),
|
|
747
747
|
children: [
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
o("
|
|
748
|
+
/* @__PURE__ */ r(T, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
749
|
+
o("inputs.fileUpload.browse", "Browse files")
|
|
750
750
|
]
|
|
751
751
|
}
|
|
752
752
|
)
|
|
@@ -755,11 +755,11 @@ const ss = Ne(
|
|
|
755
755
|
}
|
|
756
756
|
);
|
|
757
757
|
}, ye = () => g === "dropzone" ? null : g === "button" ? /* @__PURE__ */ m("div", { onPaste: ee, ref: j, children: [
|
|
758
|
-
/* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ r(
|
|
759
759
|
"input",
|
|
760
760
|
{
|
|
761
761
|
...J({
|
|
762
|
-
"aria-label": o("
|
|
762
|
+
"aria-label": o("inputs.fileUpload.browse", "Browse files")
|
|
763
763
|
})
|
|
764
764
|
}
|
|
765
765
|
),
|
|
@@ -775,8 +775,8 @@ const ss = Ne(
|
|
|
775
775
|
"aria-invalid": g === "button" && v.invalid || void 0,
|
|
776
776
|
"aria-required": g === "button" && v.required || void 0,
|
|
777
777
|
children: [
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
o("
|
|
778
|
+
/* @__PURE__ */ r(T, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
779
|
+
o("inputs.fileUpload.browse", "Browse files")
|
|
780
780
|
]
|
|
781
781
|
}
|
|
782
782
|
)
|
|
@@ -785,7 +785,7 @@ const ss = Ne(
|
|
|
785
785
|
be(),
|
|
786
786
|
ye(),
|
|
787
787
|
ve(),
|
|
788
|
-
te.length > 0 && /* @__PURE__ */
|
|
788
|
+
te.length > 0 && /* @__PURE__ */ r(
|
|
789
789
|
"div",
|
|
790
790
|
{
|
|
791
791
|
role: "alert",
|
|
@@ -795,21 +795,21 @@ const ss = Ne(
|
|
|
795
795
|
{
|
|
796
796
|
className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
797
797
|
children: [
|
|
798
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ r(
|
|
799
799
|
le,
|
|
800
800
|
{
|
|
801
801
|
"aria-hidden": "true",
|
|
802
802
|
className: "ds:size-3.5 ds:shrink-0 ds:text-destructive"
|
|
803
803
|
}
|
|
804
804
|
),
|
|
805
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ r("p", { className: "type-meta ds:text-destructive ds:m-0", children: e })
|
|
806
806
|
]
|
|
807
807
|
},
|
|
808
808
|
s
|
|
809
809
|
))
|
|
810
810
|
}
|
|
811
811
|
),
|
|
812
|
-
/* @__PURE__ */
|
|
812
|
+
/* @__PURE__ */ r(
|
|
813
813
|
"span",
|
|
814
814
|
{
|
|
815
815
|
ref: O,
|
|
@@ -826,4 +826,4 @@ export {
|
|
|
826
826
|
ss as F,
|
|
827
827
|
Pe as f
|
|
828
828
|
};
|
|
829
|
-
//# sourceMappingURL=file-upload-
|
|
829
|
+
//# sourceMappingURL=file-upload-BVbfiANR.js.map
|
package/dist/_chunks/{floating-action-button-C8OYj8mE.js → floating-action-button-pojvb9gG.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as m, jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
2
|
+
import { forwardRef as g } from "react";
|
|
3
|
+
import { c as u } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as b } from "react-i18next";
|
|
5
|
-
const x =
|
|
5
|
+
const x = u(
|
|
6
6
|
[
|
|
7
7
|
// `relative` anchors the `::before` hit-target expansion on `sm`.
|
|
8
8
|
"ds:relative ds:inline-flex ds:items-center ds:justify-center",
|
|
@@ -61,7 +61,7 @@ const x = g(
|
|
|
61
61
|
position: "bottom-end"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
), h =
|
|
64
|
+
), h = g((t, o) => {
|
|
65
65
|
const {
|
|
66
66
|
variant: i,
|
|
67
67
|
size: n,
|
|
@@ -72,7 +72,7 @@ const x = g(
|
|
|
72
72
|
children: c,
|
|
73
73
|
type: f,
|
|
74
74
|
...a
|
|
75
|
-
} = t, { t: v } = b(), p = a["aria-label"] ?? (s ? void 0 : v("
|
|
75
|
+
} = t, { t: v } = b(), p = a["aria-label"] ?? (s ? void 0 : v("common.add", { defaultValue: "Add" }));
|
|
76
76
|
return /* @__PURE__ */ m(
|
|
77
77
|
"button",
|
|
78
78
|
{
|
|
@@ -100,4 +100,4 @@ h.displayName = "FloatingActionButton";
|
|
|
100
100
|
export {
|
|
101
101
|
h as F
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=floating-action-button-
|
|
103
|
+
//# sourceMappingURL=floating-action-button-pojvb9gG.js.map
|
|
@@ -83,7 +83,7 @@ const C = f("ds:text-start", {
|
|
|
83
83
|
),
|
|
84
84
|
h && /* @__PURE__ */ t("span", { className: "ds:text-muted-foreground ds:ms-[var(--spacing-xs)] ds:font-normal", children: [
|
|
85
85
|
"(",
|
|
86
|
-
y("
|
|
86
|
+
y("common.optional", "optional"),
|
|
87
87
|
")"
|
|
88
88
|
] })
|
|
89
89
|
]
|
|
@@ -120,4 +120,4 @@ $.displayName = "FormField";
|
|
|
120
120
|
export {
|
|
121
121
|
$ as F
|
|
122
122
|
};
|
|
123
|
-
//# sourceMappingURL=form-field-
|
|
123
|
+
//# sourceMappingURL=form-field-BOm9hK35.js.map
|