@alfadocs/ui-kit 0.8.1 → 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/dist/_chunks/{agenda-card-CalZqycc.js → agenda-card-CsCm7hQv.js} +5 -5
- package/dist/_chunks/{agenda-tray-3ffFDQZC.js → agenda-tray-B8QZ3wEp.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-BHhnR3qm.js} +8 -12
- 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-DIecAfC-.js} +82 -86
- 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-ejOw5g6g.js} +3 -6
- package/dist/_chunks/{notification-tray-PGtMqXbP.js → notification-tray-C3dYdLAF.js} +21 -24
- 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-B5Ms55PZ.js} +16 -16
- 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-rmls7dIh.js} +10 -10
- package/dist/_chunks/{toast.agent-DihA6MON.js → toast.agent-32WNQ-_x.js} +2 -2
- package/dist/_chunks/{transaction-chip-DE6DITun.js → transaction-chip-z9ENE50O.js} +3 -3
- 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-DbPZMfV9.js} +30 -33
- 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,14 +447,10 @@ const ss = Ne(
|
|
|
447
447
|
return z;
|
|
448
448
|
}
|
|
449
449
|
return [...l, ...z];
|
|
450
|
-
}), L == null || L(
|
|
451
|
-
o(
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
{
|
|
455
|
-
count: r.length
|
|
456
|
-
}
|
|
457
|
-
)
|
|
450
|
+
}), L == null || L(i, f), U(
|
|
451
|
+
o("inputs.fileUpload.filesSelected", "{{count}} file(s) selected", {
|
|
452
|
+
count: i.length
|
|
453
|
+
})
|
|
458
454
|
);
|
|
459
455
|
for (const l of z)
|
|
460
456
|
Y(l);
|
|
@@ -482,8 +478,8 @@ const ss = Ne(
|
|
|
482
478
|
}), he = y((e) => {
|
|
483
479
|
const s = D.current.get(e);
|
|
484
480
|
s == null || s.abort(), b((a) => {
|
|
485
|
-
const t = a.find((
|
|
486
|
-
return t != null && t.preview && URL.revokeObjectURL(t.preview), a.filter((
|
|
481
|
+
const t = a.find((i) => i.id === e);
|
|
482
|
+
return t != null && t.preview && URL.revokeObjectURL(t.preview), a.filter((i) => i.id !== e);
|
|
487
483
|
});
|
|
488
484
|
}, []), E = y(
|
|
489
485
|
(e) => {
|
|
@@ -514,32 +510,32 @@ const ss = Ne(
|
|
|
514
510
|
const S = y(
|
|
515
511
|
(e) => {
|
|
516
512
|
const s = [], a = [], t = h ? p : 1;
|
|
517
|
-
for (const
|
|
513
|
+
for (const i of e) {
|
|
518
514
|
if (s.length >= t) {
|
|
519
|
-
a.push({ file:
|
|
515
|
+
a.push({ file: i, reason: "too-many-files" });
|
|
520
516
|
continue;
|
|
521
517
|
}
|
|
522
|
-
if (c !== void 0 &&
|
|
523
|
-
a.push({ file:
|
|
518
|
+
if (c !== void 0 && i.size > c) {
|
|
519
|
+
a.push({ file: i, reason: "file-too-large" });
|
|
524
520
|
continue;
|
|
525
521
|
}
|
|
526
|
-
if (u !== void 0 &&
|
|
527
|
-
a.push({ file:
|
|
522
|
+
if (u !== void 0 && i.size < u) {
|
|
523
|
+
a.push({ file: i, reason: "file-too-small" });
|
|
528
524
|
continue;
|
|
529
525
|
}
|
|
530
526
|
if (n) {
|
|
531
|
-
const f = de(
|
|
527
|
+
const f = de(i.name);
|
|
532
528
|
if (!Object.entries(n).some(
|
|
533
529
|
([l, k]) => {
|
|
534
|
-
const xe = l === "*/*" || l.endsWith("/*") &&
|
|
530
|
+
const xe = l === "*/*" || l.endsWith("/*") && i.type.startsWith(l.replace("/*", "/")) || i.type === l, ke = k.length > 0 && k.some((we) => we.toLowerCase() === f);
|
|
535
531
|
return xe || ke;
|
|
536
532
|
}
|
|
537
533
|
)) {
|
|
538
|
-
a.push({ file:
|
|
534
|
+
a.push({ file: i, reason: "file-invalid-type" });
|
|
539
535
|
continue;
|
|
540
536
|
}
|
|
541
537
|
}
|
|
542
|
-
s.push(
|
|
538
|
+
s.push(i);
|
|
543
539
|
}
|
|
544
540
|
return { accepted: s, rejected: a };
|
|
545
541
|
},
|
|
@@ -550,11 +546,11 @@ const ss = Ne(
|
|
|
550
546
|
const s = Array.from(e.clipboardData.files);
|
|
551
547
|
if (s.length > 0) {
|
|
552
548
|
e.preventDefault();
|
|
553
|
-
const { accepted: a, rejected: t } = S(s),
|
|
549
|
+
const { accepted: a, rejected: t } = S(s), i = t.map((f) => ({
|
|
554
550
|
file: f.file,
|
|
555
551
|
errors: [{ code: f.reason, message: f.reason }]
|
|
556
552
|
}));
|
|
557
|
-
$(a,
|
|
553
|
+
$(a, i);
|
|
558
554
|
}
|
|
559
555
|
},
|
|
560
556
|
[x, $, S]
|
|
@@ -566,11 +562,11 @@ const ss = Ne(
|
|
|
566
562
|
const se = q(() => {
|
|
567
563
|
const e = [];
|
|
568
564
|
return n && e.push(es(n)), c && e.push(
|
|
569
|
-
o("
|
|
565
|
+
o("inputs.fileUpload.maxSizeHint", "Max {{size}}", {
|
|
570
566
|
size: I(c, N.language, o)
|
|
571
567
|
})
|
|
572
568
|
), h && p > 1 && e.push(
|
|
573
|
-
o("
|
|
569
|
+
o("inputs.fileUpload.maxFilesHint", "Up to {{count}} files", {
|
|
574
570
|
count: p
|
|
575
571
|
})
|
|
576
572
|
), e;
|
|
@@ -578,7 +574,7 @@ const ss = Ne(
|
|
|
578
574
|
switch (e.reason) {
|
|
579
575
|
case "file-too-large":
|
|
580
576
|
return o(
|
|
581
|
-
"
|
|
577
|
+
"inputs.fileUpload.errors.fileTooLarge",
|
|
582
578
|
"File exceeds {{maxSize}}",
|
|
583
579
|
{
|
|
584
580
|
maxSize: c ? I(c, N.language, o) : ""
|
|
@@ -586,7 +582,7 @@ const ss = Ne(
|
|
|
586
582
|
);
|
|
587
583
|
case "file-too-small":
|
|
588
584
|
return o(
|
|
589
|
-
"
|
|
585
|
+
"inputs.fileUpload.errors.fileTooSmall",
|
|
590
586
|
"File is smaller than {{minSize}}",
|
|
591
587
|
{
|
|
592
588
|
minSize: u ? I(u, N.language, o) : ""
|
|
@@ -594,25 +590,25 @@ const ss = Ne(
|
|
|
594
590
|
);
|
|
595
591
|
case "file-invalid-type":
|
|
596
592
|
return o(
|
|
597
|
-
"
|
|
593
|
+
"inputs.fileUpload.errors.fileInvalidType",
|
|
598
594
|
"File type not accepted"
|
|
599
595
|
);
|
|
600
596
|
case "too-many-files":
|
|
601
597
|
return o(
|
|
602
|
-
"
|
|
598
|
+
"inputs.fileUpload.errors.tooManyFiles",
|
|
603
599
|
"Maximum {{maxFiles}} files allowed",
|
|
604
600
|
{
|
|
605
601
|
maxFiles: p
|
|
606
602
|
}
|
|
607
603
|
);
|
|
608
604
|
}
|
|
609
|
-
}), [G, o, c, u, p, N.language]), ve = () => R.length === 0 ? null : /* @__PURE__ */
|
|
605
|
+
}), [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
606
|
"li",
|
|
611
607
|
{
|
|
612
608
|
"data-file-id": e.id,
|
|
613
609
|
className: Ge({ status: e.status }),
|
|
614
610
|
children: [
|
|
615
|
-
ce && e.preview ? /* @__PURE__ */
|
|
611
|
+
ce && e.preview ? /* @__PURE__ */ r(
|
|
616
612
|
"img",
|
|
617
613
|
{
|
|
618
614
|
src: e.preview,
|
|
@@ -623,7 +619,7 @@ const ss = Ne(
|
|
|
623
619
|
) : Je(e.file),
|
|
624
620
|
/* @__PURE__ */ m("div", { className: "ds:flex-1 ds:min-w-0", children: [
|
|
625
621
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
626
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ r("p", { className: "ds:truncate type-label ds:m-0", children: e.file.name }),
|
|
627
623
|
Qe(e.status)
|
|
628
624
|
] }),
|
|
629
625
|
/* @__PURE__ */ m("p", { className: "type-meta ds:text-muted-foreground ds:m-0 ds:mt-0.5", children: [
|
|
@@ -632,9 +628,9 @@ const ss = Ne(
|
|
|
632
628
|
e.progress,
|
|
633
629
|
"%"
|
|
634
630
|
] }),
|
|
635
|
-
e.status === "complete" && /* @__PURE__ */
|
|
631
|
+
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
632
|
] }),
|
|
637
|
-
e.status === "uploading" && /* @__PURE__ */
|
|
633
|
+
e.status === "uploading" && /* @__PURE__ */ r(
|
|
638
634
|
"div",
|
|
639
635
|
{
|
|
640
636
|
role: "progressbar",
|
|
@@ -643,7 +639,7 @@ const ss = Ne(
|
|
|
643
639
|
"aria-valuemin": 0,
|
|
644
640
|
"aria-valuemax": 100,
|
|
645
641
|
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__ */
|
|
642
|
+
children: /* @__PURE__ */ r(
|
|
647
643
|
"div",
|
|
648
644
|
{
|
|
649
645
|
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 +648,7 @@ const ss = Ne(
|
|
|
652
648
|
)
|
|
653
649
|
}
|
|
654
650
|
),
|
|
655
|
-
e.status === "error" && e.error && /* @__PURE__ */
|
|
651
|
+
e.status === "error" && e.error && /* @__PURE__ */ r(
|
|
656
652
|
"p",
|
|
657
653
|
{
|
|
658
654
|
role: "alert",
|
|
@@ -661,24 +657,24 @@ const ss = Ne(
|
|
|
661
657
|
}
|
|
662
658
|
)
|
|
663
659
|
] }),
|
|
664
|
-
e.status === "uploading" && /* @__PURE__ */
|
|
660
|
+
e.status === "uploading" && /* @__PURE__ */ r(
|
|
665
661
|
"button",
|
|
666
662
|
{
|
|
667
663
|
type: "button",
|
|
668
664
|
onClick: () => he(e.id),
|
|
669
|
-
"aria-label": o("
|
|
665
|
+
"aria-label": o("inputs.fileUpload.cancel", "Cancel upload"),
|
|
670
666
|
className: oe(),
|
|
671
|
-
children: /* @__PURE__ */
|
|
667
|
+
children: /* @__PURE__ */ r(ie, { "aria-hidden": "true", className: "ds:size-4" })
|
|
672
668
|
}
|
|
673
669
|
),
|
|
674
|
-
(e.status === "complete" || e.status === "pending" || e.status === "error") && /* @__PURE__ */
|
|
670
|
+
(e.status === "complete" || e.status === "pending" || e.status === "error") && /* @__PURE__ */ r(
|
|
675
671
|
"button",
|
|
676
672
|
{
|
|
677
673
|
type: "button",
|
|
678
674
|
onClick: () => E(e.id),
|
|
679
|
-
"aria-label": o("
|
|
675
|
+
"aria-label": o("inputs.fileUpload.remove", "Remove file"),
|
|
680
676
|
className: oe(),
|
|
681
|
-
children: /* @__PURE__ */
|
|
677
|
+
children: /* @__PURE__ */ r(ie, { "aria-hidden": "true", className: "ds:size-4" })
|
|
682
678
|
}
|
|
683
679
|
)
|
|
684
680
|
]
|
|
@@ -705,7 +701,7 @@ const ss = Ne(
|
|
|
705
701
|
onPaste: ee,
|
|
706
702
|
id: K,
|
|
707
703
|
"aria-label": o(
|
|
708
|
-
"
|
|
704
|
+
"inputs.fileUpload.dropHere",
|
|
709
705
|
"Drop files here or click to browse"
|
|
710
706
|
),
|
|
711
707
|
"aria-describedby": v.describedBy || void 0,
|
|
@@ -713,25 +709,25 @@ const ss = Ne(
|
|
|
713
709
|
"aria-required": v.required || void 0,
|
|
714
710
|
"data-testid": "file-upload-dropzone",
|
|
715
711
|
children: [
|
|
716
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ r(
|
|
717
713
|
"input",
|
|
718
714
|
{
|
|
719
715
|
...J({
|
|
720
716
|
"aria-label": o(
|
|
721
|
-
"
|
|
717
|
+
"inputs.fileUpload.dropHere",
|
|
722
718
|
"Drop files here or click to browse"
|
|
723
719
|
)
|
|
724
720
|
})
|
|
725
721
|
}
|
|
726
722
|
),
|
|
727
723
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
728
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__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
725
|
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
"
|
|
726
|
+
/* @__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(
|
|
727
|
+
"inputs.fileUpload.dropHere",
|
|
732
728
|
"Drop files here or click to browse"
|
|
733
729
|
) }),
|
|
734
|
-
se.length > 0 && !C && /* @__PURE__ */
|
|
730
|
+
se.length > 0 && !C && /* @__PURE__ */ r("p", { className: "type-meta ds:text-muted-foreground ds:text-center ds:m-0", children: se.join(" · ") })
|
|
735
731
|
] }),
|
|
736
732
|
g === "both" && !C && /* @__PURE__ */ m(
|
|
737
733
|
"button",
|
|
@@ -745,8 +741,8 @@ const ss = Ne(
|
|
|
745
741
|
className: "ds:mt-[var(--spacing-xs)]"
|
|
746
742
|
}),
|
|
747
743
|
children: [
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
o("
|
|
744
|
+
/* @__PURE__ */ r(T, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
745
|
+
o("inputs.fileUpload.browse", "Browse files")
|
|
750
746
|
]
|
|
751
747
|
}
|
|
752
748
|
)
|
|
@@ -755,11 +751,11 @@ const ss = Ne(
|
|
|
755
751
|
}
|
|
756
752
|
);
|
|
757
753
|
}, ye = () => g === "dropzone" ? null : g === "button" ? /* @__PURE__ */ m("div", { onPaste: ee, ref: j, children: [
|
|
758
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ r(
|
|
759
755
|
"input",
|
|
760
756
|
{
|
|
761
757
|
...J({
|
|
762
|
-
"aria-label": o("
|
|
758
|
+
"aria-label": o("inputs.fileUpload.browse", "Browse files")
|
|
763
759
|
})
|
|
764
760
|
}
|
|
765
761
|
),
|
|
@@ -775,8 +771,8 @@ const ss = Ne(
|
|
|
775
771
|
"aria-invalid": g === "button" && v.invalid || void 0,
|
|
776
772
|
"aria-required": g === "button" && v.required || void 0,
|
|
777
773
|
children: [
|
|
778
|
-
/* @__PURE__ */
|
|
779
|
-
o("
|
|
774
|
+
/* @__PURE__ */ r(T, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
775
|
+
o("inputs.fileUpload.browse", "Browse files")
|
|
780
776
|
]
|
|
781
777
|
}
|
|
782
778
|
)
|
|
@@ -785,7 +781,7 @@ const ss = Ne(
|
|
|
785
781
|
be(),
|
|
786
782
|
ye(),
|
|
787
783
|
ve(),
|
|
788
|
-
te.length > 0 && /* @__PURE__ */
|
|
784
|
+
te.length > 0 && /* @__PURE__ */ r(
|
|
789
785
|
"div",
|
|
790
786
|
{
|
|
791
787
|
role: "alert",
|
|
@@ -795,21 +791,21 @@ const ss = Ne(
|
|
|
795
791
|
{
|
|
796
792
|
className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
797
793
|
children: [
|
|
798
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ r(
|
|
799
795
|
le,
|
|
800
796
|
{
|
|
801
797
|
"aria-hidden": "true",
|
|
802
798
|
className: "ds:size-3.5 ds:shrink-0 ds:text-destructive"
|
|
803
799
|
}
|
|
804
800
|
),
|
|
805
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ r("p", { className: "type-meta ds:text-destructive ds:m-0", children: e })
|
|
806
802
|
]
|
|
807
803
|
},
|
|
808
804
|
s
|
|
809
805
|
))
|
|
810
806
|
}
|
|
811
807
|
),
|
|
812
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ r(
|
|
813
809
|
"span",
|
|
814
810
|
{
|
|
815
811
|
ref: O,
|
|
@@ -826,4 +822,4 @@ export {
|
|
|
826
822
|
ss as F,
|
|
827
823
|
Pe as f
|
|
828
824
|
};
|
|
829
|
-
//# sourceMappingURL=file-upload-
|
|
825
|
+
//# sourceMappingURL=file-upload-DIecAfC-.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
|