@opencxh/ui-kit 3.128.0 → 3.132.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/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +738 -687
- package/dist/index.js.map +1 -1
- package/dist/src/content/RichText.d.ts +14 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { clsx as
|
|
1
|
+
import { clsx as We } from "clsx";
|
|
2
2
|
import { jsxs as c, jsx as e, Fragment as xe } from "react/jsx-runtime";
|
|
3
|
-
import { VideoOff as
|
|
4
|
-
import oe, { useRef as se, useEffect as Q, forwardRef as me, useState as
|
|
3
|
+
import { VideoOff as Ke, User as Ge, MicOff as Je, Mic as Ye, X as we, ChevronDown as ge, ExternalLink as Xe, Calendar as Ze, ChevronLeft as ke, ChevronRight as Ce, ChevronDownIcon as Qe, Loader2 as et, Search as Se, Check as Te, ChevronUp as tt, ChevronsLeft as rt, ChevronsRight as nt, FileText as Ee, HardDrive as _e, ArrowLeft as st, FolderPlus as at, Upload as lt, Folder as Ae, Trash2 as ot, Plus as ct, Sparkles as it, ImageOff as dt, Pencil as ut, ArrowUpRight as mt } from "lucide-react";
|
|
4
|
+
import oe, { useRef as se, useEffect as Q, forwardRef as me, useState as F, useLayoutEffect as ft, useMemo as he, useCallback as ue, createContext as ht, Component as xt } from "react";
|
|
5
|
+
import bt from "dompurify";
|
|
6
|
+
import pt from "react-markdown";
|
|
7
|
+
import gt from "remark-gfm";
|
|
5
8
|
function d(...t) {
|
|
6
|
-
return
|
|
9
|
+
return We(t);
|
|
7
10
|
}
|
|
8
|
-
function
|
|
11
|
+
function tn(t) {
|
|
9
12
|
return (r, n) => t[r]?.[n] || "";
|
|
10
13
|
}
|
|
11
|
-
function
|
|
14
|
+
function rn(t) {
|
|
12
15
|
return (r) => t[r] || "";
|
|
13
16
|
}
|
|
14
|
-
function
|
|
17
|
+
function nn({ tiles: t, pinned: r, className: n }) {
|
|
15
18
|
if (r)
|
|
16
19
|
return /* @__PURE__ */ c("div", { className: d("flex flex-col md:flex-row gap-2 h-full min-h-0", n), children: [
|
|
17
20
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-0", children: r }),
|
|
@@ -20,7 +23,7 @@ function Gr({ tiles: t, pinned: r, className: n }) {
|
|
|
20
23
|
const s = t.length <= 1 ? "grid-cols-1" : t.length <= 4 ? "grid-cols-2" : t.length <= 9 ? "grid-cols-3" : "grid-cols-4";
|
|
21
24
|
return /* @__PURE__ */ e("div", { className: d("grid gap-2 h-full", s, n), children: t.map((a, o) => /* @__PURE__ */ e("div", { children: a }, o)) });
|
|
22
25
|
}
|
|
23
|
-
function
|
|
26
|
+
function sn({
|
|
24
27
|
name: t,
|
|
25
28
|
avatarUrl: r,
|
|
26
29
|
muted: n,
|
|
@@ -40,7 +43,7 @@ function Jr({
|
|
|
40
43
|
l
|
|
41
44
|
),
|
|
42
45
|
children: [
|
|
43
|
-
a && o ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: o }) : /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: r ? /* @__PURE__ */ e("img", { src: r, alt: t, className: "w-16 h-16 rounded-full object-cover" }) : /* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-video-surface-strong flex items-center justify-center", children: a ? /* @__PURE__ */ e(
|
|
46
|
+
a && o ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: o }) : /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: r ? /* @__PURE__ */ e("img", { src: r, alt: t, className: "w-16 h-16 rounded-full object-cover" }) : /* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-video-surface-strong flex items-center justify-center", children: a ? /* @__PURE__ */ e(Ke, { className: "w-8 h-8" }) : /* @__PURE__ */ e(Ge, { className: "w-8 h-8" }) }) }),
|
|
44
47
|
/* @__PURE__ */ c("div", { className: "absolute bottom-2 left-2 flex items-center gap-1.5 px-2 py-1 rounded bg-video-overlay text-white text-xs", children: [
|
|
45
48
|
n ? /* @__PURE__ */ e(Je, { className: "w-3 h-3" }) : /* @__PURE__ */ e(Ye, { className: "w-3 h-3" }),
|
|
46
49
|
/* @__PURE__ */ e("span", { className: "truncate max-w-35", children: t })
|
|
@@ -49,7 +52,7 @@ function Jr({
|
|
|
49
52
|
}
|
|
50
53
|
);
|
|
51
54
|
}
|
|
52
|
-
function
|
|
55
|
+
function an({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
|
|
53
56
|
const a = se(null);
|
|
54
57
|
return Q(() => {
|
|
55
58
|
if (!r || !a.current) return;
|
|
@@ -69,7 +72,7 @@ function Yr({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
|
|
|
69
72
|
}
|
|
70
73
|
);
|
|
71
74
|
}
|
|
72
|
-
const
|
|
75
|
+
const vt = {
|
|
73
76
|
primary: "bg-accent text-accent-fg hover:bg-accent-hover disabled:bg-surface-hover",
|
|
74
77
|
secondary: "bg-gray-100 text-text hover:bg-surface-hover disabled:bg-surface-hover",
|
|
75
78
|
// No resting fill, so no disabled fill either — a greyed-out plate where
|
|
@@ -82,7 +85,7 @@ const bt = {
|
|
|
82
85
|
success: "bg-success text-text-inverse hover:opacity-90 disabled:bg-surface-hover",
|
|
83
86
|
warning: "bg-warning text-text-inverse hover:opacity-90 disabled:bg-surface-hover",
|
|
84
87
|
"danger-solid": "bg-danger text-text-inverse hover:opacity-90 disabled:bg-surface-hover"
|
|
85
|
-
},
|
|
88
|
+
}, yt = {
|
|
86
89
|
xs: "h-control-xs px-2 text-xs",
|
|
87
90
|
sm: "h-control-sm px-3 text-sm",
|
|
88
91
|
md: "h-control-md px-4 text-sm",
|
|
@@ -90,7 +93,7 @@ const bt = {
|
|
|
90
93
|
xl: "h-control-xl px-6 text-base",
|
|
91
94
|
"2xl": "h-control-2xl px-6 text-base",
|
|
92
95
|
full: "h-control-md px-4 text-sm"
|
|
93
|
-
},
|
|
96
|
+
}, Nt = {
|
|
94
97
|
xs: "h-control-xs w-6",
|
|
95
98
|
sm: "h-control-sm w-7",
|
|
96
99
|
md: "h-control-md w-8",
|
|
@@ -126,8 +129,8 @@ const bt = {
|
|
|
126
129
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
127
130
|
"disabled:cursor-not-allowed disabled:border-border-subtle",
|
|
128
131
|
"disabled:text-text-disabled",
|
|
129
|
-
|
|
130
|
-
l ?
|
|
132
|
+
vt[t],
|
|
133
|
+
l ? Nt[r] : yt[r],
|
|
131
134
|
(n || r === "full") && "w-full",
|
|
132
135
|
s && "cursor-wait",
|
|
133
136
|
m
|
|
@@ -153,7 +156,7 @@ const bt = {
|
|
|
153
156
|
}
|
|
154
157
|
);
|
|
155
158
|
ne.displayName = "Button";
|
|
156
|
-
const
|
|
159
|
+
const ln = ({
|
|
157
160
|
children: t,
|
|
158
161
|
size: r = "md",
|
|
159
162
|
orientation: n = "horizontal",
|
|
@@ -183,7 +186,7 @@ const Xr = ({
|
|
|
183
186
|
a
|
|
184
187
|
);
|
|
185
188
|
return /* @__PURE__ */ e("div", { className: o, role: "group", children: t });
|
|
186
|
-
},
|
|
189
|
+
}, wt = {
|
|
187
190
|
primary: "text-text",
|
|
188
191
|
secondary: "text-text-muted",
|
|
189
192
|
accent: "text-accent",
|
|
@@ -203,9 +206,9 @@ const Xr = ({
|
|
|
203
206
|
"aria-label": l,
|
|
204
207
|
...u
|
|
205
208
|
}) => {
|
|
206
|
-
const m = typeof r == "number" ? r :
|
|
209
|
+
const m = typeof r == "number" ? r : kt(r), y = d(
|
|
207
210
|
"inline-block shrink-0",
|
|
208
|
-
|
|
211
|
+
wt[n],
|
|
209
212
|
s && [
|
|
210
213
|
"cursor-pointer rounded-sm transition-opacity duration-fast ease-out hover:opacity-80",
|
|
211
214
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
@@ -227,7 +230,7 @@ const Xr = ({
|
|
|
227
230
|
};
|
|
228
231
|
return /* @__PURE__ */ e(t, { ...h });
|
|
229
232
|
};
|
|
230
|
-
function
|
|
233
|
+
function kt(t) {
|
|
231
234
|
return {
|
|
232
235
|
xs: 12,
|
|
233
236
|
sm: 14,
|
|
@@ -236,14 +239,14 @@ function yt(t) {
|
|
|
236
239
|
xl: 24
|
|
237
240
|
}[t];
|
|
238
241
|
}
|
|
239
|
-
const
|
|
242
|
+
const Ct = {
|
|
240
243
|
none: "border-none hover:bg-surface-hover hover:text-text",
|
|
241
244
|
default: "border-border text-text-muted hover:bg-surface-hover hover:text-text",
|
|
242
245
|
muted: "border-border text-text-subtle hover:bg-surface-hover hover:text-text",
|
|
243
246
|
warning: "border-warning-border bg-warning-soft text-warning-fg hover:bg-surface-hover",
|
|
244
247
|
danger: "border-danger-border bg-danger-soft text-danger-fg hover:bg-surface-hover"
|
|
245
248
|
};
|
|
246
|
-
function
|
|
249
|
+
function on({
|
|
247
250
|
label: t,
|
|
248
251
|
icon: r,
|
|
249
252
|
tone: n = "default",
|
|
@@ -264,7 +267,7 @@ function Zr({
|
|
|
264
267
|
"transition-colors duration-fast ease-out",
|
|
265
268
|
p,
|
|
266
269
|
// Picking a value outranks whatever the value happens to mean.
|
|
267
|
-
o ? "bg-accent text-accent-fg" : d("border",
|
|
270
|
+
o ? "bg-accent text-accent-fg" : d("border", Ct[n]),
|
|
268
271
|
f
|
|
269
272
|
), g = /* @__PURE__ */ c(xe, { children: [
|
|
270
273
|
r,
|
|
@@ -290,13 +293,13 @@ function Zr({
|
|
|
290
293
|
)
|
|
291
294
|
] }) : /* @__PURE__ */ e("button", { type: "button", title: h, onClick: y, className: d(w, b), children: g });
|
|
292
295
|
}
|
|
293
|
-
const
|
|
296
|
+
const St = {
|
|
294
297
|
xs: "text-xs",
|
|
295
298
|
sm: "text-sm",
|
|
296
299
|
md: "text-base",
|
|
297
300
|
lg: "text-md",
|
|
298
301
|
xl: "text-lg"
|
|
299
|
-
},
|
|
302
|
+
}, zt = {
|
|
300
303
|
primary: "text-text hover:text-info-fg hover:underline",
|
|
301
304
|
info: "text-info-fg hover:underline",
|
|
302
305
|
secondary: "text-text-muted hover:text-text",
|
|
@@ -305,7 +308,7 @@ const wt = {
|
|
|
305
308
|
success: "text-success-fg hover:underline",
|
|
306
309
|
warning: "text-warning-fg hover:underline",
|
|
307
310
|
error: "text-danger-fg hover:underline"
|
|
308
|
-
},
|
|
311
|
+
}, Et = {
|
|
309
312
|
primary: "bg-accent-soft",
|
|
310
313
|
accent: "bg-accent-soft",
|
|
311
314
|
secondary: "bg-surface-hover",
|
|
@@ -314,7 +317,7 @@ const wt = {
|
|
|
314
317
|
warning: "bg-warning-soft",
|
|
315
318
|
error: "bg-danger-soft",
|
|
316
319
|
info: "bg-info-soft"
|
|
317
|
-
},
|
|
320
|
+
}, cn = ({
|
|
318
321
|
variant: t = "default",
|
|
319
322
|
size: r = "md",
|
|
320
323
|
color: n = "primary",
|
|
@@ -331,13 +334,13 @@ const wt = {
|
|
|
331
334
|
"inline-flex items-center gap-1 underline-offset-2",
|
|
332
335
|
"transition-colors duration-fast ease-out",
|
|
333
336
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
334
|
-
|
|
335
|
-
!s &&
|
|
337
|
+
St[r],
|
|
338
|
+
!s && zt[n],
|
|
336
339
|
t === "subtle" && "no-underline opacity-70 hover:opacity-100",
|
|
337
340
|
t === "underline" && "underline decoration-1 hover:decoration-2",
|
|
338
341
|
t === "button" && [
|
|
339
342
|
"h-control-md rounded-md px-3 font-semibold no-underline hover:no-underline",
|
|
340
|
-
|
|
343
|
+
Et[n]
|
|
341
344
|
],
|
|
342
345
|
s && "pointer-events-none cursor-not-allowed text-text-disabled opacity-50",
|
|
343
346
|
o
|
|
@@ -352,11 +355,11 @@ const wt = {
|
|
|
352
355
|
l,
|
|
353
356
|
f && /* @__PURE__ */ e(Xe, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
|
|
354
357
|
] });
|
|
355
|
-
},
|
|
358
|
+
}, Mt = {
|
|
356
359
|
sm: "h-control-sm px-3 text-sm",
|
|
357
360
|
md: "h-control-md px-3 text-sm"
|
|
358
361
|
};
|
|
359
|
-
function
|
|
362
|
+
function dn({
|
|
360
363
|
options: t,
|
|
361
364
|
value: r,
|
|
362
365
|
onChange: n,
|
|
@@ -383,7 +386,7 @@ function en({
|
|
|
383
386
|
"inline-flex items-center justify-center rounded-sm",
|
|
384
387
|
"transition-colors duration-fast ease-out",
|
|
385
388
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
386
|
-
|
|
389
|
+
Mt[s],
|
|
387
390
|
u ? "bg-surface text-text font-semibold" : "text-text-muted hover:text-text"
|
|
388
391
|
),
|
|
389
392
|
children: l.label
|
|
@@ -395,7 +398,7 @@ function en({
|
|
|
395
398
|
);
|
|
396
399
|
}
|
|
397
400
|
function ze(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start" } = {}) {
|
|
398
|
-
const [o, l] =
|
|
401
|
+
const [o, l] = F({});
|
|
399
402
|
return ft(() => {
|
|
400
403
|
if (!t) return;
|
|
401
404
|
const u = () => {
|
|
@@ -409,7 +412,7 @@ function ze(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start
|
|
|
409
412
|
};
|
|
410
413
|
}, [t, r, n, s, a]), o;
|
|
411
414
|
}
|
|
412
|
-
const
|
|
415
|
+
const $t = ({
|
|
413
416
|
trigger: t,
|
|
414
417
|
children: r,
|
|
415
418
|
placement: n = "bottom-start",
|
|
@@ -419,13 +422,13 @@ const zt = ({
|
|
|
419
422
|
disabled: l = !1,
|
|
420
423
|
triggerLabel: u
|
|
421
424
|
}) => {
|
|
422
|
-
const [m, y] =
|
|
425
|
+
const [m, y] = F(!1), h = se(null), f = se(null), x = ze(m, f, { placement: n });
|
|
423
426
|
Q(() => {
|
|
424
427
|
if (!m) return;
|
|
425
|
-
const g = (
|
|
426
|
-
h.current && !h.current.contains(
|
|
427
|
-
}, b = (
|
|
428
|
-
|
|
428
|
+
const g = (A) => {
|
|
429
|
+
h.current && !h.current.contains(A.target) && y(!1);
|
|
430
|
+
}, b = (A) => {
|
|
431
|
+
A.key === "Escape" && y(!1);
|
|
429
432
|
};
|
|
430
433
|
return document.addEventListener("mousedown", g), document.addEventListener("keydown", b), () => {
|
|
431
434
|
document.removeEventListener("mousedown", g), document.removeEventListener("keydown", b);
|
|
@@ -466,15 +469,15 @@ const zt = ({
|
|
|
466
469
|
}
|
|
467
470
|
)
|
|
468
471
|
] });
|
|
469
|
-
},
|
|
472
|
+
}, Dt = {
|
|
470
473
|
primary: "bg-accent text-accent-fg hover:bg-accent-hover",
|
|
471
474
|
secondary: "border border-border bg-surface text-text hover:bg-surface-hover",
|
|
472
475
|
outline: "border border-accent-border text-accent hover:bg-accent-soft"
|
|
473
|
-
},
|
|
476
|
+
}, Tt = {
|
|
474
477
|
sm: "h-control-sm w-7",
|
|
475
478
|
md: "h-control-md w-8"
|
|
476
479
|
};
|
|
477
|
-
function
|
|
480
|
+
function Fe({
|
|
478
481
|
label: t,
|
|
479
482
|
onClick: r,
|
|
480
483
|
variant: n = "primary",
|
|
@@ -502,7 +505,7 @@ function Re({
|
|
|
502
505
|
}
|
|
503
506
|
),
|
|
504
507
|
f && /* @__PURE__ */ e(
|
|
505
|
-
|
|
508
|
+
$t,
|
|
506
509
|
{
|
|
507
510
|
placement: m,
|
|
508
511
|
disabled: h,
|
|
@@ -515,8 +518,8 @@ function Re({
|
|
|
515
518
|
className: d(
|
|
516
519
|
"inline-flex items-center justify-center rounded-md rounded-l-none",
|
|
517
520
|
"transition-colors duration-fast ease-out",
|
|
518
|
-
|
|
519
|
-
|
|
521
|
+
Dt[n],
|
|
522
|
+
Tt[s],
|
|
520
523
|
h && "cursor-not-allowed opacity-50"
|
|
521
524
|
),
|
|
522
525
|
children: /* @__PURE__ */ e(ge, { className: "size-icon-md" })
|
|
@@ -546,17 +549,17 @@ function Re({
|
|
|
546
549
|
)
|
|
547
550
|
] });
|
|
548
551
|
}
|
|
549
|
-
const
|
|
552
|
+
const _t = {
|
|
550
553
|
sm: "size-checkbox-sm",
|
|
551
554
|
md: "size-checkbox",
|
|
552
555
|
lg: "size-checkbox-lg",
|
|
553
556
|
full: "size-checkbox"
|
|
554
|
-
},
|
|
557
|
+
}, At = {
|
|
555
558
|
sm: "min-h-control-sm",
|
|
556
559
|
md: "min-h-control-md",
|
|
557
560
|
lg: "min-h-control-lg",
|
|
558
561
|
full: "min-h-control-md"
|
|
559
|
-
},
|
|
562
|
+
}, Lt = {
|
|
560
563
|
sm: "text-sm",
|
|
561
564
|
md: "text-base",
|
|
562
565
|
lg: "text-md",
|
|
@@ -583,7 +586,7 @@ const $t = {
|
|
|
583
586
|
return oe.useEffect(() => {
|
|
584
587
|
w.current && (w.current.indeterminate = a);
|
|
585
588
|
}, [a]), /* @__PURE__ */ c("div", { className: d("flex flex-col", o), children: [
|
|
586
|
-
/* @__PURE__ */ c("div", { className: d("flex items-center gap-3",
|
|
589
|
+
/* @__PURE__ */ c("div", { className: d("flex items-center gap-3", At[s]), children: [
|
|
587
590
|
/* @__PURE__ */ e(
|
|
588
591
|
"input",
|
|
589
592
|
{
|
|
@@ -598,7 +601,7 @@ const $t = {
|
|
|
598
601
|
"transition-colors duration-fast ease-out",
|
|
599
602
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
600
603
|
"disabled:cursor-not-allowed disabled:bg-surface-hover",
|
|
601
|
-
|
|
604
|
+
_t[s],
|
|
602
605
|
p ? "border-danger-border" : "border-border-strong",
|
|
603
606
|
u
|
|
604
607
|
),
|
|
@@ -613,7 +616,7 @@ const $t = {
|
|
|
613
616
|
className: d(
|
|
614
617
|
"cursor-pointer",
|
|
615
618
|
p ? "text-danger-fg" : "text-text",
|
|
616
|
-
|
|
619
|
+
Lt[s],
|
|
617
620
|
l
|
|
618
621
|
),
|
|
619
622
|
children: t
|
|
@@ -627,7 +630,7 @@ const $t = {
|
|
|
627
630
|
}
|
|
628
631
|
);
|
|
629
632
|
pe.displayName = "Checkbox";
|
|
630
|
-
const
|
|
633
|
+
const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }), jt = () => /* @__PURE__ */ e(Y, { icon: ke, size: "md", color: "current" }), Pt = () => /* @__PURE__ */ e(Y, { icon: Ce, size: "md", color: "current" }), $e = me(({
|
|
631
634
|
value: t,
|
|
632
635
|
onChange: r,
|
|
633
636
|
placeholder: n = "Select date",
|
|
@@ -640,7 +643,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
640
643
|
format: y = "MM/dd/yyyy",
|
|
641
644
|
withTime: h = !1
|
|
642
645
|
}, f) => {
|
|
643
|
-
const [x, p] =
|
|
646
|
+
const [x, p] = F(!1), [w, g] = F(() => t || /* @__PURE__ */ new Date()), b = se(null), A = se(null), _ = ze(x, A);
|
|
644
647
|
Q(() => {
|
|
645
648
|
const i = (S) => {
|
|
646
649
|
b.current && !b.current.contains(S.target) && p(!1);
|
|
@@ -649,7 +652,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
649
652
|
document.removeEventListener("mousedown", i);
|
|
650
653
|
};
|
|
651
654
|
}, [x]);
|
|
652
|
-
const
|
|
655
|
+
const K = (i) => {
|
|
653
656
|
if (!i) return "";
|
|
654
657
|
const S = i.getDate().toString().padStart(2, "0"), N = (i.getMonth() + 1).toString().padStart(2, "0"), T = i.getFullYear(), k = y === "dd/MM/yyyy" ? `${S}/${N}/${T}` : y === "yyyy-MM-dd" ? `${T}-${N}-${S}` : `${N}/${S}/${T}`;
|
|
655
658
|
return h ? `${k} ${$(i)}` : k;
|
|
@@ -658,14 +661,14 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
658
661
|
if (Number.isNaN(S) || Number.isNaN(N)) return;
|
|
659
662
|
const T = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
660
663
|
T.setHours(S, N, 0, 0), r?.(T);
|
|
661
|
-
},
|
|
664
|
+
}, U = () => {
|
|
662
665
|
const i = w.getFullYear(), S = w.getMonth(), N = new Date(i, S, 1), T = new Date(N);
|
|
663
666
|
T.setDate(T.getDate() - N.getDay());
|
|
664
667
|
const k = [], ee = new Date(T);
|
|
665
668
|
for (let ae = 0; ae < 42; ae++)
|
|
666
669
|
k.push(new Date(ee)), ee.setDate(ee.getDate() + 1);
|
|
667
670
|
return k;
|
|
668
|
-
},
|
|
671
|
+
}, I = (i) => {
|
|
669
672
|
if (i.getMonth() === w.getMonth() && !(u && i < u) && !(m && i > m)) {
|
|
670
673
|
if (h) {
|
|
671
674
|
const N = new Date(i);
|
|
@@ -676,11 +679,11 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
676
679
|
}
|
|
677
680
|
}, q = () => {
|
|
678
681
|
g(new Date(w.getFullYear(), w.getMonth() - 1, 1));
|
|
679
|
-
},
|
|
682
|
+
}, W = () => {
|
|
680
683
|
g(new Date(w.getFullYear(), w.getMonth() + 1, 1));
|
|
681
684
|
}, re = () => {
|
|
682
685
|
r?.(null), p(!1);
|
|
683
|
-
},
|
|
686
|
+
}, P = d(
|
|
684
687
|
"w-full border border-border rounded-md transition-colors duration-fast",
|
|
685
688
|
"bg-surface text-text",
|
|
686
689
|
"placeholder:text-text-muted",
|
|
@@ -693,7 +696,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
693
696
|
"h-control-md w-full px-3 text-base": o === "full"
|
|
694
697
|
},
|
|
695
698
|
l
|
|
696
|
-
), ce =
|
|
699
|
+
), ce = U(), C = [
|
|
697
700
|
"January",
|
|
698
701
|
"February",
|
|
699
702
|
"March",
|
|
@@ -708,19 +711,19 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
708
711
|
"December"
|
|
709
712
|
];
|
|
710
713
|
return /* @__PURE__ */ c("div", { ref: b, className: "relative", children: [
|
|
711
|
-
/* @__PURE__ */ c("div", { ref:
|
|
714
|
+
/* @__PURE__ */ c("div", { ref: A, className: "relative", children: [
|
|
712
715
|
/* @__PURE__ */ e(
|
|
713
716
|
"input",
|
|
714
717
|
{
|
|
715
718
|
ref: f,
|
|
716
719
|
type: "text",
|
|
717
|
-
value:
|
|
720
|
+
value: K(t ?? null),
|
|
718
721
|
placeholder: n,
|
|
719
722
|
disabled: s,
|
|
720
723
|
required: a,
|
|
721
724
|
readOnly: !0,
|
|
722
725
|
onClick: () => !s && p(!x),
|
|
723
|
-
className: d(
|
|
726
|
+
className: d(P, "pr-10 cursor-pointer")
|
|
724
727
|
}
|
|
725
728
|
),
|
|
726
729
|
/* @__PURE__ */ e(
|
|
@@ -730,18 +733,18 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
730
733
|
onClick: () => !s && p(!x),
|
|
731
734
|
disabled: s,
|
|
732
735
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted hover:text-text-muted",
|
|
733
|
-
children: /* @__PURE__ */ e(
|
|
736
|
+
children: /* @__PURE__ */ e(It, {})
|
|
734
737
|
}
|
|
735
738
|
)
|
|
736
739
|
] }),
|
|
737
|
-
x && /* @__PURE__ */ c("div", { style:
|
|
740
|
+
x && /* @__PURE__ */ c("div", { style: _, className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
738
741
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
|
|
739
742
|
/* @__PURE__ */ e(
|
|
740
743
|
"button",
|
|
741
744
|
{
|
|
742
745
|
onClick: q,
|
|
743
746
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
744
|
-
children: /* @__PURE__ */ e(
|
|
747
|
+
children: /* @__PURE__ */ e(jt, {})
|
|
745
748
|
}
|
|
746
749
|
),
|
|
747
750
|
/* @__PURE__ */ c("h3", { className: "text-sm font-medium text-text", children: [
|
|
@@ -752,9 +755,9 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
752
755
|
/* @__PURE__ */ e(
|
|
753
756
|
"button",
|
|
754
757
|
{
|
|
755
|
-
onClick:
|
|
758
|
+
onClick: W,
|
|
756
759
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
757
|
-
children: /* @__PURE__ */ e(
|
|
760
|
+
children: /* @__PURE__ */ e(Pt, {})
|
|
758
761
|
}
|
|
759
762
|
)
|
|
760
763
|
] }),
|
|
@@ -764,7 +767,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
764
767
|
return /* @__PURE__ */ e(
|
|
765
768
|
"button",
|
|
766
769
|
{
|
|
767
|
-
onClick: () => !ee &&
|
|
770
|
+
onClick: () => !ee && I(i),
|
|
768
771
|
disabled: ee,
|
|
769
772
|
className: d(
|
|
770
773
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
@@ -813,7 +816,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
813
816
|
] })
|
|
814
817
|
] })
|
|
815
818
|
] });
|
|
816
|
-
}),
|
|
819
|
+
}), Ot = {
|
|
817
820
|
sm: "h-control-sm px-3 text-sm",
|
|
818
821
|
md: "h-control-md px-3 text-sm",
|
|
819
822
|
lg: "h-control-lg px-3 text-base",
|
|
@@ -837,13 +840,13 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
837
840
|
value: w,
|
|
838
841
|
onChange: g,
|
|
839
842
|
allowCreate: b,
|
|
840
|
-
onCreateOption:
|
|
841
|
-
...
|
|
842
|
-
},
|
|
843
|
-
const $ = f || `select-${Math.random().toString(36).substr(2, 9)}`, X = !!n, [
|
|
844
|
-
oe.useImperativeHandle(
|
|
843
|
+
onCreateOption: A,
|
|
844
|
+
..._
|
|
845
|
+
}, K) => {
|
|
846
|
+
const $ = f || `select-${Math.random().toString(36).substr(2, 9)}`, X = !!n, [U, I] = oe.useState(!1), [q, W] = oe.useState(""), re = oe.useRef(null), P = oe.useRef(null), ce = ze(U, P, { matchWidth: !0 }), [C, i] = oe.useState(l);
|
|
847
|
+
oe.useImperativeHandle(K, () => re.current), oe.useEffect(() => {
|
|
845
848
|
const E = (D) => {
|
|
846
|
-
re.current && !re.current.contains(D.target) &&
|
|
849
|
+
re.current && !re.current.contains(D.target) && I(!1);
|
|
847
850
|
};
|
|
848
851
|
return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
|
|
849
852
|
}, []);
|
|
@@ -854,11 +857,11 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
854
857
|
[]
|
|
855
858
|
), N = oe.useCallback(
|
|
856
859
|
(E, D) => {
|
|
857
|
-
const z = [...E],
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
+
const z = [...E], R = (B) => {
|
|
861
|
+
const V = (B ?? "").trim();
|
|
862
|
+
V && (S(z, V) || z.push({ value: V, label: V }));
|
|
860
863
|
};
|
|
861
|
-
return Array.isArray(D) ? D.forEach(
|
|
864
|
+
return Array.isArray(D) ? D.forEach(R) : R(D), z;
|
|
862
865
|
},
|
|
863
866
|
[S]
|
|
864
867
|
);
|
|
@@ -872,10 +875,10 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
872
875
|
}, [l, w, N, S]);
|
|
873
876
|
const T = (E) => {
|
|
874
877
|
if (p) {
|
|
875
|
-
const D = Array.isArray(w) ? w : [], z = D.includes(E) ? D.filter((
|
|
878
|
+
const D = Array.isArray(w) ? w : [], z = D.includes(E) ? D.filter((R) => R !== E) : [...D, E];
|
|
876
879
|
g?.(z);
|
|
877
880
|
} else
|
|
878
|
-
g?.(E),
|
|
881
|
+
g?.(E), I(!1), W("");
|
|
879
882
|
}, k = p ? null : C.find((E) => E.value === w), ee = p ? C.filter(
|
|
880
883
|
(E) => Array.isArray(w) && w.includes(E.value)
|
|
881
884
|
) : [], ae = x && q ? C.filter(
|
|
@@ -883,16 +886,16 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
883
886
|
) : C, le = !!b && !!x && !!q.trim() && !S(C, q), G = (E) => {
|
|
884
887
|
const D = E.trim();
|
|
885
888
|
if (!D) return;
|
|
886
|
-
const z =
|
|
889
|
+
const z = A?.(D) ?? {
|
|
887
890
|
value: D,
|
|
888
891
|
label: D
|
|
889
892
|
};
|
|
890
893
|
if (S(C, z.value) || S(C, z.label)) {
|
|
891
|
-
T(z.value),
|
|
894
|
+
T(z.value), W(""), p || I(!1);
|
|
892
895
|
return;
|
|
893
896
|
}
|
|
894
|
-
i((
|
|
895
|
-
},
|
|
897
|
+
i((R) => [...R, z]), T(z.value), W(""), p || I(!1);
|
|
898
|
+
}, j = () => p ? ee.length > 0 ? ee.map((E) => E.label).join(", ") : u || "Select options" : k?.label || u || "Select an option";
|
|
896
899
|
return /* @__PURE__ */ c(
|
|
897
900
|
"div",
|
|
898
901
|
{
|
|
@@ -902,13 +905,13 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
902
905
|
a && "w-full",
|
|
903
906
|
m
|
|
904
907
|
),
|
|
905
|
-
...
|
|
908
|
+
..._,
|
|
906
909
|
children: [
|
|
907
910
|
t && /* @__PURE__ */ e(
|
|
908
911
|
"label",
|
|
909
912
|
{
|
|
910
913
|
htmlFor: $,
|
|
911
|
-
onClick: () =>
|
|
914
|
+
onClick: () => I(!U),
|
|
912
915
|
className: d(
|
|
913
916
|
"block text-xs font-semibold uppercase tracking-label mb-1.5",
|
|
914
917
|
X ? "text-danger-fg" : "text-text-muted",
|
|
@@ -921,43 +924,43 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
921
924
|
/* @__PURE__ */ c(
|
|
922
925
|
"button",
|
|
923
926
|
{
|
|
924
|
-
ref:
|
|
927
|
+
ref: P,
|
|
925
928
|
type: "button",
|
|
926
929
|
id: $,
|
|
927
930
|
disabled: o,
|
|
928
|
-
onClick: () =>
|
|
931
|
+
onClick: () => I(!U),
|
|
929
932
|
className: d(
|
|
930
933
|
"flex w-full items-center justify-between gap-2 rounded-md border transition-colors duration-fast text-left",
|
|
931
934
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
932
935
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
933
936
|
"bg-surface",
|
|
934
|
-
|
|
937
|
+
Ot[s],
|
|
935
938
|
X ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
936
939
|
h
|
|
937
940
|
),
|
|
938
941
|
children: [
|
|
939
|
-
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children:
|
|
942
|
+
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children: j() }),
|
|
940
943
|
/* @__PURE__ */ e(
|
|
941
944
|
Qe,
|
|
942
945
|
{
|
|
943
946
|
size: 16,
|
|
944
947
|
className: d(
|
|
945
948
|
"shrink-0 opacity-60 transition-transform duration-fast",
|
|
946
|
-
|
|
949
|
+
U && "rotate-180"
|
|
947
950
|
)
|
|
948
951
|
}
|
|
949
952
|
)
|
|
950
953
|
]
|
|
951
954
|
}
|
|
952
955
|
),
|
|
953
|
-
|
|
956
|
+
U && /* @__PURE__ */ c("div", { style: ce, className: "fixed z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
|
|
954
957
|
x && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
955
958
|
"input",
|
|
956
959
|
{
|
|
957
960
|
type: "text",
|
|
958
961
|
placeholder: "Search...",
|
|
959
962
|
value: q,
|
|
960
|
-
onChange: (E) =>
|
|
963
|
+
onChange: (E) => W(E.target.value),
|
|
961
964
|
onKeyDown: (E) => {
|
|
962
965
|
E.key === "Enter" && le && (E.preventDefault(), G(q));
|
|
963
966
|
},
|
|
@@ -988,7 +991,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
988
991
|
{
|
|
989
992
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
990
993
|
onClick: () => {
|
|
991
|
-
g?.(""),
|
|
994
|
+
g?.(""), I(!1);
|
|
992
995
|
},
|
|
993
996
|
children: u
|
|
994
997
|
}
|
|
@@ -1040,12 +1043,12 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
1040
1043
|
}
|
|
1041
1044
|
);
|
|
1042
1045
|
Ne.displayName = "Select";
|
|
1043
|
-
const
|
|
1046
|
+
const Bt = {
|
|
1044
1047
|
sm: "h-control-sm px-3 text-sm",
|
|
1045
1048
|
md: "h-control-md px-3 text-base",
|
|
1046
1049
|
lg: "h-control-lg px-3 text-base",
|
|
1047
1050
|
full: "h-control-md px-3 text-base"
|
|
1048
|
-
},
|
|
1051
|
+
}, Re = "mb-1.5 block text-xs font-semibold uppercase tracking-label", be = me(
|
|
1049
1052
|
({
|
|
1050
1053
|
label: t,
|
|
1051
1054
|
helperText: r,
|
|
@@ -1061,14 +1064,14 @@ const Pt = {
|
|
|
1061
1064
|
id: f,
|
|
1062
1065
|
...x
|
|
1063
1066
|
}, p) => {
|
|
1064
|
-
const w = oe.useId(), g = f || `textfield-${w}`, b = !!n,
|
|
1067
|
+
const w = oe.useId(), g = f || `textfield-${w}`, b = !!n, A = n || r ? `${g}-description` : void 0;
|
|
1065
1068
|
return /* @__PURE__ */ c("div", { className: d("flex flex-col", a && "w-full", m), children: [
|
|
1066
1069
|
t && /* @__PURE__ */ e(
|
|
1067
1070
|
"label",
|
|
1068
1071
|
{
|
|
1069
1072
|
htmlFor: g,
|
|
1070
1073
|
className: d(
|
|
1071
|
-
|
|
1074
|
+
Re,
|
|
1072
1075
|
b ? "text-danger-fg" : "text-text-subtle",
|
|
1073
1076
|
y
|
|
1074
1077
|
),
|
|
@@ -1083,14 +1086,14 @@ const Pt = {
|
|
|
1083
1086
|
ref: p,
|
|
1084
1087
|
id: g,
|
|
1085
1088
|
"aria-invalid": b || void 0,
|
|
1086
|
-
"aria-describedby":
|
|
1089
|
+
"aria-describedby": A,
|
|
1087
1090
|
className: d(
|
|
1088
1091
|
"block w-full rounded-md border bg-surface-input text-text",
|
|
1089
1092
|
"transition-colors duration-fast ease-out",
|
|
1090
1093
|
"placeholder:text-text-subtle",
|
|
1091
1094
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
1092
1095
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
1093
|
-
|
|
1096
|
+
Bt[s],
|
|
1094
1097
|
o && "pl-9",
|
|
1095
1098
|
(l || u) && "pr-9",
|
|
1096
1099
|
b ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
@@ -1110,7 +1113,7 @@ const Pt = {
|
|
|
1110
1113
|
(n || r) && /* @__PURE__ */ e(
|
|
1111
1114
|
"p",
|
|
1112
1115
|
{
|
|
1113
|
-
id:
|
|
1116
|
+
id: A,
|
|
1114
1117
|
className: d("mt-1 text-xs", b ? "text-danger-fg" : "text-text-subtle"),
|
|
1115
1118
|
children: n || r
|
|
1116
1119
|
}
|
|
@@ -1119,7 +1122,7 @@ const Pt = {
|
|
|
1119
1122
|
}
|
|
1120
1123
|
);
|
|
1121
1124
|
be.displayName = "TextField";
|
|
1122
|
-
function
|
|
1125
|
+
function Ft({
|
|
1123
1126
|
value: t,
|
|
1124
1127
|
onChange: r,
|
|
1125
1128
|
onListFolders: n,
|
|
@@ -1129,7 +1132,7 @@ function Ot({
|
|
|
1129
1132
|
templatePlaceholder: l,
|
|
1130
1133
|
showTemplate: u = !0
|
|
1131
1134
|
}) {
|
|
1132
|
-
const [m, y] =
|
|
1135
|
+
const [m, y] = F([]);
|
|
1133
1136
|
Q(() => {
|
|
1134
1137
|
let f = !0;
|
|
1135
1138
|
return Promise.resolve(n?.()).then((x) => {
|
|
@@ -1164,7 +1167,7 @@ function Ot({
|
|
|
1164
1167
|
)
|
|
1165
1168
|
] });
|
|
1166
1169
|
}
|
|
1167
|
-
const fe = (...t) => t.filter(Boolean).join(" "),
|
|
1170
|
+
const fe = (...t) => t.filter(Boolean).join(" "), Rt = (t) => /* @__PURE__ */ e(Se, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Vt = (t) => /* @__PURE__ */ e(ge, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Ht = {
|
|
1168
1171
|
sm: "h-control-sm px-3 text-sm",
|
|
1169
1172
|
md: "h-control-md px-3 text-base",
|
|
1170
1173
|
lg: "h-control-lg px-3 text-base",
|
|
@@ -1174,14 +1177,14 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1174
1177
|
md: "h-5 w-5",
|
|
1175
1178
|
lg: "h-6 w-6",
|
|
1176
1179
|
full: "h-6 w-6"
|
|
1177
|
-
},
|
|
1180
|
+
}, qt = me(
|
|
1178
1181
|
({
|
|
1179
1182
|
label: t,
|
|
1180
1183
|
helperText: r,
|
|
1181
1184
|
error: n,
|
|
1182
1185
|
size: s = "md",
|
|
1183
1186
|
fullWidth: a = !1,
|
|
1184
|
-
startIcon: o = /* @__PURE__ */ e(
|
|
1187
|
+
startIcon: o = /* @__PURE__ */ e(Rt, {}),
|
|
1185
1188
|
loading: l = !1,
|
|
1186
1189
|
containerClassName: u,
|
|
1187
1190
|
labelClassName: m,
|
|
@@ -1193,18 +1196,18 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1193
1196
|
debounceTime: w = 500,
|
|
1194
1197
|
showAllOnOpen: g = !1,
|
|
1195
1198
|
value: b,
|
|
1196
|
-
onChange:
|
|
1197
|
-
...
|
|
1198
|
-
},
|
|
1199
|
-
const $ = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, X = !!n,
|
|
1199
|
+
onChange: A,
|
|
1200
|
+
..._
|
|
1201
|
+
}, K) => {
|
|
1202
|
+
const $ = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, X = !!n, U = se(null), I = se(null), [q, W] = F(b || ""), [re, P] = F(!1), [ce, C] = F(!1), [i, S] = F(!1);
|
|
1200
1203
|
Q(() => {
|
|
1201
|
-
b !== void 0 &&
|
|
1204
|
+
b !== void 0 && W(b);
|
|
1202
1205
|
}, [b]);
|
|
1203
1206
|
const N = he(() => {
|
|
1204
1207
|
if (g && !i || !q) return f;
|
|
1205
|
-
const
|
|
1208
|
+
const j = String(q).toLowerCase();
|
|
1206
1209
|
return f.filter(
|
|
1207
|
-
(E) => String(E.label).toLowerCase().includes(
|
|
1210
|
+
(E) => String(E.label).toLowerCase().includes(j)
|
|
1208
1211
|
);
|
|
1209
1212
|
}, [q, f, g, i]);
|
|
1210
1213
|
Q(() => {
|
|
@@ -1212,7 +1215,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1212
1215
|
C(!1);
|
|
1213
1216
|
return;
|
|
1214
1217
|
}
|
|
1215
|
-
const
|
|
1218
|
+
const j = setTimeout(async () => {
|
|
1216
1219
|
C(!0);
|
|
1217
1220
|
try {
|
|
1218
1221
|
await x(String(q));
|
|
@@ -1223,22 +1226,22 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1223
1226
|
}
|
|
1224
1227
|
}, w);
|
|
1225
1228
|
return () => {
|
|
1226
|
-
clearTimeout(
|
|
1229
|
+
clearTimeout(j), C(!1);
|
|
1227
1230
|
};
|
|
1228
1231
|
}, [q, w, x]), Q(() => {
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1232
|
+
const j = (E) => {
|
|
1233
|
+
U.current && !U.current.contains(E.target) && P(!1);
|
|
1231
1234
|
};
|
|
1232
|
-
return document.addEventListener("mousedown",
|
|
1235
|
+
return document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
|
|
1233
1236
|
}, []);
|
|
1234
|
-
const T = (
|
|
1235
|
-
const E =
|
|
1236
|
-
|
|
1237
|
-
}, k = (
|
|
1238
|
-
|
|
1237
|
+
const T = (j) => {
|
|
1238
|
+
const E = j.target.value;
|
|
1239
|
+
W(E), P(!0), S(!0), A && A(j);
|
|
1240
|
+
}, k = (j) => {
|
|
1241
|
+
W(j.label), P(!1), S(!1), p && p(j.value);
|
|
1239
1242
|
}, ee = () => {
|
|
1240
|
-
(f.length > 0 || x) && (
|
|
1241
|
-
}, ae = l || ce, le = re && (N.length > 0 || ae), G = he(() =>
|
|
1243
|
+
(f.length > 0 || x) && (P(!0), S(!1));
|
|
1244
|
+
}, ae = l || ce, le = re && (N.length > 0 || ae), G = he(() => K || I, [K]);
|
|
1242
1245
|
return /* @__PURE__ */ c(
|
|
1243
1246
|
"div",
|
|
1244
1247
|
{
|
|
@@ -1248,7 +1251,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1248
1251
|
u || "",
|
|
1249
1252
|
"relative"
|
|
1250
1253
|
),
|
|
1251
|
-
ref:
|
|
1254
|
+
ref: U,
|
|
1252
1255
|
children: [
|
|
1253
1256
|
t && /* @__PURE__ */ e(
|
|
1254
1257
|
"label",
|
|
@@ -1278,7 +1281,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1278
1281
|
"placeholder:text-text-subtle focus-visible:outline-none focus-visible:focus-ring",
|
|
1279
1282
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
1280
1283
|
// Size styles
|
|
1281
|
-
|
|
1284
|
+
Ht[s],
|
|
1282
1285
|
// Icon padding
|
|
1283
1286
|
o ? "pl-10" : "",
|
|
1284
1287
|
"pr-10",
|
|
@@ -1287,7 +1290,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1287
1290
|
X ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
1288
1291
|
y || ""
|
|
1289
1292
|
),
|
|
1290
|
-
...
|
|
1293
|
+
..._
|
|
1291
1294
|
}
|
|
1292
1295
|
),
|
|
1293
1296
|
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: ae || l ? (
|
|
@@ -1302,7 +1305,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1302
1305
|
) : (
|
|
1303
1306
|
// Dropdown Chevron
|
|
1304
1307
|
/* @__PURE__ */ e(
|
|
1305
|
-
|
|
1308
|
+
Vt,
|
|
1306
1309
|
{
|
|
1307
1310
|
className: fe(
|
|
1308
1311
|
"text-text-muted cursor-pointer transition-transform",
|
|
@@ -1310,7 +1313,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1310
1313
|
re ? "rotate-180" : "rotate-0"
|
|
1311
1314
|
),
|
|
1312
1315
|
onClick: () => {
|
|
1313
|
-
|
|
1316
|
+
P((j) => (j || S(!1), !j));
|
|
1314
1317
|
}
|
|
1315
1318
|
}
|
|
1316
1319
|
)
|
|
@@ -1321,16 +1324,16 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1321
1324
|
{
|
|
1322
1325
|
className: "absolute z-10 mt-1 w-full bg-surface border border-border rounded-lg shadow-lg max-h-60 overflow-auto top-full",
|
|
1323
1326
|
role: "listbox",
|
|
1324
|
-
children: N.length > 0 ? N.map((
|
|
1327
|
+
children: N.length > 0 ? N.map((j) => /* @__PURE__ */ e(
|
|
1325
1328
|
"li",
|
|
1326
1329
|
{
|
|
1327
1330
|
className: "px-4 py-2 cursor-pointer text-text hover:bg-accent-soft hover:text-accent transition-colors",
|
|
1328
|
-
onClick: () => k(
|
|
1331
|
+
onClick: () => k(j),
|
|
1329
1332
|
role: "option",
|
|
1330
|
-
"aria-selected": q ===
|
|
1331
|
-
children:
|
|
1333
|
+
"aria-selected": q === j.label,
|
|
1334
|
+
children: j.label
|
|
1332
1335
|
},
|
|
1333
|
-
|
|
1336
|
+
j.value
|
|
1334
1337
|
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-text-muted", children: ae || l ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
|
|
1335
1338
|
}
|
|
1336
1339
|
),
|
|
@@ -1353,8 +1356,8 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1353
1356
|
);
|
|
1354
1357
|
}
|
|
1355
1358
|
);
|
|
1356
|
-
|
|
1357
|
-
const
|
|
1359
|
+
qt.displayName = "SearchableTextField";
|
|
1360
|
+
const Ut = me(
|
|
1358
1361
|
({ checked: t, onChange: r, label: n, disabled: s = !1, className: a, ...o }, l) => {
|
|
1359
1362
|
const u = /* @__PURE__ */ e(
|
|
1360
1363
|
"span",
|
|
@@ -1407,8 +1410,8 @@ const Ht = me(
|
|
|
1407
1410
|
);
|
|
1408
1411
|
}
|
|
1409
1412
|
);
|
|
1410
|
-
|
|
1411
|
-
function
|
|
1413
|
+
Ut.displayName = "Switch";
|
|
1414
|
+
function Wt({
|
|
1412
1415
|
variant: t = "page",
|
|
1413
1416
|
children: r,
|
|
1414
1417
|
showTableSkeleton: n = !1,
|
|
@@ -1457,7 +1460,7 @@ function Ut({
|
|
|
1457
1460
|
] })
|
|
1458
1461
|
] }) });
|
|
1459
1462
|
}
|
|
1460
|
-
const
|
|
1463
|
+
const Kt = ({
|
|
1461
1464
|
trigger: t,
|
|
1462
1465
|
options: r,
|
|
1463
1466
|
value: n,
|
|
@@ -1468,13 +1471,13 @@ const qt = ({
|
|
|
1468
1471
|
showCheck: u = !0,
|
|
1469
1472
|
header: m
|
|
1470
1473
|
}) => {
|
|
1471
|
-
const [y, h] =
|
|
1472
|
-
|
|
1474
|
+
const [y, h] = F(!1), [f, x] = F(null), [p, w] = F({ top: 0, left: 0 }), g = se(null), b = se(null), A = se(null), _ = se(null), K = ze(y, b, { placement: a }), $ = se(null), X = () => Array.from(
|
|
1475
|
+
_.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1473
1476
|
);
|
|
1474
1477
|
Q(() => {
|
|
1475
1478
|
y && X()[0]?.focus();
|
|
1476
1479
|
}, [y]);
|
|
1477
|
-
const
|
|
1480
|
+
const U = (i) => {
|
|
1478
1481
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(i.key)) return;
|
|
1479
1482
|
const N = X();
|
|
1480
1483
|
if (N.length === 0) return;
|
|
@@ -1484,7 +1487,7 @@ const qt = ({
|
|
|
1484
1487
|
};
|
|
1485
1488
|
Q(() => {
|
|
1486
1489
|
const i = (S) => {
|
|
1487
|
-
g.current && (!g.current.contains(S.target) ||
|
|
1490
|
+
g.current && (!g.current.contains(S.target) || A.current && !A.current.contains(S.target)) && (h(!1), x(null), $.current && (clearTimeout($.current), $.current = null));
|
|
1488
1491
|
};
|
|
1489
1492
|
return y && document.addEventListener("mousedown", i), () => {
|
|
1490
1493
|
document.removeEventListener("mousedown", i);
|
|
@@ -1512,17 +1515,17 @@ const qt = ({
|
|
|
1512
1515
|
}, [f]), Q(() => () => {
|
|
1513
1516
|
$.current && clearTimeout($.current);
|
|
1514
1517
|
}, []);
|
|
1515
|
-
const
|
|
1518
|
+
const I = (i) => {
|
|
1516
1519
|
i.stopPropagation(), !o && (h(!y), x(null), $.current && (clearTimeout($.current), $.current = null));
|
|
1517
1520
|
}, q = (i, S, N) => {
|
|
1518
1521
|
i.stopPropagation(), !S.disabled && !S.divider && (!S.children || S.children.length === 0) && (s?.(S.value, N), h(!1), x(null));
|
|
1519
|
-
},
|
|
1522
|
+
}, W = (i) => {
|
|
1520
1523
|
$.current && (clearTimeout($.current), $.current = null), i.children && i.children.length > 0 ? x(i.value) : x(null);
|
|
1521
1524
|
}, re = (i) => {
|
|
1522
1525
|
i.children && i.children.length > 0 ? $.current = setTimeout(() => {
|
|
1523
1526
|
x(null);
|
|
1524
1527
|
}, 150) : x(null);
|
|
1525
|
-
},
|
|
1528
|
+
}, P = (i, S, N) => {
|
|
1526
1529
|
i.stopPropagation(), !S.disabled && !S.divider && (s?.(S.value, N), h(!1), x(null));
|
|
1527
1530
|
}, ce = d(
|
|
1528
1531
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
@@ -1544,7 +1547,7 @@ const qt = ({
|
|
|
1544
1547
|
"button",
|
|
1545
1548
|
{
|
|
1546
1549
|
ref: b,
|
|
1547
|
-
onClick:
|
|
1550
|
+
onClick: I,
|
|
1548
1551
|
disabled: o,
|
|
1549
1552
|
"aria-haspopup": "menu",
|
|
1550
1553
|
"aria-expanded": y,
|
|
@@ -1554,7 +1557,7 @@ const qt = ({
|
|
|
1554
1557
|
children: t
|
|
1555
1558
|
}
|
|
1556
1559
|
),
|
|
1557
|
-
y && /* @__PURE__ */ e("div", { ref:
|
|
1560
|
+
y && /* @__PURE__ */ e("div", { ref: _, className: ce, style: K, onKeyDown: U, children: /* @__PURE__ */ c("div", { className: "p-2", role: "menu", children: [
|
|
1558
1561
|
m && (typeof m == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: m }) : m),
|
|
1559
1562
|
r.map((i, S) => {
|
|
1560
1563
|
if (i.divider)
|
|
@@ -1574,7 +1577,7 @@ const qt = ({
|
|
|
1574
1577
|
role: "menuitem",
|
|
1575
1578
|
"aria-haspopup": N ? "menu" : void 0,
|
|
1576
1579
|
onClick: (k) => q(k, i),
|
|
1577
|
-
onMouseEnter: () =>
|
|
1580
|
+
onMouseEnter: () => W(i),
|
|
1578
1581
|
onMouseLeave: () => re(i),
|
|
1579
1582
|
disabled: i.disabled,
|
|
1580
1583
|
className: d(
|
|
@@ -1602,7 +1605,7 @@ const qt = ({
|
|
|
1602
1605
|
N && T && /* @__PURE__ */ e(
|
|
1603
1606
|
"div",
|
|
1604
1607
|
{
|
|
1605
|
-
ref:
|
|
1608
|
+
ref: A,
|
|
1606
1609
|
className: C,
|
|
1607
1610
|
style: {
|
|
1608
1611
|
top: `${p.top}px`,
|
|
@@ -1631,7 +1634,7 @@ const qt = ({
|
|
|
1631
1634
|
return /* @__PURE__ */ c(
|
|
1632
1635
|
"button",
|
|
1633
1636
|
{
|
|
1634
|
-
onClick: (le) =>
|
|
1637
|
+
onClick: (le) => P(
|
|
1635
1638
|
le,
|
|
1636
1639
|
k,
|
|
1637
1640
|
i.value
|
|
@@ -1676,17 +1679,17 @@ const qt = ({
|
|
|
1676
1679
|
]
|
|
1677
1680
|
}
|
|
1678
1681
|
);
|
|
1679
|
-
},
|
|
1682
|
+
}, Le = {
|
|
1680
1683
|
none: "pl-0",
|
|
1681
1684
|
sm: "pl-2",
|
|
1682
1685
|
md: "pl-4",
|
|
1683
1686
|
lg: "pl-6"
|
|
1684
|
-
},
|
|
1687
|
+
}, Ie = {
|
|
1685
1688
|
none: "pr-0",
|
|
1686
1689
|
sm: "pr-2",
|
|
1687
1690
|
md: "pr-4",
|
|
1688
1691
|
lg: "pr-6"
|
|
1689
|
-
},
|
|
1692
|
+
}, Gt = () => /* @__PURE__ */ e(Y, { icon: Se, size: "md", color: "current" }), Jt = ({ active: t }) => /* @__PURE__ */ e(Y, { icon: tt, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Yt = ({ active: t }) => /* @__PURE__ */ e(Y, { icon: ge, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Xt = () => /* @__PURE__ */ e(Y, { icon: ke, size: "md", color: "current" }), Zt = () => /* @__PURE__ */ e(Y, { icon: Ce, size: "md", color: "current" }), Qt = () => /* @__PURE__ */ e(Y, { icon: rt, size: "md", color: "current" }), er = () => /* @__PURE__ */ e(Y, { icon: nt, size: "md", color: "current" }), Ve = () => /* @__PURE__ */ e(Y, { icon: ge, size: "md", color: "current" }), tr = (t) => {
|
|
1690
1693
|
const r = (s) => t.multiSelect && Array.isArray(t.value) ? t.value?.includes(s) : t.value === s, n = (s) => {
|
|
1691
1694
|
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((a) => a !== s)) : t.onChange(s);
|
|
1692
1695
|
};
|
|
@@ -1705,7 +1708,7 @@ const qt = ({
|
|
|
1705
1708
|
/* @__PURE__ */ e("span", { className: "text-text", children: t.multiSelect && Array.isArray(t.value) ? t.value?.map(
|
|
1706
1709
|
(s) => t.options?.find((a) => a.value === s)?.label
|
|
1707
1710
|
).join(", ") : t.options?.find((s) => s.value === t.value)?.label }),
|
|
1708
|
-
/* @__PURE__ */ e("span", { className: "text-text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(
|
|
1711
|
+
/* @__PURE__ */ e("span", { className: "text-text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(Ve, {}) })
|
|
1709
1712
|
] }),
|
|
1710
1713
|
/* @__PURE__ */ c("div", { className: "absolute z-10 left-0 mt-1 bg-surface border border-border rounded-lg shadow-overlay p-2 w-48", children: [
|
|
1711
1714
|
t.options?.map((s) => /* @__PURE__ */ e(
|
|
@@ -1733,7 +1736,7 @@ const qt = ({
|
|
|
1733
1736
|
)
|
|
1734
1737
|
] })
|
|
1735
1738
|
] }) }) });
|
|
1736
|
-
},
|
|
1739
|
+
}, je = ({
|
|
1737
1740
|
data: t,
|
|
1738
1741
|
columns: r,
|
|
1739
1742
|
loading: n = !1,
|
|
@@ -1748,68 +1751,68 @@ const qt = ({
|
|
|
1748
1751
|
selectable: f = !1,
|
|
1749
1752
|
selectedRows: x = [],
|
|
1750
1753
|
onSelectionChange: p,
|
|
1751
|
-
getRowKey: w = (
|
|
1754
|
+
getRowKey: w = (I, q) => q,
|
|
1752
1755
|
emptyContent: g,
|
|
1753
1756
|
hoverable: b = !0,
|
|
1754
|
-
bordered:
|
|
1755
|
-
striped:
|
|
1756
|
-
padding:
|
|
1757
|
+
bordered: A = !1,
|
|
1758
|
+
striped: _ = !1,
|
|
1759
|
+
padding: K = "md",
|
|
1757
1760
|
className: $,
|
|
1758
1761
|
rowClassName: X,
|
|
1759
|
-
headerBackground:
|
|
1762
|
+
headerBackground: U = !0
|
|
1760
1763
|
}) => {
|
|
1761
|
-
const [
|
|
1764
|
+
const [I, q] = F(""), [W, re] = F({
|
|
1762
1765
|
column: null,
|
|
1763
1766
|
direction: null
|
|
1764
|
-
}), [
|
|
1767
|
+
}), [P, ce] = F({
|
|
1765
1768
|
page: 0,
|
|
1766
1769
|
pageSize: m
|
|
1767
1770
|
}), C = se(null), i = he(() => {
|
|
1768
1771
|
let v = t;
|
|
1769
|
-
if (s &&
|
|
1770
|
-
const
|
|
1772
|
+
if (s && I.trim()) {
|
|
1773
|
+
const H = r.filter(
|
|
1771
1774
|
(J) => J.searchable !== !1
|
|
1772
|
-
), Z =
|
|
1773
|
-
v = v.filter((J) =>
|
|
1774
|
-
const ie = typeof
|
|
1775
|
+
), Z = I.toLowerCase();
|
|
1776
|
+
v = v.filter((J) => H.some((O) => {
|
|
1777
|
+
const ie = typeof O.accessor == "function" ? O.accessor(J) : J[O.accessor];
|
|
1775
1778
|
return String(ie || "").toLowerCase().includes(Z);
|
|
1776
1779
|
}));
|
|
1777
1780
|
}
|
|
1778
|
-
return o.forEach((
|
|
1779
|
-
|
|
1780
|
-
const J = r.find((ie) => ie.id ===
|
|
1781
|
+
return o.forEach((H) => {
|
|
1782
|
+
H.value && H.value !== "all" && (v = v.filter((Z) => {
|
|
1783
|
+
const J = r.find((ie) => ie.id === H.id);
|
|
1781
1784
|
if (!J) return !0;
|
|
1782
|
-
const
|
|
1783
|
-
return String(
|
|
1785
|
+
const O = typeof J.accessor == "function" ? J.accessor(Z) : Z[J.accessor];
|
|
1786
|
+
return String(O || "") === H.value;
|
|
1784
1787
|
}));
|
|
1785
1788
|
}), v;
|
|
1786
|
-
}, [t,
|
|
1787
|
-
if (!
|
|
1788
|
-
const v = r.find((
|
|
1789
|
-
return v ? [...i].sort((
|
|
1790
|
-
const J = typeof v.accessor == "function" ? v.accessor(
|
|
1789
|
+
}, [t, I, r, s, o]), S = he(() => {
|
|
1790
|
+
if (!W.column || !W.direction) return i;
|
|
1791
|
+
const v = r.find((H) => H.id === W.column);
|
|
1792
|
+
return v ? [...i].sort((H, Z) => {
|
|
1793
|
+
const J = typeof v.accessor == "function" ? v.accessor(H) : H[v.accessor], O = typeof v.accessor == "function" ? v.accessor(Z) : Z[v.accessor];
|
|
1791
1794
|
let ie = 0;
|
|
1792
|
-
return J <
|
|
1795
|
+
return J < O ? ie = -1 : J > O && (ie = 1), W.direction === "desc" ? -ie : ie;
|
|
1793
1796
|
}) : i;
|
|
1794
|
-
}, [i,
|
|
1797
|
+
}, [i, W, r]), N = he(() => {
|
|
1795
1798
|
if (!l) return S;
|
|
1796
|
-
const v =
|
|
1797
|
-
return S.slice(v,
|
|
1798
|
-
}, [S,
|
|
1799
|
+
const v = P.page * P.pageSize, H = v + P.pageSize;
|
|
1800
|
+
return S.slice(v, H);
|
|
1801
|
+
}, [S, P, l]), T = ue(
|
|
1799
1802
|
(v) => {
|
|
1800
1803
|
r.find((Z) => Z.id === v)?.sortable && re((Z) => Z.column !== v ? { column: v, direction: "asc" } : Z.direction === "asc" ? { column: v, direction: "desc" } : { column: null, direction: null });
|
|
1801
1804
|
},
|
|
1802
1805
|
[r]
|
|
1803
1806
|
), k = ue((v) => {
|
|
1804
|
-
ce((
|
|
1807
|
+
ce((H) => ({ ...H, page: v }));
|
|
1805
1808
|
}, []), ee = ue((v) => {
|
|
1806
1809
|
ce({ page: 0, pageSize: v });
|
|
1807
1810
|
}, []), ae = ue(
|
|
1808
|
-
(v,
|
|
1811
|
+
(v, H) => {
|
|
1809
1812
|
if (!p) return;
|
|
1810
1813
|
const Z = w(v, 0);
|
|
1811
|
-
x.map((J,
|
|
1812
|
-
(J,
|
|
1814
|
+
x.map((J, O) => w(J, O)), p(H ? [...x, v] : x.filter(
|
|
1815
|
+
(J, O) => w(x[O], O) !== Z
|
|
1813
1816
|
));
|
|
1814
1817
|
},
|
|
1815
1818
|
[x, p, w]
|
|
@@ -1821,23 +1824,23 @@ const qt = ({
|
|
|
1821
1824
|
);
|
|
1822
1825
|
Q(() => {
|
|
1823
1826
|
ce((v) => ({ ...v, page: 0 }));
|
|
1824
|
-
}, [
|
|
1827
|
+
}, [I, W]), Q(() => {
|
|
1825
1828
|
ce((v) => ({ ...v, page: 0 }));
|
|
1826
1829
|
}, [o.map((v) => v.value).join(",")]);
|
|
1827
|
-
const G = S.length,
|
|
1828
|
-
const
|
|
1830
|
+
const G = S.length, j = Math.ceil(G / P.pageSize), E = P.page * P.pageSize + 1, D = Math.min(E + P.pageSize - 1, G), z = N.length > 0 && N.every((v) => {
|
|
1831
|
+
const H = w(v, 0);
|
|
1829
1832
|
return x.some(
|
|
1830
|
-
(Z, J) => w(Z, J) ===
|
|
1833
|
+
(Z, J) => w(Z, J) === H
|
|
1831
1834
|
);
|
|
1832
|
-
}),
|
|
1833
|
-
const
|
|
1835
|
+
}), R = N.some((v) => {
|
|
1836
|
+
const H = w(v, 0);
|
|
1834
1837
|
return x.some(
|
|
1835
|
-
(Z, J) => w(Z, J) ===
|
|
1838
|
+
(Z, J) => w(Z, J) === H
|
|
1836
1839
|
);
|
|
1837
1840
|
}), B = d(
|
|
1838
1841
|
"w-full text-sm leading-5 text-text border-collapse",
|
|
1839
1842
|
$
|
|
1840
|
-
),
|
|
1843
|
+
), V = U ? "bg-surface-sunk border-border border-t" : "bg-surface", M = d(V, "h-control-lg"), L = d(
|
|
1841
1844
|
"text-text border-b border-border p-2"
|
|
1842
1845
|
), te = d("h-row-lg", {
|
|
1843
1846
|
"hover:bg-surface-sunk": b,
|
|
@@ -1845,21 +1848,21 @@ const qt = ({
|
|
|
1845
1848
|
});
|
|
1846
1849
|
return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
|
|
1847
1850
|
(s || o.length > 0) && /* @__PURE__ */ e("div", { className: "px-4 pt-4 pb-2", children: /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-4 items-start", children: [
|
|
1848
|
-
o.map((v) => /* @__PURE__ */ e(
|
|
1851
|
+
o.map((v) => /* @__PURE__ */ e(tr, { ...v }, v.id)),
|
|
1849
1852
|
/* @__PURE__ */ e("div", { className: "w-full sm:w-auto sm:ml-auto min-w-menu", children: /* @__PURE__ */ e(
|
|
1850
1853
|
be,
|
|
1851
1854
|
{
|
|
1852
1855
|
placeholder: a,
|
|
1853
|
-
value:
|
|
1856
|
+
value: I,
|
|
1854
1857
|
onChange: (v) => q(v.target.value),
|
|
1855
|
-
startIcon: /* @__PURE__ */ e(
|
|
1858
|
+
startIcon: /* @__PURE__ */ e(Gt, {}),
|
|
1856
1859
|
className: "max-w-sm"
|
|
1857
1860
|
}
|
|
1858
1861
|
) })
|
|
1859
1862
|
] }) }),
|
|
1860
1863
|
/* @__PURE__ */ c("div", { className: "relative w-full overflow-x-auto min-h-100", children: [
|
|
1861
1864
|
n && /* @__PURE__ */ e("div", { className: "flex items-center justify-center z-10", children: /* @__PURE__ */ e(
|
|
1862
|
-
|
|
1865
|
+
Wt,
|
|
1863
1866
|
{
|
|
1864
1867
|
showTableSkeleton: !0,
|
|
1865
1868
|
tableRows: 10,
|
|
@@ -1868,23 +1871,23 @@ const qt = ({
|
|
|
1868
1871
|
) }),
|
|
1869
1872
|
/* @__PURE__ */ c("table", { ref: C, className: d(B, "min-w-full"), children: [
|
|
1870
1873
|
/* @__PURE__ */ e("thead", { className: M, children: /* @__PURE__ */ c("tr", { children: [
|
|
1871
|
-
f && /* @__PURE__ */ e("th", { className: d(
|
|
1874
|
+
f && /* @__PURE__ */ e("th", { className: d(L, "w-12"), children: /* @__PURE__ */ e(
|
|
1872
1875
|
"input",
|
|
1873
1876
|
{
|
|
1874
1877
|
type: "checkbox",
|
|
1875
1878
|
checked: z,
|
|
1876
1879
|
ref: (v) => {
|
|
1877
|
-
v && (v.indeterminate =
|
|
1880
|
+
v && (v.indeterminate = R && !z);
|
|
1878
1881
|
},
|
|
1879
1882
|
onChange: (v) => le(v.target.checked),
|
|
1880
1883
|
className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
|
|
1881
1884
|
}
|
|
1882
1885
|
) }),
|
|
1883
|
-
!n && r.map((v,
|
|
1886
|
+
!n && r.map((v, H) => /* @__PURE__ */ e(
|
|
1884
1887
|
"th",
|
|
1885
1888
|
{
|
|
1886
1889
|
className: d(
|
|
1887
|
-
|
|
1890
|
+
L,
|
|
1888
1891
|
"font-semibold text-xs text-text-muted uppercase tracking-label",
|
|
1889
1892
|
"group",
|
|
1890
1893
|
{
|
|
@@ -1892,11 +1895,11 @@ const qt = ({
|
|
|
1892
1895
|
"text-center": v.align === "center",
|
|
1893
1896
|
"text-right": v.align === "right",
|
|
1894
1897
|
"cursor-pointer select-none": v.sortable,
|
|
1895
|
-
[`sticky left-0 ${
|
|
1896
|
-
[`sticky right-0 ${
|
|
1898
|
+
[`sticky left-0 ${V}`]: v.sticky === "left",
|
|
1899
|
+
[`sticky right-0 ${V}`]: v.sticky === "right"
|
|
1897
1900
|
},
|
|
1898
|
-
|
|
1899
|
-
|
|
1901
|
+
H === 0 && Le[K],
|
|
1902
|
+
H === r.length - 1 && Ie[K]
|
|
1900
1903
|
),
|
|
1901
1904
|
style: { width: v.width },
|
|
1902
1905
|
onClick: () => v.sortable && T(v.id),
|
|
@@ -1907,19 +1910,19 @@ const qt = ({
|
|
|
1907
1910
|
{
|
|
1908
1911
|
className: d(
|
|
1909
1912
|
"flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1910
|
-
|
|
1913
|
+
W.column === v.id && "opacity-100"
|
|
1911
1914
|
),
|
|
1912
1915
|
children: [
|
|
1913
1916
|
/* @__PURE__ */ e(
|
|
1914
|
-
|
|
1917
|
+
Jt,
|
|
1915
1918
|
{
|
|
1916
|
-
active:
|
|
1919
|
+
active: W.column === v.id && W.direction === "asc"
|
|
1917
1920
|
}
|
|
1918
1921
|
),
|
|
1919
1922
|
/* @__PURE__ */ e(
|
|
1920
|
-
|
|
1923
|
+
Yt,
|
|
1921
1924
|
{
|
|
1922
|
-
active:
|
|
1925
|
+
active: W.column === v.id && W.direction === "desc"
|
|
1923
1926
|
}
|
|
1924
1927
|
)
|
|
1925
1928
|
]
|
|
@@ -1929,21 +1932,21 @@ const qt = ({
|
|
|
1929
1932
|
},
|
|
1930
1933
|
v.id
|
|
1931
1934
|
)),
|
|
1932
|
-
y.length > 0 && /* @__PURE__ */ e("th", { className: d(
|
|
1935
|
+
y.length > 0 && /* @__PURE__ */ e("th", { className: d(L, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
1933
1936
|
] }) }),
|
|
1934
1937
|
/* @__PURE__ */ e("tbody", { children: N.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1935
1938
|
"td",
|
|
1936
1939
|
{
|
|
1937
1940
|
colSpan: r.length + (f ? 1 : 0) + (y.length > 0 ? 1 : 0),
|
|
1938
1941
|
className: d(
|
|
1939
|
-
|
|
1942
|
+
L,
|
|
1940
1943
|
"text-center py-8 text-text-muted"
|
|
1941
1944
|
),
|
|
1942
1945
|
children: g || "No data available"
|
|
1943
1946
|
}
|
|
1944
|
-
) }) : N.map((v,
|
|
1945
|
-
const Z = w(v,
|
|
1946
|
-
(
|
|
1947
|
+
) }) : N.map((v, H) => {
|
|
1948
|
+
const Z = w(v, H), J = x.some(
|
|
1949
|
+
(O, ie) => w(O, ie) === Z
|
|
1947
1950
|
);
|
|
1948
1951
|
return /* @__PURE__ */ c(
|
|
1949
1952
|
"tr",
|
|
@@ -1951,63 +1954,63 @@ const qt = ({
|
|
|
1951
1954
|
className: d(
|
|
1952
1955
|
te,
|
|
1953
1956
|
{ "bg-accent-soft": J },
|
|
1954
|
-
X?.(v,
|
|
1957
|
+
X?.(v, H)
|
|
1955
1958
|
),
|
|
1956
|
-
onClick: (
|
|
1957
|
-
|
|
1959
|
+
onClick: (O) => {
|
|
1960
|
+
O.stopPropagation(), h?.(v, H);
|
|
1958
1961
|
},
|
|
1959
1962
|
children: [
|
|
1960
|
-
f && /* @__PURE__ */ e("td", { className:
|
|
1963
|
+
f && /* @__PURE__ */ e("td", { className: L, children: /* @__PURE__ */ e(
|
|
1961
1964
|
"input",
|
|
1962
1965
|
{
|
|
1963
1966
|
type: "checkbox",
|
|
1964
1967
|
checked: J,
|
|
1965
|
-
onChange: (
|
|
1966
|
-
|
|
1968
|
+
onChange: (O) => {
|
|
1969
|
+
O.stopPropagation(), ae(v, O.target.checked);
|
|
1967
1970
|
},
|
|
1968
1971
|
className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
|
|
1969
1972
|
}
|
|
1970
1973
|
) }),
|
|
1971
|
-
r.map((
|
|
1972
|
-
const ve = typeof
|
|
1974
|
+
r.map((O, ie) => {
|
|
1975
|
+
const ve = typeof O.accessor == "function" ? O.accessor(v) : v[O.accessor];
|
|
1973
1976
|
return /* @__PURE__ */ e(
|
|
1974
1977
|
"td",
|
|
1975
1978
|
{
|
|
1976
1979
|
className: d(
|
|
1977
|
-
|
|
1980
|
+
L,
|
|
1978
1981
|
{
|
|
1979
|
-
"text-left":
|
|
1980
|
-
"text-center":
|
|
1981
|
-
"text-right":
|
|
1982
|
-
"sticky left-0 bg-surface":
|
|
1983
|
-
"sticky right-0 bg-surface":
|
|
1982
|
+
"text-left": O.align === "left" || !O.align,
|
|
1983
|
+
"text-center": O.align === "center",
|
|
1984
|
+
"text-right": O.align === "right",
|
|
1985
|
+
"sticky left-0 bg-surface": O.sticky === "left",
|
|
1986
|
+
"sticky right-0 bg-surface": O.sticky === "right"
|
|
1984
1987
|
},
|
|
1985
|
-
ie === 0 &&
|
|
1986
|
-
ie === r.length - 1 &&
|
|
1988
|
+
ie === 0 && Le[K],
|
|
1989
|
+
ie === r.length - 1 && Ie[K]
|
|
1987
1990
|
),
|
|
1988
|
-
children:
|
|
1991
|
+
children: O.cell ? O.cell(ve, v, ie) : String(ve || "")
|
|
1989
1992
|
},
|
|
1990
|
-
|
|
1993
|
+
O.id
|
|
1991
1994
|
);
|
|
1992
1995
|
}),
|
|
1993
|
-
y.length > 0 && /* @__PURE__ */ e("td", { className:
|
|
1994
|
-
|
|
1996
|
+
y.length > 0 && /* @__PURE__ */ e("td", { className: L, children: /* @__PURE__ */ e(
|
|
1997
|
+
Kt,
|
|
1995
1998
|
{
|
|
1996
1999
|
trigger: /* @__PURE__ */ c("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-text-muted hover:text-text", children: [
|
|
1997
2000
|
/* @__PURE__ */ e("span", { children: "Options" }),
|
|
1998
|
-
/* @__PURE__ */ e(
|
|
2001
|
+
/* @__PURE__ */ e(Ve, {})
|
|
1999
2002
|
] }),
|
|
2000
|
-
options: y.map((
|
|
2001
|
-
value:
|
|
2002
|
-
label:
|
|
2003
|
-
icon:
|
|
2004
|
-
disabled:
|
|
2003
|
+
options: y.map((O) => ({
|
|
2004
|
+
value: O.id,
|
|
2005
|
+
label: O.label,
|
|
2006
|
+
icon: O.icon,
|
|
2007
|
+
disabled: O.disabled?.(v)
|
|
2005
2008
|
})),
|
|
2006
|
-
onSelect: (
|
|
2009
|
+
onSelect: (O) => {
|
|
2007
2010
|
const ie = y.find(
|
|
2008
|
-
(ve) => ve.id ===
|
|
2011
|
+
(ve) => ve.id === O
|
|
2009
2012
|
);
|
|
2010
|
-
ie && ie.onClick(v,
|
|
2013
|
+
ie && ie.onClick(v, H);
|
|
2011
2014
|
},
|
|
2012
2015
|
placement: "bottom-end"
|
|
2013
2016
|
}
|
|
@@ -2035,7 +2038,7 @@ const qt = ({
|
|
|
2035
2038
|
/* @__PURE__ */ e(
|
|
2036
2039
|
"select",
|
|
2037
2040
|
{
|
|
2038
|
-
value:
|
|
2041
|
+
value: P.pageSize,
|
|
2039
2042
|
onChange: (v) => ee(Number(v.target.value)),
|
|
2040
2043
|
className: "h-control-sm w-16 rounded-md border border-border bg-surface-input px-2 text-sm text-text",
|
|
2041
2044
|
children: u.map((v) => /* @__PURE__ */ e("option", { value: v, children: v }, v))
|
|
@@ -2050,9 +2053,9 @@ const qt = ({
|
|
|
2050
2053
|
size: "sm",
|
|
2051
2054
|
variant: "ghost",
|
|
2052
2055
|
onClick: () => k(0),
|
|
2053
|
-
disabled:
|
|
2056
|
+
disabled: P.page === 0,
|
|
2054
2057
|
iconOnly: !0,
|
|
2055
|
-
children: /* @__PURE__ */ e(
|
|
2058
|
+
children: /* @__PURE__ */ e(Qt, {})
|
|
2056
2059
|
}
|
|
2057
2060
|
),
|
|
2058
2061
|
/* @__PURE__ */ e(
|
|
@@ -2060,27 +2063,27 @@ const qt = ({
|
|
|
2060
2063
|
{
|
|
2061
2064
|
size: "sm",
|
|
2062
2065
|
variant: "ghost",
|
|
2063
|
-
onClick: () => k(
|
|
2064
|
-
disabled:
|
|
2066
|
+
onClick: () => k(P.page - 1),
|
|
2067
|
+
disabled: P.page === 0,
|
|
2065
2068
|
iconOnly: !0,
|
|
2066
|
-
children: /* @__PURE__ */ e(
|
|
2069
|
+
children: /* @__PURE__ */ e(Xt, {})
|
|
2067
2070
|
}
|
|
2068
2071
|
),
|
|
2069
2072
|
/* @__PURE__ */ c("span", { className: "px-3 py-1 text-sm text-text-muted", children: [
|
|
2070
2073
|
"Page ",
|
|
2071
|
-
|
|
2074
|
+
P.page + 1,
|
|
2072
2075
|
" of ",
|
|
2073
|
-
|
|
2076
|
+
j
|
|
2074
2077
|
] }),
|
|
2075
2078
|
/* @__PURE__ */ e(
|
|
2076
2079
|
ne,
|
|
2077
2080
|
{
|
|
2078
2081
|
size: "sm",
|
|
2079
2082
|
variant: "ghost",
|
|
2080
|
-
onClick: () => k(
|
|
2081
|
-
disabled:
|
|
2083
|
+
onClick: () => k(P.page + 1),
|
|
2084
|
+
disabled: P.page >= j - 1,
|
|
2082
2085
|
iconOnly: !0,
|
|
2083
|
-
children: /* @__PURE__ */ e(
|
|
2086
|
+
children: /* @__PURE__ */ e(Zt, {})
|
|
2084
2087
|
}
|
|
2085
2088
|
),
|
|
2086
2089
|
/* @__PURE__ */ e(
|
|
@@ -2088,22 +2091,22 @@ const qt = ({
|
|
|
2088
2091
|
{
|
|
2089
2092
|
size: "sm",
|
|
2090
2093
|
variant: "ghost",
|
|
2091
|
-
onClick: () => k(
|
|
2092
|
-
disabled:
|
|
2094
|
+
onClick: () => k(j - 1),
|
|
2095
|
+
disabled: P.page >= j - 1,
|
|
2093
2096
|
iconOnly: !0,
|
|
2094
|
-
children: /* @__PURE__ */ e(
|
|
2097
|
+
children: /* @__PURE__ */ e(er, {})
|
|
2095
2098
|
}
|
|
2096
2099
|
)
|
|
2097
2100
|
] })
|
|
2098
2101
|
] })
|
|
2099
2102
|
] });
|
|
2100
|
-
},
|
|
2103
|
+
}, rr = ht(null), un = ({
|
|
2101
2104
|
items: t,
|
|
2102
2105
|
activeTab: r,
|
|
2103
2106
|
onTabChange: n,
|
|
2104
2107
|
className: s
|
|
2105
2108
|
}) => {
|
|
2106
|
-
const [a, o] =
|
|
2109
|
+
const [a, o] = F(t[0]?.id || ""), l = r || a, u = (m) => {
|
|
2107
2110
|
n ? n(m) : o(m);
|
|
2108
2111
|
};
|
|
2109
2112
|
return /* @__PURE__ */ e("div", { className: d("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((m) => /* @__PURE__ */ e(
|
|
@@ -2129,7 +2132,7 @@ const qt = ({
|
|
|
2129
2132
|
},
|
|
2130
2133
|
m.id
|
|
2131
2134
|
)) }) });
|
|
2132
|
-
},
|
|
2135
|
+
}, nr = ({
|
|
2133
2136
|
items: t,
|
|
2134
2137
|
defaultTab: r,
|
|
2135
2138
|
activeTab: n,
|
|
@@ -2138,7 +2141,7 @@ const qt = ({
|
|
|
2138
2141
|
size: o = "md",
|
|
2139
2142
|
className: l
|
|
2140
2143
|
}) => {
|
|
2141
|
-
const [u, m] =
|
|
2144
|
+
const [u, m] = F(
|
|
2142
2145
|
r || n || t[0]?.id || ""
|
|
2143
2146
|
), y = n || u, h = (g) => {
|
|
2144
2147
|
s ? s(g) : m(g);
|
|
@@ -2155,11 +2158,11 @@ const qt = ({
|
|
|
2155
2158
|
},
|
|
2156
2159
|
l
|
|
2157
2160
|
), w = (g, b) => {
|
|
2158
|
-
const
|
|
2161
|
+
const A = "transition-colors duration-fast font-medium", _ = {
|
|
2159
2162
|
"text-xs px-2 py-1": o === "sm",
|
|
2160
2163
|
"text-sm px-3 py-2": o === "md",
|
|
2161
2164
|
"text-base px-4 py-3": o === "lg"
|
|
2162
|
-
},
|
|
2165
|
+
}, K = {
|
|
2163
2166
|
// Default variant
|
|
2164
2167
|
"border-b-2 -mb-px": a === "default",
|
|
2165
2168
|
// Pills variant
|
|
@@ -2172,14 +2175,14 @@ const qt = ({
|
|
|
2172
2175
|
}, X = b ? {
|
|
2173
2176
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
2174
2177
|
"bg-surface text-text shadow-none": a === "pills"
|
|
2175
|
-
} : {},
|
|
2178
|
+
} : {}, U = !b && !g.disabled ? {
|
|
2176
2179
|
"border-transparent text-text-muted hover:text-text": a === "default",
|
|
2177
2180
|
"text-text-muted hover:text-text": a === "pills",
|
|
2178
2181
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
2179
2182
|
} : {};
|
|
2180
|
-
return d(
|
|
2183
|
+
return d(A, _, K, $, X, U);
|
|
2181
2184
|
};
|
|
2182
|
-
return /* @__PURE__ */ e(
|
|
2185
|
+
return /* @__PURE__ */ e(rr.Provider, { value: f, children: /* @__PURE__ */ c("div", { children: [
|
|
2183
2186
|
/* @__PURE__ */ e("div", { className: p, role: "tablist", children: t.map((g) => /* @__PURE__ */ e(
|
|
2184
2187
|
"button",
|
|
2185
2188
|
{
|
|
@@ -2208,14 +2211,14 @@ const qt = ({
|
|
|
2208
2211
|
}
|
|
2209
2212
|
)
|
|
2210
2213
|
] }) });
|
|
2211
|
-
},
|
|
2214
|
+
}, sr = {
|
|
2212
2215
|
sm: "max-w-md",
|
|
2213
2216
|
md: "max-w-lg",
|
|
2214
2217
|
lg: "max-w-2xl",
|
|
2215
2218
|
xl: "max-w-4xl",
|
|
2216
2219
|
full: "max-w-full mx-4"
|
|
2217
2220
|
};
|
|
2218
|
-
function
|
|
2221
|
+
function He({
|
|
2219
2222
|
open: t,
|
|
2220
2223
|
onClose: r,
|
|
2221
2224
|
title: n,
|
|
@@ -2259,7 +2262,7 @@ function Ue({
|
|
|
2259
2262
|
"relative w-full bg-surface rounded-lg shadow-modal",
|
|
2260
2263
|
// 'animate-scale-in',
|
|
2261
2264
|
"focus:outline-none",
|
|
2262
|
-
|
|
2265
|
+
sr[s],
|
|
2263
2266
|
l
|
|
2264
2267
|
),
|
|
2265
2268
|
role: "dialog",
|
|
@@ -2294,19 +2297,19 @@ function Ue({
|
|
|
2294
2297
|
}
|
|
2295
2298
|
) : null;
|
|
2296
2299
|
}
|
|
2297
|
-
const
|
|
2300
|
+
const ar = {
|
|
2298
2301
|
xs: "text-xs",
|
|
2299
2302
|
sm: "text-sm",
|
|
2300
2303
|
md: "text-base",
|
|
2301
2304
|
lg: "text-md",
|
|
2302
2305
|
xl: "text-lg"
|
|
2303
|
-
},
|
|
2306
|
+
}, lr = {
|
|
2304
2307
|
light: "font-normal",
|
|
2305
2308
|
normal: "font-normal",
|
|
2306
2309
|
medium: "font-medium",
|
|
2307
2310
|
semibold: "font-semibold",
|
|
2308
2311
|
bold: "font-bold"
|
|
2309
|
-
},
|
|
2312
|
+
}, or = {
|
|
2310
2313
|
primary: "text-text",
|
|
2311
2314
|
secondary: "text-text-muted",
|
|
2312
2315
|
accent: "text-accent",
|
|
@@ -2317,12 +2320,12 @@ const rr = {
|
|
|
2317
2320
|
neutral: "text-text",
|
|
2318
2321
|
current: "text-current",
|
|
2319
2322
|
muted: "text-text-subtle"
|
|
2320
|
-
},
|
|
2323
|
+
}, cr = {
|
|
2321
2324
|
left: "text-left",
|
|
2322
2325
|
center: "text-center",
|
|
2323
2326
|
right: "text-right",
|
|
2324
2327
|
justify: "text-justify"
|
|
2325
|
-
},
|
|
2328
|
+
}, ir = {
|
|
2326
2329
|
tight: "leading-tight",
|
|
2327
2330
|
normal: "leading-normal",
|
|
2328
2331
|
relaxed: "leading-relaxed"
|
|
@@ -2341,28 +2344,28 @@ const rr = {
|
|
|
2341
2344
|
children: f,
|
|
2342
2345
|
...x
|
|
2343
2346
|
}) => {
|
|
2344
|
-
const p = y ||
|
|
2347
|
+
const p = y || dr(t), w = t === "caption", g = t === "label", b = t === "code", A = d(
|
|
2345
2348
|
"font-sans",
|
|
2346
2349
|
// Variant — caption and label pin their own size/weight
|
|
2347
2350
|
w && "text-xs text-text-subtle",
|
|
2348
2351
|
g && "text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
2349
2352
|
b && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
|
|
2350
2353
|
// Size — only where the variant does not pin it
|
|
2351
|
-
!w && !g && !b &&
|
|
2354
|
+
!w && !g && !b && ar[r],
|
|
2352
2355
|
// Weight — label owns its weight
|
|
2353
|
-
!g &&
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
+
!g && lr[n],
|
|
2357
|
+
or[s],
|
|
2358
|
+
cr[a],
|
|
2356
2359
|
// Line height only overrides the body variant
|
|
2357
|
-
t === "body" &&
|
|
2360
|
+
t === "body" && ir[m],
|
|
2358
2361
|
l && "italic",
|
|
2359
2362
|
u && "underline",
|
|
2360
2363
|
o && "truncate",
|
|
2361
2364
|
h
|
|
2362
2365
|
);
|
|
2363
|
-
return /* @__PURE__ */ e(p, { className:
|
|
2366
|
+
return /* @__PURE__ */ e(p, { className: A, ...x, children: f });
|
|
2364
2367
|
};
|
|
2365
|
-
function
|
|
2368
|
+
function dr(t) {
|
|
2366
2369
|
return {
|
|
2367
2370
|
body: "p",
|
|
2368
2371
|
caption: "span",
|
|
@@ -2370,7 +2373,7 @@ function or(t) {
|
|
|
2370
2373
|
code: "code"
|
|
2371
2374
|
}[t] || "p";
|
|
2372
2375
|
}
|
|
2373
|
-
const
|
|
2376
|
+
const ur = ({
|
|
2374
2377
|
value: t,
|
|
2375
2378
|
onChange: r,
|
|
2376
2379
|
label: n,
|
|
@@ -2384,90 +2387,90 @@ const cr = ({
|
|
|
2384
2387
|
onDownloadFile: h,
|
|
2385
2388
|
onRegisterFile: f
|
|
2386
2389
|
}) => {
|
|
2387
|
-
const [x, p] =
|
|
2390
|
+
const [x, p] = F(!1), [w, g] = F([]), [b, A] = F(null), [_, K] = F("/"), [$, X] = F([]), [U, I] = F(!1), [q, W] = F(""), [re, P] = F(
|
|
2388
2391
|
typeof t == "object" ? t : null
|
|
2389
|
-
), [ce, C] =
|
|
2392
|
+
), [ce, C] = F(!1), [i, S] = F(""), N = se(null);
|
|
2390
2393
|
Q(() => {
|
|
2391
2394
|
x && T();
|
|
2392
2395
|
}, [x]), Q(() => {
|
|
2393
2396
|
x && b && k();
|
|
2394
|
-
}, [x, b,
|
|
2397
|
+
}, [x, b, _, q]);
|
|
2395
2398
|
const T = async () => {
|
|
2396
|
-
|
|
2399
|
+
I(!0);
|
|
2397
2400
|
try {
|
|
2398
2401
|
const M = await m?.();
|
|
2399
2402
|
M?.data && g(M.data);
|
|
2400
2403
|
} catch (M) {
|
|
2401
2404
|
console.error("Failed to load mounts", M);
|
|
2402
2405
|
} finally {
|
|
2403
|
-
|
|
2406
|
+
I(!1);
|
|
2404
2407
|
}
|
|
2405
2408
|
}, k = async () => {
|
|
2406
2409
|
if (b) {
|
|
2407
|
-
|
|
2410
|
+
I(!0);
|
|
2408
2411
|
try {
|
|
2409
|
-
const M = await u?.({ mountId: b.id, name: q, path:
|
|
2412
|
+
const M = await u?.({ mountId: b.id, name: q, path: _ });
|
|
2410
2413
|
M?.data && X(M.data);
|
|
2411
2414
|
} catch (M) {
|
|
2412
2415
|
console.error("Failed to load files", M);
|
|
2413
2416
|
} finally {
|
|
2414
|
-
|
|
2417
|
+
I(!1);
|
|
2415
2418
|
}
|
|
2416
2419
|
}
|
|
2417
2420
|
}, ee = async (M) => {
|
|
2418
|
-
const
|
|
2419
|
-
if (
|
|
2420
|
-
|
|
2421
|
+
const L = M.target.files?.[0];
|
|
2422
|
+
if (L) {
|
|
2423
|
+
I(!0);
|
|
2421
2424
|
try {
|
|
2422
|
-
const te = await
|
|
2425
|
+
const te = await L.arrayBuffer(), v = new Uint8Array(te), H = {
|
|
2423
2426
|
id: `local-${Date.now()}`,
|
|
2424
|
-
name:
|
|
2427
|
+
name: L.name,
|
|
2425
2428
|
type: "file",
|
|
2426
2429
|
path: "/",
|
|
2427
|
-
mimeType:
|
|
2428
|
-
size:
|
|
2430
|
+
mimeType: L.type || "application/octet-stream",
|
|
2431
|
+
size: L.size,
|
|
2429
2432
|
mountId: "local",
|
|
2430
|
-
providerKey:
|
|
2433
|
+
providerKey: L.name,
|
|
2431
2434
|
ownerId: "me"
|
|
2432
2435
|
};
|
|
2433
|
-
|
|
2436
|
+
P(H), r(H, v), p(!1);
|
|
2434
2437
|
} catch (te) {
|
|
2435
2438
|
console.error("Local file selection failed", te);
|
|
2436
2439
|
} finally {
|
|
2437
|
-
|
|
2440
|
+
I(!1);
|
|
2438
2441
|
}
|
|
2439
2442
|
}
|
|
2440
2443
|
}, ae = async (M) => {
|
|
2441
|
-
const
|
|
2442
|
-
if (!(!
|
|
2443
|
-
|
|
2444
|
+
const L = M.target.files?.[0];
|
|
2445
|
+
if (!(!L || !b)) {
|
|
2446
|
+
I(!0);
|
|
2444
2447
|
try {
|
|
2445
|
-
const te = await
|
|
2448
|
+
const te = await L.arrayBuffer(), v = await y?.({
|
|
2446
2449
|
file: new Uint8Array(te),
|
|
2447
|
-
filename:
|
|
2448
|
-
mimeType:
|
|
2450
|
+
filename: L.name,
|
|
2451
|
+
mimeType: L.type || "application/octet-stream",
|
|
2449
2452
|
mountId: b.id,
|
|
2450
|
-
path:
|
|
2453
|
+
path: _
|
|
2451
2454
|
});
|
|
2452
2455
|
if (v?.data) {
|
|
2453
|
-
const
|
|
2454
|
-
|
|
2456
|
+
const H = v.data;
|
|
2457
|
+
P(H), r(H, new Uint8Array(te)), p(!1);
|
|
2455
2458
|
}
|
|
2456
2459
|
} catch (te) {
|
|
2457
2460
|
console.error("Upload failed", te);
|
|
2458
2461
|
} finally {
|
|
2459
|
-
|
|
2462
|
+
I(!1);
|
|
2460
2463
|
}
|
|
2461
2464
|
}
|
|
2462
2465
|
}, le = async () => {
|
|
2463
2466
|
if (!(!i || !b)) {
|
|
2464
|
-
|
|
2467
|
+
I(!0);
|
|
2465
2468
|
try {
|
|
2466
|
-
const M = `${
|
|
2469
|
+
const M = `${_}${i}/`;
|
|
2467
2470
|
f && (await f({
|
|
2468
2471
|
name: i,
|
|
2469
2472
|
type: "folder",
|
|
2470
|
-
path:
|
|
2473
|
+
path: _,
|
|
2471
2474
|
mimeType: "application/x-directory",
|
|
2472
2475
|
size: 0,
|
|
2473
2476
|
mountId: b.id,
|
|
@@ -2477,48 +2480,48 @@ const cr = ({
|
|
|
2477
2480
|
} catch (M) {
|
|
2478
2481
|
console.error("Failed to create folder", M);
|
|
2479
2482
|
} finally {
|
|
2480
|
-
|
|
2483
|
+
I(!1);
|
|
2481
2484
|
}
|
|
2482
2485
|
}
|
|
2483
2486
|
}, G = async (M) => {
|
|
2484
|
-
|
|
2487
|
+
I(!0);
|
|
2485
2488
|
try {
|
|
2486
|
-
const
|
|
2487
|
-
|
|
2488
|
-
} catch (
|
|
2489
|
-
console.error("Failed to download file",
|
|
2489
|
+
const L = await h?.(M.id);
|
|
2490
|
+
P(M), r(M, L), p(!1);
|
|
2491
|
+
} catch (L) {
|
|
2492
|
+
console.error("Failed to download file", L);
|
|
2490
2493
|
} finally {
|
|
2491
|
-
|
|
2494
|
+
I(!1);
|
|
2492
2495
|
}
|
|
2493
|
-
},
|
|
2494
|
-
M.stopPropagation(),
|
|
2496
|
+
}, j = (M) => {
|
|
2497
|
+
M.stopPropagation(), P(null), r(null);
|
|
2495
2498
|
}, E = he(() => {
|
|
2496
|
-
const M = /* @__PURE__ */ new Set(),
|
|
2499
|
+
const M = /* @__PURE__ */ new Set(), L = [];
|
|
2497
2500
|
return $.forEach((te) => {
|
|
2498
2501
|
if (te.type === "folder") {
|
|
2499
|
-
te.path ===
|
|
2502
|
+
te.path === _ && M.add(te.name);
|
|
2500
2503
|
return;
|
|
2501
2504
|
}
|
|
2502
|
-
const v = te.providerKey || te.name, Z = (
|
|
2503
|
-
Z.length > 1 ? M.add(Z[0]) : Z.length === 1 &&
|
|
2505
|
+
const v = te.providerKey || te.name, Z = (_ ? v.substring(_.length) : v).split("/").filter((J) => J !== "");
|
|
2506
|
+
Z.length > 1 ? M.add(Z[0]) : Z.length === 1 && L.push(te);
|
|
2504
2507
|
}), {
|
|
2505
2508
|
folders: Array.from(M).sort(),
|
|
2506
|
-
files:
|
|
2509
|
+
files: L.sort((te, v) => te.name.localeCompare(v.name))
|
|
2507
2510
|
};
|
|
2508
|
-
}, [$,
|
|
2509
|
-
|
|
2511
|
+
}, [$, _]), D = (M) => {
|
|
2512
|
+
K((L) => `${L}${M}/`);
|
|
2510
2513
|
}, z = () => {
|
|
2511
|
-
const M =
|
|
2512
|
-
M.pop(), M.length === 0 ?
|
|
2513
|
-
},
|
|
2514
|
-
const M = E.folders.map((
|
|
2515
|
-
id: `folder-${
|
|
2516
|
-
name:
|
|
2514
|
+
const M = _.split("/").filter((L) => L !== "");
|
|
2515
|
+
M.pop(), M.length === 0 ? K("/") : K(`${M.join("/")}/`);
|
|
2516
|
+
}, R = he(() => {
|
|
2517
|
+
const M = E.folders.map((L) => ({
|
|
2518
|
+
id: `folder-${L}`,
|
|
2519
|
+
name: L,
|
|
2517
2520
|
type: "folder"
|
|
2518
2521
|
}));
|
|
2519
|
-
return E.files.forEach((
|
|
2522
|
+
return E.files.forEach((L) => {
|
|
2520
2523
|
M.push({
|
|
2521
|
-
...
|
|
2524
|
+
...L,
|
|
2522
2525
|
type: "file"
|
|
2523
2526
|
});
|
|
2524
2527
|
}), M;
|
|
@@ -2527,16 +2530,16 @@ const cr = ({
|
|
|
2527
2530
|
id: "name",
|
|
2528
2531
|
header: "Name",
|
|
2529
2532
|
accessor: "name",
|
|
2530
|
-
cell: (M,
|
|
2533
|
+
cell: (M, L) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
2531
2534
|
/* @__PURE__ */ e(
|
|
2532
2535
|
Y,
|
|
2533
2536
|
{
|
|
2534
|
-
icon:
|
|
2537
|
+
icon: L.type === "folder" ? Ae : Ee,
|
|
2535
2538
|
size: "sm",
|
|
2536
|
-
color:
|
|
2539
|
+
color: L.type === "folder" ? "warning" : "secondary"
|
|
2537
2540
|
}
|
|
2538
2541
|
),
|
|
2539
|
-
/* @__PURE__ */ e("span", { className: d(
|
|
2542
|
+
/* @__PURE__ */ e("span", { className: d(L.type === "folder" && "font-medium"), children: M })
|
|
2540
2543
|
] })
|
|
2541
2544
|
},
|
|
2542
2545
|
{
|
|
@@ -2554,26 +2557,26 @@ const cr = ({
|
|
|
2554
2557
|
header: "",
|
|
2555
2558
|
accessor: "id",
|
|
2556
2559
|
align: "right",
|
|
2557
|
-
cell: (M,
|
|
2560
|
+
cell: (M, L) => /* @__PURE__ */ e(
|
|
2558
2561
|
ne,
|
|
2559
2562
|
{
|
|
2560
2563
|
size: "sm",
|
|
2561
2564
|
variant: "outline",
|
|
2562
2565
|
onClick: (te) => {
|
|
2563
|
-
te.stopPropagation(),
|
|
2566
|
+
te.stopPropagation(), L.type === "folder" ? D(L.name) : G(L);
|
|
2564
2567
|
},
|
|
2565
|
-
loading:
|
|
2566
|
-
children:
|
|
2568
|
+
loading: U && L.type === "file" && re?.id === L.id,
|
|
2569
|
+
children: L.type === "folder" ? "Open" : "Select"
|
|
2567
2570
|
}
|
|
2568
2571
|
)
|
|
2569
2572
|
}
|
|
2570
|
-
],
|
|
2573
|
+
], V = [
|
|
2571
2574
|
{
|
|
2572
2575
|
id: "name",
|
|
2573
2576
|
header: "Mount Name",
|
|
2574
2577
|
accessor: "name",
|
|
2575
2578
|
cell: (M) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
|
|
2576
|
-
/* @__PURE__ */ e(Y, { icon:
|
|
2579
|
+
/* @__PURE__ */ e(Y, { icon: _e, size: "sm", color: "primary" }),
|
|
2577
2580
|
/* @__PURE__ */ e("span", { children: M })
|
|
2578
2581
|
] })
|
|
2579
2582
|
},
|
|
@@ -2582,7 +2585,7 @@ const cr = ({
|
|
|
2582
2585
|
header: "",
|
|
2583
2586
|
accessor: "id",
|
|
2584
2587
|
align: "right",
|
|
2585
|
-
cell: (M,
|
|
2588
|
+
cell: (M, L) => /* @__PURE__ */ e(ne, { size: "sm", variant: "outline", onClick: () => A(L), children: "Open" })
|
|
2586
2589
|
}
|
|
2587
2590
|
];
|
|
2588
2591
|
return /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
@@ -2598,12 +2601,12 @@ const cr = ({
|
|
|
2598
2601
|
o && "opacity-50 cursor-not-allowed bg-surface-sunk"
|
|
2599
2602
|
),
|
|
2600
2603
|
children: [
|
|
2601
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(Y, { icon: re ? Ee :
|
|
2604
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(Y, { icon: re ? Ee : _e, color: re ? "primary" : "secondary" }) }),
|
|
2602
2605
|
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: re ? /* @__PURE__ */ e("span", { className: "text-sm text-text font-medium", children: re.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-text-muted", children: s }) }),
|
|
2603
2606
|
re && !o && /* @__PURE__ */ e(
|
|
2604
2607
|
"button",
|
|
2605
2608
|
{
|
|
2606
|
-
onClick:
|
|
2609
|
+
onClick: j,
|
|
2607
2610
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
2608
2611
|
children: /* @__PURE__ */ e(Y, { icon: we, size: "xs" })
|
|
2609
2612
|
}
|
|
@@ -2613,16 +2616,16 @@ const cr = ({
|
|
|
2613
2616
|
),
|
|
2614
2617
|
a && /* @__PURE__ */ e(de, { variant: "body", size: "xs", className: "text-danger-fg", children: a }),
|
|
2615
2618
|
/* @__PURE__ */ e(
|
|
2616
|
-
|
|
2619
|
+
He,
|
|
2617
2620
|
{
|
|
2618
2621
|
open: x,
|
|
2619
2622
|
onClose: () => {
|
|
2620
|
-
p(!1),
|
|
2623
|
+
p(!1), A(null), K("/"), C(!1);
|
|
2621
2624
|
},
|
|
2622
2625
|
title: b ? `Explorer: ${b.name}` : "Select Storage Mount",
|
|
2623
2626
|
size: "lg",
|
|
2624
2627
|
children: /* @__PURE__ */ e(
|
|
2625
|
-
|
|
2628
|
+
nr,
|
|
2626
2629
|
{
|
|
2627
2630
|
variant: "pills",
|
|
2628
2631
|
items: [
|
|
@@ -2637,19 +2640,19 @@ const cr = ({
|
|
|
2637
2640
|
variant: "ghost",
|
|
2638
2641
|
size: "sm",
|
|
2639
2642
|
onClick: () => {
|
|
2640
|
-
|
|
2643
|
+
_ && _ !== "/" ? z() : A(null);
|
|
2641
2644
|
},
|
|
2642
2645
|
leftIcon: /* @__PURE__ */ e(Y, { icon: st, size: "xs" }),
|
|
2643
|
-
children:
|
|
2646
|
+
children: _ ? "Back" : "Back to Mounts"
|
|
2644
2647
|
}
|
|
2645
2648
|
),
|
|
2646
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2649
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children: _ }) }),
|
|
2647
2650
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
2648
2651
|
be,
|
|
2649
2652
|
{
|
|
2650
2653
|
placeholder: "Search...",
|
|
2651
2654
|
value: q,
|
|
2652
|
-
onChange: (M) =>
|
|
2655
|
+
onChange: (M) => W(M.target.value),
|
|
2653
2656
|
startIcon: /* @__PURE__ */ e(Se, { size: 14 }),
|
|
2654
2657
|
fullWidth: !0,
|
|
2655
2658
|
size: "sm"
|
|
@@ -2673,7 +2676,7 @@ const cr = ({
|
|
|
2673
2676
|
size: "sm",
|
|
2674
2677
|
onClick: () => N.current?.click(),
|
|
2675
2678
|
leftIcon: /* @__PURE__ */ e(Y, { icon: lt, size: "xs" }),
|
|
2676
|
-
loading:
|
|
2679
|
+
loading: U,
|
|
2677
2680
|
children: "Upload"
|
|
2678
2681
|
}
|
|
2679
2682
|
),
|
|
@@ -2690,7 +2693,7 @@ const cr = ({
|
|
|
2690
2693
|
] })
|
|
2691
2694
|
] }),
|
|
2692
2695
|
ce && /* @__PURE__ */ c("div", { className: "flex items-center gap-2 p-3 bg-surface-sunk rounded-lg border border-border", children: [
|
|
2693
|
-
/* @__PURE__ */ e(Y, { icon:
|
|
2696
|
+
/* @__PURE__ */ e(Y, { icon: Ae, size: "sm", color: "warning" }),
|
|
2694
2697
|
/* @__PURE__ */ e(
|
|
2695
2698
|
be,
|
|
2696
2699
|
{
|
|
@@ -2701,27 +2704,27 @@ const cr = ({
|
|
|
2701
2704
|
autoFocus: !0
|
|
2702
2705
|
}
|
|
2703
2706
|
),
|
|
2704
|
-
/* @__PURE__ */ e(ne, { size: "sm", onClick: le, loading:
|
|
2707
|
+
/* @__PURE__ */ e(ne, { size: "sm", onClick: le, loading: U, children: "Create" }),
|
|
2705
2708
|
/* @__PURE__ */ e(ne, { size: "sm", variant: "ghost", onClick: () => C(!1), children: "Cancel" })
|
|
2706
2709
|
] }),
|
|
2707
2710
|
/* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2708
|
-
|
|
2711
|
+
je,
|
|
2709
2712
|
{
|
|
2710
|
-
data:
|
|
2713
|
+
data: R,
|
|
2711
2714
|
columns: B,
|
|
2712
|
-
loading:
|
|
2715
|
+
loading: U,
|
|
2713
2716
|
emptyContent: "This folder is empty",
|
|
2714
2717
|
onRowClick: (M) => M.type === "folder" ? D(M.name) : G(M)
|
|
2715
2718
|
}
|
|
2716
2719
|
) })
|
|
2717
2720
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2718
|
-
|
|
2721
|
+
je,
|
|
2719
2722
|
{
|
|
2720
2723
|
data: w,
|
|
2721
|
-
columns:
|
|
2722
|
-
loading:
|
|
2724
|
+
columns: V,
|
|
2725
|
+
loading: U,
|
|
2723
2726
|
emptyContent: "No storage mounts configured",
|
|
2724
|
-
onRowClick: (M) =>
|
|
2727
|
+
onRowClick: (M) => A(M)
|
|
2725
2728
|
}
|
|
2726
2729
|
) }) })
|
|
2727
2730
|
},
|
|
@@ -2737,7 +2740,7 @@ const cr = ({
|
|
|
2737
2740
|
" be uploaded to platform storage."
|
|
2738
2741
|
] }),
|
|
2739
2742
|
/* @__PURE__ */ c("label", { className: "cursor-pointer", children: [
|
|
2740
|
-
/* @__PURE__ */ e(ne, { variant: "primary", size: "lg", loading:
|
|
2743
|
+
/* @__PURE__ */ e(ne, { variant: "primary", size: "lg", loading: U, className: "pointer-events-none", children: "Browse Local File" }),
|
|
2741
2744
|
/* @__PURE__ */ e(
|
|
2742
2745
|
"input",
|
|
2743
2746
|
{
|
|
@@ -2745,7 +2748,7 @@ const cr = ({
|
|
|
2745
2748
|
className: "hidden",
|
|
2746
2749
|
onChange: ee,
|
|
2747
2750
|
accept: l,
|
|
2748
|
-
disabled:
|
|
2751
|
+
disabled: U
|
|
2749
2752
|
}
|
|
2750
2753
|
)
|
|
2751
2754
|
] })
|
|
@@ -2757,7 +2760,7 @@ const cr = ({
|
|
|
2757
2760
|
}
|
|
2758
2761
|
)
|
|
2759
2762
|
] });
|
|
2760
|
-
},
|
|
2763
|
+
}, mr = {
|
|
2761
2764
|
sm: "px-3 py-1.5 text-sm",
|
|
2762
2765
|
md: "px-3 py-2 text-base",
|
|
2763
2766
|
lg: "px-3 py-2 text-md",
|
|
@@ -2784,7 +2787,7 @@ const cr = ({
|
|
|
2784
2787
|
{
|
|
2785
2788
|
htmlFor: w,
|
|
2786
2789
|
className: d(
|
|
2787
|
-
|
|
2790
|
+
Re,
|
|
2788
2791
|
g ? "text-danger-fg" : "text-text-subtle",
|
|
2789
2792
|
u
|
|
2790
2793
|
),
|
|
@@ -2806,7 +2809,7 @@ const cr = ({
|
|
|
2806
2809
|
"placeholder:text-text-subtle",
|
|
2807
2810
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2808
2811
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
2809
|
-
|
|
2812
|
+
mr[s],
|
|
2810
2813
|
g ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
2811
2814
|
m
|
|
2812
2815
|
),
|
|
@@ -2833,13 +2836,13 @@ const cr = ({
|
|
|
2833
2836
|
}
|
|
2834
2837
|
);
|
|
2835
2838
|
De.displayName = "TextArea";
|
|
2836
|
-
function
|
|
2839
|
+
function Pe(t, r) {
|
|
2837
2840
|
return r.split(".").reduce(
|
|
2838
2841
|
(n, s) => n && typeof n == "object" && s in n ? n[s] : void 0,
|
|
2839
2842
|
t
|
|
2840
2843
|
);
|
|
2841
2844
|
}
|
|
2842
|
-
function
|
|
2845
|
+
function fr(t, r, n) {
|
|
2843
2846
|
const s = r.split("."), a = Array.isArray(t) ? [...t] : { ...t };
|
|
2844
2847
|
let o = a;
|
|
2845
2848
|
for (let l = 0; l < s.length - 1; l++) {
|
|
@@ -2848,7 +2851,7 @@ function dr(t, r, n) {
|
|
|
2848
2851
|
}
|
|
2849
2852
|
return o[s[s.length - 1]] = n, a;
|
|
2850
2853
|
}
|
|
2851
|
-
function
|
|
2854
|
+
function hr(t, r) {
|
|
2852
2855
|
const n = r.split("."), s = Array.isArray(t) ? [...t] : { ...t };
|
|
2853
2856
|
let a = s;
|
|
2854
2857
|
for (let o = 0; o < n.length - 1; o++) {
|
|
@@ -2858,7 +2861,7 @@ function ur(t, r) {
|
|
|
2858
2861
|
}
|
|
2859
2862
|
return delete a[n[n.length - 1]], s;
|
|
2860
2863
|
}
|
|
2861
|
-
const
|
|
2864
|
+
const mn = ({
|
|
2862
2865
|
groups: t,
|
|
2863
2866
|
data: r,
|
|
2864
2867
|
onSubmit: n,
|
|
@@ -2876,11 +2879,11 @@ const rn = ({
|
|
|
2876
2879
|
ref: w,
|
|
2877
2880
|
sdk: g
|
|
2878
2881
|
}) => {
|
|
2879
|
-
const [b,
|
|
2882
|
+
const [b, A] = F(r || {}), [_, K] = F({}), [$, X] = F({});
|
|
2880
2883
|
Q(() => {
|
|
2881
|
-
r &&
|
|
2884
|
+
r && A({ ...r });
|
|
2882
2885
|
}, [r]);
|
|
2883
|
-
const
|
|
2886
|
+
const U = ue(
|
|
2884
2887
|
(C, i, S) => {
|
|
2885
2888
|
const N = t.flatMap((T) => T.items).find((T) => T.name === C);
|
|
2886
2889
|
if (!N) return null;
|
|
@@ -2897,11 +2900,11 @@ const rn = ({
|
|
|
2897
2900
|
if (i.forEach((ee, ae) => {
|
|
2898
2901
|
const le = {};
|
|
2899
2902
|
for (const G of N.arrayFields) {
|
|
2900
|
-
const
|
|
2901
|
-
if (G.required && (
|
|
2903
|
+
const j = ee?.[G.name];
|
|
2904
|
+
if (G.required && (j == null || j === ""))
|
|
2902
2905
|
le[G.name] = `${G.label} is required`, k = !0;
|
|
2903
2906
|
else if (G.validator) {
|
|
2904
|
-
const E = G.validator(
|
|
2907
|
+
const E = G.validator(j, ee);
|
|
2905
2908
|
E && (le[G.name] = E, k = !0);
|
|
2906
2909
|
}
|
|
2907
2910
|
}
|
|
@@ -2913,21 +2916,21 @@ const rn = ({
|
|
|
2913
2916
|
return N.validator ? N.validator(i, S) : null;
|
|
2914
2917
|
},
|
|
2915
2918
|
[t]
|
|
2916
|
-
),
|
|
2919
|
+
), I = ue(
|
|
2917
2920
|
(C, i) => {
|
|
2918
|
-
let S =
|
|
2921
|
+
let S = fr(
|
|
2919
2922
|
b,
|
|
2920
2923
|
C,
|
|
2921
2924
|
i
|
|
2922
2925
|
);
|
|
2923
|
-
t.flatMap((k) => k.items).find((k) => k.name === C)?.removeIfEmpty && (i == null || i === "") && (S =
|
|
2924
|
-
const T =
|
|
2925
|
-
|
|
2926
|
+
t.flatMap((k) => k.items).find((k) => k.name === C)?.removeIfEmpty && (i == null || i === "") && (S = hr(S, C)), A(S), X((k) => ({ ...k, [C]: !0 }));
|
|
2927
|
+
const T = U(C, i, S);
|
|
2928
|
+
K((k) => ({
|
|
2926
2929
|
...k,
|
|
2927
2930
|
[C]: T || ""
|
|
2928
2931
|
})), a?.(S, C);
|
|
2929
2932
|
},
|
|
2930
|
-
[b, t,
|
|
2933
|
+
[b, t, U, a]
|
|
2931
2934
|
), q = ue(
|
|
2932
2935
|
async (C) => {
|
|
2933
2936
|
if (C.preventDefault(), x) return;
|
|
@@ -2935,9 +2938,9 @@ const rn = ({
|
|
|
2935
2938
|
for (const T of S) {
|
|
2936
2939
|
if (T.hidden || T.conditional && !T.conditional(b))
|
|
2937
2940
|
continue;
|
|
2938
|
-
const k =
|
|
2941
|
+
const k = U(
|
|
2939
2942
|
T.name,
|
|
2940
|
-
|
|
2943
|
+
Pe(b, T.name),
|
|
2941
2944
|
b
|
|
2942
2945
|
);
|
|
2943
2946
|
k && (i[T.name] = k);
|
|
@@ -2946,15 +2949,15 @@ const rn = ({
|
|
|
2946
2949
|
const T = l(b);
|
|
2947
2950
|
T && Object.assign(i, T);
|
|
2948
2951
|
}
|
|
2949
|
-
if (
|
|
2952
|
+
if (K(i), Object.keys(i).some((T) => i[T]))
|
|
2950
2953
|
return;
|
|
2951
2954
|
const N = o ? o(b) : b;
|
|
2952
2955
|
await n?.(b, N);
|
|
2953
2956
|
},
|
|
2954
|
-
[b, t,
|
|
2955
|
-
),
|
|
2957
|
+
[b, t, U, l, o, n, x]
|
|
2958
|
+
), W = ue(
|
|
2956
2959
|
(C) => {
|
|
2957
|
-
const i =
|
|
2960
|
+
const i = Pe(b, C.name), S = $[C.name] ? _[C.name] : void 0, N = C.disabled || x, T = {
|
|
2958
2961
|
value: i || "",
|
|
2959
2962
|
disabled: N,
|
|
2960
2963
|
required: C.required,
|
|
@@ -2972,7 +2975,7 @@ const rn = ({
|
|
|
2972
2975
|
be,
|
|
2973
2976
|
{
|
|
2974
2977
|
...T,
|
|
2975
|
-
onChange: (k) =>
|
|
2978
|
+
onChange: (k) => I(C.name, k.target.value),
|
|
2976
2979
|
type: C.textType || C.type,
|
|
2977
2980
|
autoComplete: C.autocomplete,
|
|
2978
2981
|
error: S,
|
|
@@ -2984,7 +2987,7 @@ const rn = ({
|
|
|
2984
2987
|
De,
|
|
2985
2988
|
{
|
|
2986
2989
|
...T,
|
|
2987
|
-
onChange: (k) =>
|
|
2990
|
+
onChange: (k) => I(C.name, k.target.value),
|
|
2988
2991
|
rows: 4,
|
|
2989
2992
|
error: S,
|
|
2990
2993
|
size: f
|
|
@@ -2995,7 +2998,7 @@ const rn = ({
|
|
|
2995
2998
|
Ne,
|
|
2996
2999
|
{
|
|
2997
3000
|
...T,
|
|
2998
|
-
onChange: (k) =>
|
|
3001
|
+
onChange: (k) => I(C.name, k),
|
|
2999
3002
|
options: (C.options || []).map((k) => ({
|
|
3000
3003
|
...k,
|
|
3001
3004
|
value: String(k.value)
|
|
@@ -3014,7 +3017,7 @@ const rn = ({
|
|
|
3014
3017
|
...T,
|
|
3015
3018
|
label: C.label,
|
|
3016
3019
|
checked: !!i,
|
|
3017
|
-
onChange: (k) =>
|
|
3020
|
+
onChange: (k) => I(C.name, k.target.checked),
|
|
3018
3021
|
size: f
|
|
3019
3022
|
}
|
|
3020
3023
|
);
|
|
@@ -3031,7 +3034,7 @@ const rn = ({
|
|
|
3031
3034
|
name: C.name,
|
|
3032
3035
|
value: k.value,
|
|
3033
3036
|
checked: i === k.value,
|
|
3034
|
-
onChange: () =>
|
|
3037
|
+
onChange: () => I(C.name, k.value),
|
|
3035
3038
|
disabled: N || k.disabled,
|
|
3036
3039
|
className: "size-checkbox shrink-0 border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3037
3040
|
}
|
|
@@ -3047,17 +3050,17 @@ const rn = ({
|
|
|
3047
3050
|
{
|
|
3048
3051
|
...T,
|
|
3049
3052
|
value: i ? new Date(i) : null,
|
|
3050
|
-
onChange: (k) =>
|
|
3053
|
+
onChange: (k) => I(C.name, k),
|
|
3051
3054
|
size: f
|
|
3052
3055
|
}
|
|
3053
3056
|
);
|
|
3054
3057
|
case "file":
|
|
3055
3058
|
return /* @__PURE__ */ e(
|
|
3056
|
-
|
|
3059
|
+
ur,
|
|
3057
3060
|
{
|
|
3058
3061
|
...T,
|
|
3059
3062
|
value: i,
|
|
3060
|
-
onChange: (k) =>
|
|
3063
|
+
onChange: (k) => I(C.name, k),
|
|
3061
3064
|
error: S,
|
|
3062
3065
|
onListFiles: (k) => g?.http.invoke({
|
|
3063
3066
|
method: "POST",
|
|
@@ -3086,10 +3089,10 @@ const rn = ({
|
|
|
3086
3089
|
);
|
|
3087
3090
|
case "folder":
|
|
3088
3091
|
return /* @__PURE__ */ e(
|
|
3089
|
-
|
|
3092
|
+
Ft,
|
|
3090
3093
|
{
|
|
3091
3094
|
value: i || {},
|
|
3092
|
-
onChange: (k) =>
|
|
3095
|
+
onChange: (k) => I(C.name, k),
|
|
3093
3096
|
onListFolders: () => g?.http.invoke({
|
|
3094
3097
|
method: "GET",
|
|
3095
3098
|
action: "storage.mount"
|
|
@@ -3102,7 +3105,7 @@ const rn = ({
|
|
|
3102
3105
|
case "custom":
|
|
3103
3106
|
return C.customComponent?.({
|
|
3104
3107
|
value: i,
|
|
3105
|
-
onChange: (k) =>
|
|
3108
|
+
onChange: (k) => I(C.name, k),
|
|
3106
3109
|
error: S,
|
|
3107
3110
|
disabled: N
|
|
3108
3111
|
});
|
|
@@ -3115,21 +3118,21 @@ const rn = ({
|
|
|
3115
3118
|
} catch {
|
|
3116
3119
|
}
|
|
3117
3120
|
const ae = () => {
|
|
3118
|
-
|
|
3119
|
-
}, le = (
|
|
3120
|
-
|
|
3121
|
+
I(C.name, [...k, {}]);
|
|
3122
|
+
}, le = (j) => {
|
|
3123
|
+
I(
|
|
3121
3124
|
C.name,
|
|
3122
|
-
k.filter((E, D) => D !==
|
|
3125
|
+
k.filter((E, D) => D !== j)
|
|
3123
3126
|
);
|
|
3124
|
-
}, G = (
|
|
3127
|
+
}, G = (j, E, D) => {
|
|
3125
3128
|
const z = [...k];
|
|
3126
|
-
z[
|
|
3127
|
-
...z[
|
|
3129
|
+
z[j] = {
|
|
3130
|
+
...z[j],
|
|
3128
3131
|
[E]: D
|
|
3129
|
-
},
|
|
3132
|
+
}, I(C.name, z);
|
|
3130
3133
|
};
|
|
3131
3134
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
3132
|
-
k.map((
|
|
3135
|
+
k.map((j, E) => /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
|
|
3133
3136
|
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: C.arrayFields?.map((D) => {
|
|
3134
3137
|
const z = ee?.[E]?.[D.name];
|
|
3135
3138
|
return /* @__PURE__ */ c(
|
|
@@ -3142,8 +3145,8 @@ const rn = ({
|
|
|
3142
3145
|
D.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3143
3146
|
] }),
|
|
3144
3147
|
(() => {
|
|
3145
|
-
const
|
|
3146
|
-
value:
|
|
3148
|
+
const R = {
|
|
3149
|
+
value: j?.[D.name] || "",
|
|
3147
3150
|
disabled: N,
|
|
3148
3151
|
required: D.required,
|
|
3149
3152
|
placeholder: D.placeholder,
|
|
@@ -3159,7 +3162,7 @@ const rn = ({
|
|
|
3159
3162
|
return /* @__PURE__ */ e(
|
|
3160
3163
|
be,
|
|
3161
3164
|
{
|
|
3162
|
-
...
|
|
3165
|
+
...R,
|
|
3163
3166
|
onChange: (B) => G(
|
|
3164
3167
|
E,
|
|
3165
3168
|
D.name,
|
|
@@ -3175,7 +3178,7 @@ const rn = ({
|
|
|
3175
3178
|
return /* @__PURE__ */ e(
|
|
3176
3179
|
De,
|
|
3177
3180
|
{
|
|
3178
|
-
...
|
|
3181
|
+
...R,
|
|
3179
3182
|
onChange: (B) => G(
|
|
3180
3183
|
E,
|
|
3181
3184
|
D.name,
|
|
@@ -3190,7 +3193,7 @@ const rn = ({
|
|
|
3190
3193
|
return /* @__PURE__ */ e(
|
|
3191
3194
|
Ne,
|
|
3192
3195
|
{
|
|
3193
|
-
...
|
|
3196
|
+
...R,
|
|
3194
3197
|
onChange: (B) => G(
|
|
3195
3198
|
E,
|
|
3196
3199
|
D.name,
|
|
@@ -3213,8 +3216,8 @@ const rn = ({
|
|
|
3213
3216
|
return /* @__PURE__ */ e(
|
|
3214
3217
|
pe,
|
|
3215
3218
|
{
|
|
3216
|
-
...
|
|
3217
|
-
checked: !!
|
|
3219
|
+
...R,
|
|
3220
|
+
checked: !!j?.[D.name],
|
|
3218
3221
|
onChange: (B) => G(
|
|
3219
3222
|
E,
|
|
3220
3223
|
D.name,
|
|
@@ -3235,7 +3238,7 @@ const rn = ({
|
|
|
3235
3238
|
type: "radio",
|
|
3236
3239
|
name: `${C.name}.${E}.${D.name}`,
|
|
3237
3240
|
value: B.value,
|
|
3238
|
-
checked:
|
|
3241
|
+
checked: j?.[D.name] === B.value,
|
|
3239
3242
|
onChange: () => G(
|
|
3240
3243
|
E,
|
|
3241
3244
|
D.name,
|
|
@@ -3251,16 +3254,16 @@ const rn = ({
|
|
|
3251
3254
|
B.value
|
|
3252
3255
|
)) });
|
|
3253
3256
|
case "date": {
|
|
3254
|
-
const B =
|
|
3257
|
+
const B = j?.[D.name];
|
|
3255
3258
|
return /* @__PURE__ */ e(
|
|
3256
3259
|
$e,
|
|
3257
3260
|
{
|
|
3258
|
-
...
|
|
3261
|
+
...R,
|
|
3259
3262
|
value: B ? new Date(B) : null,
|
|
3260
|
-
onChange: (
|
|
3263
|
+
onChange: (V) => G(
|
|
3261
3264
|
E,
|
|
3262
3265
|
D.name,
|
|
3263
|
-
|
|
3266
|
+
V
|
|
3264
3267
|
),
|
|
3265
3268
|
size: f
|
|
3266
3269
|
}
|
|
@@ -3268,7 +3271,7 @@ const rn = ({
|
|
|
3268
3271
|
}
|
|
3269
3272
|
case "custom":
|
|
3270
3273
|
return D.customComponent?.({
|
|
3271
|
-
value:
|
|
3274
|
+
value: j?.[D.name],
|
|
3272
3275
|
onChange: (B) => G(
|
|
3273
3276
|
E,
|
|
3274
3277
|
D.name,
|
|
@@ -3328,7 +3331,7 @@ const rn = ({
|
|
|
3328
3331
|
return null;
|
|
3329
3332
|
}
|
|
3330
3333
|
},
|
|
3331
|
-
[b, $,
|
|
3334
|
+
[b, $, _, x, f, I]
|
|
3332
3335
|
), re = ue(
|
|
3333
3336
|
(C) => {
|
|
3334
3337
|
if (C.conditional && !C.conditional(b))
|
|
@@ -3355,7 +3358,7 @@ const rn = ({
|
|
|
3355
3358
|
C.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: C.description })
|
|
3356
3359
|
] }),
|
|
3357
3360
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: S, children: i.map((N) => {
|
|
3358
|
-
const T = $[N.name] ?
|
|
3361
|
+
const T = $[N.name] ? _[N.name] : void 0;
|
|
3359
3362
|
return /* @__PURE__ */ c(
|
|
3360
3363
|
"div",
|
|
3361
3364
|
{
|
|
@@ -3372,7 +3375,7 @@ const rn = ({
|
|
|
3372
3375
|
N.label,
|
|
3373
3376
|
N.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3374
3377
|
] }),
|
|
3375
|
-
|
|
3378
|
+
W(N),
|
|
3376
3379
|
N.help && !T && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-text-subtle", children: N.help })
|
|
3377
3380
|
]
|
|
3378
3381
|
},
|
|
@@ -3384,8 +3387,8 @@ const rn = ({
|
|
|
3384
3387
|
C.id
|
|
3385
3388
|
);
|
|
3386
3389
|
},
|
|
3387
|
-
[b, $,
|
|
3388
|
-
),
|
|
3390
|
+
[b, $, _, W]
|
|
3391
|
+
), P = d(
|
|
3389
3392
|
"overflow-hidden rounded-lg border border-border bg-surface",
|
|
3390
3393
|
{
|
|
3391
3394
|
"max-w-md": f === "sm",
|
|
@@ -3395,7 +3398,7 @@ const rn = ({
|
|
|
3395
3398
|
},
|
|
3396
3399
|
p
|
|
3397
3400
|
), ce = f === "full" ? "md" : f;
|
|
3398
|
-
return /* @__PURE__ */ c("form", { ref: w, onSubmit: q, className:
|
|
3401
|
+
return /* @__PURE__ */ c("form", { ref: w, onSubmit: q, className: P, children: [
|
|
3399
3402
|
!y && /* @__PURE__ */ e("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": !0 }),
|
|
3400
3403
|
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(re) }),
|
|
3401
3404
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle bg-surface-sunk px-5 py-3", children: y && /* @__PURE__ */ c(xe, { children: [
|
|
@@ -3427,7 +3430,7 @@ const rn = ({
|
|
|
3427
3430
|
] }) })
|
|
3428
3431
|
] });
|
|
3429
3432
|
};
|
|
3430
|
-
function
|
|
3433
|
+
function fn({
|
|
3431
3434
|
open: t,
|
|
3432
3435
|
title: r,
|
|
3433
3436
|
description: n,
|
|
@@ -3439,7 +3442,7 @@ function nn({
|
|
|
3439
3442
|
onCancel: m
|
|
3440
3443
|
}) {
|
|
3441
3444
|
return /* @__PURE__ */ e(
|
|
3442
|
-
|
|
3445
|
+
He,
|
|
3443
3446
|
{
|
|
3444
3447
|
open: t,
|
|
3445
3448
|
onClose: m,
|
|
@@ -3461,7 +3464,7 @@ function nn({
|
|
|
3461
3464
|
}
|
|
3462
3465
|
);
|
|
3463
3466
|
}
|
|
3464
|
-
const
|
|
3467
|
+
const xr = {
|
|
3465
3468
|
default: "bg-surface-hover text-text",
|
|
3466
3469
|
primary: "bg-accent-soft text-accent",
|
|
3467
3470
|
secondary: "bg-surface-hover text-text-muted",
|
|
@@ -3471,11 +3474,11 @@ const mr = {
|
|
|
3471
3474
|
info: "bg-info-soft text-info-fg",
|
|
3472
3475
|
// Internal-note amber. Never for customer-visible content.
|
|
3473
3476
|
note: "bg-note-soft text-note"
|
|
3474
|
-
},
|
|
3477
|
+
}, br = {
|
|
3475
3478
|
sm: "px-2 py-0.5 text-xs",
|
|
3476
3479
|
md: "px-2.5 py-1 text-sm",
|
|
3477
3480
|
lg: "px-3 py-1.5 text-base"
|
|
3478
|
-
},
|
|
3481
|
+
}, pr = {
|
|
3479
3482
|
default: "bg-surface-hover",
|
|
3480
3483
|
primary: "bg-accent",
|
|
3481
3484
|
secondary: "bg-surface-hover",
|
|
@@ -3485,7 +3488,7 @@ const mr = {
|
|
|
3485
3488
|
info: "bg-info",
|
|
3486
3489
|
note: "bg-note"
|
|
3487
3490
|
};
|
|
3488
|
-
function
|
|
3491
|
+
function hn({
|
|
3489
3492
|
variant: t = "default",
|
|
3490
3493
|
size: r = "md",
|
|
3491
3494
|
dot: n = !1,
|
|
@@ -3503,9 +3506,9 @@ function sn({
|
|
|
3503
3506
|
// Base styles
|
|
3504
3507
|
"inline-flex items-center font-medium rounded-full",
|
|
3505
3508
|
// Variant styles
|
|
3506
|
-
|
|
3509
|
+
xr[t],
|
|
3507
3510
|
// Size styles
|
|
3508
|
-
|
|
3511
|
+
br[r],
|
|
3509
3512
|
l
|
|
3510
3513
|
),
|
|
3511
3514
|
...m,
|
|
@@ -3515,7 +3518,7 @@ function sn({
|
|
|
3515
3518
|
{
|
|
3516
3519
|
className: d(
|
|
3517
3520
|
"w-2 h-2 rounded-full mr-1.5",
|
|
3518
|
-
|
|
3521
|
+
pr[t]
|
|
3519
3522
|
)
|
|
3520
3523
|
}
|
|
3521
3524
|
),
|
|
@@ -3534,11 +3537,11 @@ function sn({
|
|
|
3534
3537
|
}
|
|
3535
3538
|
);
|
|
3536
3539
|
}
|
|
3537
|
-
const
|
|
3540
|
+
const gr = {
|
|
3538
3541
|
neutral: "bg-surface-hover text-text-muted",
|
|
3539
3542
|
success: "bg-success-soft text-success-fg"
|
|
3540
3543
|
};
|
|
3541
|
-
function
|
|
3544
|
+
function xn({
|
|
3542
3545
|
icon: t,
|
|
3543
3546
|
tone: r = "neutral",
|
|
3544
3547
|
title: n,
|
|
@@ -3558,7 +3561,7 @@ function an({
|
|
|
3558
3561
|
),
|
|
3559
3562
|
...u,
|
|
3560
3563
|
children: [
|
|
3561
|
-
t != null && /* @__PURE__ */ e("span", { className: d("flex size-disc items-center justify-center rounded-full text-2xl",
|
|
3564
|
+
t != null && /* @__PURE__ */ e("span", { className: d("flex size-disc items-center justify-center rounded-full text-2xl", gr[r]), children: t }),
|
|
3562
3565
|
/* @__PURE__ */ e("div", { className: "text-lg font-semibold text-text", children: n }),
|
|
3563
3566
|
s && /* @__PURE__ */ e("div", { className: "max-w-sm text-sm leading-relaxed text-text-muted", children: s }),
|
|
3564
3567
|
a && /* @__PURE__ */ e("div", { className: "flex gap-2 pt-1.5", children: a })
|
|
@@ -3566,7 +3569,7 @@ function an({
|
|
|
3566
3569
|
}
|
|
3567
3570
|
);
|
|
3568
3571
|
}
|
|
3569
|
-
function
|
|
3572
|
+
function bn({ children: t, className: r, ...n }) {
|
|
3570
3573
|
return /* @__PURE__ */ e(
|
|
3571
3574
|
"kbd",
|
|
3572
3575
|
{
|
|
@@ -3579,14 +3582,14 @@ function ln({ children: t, className: r, ...n }) {
|
|
|
3579
3582
|
}
|
|
3580
3583
|
);
|
|
3581
3584
|
}
|
|
3582
|
-
const
|
|
3585
|
+
const vr = {
|
|
3583
3586
|
sm: "h-1",
|
|
3584
3587
|
md: "h-1.5"
|
|
3585
|
-
},
|
|
3588
|
+
}, yr = {
|
|
3586
3589
|
accent: "bg-accent",
|
|
3587
3590
|
success: "bg-success"
|
|
3588
3591
|
};
|
|
3589
|
-
function
|
|
3592
|
+
function pn({ value: t, variant: r = "accent", size: n = "md", className: s, ...a }) {
|
|
3590
3593
|
const o = Math.max(0, Math.min(100, t));
|
|
3591
3594
|
return /* @__PURE__ */ e(
|
|
3592
3595
|
"div",
|
|
@@ -3595,37 +3598,37 @@ function on({ value: t, variant: r = "accent", size: n = "md", className: s, ...
|
|
|
3595
3598
|
"aria-valuenow": Math.round(o),
|
|
3596
3599
|
"aria-valuemin": 0,
|
|
3597
3600
|
"aria-valuemax": 100,
|
|
3598
|
-
className: d("w-full overflow-hidden rounded-full bg-surface-hover",
|
|
3601
|
+
className: d("w-full overflow-hidden rounded-full bg-surface-hover", vr[n], s),
|
|
3599
3602
|
...a,
|
|
3600
3603
|
children: /* @__PURE__ */ e(
|
|
3601
3604
|
"div",
|
|
3602
3605
|
{
|
|
3603
|
-
className: d("h-full rounded-full transition-[width] duration-300 ease-out",
|
|
3606
|
+
className: d("h-full rounded-full transition-[width] duration-300 ease-out", yr[r]),
|
|
3604
3607
|
style: { width: `${o}%` }
|
|
3605
3608
|
}
|
|
3606
3609
|
)
|
|
3607
3610
|
}
|
|
3608
3611
|
);
|
|
3609
3612
|
}
|
|
3610
|
-
const
|
|
3613
|
+
const Nr = {
|
|
3611
3614
|
xs: "h-3 w-3",
|
|
3612
3615
|
sm: "h-4 w-4",
|
|
3613
3616
|
md: "h-6 w-6",
|
|
3614
3617
|
lg: "h-8 w-8",
|
|
3615
3618
|
xl: "h-12 w-12"
|
|
3616
|
-
},
|
|
3619
|
+
}, wr = {
|
|
3617
3620
|
primary: "text-accent",
|
|
3618
3621
|
secondary: "text-text-muted",
|
|
3619
3622
|
white: "text-white",
|
|
3620
3623
|
current: "text-current"
|
|
3621
|
-
},
|
|
3624
|
+
}, kr = {
|
|
3622
3625
|
xs: "text-xs",
|
|
3623
3626
|
sm: "text-sm",
|
|
3624
3627
|
md: "text-sm",
|
|
3625
3628
|
lg: "text-base",
|
|
3626
3629
|
xl: "text-lg"
|
|
3627
3630
|
};
|
|
3628
|
-
function
|
|
3631
|
+
function gn({
|
|
3629
3632
|
size: t = "md",
|
|
3630
3633
|
variant: r = "primary",
|
|
3631
3634
|
label: n = "Loading...",
|
|
@@ -3648,8 +3651,8 @@ function cn({
|
|
|
3648
3651
|
{
|
|
3649
3652
|
className: d(
|
|
3650
3653
|
"animate-spin",
|
|
3651
|
-
|
|
3652
|
-
|
|
3654
|
+
Nr[t],
|
|
3655
|
+
wr[r]
|
|
3653
3656
|
),
|
|
3654
3657
|
fill: "none",
|
|
3655
3658
|
viewBox: "0 0 24 24",
|
|
@@ -3683,7 +3686,7 @@ function cn({
|
|
|
3683
3686
|
{
|
|
3684
3687
|
className: d(
|
|
3685
3688
|
"text-text-muted",
|
|
3686
|
-
|
|
3689
|
+
kr[t]
|
|
3687
3690
|
),
|
|
3688
3691
|
children: n
|
|
3689
3692
|
}
|
|
@@ -3693,7 +3696,7 @@ function cn({
|
|
|
3693
3696
|
}
|
|
3694
3697
|
);
|
|
3695
3698
|
}
|
|
3696
|
-
const
|
|
3699
|
+
const Cr = {
|
|
3697
3700
|
neutral: "bg-text-disabled",
|
|
3698
3701
|
accent: "bg-accent",
|
|
3699
3702
|
success: "bg-success",
|
|
@@ -3707,7 +3710,7 @@ const Nr = {
|
|
|
3707
3710
|
"cat-4": "bg-cat-4",
|
|
3708
3711
|
"cat-5": "bg-cat-5"
|
|
3709
3712
|
};
|
|
3710
|
-
function
|
|
3713
|
+
function vn({
|
|
3711
3714
|
tone: t = "neutral",
|
|
3712
3715
|
shape: r = "round",
|
|
3713
3716
|
pulse: n = !1,
|
|
@@ -3723,14 +3726,14 @@ function dn({
|
|
|
3723
3726
|
className: d(
|
|
3724
3727
|
"inline-block size-dot shrink-0",
|
|
3725
3728
|
r === "round" ? "rounded-full" : "rounded-sm",
|
|
3726
|
-
|
|
3729
|
+
Cr[t],
|
|
3727
3730
|
n && "animate-pulse",
|
|
3728
3731
|
a
|
|
3729
3732
|
)
|
|
3730
3733
|
}
|
|
3731
3734
|
);
|
|
3732
3735
|
}
|
|
3733
|
-
function
|
|
3736
|
+
function yn({
|
|
3734
3737
|
steps: t,
|
|
3735
3738
|
current: r,
|
|
3736
3739
|
variant: n = "numbered",
|
|
@@ -3766,7 +3769,7 @@ function un({
|
|
|
3766
3769
|
m < t.length - 1 && /* @__PURE__ */ e("span", { className: "h-px w-8 bg-border-strong" })
|
|
3767
3770
|
] }, u)) });
|
|
3768
3771
|
}
|
|
3769
|
-
function
|
|
3772
|
+
function Nn({ title: t, icon: r = /* @__PURE__ */ e(it, { className: "size-icon-md", "aria-hidden": !0 }), action: n, children: s, className: a, ...o }) {
|
|
3770
3773
|
return /* @__PURE__ */ c(
|
|
3771
3774
|
"div",
|
|
3772
3775
|
{
|
|
@@ -3787,21 +3790,21 @@ function mn({ title: t, icon: r = /* @__PURE__ */ e(it, { className: "size-icon-
|
|
|
3787
3790
|
}
|
|
3788
3791
|
);
|
|
3789
3792
|
}
|
|
3790
|
-
const
|
|
3793
|
+
const Sr = {
|
|
3791
3794
|
xs: "w-5 h-5 text-xs",
|
|
3792
3795
|
sm: "w-6 h-6 text-xs",
|
|
3793
3796
|
md: "w-7 h-7 text-base",
|
|
3794
3797
|
lg: "w-9 h-9 text-sm"
|
|
3795
3798
|
};
|
|
3796
|
-
function
|
|
3799
|
+
function zr(t) {
|
|
3797
3800
|
if (!t) return "?";
|
|
3798
3801
|
const r = t.trim().split(/[^\p{L}\p{N}]+/u).filter(Boolean);
|
|
3799
3802
|
return r.length >= 2 ? (r[0][0] + r[1][0]).toUpperCase() : r.length === 1 ? r[0].slice(0, 2).toUpperCase() : "?";
|
|
3800
3803
|
}
|
|
3801
|
-
const
|
|
3804
|
+
const Er = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
3802
3805
|
const [o, l] = oe.useState(!1), u = d(
|
|
3803
3806
|
"inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 font-semibold select-none bg-surface-hover text-text",
|
|
3804
|
-
|
|
3807
|
+
Sr[n],
|
|
3805
3808
|
s
|
|
3806
3809
|
);
|
|
3807
3810
|
return r && !o ? /* @__PURE__ */ e(
|
|
@@ -3813,13 +3816,13 @@ const Cr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3813
3816
|
className: d(u, "object-cover"),
|
|
3814
3817
|
onError: () => l(!0)
|
|
3815
3818
|
}
|
|
3816
|
-
) : /* @__PURE__ */ e("span", { className: u, title: a ?? t, "aria-label": t, children:
|
|
3817
|
-
},
|
|
3819
|
+
) : /* @__PURE__ */ e("span", { className: u, title: a ?? t, "aria-label": t, children: zr(t) });
|
|
3820
|
+
}, Oe = "ring-surface", Mr = "ring-surface-accent", wn = ({ people: t, max: r = 4, size: n = "sm", className: s }) => {
|
|
3818
3821
|
if (t.length === 0) return null;
|
|
3819
3822
|
const a = t.slice(0, r), o = t.length - a.length;
|
|
3820
3823
|
return /* @__PURE__ */ c("span", { className: d("inline-flex items-center", s), children: [
|
|
3821
3824
|
a.map((l, u) => /* @__PURE__ */ e(
|
|
3822
|
-
|
|
3825
|
+
Er,
|
|
3823
3826
|
{
|
|
3824
3827
|
name: l.name,
|
|
3825
3828
|
src: l.src,
|
|
@@ -3827,7 +3830,7 @@ const Cr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3827
3830
|
title: l.name ? l.seen === !1 ? `${l.name} — nog niet gelezen` : l.name : void 0,
|
|
3828
3831
|
className: d(
|
|
3829
3832
|
u > 0 && "-ml-2",
|
|
3830
|
-
l.owner ?
|
|
3833
|
+
l.owner ? Mr : Oe,
|
|
3831
3834
|
l.seen === !1 && "opacity-40"
|
|
3832
3835
|
)
|
|
3833
3836
|
},
|
|
@@ -3839,7 +3842,7 @@ const Cr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3839
3842
|
className: d(
|
|
3840
3843
|
"inline-flex items-center justify-center rounded-full shrink-0 -ml-2 font-semibold bg-surface-hover text-text-muted",
|
|
3841
3844
|
n === "xs" ? "w-5 h-5 text-xs" : n === "md" ? "w-7 h-7 text-xs" : n === "lg" ? "w-9 h-9 text-xs" : "w-6 h-6 text-xs",
|
|
3842
|
-
|
|
3845
|
+
Oe
|
|
3843
3846
|
),
|
|
3844
3847
|
children: [
|
|
3845
3848
|
"+",
|
|
@@ -3854,12 +3857,12 @@ const Cr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3854
3857
|
chat: { fg: "text-channel-chat-fg", bg: "bg-channel-chat-soft" },
|
|
3855
3858
|
tel: { fg: "text-channel-phone-fg", bg: "bg-channel-phone-soft" },
|
|
3856
3859
|
note: { fg: "text-channel-note-fg", bg: "bg-channel-note-soft" }
|
|
3857
|
-
},
|
|
3860
|
+
}, $r = {
|
|
3858
3861
|
sm: "size-avatar-xs rounded-sm text-xs",
|
|
3859
3862
|
md: "size-avatar-sm rounded-md text-xs",
|
|
3860
3863
|
lg: "size-avatar-lg rounded-md text-base"
|
|
3861
3864
|
};
|
|
3862
|
-
function
|
|
3865
|
+
function kn({ channel: t, children: r, size: n = "md", className: s, title: a }) {
|
|
3863
3866
|
const o = Be[t in Be ? t : "note"];
|
|
3864
3867
|
return /* @__PURE__ */ e(
|
|
3865
3868
|
"span",
|
|
@@ -3867,7 +3870,7 @@ function hn({ channel: t, children: r, size: n = "md", className: s, title: a })
|
|
|
3867
3870
|
title: a,
|
|
3868
3871
|
className: d(
|
|
3869
3872
|
"inline-flex shrink-0 items-center justify-center font-bold",
|
|
3870
|
-
|
|
3873
|
+
$r[n],
|
|
3871
3874
|
o.fg,
|
|
3872
3875
|
o.bg,
|
|
3873
3876
|
s
|
|
@@ -3876,7 +3879,7 @@ function hn({ channel: t, children: r, size: n = "md", className: s, title: a })
|
|
|
3876
3879
|
}
|
|
3877
3880
|
);
|
|
3878
3881
|
}
|
|
3879
|
-
const
|
|
3882
|
+
const Cn = ({
|
|
3880
3883
|
src: t,
|
|
3881
3884
|
alt: r,
|
|
3882
3885
|
size: n = "md",
|
|
@@ -3892,15 +3895,15 @@ const xn = ({
|
|
|
3892
3895
|
onError: x,
|
|
3893
3896
|
...p
|
|
3894
3897
|
}) => {
|
|
3895
|
-
const [w, g] =
|
|
3896
|
-
g(!1),
|
|
3897
|
-
}, X = (
|
|
3898
|
-
if (g(!1),
|
|
3899
|
-
|
|
3898
|
+
const [w, g] = F(!0), [b, A] = F(!1), [_, K] = F(t), $ = (P) => {
|
|
3899
|
+
g(!1), A(!1), f?.(P);
|
|
3900
|
+
}, X = (P) => {
|
|
3901
|
+
if (g(!1), A(!0), u && _ !== u) {
|
|
3902
|
+
K(u), A(!1), g(!0);
|
|
3900
3903
|
return;
|
|
3901
3904
|
}
|
|
3902
|
-
x?.(
|
|
3903
|
-
},
|
|
3905
|
+
x?.(P);
|
|
3906
|
+
}, U = d(
|
|
3904
3907
|
"relative overflow-hidden bg-surface-hover",
|
|
3905
3908
|
// Size variants
|
|
3906
3909
|
{
|
|
@@ -3928,7 +3931,7 @@ const xn = ({
|
|
|
3928
3931
|
"rounded-full": a === "full"
|
|
3929
3932
|
},
|
|
3930
3933
|
h
|
|
3931
|
-
),
|
|
3934
|
+
), I = d(
|
|
3932
3935
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
3933
3936
|
{
|
|
3934
3937
|
"opacity-0": w || b,
|
|
@@ -3937,27 +3940,27 @@ const xn = ({
|
|
|
3937
3940
|
), q = d(
|
|
3938
3941
|
"absolute inset-0 flex items-center justify-center",
|
|
3939
3942
|
"text-text-muted"
|
|
3940
|
-
),
|
|
3943
|
+
), W = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), re = /* @__PURE__ */ c("div", { className: "text-center", children: [
|
|
3941
3944
|
/* @__PURE__ */ e(Y, { icon: dt, size: "lg", className: "mx-auto mb-1" }),
|
|
3942
3945
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
3943
3946
|
] });
|
|
3944
|
-
return /* @__PURE__ */ c("div", { className:
|
|
3947
|
+
return /* @__PURE__ */ c("div", { className: U, children: [
|
|
3945
3948
|
/* @__PURE__ */ e(
|
|
3946
3949
|
"img",
|
|
3947
3950
|
{
|
|
3948
3951
|
...p,
|
|
3949
|
-
src:
|
|
3952
|
+
src: _,
|
|
3950
3953
|
alt: r,
|
|
3951
|
-
className:
|
|
3954
|
+
className: I,
|
|
3952
3955
|
onLoad: $,
|
|
3953
3956
|
onError: X
|
|
3954
3957
|
}
|
|
3955
3958
|
),
|
|
3956
|
-
w && o && /* @__PURE__ */ e("div", { className: q, children: m ||
|
|
3959
|
+
w && o && /* @__PURE__ */ e("div", { className: q, children: m || W }),
|
|
3957
3960
|
b && l && /* @__PURE__ */ e("div", { className: q, children: y || re })
|
|
3958
3961
|
] });
|
|
3959
3962
|
};
|
|
3960
|
-
function
|
|
3963
|
+
function Sn({
|
|
3961
3964
|
items: t,
|
|
3962
3965
|
getRowKey: r,
|
|
3963
3966
|
variant: n = "divided",
|
|
@@ -3975,17 +3978,17 @@ function bn({
|
|
|
3975
3978
|
stickyGroupHeaders: w = !1,
|
|
3976
3979
|
collapsibleGroups: g = !1,
|
|
3977
3980
|
hideGroupCount: b = !1,
|
|
3978
|
-
selectable:
|
|
3979
|
-
selectedItems:
|
|
3980
|
-
onSelectionChange:
|
|
3981
|
+
selectable: A = !1,
|
|
3982
|
+
selectedItems: _ = [],
|
|
3983
|
+
onSelectionChange: K,
|
|
3981
3984
|
bulkActions: $,
|
|
3982
3985
|
header: X,
|
|
3983
|
-
stickyHeader:
|
|
3984
|
-
bordered:
|
|
3986
|
+
stickyHeader: U = !1,
|
|
3987
|
+
bordered: I = !1,
|
|
3985
3988
|
emptyContent: q,
|
|
3986
|
-
loading:
|
|
3989
|
+
loading: W = !1,
|
|
3987
3990
|
loadingRows: re = 4,
|
|
3988
|
-
className:
|
|
3991
|
+
className: P,
|
|
3989
3992
|
"aria-label": ce
|
|
3990
3993
|
}) {
|
|
3991
3994
|
const [C, i] = oe.useState(
|
|
@@ -3999,24 +4002,24 @@ function bn({
|
|
|
3999
4002
|
);
|
|
4000
4003
|
if (B.length === 0) return;
|
|
4001
4004
|
z.preventDefault();
|
|
4002
|
-
const
|
|
4005
|
+
const V = B.indexOf(document.activeElement), M = z.key === "Home" ? 0 : z.key === "End" ? B.length - 1 : z.key === "ArrowDown" ? (V + 1) % B.length : (V - 1 + B.length) % B.length;
|
|
4003
4006
|
B[M]?.focus();
|
|
4004
|
-
}, T = (z,
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
+
}, T = (z, R) => r ? r(z, R) : R, k = (z) => _.includes(z), ee = (z, R) => {
|
|
4008
|
+
K && K(
|
|
4009
|
+
R ? [..._, z] : _.filter((B) => B !== z)
|
|
4007
4010
|
);
|
|
4008
|
-
}, ae = (z) =>
|
|
4011
|
+
}, ae = (z) => K?.(z ? [...t] : []), le = d(
|
|
4009
4012
|
"flex flex-col",
|
|
4010
|
-
|
|
4011
|
-
|
|
4013
|
+
I && "overflow-hidden rounded-lg border border-border-subtle",
|
|
4014
|
+
P
|
|
4012
4015
|
);
|
|
4013
|
-
if (
|
|
4014
|
-
return /* @__PURE__ */ e("div", { className: le, children: Array.from({ length: re }).map((z,
|
|
4016
|
+
if (W)
|
|
4017
|
+
return /* @__PURE__ */ e("div", { className: le, children: Array.from({ length: re }).map((z, R) => /* @__PURE__ */ c(
|
|
4015
4018
|
"div",
|
|
4016
4019
|
{
|
|
4017
4020
|
className: d(
|
|
4018
4021
|
"flex animate-pulse items-center gap-3 px-4 py-2",
|
|
4019
|
-
n === "divided" &&
|
|
4022
|
+
n === "divided" && R > 0 && "border-t border-border-subtle"
|
|
4020
4023
|
),
|
|
4021
4024
|
children: [
|
|
4022
4025
|
/* @__PURE__ */ e("span", { className: "size-tile-sm shrink-0 rounded-md bg-surface-hover" }),
|
|
@@ -4025,12 +4028,12 @@ function bn({
|
|
|
4025
4028
|
/* @__PURE__ */ e("span", { className: "h-3 w-8 shrink-0 rounded-sm bg-surface-hover" })
|
|
4026
4029
|
]
|
|
4027
4030
|
},
|
|
4028
|
-
`skeleton-${
|
|
4031
|
+
`skeleton-${R}`
|
|
4029
4032
|
)) });
|
|
4030
4033
|
if (t.length === 0 && q)
|
|
4031
4034
|
return /* @__PURE__ */ e("div", { className: le, children: q });
|
|
4032
|
-
const G = t.length > 0 &&
|
|
4033
|
-
const
|
|
4035
|
+
const G = t.length > 0 && _.length === t.length, j = _.length > 0 && !G, E = (z, R, B) => {
|
|
4036
|
+
const V = m?.(z, R) ?? !1, M = y?.(z, R) ?? !1, L = h?.(z, R) ?? !1, te = A && k(z);
|
|
4034
4037
|
return /* @__PURE__ */ c(
|
|
4035
4038
|
"li",
|
|
4036
4039
|
{
|
|
@@ -4038,11 +4041,11 @@ function bn({
|
|
|
4038
4041
|
role: "button",
|
|
4039
4042
|
tabIndex: 0,
|
|
4040
4043
|
"data-list-row": "",
|
|
4041
|
-
"aria-current":
|
|
4042
|
-
onClick: () => l(z,
|
|
4043
|
-
onFocus: () => u?.(
|
|
4044
|
+
"aria-current": V || void 0,
|
|
4045
|
+
onClick: () => l(z, R),
|
|
4046
|
+
onFocus: () => u?.(R),
|
|
4044
4047
|
onKeyDown: (v) => {
|
|
4045
|
-
v.key !== "Enter" && v.key !== " " || (v.preventDefault(), l(z,
|
|
4048
|
+
v.key !== "Enter" && v.key !== " " || (v.preventDefault(), l(z, R));
|
|
4046
4049
|
}
|
|
4047
4050
|
} : {},
|
|
4048
4051
|
className: d(
|
|
@@ -4050,12 +4053,12 @@ function bn({
|
|
|
4050
4053
|
"transition-colors duration-fast ease-out",
|
|
4051
4054
|
n === "divided" && !B && "border-t border-border-subtle",
|
|
4052
4055
|
l && "cursor-pointer focus-visible:outline-none focus-visible:focus-ring",
|
|
4053
|
-
|
|
4056
|
+
V || te ? "bg-accent-soft text-text" : l && "hover:bg-surface-hover",
|
|
4054
4057
|
M && "font-bold",
|
|
4055
|
-
|
|
4058
|
+
L && "opacity-55"
|
|
4056
4059
|
),
|
|
4057
4060
|
children: [
|
|
4058
|
-
|
|
4061
|
+
A && /* @__PURE__ */ e("span", { onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4059
4062
|
pe,
|
|
4060
4063
|
{
|
|
4061
4064
|
checked: k(z),
|
|
@@ -4070,30 +4073,30 @@ function bn({
|
|
|
4070
4073
|
className: "mt-2 size-1.5 shrink-0 self-start rounded-full bg-border-strong"
|
|
4071
4074
|
}
|
|
4072
4075
|
),
|
|
4073
|
-
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(z,
|
|
4074
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(z,
|
|
4075
|
-
o && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: o(z,
|
|
4076
|
+
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(z, R) }),
|
|
4077
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(z, R) : String(z) }),
|
|
4078
|
+
o && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: o(z, R) })
|
|
4076
4079
|
]
|
|
4077
4080
|
},
|
|
4078
|
-
T(z,
|
|
4081
|
+
T(z, R)
|
|
4079
4082
|
);
|
|
4080
4083
|
}, D = (() => {
|
|
4081
4084
|
if (!f)
|
|
4082
|
-
return t.map((
|
|
4085
|
+
return t.map((V, M) => E(V, M, M === 0));
|
|
4083
4086
|
const z = /* @__PURE__ */ new Map();
|
|
4084
|
-
t.forEach((
|
|
4085
|
-
const
|
|
4086
|
-
z.has(
|
|
4087
|
+
t.forEach((V, M) => {
|
|
4088
|
+
const L = f(V, M);
|
|
4089
|
+
z.has(L) || z.set(L, []), z.get(L).push({ item: V, index: M });
|
|
4087
4090
|
});
|
|
4088
|
-
const
|
|
4091
|
+
const R = x ?? [];
|
|
4089
4092
|
return [
|
|
4090
|
-
...
|
|
4091
|
-
...[...z.keys()].filter((
|
|
4092
|
-
].flatMap((
|
|
4093
|
-
const
|
|
4093
|
+
...R.filter((V) => z.has(V.id)),
|
|
4094
|
+
...[...z.keys()].filter((V) => !R.some((M) => M.id === V)).map((V) => ({ id: V }))
|
|
4095
|
+
].flatMap((V, M) => {
|
|
4096
|
+
const L = z.get(V.id) ?? [], te = g && C[V.id], v = V.title ?? V.id, H = V.count ?? L.length, Z = /* @__PURE__ */ e(
|
|
4094
4097
|
"li",
|
|
4095
4098
|
{
|
|
4096
|
-
onClick: g ? () => i((J) => ({ ...J, [
|
|
4099
|
+
onClick: g ? () => i((J) => ({ ...J, [V.id]: !J[V.id] })) : void 0,
|
|
4097
4100
|
className: d(
|
|
4098
4101
|
"flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
|
|
4099
4102
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
@@ -4104,8 +4107,8 @@ function bn({
|
|
|
4104
4107
|
g && "cursor-pointer select-none hover:text-text"
|
|
4105
4108
|
),
|
|
4106
4109
|
"aria-expanded": g ? !te : void 0,
|
|
4107
|
-
style: w ? { top:
|
|
4108
|
-
children: p ? p(
|
|
4110
|
+
style: w ? { top: U ? 28 : 0 } : void 0,
|
|
4111
|
+
children: p ? p(V, L.map((J) => J.item)) : /* @__PURE__ */ c(xe, { children: [
|
|
4109
4112
|
g && /* @__PURE__ */ e(
|
|
4110
4113
|
Ce,
|
|
4111
4114
|
{
|
|
@@ -4117,32 +4120,32 @@ function bn({
|
|
|
4117
4120
|
}
|
|
4118
4121
|
),
|
|
4119
4122
|
/* @__PURE__ */ e("span", { children: v }),
|
|
4120
|
-
!b && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children:
|
|
4123
|
+
!b && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: H })
|
|
4121
4124
|
] })
|
|
4122
4125
|
},
|
|
4123
|
-
`group-${
|
|
4126
|
+
`group-${V.id}`
|
|
4124
4127
|
);
|
|
4125
4128
|
return te ? [Z] : [
|
|
4126
4129
|
Z,
|
|
4127
|
-
...
|
|
4128
|
-
({ item: J, index:
|
|
4130
|
+
...L.map(
|
|
4131
|
+
({ item: J, index: O }, ie) => E(J, O, ie === 0)
|
|
4129
4132
|
)
|
|
4130
4133
|
];
|
|
4131
4134
|
});
|
|
4132
4135
|
})();
|
|
4133
4136
|
return /* @__PURE__ */ c("div", { ref: S, className: le, onKeyDown: l ? N : void 0, children: [
|
|
4134
|
-
|
|
4137
|
+
A && _.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
|
|
4135
4138
|
/* @__PURE__ */ e(
|
|
4136
4139
|
pe,
|
|
4137
4140
|
{
|
|
4138
4141
|
checked: G,
|
|
4139
|
-
indeterminate:
|
|
4142
|
+
indeterminate: j,
|
|
4140
4143
|
onChange: (z) => ae(z.target.checked),
|
|
4141
4144
|
"aria-label": "Alles selecteren"
|
|
4142
4145
|
}
|
|
4143
4146
|
),
|
|
4144
4147
|
/* @__PURE__ */ c("span", { className: "text-xs text-text-subtle", children: [
|
|
4145
|
-
|
|
4148
|
+
_.length,
|
|
4146
4149
|
" geselecteerd"
|
|
4147
4150
|
] }),
|
|
4148
4151
|
$ && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: $ })
|
|
@@ -4153,7 +4156,7 @@ function bn({
|
|
|
4153
4156
|
className: d(
|
|
4154
4157
|
"flex items-center gap-3 border-b border-border-subtle px-4 py-1.5",
|
|
4155
4158
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
4156
|
-
|
|
4159
|
+
U && "sticky top-0 z-20"
|
|
4157
4160
|
),
|
|
4158
4161
|
children: X
|
|
4159
4162
|
}
|
|
@@ -4161,7 +4164,7 @@ function bn({
|
|
|
4161
4164
|
/* @__PURE__ */ e("ul", { "aria-label": ce, className: "flex flex-col", children: D })
|
|
4162
4165
|
] });
|
|
4163
4166
|
}
|
|
4164
|
-
function
|
|
4167
|
+
function zn({
|
|
4165
4168
|
side: t,
|
|
4166
4169
|
continued: r = !1,
|
|
4167
4170
|
tone: n = "default",
|
|
@@ -4191,18 +4194,18 @@ function pn({
|
|
|
4191
4194
|
}
|
|
4192
4195
|
);
|
|
4193
4196
|
}
|
|
4194
|
-
const
|
|
4197
|
+
const Dr = {
|
|
4195
4198
|
default: "text-text",
|
|
4196
4199
|
urgent: "text-danger-fg",
|
|
4197
4200
|
success: "text-success-fg"
|
|
4198
4201
|
};
|
|
4199
|
-
function
|
|
4202
|
+
function En({ value: t, label: r, tone: n = "default", className: s, ...a }) {
|
|
4200
4203
|
return /* @__PURE__ */ c("div", { className: d("rounded-xl shadow-sm bg-surface px-4 py-3.5", s), ...a, children: [
|
|
4201
|
-
/* @__PURE__ */ e("div", { className: d("text-2xl font-semibold",
|
|
4204
|
+
/* @__PURE__ */ e("div", { className: d("text-2xl font-semibold", Dr[n]), children: t }),
|
|
4202
4205
|
/* @__PURE__ */ e("div", { className: "pt-0.5 text-xs text-text-muted", children: r })
|
|
4203
4206
|
] });
|
|
4204
4207
|
}
|
|
4205
|
-
const
|
|
4208
|
+
const Mn = ({
|
|
4206
4209
|
surface: t = !1,
|
|
4207
4210
|
title: r,
|
|
4208
4211
|
subtitle: n,
|
|
@@ -4216,17 +4219,17 @@ const vn = ({
|
|
|
4216
4219
|
editable: h = !1,
|
|
4217
4220
|
onTitleChange: f
|
|
4218
4221
|
}) => {
|
|
4219
|
-
const [x, p] =
|
|
4222
|
+
const [x, p] = F(!1), [w, g] = F(r), b = se(null);
|
|
4220
4223
|
Q(() => {
|
|
4221
4224
|
g(r);
|
|
4222
4225
|
}, [r]), Q(() => {
|
|
4223
4226
|
x && b.current && (b.current.focus(), b.current.select());
|
|
4224
4227
|
}, [x]);
|
|
4225
|
-
const
|
|
4228
|
+
const A = () => {
|
|
4226
4229
|
h && p(!0);
|
|
4227
|
-
},
|
|
4230
|
+
}, _ = () => {
|
|
4228
4231
|
p(!1), w.trim() !== "" && w !== r && f ? f(w.trim()) : g(r);
|
|
4229
|
-
},
|
|
4232
|
+
}, K = ($) => {
|
|
4230
4233
|
$.key === "Enter" ? b.current?.blur() : $.key === "Escape" && (g(r), p(!1));
|
|
4231
4234
|
};
|
|
4232
4235
|
return /* @__PURE__ */ c(
|
|
@@ -4250,15 +4253,15 @@ const vn = ({
|
|
|
4250
4253
|
type: "text",
|
|
4251
4254
|
value: w,
|
|
4252
4255
|
onChange: ($) => g($.target.value),
|
|
4253
|
-
onBlur:
|
|
4254
|
-
onKeyDown:
|
|
4256
|
+
onBlur: _,
|
|
4257
|
+
onKeyDown: K,
|
|
4255
4258
|
className: "text-1xl font-semibold bg-transparent border-b-1 border-border rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 w-full"
|
|
4256
4259
|
}
|
|
4257
4260
|
) : /* @__PURE__ */ c("div", { className: "group flex items-baseline gap-2.5 min-w-0", children: [
|
|
4258
4261
|
/* @__PURE__ */ e(
|
|
4259
4262
|
"h2",
|
|
4260
4263
|
{
|
|
4261
|
-
onClick:
|
|
4264
|
+
onClick: A,
|
|
4262
4265
|
className: d(
|
|
4263
4266
|
"text-xl font-semibold truncate",
|
|
4264
4267
|
h && "cursor-pointer"
|
|
@@ -4272,7 +4275,7 @@ const vn = ({
|
|
|
4272
4275
|
ut,
|
|
4273
4276
|
{
|
|
4274
4277
|
size: 15,
|
|
4275
|
-
onClick:
|
|
4278
|
+
onClick: A,
|
|
4276
4279
|
className: "shrink-0 cursor-pointer text-text-muted opacity-0 group-hover:opacity-100 transition-opacity"
|
|
4277
4280
|
}
|
|
4278
4281
|
)
|
|
@@ -4282,7 +4285,7 @@ const vn = ({
|
|
|
4282
4285
|
] }) }),
|
|
4283
4286
|
a.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: a.map(
|
|
4284
4287
|
($) => $.render ? /* @__PURE__ */ e(oe.Fragment, { children: $.render() }, $.id) : $.splitOptions && $.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
4285
|
-
|
|
4288
|
+
Fe,
|
|
4286
4289
|
{
|
|
4287
4290
|
label: $.label,
|
|
4288
4291
|
onClick: $.onClick,
|
|
@@ -4311,24 +4314,24 @@ const vn = ({
|
|
|
4311
4314
|
]
|
|
4312
4315
|
}
|
|
4313
4316
|
);
|
|
4314
|
-
},
|
|
4317
|
+
}, Tr = {
|
|
4315
4318
|
none: "p-0",
|
|
4316
4319
|
sm: "p-2",
|
|
4317
4320
|
md: "p-4",
|
|
4318
4321
|
lg: "p-6"
|
|
4319
|
-
},
|
|
4322
|
+
}, $n = ({
|
|
4320
4323
|
actions: t = [],
|
|
4321
4324
|
onBack: r,
|
|
4322
4325
|
backLabel: n = "Back",
|
|
4323
4326
|
className: s,
|
|
4324
4327
|
padding: a = "md",
|
|
4325
4328
|
children: o
|
|
4326
|
-
}) => /* @__PURE__ */ c("div", { className: d("flex items-center gap-2 mb-3",
|
|
4329
|
+
}) => /* @__PURE__ */ c("div", { className: d("flex items-center gap-2 mb-3", Tr[a], s), children: [
|
|
4327
4330
|
r && /* @__PURE__ */ e(ne, { variant: "secondary", onClick: r, leftIcon: /* @__PURE__ */ e(Y, { icon: ke, size: "sm" }), iconOnly: !0 }),
|
|
4328
4331
|
o && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: o }),
|
|
4329
4332
|
t.length > 0 && /* @__PURE__ */ e("div", { className: d("flex flex-wrap gap-4", !o && "ml-auto"), children: t.map(
|
|
4330
4333
|
(l) => l.splitOptions && l.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
4331
|
-
|
|
4334
|
+
Fe,
|
|
4332
4335
|
{
|
|
4333
4336
|
label: l.label,
|
|
4334
4337
|
onClick: l.onClick,
|
|
@@ -4353,8 +4356,55 @@ const vn = ({
|
|
|
4353
4356
|
l.id
|
|
4354
4357
|
)
|
|
4355
4358
|
) })
|
|
4356
|
-
] })
|
|
4357
|
-
|
|
4359
|
+
] }), _r = /<[a-z][\s\S]*>/i, Ar = [
|
|
4360
|
+
"[&_p]:my-1.5 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0 [&_p]:leading-relaxed",
|
|
4361
|
+
"[&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2",
|
|
4362
|
+
"[&_strong]:font-semibold [&_em]:italic",
|
|
4363
|
+
"[&_ul]:my-1.5 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:my-1.5 [&_ol]:list-decimal [&_ol]:pl-5",
|
|
4364
|
+
"[&_li]:leading-relaxed",
|
|
4365
|
+
"[&_h1]:mb-1 [&_h1]:mt-2 [&_h1]:font-semibold [&_h2]:mb-1 [&_h2]:mt-2 [&_h2]:font-semibold [&_h3]:mb-1 [&_h3]:mt-2 [&_h3]:font-semibold",
|
|
4366
|
+
"[&_blockquote]:my-1.5 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-text-muted",
|
|
4367
|
+
"[&_hr]:my-2 [&_hr]:border-border",
|
|
4368
|
+
"[&_pre]:my-1.5 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:bg-surface-sunk [&_pre]:p-2 [&_pre]:text-xs",
|
|
4369
|
+
"[&_code]:rounded-sm [&_code]:bg-surface-sunk [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-xs",
|
|
4370
|
+
"[&_pre_code]:bg-transparent [&_pre_code]:p-0",
|
|
4371
|
+
"[&_table]:my-1.5 [&_table]:w-full [&_table]:border-collapse [&_table]:text-xs",
|
|
4372
|
+
"[&_th]:border [&_th]:border-border [&_th]:px-2 [&_th]:py-1 [&_th]:text-left [&_th]:font-semibold",
|
|
4373
|
+
"[&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-1"
|
|
4374
|
+
].join(" "), Lr = {
|
|
4375
|
+
p: (t) => /* @__PURE__ */ e("p", { className: "my-1.5 leading-relaxed first:mt-0 last:mb-0", ...t }),
|
|
4376
|
+
a: (t) => /* @__PURE__ */ e("a", { className: "text-accent underline underline-offset-2 hover:opacity-80", target: "_blank", rel: "noopener noreferrer", ...t }),
|
|
4377
|
+
strong: (t) => /* @__PURE__ */ e("strong", { className: "font-semibold", ...t }),
|
|
4378
|
+
em: (t) => /* @__PURE__ */ e("em", { className: "italic", ...t }),
|
|
4379
|
+
ul: (t) => /* @__PURE__ */ e("ul", { className: "my-1.5 list-disc space-y-0.5 pl-5", ...t }),
|
|
4380
|
+
ol: (t) => /* @__PURE__ */ e("ol", { className: "my-1.5 list-decimal space-y-0.5 pl-5", ...t }),
|
|
4381
|
+
li: (t) => /* @__PURE__ */ e("li", { className: "leading-relaxed", ...t }),
|
|
4382
|
+
h1: (t) => /* @__PURE__ */ e("h1", { className: "mb-1 mt-2 text-md font-semibold first:mt-0", ...t }),
|
|
4383
|
+
h2: (t) => /* @__PURE__ */ e("h2", { className: "mb-1 mt-2 text-base font-semibold first:mt-0", ...t }),
|
|
4384
|
+
h3: (t) => /* @__PURE__ */ e("h3", { className: "mb-1 mt-2 text-base font-semibold first:mt-0", ...t }),
|
|
4385
|
+
blockquote: (t) => /* @__PURE__ */ e("blockquote", { className: "my-1.5 border-l-2 border-border pl-3 text-text-muted", ...t }),
|
|
4386
|
+
hr: (t) => /* @__PURE__ */ e("hr", { className: "my-2 border-border", ...t }),
|
|
4387
|
+
pre: (t) => /* @__PURE__ */ e("pre", { className: "my-1.5 overflow-x-auto rounded-md bg-surface-sunk p-2 text-xs", ...t }),
|
|
4388
|
+
code: ({ className: t, children: r, ...n }) => {
|
|
4389
|
+
const s = String(r ?? "");
|
|
4390
|
+
return /language-/.test(t ?? "") || s.includes(`
|
|
4391
|
+
`) ? /* @__PURE__ */ e("code", { className: "font-mono text-xs", ...n, children: r }) : /* @__PURE__ */ e("code", { className: "rounded-sm bg-surface-sunk px-1 py-0.5 font-mono text-xs", ...n, children: r });
|
|
4392
|
+
},
|
|
4393
|
+
table: (t) => /* @__PURE__ */ e("div", { className: "my-1.5 overflow-x-auto", children: /* @__PURE__ */ e("table", { className: "w-full border-collapse text-xs", ...t }) }),
|
|
4394
|
+
th: (t) => /* @__PURE__ */ e("th", { className: "border border-border px-2 py-1 text-left font-semibold", ...t }),
|
|
4395
|
+
td: (t) => /* @__PURE__ */ e("td", { className: "border border-border px-2 py-1", ...t })
|
|
4396
|
+
};
|
|
4397
|
+
function Dn({ text: t, className: r, as: n }) {
|
|
4398
|
+
const s = t ?? "";
|
|
4399
|
+
return (n ? n === "html" : _r.test(s)) ? /* @__PURE__ */ e(
|
|
4400
|
+
"div",
|
|
4401
|
+
{
|
|
4402
|
+
className: d("break-words", Ar, r),
|
|
4403
|
+
dangerouslySetInnerHTML: { __html: bt.sanitize(s, { ADD_ATTR: ["target", "rel"] }) }
|
|
4404
|
+
}
|
|
4405
|
+
) : /* @__PURE__ */ e("div", { className: d("break-words", r), children: /* @__PURE__ */ e(pt, { remarkPlugins: [gt], components: Lr, children: s }) });
|
|
4406
|
+
}
|
|
4407
|
+
function Tn({ label: t, trailing: r, align: n = "center", className: s }) {
|
|
4358
4408
|
const a = /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-border-subtle", "aria-hidden": !0 });
|
|
4359
4409
|
return !t && !r ? /* @__PURE__ */ e("div", { className: d("flex items-center py-2", s), children: a }) : /* @__PURE__ */ c("div", { className: d("flex items-center gap-3 py-2", s), children: [
|
|
4360
4410
|
n === "center" && a,
|
|
@@ -4363,7 +4413,7 @@ function Nn({ label: t, trailing: r, align: n = "center", className: s }) {
|
|
|
4363
4413
|
r && /* @__PURE__ */ e("span", { className: "shrink-0", children: r })
|
|
4364
4414
|
] });
|
|
4365
4415
|
}
|
|
4366
|
-
function
|
|
4416
|
+
function _n({
|
|
4367
4417
|
label: t,
|
|
4368
4418
|
description: r,
|
|
4369
4419
|
control: n,
|
|
@@ -4390,7 +4440,7 @@ function wn({
|
|
|
4390
4440
|
}
|
|
4391
4441
|
);
|
|
4392
4442
|
}
|
|
4393
|
-
function
|
|
4443
|
+
function An({
|
|
4394
4444
|
icon: t,
|
|
4395
4445
|
title: r,
|
|
4396
4446
|
description: n,
|
|
@@ -4410,7 +4460,7 @@ function kn({
|
|
|
4410
4460
|
/* @__PURE__ */ e("div", { className: d("flex flex-col", t && "pl-6"), children: a })
|
|
4411
4461
|
] });
|
|
4412
4462
|
}
|
|
4413
|
-
function
|
|
4463
|
+
function Ln({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
4414
4464
|
return /* @__PURE__ */ c(
|
|
4415
4465
|
"button",
|
|
4416
4466
|
{
|
|
@@ -4428,13 +4478,13 @@ function Cn({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
|
4428
4478
|
}
|
|
4429
4479
|
);
|
|
4430
4480
|
}
|
|
4431
|
-
function
|
|
4481
|
+
function Ir(t, r) {
|
|
4432
4482
|
return r.split(".").reduce(
|
|
4433
4483
|
(n, s) => n && typeof n == "object" && s in n ? n[s] : void 0,
|
|
4434
4484
|
t
|
|
4435
4485
|
);
|
|
4436
4486
|
}
|
|
4437
|
-
const
|
|
4487
|
+
const In = ({
|
|
4438
4488
|
groups: t,
|
|
4439
4489
|
data: r,
|
|
4440
4490
|
size: n = "md",
|
|
@@ -4457,7 +4507,7 @@ const Sn = ({
|
|
|
4457
4507
|
return x ? x.label : String(h || "-");
|
|
4458
4508
|
}, u = ue(
|
|
4459
4509
|
(h) => {
|
|
4460
|
-
const f =
|
|
4510
|
+
const f = Ir(r, h.name);
|
|
4461
4511
|
if (h.type === "array") {
|
|
4462
4512
|
const p = f;
|
|
4463
4513
|
return !p || p.length === 0 ? /* @__PURE__ */ e(
|
|
@@ -4488,8 +4538,8 @@ const Sn = ({
|
|
|
4488
4538
|
}
|
|
4489
4539
|
) }),
|
|
4490
4540
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: h.arrayFields?.map((b) => {
|
|
4491
|
-
const
|
|
4492
|
-
let
|
|
4541
|
+
const A = w?.[b.name];
|
|
4542
|
+
let _ = "-";
|
|
4493
4543
|
switch (b.type) {
|
|
4494
4544
|
case "text":
|
|
4495
4545
|
case "email":
|
|
@@ -4497,30 +4547,30 @@ const Sn = ({
|
|
|
4497
4547
|
case "tel":
|
|
4498
4548
|
case "url":
|
|
4499
4549
|
case "textarea":
|
|
4500
|
-
|
|
4550
|
+
_ = A || "-";
|
|
4501
4551
|
break;
|
|
4502
4552
|
case "select":
|
|
4503
4553
|
case "radio":
|
|
4504
|
-
|
|
4505
|
-
|
|
4554
|
+
_ = l(
|
|
4555
|
+
A,
|
|
4506
4556
|
b.options
|
|
4507
4557
|
);
|
|
4508
4558
|
break;
|
|
4509
4559
|
case "checkbox":
|
|
4510
|
-
|
|
4560
|
+
_ = o(A);
|
|
4511
4561
|
break;
|
|
4512
4562
|
case "date":
|
|
4513
|
-
|
|
4563
|
+
_ = a(A);
|
|
4514
4564
|
break;
|
|
4515
4565
|
case "custom":
|
|
4516
|
-
|
|
4517
|
-
value:
|
|
4566
|
+
_ = b.customComponent?.({
|
|
4567
|
+
value: A
|
|
4518
4568
|
});
|
|
4519
4569
|
break;
|
|
4520
4570
|
default:
|
|
4521
|
-
|
|
4571
|
+
_ = String(A || "-");
|
|
4522
4572
|
}
|
|
4523
|
-
return b.format && (
|
|
4573
|
+
return b.format && (_ = b.format(A, w)), /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
4524
4574
|
/* @__PURE__ */ e(
|
|
4525
4575
|
de,
|
|
4526
4576
|
{
|
|
@@ -4536,7 +4586,7 @@ const Sn = ({
|
|
|
4536
4586
|
variant: "body",
|
|
4537
4587
|
size: "sm",
|
|
4538
4588
|
className: "text-text",
|
|
4539
|
-
children:
|
|
4589
|
+
children: _
|
|
4540
4590
|
}
|
|
4541
4591
|
)
|
|
4542
4592
|
] }, b.name);
|
|
@@ -4763,7 +4813,7 @@ const Sn = ({
|
|
|
4763
4813
|
]
|
|
4764
4814
|
}
|
|
4765
4815
|
) });
|
|
4766
|
-
},
|
|
4816
|
+
}, jn = ({
|
|
4767
4817
|
title: t,
|
|
4768
4818
|
actionIcons: r,
|
|
4769
4819
|
items: n,
|
|
@@ -4798,7 +4848,7 @@ const Sn = ({
|
|
|
4798
4848
|
u
|
|
4799
4849
|
)
|
|
4800
4850
|
) })
|
|
4801
|
-
] }),
|
|
4851
|
+
] }), jr = {
|
|
4802
4852
|
xs: "text-xs",
|
|
4803
4853
|
sm: "text-sm",
|
|
4804
4854
|
md: "text-base",
|
|
@@ -4807,13 +4857,13 @@ const Sn = ({
|
|
|
4807
4857
|
"2xl": "text-2xl",
|
|
4808
4858
|
"3xl": "text-3xl",
|
|
4809
4859
|
"4xl": "text-3xl"
|
|
4810
|
-
},
|
|
4860
|
+
}, Pr = {
|
|
4811
4861
|
light: "font-normal",
|
|
4812
4862
|
normal: "font-normal",
|
|
4813
4863
|
medium: "font-medium",
|
|
4814
4864
|
semibold: "font-semibold",
|
|
4815
4865
|
bold: "font-bold"
|
|
4816
|
-
},
|
|
4866
|
+
}, Or = {
|
|
4817
4867
|
primary: "text-text",
|
|
4818
4868
|
secondary: "text-text-muted",
|
|
4819
4869
|
accent: "text-accent",
|
|
@@ -4823,11 +4873,11 @@ const Sn = ({
|
|
|
4823
4873
|
info: "text-info-fg",
|
|
4824
4874
|
neutral: "text-text",
|
|
4825
4875
|
current: "text-current"
|
|
4826
|
-
},
|
|
4876
|
+
}, Br = {
|
|
4827
4877
|
left: "text-left",
|
|
4828
4878
|
center: "text-center",
|
|
4829
4879
|
right: "text-right"
|
|
4830
|
-
},
|
|
4880
|
+
}, Pn = ({
|
|
4831
4881
|
level: t = 1,
|
|
4832
4882
|
size: r,
|
|
4833
4883
|
weight: n = "semibold",
|
|
@@ -4840,16 +4890,16 @@ const Sn = ({
|
|
|
4840
4890
|
}) => {
|
|
4841
4891
|
const y = `h${t}`, h = d(
|
|
4842
4892
|
"font-sans text-pretty",
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4893
|
+
jr[r || Fr(t)],
|
|
4894
|
+
Pr[n],
|
|
4895
|
+
Or[s],
|
|
4896
|
+
Br[a],
|
|
4847
4897
|
o && "truncate",
|
|
4848
4898
|
l
|
|
4849
4899
|
);
|
|
4850
4900
|
return /* @__PURE__ */ e(y, { className: h, ...m, children: u });
|
|
4851
4901
|
};
|
|
4852
|
-
function
|
|
4902
|
+
function Fr(t) {
|
|
4853
4903
|
return {
|
|
4854
4904
|
1: "2xl",
|
|
4855
4905
|
2: "xl",
|
|
@@ -4859,7 +4909,7 @@ function Ir(t) {
|
|
|
4859
4909
|
6: "md"
|
|
4860
4910
|
}[t] || "md";
|
|
4861
4911
|
}
|
|
4862
|
-
const
|
|
4912
|
+
const On = ({
|
|
4863
4913
|
commands: t,
|
|
4864
4914
|
isOpen: r,
|
|
4865
4915
|
onClose: n,
|
|
@@ -4867,34 +4917,34 @@ const Mn = ({
|
|
|
4867
4917
|
initialCommandPath: a,
|
|
4868
4918
|
initialActiveIndex: o
|
|
4869
4919
|
}) => {
|
|
4870
|
-
const [l, u] =
|
|
4920
|
+
const [l, u] = F(""), [m, y] = F(a || []), [h, f] = F(o || 0), x = se(null), p = se(null), g = (m.length ? t.find((b) => b.id === m[0])?.subCommands || [] : t).filter(
|
|
4871
4921
|
(b) => b.label.toLowerCase().includes(l.toLowerCase())
|
|
4872
4922
|
);
|
|
4873
4923
|
return Q(() => {
|
|
4874
4924
|
r || (u(""), y(a || []), f(o || 0));
|
|
4875
4925
|
}, [r]), Q(() => {
|
|
4876
|
-
const b = (
|
|
4926
|
+
const b = (A) => {
|
|
4877
4927
|
if (r) {
|
|
4878
|
-
if (
|
|
4928
|
+
if (A.key === "Escape")
|
|
4879
4929
|
n();
|
|
4880
|
-
else if (
|
|
4930
|
+
else if (A.key === "ArrowUp")
|
|
4881
4931
|
f(
|
|
4882
|
-
(
|
|
4932
|
+
(_) => _ > 0 ? _ - 1 : g.length - 1
|
|
4883
4933
|
);
|
|
4884
|
-
else if (
|
|
4934
|
+
else if (A.key === "ArrowDown")
|
|
4885
4935
|
f(
|
|
4886
|
-
(
|
|
4936
|
+
(_) => _ < g.length - 1 ? _ + 1 : 0
|
|
4887
4937
|
);
|
|
4888
|
-
else if (
|
|
4889
|
-
const
|
|
4890
|
-
|
|
4938
|
+
else if (A.key === "Enter") {
|
|
4939
|
+
const _ = g[h];
|
|
4940
|
+
_ && (_.subCommands ? (y([...m, _.id]), f(0)) : _.action && (_.action(), n()));
|
|
4891
4941
|
}
|
|
4892
4942
|
}
|
|
4893
4943
|
};
|
|
4894
4944
|
return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
|
|
4895
4945
|
}, [r, n, g, h, m]), Q(() => {
|
|
4896
|
-
const b = (
|
|
4897
|
-
x.current && !x.current.contains(
|
|
4946
|
+
const b = (A) => {
|
|
4947
|
+
x.current && !x.current.contains(A.target) && n();
|
|
4898
4948
|
};
|
|
4899
4949
|
return r && document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
4900
4950
|
}, [r, n]), Q(() => {
|
|
@@ -4927,15 +4977,15 @@ const Mn = ({
|
|
|
4927
4977
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
4928
4978
|
children: [
|
|
4929
4979
|
g.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
4930
|
-
g.map((b,
|
|
4980
|
+
g.map((b, A) => /* @__PURE__ */ c(
|
|
4931
4981
|
"div",
|
|
4932
4982
|
{
|
|
4933
|
-
"data-index":
|
|
4934
|
-
className: `flex items-center p-2 cursor-pointer rounded-md ${
|
|
4983
|
+
"data-index": A,
|
|
4984
|
+
className: `flex items-center p-2 cursor-pointer rounded-md ${A === h ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
4935
4985
|
onClick: () => {
|
|
4936
4986
|
b.subCommands ? (y([...m, b.id]), f(0)) : b.action && (b.action(), n());
|
|
4937
4987
|
},
|
|
4938
|
-
onMouseEnter: () => f(
|
|
4988
|
+
onMouseEnter: () => f(A),
|
|
4939
4989
|
children: [
|
|
4940
4990
|
b.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: b.icon }),
|
|
4941
4991
|
/* @__PURE__ */ e("span", { className: "flex-grow", children: b.label }),
|
|
@@ -4964,7 +5014,7 @@ const Mn = ({
|
|
|
4964
5014
|
]
|
|
4965
5015
|
}
|
|
4966
5016
|
) }) : null;
|
|
4967
|
-
},
|
|
5017
|
+
}, Rr = {
|
|
4968
5018
|
none: "p-0",
|
|
4969
5019
|
xs: "p-1",
|
|
4970
5020
|
sm: "p-2",
|
|
@@ -4972,7 +5022,7 @@ const Mn = ({
|
|
|
4972
5022
|
lg: "p-6",
|
|
4973
5023
|
xl: "p-8",
|
|
4974
5024
|
"2xl": "p-12"
|
|
4975
|
-
},
|
|
5025
|
+
}, Vr = {
|
|
4976
5026
|
none: "m-0",
|
|
4977
5027
|
xs: "m-1",
|
|
4978
5028
|
sm: "m-2",
|
|
@@ -4980,7 +5030,7 @@ const Mn = ({
|
|
|
4980
5030
|
lg: "m-6",
|
|
4981
5031
|
xl: "m-8",
|
|
4982
5032
|
"2xl": "m-12"
|
|
4983
|
-
},
|
|
5033
|
+
}, Hr = {
|
|
4984
5034
|
none: "",
|
|
4985
5035
|
primary: "bg-accent text-accent-fg",
|
|
4986
5036
|
secondary: "bg-surface-hover",
|
|
@@ -4996,26 +5046,26 @@ const Mn = ({
|
|
|
4996
5046
|
backdrop: "bg-page",
|
|
4997
5047
|
editor: "bg-surface",
|
|
4998
5048
|
input: "bg-surface-input"
|
|
4999
|
-
},
|
|
5049
|
+
}, qr = {
|
|
5000
5050
|
none: "rounded-none",
|
|
5001
5051
|
sm: "rounded-sm",
|
|
5002
5052
|
md: "rounded-md",
|
|
5003
5053
|
lg: "rounded-lg",
|
|
5004
5054
|
xl: "rounded-xl",
|
|
5005
5055
|
full: "rounded-full"
|
|
5006
|
-
},
|
|
5056
|
+
}, Ur = {
|
|
5007
5057
|
none: "shadow-none",
|
|
5008
5058
|
sm: "shadow-none",
|
|
5009
5059
|
md: "shadow-overlay",
|
|
5010
5060
|
lg: "shadow-overlay",
|
|
5011
5061
|
xl: "shadow-modal",
|
|
5012
5062
|
"2xl": "shadow-modal"
|
|
5013
|
-
},
|
|
5063
|
+
}, Wr = {
|
|
5014
5064
|
none: "border-0",
|
|
5015
5065
|
sm: "border",
|
|
5016
5066
|
md: "border-2",
|
|
5017
5067
|
lg: "border-4"
|
|
5018
|
-
},
|
|
5068
|
+
}, Kr = {
|
|
5019
5069
|
primary: "border-accent-border",
|
|
5020
5070
|
secondary: "border-border",
|
|
5021
5071
|
accent: "border-accent-border",
|
|
@@ -5025,7 +5075,7 @@ const Mn = ({
|
|
|
5025
5075
|
info: "border-info-border",
|
|
5026
5076
|
neutral: "border-border-subtle",
|
|
5027
5077
|
white: "border-border-subtle"
|
|
5028
|
-
},
|
|
5078
|
+
}, Ue = me(
|
|
5029
5079
|
({
|
|
5030
5080
|
padding: t,
|
|
5031
5081
|
margin: r,
|
|
@@ -5042,13 +5092,13 @@ const Mn = ({
|
|
|
5042
5092
|
{
|
|
5043
5093
|
ref: h,
|
|
5044
5094
|
className: d(
|
|
5045
|
-
t &&
|
|
5046
|
-
r &&
|
|
5047
|
-
n &&
|
|
5048
|
-
s &&
|
|
5049
|
-
a &&
|
|
5050
|
-
o &&
|
|
5051
|
-
l &&
|
|
5095
|
+
t && Rr[t],
|
|
5096
|
+
r && Vr[r],
|
|
5097
|
+
n && Hr[n],
|
|
5098
|
+
s && qr[s],
|
|
5099
|
+
a && Ur[a],
|
|
5100
|
+
o && Wr[o],
|
|
5101
|
+
l && Kr[l],
|
|
5052
5102
|
u
|
|
5053
5103
|
),
|
|
5054
5104
|
...y,
|
|
@@ -5056,9 +5106,9 @@ const Mn = ({
|
|
|
5056
5106
|
}
|
|
5057
5107
|
)
|
|
5058
5108
|
);
|
|
5059
|
-
|
|
5060
|
-
const
|
|
5061
|
-
|
|
5109
|
+
Ue.displayName = "Box";
|
|
5110
|
+
const Bn = ({ children: t, title: r, ...n }) => /* @__PURE__ */ c(
|
|
5111
|
+
Ue,
|
|
5062
5112
|
{
|
|
5063
5113
|
background: "module",
|
|
5064
5114
|
radius: "lg",
|
|
@@ -5072,7 +5122,7 @@ const $n = ({ children: t, title: r, ...n }) => /* @__PURE__ */ c(
|
|
|
5072
5122
|
]
|
|
5073
5123
|
}
|
|
5074
5124
|
);
|
|
5075
|
-
function
|
|
5125
|
+
function Fn({
|
|
5076
5126
|
identifier: t,
|
|
5077
5127
|
resourceLoader: r,
|
|
5078
5128
|
framework: n = "react",
|
|
@@ -5080,7 +5130,7 @@ function Dn({
|
|
|
5080
5130
|
componentProps: a,
|
|
5081
5131
|
className: o
|
|
5082
5132
|
}) {
|
|
5083
|
-
const l = se(null), [u, m] =
|
|
5133
|
+
const l = se(null), [u, m] = F(!0), [y, h] = F(null), f = se(null);
|
|
5084
5134
|
return se(null), Q(() => {
|
|
5085
5135
|
let x = !0;
|
|
5086
5136
|
return (async () => {
|
|
@@ -5120,7 +5170,7 @@ function Dn({
|
|
|
5120
5170
|
n === "react" && y && /* @__PURE__ */ e(y, { ...a })
|
|
5121
5171
|
] });
|
|
5122
5172
|
}
|
|
5123
|
-
class
|
|
5173
|
+
class Rn extends xt {
|
|
5124
5174
|
constructor() {
|
|
5125
5175
|
super(...arguments), this.state = {
|
|
5126
5176
|
hasError: !1,
|
|
@@ -5149,66 +5199,67 @@ class Tn extends xt {
|
|
|
5149
5199
|
}
|
|
5150
5200
|
}
|
|
5151
5201
|
export {
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5202
|
+
Nn as AssistantCard,
|
|
5203
|
+
Er as Avatar,
|
|
5204
|
+
wn as AvatarStack,
|
|
5205
|
+
hn as Badge,
|
|
5206
|
+
Ue as Box,
|
|
5157
5207
|
ne as Button,
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5208
|
+
ln as ButtonGroup,
|
|
5209
|
+
Bn as Card,
|
|
5210
|
+
kn as ChannelBadge,
|
|
5161
5211
|
pe as Checkbox,
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5212
|
+
On as CommandPalette,
|
|
5213
|
+
fn as ConfirmDialog,
|
|
5214
|
+
Wt as ContentLoading,
|
|
5165
5215
|
$e as DatePicker,
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5216
|
+
Kt as Dropdown,
|
|
5217
|
+
xn as EmptyState,
|
|
5218
|
+
Rn as ErrorBoundary,
|
|
5219
|
+
Fn as FederatedResource,
|
|
5220
|
+
on as FilterChip,
|
|
5221
|
+
Ft as FolderSelect,
|
|
5222
|
+
mn as Form,
|
|
5223
|
+
Pn as Heading,
|
|
5174
5224
|
Y as Icon,
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5225
|
+
Cn as Image,
|
|
5226
|
+
bn as Kbd,
|
|
5227
|
+
En as KpiCard,
|
|
5228
|
+
cn as Link,
|
|
5229
|
+
Sn as List,
|
|
5230
|
+
nn as MeetingGrid,
|
|
5231
|
+
zn as MessageBubble,
|
|
5232
|
+
He as Modal,
|
|
5233
|
+
Mn as PageHeader,
|
|
5234
|
+
$n as PageToolbar,
|
|
5235
|
+
sn as ParticipantTile,
|
|
5236
|
+
$t as Popover,
|
|
5237
|
+
pn as ProgressBar,
|
|
5238
|
+
Dn as RichText,
|
|
5239
|
+
qt as SearchableTextField,
|
|
5240
|
+
Tn as SectionDivider,
|
|
5241
|
+
dn as SegmentedToggle,
|
|
5191
5242
|
Ne as Select,
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5243
|
+
_n as SettingsRow,
|
|
5244
|
+
An as SettingsSection,
|
|
5245
|
+
jn as SidebarMenu,
|
|
5246
|
+
Ln as SourceChip,
|
|
5247
|
+
gn as Spinner,
|
|
5248
|
+
Fe as SplitButton,
|
|
5249
|
+
vn as StatusDot,
|
|
5250
|
+
yn as StepIndicator,
|
|
5251
|
+
ur as StorageInput,
|
|
5252
|
+
Ut as Switch,
|
|
5253
|
+
un as TabBar,
|
|
5254
|
+
je as Table,
|
|
5255
|
+
nr as Tabs,
|
|
5205
5256
|
de as Text,
|
|
5206
5257
|
De as TextArea,
|
|
5207
5258
|
be as TextField,
|
|
5208
|
-
|
|
5209
|
-
|
|
5259
|
+
an as VideoSurface,
|
|
5260
|
+
In as View,
|
|
5210
5261
|
d as cn,
|
|
5211
|
-
|
|
5212
|
-
|
|
5262
|
+
rn as createSizes,
|
|
5263
|
+
tn as createVariants
|
|
5213
5264
|
};
|
|
5214
5265
|
//# sourceMappingURL=index.js.map
|