@opencxh/ui-kit 3.113.1 → 3.114.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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +837 -834
- package/dist/index.js.map +1 -1
- package/dist/src/input/Checkbox.d.ts +0 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { clsx as
|
|
1
|
+
import { clsx as qe } from "clsx";
|
|
2
2
|
import { jsxs as i, jsx as e, Fragment as fe } from "react/jsx-runtime";
|
|
3
3
|
import { VideoOff as We, User as Ke, MicOff as _e, Mic as Ge, X as ve, ChevronDown as be, ExternalLink as Je, Calendar as Ye, ChevronLeft as je, ChevronRight as ye, ChevronDownIcon as Xe, Loader2 as Ze, Search as Ne, Check as Me, ChevronUp as Qe, ChevronsLeft as et, ChevronsRight as tt, FileText as ke, HardDrive as $e, ArrowLeft as Ee, FolderPlus as rt, Upload as nt, Folder as De, Trash2 as st, Plus as at, Sparkles as lt, ImageOff as ot, Pencil as ct, ArrowUpRight as it } from "lucide-react";
|
|
4
4
|
import le, { useRef as ae, useEffect as Y, forwardRef as de, useState as R, useLayoutEffect as dt, useMemo as me, useCallback as ce, createContext as ut, Component as mt } from "react";
|
|
5
|
-
function
|
|
6
|
-
return
|
|
5
|
+
function u(...t) {
|
|
6
|
+
return qe(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Ur(t) {
|
|
9
9
|
return (r, n) => t[r]?.[n] || "";
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function qr(t) {
|
|
12
12
|
return (r) => t[r] || "";
|
|
13
13
|
}
|
|
14
14
|
function Wr({ tiles: t, pinned: r, className: n }) {
|
|
15
15
|
if (r)
|
|
16
|
-
return /* @__PURE__ */ i("div", { className:
|
|
16
|
+
return /* @__PURE__ */ i("div", { className: u("flex flex-col md:flex-row gap-2 h-full min-h-0", n), children: [
|
|
17
17
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-0", children: r }),
|
|
18
18
|
t.length > 0 && /* @__PURE__ */ e("div", { className: "flex md:flex-col gap-2 md:w-48 overflow-auto", children: t.map((a, l) => /* @__PURE__ */ e("div", { className: "min-w-40 md:min-w-0", children: a }, l)) })
|
|
19
19
|
] });
|
|
20
20
|
const s = t.length <= 1 ? "grid-cols-1" : t.length <= 4 ? "grid-cols-2" : t.length <= 9 ? "grid-cols-3" : "grid-cols-4";
|
|
21
|
-
return /* @__PURE__ */ e("div", { className:
|
|
21
|
+
return /* @__PURE__ */ e("div", { className: u("grid gap-2 h-full", s, n), children: t.map((a, l) => /* @__PURE__ */ e("div", { children: a }, l)) });
|
|
22
22
|
}
|
|
23
23
|
function Kr({
|
|
24
24
|
name: t,
|
|
@@ -28,14 +28,14 @@ function Kr({
|
|
|
28
28
|
hasVideo: a,
|
|
29
29
|
videoSlot: l,
|
|
30
30
|
className: c,
|
|
31
|
-
fill:
|
|
31
|
+
fill: x
|
|
32
32
|
}) {
|
|
33
33
|
return /* @__PURE__ */ i(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
-
className:
|
|
36
|
+
className: u(
|
|
37
37
|
"relative rounded-lg overflow-hidden bg-video-surface flex items-center justify-center",
|
|
38
|
-
|
|
38
|
+
x ? "h-full w-full" : "aspect-video",
|
|
39
39
|
s && "ring-2 ring-speaking",
|
|
40
40
|
c
|
|
41
41
|
),
|
|
@@ -61,7 +61,7 @@ function _r({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
|
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
63
|
ref: a,
|
|
64
|
-
className:
|
|
64
|
+
className: u(
|
|
65
65
|
"w-full h-full bg-video-surface-strong overflow-hidden",
|
|
66
66
|
n && "[&>*]:scale-x-[-1]",
|
|
67
67
|
s
|
|
@@ -70,16 +70,18 @@ function _r({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
const ft = {
|
|
73
|
-
primary: "bg-accent text-accent-fg hover:bg-accent-hover",
|
|
74
|
-
secondary: "border border-border bg-surface text-text hover:bg-surface-hover",
|
|
73
|
+
primary: "bg-accent text-accent-fg hover:bg-accent-hover disabled:bg-surface-hover",
|
|
74
|
+
secondary: "border border-border bg-surface text-text hover:bg-surface-hover disabled:bg-surface-hover",
|
|
75
|
+
// No resting fill, so no disabled fill either — a greyed-out plate where
|
|
76
|
+
// there was nothing reads as a different control, not as a disabled one.
|
|
75
77
|
outline: "border border-accent-border text-accent hover:bg-accent-soft",
|
|
76
78
|
ghost: "text-text-muted hover:bg-surface-hover hover:text-text",
|
|
77
|
-
destructive: "border border-danger-border bg-danger-soft text-danger-fg hover:border-danger",
|
|
79
|
+
destructive: "border border-danger-border bg-danger-soft text-danger-fg hover:border-danger disabled:bg-surface-hover",
|
|
78
80
|
// Solid status fills. Reserved for a control whose colour IS the answer —
|
|
79
81
|
// an RSVP, answering or rejecting a call — not for ordinary emphasis.
|
|
80
|
-
success: "bg-success text-text-inverse hover:opacity-90",
|
|
81
|
-
warning: "bg-warning text-text-inverse hover:opacity-90",
|
|
82
|
-
"danger-solid": "bg-danger text-text-inverse hover:opacity-90"
|
|
82
|
+
success: "bg-success text-text-inverse hover:opacity-90 disabled:bg-surface-hover",
|
|
83
|
+
warning: "bg-warning text-text-inverse hover:opacity-90 disabled:bg-surface-hover",
|
|
84
|
+
"danger-solid": "bg-danger text-text-inverse hover:opacity-90 disabled:bg-surface-hover"
|
|
83
85
|
}, ht = {
|
|
84
86
|
xs: "h-control-xs px-2 text-xs",
|
|
85
87
|
sm: "h-control-sm px-3 text-sm",
|
|
@@ -105,25 +107,25 @@ const ft = {
|
|
|
105
107
|
leftIcon: a,
|
|
106
108
|
rightIcon: l,
|
|
107
109
|
iconOnly: c = !1,
|
|
108
|
-
shape:
|
|
110
|
+
shape: x = "default",
|
|
109
111
|
className: b,
|
|
110
112
|
children: y,
|
|
111
|
-
disabled:
|
|
112
|
-
...
|
|
113
|
-
},
|
|
114
|
-
const p =
|
|
113
|
+
disabled: f,
|
|
114
|
+
...m
|
|
115
|
+
}, h) => {
|
|
116
|
+
const p = f || s;
|
|
115
117
|
return /* @__PURE__ */ i(
|
|
116
118
|
"button",
|
|
117
119
|
{
|
|
118
|
-
ref:
|
|
120
|
+
ref: h,
|
|
119
121
|
type: "button",
|
|
120
|
-
className:
|
|
122
|
+
className: u(
|
|
121
123
|
"inline-flex shrink-0 items-center justify-center gap-2 cursor-pointer font-semibold",
|
|
122
|
-
|
|
124
|
+
x === "circle" ? "rounded-full" : "rounded-md",
|
|
123
125
|
"transition-colors duration-fast ease-out",
|
|
124
126
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
125
127
|
"disabled:cursor-not-allowed disabled:border-border-subtle",
|
|
126
|
-
"disabled:
|
|
128
|
+
"disabled:text-text-disabled",
|
|
127
129
|
ft[t],
|
|
128
130
|
c ? xt[r] : ht[r],
|
|
129
131
|
(n || r === "full") && "w-full",
|
|
@@ -132,7 +134,7 @@ const ft = {
|
|
|
132
134
|
),
|
|
133
135
|
disabled: p,
|
|
134
136
|
"aria-busy": s || void 0,
|
|
135
|
-
...
|
|
137
|
+
...m,
|
|
136
138
|
children: [
|
|
137
139
|
s && /* @__PURE__ */ e(
|
|
138
140
|
"span",
|
|
@@ -158,7 +160,7 @@ const Gr = ({
|
|
|
158
160
|
attached: s = !0,
|
|
159
161
|
className: a
|
|
160
162
|
}) => {
|
|
161
|
-
const l =
|
|
163
|
+
const l = u(
|
|
162
164
|
"inline-flex",
|
|
163
165
|
{
|
|
164
166
|
// Orientation
|
|
@@ -199,9 +201,9 @@ const Gr = ({
|
|
|
199
201
|
onClick: a,
|
|
200
202
|
className: l,
|
|
201
203
|
"aria-label": c,
|
|
202
|
-
...
|
|
204
|
+
...x
|
|
203
205
|
}) => {
|
|
204
|
-
const b = typeof r == "number" ? r : gt(r), y =
|
|
206
|
+
const b = typeof r == "number" ? r : gt(r), y = u(
|
|
205
207
|
"inline-block shrink-0",
|
|
206
208
|
bt[n],
|
|
207
209
|
s && [
|
|
@@ -209,7 +211,7 @@ const Gr = ({
|
|
|
209
211
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
210
212
|
],
|
|
211
213
|
l
|
|
212
|
-
),
|
|
214
|
+
), f = {
|
|
213
215
|
size: b,
|
|
214
216
|
strokeWidth: 2,
|
|
215
217
|
className: y,
|
|
@@ -218,12 +220,12 @@ const Gr = ({
|
|
|
218
220
|
"aria-hidden": c ? void 0 : !0,
|
|
219
221
|
role: s ? "button" : void 0,
|
|
220
222
|
tabIndex: s ? 0 : void 0,
|
|
221
|
-
onKeyDown: s ? (
|
|
222
|
-
(
|
|
223
|
+
onKeyDown: s ? (m) => {
|
|
224
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), a?.());
|
|
223
225
|
} : void 0,
|
|
224
|
-
...
|
|
226
|
+
...x
|
|
225
227
|
};
|
|
226
|
-
return /* @__PURE__ */ e(t, { ...
|
|
228
|
+
return /* @__PURE__ */ e(t, { ...f });
|
|
227
229
|
};
|
|
228
230
|
function gt(t) {
|
|
229
231
|
return {
|
|
@@ -248,44 +250,44 @@ function Jr({
|
|
|
248
250
|
size: a = "md",
|
|
249
251
|
active: l = !1,
|
|
250
252
|
caret: c = !1,
|
|
251
|
-
onClear:
|
|
253
|
+
onClear: x,
|
|
252
254
|
clearLabel: b = "Filter wissen",
|
|
253
255
|
onClick: y,
|
|
254
|
-
title:
|
|
255
|
-
className:
|
|
256
|
+
title: f,
|
|
257
|
+
className: m
|
|
256
258
|
}) {
|
|
257
|
-
const
|
|
259
|
+
const h = l && !!x, p = s === "pill" ? "rounded-full" : "rounded-md", k = u(
|
|
258
260
|
// A button's default cursor is an arrow, so it has to be asked for.
|
|
259
261
|
"inline-flex cursor-pointer select-none items-center text-sm font-semibold",
|
|
260
262
|
a === "sm" ? "h-control-sm" : "h-control-md",
|
|
261
263
|
"transition-colors duration-fast ease-out",
|
|
262
264
|
p,
|
|
263
265
|
// Picking a value outranks whatever the value happens to mean.
|
|
264
|
-
l ? "bg-accent text-accent-fg" :
|
|
265
|
-
|
|
266
|
+
l ? "bg-accent text-accent-fg" : u("border", pt[n]),
|
|
267
|
+
m
|
|
266
268
|
), v = /* @__PURE__ */ i(fe, { children: [
|
|
267
269
|
r,
|
|
268
270
|
t,
|
|
269
271
|
c && /* @__PURE__ */ e(J, { icon: be, size: "xs" })
|
|
270
|
-
] }), g =
|
|
272
|
+
] }), g = u(
|
|
271
273
|
"inline-flex items-center gap-1.5 pl-3",
|
|
272
274
|
p,
|
|
273
|
-
|
|
275
|
+
h ? "pr-1.5" : "pr-3",
|
|
274
276
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
275
277
|
);
|
|
276
|
-
return
|
|
278
|
+
return h ? /* @__PURE__ */ i("span", { className: k, title: f, children: [
|
|
277
279
|
/* @__PURE__ */ e("button", { type: "button", onClick: y, className: g, children: v }),
|
|
278
280
|
/* @__PURE__ */ e(
|
|
279
281
|
"button",
|
|
280
282
|
{
|
|
281
283
|
type: "button",
|
|
282
284
|
"aria-label": b,
|
|
283
|
-
onClick:
|
|
284
|
-
className:
|
|
285
|
+
onClick: x,
|
|
286
|
+
className: u("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", p),
|
|
285
287
|
children: /* @__PURE__ */ e(J, { icon: ve, size: "xs" })
|
|
286
288
|
}
|
|
287
289
|
)
|
|
288
|
-
] }) : /* @__PURE__ */ e("button", { type: "button", title:
|
|
290
|
+
] }) : /* @__PURE__ */ e("button", { type: "button", title: f, onClick: y, className: u(k, g), children: v });
|
|
289
291
|
}
|
|
290
292
|
const vt = {
|
|
291
293
|
xs: "text-xs",
|
|
@@ -319,12 +321,12 @@ const vt = {
|
|
|
319
321
|
external: a = !1,
|
|
320
322
|
className: l,
|
|
321
323
|
children: c,
|
|
322
|
-
href:
|
|
324
|
+
href: x,
|
|
323
325
|
target: b,
|
|
324
326
|
rel: y,
|
|
325
|
-
...
|
|
327
|
+
...f
|
|
326
328
|
}) => {
|
|
327
|
-
const
|
|
329
|
+
const m = a || x && (x.startsWith("http") || x.startsWith("mailto:")), h = u(
|
|
328
330
|
"inline-flex items-center gap-1 underline-offset-2",
|
|
329
331
|
"transition-colors duration-fast ease-out",
|
|
330
332
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -339,15 +341,15 @@ const vt = {
|
|
|
339
341
|
s && "pointer-events-none cursor-not-allowed text-text-disabled opacity-50",
|
|
340
342
|
l
|
|
341
343
|
), p = {
|
|
342
|
-
...
|
|
343
|
-
href: s ? void 0 :
|
|
344
|
-
target:
|
|
345
|
-
rel:
|
|
344
|
+
...f,
|
|
345
|
+
href: s ? void 0 : x,
|
|
346
|
+
target: m ? "_blank" : b,
|
|
347
|
+
rel: m ? "noopener noreferrer" : y,
|
|
346
348
|
"aria-disabled": s || void 0
|
|
347
349
|
};
|
|
348
|
-
return /* @__PURE__ */ i("a", { className:
|
|
350
|
+
return /* @__PURE__ */ i("a", { className: h, ...p, children: [
|
|
349
351
|
c,
|
|
350
|
-
|
|
352
|
+
m && /* @__PURE__ */ e(Je, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
|
|
351
353
|
] });
|
|
352
354
|
}, wt = {
|
|
353
355
|
sm: "h-control-sm px-3 text-sm",
|
|
@@ -366,22 +368,22 @@ function Xr({
|
|
|
366
368
|
{
|
|
367
369
|
role: "tablist",
|
|
368
370
|
"aria-label": l,
|
|
369
|
-
className:
|
|
371
|
+
className: u("inline-flex gap-0.5 rounded-md bg-surface-hover p-0.5", a),
|
|
370
372
|
children: t.map((c) => {
|
|
371
|
-
const
|
|
373
|
+
const x = c.value === r;
|
|
372
374
|
return /* @__PURE__ */ e(
|
|
373
375
|
"button",
|
|
374
376
|
{
|
|
375
377
|
role: "tab",
|
|
376
|
-
"aria-selected":
|
|
378
|
+
"aria-selected": x,
|
|
377
379
|
type: "button",
|
|
378
380
|
onClick: () => n(c.value),
|
|
379
|
-
className:
|
|
381
|
+
className: u(
|
|
380
382
|
"inline-flex items-center justify-center rounded-sm",
|
|
381
383
|
"transition-colors duration-fast ease-out",
|
|
382
384
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
383
385
|
wt[s],
|
|
384
|
-
|
|
386
|
+
x ? "bg-surface text-text font-semibold" : "text-text-muted hover:text-text"
|
|
385
387
|
),
|
|
386
388
|
children: c.label
|
|
387
389
|
},
|
|
@@ -395,14 +397,14 @@ function we(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start
|
|
|
395
397
|
const [l, c] = R({});
|
|
396
398
|
return dt(() => {
|
|
397
399
|
if (!t) return;
|
|
398
|
-
const
|
|
400
|
+
const x = () => {
|
|
399
401
|
const b = r.current;
|
|
400
402
|
if (!b) return;
|
|
401
|
-
const y = b.getBoundingClientRect(),
|
|
402
|
-
k ? (v.bottom = window.innerHeight - y.top + n, v.maxHeight = Math.max(120,
|
|
403
|
+
const y = b.getBoundingClientRect(), f = window.innerHeight - y.bottom, m = y.top, h = a.startsWith("top"), p = h ? m < 200 && f > m : f < 200 && m > f, k = h !== p, v = { position: "fixed" };
|
|
404
|
+
k ? (v.bottom = window.innerHeight - y.top + n, v.maxHeight = Math.max(120, m - n * 2)) : (v.top = y.bottom + n, v.maxHeight = Math.max(120, f - n * 2)), a.endsWith("end") ? v.right = window.innerWidth - y.right : v.left = y.left, s && (v.width = y.width), c(v);
|
|
403
405
|
};
|
|
404
|
-
return
|
|
405
|
-
window.removeEventListener("scroll",
|
|
406
|
+
return x(), window.addEventListener("scroll", x, !0), window.addEventListener("resize", x), () => {
|
|
407
|
+
window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x);
|
|
406
408
|
};
|
|
407
409
|
}, [t, r, n, s, a]), l;
|
|
408
410
|
}
|
|
@@ -414,15 +416,15 @@ const kt = ({
|
|
|
414
416
|
rootClassName: a,
|
|
415
417
|
triggerClassName: l,
|
|
416
418
|
disabled: c = !1,
|
|
417
|
-
triggerLabel:
|
|
419
|
+
triggerLabel: x
|
|
418
420
|
}) => {
|
|
419
|
-
const [b, y] = R(!1),
|
|
421
|
+
const [b, y] = R(!1), f = ae(null), m = ae(null), h = we(b, m, { placement: n });
|
|
420
422
|
Y(() => {
|
|
421
423
|
if (!b) return;
|
|
422
|
-
const v = (
|
|
423
|
-
|
|
424
|
-
}, g = (
|
|
425
|
-
|
|
424
|
+
const v = (L) => {
|
|
425
|
+
f.current && !f.current.contains(L.target) && y(!1);
|
|
426
|
+
}, g = (L) => {
|
|
427
|
+
L.key === "Escape" && y(!1);
|
|
426
428
|
};
|
|
427
429
|
return document.addEventListener("mousedown", v), document.addEventListener("keydown", g), () => {
|
|
428
430
|
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", g);
|
|
@@ -431,17 +433,17 @@ const kt = ({
|
|
|
431
433
|
const p = (v) => {
|
|
432
434
|
v.stopPropagation(), !c && y((g) => !g);
|
|
433
435
|
}, k = () => y(!1);
|
|
434
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
436
|
+
return /* @__PURE__ */ i("div", { ref: f, className: u("relative inline-flex", a), children: [
|
|
435
437
|
/* @__PURE__ */ e(
|
|
436
438
|
"button",
|
|
437
439
|
{
|
|
438
|
-
ref:
|
|
440
|
+
ref: m,
|
|
439
441
|
type: "button",
|
|
440
442
|
onClick: p,
|
|
441
443
|
disabled: c,
|
|
442
|
-
"aria-label":
|
|
444
|
+
"aria-label": x,
|
|
443
445
|
"aria-expanded": b,
|
|
444
|
-
className:
|
|
446
|
+
className: u(
|
|
445
447
|
"inline-flex items-center",
|
|
446
448
|
c && "cursor-not-allowed opacity-50",
|
|
447
449
|
l
|
|
@@ -452,13 +454,13 @@ const kt = ({
|
|
|
452
454
|
b && /* @__PURE__ */ e(
|
|
453
455
|
"div",
|
|
454
456
|
{
|
|
455
|
-
className:
|
|
457
|
+
className: u(
|
|
456
458
|
// overflow-y-auto pairs with the hook's max-height: without it a
|
|
457
459
|
// panel taller than the space available is simply cut off.
|
|
458
460
|
"fixed z-overlay overflow-y-auto rounded-lg border border-border bg-surface shadow-overlay",
|
|
459
461
|
s
|
|
460
462
|
),
|
|
461
|
-
style:
|
|
463
|
+
style: h,
|
|
462
464
|
children: typeof r == "function" ? r(k) : r
|
|
463
465
|
}
|
|
464
466
|
)
|
|
@@ -479,11 +481,11 @@ function Pe({
|
|
|
479
481
|
icon: a,
|
|
480
482
|
options: l,
|
|
481
483
|
disabled: c = !1,
|
|
482
|
-
loading:
|
|
484
|
+
loading: x = !1,
|
|
483
485
|
menuPlacement: b = "bottom-end",
|
|
484
486
|
menuLabel: y = "More options"
|
|
485
487
|
}) {
|
|
486
|
-
const
|
|
488
|
+
const f = c || x, m = l.length > 0;
|
|
487
489
|
return /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-px", children: [
|
|
488
490
|
/* @__PURE__ */ e(
|
|
489
491
|
re,
|
|
@@ -492,41 +494,41 @@ function Pe({
|
|
|
492
494
|
size: s,
|
|
493
495
|
onClick: r,
|
|
494
496
|
disabled: c,
|
|
495
|
-
loading:
|
|
497
|
+
loading: x,
|
|
496
498
|
leftIcon: a,
|
|
497
|
-
className: m
|
|
499
|
+
className: u(m && "rounded-r-none"),
|
|
498
500
|
children: t
|
|
499
501
|
}
|
|
500
502
|
),
|
|
501
|
-
|
|
503
|
+
m && /* @__PURE__ */ e(
|
|
502
504
|
kt,
|
|
503
505
|
{
|
|
504
506
|
placement: b,
|
|
505
|
-
disabled:
|
|
507
|
+
disabled: f,
|
|
506
508
|
triggerLabel: y,
|
|
507
509
|
className: "min-w-menu py-1",
|
|
508
510
|
trigger: /* @__PURE__ */ e(
|
|
509
511
|
"span",
|
|
510
512
|
{
|
|
511
513
|
"aria-hidden": "true",
|
|
512
|
-
className:
|
|
514
|
+
className: u(
|
|
513
515
|
"inline-flex items-center justify-center rounded-md rounded-l-none",
|
|
514
516
|
"transition-colors duration-fast ease-out",
|
|
515
517
|
Ct[n],
|
|
516
518
|
St[s],
|
|
517
|
-
|
|
519
|
+
f && "cursor-not-allowed opacity-50"
|
|
518
520
|
),
|
|
519
521
|
children: /* @__PURE__ */ e(be, { className: "size-icon-md" })
|
|
520
522
|
}
|
|
521
523
|
),
|
|
522
|
-
children: (
|
|
524
|
+
children: (h) => /* @__PURE__ */ e(fe, { children: l.map((p) => /* @__PURE__ */ i(
|
|
523
525
|
"button",
|
|
524
526
|
{
|
|
525
527
|
type: "button",
|
|
526
528
|
onClick: () => {
|
|
527
|
-
p.onClick(),
|
|
529
|
+
p.onClick(), h();
|
|
528
530
|
},
|
|
529
|
-
className:
|
|
531
|
+
className: u(
|
|
530
532
|
"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm",
|
|
531
533
|
"transition-colors duration-fast ease-out",
|
|
532
534
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -565,53 +567,53 @@ const zt = {
|
|
|
565
567
|
error: n,
|
|
566
568
|
size: s = "md",
|
|
567
569
|
indeterminate: a = !1,
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
v.current = $, typeof u == "function" ? u($) : u && typeof u == "object" && (u.current = $);
|
|
570
|
+
containerClassName: l,
|
|
571
|
+
labelClassName: c,
|
|
572
|
+
className: x,
|
|
573
|
+
id: b,
|
|
574
|
+
...y
|
|
575
|
+
}, f) => {
|
|
576
|
+
const m = le.useId(), h = b || `checkbox-${m}`, p = !!n, k = le.useRef(null), v = le.useCallback(
|
|
577
|
+
(g) => {
|
|
578
|
+
k.current = g, typeof f == "function" ? f(g) : f && typeof f == "object" && (f.current = g);
|
|
578
579
|
},
|
|
579
|
-
[
|
|
580
|
+
[f]
|
|
580
581
|
);
|
|
581
582
|
return le.useEffect(() => {
|
|
582
|
-
|
|
583
|
-
}, [a]), /* @__PURE__ */ i("div", { className:
|
|
584
|
-
/* @__PURE__ */ i("div", { className:
|
|
583
|
+
k.current && (k.current.indeterminate = a);
|
|
584
|
+
}, [a]), /* @__PURE__ */ i("div", { className: u("flex flex-col", l), children: [
|
|
585
|
+
/* @__PURE__ */ i("div", { className: u("flex items-center gap-3", Et[s]), children: [
|
|
585
586
|
/* @__PURE__ */ e(
|
|
586
587
|
"input",
|
|
587
588
|
{
|
|
588
|
-
ref:
|
|
589
|
-
id:
|
|
589
|
+
ref: v,
|
|
590
|
+
id: h,
|
|
590
591
|
type: "checkbox",
|
|
591
|
-
"aria-invalid":
|
|
592
|
-
className:
|
|
593
|
-
|
|
594
|
-
|
|
592
|
+
"aria-invalid": p || void 0,
|
|
593
|
+
className: u(
|
|
594
|
+
// rounded-md, not rounded-sm: at 16px a 4px corner reads as a
|
|
595
|
+
// hard square, and the box is the one thing you aim at in a list.
|
|
596
|
+
"shrink-0 rounded-md border bg-surface-input accent-accent",
|
|
595
597
|
"transition-colors duration-fast ease-out",
|
|
596
598
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
597
599
|
"disabled:cursor-not-allowed disabled:bg-surface-hover",
|
|
598
600
|
zt[s],
|
|
599
|
-
|
|
600
|
-
|
|
601
|
+
p ? "border-danger-border" : "border-border-strong",
|
|
602
|
+
x
|
|
601
603
|
),
|
|
602
|
-
...
|
|
604
|
+
...y
|
|
603
605
|
}
|
|
604
606
|
),
|
|
605
607
|
t && /* @__PURE__ */ i("div", { className: "flex-1", children: [
|
|
606
608
|
/* @__PURE__ */ e(
|
|
607
609
|
"label",
|
|
608
610
|
{
|
|
609
|
-
htmlFor:
|
|
610
|
-
className:
|
|
611
|
+
htmlFor: h,
|
|
612
|
+
className: u(
|
|
611
613
|
"cursor-pointer",
|
|
612
|
-
|
|
614
|
+
p ? "text-danger-fg" : "text-text",
|
|
613
615
|
Mt[s],
|
|
614
|
-
|
|
616
|
+
c
|
|
615
617
|
),
|
|
616
618
|
children: t
|
|
617
619
|
}
|
|
@@ -632,39 +634,39 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
632
634
|
required: a = !1,
|
|
633
635
|
size: l = "md",
|
|
634
636
|
className: c,
|
|
635
|
-
minDate:
|
|
637
|
+
minDate: x,
|
|
636
638
|
maxDate: b,
|
|
637
639
|
format: y = "MM/dd/yyyy",
|
|
638
|
-
withTime:
|
|
639
|
-
},
|
|
640
|
-
const [
|
|
640
|
+
withTime: f = !1
|
|
641
|
+
}, m) => {
|
|
642
|
+
const [h, p] = R(!1), [k, v] = R(() => t || /* @__PURE__ */ new Date()), g = ae(null), L = ae(null), $ = we(h, L);
|
|
641
643
|
Y(() => {
|
|
642
644
|
const d = (E) => {
|
|
643
645
|
g.current && !g.current.contains(E.target) && p(!1);
|
|
644
646
|
};
|
|
645
|
-
return
|
|
647
|
+
return h && document.addEventListener("mousedown", d), () => {
|
|
646
648
|
document.removeEventListener("mousedown", d);
|
|
647
649
|
};
|
|
648
|
-
}, [
|
|
650
|
+
}, [h]);
|
|
649
651
|
const _ = (d) => {
|
|
650
652
|
if (!d) return "";
|
|
651
|
-
const E = d.getDate().toString().padStart(2, "0"), N = (d.getMonth() + 1).toString().padStart(2, "0"),
|
|
652
|
-
return
|
|
653
|
-
}, M = (d) => `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}`,
|
|
653
|
+
const E = d.getDate().toString().padStart(2, "0"), N = (d.getMonth() + 1).toString().padStart(2, "0"), A = d.getFullYear(), w = y === "dd/MM/yyyy" ? `${E}/${N}/${A}` : y === "yyyy-MM-dd" ? `${A}-${N}-${E}` : `${N}/${E}/${A}`;
|
|
654
|
+
return f ? `${w} ${M(d)}` : w;
|
|
655
|
+
}, M = (d) => `${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}`, U = (d) => {
|
|
654
656
|
const [E, N] = d.split(":").map(Number);
|
|
655
657
|
if (Number.isNaN(E) || Number.isNaN(N)) return;
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
+
const A = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
659
|
+
A.setHours(E, N, 0, 0), r?.(A);
|
|
658
660
|
}, V = () => {
|
|
659
|
-
const d = k.getFullYear(), E = k.getMonth(), N = new Date(d, E, 1),
|
|
660
|
-
|
|
661
|
-
const w = [], Q = new Date(
|
|
661
|
+
const d = k.getFullYear(), E = k.getMonth(), N = new Date(d, E, 1), A = new Date(N);
|
|
662
|
+
A.setDate(A.getDate() - N.getDay());
|
|
663
|
+
const w = [], Q = new Date(A);
|
|
662
664
|
for (let te = 0; te < 42; te++)
|
|
663
665
|
w.push(new Date(Q)), Q.setDate(Q.getDate() + 1);
|
|
664
666
|
return w;
|
|
665
667
|
}, j = (d) => {
|
|
666
|
-
if (d.getMonth() === k.getMonth() && !(
|
|
667
|
-
if (
|
|
668
|
+
if (d.getMonth() === k.getMonth() && !(x && d < x) && !(b && d > b)) {
|
|
669
|
+
if (f) {
|
|
668
670
|
const N = new Date(d);
|
|
669
671
|
N.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(N);
|
|
670
672
|
return;
|
|
@@ -677,7 +679,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
677
679
|
v(new Date(k.getFullYear(), k.getMonth() + 1, 1));
|
|
678
680
|
}, X = () => {
|
|
679
681
|
r?.(null), p(!1);
|
|
680
|
-
}, Z =
|
|
682
|
+
}, Z = u(
|
|
681
683
|
"w-full border border-border rounded-md transition-colors duration-fast",
|
|
682
684
|
"bg-surface text-text",
|
|
683
685
|
"placeholder:text-text-muted",
|
|
@@ -705,33 +707,33 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
705
707
|
"December"
|
|
706
708
|
];
|
|
707
709
|
return /* @__PURE__ */ i("div", { ref: g, className: "relative", children: [
|
|
708
|
-
/* @__PURE__ */ i("div", { ref:
|
|
710
|
+
/* @__PURE__ */ i("div", { ref: L, className: "relative", children: [
|
|
709
711
|
/* @__PURE__ */ e(
|
|
710
712
|
"input",
|
|
711
713
|
{
|
|
712
|
-
ref:
|
|
714
|
+
ref: m,
|
|
713
715
|
type: "text",
|
|
714
716
|
value: _(t ?? null),
|
|
715
717
|
placeholder: n,
|
|
716
718
|
disabled: s,
|
|
717
719
|
required: a,
|
|
718
720
|
readOnly: !0,
|
|
719
|
-
onClick: () => !s && p(!
|
|
720
|
-
className:
|
|
721
|
+
onClick: () => !s && p(!h),
|
|
722
|
+
className: u(Z, "pr-10 cursor-pointer")
|
|
721
723
|
}
|
|
722
724
|
),
|
|
723
725
|
/* @__PURE__ */ e(
|
|
724
726
|
"button",
|
|
725
727
|
{
|
|
726
728
|
type: "button",
|
|
727
|
-
onClick: () => !s && p(!
|
|
729
|
+
onClick: () => !s && p(!h),
|
|
728
730
|
disabled: s,
|
|
729
731
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted hover:text-text-muted",
|
|
730
732
|
children: /* @__PURE__ */ e($t, {})
|
|
731
733
|
}
|
|
732
734
|
)
|
|
733
735
|
] }),
|
|
734
|
-
|
|
736
|
+
h && /* @__PURE__ */ i("div", { style: $, className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
735
737
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
736
738
|
/* @__PURE__ */ e(
|
|
737
739
|
"button",
|
|
@@ -757,18 +759,18 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
757
759
|
] }),
|
|
758
760
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((d) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: d }, d)) }),
|
|
759
761
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: ee.map((d, E) => {
|
|
760
|
-
const N = d.getMonth() === k.getMonth(),
|
|
762
|
+
const N = d.getMonth() === k.getMonth(), A = t && d.toDateString() === t.toDateString(), w = d.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), Q = !N || x && d < x || b && d > b;
|
|
761
763
|
return /* @__PURE__ */ e(
|
|
762
764
|
"button",
|
|
763
765
|
{
|
|
764
766
|
onClick: () => !Q && j(d),
|
|
765
767
|
disabled: Q,
|
|
766
|
-
className:
|
|
768
|
+
className: u(
|
|
767
769
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
768
770
|
{
|
|
769
|
-
"text-text hover:bg-surface-hover": N && !
|
|
770
|
-
"bg-accent text-accent-fg":
|
|
771
|
-
"bg-surface-hover text-text": w && !
|
|
771
|
+
"text-text hover:bg-surface-hover": N && !A && !Q,
|
|
772
|
+
"bg-accent text-accent-fg": A,
|
|
773
|
+
"bg-surface-hover text-text": w && !A,
|
|
772
774
|
"text-text-muted cursor-not-allowed": Q
|
|
773
775
|
}
|
|
774
776
|
),
|
|
@@ -777,7 +779,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
777
779
|
E
|
|
778
780
|
);
|
|
779
781
|
}) }),
|
|
780
|
-
|
|
782
|
+
f && /* @__PURE__ */ i("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
|
|
781
783
|
/* @__PURE__ */ e("label", { htmlFor: "datepicker-time", className: "text-sm text-text-muted", children: "Tijd" }),
|
|
782
784
|
/* @__PURE__ */ e(
|
|
783
785
|
"input",
|
|
@@ -785,7 +787,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
785
787
|
id: "datepicker-time",
|
|
786
788
|
type: "time",
|
|
787
789
|
value: t ? M(t) : "",
|
|
788
|
-
onChange: (d) =>
|
|
790
|
+
onChange: (d) => U(d.target.value),
|
|
789
791
|
className: "h-control-sm rounded-md border border-border bg-surface-input px-2 text-sm text-text focus-visible:outline-none focus-visible:focus-ring"
|
|
790
792
|
}
|
|
791
793
|
)
|
|
@@ -824,88 +826,88 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
824
826
|
fullWidth: a = !1,
|
|
825
827
|
options: l,
|
|
826
828
|
placeholder: c,
|
|
827
|
-
containerClassName:
|
|
829
|
+
containerClassName: x,
|
|
828
830
|
labelClassName: b,
|
|
829
831
|
className: y,
|
|
830
|
-
id:
|
|
831
|
-
searchable:
|
|
832
|
-
multiple:
|
|
832
|
+
id: f,
|
|
833
|
+
searchable: m,
|
|
834
|
+
multiple: h,
|
|
833
835
|
value: p,
|
|
834
836
|
onChange: k,
|
|
835
837
|
allowCreate: v,
|
|
836
838
|
onCreateOption: g,
|
|
837
|
-
|
|
838
|
-
},
|
|
839
|
-
const _ =
|
|
840
|
-
le.useImperativeHandle(
|
|
841
|
-
const S = (
|
|
842
|
-
H.current && !H.current.contains(
|
|
839
|
+
...L
|
|
840
|
+
}, $) => {
|
|
841
|
+
const _ = f || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [U, V] = le.useState(!1), [j, W] = le.useState(""), H = le.useRef(null), X = le.useRef(null), Z = we(U, X, { matchWidth: !0 }), [ee, C] = le.useState(l);
|
|
842
|
+
le.useImperativeHandle($, () => H.current), le.useEffect(() => {
|
|
843
|
+
const S = (T) => {
|
|
844
|
+
H.current && !H.current.contains(T.target) && V(!1);
|
|
843
845
|
};
|
|
844
846
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
845
847
|
}, []);
|
|
846
848
|
const d = le.useCallback(
|
|
847
|
-
(S,
|
|
848
|
-
(I) => ge(I.value) === ge(
|
|
849
|
+
(S, T) => S.some(
|
|
850
|
+
(I) => ge(I.value) === ge(T) || ge(I.label) === ge(T)
|
|
849
851
|
),
|
|
850
852
|
[]
|
|
851
853
|
), E = le.useCallback(
|
|
852
|
-
(S,
|
|
853
|
-
const I = [...S],
|
|
854
|
-
const P = (
|
|
854
|
+
(S, T) => {
|
|
855
|
+
const I = [...S], D = (q) => {
|
|
856
|
+
const P = (q ?? "").trim();
|
|
855
857
|
P && (d(I, P) || I.push({ value: P, label: P }));
|
|
856
858
|
};
|
|
857
|
-
return Array.isArray(
|
|
859
|
+
return Array.isArray(T) ? T.forEach(D) : D(T), I;
|
|
858
860
|
},
|
|
859
861
|
[d]
|
|
860
862
|
);
|
|
861
863
|
le.useEffect(() => {
|
|
862
864
|
C((S) => {
|
|
863
|
-
const
|
|
865
|
+
const T = [...l];
|
|
864
866
|
return S.forEach((I) => {
|
|
865
|
-
!d(
|
|
866
|
-
}), E(
|
|
867
|
+
!d(T, I.value) && !d(T, I.label) && T.push(I);
|
|
868
|
+
}), E(T, p);
|
|
867
869
|
});
|
|
868
870
|
}, [l, p, E, d]);
|
|
869
871
|
const N = (S) => {
|
|
870
|
-
if (
|
|
871
|
-
const
|
|
872
|
+
if (h) {
|
|
873
|
+
const T = Array.isArray(p) ? p : [], I = T.includes(S) ? T.filter((D) => D !== S) : [...T, S];
|
|
872
874
|
k?.(I);
|
|
873
875
|
} else
|
|
874
876
|
k?.(S), V(!1), W("");
|
|
875
|
-
},
|
|
877
|
+
}, A = h ? null : ee.find((S) => S.value === p), w = h ? ee.filter(
|
|
876
878
|
(S) => Array.isArray(p) && p.includes(S.value)
|
|
877
|
-
) : [], Q =
|
|
879
|
+
) : [], Q = m && j ? ee.filter(
|
|
878
880
|
(S) => S.label.toLowerCase().includes(j.toLowerCase())
|
|
879
|
-
) : ee, te = !!v && !!
|
|
880
|
-
const
|
|
881
|
-
if (!
|
|
882
|
-
const I = g?.(
|
|
883
|
-
value:
|
|
884
|
-
label:
|
|
881
|
+
) : ee, te = !!v && !!m && !!j.trim() && !d(ee, j), ne = (S) => {
|
|
882
|
+
const T = S.trim();
|
|
883
|
+
if (!T) return;
|
|
884
|
+
const I = g?.(T) ?? {
|
|
885
|
+
value: T,
|
|
886
|
+
label: T
|
|
885
887
|
};
|
|
886
888
|
if (d(ee, I.value) || d(ee, I.label)) {
|
|
887
|
-
N(I.value), W(""),
|
|
889
|
+
N(I.value), W(""), h || V(!1);
|
|
888
890
|
return;
|
|
889
891
|
}
|
|
890
|
-
C((
|
|
891
|
-
}, G = () =>
|
|
892
|
+
C((D) => [...D, I]), N(I.value), W(""), h || V(!1);
|
|
893
|
+
}, G = () => h ? w.length > 0 ? w.map((S) => S.label).join(", ") : c || "Select options" : A?.label || c || "Select an option";
|
|
892
894
|
return /* @__PURE__ */ i(
|
|
893
895
|
"div",
|
|
894
896
|
{
|
|
895
897
|
ref: H,
|
|
896
|
-
className:
|
|
898
|
+
className: u(
|
|
897
899
|
"relative flex flex-col",
|
|
898
900
|
a && "w-full",
|
|
899
|
-
|
|
901
|
+
x
|
|
900
902
|
),
|
|
901
|
-
|
|
903
|
+
...L,
|
|
902
904
|
children: [
|
|
903
905
|
t && /* @__PURE__ */ e(
|
|
904
906
|
"label",
|
|
905
907
|
{
|
|
906
908
|
htmlFor: _,
|
|
907
|
-
onClick: () => V(!
|
|
908
|
-
className:
|
|
909
|
+
onClick: () => V(!U),
|
|
910
|
+
className: u(
|
|
909
911
|
"block text-xs font-semibold uppercase tracking-label mb-1.5",
|
|
910
912
|
M ? "text-danger-fg" : "text-text-muted",
|
|
911
913
|
b
|
|
@@ -920,8 +922,8 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
920
922
|
ref: X,
|
|
921
923
|
type: "button",
|
|
922
924
|
id: _,
|
|
923
|
-
onClick: () => V(!
|
|
924
|
-
className:
|
|
925
|
+
onClick: () => V(!U),
|
|
926
|
+
className: u(
|
|
925
927
|
"flex w-full items-center justify-between gap-2 rounded-md border transition-colors duration-fast text-left",
|
|
926
928
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
927
929
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
@@ -936,17 +938,17 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
936
938
|
Xe,
|
|
937
939
|
{
|
|
938
940
|
size: 16,
|
|
939
|
-
className:
|
|
941
|
+
className: u(
|
|
940
942
|
"shrink-0 opacity-60 transition-transform duration-fast",
|
|
941
|
-
|
|
943
|
+
U && "rotate-180"
|
|
942
944
|
)
|
|
943
945
|
}
|
|
944
946
|
)
|
|
945
947
|
]
|
|
946
948
|
}
|
|
947
949
|
),
|
|
948
|
-
|
|
949
|
-
|
|
950
|
+
U && /* @__PURE__ */ i("div", { style: Z, className: "fixed z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
|
|
951
|
+
m && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
950
952
|
"input",
|
|
951
953
|
{
|
|
952
954
|
type: "text",
|
|
@@ -956,7 +958,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
956
958
|
onKeyDown: (S) => {
|
|
957
959
|
S.key === "Enter" && te && (S.preventDefault(), ne(j));
|
|
958
960
|
},
|
|
959
|
-
className:
|
|
961
|
+
className: u(
|
|
960
962
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
961
963
|
"text-text border-border focus-visible:outline-none focus-visible:focus-ring"
|
|
962
964
|
)
|
|
@@ -965,7 +967,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
965
967
|
te && /* @__PURE__ */ i(
|
|
966
968
|
"div",
|
|
967
969
|
{
|
|
968
|
-
className:
|
|
970
|
+
className: u(
|
|
969
971
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
970
972
|
"text-info-fg hover:bg-surface-hover"
|
|
971
973
|
),
|
|
@@ -978,7 +980,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
978
980
|
}
|
|
979
981
|
),
|
|
980
982
|
/* @__PURE__ */ i("ul", { className: "min-h-0 flex-1 overflow-auto py-1", children: [
|
|
981
|
-
c && !
|
|
983
|
+
c && !h && /* @__PURE__ */ e(
|
|
982
984
|
"li",
|
|
983
985
|
{
|
|
984
986
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
@@ -989,23 +991,23 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
989
991
|
}
|
|
990
992
|
),
|
|
991
993
|
Q.map((S) => {
|
|
992
|
-
const
|
|
994
|
+
const T = h ? Array.isArray(p) && p.includes(S.value) : p === S.value;
|
|
993
995
|
return /* @__PURE__ */ e(
|
|
994
996
|
"li",
|
|
995
997
|
{
|
|
996
998
|
onClick: () => !S.disabled && N(S.value),
|
|
997
|
-
className:
|
|
999
|
+
className: u(
|
|
998
1000
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
999
1001
|
"text-text",
|
|
1000
1002
|
S.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-surface-hover",
|
|
1001
|
-
|
|
1003
|
+
T && "bg-accent-soft text-accent font-semibold"
|
|
1002
1004
|
),
|
|
1003
1005
|
children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1004
|
-
|
|
1006
|
+
h && /* @__PURE__ */ e(
|
|
1005
1007
|
"input",
|
|
1006
1008
|
{
|
|
1007
1009
|
type: "checkbox",
|
|
1008
|
-
checked:
|
|
1010
|
+
checked: T,
|
|
1009
1011
|
readOnly: !0,
|
|
1010
1012
|
className: "mr-3 h-4 w-4 rounded border-border [&:not(:checked)]:bg-surface-input text-accent "
|
|
1011
1013
|
}
|
|
@@ -1022,7 +1024,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
1022
1024
|
(n || r) && /* @__PURE__ */ e(
|
|
1023
1025
|
"p",
|
|
1024
1026
|
{
|
|
1025
|
-
className:
|
|
1027
|
+
className: u(
|
|
1026
1028
|
"mt-1 text-xs",
|
|
1027
1029
|
M ? "text-danger-fg" : "text-text-muted"
|
|
1028
1030
|
),
|
|
@@ -1049,20 +1051,20 @@ const Lt = {
|
|
|
1049
1051
|
fullWidth: a = !1,
|
|
1050
1052
|
startIcon: l,
|
|
1051
1053
|
endIcon: c,
|
|
1052
|
-
loading:
|
|
1054
|
+
loading: x = !1,
|
|
1053
1055
|
containerClassName: b,
|
|
1054
1056
|
labelClassName: y,
|
|
1055
|
-
className:
|
|
1056
|
-
id:
|
|
1057
|
-
...
|
|
1057
|
+
className: f,
|
|
1058
|
+
id: m,
|
|
1059
|
+
...h
|
|
1058
1060
|
}, p) => {
|
|
1059
|
-
const k = le.useId(), v =
|
|
1060
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1061
|
+
const k = le.useId(), v = m || `textfield-${k}`, g = !!n, L = n || r ? `${v}-description` : void 0;
|
|
1062
|
+
return /* @__PURE__ */ i("div", { className: u("flex flex-col", a && "w-full", b), children: [
|
|
1061
1063
|
t && /* @__PURE__ */ e(
|
|
1062
1064
|
"label",
|
|
1063
1065
|
{
|
|
1064
1066
|
htmlFor: v,
|
|
1065
|
-
className:
|
|
1067
|
+
className: u(
|
|
1066
1068
|
Oe,
|
|
1067
1069
|
g ? "text-danger-fg" : "text-text-subtle",
|
|
1068
1070
|
y
|
|
@@ -1078,8 +1080,8 @@ const Lt = {
|
|
|
1078
1080
|
ref: p,
|
|
1079
1081
|
id: v,
|
|
1080
1082
|
"aria-invalid": g || void 0,
|
|
1081
|
-
"aria-describedby":
|
|
1082
|
-
className:
|
|
1083
|
+
"aria-describedby": L,
|
|
1084
|
+
className: u(
|
|
1083
1085
|
"block w-full rounded-md border bg-surface-input text-text",
|
|
1084
1086
|
"transition-colors duration-fast ease-out",
|
|
1085
1087
|
"placeholder:text-text-subtle",
|
|
@@ -1087,14 +1089,14 @@ const Lt = {
|
|
|
1087
1089
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
1088
1090
|
Lt[s],
|
|
1089
1091
|
l && "pl-9",
|
|
1090
|
-
(c ||
|
|
1092
|
+
(c || x) && "pr-9",
|
|
1091
1093
|
g ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
1092
|
-
|
|
1094
|
+
f
|
|
1093
1095
|
),
|
|
1094
|
-
...
|
|
1096
|
+
...h
|
|
1095
1097
|
}
|
|
1096
1098
|
),
|
|
1097
|
-
(c ||
|
|
1099
|
+
(c || x) && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted", children: x ? /* @__PURE__ */ e(
|
|
1098
1100
|
"span",
|
|
1099
1101
|
{
|
|
1100
1102
|
"aria-hidden": !0,
|
|
@@ -1105,8 +1107,8 @@ const Lt = {
|
|
|
1105
1107
|
(n || r) && /* @__PURE__ */ e(
|
|
1106
1108
|
"p",
|
|
1107
1109
|
{
|
|
1108
|
-
id:
|
|
1109
|
-
className:
|
|
1110
|
+
id: L,
|
|
1111
|
+
className: u("mt-1 text-xs", g ? "text-danger-fg" : "text-text-subtle"),
|
|
1110
1112
|
children: n || r
|
|
1111
1113
|
}
|
|
1112
1114
|
)
|
|
@@ -1122,39 +1124,39 @@ function It({
|
|
|
1122
1124
|
size: a = "md",
|
|
1123
1125
|
placeholder: l,
|
|
1124
1126
|
templatePlaceholder: c,
|
|
1125
|
-
showTemplate:
|
|
1127
|
+
showTemplate: x = !0
|
|
1126
1128
|
}) {
|
|
1127
1129
|
const [b, y] = R([]);
|
|
1128
1130
|
Y(() => {
|
|
1129
|
-
let
|
|
1130
|
-
return Promise.resolve(n?.()).then((
|
|
1131
|
-
|
|
1131
|
+
let m = !0;
|
|
1132
|
+
return Promise.resolve(n?.()).then((h) => {
|
|
1133
|
+
m && h && y(h.data ?? []);
|
|
1132
1134
|
}).catch(() => {
|
|
1133
1135
|
}), () => {
|
|
1134
|
-
|
|
1136
|
+
m = !1;
|
|
1135
1137
|
};
|
|
1136
1138
|
}, []);
|
|
1137
|
-
const
|
|
1139
|
+
const f = t ?? {};
|
|
1138
1140
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
|
|
1139
1141
|
/* @__PURE__ */ e(
|
|
1140
1142
|
pe,
|
|
1141
1143
|
{
|
|
1142
1144
|
size: a,
|
|
1143
1145
|
fullWidth: !0,
|
|
1144
|
-
value:
|
|
1145
|
-
options: b.map((
|
|
1146
|
+
value: f.folderId ?? "",
|
|
1147
|
+
options: b.map((m) => ({ value: m.id, label: m.name })),
|
|
1146
1148
|
placeholder: l ?? "Select a folder",
|
|
1147
|
-
onChange: (
|
|
1149
|
+
onChange: (m) => r?.({ ...f, folderId: m })
|
|
1148
1150
|
}
|
|
1149
1151
|
),
|
|
1150
|
-
|
|
1152
|
+
x && /* @__PURE__ */ e(
|
|
1151
1153
|
he,
|
|
1152
1154
|
{
|
|
1153
1155
|
size: a,
|
|
1154
1156
|
disabled: s ?? !1,
|
|
1155
|
-
value:
|
|
1157
|
+
value: f.pathTemplate ?? "",
|
|
1156
1158
|
placeholder: c ?? "Sub-path e.g. {yyyy}/{mm}/{dd} (optional)",
|
|
1157
|
-
onChange: (
|
|
1159
|
+
onChange: (m) => r?.({ ...f, pathTemplate: m.target.value })
|
|
1158
1160
|
}
|
|
1159
1161
|
)
|
|
1160
1162
|
] });
|
|
@@ -1169,7 +1171,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1169
1171
|
md: "h-5 w-5",
|
|
1170
1172
|
lg: "h-6 w-6",
|
|
1171
1173
|
full: "h-6 w-6"
|
|
1172
|
-
},
|
|
1174
|
+
}, Ft = de(
|
|
1173
1175
|
({
|
|
1174
1176
|
label: t,
|
|
1175
1177
|
helperText: r,
|
|
@@ -1178,41 +1180,41 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1178
1180
|
fullWidth: a = !1,
|
|
1179
1181
|
startIcon: l = /* @__PURE__ */ e(jt, {}),
|
|
1180
1182
|
loading: c = !1,
|
|
1181
|
-
containerClassName:
|
|
1183
|
+
containerClassName: x,
|
|
1182
1184
|
labelClassName: b,
|
|
1183
1185
|
className: y,
|
|
1184
|
-
id:
|
|
1185
|
-
options:
|
|
1186
|
-
onRemoteSearch:
|
|
1186
|
+
id: f,
|
|
1187
|
+
options: m,
|
|
1188
|
+
onRemoteSearch: h,
|
|
1187
1189
|
onSelect: p,
|
|
1188
1190
|
debounceTime: k = 500,
|
|
1189
1191
|
showAllOnOpen: v = !1,
|
|
1190
1192
|
value: g,
|
|
1191
|
-
onChange:
|
|
1192
|
-
|
|
1193
|
+
onChange: L,
|
|
1194
|
+
...$
|
|
1193
1195
|
}, _) => {
|
|
1194
|
-
const M =
|
|
1196
|
+
const M = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, U = !!n, V = ae(null), j = ae(null), [W, H] = R(g || ""), [X, Z] = R(!1), [ee, C] = R(!1), [d, E] = R(!1);
|
|
1195
1197
|
Y(() => {
|
|
1196
1198
|
g !== void 0 && H(g);
|
|
1197
1199
|
}, [g]);
|
|
1198
1200
|
const N = me(() => {
|
|
1199
|
-
if (v && !d || !W) return
|
|
1201
|
+
if (v && !d || !W) return m;
|
|
1200
1202
|
const S = String(W).toLowerCase();
|
|
1201
|
-
return
|
|
1202
|
-
(
|
|
1203
|
+
return m.filter(
|
|
1204
|
+
(T) => String(T.label).toLowerCase().includes(S)
|
|
1203
1205
|
);
|
|
1204
|
-
}, [W,
|
|
1206
|
+
}, [W, m, v, d]);
|
|
1205
1207
|
Y(() => {
|
|
1206
|
-
if (!
|
|
1208
|
+
if (!h || !W) {
|
|
1207
1209
|
C(!1);
|
|
1208
1210
|
return;
|
|
1209
1211
|
}
|
|
1210
1212
|
const S = setTimeout(async () => {
|
|
1211
1213
|
C(!0);
|
|
1212
1214
|
try {
|
|
1213
|
-
await
|
|
1214
|
-
} catch (
|
|
1215
|
-
console.error("Remote search failed:",
|
|
1215
|
+
await h(String(W));
|
|
1216
|
+
} catch (T) {
|
|
1217
|
+
console.error("Remote search failed:", T);
|
|
1216
1218
|
} finally {
|
|
1217
1219
|
C(!1);
|
|
1218
1220
|
}
|
|
@@ -1220,19 +1222,19 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1220
1222
|
return () => {
|
|
1221
1223
|
clearTimeout(S), C(!1);
|
|
1222
1224
|
};
|
|
1223
|
-
}, [W, k,
|
|
1224
|
-
const S = (
|
|
1225
|
-
V.current && !V.current.contains(
|
|
1225
|
+
}, [W, k, h]), Y(() => {
|
|
1226
|
+
const S = (T) => {
|
|
1227
|
+
V.current && !V.current.contains(T.target) && Z(!1);
|
|
1226
1228
|
};
|
|
1227
1229
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
1228
1230
|
}, []);
|
|
1229
|
-
const
|
|
1230
|
-
const
|
|
1231
|
-
H(
|
|
1231
|
+
const A = (S) => {
|
|
1232
|
+
const T = S.target.value;
|
|
1233
|
+
H(T), Z(!0), E(!0), L && L(S);
|
|
1232
1234
|
}, w = (S) => {
|
|
1233
1235
|
H(S.label), Z(!1), E(!1), p && p(S.value);
|
|
1234
1236
|
}, Q = () => {
|
|
1235
|
-
(
|
|
1237
|
+
(m.length > 0 || h) && (Z(!0), E(!1));
|
|
1236
1238
|
}, te = c || ee, ne = X && (N.length > 0 || te), G = me(() => _ || j, [_]);
|
|
1237
1239
|
return /* @__PURE__ */ i(
|
|
1238
1240
|
"div",
|
|
@@ -1240,7 +1242,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1240
1242
|
className: ue(
|
|
1241
1243
|
"flex flex-col",
|
|
1242
1244
|
a ? "w-full" : "",
|
|
1243
|
-
|
|
1245
|
+
x || "",
|
|
1244
1246
|
"relative"
|
|
1245
1247
|
),
|
|
1246
1248
|
ref: V,
|
|
@@ -1251,7 +1253,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1251
1253
|
htmlFor: M,
|
|
1252
1254
|
className: ue(
|
|
1253
1255
|
"block text-sm font-medium mb-1",
|
|
1254
|
-
|
|
1256
|
+
U ? "text-danger-fg" : "text-text",
|
|
1255
1257
|
b || ""
|
|
1256
1258
|
),
|
|
1257
1259
|
children: t
|
|
@@ -1265,7 +1267,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1265
1267
|
ref: G,
|
|
1266
1268
|
id: M,
|
|
1267
1269
|
value: W,
|
|
1268
|
-
onChange:
|
|
1270
|
+
onChange: A,
|
|
1269
1271
|
onFocus: Q,
|
|
1270
1272
|
className: ue(
|
|
1271
1273
|
// Base styles
|
|
@@ -1279,10 +1281,10 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1279
1281
|
"pr-10",
|
|
1280
1282
|
// Altijd padding rechts voor de dropdown/loading icon
|
|
1281
1283
|
// State styles
|
|
1282
|
-
|
|
1284
|
+
U ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
1283
1285
|
y || ""
|
|
1284
1286
|
),
|
|
1285
|
-
|
|
1287
|
+
...$
|
|
1286
1288
|
}
|
|
1287
1289
|
),
|
|
1288
1290
|
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: te || c ? (
|
|
@@ -1334,12 +1336,12 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1334
1336
|
{
|
|
1335
1337
|
className: ue(
|
|
1336
1338
|
"mt-1 text-xs",
|
|
1337
|
-
|
|
1339
|
+
U ? "text-danger-fg" : "text-text-muted"
|
|
1338
1340
|
),
|
|
1339
1341
|
children: n || r
|
|
1340
1342
|
}
|
|
1341
1343
|
),
|
|
1342
|
-
|
|
1344
|
+
h && /* @__PURE__ */ i("p", { className: "mt-2 text-xs text-success-fg", children: [
|
|
1343
1345
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
1344
1346
|
String(W)
|
|
1345
1347
|
] })
|
|
@@ -1348,14 +1350,14 @@ const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1348
1350
|
);
|
|
1349
1351
|
}
|
|
1350
1352
|
);
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1353
|
+
Ft.displayName = "SearchableTextField";
|
|
1354
|
+
const Bt = de(
|
|
1353
1355
|
({ checked: t, onChange: r, label: n, disabled: s = !1, className: a, ...l }, c) => {
|
|
1354
|
-
const
|
|
1356
|
+
const x = /* @__PURE__ */ e(
|
|
1355
1357
|
"span",
|
|
1356
1358
|
{
|
|
1357
1359
|
"aria-hidden": !0,
|
|
1358
|
-
className:
|
|
1360
|
+
className: u(
|
|
1359
1361
|
"relative inline-flex size-switch-track shrink-0 items-center rounded-full",
|
|
1360
1362
|
"transition-colors duration-fast ease-out",
|
|
1361
1363
|
t ? "bg-accent" : "bg-surface-hover",
|
|
@@ -1364,7 +1366,7 @@ const Ft = de(
|
|
|
1364
1366
|
children: /* @__PURE__ */ e(
|
|
1365
1367
|
"span",
|
|
1366
1368
|
{
|
|
1367
|
-
className:
|
|
1369
|
+
className: u(
|
|
1368
1370
|
"absolute left-0.5 size-switch-knob rounded-full bg-surface shadow-overlay",
|
|
1369
1371
|
"transition-transform duration-fast ease-out",
|
|
1370
1372
|
t && "translate-switch"
|
|
@@ -1376,7 +1378,7 @@ const Ft = de(
|
|
|
1376
1378
|
return /* @__PURE__ */ i(
|
|
1377
1379
|
"label",
|
|
1378
1380
|
{
|
|
1379
|
-
className:
|
|
1381
|
+
className: u(
|
|
1380
1382
|
"inline-flex items-center gap-2",
|
|
1381
1383
|
s ? "cursor-not-allowed" : "cursor-pointer",
|
|
1382
1384
|
a
|
|
@@ -1395,14 +1397,14 @@ const Ft = de(
|
|
|
1395
1397
|
...l
|
|
1396
1398
|
}
|
|
1397
1399
|
),
|
|
1398
|
-
/* @__PURE__ */ e("span", { className: "inline-flex rounded-full peer-focus-visible:focus-ring", children:
|
|
1400
|
+
/* @__PURE__ */ e("span", { className: "inline-flex rounded-full peer-focus-visible:focus-ring", children: x }),
|
|
1399
1401
|
n && /* @__PURE__ */ e("span", { className: "text-sm text-text", children: n })
|
|
1400
1402
|
]
|
|
1401
1403
|
}
|
|
1402
1404
|
);
|
|
1403
1405
|
}
|
|
1404
1406
|
);
|
|
1405
|
-
|
|
1407
|
+
Bt.displayName = "Switch";
|
|
1406
1408
|
function Rt({
|
|
1407
1409
|
variant: t = "page",
|
|
1408
1410
|
children: r,
|
|
@@ -1425,16 +1427,16 @@ function Rt({
|
|
|
1425
1427
|
{
|
|
1426
1428
|
className: "grid gap-2 bg-surface-hover p-3",
|
|
1427
1429
|
style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
|
|
1428
|
-
children: Array.from({ length: s }).map((c,
|
|
1430
|
+
children: Array.from({ length: s }).map((c, x) => /* @__PURE__ */ e(
|
|
1429
1431
|
"div",
|
|
1430
1432
|
{
|
|
1431
1433
|
className: "h-4 w-2/3 rounded-sm bg-border-strong"
|
|
1432
1434
|
},
|
|
1433
|
-
`header-${
|
|
1435
|
+
`header-${x}`
|
|
1434
1436
|
))
|
|
1435
1437
|
}
|
|
1436
1438
|
),
|
|
1437
|
-
Array.from({ length: a }).map((c,
|
|
1439
|
+
Array.from({ length: a }).map((c, x) => /* @__PURE__ */ e(
|
|
1438
1440
|
"div",
|
|
1439
1441
|
{
|
|
1440
1442
|
className: "grid gap-2 border-t border-border-subtle p-3",
|
|
@@ -1444,10 +1446,10 @@ function Rt({
|
|
|
1444
1446
|
{
|
|
1445
1447
|
className: "h-4 w-full rounded-sm bg-surface-hover"
|
|
1446
1448
|
},
|
|
1447
|
-
`cell-${
|
|
1449
|
+
`cell-${x}-${y}`
|
|
1448
1450
|
))
|
|
1449
1451
|
},
|
|
1450
|
-
`row-${
|
|
1452
|
+
`row-${x}`
|
|
1451
1453
|
))
|
|
1452
1454
|
] })
|
|
1453
1455
|
] }) });
|
|
@@ -1460,41 +1462,41 @@ const Vt = ({
|
|
|
1460
1462
|
placement: a = "bottom-start",
|
|
1461
1463
|
disabled: l = !1,
|
|
1462
1464
|
className: c,
|
|
1463
|
-
showCheck:
|
|
1465
|
+
showCheck: x = !0,
|
|
1464
1466
|
header: b
|
|
1465
1467
|
}) => {
|
|
1466
|
-
const [y,
|
|
1467
|
-
|
|
1468
|
+
const [y, f] = R(!1), [m, h] = R(null), [p, k] = R({ top: 0, left: 0 }), v = ae(null), g = ae(null), L = ae(null), $ = ae(null), _ = we(y, g, { placement: a }), M = ae(null), U = () => Array.from(
|
|
1469
|
+
$.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1468
1470
|
);
|
|
1469
1471
|
Y(() => {
|
|
1470
|
-
y &&
|
|
1472
|
+
y && U()[0]?.focus();
|
|
1471
1473
|
}, [y]);
|
|
1472
1474
|
const V = (d) => {
|
|
1473
1475
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(d.key)) return;
|
|
1474
|
-
const N =
|
|
1476
|
+
const N = U();
|
|
1475
1477
|
if (N.length === 0) return;
|
|
1476
1478
|
d.preventDefault();
|
|
1477
|
-
const
|
|
1479
|
+
const A = N.indexOf(document.activeElement), w = d.key === "Home" ? 0 : d.key === "End" ? N.length - 1 : d.key === "ArrowDown" ? (A + 1) % N.length : (A - 1 + N.length) % N.length;
|
|
1478
1480
|
N[w]?.focus();
|
|
1479
1481
|
};
|
|
1480
1482
|
Y(() => {
|
|
1481
1483
|
const d = (E) => {
|
|
1482
|
-
v.current && (!v.current.contains(E.target) ||
|
|
1484
|
+
v.current && (!v.current.contains(E.target) || L.current && !L.current.contains(E.target)) && (f(!1), h(null), M.current && (clearTimeout(M.current), M.current = null));
|
|
1483
1485
|
};
|
|
1484
1486
|
return y && document.addEventListener("mousedown", d), () => {
|
|
1485
1487
|
document.removeEventListener("mousedown", d);
|
|
1486
1488
|
};
|
|
1487
1489
|
}, [y]), Y(() => {
|
|
1488
1490
|
const d = (E) => {
|
|
1489
|
-
E.key === "Escape" && (
|
|
1491
|
+
E.key === "Escape" && (f(!1), h(null), g.current?.focus(), M.current && (clearTimeout(M.current), M.current = null));
|
|
1490
1492
|
};
|
|
1491
1493
|
return y && document.addEventListener("keydown", d), () => {
|
|
1492
1494
|
document.removeEventListener("keydown", d);
|
|
1493
1495
|
};
|
|
1494
1496
|
}, [y]), Y(() => {
|
|
1495
|
-
if (
|
|
1497
|
+
if (m && v.current) {
|
|
1496
1498
|
const d = v.current.querySelector(
|
|
1497
|
-
`[data-option-value="${
|
|
1499
|
+
`[data-option-value="${m}"]`
|
|
1498
1500
|
);
|
|
1499
1501
|
if (d) {
|
|
1500
1502
|
const E = d.getBoundingClientRect();
|
|
@@ -1504,25 +1506,25 @@ const Vt = ({
|
|
|
1504
1506
|
});
|
|
1505
1507
|
}
|
|
1506
1508
|
}
|
|
1507
|
-
}, [
|
|
1509
|
+
}, [m]), Y(() => () => {
|
|
1508
1510
|
M.current && clearTimeout(M.current);
|
|
1509
1511
|
}, []);
|
|
1510
1512
|
const j = (d) => {
|
|
1511
|
-
d.stopPropagation(), !l && (
|
|
1513
|
+
d.stopPropagation(), !l && (f(!y), h(null), M.current && (clearTimeout(M.current), M.current = null));
|
|
1512
1514
|
}, W = (d, E, N) => {
|
|
1513
|
-
d.stopPropagation(), !E.disabled && !E.divider && (!E.children || E.children.length === 0) && (s?.(E.value, N),
|
|
1515
|
+
d.stopPropagation(), !E.disabled && !E.divider && (!E.children || E.children.length === 0) && (s?.(E.value, N), f(!1), h(null));
|
|
1514
1516
|
}, H = (d) => {
|
|
1515
|
-
M.current && (clearTimeout(M.current), M.current = null), d.children && d.children.length > 0 ?
|
|
1517
|
+
M.current && (clearTimeout(M.current), M.current = null), d.children && d.children.length > 0 ? h(d.value) : h(null);
|
|
1516
1518
|
}, X = (d) => {
|
|
1517
1519
|
d.children && d.children.length > 0 ? M.current = setTimeout(() => {
|
|
1518
|
-
|
|
1519
|
-
}, 150) :
|
|
1520
|
+
h(null);
|
|
1521
|
+
}, 150) : h(null);
|
|
1520
1522
|
}, Z = (d, E, N) => {
|
|
1521
|
-
d.stopPropagation(), !E.disabled && !E.divider && (s?.(E.value, N),
|
|
1522
|
-
}, ee =
|
|
1523
|
+
d.stopPropagation(), !E.disabled && !E.divider && (s?.(E.value, N), f(!1), h(null));
|
|
1524
|
+
}, ee = u(
|
|
1523
1525
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1524
1526
|
"max-h-60 overflow-auto"
|
|
1525
|
-
), C =
|
|
1527
|
+
), C = u(
|
|
1526
1528
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1527
1529
|
"max-h-60 overflow-auto"
|
|
1528
1530
|
);
|
|
@@ -1530,7 +1532,7 @@ const Vt = ({
|
|
|
1530
1532
|
"div",
|
|
1531
1533
|
{
|
|
1532
1534
|
ref: v,
|
|
1533
|
-
className:
|
|
1535
|
+
className: u(
|
|
1534
1536
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-surface-hover",
|
|
1535
1537
|
c
|
|
1536
1538
|
),
|
|
@@ -1543,13 +1545,13 @@ const Vt = ({
|
|
|
1543
1545
|
disabled: l,
|
|
1544
1546
|
"aria-haspopup": "menu",
|
|
1545
1547
|
"aria-expanded": y,
|
|
1546
|
-
className:
|
|
1548
|
+
className: u("inline-flex items-center justify-center", {
|
|
1547
1549
|
"opacity-50 cursor-not-allowed": l
|
|
1548
1550
|
}),
|
|
1549
1551
|
children: t
|
|
1550
1552
|
}
|
|
1551
1553
|
),
|
|
1552
|
-
y && /* @__PURE__ */ e("div", { ref:
|
|
1554
|
+
y && /* @__PURE__ */ e("div", { ref: $, className: ee, style: _, onKeyDown: V, children: /* @__PURE__ */ i("div", { className: "p-2", role: "menu", children: [
|
|
1553
1555
|
b && (typeof b == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: b }) : b),
|
|
1554
1556
|
r.map((d, E) => {
|
|
1555
1557
|
if (d.divider)
|
|
@@ -1560,7 +1562,7 @@ const Vt = ({
|
|
|
1560
1562
|
},
|
|
1561
1563
|
`divider-${E}`
|
|
1562
1564
|
);
|
|
1563
|
-
const N = d.children && d.children.length > 0,
|
|
1565
|
+
const N = d.children && d.children.length > 0, A = m === d.value;
|
|
1564
1566
|
return /* @__PURE__ */ i("div", { className: "relative group", children: [
|
|
1565
1567
|
/* @__PURE__ */ i(
|
|
1566
1568
|
"button",
|
|
@@ -1572,11 +1574,11 @@ const Vt = ({
|
|
|
1572
1574
|
onMouseEnter: () => H(d),
|
|
1573
1575
|
onMouseLeave: () => X(d),
|
|
1574
1576
|
disabled: d.disabled,
|
|
1575
|
-
className:
|
|
1577
|
+
className: u(
|
|
1576
1578
|
"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover focus-visible:outline-none focus-visible:focus-ring",
|
|
1577
1579
|
{
|
|
1578
1580
|
"opacity-50 cursor-not-allowed": d.disabled,
|
|
1579
|
-
"bg-surface-hover":
|
|
1581
|
+
"bg-surface-hover": A && N
|
|
1580
1582
|
}
|
|
1581
1583
|
),
|
|
1582
1584
|
children: [
|
|
@@ -1588,27 +1590,27 @@ const Vt = ({
|
|
|
1588
1590
|
] })
|
|
1589
1591
|
] }),
|
|
1590
1592
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1591
|
-
|
|
1593
|
+
x && n === d.value && /* @__PURE__ */ e(Me, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
|
|
1592
1594
|
N && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
|
|
1593
1595
|
] })
|
|
1594
1596
|
]
|
|
1595
1597
|
}
|
|
1596
1598
|
),
|
|
1597
|
-
N &&
|
|
1599
|
+
N && A && /* @__PURE__ */ e(
|
|
1598
1600
|
"div",
|
|
1599
1601
|
{
|
|
1600
|
-
ref:
|
|
1602
|
+
ref: L,
|
|
1601
1603
|
className: C,
|
|
1602
1604
|
style: {
|
|
1603
1605
|
top: `${p.top}px`,
|
|
1604
1606
|
left: `${p.left}px`
|
|
1605
1607
|
},
|
|
1606
1608
|
onMouseEnter: () => {
|
|
1607
|
-
M.current && (clearTimeout(M.current), M.current = null),
|
|
1609
|
+
M.current && (clearTimeout(M.current), M.current = null), h(d.value);
|
|
1608
1610
|
},
|
|
1609
1611
|
onMouseLeave: () => {
|
|
1610
1612
|
M.current = setTimeout(() => {
|
|
1611
|
-
|
|
1613
|
+
h(null);
|
|
1612
1614
|
}, 150);
|
|
1613
1615
|
},
|
|
1614
1616
|
children: /* @__PURE__ */ e("div", { className: "p-2", children: d.children.map((w, Q) => {
|
|
@@ -1632,7 +1634,7 @@ const Vt = ({
|
|
|
1632
1634
|
d.value
|
|
1633
1635
|
),
|
|
1634
1636
|
disabled: w.disabled,
|
|
1635
|
-
className:
|
|
1637
|
+
className: u(
|
|
1636
1638
|
"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover",
|
|
1637
1639
|
{
|
|
1638
1640
|
"opacity-50 cursor-not-allowed": w.disabled
|
|
@@ -1646,7 +1648,7 @@ const Vt = ({
|
|
|
1646
1648
|
w.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: w.description })
|
|
1647
1649
|
] })
|
|
1648
1650
|
] }),
|
|
1649
|
-
|
|
1651
|
+
x && te && /* @__PURE__ */ e(Me, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 })
|
|
1650
1652
|
]
|
|
1651
1653
|
},
|
|
1652
1654
|
w.value
|
|
@@ -1659,8 +1661,8 @@ const Vt = ({
|
|
|
1659
1661
|
(() => {
|
|
1660
1662
|
const d = r.reduce((E, N) => {
|
|
1661
1663
|
if (N.divider) return E;
|
|
1662
|
-
const
|
|
1663
|
-
return E + 1 +
|
|
1664
|
+
const A = N.children ? N.children.filter((w) => !w.divider).length : 0;
|
|
1665
|
+
return E + 1 + A;
|
|
1664
1666
|
}, 0);
|
|
1665
1667
|
return d > 1 && /* @__PURE__ */ e("div", { className: "border-t border-border mt-2 pt-2", children: /* @__PURE__ */ i("div", { className: "text-xs text-text-muted px-3 py-1", children: [
|
|
1666
1668
|
d,
|
|
@@ -1671,7 +1673,7 @@ const Vt = ({
|
|
|
1671
1673
|
]
|
|
1672
1674
|
}
|
|
1673
1675
|
);
|
|
1674
|
-
}, Ht = () => /* @__PURE__ */ e(J, { icon: Ne, size: "md", color: "current" }),
|
|
1676
|
+
}, Ht = () => /* @__PURE__ */ e(J, { icon: Ne, size: "md", color: "current" }), Ut = ({ active: t }) => /* @__PURE__ */ e(J, { icon: Qe, size: "sm", className: t ? "text-text" : "text-text-subtle" }), qt = ({ active: t }) => /* @__PURE__ */ e(J, { icon: be, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Wt = () => /* @__PURE__ */ e(J, { icon: je, size: "md", color: "current" }), Kt = () => /* @__PURE__ */ e(J, { icon: ye, size: "md", color: "current" }), _t = () => /* @__PURE__ */ e(J, { icon: et, size: "md", color: "current" }), Gt = () => /* @__PURE__ */ e(J, { icon: tt, size: "md", color: "current" }), Fe = () => /* @__PURE__ */ e(J, { icon: be, size: "md", color: "current" }), Jt = (t) => {
|
|
1675
1677
|
const r = (s) => t.multiSelect && Array.isArray(t.value) ? t.value?.includes(s) : t.value === s, n = (s) => {
|
|
1676
1678
|
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((a) => a !== s)) : t.onChange(s);
|
|
1677
1679
|
};
|
|
@@ -1690,7 +1692,7 @@ const Vt = ({
|
|
|
1690
1692
|
/* @__PURE__ */ e("span", { className: "text-text", children: t.multiSelect && Array.isArray(t.value) ? t.value?.map(
|
|
1691
1693
|
(s) => t.options?.find((a) => a.value === s)?.label
|
|
1692
1694
|
).join(", ") : t.options?.find((s) => s.value === t.value)?.label }),
|
|
1693
|
-
/* @__PURE__ */ e("span", { className: "text-text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(
|
|
1695
|
+
/* @__PURE__ */ e("span", { className: "text-text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(Fe, {}) })
|
|
1694
1696
|
] }),
|
|
1695
1697
|
/* @__PURE__ */ i("div", { className: "absolute z-10 left-0 mt-1 bg-surface border border-border rounded-lg shadow-overlay p-2 w-48", children: [
|
|
1696
1698
|
t.options?.map((s) => /* @__PURE__ */ e(
|
|
@@ -1701,7 +1703,7 @@ const Vt = ({
|
|
|
1701
1703
|
children: /* @__PURE__ */ e(
|
|
1702
1704
|
"span",
|
|
1703
1705
|
{
|
|
1704
|
-
className:
|
|
1706
|
+
className: u(r(s.value) && "text-accent"),
|
|
1705
1707
|
children: s.label
|
|
1706
1708
|
}
|
|
1707
1709
|
)
|
|
@@ -1726,22 +1728,22 @@ const Vt = ({
|
|
|
1726
1728
|
searchPlaceholder: a = "Search...",
|
|
1727
1729
|
filters: l = [],
|
|
1728
1730
|
paginated: c = !1,
|
|
1729
|
-
pageSizeOptions:
|
|
1731
|
+
pageSizeOptions: x = [10, 25, 50, 100],
|
|
1730
1732
|
defaultPageSize: b = 10,
|
|
1731
1733
|
actions: y = [],
|
|
1732
|
-
onRowClick:
|
|
1733
|
-
selectable:
|
|
1734
|
-
selectedRows:
|
|
1734
|
+
onRowClick: f,
|
|
1735
|
+
selectable: m = !1,
|
|
1736
|
+
selectedRows: h = [],
|
|
1735
1737
|
onSelectionChange: p,
|
|
1736
|
-
getRowKey: k = (
|
|
1738
|
+
getRowKey: k = (U, V) => V,
|
|
1737
1739
|
emptyContent: v,
|
|
1738
1740
|
hoverable: g = !0,
|
|
1739
|
-
bordered:
|
|
1740
|
-
striped:
|
|
1741
|
+
bordered: L = !1,
|
|
1742
|
+
striped: $ = !1,
|
|
1741
1743
|
className: _,
|
|
1742
1744
|
rowClassName: M
|
|
1743
1745
|
}) => {
|
|
1744
|
-
const [
|
|
1746
|
+
const [U, V] = R(""), [j, W] = R({
|
|
1745
1747
|
column: null,
|
|
1746
1748
|
direction: null
|
|
1747
1749
|
}), [H, X] = R({
|
|
@@ -1749,30 +1751,30 @@ const Vt = ({
|
|
|
1749
1751
|
pageSize: b
|
|
1750
1752
|
}), Z = ae(null), ee = me(() => {
|
|
1751
1753
|
let o = t;
|
|
1752
|
-
if (s &&
|
|
1754
|
+
if (s && U.trim()) {
|
|
1753
1755
|
const z = r.filter(
|
|
1754
|
-
(
|
|
1755
|
-
),
|
|
1756
|
-
o = o.filter((
|
|
1757
|
-
const se = typeof O.accessor == "function" ? O.accessor(
|
|
1758
|
-
return String(se || "").toLowerCase().includes(
|
|
1756
|
+
(B) => B.searchable !== !1
|
|
1757
|
+
), F = U.toLowerCase();
|
|
1758
|
+
o = o.filter((B) => z.some((O) => {
|
|
1759
|
+
const se = typeof O.accessor == "function" ? O.accessor(B) : B[O.accessor];
|
|
1760
|
+
return String(se || "").toLowerCase().includes(F);
|
|
1759
1761
|
}));
|
|
1760
1762
|
}
|
|
1761
1763
|
return l.forEach((z) => {
|
|
1762
|
-
z.value && z.value !== "all" && (o = o.filter((
|
|
1763
|
-
const
|
|
1764
|
-
if (!
|
|
1765
|
-
const O = typeof
|
|
1764
|
+
z.value && z.value !== "all" && (o = o.filter((F) => {
|
|
1765
|
+
const B = r.find((se) => se.id === z.id);
|
|
1766
|
+
if (!B) return !0;
|
|
1767
|
+
const O = typeof B.accessor == "function" ? B.accessor(F) : F[B.accessor];
|
|
1766
1768
|
return String(O || "") === z.value;
|
|
1767
1769
|
}));
|
|
1768
1770
|
}), o;
|
|
1769
|
-
}, [t,
|
|
1771
|
+
}, [t, U, r, s, l]), C = me(() => {
|
|
1770
1772
|
if (!j.column || !j.direction) return ee;
|
|
1771
1773
|
const o = r.find((z) => z.id === j.column);
|
|
1772
|
-
return o ? [...ee].sort((z,
|
|
1773
|
-
const
|
|
1774
|
+
return o ? [...ee].sort((z, F) => {
|
|
1775
|
+
const B = typeof o.accessor == "function" ? o.accessor(z) : z[o.accessor], O = typeof o.accessor == "function" ? o.accessor(F) : F[o.accessor];
|
|
1774
1776
|
let se = 0;
|
|
1775
|
-
return
|
|
1777
|
+
return B < O ? se = -1 : B > O && (se = 1), j.direction === "desc" ? -se : se;
|
|
1776
1778
|
}) : ee;
|
|
1777
1779
|
}, [ee, j, r]), d = me(() => {
|
|
1778
1780
|
if (!c) return C;
|
|
@@ -1780,22 +1782,22 @@ const Vt = ({
|
|
|
1780
1782
|
return C.slice(o, z);
|
|
1781
1783
|
}, [C, H, c]), E = ce(
|
|
1782
1784
|
(o) => {
|
|
1783
|
-
r.find((
|
|
1785
|
+
r.find((F) => F.id === o)?.sortable && W((F) => F.column !== o ? { column: o, direction: "asc" } : F.direction === "asc" ? { column: o, direction: "desc" } : { column: null, direction: null });
|
|
1784
1786
|
},
|
|
1785
1787
|
[r]
|
|
1786
1788
|
), N = ce((o) => {
|
|
1787
1789
|
X((z) => ({ ...z, page: o }));
|
|
1788
|
-
}, []),
|
|
1790
|
+
}, []), A = ce((o) => {
|
|
1789
1791
|
X({ page: 0, pageSize: o });
|
|
1790
1792
|
}, []), w = ce(
|
|
1791
1793
|
(o, z) => {
|
|
1792
1794
|
if (!p) return;
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1795
|
-
(
|
|
1795
|
+
const F = k(o, 0);
|
|
1796
|
+
h.map((B, O) => k(B, O)), p(z ? [...h, o] : h.filter(
|
|
1797
|
+
(B, O) => k(h[O], O) !== F
|
|
1796
1798
|
));
|
|
1797
1799
|
},
|
|
1798
|
-
[
|
|
1800
|
+
[h, p, k]
|
|
1799
1801
|
), Q = ce(
|
|
1800
1802
|
(o) => {
|
|
1801
1803
|
p && p(o ? [...d] : []);
|
|
@@ -1804,27 +1806,27 @@ const Vt = ({
|
|
|
1804
1806
|
);
|
|
1805
1807
|
Y(() => {
|
|
1806
1808
|
X((o) => ({ ...o, page: 0 }));
|
|
1807
|
-
}, [
|
|
1809
|
+
}, [U, j]), Y(() => {
|
|
1808
1810
|
X((o) => ({ ...o, page: 0 }));
|
|
1809
1811
|
}, [l.map((o) => o.value).join(",")]);
|
|
1810
|
-
const te = C.length, ne = Math.ceil(te / H.pageSize), G = H.page * H.pageSize + 1, S = Math.min(G + H.pageSize - 1, te),
|
|
1812
|
+
const te = C.length, ne = Math.ceil(te / H.pageSize), G = H.page * H.pageSize + 1, S = Math.min(G + H.pageSize - 1, te), T = d.length > 0 && d.every((o) => {
|
|
1811
1813
|
const z = k(o, 0);
|
|
1812
|
-
return
|
|
1813
|
-
(
|
|
1814
|
+
return h.some(
|
|
1815
|
+
(F, B) => k(F, B) === z
|
|
1814
1816
|
);
|
|
1815
1817
|
}), I = d.some((o) => {
|
|
1816
1818
|
const z = k(o, 0);
|
|
1817
|
-
return
|
|
1818
|
-
(
|
|
1819
|
+
return h.some(
|
|
1820
|
+
(F, B) => k(F, B) === z
|
|
1819
1821
|
);
|
|
1820
|
-
}),
|
|
1822
|
+
}), D = u(
|
|
1821
1823
|
"w-full text-sm leading-5 text-text border-collapse",
|
|
1822
1824
|
_
|
|
1823
|
-
),
|
|
1825
|
+
), q = u("bg-surface"), P = u(
|
|
1824
1826
|
"text-text p-3 border-b border-border"
|
|
1825
|
-
), K =
|
|
1827
|
+
), K = u("h-row-lg", {
|
|
1826
1828
|
"hover:bg-surface-sunk": g,
|
|
1827
|
-
"cursor-pointer":
|
|
1829
|
+
"cursor-pointer": f
|
|
1828
1830
|
});
|
|
1829
1831
|
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
1830
1832
|
(s || l.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */ i("div", { className: "flex flex-wrap gap-4 items-start", children: [
|
|
@@ -1833,7 +1835,7 @@ const Vt = ({
|
|
|
1833
1835
|
he,
|
|
1834
1836
|
{
|
|
1835
1837
|
placeholder: a,
|
|
1836
|
-
value:
|
|
1838
|
+
value: U,
|
|
1837
1839
|
onChange: (o) => V(o.target.value),
|
|
1838
1840
|
startIcon: /* @__PURE__ */ e(Ht, {}),
|
|
1839
1841
|
className: "max-w-sm"
|
|
@@ -1849,15 +1851,15 @@ const Vt = ({
|
|
|
1849
1851
|
tableColumns: r.length
|
|
1850
1852
|
}
|
|
1851
1853
|
) }),
|
|
1852
|
-
/* @__PURE__ */ i("table", { ref: Z, className:
|
|
1853
|
-
/* @__PURE__ */ e("thead", { className:
|
|
1854
|
-
|
|
1854
|
+
/* @__PURE__ */ i("table", { ref: Z, className: u(D, "min-w-full"), children: [
|
|
1855
|
+
/* @__PURE__ */ e("thead", { className: q, children: /* @__PURE__ */ i("tr", { children: [
|
|
1856
|
+
m && /* @__PURE__ */ e("th", { className: u(P, "w-12"), children: /* @__PURE__ */ e(
|
|
1855
1857
|
"input",
|
|
1856
1858
|
{
|
|
1857
1859
|
type: "checkbox",
|
|
1858
|
-
checked:
|
|
1860
|
+
checked: T,
|
|
1859
1861
|
ref: (o) => {
|
|
1860
|
-
o && (o.indeterminate = I && !
|
|
1862
|
+
o && (o.indeterminate = I && !T);
|
|
1861
1863
|
},
|
|
1862
1864
|
onChange: (o) => Q(o.target.checked),
|
|
1863
1865
|
className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
|
|
@@ -1866,7 +1868,7 @@ const Vt = ({
|
|
|
1866
1868
|
!n && r.map((o) => /* @__PURE__ */ e(
|
|
1867
1869
|
"th",
|
|
1868
1870
|
{
|
|
1869
|
-
className:
|
|
1871
|
+
className: u(
|
|
1870
1872
|
P,
|
|
1871
1873
|
"font-semibold text-xs text-text-muted uppercase tracking-label",
|
|
1872
1874
|
"group",
|
|
@@ -1886,19 +1888,19 @@ const Vt = ({
|
|
|
1886
1888
|
o.sortable && /* @__PURE__ */ i(
|
|
1887
1889
|
"div",
|
|
1888
1890
|
{
|
|
1889
|
-
className:
|
|
1891
|
+
className: u(
|
|
1890
1892
|
"flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1891
1893
|
j.column === o.id && "opacity-100"
|
|
1892
1894
|
),
|
|
1893
1895
|
children: [
|
|
1894
1896
|
/* @__PURE__ */ e(
|
|
1895
|
-
|
|
1897
|
+
Ut,
|
|
1896
1898
|
{
|
|
1897
1899
|
active: j.column === o.id && j.direction === "asc"
|
|
1898
1900
|
}
|
|
1899
1901
|
),
|
|
1900
1902
|
/* @__PURE__ */ e(
|
|
1901
|
-
|
|
1903
|
+
qt,
|
|
1902
1904
|
{
|
|
1903
1905
|
active: j.column === o.id && j.direction === "desc"
|
|
1904
1906
|
}
|
|
@@ -1910,39 +1912,39 @@ const Vt = ({
|
|
|
1910
1912
|
},
|
|
1911
1913
|
o.id
|
|
1912
1914
|
)),
|
|
1913
|
-
y.length > 0 && /* @__PURE__ */ e("th", { className:
|
|
1915
|
+
y.length > 0 && /* @__PURE__ */ e("th", { className: u(P, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
1914
1916
|
] }) }),
|
|
1915
1917
|
/* @__PURE__ */ e("tbody", { children: d.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1916
1918
|
"td",
|
|
1917
1919
|
{
|
|
1918
|
-
colSpan: r.length + (
|
|
1919
|
-
className:
|
|
1920
|
+
colSpan: r.length + (m ? 1 : 0) + (y.length > 0 ? 1 : 0),
|
|
1921
|
+
className: u(
|
|
1920
1922
|
P,
|
|
1921
1923
|
"text-center py-8 text-text-muted"
|
|
1922
1924
|
),
|
|
1923
1925
|
children: v || "No data available"
|
|
1924
1926
|
}
|
|
1925
1927
|
) }) : d.map((o, z) => {
|
|
1926
|
-
const
|
|
1927
|
-
(O, se) => k(O, se) ===
|
|
1928
|
+
const F = k(o, z), B = h.some(
|
|
1929
|
+
(O, se) => k(O, se) === F
|
|
1928
1930
|
);
|
|
1929
1931
|
return /* @__PURE__ */ i(
|
|
1930
1932
|
"tr",
|
|
1931
1933
|
{
|
|
1932
|
-
className:
|
|
1934
|
+
className: u(
|
|
1933
1935
|
K,
|
|
1934
|
-
{ "bg-accent-soft":
|
|
1936
|
+
{ "bg-accent-soft": B },
|
|
1935
1937
|
M?.(o, z)
|
|
1936
1938
|
),
|
|
1937
1939
|
onClick: (O) => {
|
|
1938
|
-
O.stopPropagation(),
|
|
1940
|
+
O.stopPropagation(), f?.(o, z);
|
|
1939
1941
|
},
|
|
1940
1942
|
children: [
|
|
1941
|
-
|
|
1943
|
+
m && /* @__PURE__ */ e("td", { className: P, children: /* @__PURE__ */ e(
|
|
1942
1944
|
"input",
|
|
1943
1945
|
{
|
|
1944
1946
|
type: "checkbox",
|
|
1945
|
-
checked:
|
|
1947
|
+
checked: B,
|
|
1946
1948
|
onChange: (O) => {
|
|
1947
1949
|
O.stopPropagation(), w(o, O.target.checked);
|
|
1948
1950
|
},
|
|
@@ -1954,7 +1956,7 @@ const Vt = ({
|
|
|
1954
1956
|
return /* @__PURE__ */ e(
|
|
1955
1957
|
"td",
|
|
1956
1958
|
{
|
|
1957
|
-
className:
|
|
1959
|
+
className: u(P, {
|
|
1958
1960
|
"text-left": O.align === "left" || !O.align,
|
|
1959
1961
|
"text-center": O.align === "center",
|
|
1960
1962
|
"text-right": O.align === "right",
|
|
@@ -1971,7 +1973,7 @@ const Vt = ({
|
|
|
1971
1973
|
{
|
|
1972
1974
|
trigger: /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-text-muted hover:text-text", children: [
|
|
1973
1975
|
/* @__PURE__ */ e("span", { children: "Options" }),
|
|
1974
|
-
/* @__PURE__ */ e(
|
|
1976
|
+
/* @__PURE__ */ e(Fe, {})
|
|
1975
1977
|
] }),
|
|
1976
1978
|
options: y.map((O) => ({
|
|
1977
1979
|
value: O.id,
|
|
@@ -1990,7 +1992,7 @@ const Vt = ({
|
|
|
1990
1992
|
) })
|
|
1991
1993
|
]
|
|
1992
1994
|
},
|
|
1993
|
-
|
|
1995
|
+
F
|
|
1994
1996
|
);
|
|
1995
1997
|
}) })
|
|
1996
1998
|
] })
|
|
@@ -2012,9 +2014,9 @@ const Vt = ({
|
|
|
2012
2014
|
"select",
|
|
2013
2015
|
{
|
|
2014
2016
|
value: H.pageSize,
|
|
2015
|
-
onChange: (o) =>
|
|
2017
|
+
onChange: (o) => A(Number(o.target.value)),
|
|
2016
2018
|
className: "h-control-sm w-16 rounded-md border border-border bg-surface-input px-2 text-sm text-text",
|
|
2017
|
-
children:
|
|
2019
|
+
children: x.map((o) => /* @__PURE__ */ e("option", { value: o, children: o }, o))
|
|
2018
2020
|
}
|
|
2019
2021
|
)
|
|
2020
2022
|
] })
|
|
@@ -2079,15 +2081,15 @@ const Vt = ({
|
|
|
2079
2081
|
onTabChange: n,
|
|
2080
2082
|
className: s
|
|
2081
2083
|
}) => {
|
|
2082
|
-
const [a, l] = R(t[0]?.id || ""), c = r || a,
|
|
2084
|
+
const [a, l] = R(t[0]?.id || ""), c = r || a, x = (b) => {
|
|
2083
2085
|
n ? n(b) : l(b);
|
|
2084
2086
|
};
|
|
2085
|
-
return /* @__PURE__ */ e("div", { className:
|
|
2087
|
+
return /* @__PURE__ */ e("div", { className: u("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((b) => /* @__PURE__ */ e(
|
|
2086
2088
|
"button",
|
|
2087
2089
|
{
|
|
2088
|
-
onClick: () => !b.disabled &&
|
|
2090
|
+
onClick: () => !b.disabled && x(b.id),
|
|
2089
2091
|
disabled: b.disabled,
|
|
2090
|
-
className:
|
|
2092
|
+
className: u(
|
|
2091
2093
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-fast",
|
|
2092
2094
|
{
|
|
2093
2095
|
"border-accent-border text-text": c === b.id,
|
|
@@ -2097,7 +2099,7 @@ const Vt = ({
|
|
|
2097
2099
|
),
|
|
2098
2100
|
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2099
2101
|
b.label,
|
|
2100
|
-
b.badge && /* @__PURE__ */ e("span", { className:
|
|
2102
|
+
b.badge && /* @__PURE__ */ e("span", { className: u(
|
|
2101
2103
|
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
|
2102
2104
|
c === b.id ? "bg-accent-soft text-accent" : "bg-surface-hover text-text-muted"
|
|
2103
2105
|
), children: b.badge })
|
|
@@ -2114,14 +2116,14 @@ const Vt = ({
|
|
|
2114
2116
|
size: l = "md",
|
|
2115
2117
|
className: c
|
|
2116
2118
|
}) => {
|
|
2117
|
-
const [
|
|
2119
|
+
const [x, b] = R(
|
|
2118
2120
|
r || n || t[0]?.id || ""
|
|
2119
|
-
), y = n ||
|
|
2121
|
+
), y = n || x, f = (v) => {
|
|
2120
2122
|
s ? s(v) : b(v);
|
|
2121
|
-
},
|
|
2123
|
+
}, m = {
|
|
2122
2124
|
activeTab: y,
|
|
2123
|
-
setActiveTab:
|
|
2124
|
-
},
|
|
2125
|
+
setActiveTab: f
|
|
2126
|
+
}, h = t.find((v) => v.id === y), p = u(
|
|
2125
2127
|
"flex",
|
|
2126
2128
|
{
|
|
2127
2129
|
"border-b border-border px-2": a === "default" || a === "underline",
|
|
@@ -2131,7 +2133,7 @@ const Vt = ({
|
|
|
2131
2133
|
},
|
|
2132
2134
|
c
|
|
2133
2135
|
), k = (v, g) => {
|
|
2134
|
-
const
|
|
2136
|
+
const L = "transition-colors duration-fast font-medium", $ = {
|
|
2135
2137
|
"text-xs px-2 py-1": l === "sm",
|
|
2136
2138
|
"text-sm px-3 py-2": l === "md",
|
|
2137
2139
|
"text-base px-4 py-3": l === "lg"
|
|
@@ -2145,7 +2147,7 @@ const Vt = ({
|
|
|
2145
2147
|
}, M = {
|
|
2146
2148
|
"opacity-50 cursor-not-allowed": v.disabled,
|
|
2147
2149
|
"cursor-pointer": !v.disabled
|
|
2148
|
-
},
|
|
2150
|
+
}, U = g ? {
|
|
2149
2151
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
2150
2152
|
"bg-surface text-text shadow-none": a === "pills"
|
|
2151
2153
|
} : {}, V = !g && !v.disabled ? {
|
|
@@ -2153,9 +2155,9 @@ const Vt = ({
|
|
|
2153
2155
|
"text-text-muted hover:text-text": a === "pills",
|
|
2154
2156
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
2155
2157
|
} : {};
|
|
2156
|
-
return
|
|
2158
|
+
return u(L, $, _, M, U, V);
|
|
2157
2159
|
};
|
|
2158
|
-
return /* @__PURE__ */ e(Yt.Provider, { value:
|
|
2160
|
+
return /* @__PURE__ */ e(Yt.Provider, { value: m, children: /* @__PURE__ */ i("div", { children: [
|
|
2159
2161
|
/* @__PURE__ */ e("div", { className: p, role: "tablist", children: t.map((v) => /* @__PURE__ */ e(
|
|
2160
2162
|
"button",
|
|
2161
2163
|
{
|
|
@@ -2164,7 +2166,7 @@ const Vt = ({
|
|
|
2164
2166
|
"aria-selected": y === v.id,
|
|
2165
2167
|
"aria-controls": `tabpanel-${v.id}`,
|
|
2166
2168
|
disabled: v.disabled,
|
|
2167
|
-
onClick: () => !v.disabled &&
|
|
2169
|
+
onClick: () => !v.disabled && f(v.id),
|
|
2168
2170
|
className: k(v, y === v.id),
|
|
2169
2171
|
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2170
2172
|
v.label,
|
|
@@ -2173,14 +2175,14 @@ const Vt = ({
|
|
|
2173
2175
|
},
|
|
2174
2176
|
v.id
|
|
2175
2177
|
)) }),
|
|
2176
|
-
|
|
2178
|
+
h?.content && /* @__PURE__ */ e(
|
|
2177
2179
|
"div",
|
|
2178
2180
|
{
|
|
2179
2181
|
role: "tabpanel",
|
|
2180
2182
|
id: `tabpanel-${y}`,
|
|
2181
2183
|
"aria-labelledby": `tab-${y}`,
|
|
2182
2184
|
className: "mt-4",
|
|
2183
|
-
children:
|
|
2185
|
+
children: h.content
|
|
2184
2186
|
}
|
|
2185
2187
|
)
|
|
2186
2188
|
] }) });
|
|
@@ -2191,7 +2193,7 @@ const Vt = ({
|
|
|
2191
2193
|
xl: "max-w-4xl",
|
|
2192
2194
|
full: "max-w-full mx-4"
|
|
2193
2195
|
};
|
|
2194
|
-
function
|
|
2196
|
+
function Be({
|
|
2195
2197
|
open: t,
|
|
2196
2198
|
onClose: r,
|
|
2197
2199
|
title: n,
|
|
@@ -2199,19 +2201,19 @@ function Fe({
|
|
|
2199
2201
|
closeOnBackdropClick: a = !0,
|
|
2200
2202
|
closeOnEscape: l = !0,
|
|
2201
2203
|
className: c,
|
|
2202
|
-
backdropClassName:
|
|
2204
|
+
backdropClassName: x,
|
|
2203
2205
|
children: b,
|
|
2204
2206
|
footer: y,
|
|
2205
|
-
showCloseButton:
|
|
2207
|
+
showCloseButton: f = !0
|
|
2206
2208
|
}) {
|
|
2207
|
-
const
|
|
2209
|
+
const m = ae(null), h = ae(null);
|
|
2208
2210
|
Y(() => {
|
|
2209
2211
|
if (!t || !l) return;
|
|
2210
2212
|
const k = (v) => {
|
|
2211
2213
|
v.key === "Escape" && r();
|
|
2212
2214
|
};
|
|
2213
2215
|
return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
|
|
2214
|
-
}, [t, l, r]), Y(() => (t ? (
|
|
2216
|
+
}, [t, l, r]), Y(() => (t ? (h.current = document.activeElement, m.current && m.current.focus(), document.body.style.overflow = "hidden") : (h.current && h.current.focus(), document.body.style.overflow = ""), () => {
|
|
2215
2217
|
document.body.style.overflow = "";
|
|
2216
2218
|
}), [t]);
|
|
2217
2219
|
const p = (k) => {
|
|
@@ -2220,18 +2222,18 @@ function Fe({
|
|
|
2220
2222
|
return t ? /* @__PURE__ */ e(
|
|
2221
2223
|
"div",
|
|
2222
2224
|
{
|
|
2223
|
-
className:
|
|
2225
|
+
className: u(
|
|
2224
2226
|
"fixed inset-0 z-modal flex items-center justify-center p-4",
|
|
2225
2227
|
"bg-scrim",
|
|
2226
2228
|
// 'animate-fade-in',
|
|
2227
|
-
|
|
2229
|
+
x
|
|
2228
2230
|
),
|
|
2229
2231
|
onClick: p,
|
|
2230
2232
|
children: /* @__PURE__ */ i(
|
|
2231
2233
|
"div",
|
|
2232
2234
|
{
|
|
2233
|
-
ref:
|
|
2234
|
-
className:
|
|
2235
|
+
ref: m,
|
|
2236
|
+
className: u(
|
|
2235
2237
|
"relative w-full bg-surface rounded-lg shadow-modal",
|
|
2236
2238
|
// 'animate-scale-in',
|
|
2237
2239
|
"focus:outline-none",
|
|
@@ -2243,7 +2245,7 @@ function Fe({
|
|
|
2243
2245
|
"aria-labelledby": n ? "modal-title" : void 0,
|
|
2244
2246
|
tabIndex: -1,
|
|
2245
2247
|
children: [
|
|
2246
|
-
(n ||
|
|
2248
|
+
(n || f) && /* @__PURE__ */ i("div", { className: "flex items-center justify-between p-6 pb-0", children: [
|
|
2247
2249
|
n && /* @__PURE__ */ e(
|
|
2248
2250
|
"span",
|
|
2249
2251
|
{
|
|
@@ -2252,7 +2254,7 @@ function Fe({
|
|
|
2252
2254
|
children: n
|
|
2253
2255
|
}
|
|
2254
2256
|
),
|
|
2255
|
-
|
|
2257
|
+
f && /* @__PURE__ */ e(
|
|
2256
2258
|
"button",
|
|
2257
2259
|
{
|
|
2258
2260
|
onClick: r,
|
|
@@ -2310,14 +2312,14 @@ const Qt = {
|
|
|
2310
2312
|
align: a = "left",
|
|
2311
2313
|
truncate: l = !1,
|
|
2312
2314
|
italic: c = !1,
|
|
2313
|
-
underline:
|
|
2315
|
+
underline: x = !1,
|
|
2314
2316
|
lineHeight: b = "normal",
|
|
2315
2317
|
as: y,
|
|
2316
|
-
className:
|
|
2317
|
-
children:
|
|
2318
|
-
...
|
|
2318
|
+
className: f,
|
|
2319
|
+
children: m,
|
|
2320
|
+
...h
|
|
2319
2321
|
}) => {
|
|
2320
|
-
const p = y || sr(t), k = t === "caption", v = t === "label", g = t === "code",
|
|
2322
|
+
const p = y || sr(t), k = t === "caption", v = t === "label", g = t === "code", L = u(
|
|
2321
2323
|
"font-sans",
|
|
2322
2324
|
// Variant — caption and label pin their own size/weight
|
|
2323
2325
|
k && "text-xs text-text-subtle",
|
|
@@ -2332,11 +2334,11 @@ const Qt = {
|
|
|
2332
2334
|
// Line height only overrides the body variant
|
|
2333
2335
|
t === "body" && nr[b],
|
|
2334
2336
|
c && "italic",
|
|
2335
|
-
|
|
2337
|
+
x && "underline",
|
|
2336
2338
|
l && "truncate",
|
|
2337
|
-
|
|
2339
|
+
f
|
|
2338
2340
|
);
|
|
2339
|
-
return /* @__PURE__ */ e(p, { className:
|
|
2341
|
+
return /* @__PURE__ */ e(p, { className: L, ...h, children: m });
|
|
2340
2342
|
};
|
|
2341
2343
|
function sr(t) {
|
|
2342
2344
|
return {
|
|
@@ -2354,21 +2356,21 @@ const ar = ({
|
|
|
2354
2356
|
error: a,
|
|
2355
2357
|
disabled: l,
|
|
2356
2358
|
accept: c,
|
|
2357
|
-
onListFiles:
|
|
2359
|
+
onListFiles: x,
|
|
2358
2360
|
onListMounts: b,
|
|
2359
2361
|
onUploadFile: y,
|
|
2360
|
-
onDownloadFile:
|
|
2361
|
-
onRegisterFile:
|
|
2362
|
+
onDownloadFile: f,
|
|
2363
|
+
onRegisterFile: m
|
|
2362
2364
|
}) => {
|
|
2363
|
-
const [
|
|
2365
|
+
const [h, p] = R(!1), [k, v] = R([]), [g, L] = R(null), [$, _] = R("/"), [M, U] = R([]), [V, j] = R(!1), [W, H] = R(""), [X, Z] = R(
|
|
2364
2366
|
typeof t == "object" ? t : null
|
|
2365
2367
|
), [ee, C] = R(!1), [d, E] = R(""), N = ae(null);
|
|
2366
2368
|
Y(() => {
|
|
2367
|
-
|
|
2368
|
-
}, [
|
|
2369
|
-
|
|
2370
|
-
}, [
|
|
2371
|
-
const
|
|
2369
|
+
h && A();
|
|
2370
|
+
}, [h]), Y(() => {
|
|
2371
|
+
h && g && w();
|
|
2372
|
+
}, [h, g, $, W]);
|
|
2373
|
+
const A = async () => {
|
|
2372
2374
|
j(!0);
|
|
2373
2375
|
try {
|
|
2374
2376
|
const o = await b?.();
|
|
@@ -2382,8 +2384,8 @@ const ar = ({
|
|
|
2382
2384
|
if (g) {
|
|
2383
2385
|
j(!0);
|
|
2384
2386
|
try {
|
|
2385
|
-
const o = await
|
|
2386
|
-
o?.data &&
|
|
2387
|
+
const o = await x?.({ mountId: g.id, name: W, path: $ });
|
|
2388
|
+
o?.data && U(o.data);
|
|
2387
2389
|
} catch (o) {
|
|
2388
2390
|
console.error("Failed to load files", o);
|
|
2389
2391
|
} finally {
|
|
@@ -2395,7 +2397,7 @@ const ar = ({
|
|
|
2395
2397
|
if (z) {
|
|
2396
2398
|
j(!0);
|
|
2397
2399
|
try {
|
|
2398
|
-
const
|
|
2400
|
+
const F = await z.arrayBuffer(), B = new Uint8Array(F), O = {
|
|
2399
2401
|
id: `local-${Date.now()}`,
|
|
2400
2402
|
name: z.name,
|
|
2401
2403
|
type: "file",
|
|
@@ -2406,9 +2408,9 @@ const ar = ({
|
|
|
2406
2408
|
providerKey: z.name,
|
|
2407
2409
|
ownerId: "me"
|
|
2408
2410
|
};
|
|
2409
|
-
Z(O), r(O,
|
|
2410
|
-
} catch (
|
|
2411
|
-
console.error("Local file selection failed",
|
|
2411
|
+
Z(O), r(O, B), p(!1);
|
|
2412
|
+
} catch (F) {
|
|
2413
|
+
console.error("Local file selection failed", F);
|
|
2412
2414
|
} finally {
|
|
2413
2415
|
j(!1);
|
|
2414
2416
|
}
|
|
@@ -2418,19 +2420,19 @@ const ar = ({
|
|
|
2418
2420
|
if (!(!z || !g)) {
|
|
2419
2421
|
j(!0);
|
|
2420
2422
|
try {
|
|
2421
|
-
const
|
|
2422
|
-
file: new Uint8Array(
|
|
2423
|
+
const F = await z.arrayBuffer(), B = await y?.({
|
|
2424
|
+
file: new Uint8Array(F),
|
|
2423
2425
|
filename: z.name,
|
|
2424
2426
|
mimeType: z.type || "application/octet-stream",
|
|
2425
2427
|
mountId: g.id,
|
|
2426
|
-
path:
|
|
2428
|
+
path: $
|
|
2427
2429
|
});
|
|
2428
|
-
if (
|
|
2429
|
-
const O =
|
|
2430
|
-
Z(O), r(O, new Uint8Array(
|
|
2430
|
+
if (B?.data) {
|
|
2431
|
+
const O = B.data;
|
|
2432
|
+
Z(O), r(O, new Uint8Array(F)), p(!1);
|
|
2431
2433
|
}
|
|
2432
|
-
} catch (
|
|
2433
|
-
console.error("Upload failed",
|
|
2434
|
+
} catch (F) {
|
|
2435
|
+
console.error("Upload failed", F);
|
|
2434
2436
|
} finally {
|
|
2435
2437
|
j(!1);
|
|
2436
2438
|
}
|
|
@@ -2439,11 +2441,11 @@ const ar = ({
|
|
|
2439
2441
|
if (!(!d || !g)) {
|
|
2440
2442
|
j(!0);
|
|
2441
2443
|
try {
|
|
2442
|
-
const o = `${
|
|
2443
|
-
|
|
2444
|
+
const o = `${$}${d}/`;
|
|
2445
|
+
m && (await m({
|
|
2444
2446
|
name: d,
|
|
2445
2447
|
type: "folder",
|
|
2446
|
-
path:
|
|
2448
|
+
path: $,
|
|
2447
2449
|
mimeType: "application/x-directory",
|
|
2448
2450
|
size: 0,
|
|
2449
2451
|
mountId: g.id,
|
|
@@ -2459,7 +2461,7 @@ const ar = ({
|
|
|
2459
2461
|
}, G = async (o) => {
|
|
2460
2462
|
j(!0);
|
|
2461
2463
|
try {
|
|
2462
|
-
const z = await
|
|
2464
|
+
const z = await f?.(o.id);
|
|
2463
2465
|
Z(o), r(o, z), p(!1);
|
|
2464
2466
|
} catch (z) {
|
|
2465
2467
|
console.error("Failed to download file", z);
|
|
@@ -2468,37 +2470,37 @@ const ar = ({
|
|
|
2468
2470
|
}
|
|
2469
2471
|
}, S = (o) => {
|
|
2470
2472
|
o.stopPropagation(), Z(null), r(null);
|
|
2471
|
-
},
|
|
2473
|
+
}, T = me(() => {
|
|
2472
2474
|
const o = /* @__PURE__ */ new Set(), z = [];
|
|
2473
|
-
return M.forEach((
|
|
2474
|
-
if (
|
|
2475
|
-
|
|
2475
|
+
return M.forEach((F) => {
|
|
2476
|
+
if (F.type === "folder") {
|
|
2477
|
+
F.path === $ && o.add(F.name);
|
|
2476
2478
|
return;
|
|
2477
2479
|
}
|
|
2478
|
-
const
|
|
2479
|
-
se.length > 1 ? o.add(se[0]) : se.length === 1 && z.push(
|
|
2480
|
+
const B = F.providerKey || F.name, se = ($ ? B.substring($.length) : B).split("/").filter((ie) => ie !== "");
|
|
2481
|
+
se.length > 1 ? o.add(se[0]) : se.length === 1 && z.push(F);
|
|
2480
2482
|
}), {
|
|
2481
2483
|
folders: Array.from(o).sort(),
|
|
2482
|
-
files: z.sort((
|
|
2484
|
+
files: z.sort((F, B) => F.name.localeCompare(B.name))
|
|
2483
2485
|
};
|
|
2484
|
-
}, [M,
|
|
2486
|
+
}, [M, $]), I = (o) => {
|
|
2485
2487
|
_((z) => `${z}${o}/`);
|
|
2486
|
-
},
|
|
2487
|
-
const o =
|
|
2488
|
+
}, D = () => {
|
|
2489
|
+
const o = $.split("/").filter((z) => z !== "");
|
|
2488
2490
|
o.pop(), o.length === 0 ? _("/") : _(`${o.join("/")}/`);
|
|
2489
|
-
},
|
|
2490
|
-
const o =
|
|
2491
|
+
}, q = me(() => {
|
|
2492
|
+
const o = T.folders.map((z) => ({
|
|
2491
2493
|
id: `folder-${z}`,
|
|
2492
2494
|
name: z,
|
|
2493
2495
|
type: "folder"
|
|
2494
2496
|
}));
|
|
2495
|
-
return
|
|
2497
|
+
return T.files.forEach((z) => {
|
|
2496
2498
|
o.push({
|
|
2497
2499
|
...z,
|
|
2498
2500
|
type: "file"
|
|
2499
2501
|
});
|
|
2500
2502
|
}), o;
|
|
2501
|
-
}, [
|
|
2503
|
+
}, [T]), P = [
|
|
2502
2504
|
{
|
|
2503
2505
|
id: "name",
|
|
2504
2506
|
header: "Name",
|
|
@@ -2512,7 +2514,7 @@ const ar = ({
|
|
|
2512
2514
|
color: z.type === "folder" ? "warning" : "secondary"
|
|
2513
2515
|
}
|
|
2514
2516
|
),
|
|
2515
|
-
/* @__PURE__ */ e("span", { className:
|
|
2517
|
+
/* @__PURE__ */ e("span", { className: u(z.type === "folder" && "font-medium"), children: o })
|
|
2516
2518
|
] })
|
|
2517
2519
|
},
|
|
2518
2520
|
{
|
|
@@ -2535,8 +2537,8 @@ const ar = ({
|
|
|
2535
2537
|
{
|
|
2536
2538
|
size: "sm",
|
|
2537
2539
|
variant: "outline",
|
|
2538
|
-
onClick: (
|
|
2539
|
-
|
|
2540
|
+
onClick: (F) => {
|
|
2541
|
+
F.stopPropagation(), z.type === "folder" ? I(z.name) : G(z);
|
|
2540
2542
|
},
|
|
2541
2543
|
loading: V && z.type === "file" && X?.id === z.id,
|
|
2542
2544
|
children: z.type === "folder" ? "Open" : "Select"
|
|
@@ -2558,7 +2560,7 @@ const ar = ({
|
|
|
2558
2560
|
header: "",
|
|
2559
2561
|
accessor: "id",
|
|
2560
2562
|
align: "right",
|
|
2561
|
-
cell: (o, z) => /* @__PURE__ */ e(re, { size: "sm", variant: "outline", onClick: () =>
|
|
2563
|
+
cell: (o, z) => /* @__PURE__ */ e(re, { size: "sm", variant: "outline", onClick: () => L(z), children: "Open" })
|
|
2562
2564
|
}
|
|
2563
2565
|
];
|
|
2564
2566
|
return /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
@@ -2567,7 +2569,7 @@ const ar = ({
|
|
|
2567
2569
|
"div",
|
|
2568
2570
|
{
|
|
2569
2571
|
onClick: () => !l && p(!0),
|
|
2570
|
-
className:
|
|
2572
|
+
className: u(
|
|
2571
2573
|
"flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
|
|
2572
2574
|
"hover:border-border-strong bg-surface",
|
|
2573
2575
|
a ? "border-danger-border" : "border-border",
|
|
@@ -2589,11 +2591,11 @@ const ar = ({
|
|
|
2589
2591
|
),
|
|
2590
2592
|
a && /* @__PURE__ */ e(oe, { variant: "body", size: "xs", className: "text-danger-fg", children: a }),
|
|
2591
2593
|
/* @__PURE__ */ e(
|
|
2592
|
-
|
|
2594
|
+
Be,
|
|
2593
2595
|
{
|
|
2594
|
-
open:
|
|
2596
|
+
open: h,
|
|
2595
2597
|
onClose: () => {
|
|
2596
|
-
p(!1),
|
|
2598
|
+
p(!1), L(null), _("/"), C(!1);
|
|
2597
2599
|
},
|
|
2598
2600
|
title: g ? `Explorer: ${g.name}` : "Select Storage Mount",
|
|
2599
2601
|
size: "lg",
|
|
@@ -2613,13 +2615,13 @@ const ar = ({
|
|
|
2613
2615
|
variant: "ghost",
|
|
2614
2616
|
size: "sm",
|
|
2615
2617
|
onClick: () => {
|
|
2616
|
-
|
|
2618
|
+
$ && $ !== "/" ? D() : L(null);
|
|
2617
2619
|
},
|
|
2618
2620
|
leftIcon: /* @__PURE__ */ e(J, { icon: Ee, size: "xs" }),
|
|
2619
|
-
children:
|
|
2621
|
+
children: $ ? "Back" : "Back to Mounts"
|
|
2620
2622
|
}
|
|
2621
2623
|
),
|
|
2622
|
-
/* @__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:
|
|
2624
|
+
/* @__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: $ }) }),
|
|
2623
2625
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
2624
2626
|
he,
|
|
2625
2627
|
{
|
|
@@ -2683,7 +2685,7 @@ const ar = ({
|
|
|
2683
2685
|
/* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2684
2686
|
Te,
|
|
2685
2687
|
{
|
|
2686
|
-
data:
|
|
2688
|
+
data: q,
|
|
2687
2689
|
columns: P,
|
|
2688
2690
|
loading: V,
|
|
2689
2691
|
emptyContent: "This folder is empty",
|
|
@@ -2697,7 +2699,7 @@ const ar = ({
|
|
|
2697
2699
|
columns: K,
|
|
2698
2700
|
loading: V,
|
|
2699
2701
|
emptyContent: "No storage mounts configured",
|
|
2700
|
-
onRowClick: (o) =>
|
|
2702
|
+
onRowClick: (o) => L(o)
|
|
2701
2703
|
}
|
|
2702
2704
|
) }) })
|
|
2703
2705
|
},
|
|
@@ -2747,22 +2749,22 @@ const ar = ({
|
|
|
2747
2749
|
fullWidth: a = !1,
|
|
2748
2750
|
loading: l = !1,
|
|
2749
2751
|
containerClassName: c,
|
|
2750
|
-
labelClassName:
|
|
2752
|
+
labelClassName: x,
|
|
2751
2753
|
className: b,
|
|
2752
2754
|
id: y,
|
|
2753
|
-
rows:
|
|
2754
|
-
...
|
|
2755
|
-
},
|
|
2755
|
+
rows: f = 4,
|
|
2756
|
+
...m
|
|
2757
|
+
}, h) => {
|
|
2756
2758
|
const p = le.useId(), k = y || `textarea-${p}`, v = !!n, g = n || r ? `${k}-description` : void 0;
|
|
2757
|
-
return /* @__PURE__ */ i("div", { className:
|
|
2759
|
+
return /* @__PURE__ */ i("div", { className: u("flex flex-col", a && "w-full", c), children: [
|
|
2758
2760
|
t && /* @__PURE__ */ e(
|
|
2759
2761
|
"label",
|
|
2760
2762
|
{
|
|
2761
2763
|
htmlFor: k,
|
|
2762
|
-
className:
|
|
2764
|
+
className: u(
|
|
2763
2765
|
Oe,
|
|
2764
2766
|
v ? "text-danger-fg" : "text-text-subtle",
|
|
2765
|
-
|
|
2767
|
+
x
|
|
2766
2768
|
),
|
|
2767
2769
|
children: t
|
|
2768
2770
|
}
|
|
@@ -2771,12 +2773,12 @@ const ar = ({
|
|
|
2771
2773
|
/* @__PURE__ */ e(
|
|
2772
2774
|
"textarea",
|
|
2773
2775
|
{
|
|
2774
|
-
ref:
|
|
2776
|
+
ref: h,
|
|
2775
2777
|
id: k,
|
|
2776
|
-
rows:
|
|
2778
|
+
rows: f,
|
|
2777
2779
|
"aria-invalid": v || void 0,
|
|
2778
2780
|
"aria-describedby": g,
|
|
2779
|
-
className:
|
|
2781
|
+
className: u(
|
|
2780
2782
|
"block w-full resize-y rounded-md border bg-surface-input text-text",
|
|
2781
2783
|
"transition-colors duration-fast ease-out",
|
|
2782
2784
|
"placeholder:text-text-subtle",
|
|
@@ -2786,7 +2788,7 @@ const ar = ({
|
|
|
2786
2788
|
v ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
2787
2789
|
b
|
|
2788
2790
|
),
|
|
2789
|
-
...
|
|
2791
|
+
...m
|
|
2790
2792
|
}
|
|
2791
2793
|
),
|
|
2792
2794
|
l && /* @__PURE__ */ e(
|
|
@@ -2801,7 +2803,7 @@ const ar = ({
|
|
|
2801
2803
|
"p",
|
|
2802
2804
|
{
|
|
2803
2805
|
id: g,
|
|
2804
|
-
className:
|
|
2806
|
+
className: u("mt-1 text-xs", v ? "text-danger-fg" : "text-text-subtle"),
|
|
2805
2807
|
children: n || r
|
|
2806
2808
|
}
|
|
2807
2809
|
)
|
|
@@ -2819,8 +2821,8 @@ function or(t, r, n) {
|
|
|
2819
2821
|
const s = r.split("."), a = Array.isArray(t) ? [...t] : { ...t };
|
|
2820
2822
|
let l = a;
|
|
2821
2823
|
for (let c = 0; c < s.length - 1; c++) {
|
|
2822
|
-
const
|
|
2823
|
-
l[
|
|
2824
|
+
const x = s[c], b = l[x];
|
|
2825
|
+
l[x] = b && typeof b == "object" ? Array.isArray(b) ? [...b] : { ...b } : {}, l = l[x];
|
|
2824
2826
|
}
|
|
2825
2827
|
return l[s[s.length - 1]] = n, a;
|
|
2826
2828
|
}
|
|
@@ -2842,23 +2844,23 @@ const Qr = ({
|
|
|
2842
2844
|
onChange: a,
|
|
2843
2845
|
transform: l,
|
|
2844
2846
|
validate: c,
|
|
2845
|
-
submitButton:
|
|
2847
|
+
submitButton: x = { label: "Submit", variant: "primary" },
|
|
2846
2848
|
cancelButton: b = { label: "Cancel", variant: "outline" },
|
|
2847
2849
|
showButtons: y = !0,
|
|
2848
|
-
layout:
|
|
2849
|
-
size:
|
|
2850
|
-
loading:
|
|
2850
|
+
layout: f = "vertical",
|
|
2851
|
+
size: m = "md",
|
|
2852
|
+
loading: h = !1,
|
|
2851
2853
|
className: p,
|
|
2852
2854
|
ref: k,
|
|
2853
2855
|
sdk: v
|
|
2854
2856
|
}) => {
|
|
2855
|
-
const [g,
|
|
2857
|
+
const [g, L] = R(r || {}), [$, _] = R({}), [M, U] = R({});
|
|
2856
2858
|
Y(() => {
|
|
2857
|
-
r &&
|
|
2859
|
+
r && L({ ...r });
|
|
2858
2860
|
}, [r]);
|
|
2859
2861
|
const V = ce(
|
|
2860
2862
|
(C, d, E) => {
|
|
2861
|
-
const N = t.flatMap((
|
|
2863
|
+
const N = t.flatMap((A) => A.items).find((A) => A.name === C);
|
|
2862
2864
|
if (!N) return null;
|
|
2863
2865
|
if (N.required && (d == null || d === ""))
|
|
2864
2866
|
return `${N.label} is required`;
|
|
@@ -2868,7 +2870,7 @@ const Qr = ({
|
|
|
2868
2870
|
if (d && !Array.isArray(d))
|
|
2869
2871
|
return `${N.label} must be an array.`;
|
|
2870
2872
|
if (Array.isArray(d) && N.arrayFields) {
|
|
2871
|
-
const
|
|
2873
|
+
const A = [];
|
|
2872
2874
|
let w = !1;
|
|
2873
2875
|
if (d.forEach((Q, te) => {
|
|
2874
2876
|
const ne = {};
|
|
@@ -2877,13 +2879,13 @@ const Qr = ({
|
|
|
2877
2879
|
if (G.required && (S == null || S === ""))
|
|
2878
2880
|
ne[G.name] = `${G.label} is required`, w = !0;
|
|
2879
2881
|
else if (G.validator) {
|
|
2880
|
-
const
|
|
2881
|
-
|
|
2882
|
+
const T = G.validator(S, Q);
|
|
2883
|
+
T && (ne[G.name] = T, w = !0);
|
|
2882
2884
|
}
|
|
2883
2885
|
}
|
|
2884
|
-
|
|
2886
|
+
A[te] = ne;
|
|
2885
2887
|
}), w)
|
|
2886
|
-
return JSON.stringify(
|
|
2888
|
+
return JSON.stringify(A);
|
|
2887
2889
|
}
|
|
2888
2890
|
}
|
|
2889
2891
|
return N.validator ? N.validator(d, E) : null;
|
|
@@ -2896,41 +2898,41 @@ const Qr = ({
|
|
|
2896
2898
|
C,
|
|
2897
2899
|
d
|
|
2898
2900
|
);
|
|
2899
|
-
t.flatMap((w) => w.items).find((w) => w.name === C)?.removeIfEmpty && (d == null || d === "") && (E = cr(E, C)),
|
|
2900
|
-
const
|
|
2901
|
+
t.flatMap((w) => w.items).find((w) => w.name === C)?.removeIfEmpty && (d == null || d === "") && (E = cr(E, C)), L(E), U((w) => ({ ...w, [C]: !0 }));
|
|
2902
|
+
const A = V(C, d, E);
|
|
2901
2903
|
_((w) => ({
|
|
2902
2904
|
...w,
|
|
2903
|
-
[C]:
|
|
2905
|
+
[C]: A || ""
|
|
2904
2906
|
})), a?.(E, C);
|
|
2905
2907
|
},
|
|
2906
2908
|
[g, t, V, a]
|
|
2907
2909
|
), W = ce(
|
|
2908
2910
|
async (C) => {
|
|
2909
|
-
if (C.preventDefault(),
|
|
2910
|
-
const d = {}, E = t.flatMap((
|
|
2911
|
-
for (const
|
|
2912
|
-
if (
|
|
2911
|
+
if (C.preventDefault(), h) return;
|
|
2912
|
+
const d = {}, E = t.flatMap((A) => A.items);
|
|
2913
|
+
for (const A of E) {
|
|
2914
|
+
if (A.hidden || A.conditional && !A.conditional(g))
|
|
2913
2915
|
continue;
|
|
2914
2916
|
const w = V(
|
|
2915
|
-
|
|
2916
|
-
Ae(g,
|
|
2917
|
+
A.name,
|
|
2918
|
+
Ae(g, A.name),
|
|
2917
2919
|
g
|
|
2918
2920
|
);
|
|
2919
|
-
w && (d[
|
|
2921
|
+
w && (d[A.name] = w);
|
|
2920
2922
|
}
|
|
2921
2923
|
if (c) {
|
|
2922
|
-
const
|
|
2923
|
-
|
|
2924
|
+
const A = c(g);
|
|
2925
|
+
A && Object.assign(d, A);
|
|
2924
2926
|
}
|
|
2925
|
-
if (_(d), Object.keys(d).some((
|
|
2927
|
+
if (_(d), Object.keys(d).some((A) => d[A]))
|
|
2926
2928
|
return;
|
|
2927
2929
|
const N = l ? l(g) : g;
|
|
2928
2930
|
await n?.(g, N);
|
|
2929
2931
|
},
|
|
2930
|
-
[g, t, V, c, l, n,
|
|
2932
|
+
[g, t, V, c, l, n, h]
|
|
2931
2933
|
), H = ce(
|
|
2932
2934
|
(C) => {
|
|
2933
|
-
const d = Ae(g, C.name), E = M[C.name] ?
|
|
2935
|
+
const d = Ae(g, C.name), E = M[C.name] ? $[C.name] : void 0, N = C.disabled || h, A = {
|
|
2934
2936
|
value: d || "",
|
|
2935
2937
|
disabled: N,
|
|
2936
2938
|
required: C.required,
|
|
@@ -2947,30 +2949,30 @@ const Qr = ({
|
|
|
2947
2949
|
return /* @__PURE__ */ e(
|
|
2948
2950
|
he,
|
|
2949
2951
|
{
|
|
2950
|
-
...
|
|
2952
|
+
...A,
|
|
2951
2953
|
onChange: (w) => j(C.name, w.target.value),
|
|
2952
2954
|
type: C.textType || C.type,
|
|
2953
2955
|
autoComplete: C.autocomplete,
|
|
2954
2956
|
error: E,
|
|
2955
|
-
size:
|
|
2957
|
+
size: m
|
|
2956
2958
|
}
|
|
2957
2959
|
);
|
|
2958
2960
|
case "textarea":
|
|
2959
2961
|
return /* @__PURE__ */ e(
|
|
2960
2962
|
ze,
|
|
2961
2963
|
{
|
|
2962
|
-
...
|
|
2964
|
+
...A,
|
|
2963
2965
|
onChange: (w) => j(C.name, w.target.value),
|
|
2964
2966
|
rows: 4,
|
|
2965
2967
|
error: E,
|
|
2966
|
-
size:
|
|
2968
|
+
size: m
|
|
2967
2969
|
}
|
|
2968
2970
|
);
|
|
2969
2971
|
case "select":
|
|
2970
2972
|
return /* @__PURE__ */ e(
|
|
2971
2973
|
pe,
|
|
2972
2974
|
{
|
|
2973
|
-
...
|
|
2975
|
+
...A,
|
|
2974
2976
|
onChange: (w) => j(C.name, w),
|
|
2975
2977
|
options: (C.options || []).map((w) => ({
|
|
2976
2978
|
...w,
|
|
@@ -2980,17 +2982,17 @@ const Qr = ({
|
|
|
2980
2982
|
multiple: C.multiple,
|
|
2981
2983
|
allowCreate: C.allowCreate,
|
|
2982
2984
|
error: E,
|
|
2983
|
-
size:
|
|
2985
|
+
size: m
|
|
2984
2986
|
}
|
|
2985
2987
|
);
|
|
2986
2988
|
case "checkbox":
|
|
2987
2989
|
return /* @__PURE__ */ e(
|
|
2988
2990
|
xe,
|
|
2989
2991
|
{
|
|
2990
|
-
...
|
|
2992
|
+
...A,
|
|
2991
2993
|
checked: !!d,
|
|
2992
2994
|
onChange: (w) => j(C.name, w.target.checked),
|
|
2993
|
-
size:
|
|
2995
|
+
size: m
|
|
2994
2996
|
}
|
|
2995
2997
|
);
|
|
2996
2998
|
case "radio":
|
|
@@ -3020,17 +3022,17 @@ const Qr = ({
|
|
|
3020
3022
|
return /* @__PURE__ */ e(
|
|
3021
3023
|
Se,
|
|
3022
3024
|
{
|
|
3023
|
-
...
|
|
3025
|
+
...A,
|
|
3024
3026
|
value: d ? new Date(d) : null,
|
|
3025
3027
|
onChange: (w) => j(C.name, w),
|
|
3026
|
-
size:
|
|
3028
|
+
size: m
|
|
3027
3029
|
}
|
|
3028
3030
|
);
|
|
3029
3031
|
case "file":
|
|
3030
3032
|
return /* @__PURE__ */ e(
|
|
3031
3033
|
ar,
|
|
3032
3034
|
{
|
|
3033
|
-
...
|
|
3035
|
+
...A,
|
|
3034
3036
|
value: d,
|
|
3035
3037
|
onChange: (w) => j(C.name, w),
|
|
3036
3038
|
error: E,
|
|
@@ -3070,7 +3072,7 @@ const Qr = ({
|
|
|
3070
3072
|
action: "storage.mount"
|
|
3071
3073
|
}),
|
|
3072
3074
|
disabled: N,
|
|
3073
|
-
size:
|
|
3075
|
+
size: m,
|
|
3074
3076
|
placeholder: C.placeholder
|
|
3075
3077
|
}
|
|
3076
3078
|
);
|
|
@@ -3094,30 +3096,30 @@ const Qr = ({
|
|
|
3094
3096
|
}, ne = (S) => {
|
|
3095
3097
|
j(
|
|
3096
3098
|
C.name,
|
|
3097
|
-
w.filter((
|
|
3099
|
+
w.filter((T, I) => I !== S)
|
|
3098
3100
|
);
|
|
3099
|
-
}, G = (S,
|
|
3100
|
-
const
|
|
3101
|
-
|
|
3102
|
-
...
|
|
3103
|
-
[
|
|
3104
|
-
}, j(C.name,
|
|
3101
|
+
}, G = (S, T, I) => {
|
|
3102
|
+
const D = [...w];
|
|
3103
|
+
D[S] = {
|
|
3104
|
+
...D[S],
|
|
3105
|
+
[T]: I
|
|
3106
|
+
}, j(C.name, D);
|
|
3105
3107
|
};
|
|
3106
3108
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
|
|
3107
|
-
w.map((S,
|
|
3109
|
+
w.map((S, T) => /* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
|
|
3108
3110
|
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: C.arrayFields?.map((I) => {
|
|
3109
|
-
const
|
|
3111
|
+
const D = Q?.[T]?.[I.name];
|
|
3110
3112
|
return /* @__PURE__ */ i(
|
|
3111
3113
|
"div",
|
|
3112
3114
|
{
|
|
3113
3115
|
className: "flex flex-col gap-1",
|
|
3114
3116
|
children: [
|
|
3115
|
-
|
|
3117
|
+
T === 0 && /* @__PURE__ */ i("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
|
|
3116
3118
|
I.label,
|
|
3117
3119
|
I.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3118
3120
|
] }),
|
|
3119
3121
|
(() => {
|
|
3120
|
-
const
|
|
3122
|
+
const q = {
|
|
3121
3123
|
value: S?.[I.name] || "",
|
|
3122
3124
|
disabled: N,
|
|
3123
3125
|
required: I.required,
|
|
@@ -3134,40 +3136,40 @@ const Qr = ({
|
|
|
3134
3136
|
return /* @__PURE__ */ e(
|
|
3135
3137
|
he,
|
|
3136
3138
|
{
|
|
3137
|
-
...
|
|
3139
|
+
...q,
|
|
3138
3140
|
onChange: (P) => G(
|
|
3139
|
-
|
|
3141
|
+
T,
|
|
3140
3142
|
I.name,
|
|
3141
3143
|
P.target.value
|
|
3142
3144
|
),
|
|
3143
3145
|
type: I.textType || I.type,
|
|
3144
3146
|
autoComplete: I.autocomplete,
|
|
3145
|
-
error:
|
|
3146
|
-
size:
|
|
3147
|
+
error: D,
|
|
3148
|
+
size: m
|
|
3147
3149
|
}
|
|
3148
3150
|
);
|
|
3149
3151
|
case "textarea":
|
|
3150
3152
|
return /* @__PURE__ */ e(
|
|
3151
3153
|
ze,
|
|
3152
3154
|
{
|
|
3153
|
-
...
|
|
3155
|
+
...q,
|
|
3154
3156
|
onChange: (P) => G(
|
|
3155
|
-
|
|
3157
|
+
T,
|
|
3156
3158
|
I.name,
|
|
3157
3159
|
P.target.value
|
|
3158
3160
|
),
|
|
3159
3161
|
rows: 4,
|
|
3160
|
-
error:
|
|
3161
|
-
size:
|
|
3162
|
+
error: D,
|
|
3163
|
+
size: m
|
|
3162
3164
|
}
|
|
3163
3165
|
);
|
|
3164
3166
|
case "select":
|
|
3165
3167
|
return /* @__PURE__ */ e(
|
|
3166
3168
|
pe,
|
|
3167
3169
|
{
|
|
3168
|
-
...
|
|
3170
|
+
...q,
|
|
3169
3171
|
onChange: (P) => G(
|
|
3170
|
-
|
|
3172
|
+
T,
|
|
3171
3173
|
I.name,
|
|
3172
3174
|
P
|
|
3173
3175
|
),
|
|
@@ -3180,22 +3182,22 @@ const Qr = ({
|
|
|
3180
3182
|
searchable: I.searchable,
|
|
3181
3183
|
multiple: I.multiple,
|
|
3182
3184
|
allowCreate: I.allowCreate,
|
|
3183
|
-
error:
|
|
3184
|
-
size:
|
|
3185
|
+
error: D,
|
|
3186
|
+
size: m
|
|
3185
3187
|
}
|
|
3186
3188
|
);
|
|
3187
3189
|
case "checkbox":
|
|
3188
3190
|
return /* @__PURE__ */ e(
|
|
3189
3191
|
xe,
|
|
3190
3192
|
{
|
|
3191
|
-
...
|
|
3193
|
+
...q,
|
|
3192
3194
|
checked: !!S?.[I.name],
|
|
3193
3195
|
onChange: (P) => G(
|
|
3194
|
-
|
|
3196
|
+
T,
|
|
3195
3197
|
I.name,
|
|
3196
3198
|
P.target.checked
|
|
3197
3199
|
),
|
|
3198
|
-
size:
|
|
3200
|
+
size: m
|
|
3199
3201
|
}
|
|
3200
3202
|
);
|
|
3201
3203
|
case "radio":
|
|
@@ -3208,11 +3210,11 @@ const Qr = ({
|
|
|
3208
3210
|
"input",
|
|
3209
3211
|
{
|
|
3210
3212
|
type: "radio",
|
|
3211
|
-
name: `${C.name}.${
|
|
3213
|
+
name: `${C.name}.${T}.${I.name}`,
|
|
3212
3214
|
value: P.value,
|
|
3213
3215
|
checked: S?.[I.name] === P.value,
|
|
3214
3216
|
onChange: () => G(
|
|
3215
|
-
|
|
3217
|
+
T,
|
|
3216
3218
|
I.name,
|
|
3217
3219
|
P.value
|
|
3218
3220
|
),
|
|
@@ -3230,14 +3232,14 @@ const Qr = ({
|
|
|
3230
3232
|
return /* @__PURE__ */ e(
|
|
3231
3233
|
Se,
|
|
3232
3234
|
{
|
|
3233
|
-
...
|
|
3235
|
+
...q,
|
|
3234
3236
|
value: P ? new Date(P) : null,
|
|
3235
3237
|
onChange: (K) => G(
|
|
3236
|
-
|
|
3238
|
+
T,
|
|
3237
3239
|
I.name,
|
|
3238
3240
|
K
|
|
3239
3241
|
),
|
|
3240
|
-
size:
|
|
3242
|
+
size: m
|
|
3241
3243
|
}
|
|
3242
3244
|
);
|
|
3243
3245
|
}
|
|
@@ -3245,11 +3247,11 @@ const Qr = ({
|
|
|
3245
3247
|
return I.customComponent?.({
|
|
3246
3248
|
value: S?.[I.name],
|
|
3247
3249
|
onChange: (P) => G(
|
|
3248
|
-
|
|
3250
|
+
T,
|
|
3249
3251
|
I.name,
|
|
3250
3252
|
P
|
|
3251
3253
|
),
|
|
3252
|
-
error:
|
|
3254
|
+
error: D,
|
|
3253
3255
|
disabled: N
|
|
3254
3256
|
});
|
|
3255
3257
|
// Add other field types here as needed
|
|
@@ -3261,7 +3263,7 @@ const Qr = ({
|
|
|
3261
3263
|
] });
|
|
3262
3264
|
}
|
|
3263
3265
|
})(),
|
|
3264
|
-
|
|
3266
|
+
D && /* @__PURE__ */ e("p", { className: "text-xs text-danger-fg", children: D })
|
|
3265
3267
|
]
|
|
3266
3268
|
},
|
|
3267
3269
|
I.name
|
|
@@ -3275,13 +3277,13 @@ const Qr = ({
|
|
|
3275
3277
|
variant: "ghost",
|
|
3276
3278
|
size: "md",
|
|
3277
3279
|
"aria-label": `${C.label} verwijderen`,
|
|
3278
|
-
onClick: () => ne(
|
|
3280
|
+
onClick: () => ne(T),
|
|
3279
3281
|
disabled: N,
|
|
3280
|
-
className:
|
|
3282
|
+
className: u("shrink-0", T === 0 && "mt-5"),
|
|
3281
3283
|
children: /* @__PURE__ */ e(st, { className: "size-icon-md" })
|
|
3282
3284
|
}
|
|
3283
3285
|
)
|
|
3284
|
-
] },
|
|
3286
|
+
] }, T)),
|
|
3285
3287
|
/* @__PURE__ */ i(
|
|
3286
3288
|
re,
|
|
3287
3289
|
{
|
|
@@ -3303,14 +3305,14 @@ const Qr = ({
|
|
|
3303
3305
|
return null;
|
|
3304
3306
|
}
|
|
3305
3307
|
},
|
|
3306
|
-
[g, M,
|
|
3308
|
+
[g, M, $, h, m, j]
|
|
3307
3309
|
), X = ce(
|
|
3308
3310
|
(C) => {
|
|
3309
3311
|
if (C.conditional && !C.conditional(g))
|
|
3310
3312
|
return null;
|
|
3311
3313
|
const d = C.items.filter((N) => !(N.hidden || N.conditional && !N.conditional(g)));
|
|
3312
3314
|
if (d.length === 0) return null;
|
|
3313
|
-
const E =
|
|
3315
|
+
const E = u(
|
|
3314
3316
|
C.layout === "flex" ? "flex flex-wrap gap-3" : "grid gap-3",
|
|
3315
3317
|
C.layout !== "flex" && {
|
|
3316
3318
|
"grid-cols-1": !C.columns || C.columns === 1,
|
|
@@ -3329,10 +3331,10 @@ const Qr = ({
|
|
|
3329
3331
|
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children: C.title }),
|
|
3330
3332
|
C.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: C.description })
|
|
3331
3333
|
] }),
|
|
3332
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children: d.map((N) => (M[N.name] &&
|
|
3334
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children: d.map((N) => (M[N.name] && $[N.name], /* @__PURE__ */ i(
|
|
3333
3335
|
"div",
|
|
3334
3336
|
{
|
|
3335
|
-
className:
|
|
3337
|
+
className: u(
|
|
3336
3338
|
"flex min-w-0 flex-col gap-1.5",
|
|
3337
3339
|
N.type === "checkbox" && "justify-center"
|
|
3338
3340
|
),
|
|
@@ -3355,18 +3357,19 @@ const Qr = ({
|
|
|
3355
3357
|
C.id
|
|
3356
3358
|
);
|
|
3357
3359
|
},
|
|
3358
|
-
[g, M,
|
|
3359
|
-
), Z =
|
|
3360
|
+
[g, M, $, H]
|
|
3361
|
+
), Z = u(
|
|
3360
3362
|
"overflow-hidden rounded-lg border border-border bg-surface",
|
|
3361
3363
|
{
|
|
3362
|
-
"max-w-md":
|
|
3363
|
-
"max-w-2xl":
|
|
3364
|
-
"max-w-4xl":
|
|
3365
|
-
"max-w-full":
|
|
3364
|
+
"max-w-md": m === "sm",
|
|
3365
|
+
"max-w-2xl": m === "md",
|
|
3366
|
+
"max-w-4xl": m === "lg",
|
|
3367
|
+
"max-w-full": m === "full"
|
|
3366
3368
|
},
|
|
3367
3369
|
p
|
|
3368
|
-
), ee =
|
|
3370
|
+
), ee = m === "full" ? "md" : m;
|
|
3369
3371
|
return /* @__PURE__ */ i("form", { ref: k, onSubmit: W, className: Z, children: [
|
|
3372
|
+
!y && /* @__PURE__ */ e("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": !0 }),
|
|
3370
3373
|
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(X) }),
|
|
3371
3374
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle bg-surface-sunk px-5 py-3", children: y && /* @__PURE__ */ i(fe, { children: [
|
|
3372
3375
|
/* @__PURE__ */ e("div", { className: "ml-auto" }),
|
|
@@ -3376,7 +3379,7 @@ const Qr = ({
|
|
|
3376
3379
|
type: "button",
|
|
3377
3380
|
variant: b.variant ?? "ghost",
|
|
3378
3381
|
size: b.size || ee,
|
|
3379
|
-
disabled: b.disabled ||
|
|
3382
|
+
disabled: b.disabled || h,
|
|
3380
3383
|
onClick: s,
|
|
3381
3384
|
className: b.className,
|
|
3382
3385
|
children: b.label
|
|
@@ -3386,12 +3389,12 @@ const Qr = ({
|
|
|
3386
3389
|
re,
|
|
3387
3390
|
{
|
|
3388
3391
|
type: "submit",
|
|
3389
|
-
variant:
|
|
3390
|
-
size:
|
|
3391
|
-
disabled:
|
|
3392
|
-
loading:
|
|
3393
|
-
className:
|
|
3394
|
-
children:
|
|
3392
|
+
variant: x.variant,
|
|
3393
|
+
size: x.size || ee,
|
|
3394
|
+
disabled: x.disabled || h,
|
|
3395
|
+
loading: h,
|
|
3396
|
+
className: x.className,
|
|
3397
|
+
children: x.label
|
|
3395
3398
|
}
|
|
3396
3399
|
)
|
|
3397
3400
|
] }) })
|
|
@@ -3405,11 +3408,11 @@ function en({
|
|
|
3405
3408
|
cancelLabel: a = "Annuleren",
|
|
3406
3409
|
tone: l = "default",
|
|
3407
3410
|
loading: c = !1,
|
|
3408
|
-
onConfirm:
|
|
3411
|
+
onConfirm: x,
|
|
3409
3412
|
onCancel: b
|
|
3410
3413
|
}) {
|
|
3411
3414
|
return /* @__PURE__ */ e(
|
|
3412
|
-
|
|
3415
|
+
Be,
|
|
3413
3416
|
{
|
|
3414
3417
|
open: t,
|
|
3415
3418
|
onClose: b,
|
|
@@ -3421,7 +3424,7 @@ function en({
|
|
|
3421
3424
|
re,
|
|
3422
3425
|
{
|
|
3423
3426
|
variant: l === "danger" ? "destructive" : "primary",
|
|
3424
|
-
onClick:
|
|
3427
|
+
onClick: x,
|
|
3425
3428
|
loading: c,
|
|
3426
3429
|
children: s
|
|
3427
3430
|
}
|
|
@@ -3463,13 +3466,13 @@ function tn({
|
|
|
3463
3466
|
dismissible: a = !1,
|
|
3464
3467
|
onDismiss: l,
|
|
3465
3468
|
className: c,
|
|
3466
|
-
children:
|
|
3469
|
+
children: x,
|
|
3467
3470
|
...b
|
|
3468
3471
|
}) {
|
|
3469
3472
|
return /* @__PURE__ */ i(
|
|
3470
3473
|
"span",
|
|
3471
3474
|
{
|
|
3472
|
-
className:
|
|
3475
|
+
className: u(
|
|
3473
3476
|
// Base styles
|
|
3474
3477
|
"inline-flex items-center font-medium rounded-full",
|
|
3475
3478
|
// Variant styles
|
|
@@ -3483,14 +3486,14 @@ function tn({
|
|
|
3483
3486
|
n && /* @__PURE__ */ e(
|
|
3484
3487
|
"span",
|
|
3485
3488
|
{
|
|
3486
|
-
className:
|
|
3489
|
+
className: u(
|
|
3487
3490
|
"w-2 h-2 rounded-full mr-1.5",
|
|
3488
3491
|
ur[t]
|
|
3489
3492
|
)
|
|
3490
3493
|
}
|
|
3491
3494
|
),
|
|
3492
|
-
s && /* @__PURE__ */ e("span", { className:
|
|
3493
|
-
|
|
3495
|
+
s && /* @__PURE__ */ e("span", { className: u("flex-shrink-0", x && "mr-1"), children: s }),
|
|
3496
|
+
x,
|
|
3494
3497
|
a && l && /* @__PURE__ */ e(
|
|
3495
3498
|
"button",
|
|
3496
3499
|
{
|
|
@@ -3516,19 +3519,19 @@ function rn({
|
|
|
3516
3519
|
actions: a,
|
|
3517
3520
|
card: l = !1,
|
|
3518
3521
|
className: c,
|
|
3519
|
-
...
|
|
3522
|
+
...x
|
|
3520
3523
|
}) {
|
|
3521
3524
|
return /* @__PURE__ */ i(
|
|
3522
3525
|
"div",
|
|
3523
3526
|
{
|
|
3524
|
-
className:
|
|
3527
|
+
className: u(
|
|
3525
3528
|
"flex flex-col items-center gap-2.5 text-center",
|
|
3526
3529
|
l && "rounded-lg border border-border bg-surface px-11 py-9 shadow-overlay",
|
|
3527
3530
|
c
|
|
3528
3531
|
),
|
|
3529
|
-
...
|
|
3532
|
+
...x,
|
|
3530
3533
|
children: [
|
|
3531
|
-
t != null && /* @__PURE__ */ e("span", { className:
|
|
3534
|
+
t != null && /* @__PURE__ */ e("span", { className: u("flex size-disc items-center justify-center rounded-full text-2xl", mr[r]), children: t }),
|
|
3532
3535
|
/* @__PURE__ */ e("div", { className: "text-lg font-semibold text-text", children: n }),
|
|
3533
3536
|
s && /* @__PURE__ */ e("div", { className: "max-w-sm text-sm leading-relaxed text-text-muted", children: s }),
|
|
3534
3537
|
a && /* @__PURE__ */ e("div", { className: "flex gap-2 pt-1.5", children: a })
|
|
@@ -3540,7 +3543,7 @@ function nn({ children: t, className: r, ...n }) {
|
|
|
3540
3543
|
return /* @__PURE__ */ e(
|
|
3541
3544
|
"kbd",
|
|
3542
3545
|
{
|
|
3543
|
-
className:
|
|
3546
|
+
className: u(
|
|
3544
3547
|
"inline-flex items-center rounded border border-border px-1.5 py-px text-xs font-medium leading-none text-text-muted",
|
|
3545
3548
|
r
|
|
3546
3549
|
),
|
|
@@ -3565,12 +3568,12 @@ function sn({ value: t, variant: r = "accent", size: n = "md", className: s, ...
|
|
|
3565
3568
|
"aria-valuenow": Math.round(l),
|
|
3566
3569
|
"aria-valuemin": 0,
|
|
3567
3570
|
"aria-valuemax": 100,
|
|
3568
|
-
className:
|
|
3571
|
+
className: u("w-full overflow-hidden rounded-full bg-surface-hover", fr[n], s),
|
|
3569
3572
|
...a,
|
|
3570
3573
|
children: /* @__PURE__ */ e(
|
|
3571
3574
|
"div",
|
|
3572
3575
|
{
|
|
3573
|
-
className:
|
|
3576
|
+
className: u("h-full rounded-full transition-[width] duration-300 ease-out", hr[r]),
|
|
3574
3577
|
style: { width: `${l}%` }
|
|
3575
3578
|
}
|
|
3576
3579
|
)
|
|
@@ -3606,7 +3609,7 @@ function an({
|
|
|
3606
3609
|
return /* @__PURE__ */ i(
|
|
3607
3610
|
"div",
|
|
3608
3611
|
{
|
|
3609
|
-
className:
|
|
3612
|
+
className: u(
|
|
3610
3613
|
"inline-flex items-center",
|
|
3611
3614
|
s ? "flex-col space-y-2" : "",
|
|
3612
3615
|
a
|
|
@@ -3616,7 +3619,7 @@ function an({
|
|
|
3616
3619
|
/* @__PURE__ */ i(
|
|
3617
3620
|
"svg",
|
|
3618
3621
|
{
|
|
3619
|
-
className:
|
|
3622
|
+
className: u(
|
|
3620
3623
|
"animate-spin",
|
|
3621
3624
|
xr[t],
|
|
3622
3625
|
br[r]
|
|
@@ -3651,7 +3654,7 @@ function an({
|
|
|
3651
3654
|
s && /* @__PURE__ */ e(
|
|
3652
3655
|
"span",
|
|
3653
3656
|
{
|
|
3654
|
-
className:
|
|
3657
|
+
className: u(
|
|
3655
3658
|
"text-text-muted",
|
|
3656
3659
|
gr[t]
|
|
3657
3660
|
),
|
|
@@ -3690,7 +3693,7 @@ function ln({
|
|
|
3690
3693
|
role: s ? "img" : void 0,
|
|
3691
3694
|
"aria-label": s,
|
|
3692
3695
|
"aria-hidden": s ? void 0 : !0,
|
|
3693
|
-
className:
|
|
3696
|
+
className: u(
|
|
3694
3697
|
"inline-block size-dot shrink-0",
|
|
3695
3698
|
r === "round" ? "rounded-full" : "rounded-sm",
|
|
3696
3699
|
pr[t],
|
|
@@ -3708,23 +3711,23 @@ function on({
|
|
|
3708
3711
|
className: a
|
|
3709
3712
|
}) {
|
|
3710
3713
|
const l = t.indexOf(r), c = { role: s ? "group" : void 0, "aria-label": s, "aria-hidden": s ? void 0 : !0 };
|
|
3711
|
-
return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className:
|
|
3714
|
+
return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className: u("flex items-center gap-1.5", a), children: t.map((x, b) => /* @__PURE__ */ e(
|
|
3712
3715
|
"span",
|
|
3713
3716
|
{
|
|
3714
|
-
className:
|
|
3717
|
+
className: u(
|
|
3715
3718
|
"h-step-bar rounded-full transition-all duration-fast ease-out",
|
|
3716
3719
|
b === l ? "w-5 bg-accent" : "w-3.5",
|
|
3717
3720
|
b < l && "bg-border-strong",
|
|
3718
3721
|
b > l && "bg-border"
|
|
3719
3722
|
)
|
|
3720
3723
|
},
|
|
3721
|
-
|
|
3722
|
-
)) }) : /* @__PURE__ */ e("div", { ...c, className:
|
|
3724
|
+
x
|
|
3725
|
+
)) }) : /* @__PURE__ */ e("div", { ...c, className: u("flex items-center gap-2", a), children: t.map((x, b) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
3723
3726
|
/* @__PURE__ */ e(
|
|
3724
3727
|
"span",
|
|
3725
3728
|
{
|
|
3726
3729
|
"aria-current": b === l ? "step" : void 0,
|
|
3727
|
-
className:
|
|
3730
|
+
className: u(
|
|
3728
3731
|
"flex size-tile-sm items-center justify-center rounded-full text-xs font-medium",
|
|
3729
3732
|
b === l && "bg-accent text-accent-fg",
|
|
3730
3733
|
b < l && "bg-accent-soft text-accent",
|
|
@@ -3734,13 +3737,13 @@ function on({
|
|
|
3734
3737
|
}
|
|
3735
3738
|
),
|
|
3736
3739
|
b < t.length - 1 && /* @__PURE__ */ e("span", { className: "h-px w-8 bg-border-strong" })
|
|
3737
|
-
] },
|
|
3740
|
+
] }, x)) });
|
|
3738
3741
|
}
|
|
3739
3742
|
function cn({ title: t, icon: r = /* @__PURE__ */ e(lt, { className: "size-icon-md", "aria-hidden": !0 }), action: n, children: s, className: a, ...l }) {
|
|
3740
3743
|
return /* @__PURE__ */ i(
|
|
3741
3744
|
"div",
|
|
3742
3745
|
{
|
|
3743
|
-
className:
|
|
3746
|
+
className: u(
|
|
3744
3747
|
"flex flex-col gap-2 rounded-xl border p-4",
|
|
3745
3748
|
"border-assistant-border bg-assistant-soft",
|
|
3746
3749
|
a
|
|
@@ -3769,8 +3772,8 @@ function yr(t) {
|
|
|
3769
3772
|
return r.length >= 2 ? (r[0][0] + r[1][0]).toUpperCase() : r.length === 1 ? r[0].slice(0, 2).toUpperCase() : "?";
|
|
3770
3773
|
}
|
|
3771
3774
|
const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
3772
|
-
const [l, c] = le.useState(!1),
|
|
3773
|
-
"inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 font-semibold select-none bg-surface-hover
|
|
3775
|
+
const [l, c] = le.useState(!1), x = u(
|
|
3776
|
+
"inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 font-semibold select-none bg-surface-hover text-text",
|
|
3774
3777
|
vr[n],
|
|
3775
3778
|
s
|
|
3776
3779
|
);
|
|
@@ -3780,33 +3783,33 @@ const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3780
3783
|
src: r,
|
|
3781
3784
|
alt: t ?? "",
|
|
3782
3785
|
title: a ?? t,
|
|
3783
|
-
className:
|
|
3786
|
+
className: u(x, "object-cover"),
|
|
3784
3787
|
onError: () => c(!0)
|
|
3785
3788
|
}
|
|
3786
|
-
) : /* @__PURE__ */ e("span", { className:
|
|
3789
|
+
) : /* @__PURE__ */ e("span", { className: x, title: a ?? t, "aria-label": t, children: yr(t) });
|
|
3787
3790
|
}, Le = "ring-surface", wr = "ring-surface-accent", dn = ({ people: t, max: r = 4, size: n = "sm", className: s }) => {
|
|
3788
3791
|
if (t.length === 0) return null;
|
|
3789
3792
|
const a = t.slice(0, r), l = t.length - a.length;
|
|
3790
|
-
return /* @__PURE__ */ i("span", { className:
|
|
3791
|
-
a.map((c,
|
|
3793
|
+
return /* @__PURE__ */ i("span", { className: u("inline-flex items-center", s), children: [
|
|
3794
|
+
a.map((c, x) => /* @__PURE__ */ e(
|
|
3792
3795
|
Nr,
|
|
3793
3796
|
{
|
|
3794
3797
|
name: c.name,
|
|
3795
3798
|
src: c.src,
|
|
3796
3799
|
size: n,
|
|
3797
3800
|
title: c.name ? c.seen === !1 ? `${c.name} — nog niet gelezen` : c.name : void 0,
|
|
3798
|
-
className:
|
|
3799
|
-
|
|
3801
|
+
className: u(
|
|
3802
|
+
x > 0 && "-ml-2",
|
|
3800
3803
|
c.owner ? wr : Le,
|
|
3801
3804
|
c.seen === !1 && "opacity-40"
|
|
3802
3805
|
)
|
|
3803
3806
|
},
|
|
3804
|
-
c.id ?? `${c.name}-${
|
|
3807
|
+
c.id ?? `${c.name}-${x}`
|
|
3805
3808
|
)),
|
|
3806
3809
|
l > 0 && /* @__PURE__ */ i(
|
|
3807
3810
|
"span",
|
|
3808
3811
|
{
|
|
3809
|
-
className:
|
|
3812
|
+
className: u(
|
|
3810
3813
|
"inline-flex items-center justify-center rounded-full shrink-0 -ml-2 font-semibold bg-surface-hover text-text-muted",
|
|
3811
3814
|
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",
|
|
3812
3815
|
Le
|
|
@@ -3835,7 +3838,7 @@ function un({ channel: t, children: r, size: n = "md", className: s, title: a })
|
|
|
3835
3838
|
"span",
|
|
3836
3839
|
{
|
|
3837
3840
|
title: a,
|
|
3838
|
-
className:
|
|
3841
|
+
className: u(
|
|
3839
3842
|
"inline-flex shrink-0 items-center justify-center font-bold",
|
|
3840
3843
|
kr[n],
|
|
3841
3844
|
l.fg,
|
|
@@ -3854,23 +3857,23 @@ const mn = ({
|
|
|
3854
3857
|
radius: a = "md",
|
|
3855
3858
|
showLoading: l = !0,
|
|
3856
3859
|
showError: c = !0,
|
|
3857
|
-
fallback:
|
|
3860
|
+
fallback: x,
|
|
3858
3861
|
loadingContent: b,
|
|
3859
3862
|
errorContent: y,
|
|
3860
|
-
className:
|
|
3861
|
-
onLoad:
|
|
3862
|
-
onError:
|
|
3863
|
+
className: f,
|
|
3864
|
+
onLoad: m,
|
|
3865
|
+
onError: h,
|
|
3863
3866
|
...p
|
|
3864
3867
|
}) => {
|
|
3865
|
-
const [k, v] = R(!0), [g,
|
|
3866
|
-
v(!1),
|
|
3867
|
-
},
|
|
3868
|
-
if (v(!1),
|
|
3869
|
-
_(
|
|
3868
|
+
const [k, v] = R(!0), [g, L] = R(!1), [$, _] = R(t), M = (Z) => {
|
|
3869
|
+
v(!1), L(!1), m?.(Z);
|
|
3870
|
+
}, U = (Z) => {
|
|
3871
|
+
if (v(!1), L(!0), x && $ !== x) {
|
|
3872
|
+
_(x), L(!1), v(!0);
|
|
3870
3873
|
return;
|
|
3871
3874
|
}
|
|
3872
|
-
|
|
3873
|
-
}, V =
|
|
3875
|
+
h?.(Z);
|
|
3876
|
+
}, V = u(
|
|
3874
3877
|
"relative overflow-hidden bg-surface-hover",
|
|
3875
3878
|
// Size variants
|
|
3876
3879
|
{
|
|
@@ -3897,14 +3900,14 @@ const mn = ({
|
|
|
3897
3900
|
"rounded-xl": a === "xl",
|
|
3898
3901
|
"rounded-full": a === "full"
|
|
3899
3902
|
},
|
|
3900
|
-
|
|
3901
|
-
), j =
|
|
3903
|
+
f
|
|
3904
|
+
), j = u(
|
|
3902
3905
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
3903
3906
|
{
|
|
3904
3907
|
"opacity-0": k || g,
|
|
3905
3908
|
"opacity-100": !k && !g
|
|
3906
3909
|
}
|
|
3907
|
-
), W =
|
|
3910
|
+
), W = u(
|
|
3908
3911
|
"absolute inset-0 flex items-center justify-center",
|
|
3909
3912
|
"text-text-muted"
|
|
3910
3913
|
), H = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), X = /* @__PURE__ */ i("div", { className: "text-center", children: [
|
|
@@ -3916,11 +3919,11 @@ const mn = ({
|
|
|
3916
3919
|
"img",
|
|
3917
3920
|
{
|
|
3918
3921
|
...p,
|
|
3919
|
-
src:
|
|
3922
|
+
src: $,
|
|
3920
3923
|
alt: r,
|
|
3921
3924
|
className: j,
|
|
3922
3925
|
onLoad: M,
|
|
3923
|
-
onError:
|
|
3926
|
+
onError: U
|
|
3924
3927
|
}
|
|
3925
3928
|
),
|
|
3926
3929
|
k && l && /* @__PURE__ */ e("div", { className: W, children: b || H }),
|
|
@@ -3935,21 +3938,21 @@ function fn({
|
|
|
3935
3938
|
renderItem: a,
|
|
3936
3939
|
trailing: l,
|
|
3937
3940
|
onSelect: c,
|
|
3938
|
-
onActiveIndexChange:
|
|
3941
|
+
onActiveIndexChange: x,
|
|
3939
3942
|
isActive: b,
|
|
3940
3943
|
unread: y,
|
|
3941
|
-
dimmed:
|
|
3942
|
-
groupBy:
|
|
3943
|
-
groups:
|
|
3944
|
+
dimmed: f,
|
|
3945
|
+
groupBy: m,
|
|
3946
|
+
groups: h,
|
|
3944
3947
|
renderGroupHeader: p,
|
|
3945
3948
|
stickyGroupHeaders: k = !1,
|
|
3946
3949
|
collapsibleGroups: v = !1,
|
|
3947
3950
|
hideGroupCount: g = !1,
|
|
3948
|
-
selectable:
|
|
3949
|
-
selectedItems:
|
|
3951
|
+
selectable: L = !1,
|
|
3952
|
+
selectedItems: $ = [],
|
|
3950
3953
|
onSelectionChange: _,
|
|
3951
3954
|
bulkActions: M,
|
|
3952
|
-
header:
|
|
3955
|
+
header: U,
|
|
3953
3956
|
stickyHeader: V = !1,
|
|
3954
3957
|
bordered: j = !1,
|
|
3955
3958
|
emptyContent: W,
|
|
@@ -3960,33 +3963,33 @@ function fn({
|
|
|
3960
3963
|
}) {
|
|
3961
3964
|
const [C, d] = le.useState(
|
|
3962
3965
|
() => Object.fromEntries(
|
|
3963
|
-
(
|
|
3966
|
+
(h ?? []).filter((D) => D.defaultCollapsed).map((D) => [D.id, !0])
|
|
3964
3967
|
)
|
|
3965
|
-
), E = le.useRef(null), N = (
|
|
3966
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(
|
|
3968
|
+
), E = le.useRef(null), N = (D) => {
|
|
3969
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(D.key)) return;
|
|
3967
3970
|
const P = Array.from(
|
|
3968
3971
|
E.current?.querySelectorAll("li[data-list-row]") ?? []
|
|
3969
3972
|
);
|
|
3970
3973
|
if (P.length === 0) return;
|
|
3971
|
-
|
|
3972
|
-
const K = P.indexOf(document.activeElement), o =
|
|
3974
|
+
D.preventDefault();
|
|
3975
|
+
const K = P.indexOf(document.activeElement), o = D.key === "Home" ? 0 : D.key === "End" ? P.length - 1 : D.key === "ArrowDown" ? (K + 1) % P.length : (K - 1 + P.length) % P.length;
|
|
3973
3976
|
P[o]?.focus();
|
|
3974
|
-
},
|
|
3977
|
+
}, A = (D, q) => r ? r(D, q) : q, w = (D) => $.includes(D), Q = (D, q) => {
|
|
3975
3978
|
_ && _(
|
|
3976
|
-
|
|
3979
|
+
q ? [...$, D] : $.filter((P) => P !== D)
|
|
3977
3980
|
);
|
|
3978
|
-
}, te = (
|
|
3981
|
+
}, te = (D) => _?.(D ? [...t] : []), ne = u(
|
|
3979
3982
|
"flex flex-col",
|
|
3980
3983
|
j && "overflow-hidden rounded-lg border border-border-subtle",
|
|
3981
3984
|
Z
|
|
3982
3985
|
);
|
|
3983
3986
|
if (H)
|
|
3984
|
-
return /* @__PURE__ */ e("div", { className: ne, children: Array.from({ length: X }).map((
|
|
3987
|
+
return /* @__PURE__ */ e("div", { className: ne, children: Array.from({ length: X }).map((D, q) => /* @__PURE__ */ i(
|
|
3985
3988
|
"div",
|
|
3986
3989
|
{
|
|
3987
|
-
className:
|
|
3990
|
+
className: u(
|
|
3988
3991
|
"flex animate-pulse items-center gap-3 px-4 py-2",
|
|
3989
|
-
n === "divided" &&
|
|
3992
|
+
n === "divided" && q > 0 && "border-t border-border-subtle"
|
|
3990
3993
|
),
|
|
3991
3994
|
children: [
|
|
3992
3995
|
/* @__PURE__ */ e("span", { className: "size-tile-sm shrink-0 rounded-md bg-surface-hover" }),
|
|
@@ -3995,12 +3998,12 @@ function fn({
|
|
|
3995
3998
|
/* @__PURE__ */ e("span", { className: "h-3 w-8 shrink-0 rounded-sm bg-surface-hover" })
|
|
3996
3999
|
]
|
|
3997
4000
|
},
|
|
3998
|
-
`skeleton-${
|
|
4001
|
+
`skeleton-${q}`
|
|
3999
4002
|
)) });
|
|
4000
4003
|
if (t.length === 0 && W)
|
|
4001
4004
|
return /* @__PURE__ */ e("div", { className: ne, children: W });
|
|
4002
|
-
const G = t.length > 0 &&
|
|
4003
|
-
const K = b?.(
|
|
4005
|
+
const G = t.length > 0 && $.length === t.length, S = $.length > 0 && !G, T = (D, q, P) => {
|
|
4006
|
+
const K = b?.(D, q) ?? !1, o = y?.(D, q) ?? !1, z = f?.(D, q) ?? !1, F = L && w(D);
|
|
4004
4007
|
return /* @__PURE__ */ i(
|
|
4005
4008
|
"li",
|
|
4006
4009
|
{
|
|
@@ -4009,27 +4012,27 @@ function fn({
|
|
|
4009
4012
|
tabIndex: 0,
|
|
4010
4013
|
"data-list-row": "",
|
|
4011
4014
|
"aria-current": K || void 0,
|
|
4012
|
-
onClick: () => c(
|
|
4013
|
-
onFocus: () =>
|
|
4014
|
-
onKeyDown: (
|
|
4015
|
-
|
|
4015
|
+
onClick: () => c(D, q),
|
|
4016
|
+
onFocus: () => x?.(q),
|
|
4017
|
+
onKeyDown: (B) => {
|
|
4018
|
+
B.key !== "Enter" && B.key !== " " || (B.preventDefault(), c(D, q));
|
|
4016
4019
|
}
|
|
4017
4020
|
} : {},
|
|
4018
|
-
className:
|
|
4021
|
+
className: u(
|
|
4019
4022
|
"flex items-center gap-3 px-4 py-2 text-base",
|
|
4020
4023
|
"transition-colors duration-fast ease-out",
|
|
4021
4024
|
n === "divided" && !P && "border-t border-border-subtle",
|
|
4022
4025
|
c && "cursor-pointer focus-visible:outline-none focus-visible:focus-ring",
|
|
4023
|
-
K ||
|
|
4026
|
+
K || F ? "bg-accent-soft text-text" : c && "hover:bg-surface-hover",
|
|
4024
4027
|
o && "font-bold",
|
|
4025
4028
|
z && "opacity-55"
|
|
4026
4029
|
),
|
|
4027
4030
|
children: [
|
|
4028
|
-
|
|
4031
|
+
L && /* @__PURE__ */ e("span", { onClick: (B) => B.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4029
4032
|
xe,
|
|
4030
4033
|
{
|
|
4031
|
-
checked: w(
|
|
4032
|
-
onChange: (
|
|
4034
|
+
checked: w(D),
|
|
4035
|
+
onChange: (B) => Q(D, B.target.checked),
|
|
4033
4036
|
"aria-label": "Rij selecteren"
|
|
4034
4037
|
}
|
|
4035
4038
|
) }),
|
|
@@ -4040,31 +4043,31 @@ function fn({
|
|
|
4040
4043
|
className: "mt-2 size-1.5 shrink-0 self-start rounded-full bg-border-strong"
|
|
4041
4044
|
}
|
|
4042
4045
|
),
|
|
4043
|
-
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(
|
|
4044
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(
|
|
4045
|
-
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(
|
|
4046
|
+
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(D, q) }),
|
|
4047
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(D, q) : String(D) }),
|
|
4048
|
+
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(D, q) })
|
|
4046
4049
|
]
|
|
4047
4050
|
},
|
|
4048
|
-
|
|
4051
|
+
A(D, q)
|
|
4049
4052
|
);
|
|
4050
4053
|
}, I = (() => {
|
|
4051
|
-
if (!
|
|
4052
|
-
return t.map((K, o) =>
|
|
4053
|
-
const
|
|
4054
|
+
if (!m)
|
|
4055
|
+
return t.map((K, o) => T(K, o, o === 0));
|
|
4056
|
+
const D = /* @__PURE__ */ new Map();
|
|
4054
4057
|
t.forEach((K, o) => {
|
|
4055
|
-
const z =
|
|
4056
|
-
|
|
4058
|
+
const z = m(K, o);
|
|
4059
|
+
D.has(z) || D.set(z, []), D.get(z).push({ item: K, index: o });
|
|
4057
4060
|
});
|
|
4058
|
-
const
|
|
4061
|
+
const q = h ?? [];
|
|
4059
4062
|
return [
|
|
4060
|
-
...
|
|
4061
|
-
...[...
|
|
4063
|
+
...q.filter((K) => D.has(K.id)),
|
|
4064
|
+
...[...D.keys()].filter((K) => !q.some((o) => o.id === K)).map((K) => ({ id: K }))
|
|
4062
4065
|
].flatMap((K, o) => {
|
|
4063
|
-
const z =
|
|
4066
|
+
const z = D.get(K.id) ?? [], F = v && C[K.id], B = K.title ?? K.id, O = K.count ?? z.length, se = /* @__PURE__ */ e(
|
|
4064
4067
|
"li",
|
|
4065
4068
|
{
|
|
4066
4069
|
onClick: v ? () => d((ie) => ({ ...ie, [K.id]: !ie[K.id] })) : void 0,
|
|
4067
|
-
className:
|
|
4070
|
+
className: u(
|
|
4068
4071
|
"flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
|
|
4069
4072
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
4070
4073
|
"border-border-subtle",
|
|
@@ -4073,59 +4076,59 @@ function fn({
|
|
|
4073
4076
|
k && "sticky z-10",
|
|
4074
4077
|
v && "cursor-pointer select-none hover:text-text"
|
|
4075
4078
|
),
|
|
4076
|
-
"aria-expanded": v ? !
|
|
4079
|
+
"aria-expanded": v ? !F : void 0,
|
|
4077
4080
|
style: k ? { top: V ? 28 : 0 } : void 0,
|
|
4078
4081
|
children: p ? p(K, z.map((ie) => ie.item)) : /* @__PURE__ */ i(fe, { children: [
|
|
4079
4082
|
v && /* @__PURE__ */ e(
|
|
4080
4083
|
ye,
|
|
4081
4084
|
{
|
|
4082
4085
|
"aria-hidden": !0,
|
|
4083
|
-
className:
|
|
4086
|
+
className: u(
|
|
4084
4087
|
"size-icon-sm shrink-0 transition-transform duration-fast ease-out",
|
|
4085
|
-
!
|
|
4088
|
+
!F && "rotate-90"
|
|
4086
4089
|
)
|
|
4087
4090
|
}
|
|
4088
4091
|
),
|
|
4089
|
-
/* @__PURE__ */ e("span", { children:
|
|
4092
|
+
/* @__PURE__ */ e("span", { children: B }),
|
|
4090
4093
|
!g && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: O })
|
|
4091
4094
|
] })
|
|
4092
4095
|
},
|
|
4093
4096
|
`group-${K.id}`
|
|
4094
4097
|
);
|
|
4095
|
-
return
|
|
4098
|
+
return F ? [se] : [
|
|
4096
4099
|
se,
|
|
4097
4100
|
...z.map(
|
|
4098
|
-
({ item: ie, index: He },
|
|
4101
|
+
({ item: ie, index: He }, Ue) => T(ie, He, Ue === 0)
|
|
4099
4102
|
)
|
|
4100
4103
|
];
|
|
4101
4104
|
});
|
|
4102
4105
|
})();
|
|
4103
4106
|
return /* @__PURE__ */ i("div", { ref: E, className: ne, onKeyDown: c ? N : void 0, children: [
|
|
4104
|
-
|
|
4107
|
+
L && $.length > 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
|
|
4105
4108
|
/* @__PURE__ */ e(
|
|
4106
4109
|
xe,
|
|
4107
4110
|
{
|
|
4108
4111
|
checked: G,
|
|
4109
4112
|
indeterminate: S,
|
|
4110
|
-
onChange: (
|
|
4113
|
+
onChange: (D) => te(D.target.checked),
|
|
4111
4114
|
"aria-label": "Alles selecteren"
|
|
4112
4115
|
}
|
|
4113
4116
|
),
|
|
4114
4117
|
/* @__PURE__ */ i("span", { className: "text-xs text-text-subtle", children: [
|
|
4115
|
-
|
|
4118
|
+
$.length,
|
|
4116
4119
|
" geselecteerd"
|
|
4117
4120
|
] }),
|
|
4118
4121
|
M && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: M })
|
|
4119
4122
|
] }),
|
|
4120
|
-
|
|
4123
|
+
U && /* @__PURE__ */ e(
|
|
4121
4124
|
"div",
|
|
4122
4125
|
{
|
|
4123
|
-
className:
|
|
4126
|
+
className: u(
|
|
4124
4127
|
"flex items-center gap-3 border-b border-border-subtle px-4 py-1.5",
|
|
4125
4128
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
4126
4129
|
V && "sticky top-0 z-20"
|
|
4127
4130
|
),
|
|
4128
|
-
children:
|
|
4131
|
+
children: U
|
|
4129
4132
|
}
|
|
4130
4133
|
),
|
|
4131
4134
|
/* @__PURE__ */ e("ul", { "aria-label": ee, className: "flex flex-col", children: I })
|
|
@@ -4141,7 +4144,7 @@ function hn({
|
|
|
4141
4144
|
return /* @__PURE__ */ e(
|
|
4142
4145
|
"div",
|
|
4143
4146
|
{
|
|
4144
|
-
className:
|
|
4147
|
+
className: u(
|
|
4145
4148
|
// A bubble never spans the whole column; it narrows further from md,
|
|
4146
4149
|
// where the thread itself is wide enough for the difference to matter.
|
|
4147
4150
|
"min-w-0 max-w-bubble border md:max-w-bubble-md",
|
|
@@ -4168,8 +4171,8 @@ const Cr = {
|
|
|
4168
4171
|
success: "border-border"
|
|
4169
4172
|
};
|
|
4170
4173
|
function xn({ value: t, label: r, tone: n = "default", className: s, ...a }) {
|
|
4171
|
-
return /* @__PURE__ */ i("div", { className:
|
|
4172
|
-
/* @__PURE__ */ e("div", { className:
|
|
4174
|
+
return /* @__PURE__ */ i("div", { className: u("rounded-xl border bg-surface px-4 py-3.5", Sr[n], s), ...a, children: [
|
|
4175
|
+
/* @__PURE__ */ e("div", { className: u("text-2xl font-semibold", Cr[n]), children: t }),
|
|
4173
4176
|
/* @__PURE__ */ e("div", { className: "pt-0.5 text-xs text-text-muted", children: r })
|
|
4174
4177
|
] });
|
|
4175
4178
|
}
|
|
@@ -4181,29 +4184,29 @@ const bn = ({
|
|
|
4181
4184
|
actions: a = [],
|
|
4182
4185
|
children: l,
|
|
4183
4186
|
className: c,
|
|
4184
|
-
backLabel:
|
|
4187
|
+
backLabel: x = "Back",
|
|
4185
4188
|
backClassName: b,
|
|
4186
4189
|
onBack: y,
|
|
4187
|
-
editable:
|
|
4188
|
-
onTitleChange:
|
|
4190
|
+
editable: f = !1,
|
|
4191
|
+
onTitleChange: m
|
|
4189
4192
|
}) => {
|
|
4190
|
-
const [
|
|
4193
|
+
const [h, p] = R(!1), [k, v] = R(r), g = ae(null);
|
|
4191
4194
|
Y(() => {
|
|
4192
4195
|
v(r);
|
|
4193
4196
|
}, [r]), Y(() => {
|
|
4194
|
-
|
|
4195
|
-
}, [
|
|
4196
|
-
const
|
|
4197
|
-
|
|
4198
|
-
},
|
|
4199
|
-
p(!1), k.trim() !== "" && k !== r &&
|
|
4197
|
+
h && g.current && (g.current.focus(), g.current.select());
|
|
4198
|
+
}, [h]);
|
|
4199
|
+
const L = () => {
|
|
4200
|
+
f && p(!0);
|
|
4201
|
+
}, $ = () => {
|
|
4202
|
+
p(!1), k.trim() !== "" && k !== r && m ? m(k.trim()) : v(r);
|
|
4200
4203
|
}, _ = (M) => {
|
|
4201
4204
|
M.key === "Enter" ? g.current?.blur() : M.key === "Escape" && (v(r), p(!1));
|
|
4202
4205
|
};
|
|
4203
4206
|
return /* @__PURE__ */ i(
|
|
4204
4207
|
"div",
|
|
4205
4208
|
{
|
|
4206
|
-
className:
|
|
4209
|
+
className: u(
|
|
4207
4210
|
"p-5 pb-3",
|
|
4208
4211
|
// App-bar treatment: own background, full-bleed, closed with a rule.
|
|
4209
4212
|
t && "bg-surface border-b border-border",
|
|
@@ -4214,14 +4217,14 @@ const bn = ({
|
|
|
4214
4217
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ i("div", { className: "flex items-start gap-2 text-text", children: [
|
|
4215
4218
|
y && /* @__PURE__ */ e(re, { variant: "secondary", onClick: y, leftIcon: /* @__PURE__ */ e(J, { icon: Ee, size: "sm" }), iconOnly: !0 }),
|
|
4216
4219
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
4217
|
-
|
|
4220
|
+
h ? /* @__PURE__ */ e(
|
|
4218
4221
|
"input",
|
|
4219
4222
|
{
|
|
4220
4223
|
ref: g,
|
|
4221
4224
|
type: "text",
|
|
4222
4225
|
value: k,
|
|
4223
4226
|
onChange: (M) => v(M.target.value),
|
|
4224
|
-
onBlur:
|
|
4227
|
+
onBlur: $,
|
|
4225
4228
|
onKeyDown: _,
|
|
4226
4229
|
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"
|
|
4227
4230
|
}
|
|
@@ -4229,21 +4232,21 @@ const bn = ({
|
|
|
4229
4232
|
/* @__PURE__ */ e(
|
|
4230
4233
|
"h2",
|
|
4231
4234
|
{
|
|
4232
|
-
onClick:
|
|
4233
|
-
className:
|
|
4235
|
+
onClick: L,
|
|
4236
|
+
className: u(
|
|
4234
4237
|
"text-2xl font-semibold truncate",
|
|
4235
|
-
|
|
4238
|
+
f && "cursor-pointer"
|
|
4236
4239
|
),
|
|
4237
|
-
title:
|
|
4240
|
+
title: f ? "Klik om te bewerken" : void 0,
|
|
4238
4241
|
children: r
|
|
4239
4242
|
}
|
|
4240
4243
|
),
|
|
4241
4244
|
n && /* @__PURE__ */ e("span", { className: "shrink-0 text-base text-text-muted truncate", children: n }),
|
|
4242
|
-
|
|
4245
|
+
f && /* @__PURE__ */ e(
|
|
4243
4246
|
ct,
|
|
4244
4247
|
{
|
|
4245
4248
|
size: 15,
|
|
4246
|
-
onClick:
|
|
4249
|
+
onClick: L,
|
|
4247
4250
|
className: "shrink-0 cursor-pointer text-text-muted opacity-0 group-hover:opacity-100 transition-opacity"
|
|
4248
4251
|
}
|
|
4249
4252
|
)
|
|
@@ -4267,8 +4270,8 @@ const bn = ({
|
|
|
4267
4270
|
re,
|
|
4268
4271
|
{
|
|
4269
4272
|
variant: M.variant ?? "secondary",
|
|
4270
|
-
onClick: (
|
|
4271
|
-
|
|
4273
|
+
onClick: (U) => {
|
|
4274
|
+
U.stopPropagation(), U.target.blur(), M.onClick();
|
|
4272
4275
|
},
|
|
4273
4276
|
disabled: M.disabled,
|
|
4274
4277
|
leftIcon: M.icon,
|
|
@@ -4288,10 +4291,10 @@ const bn = ({
|
|
|
4288
4291
|
backLabel: n = "Back",
|
|
4289
4292
|
className: s,
|
|
4290
4293
|
children: a
|
|
4291
|
-
}) => /* @__PURE__ */ i("div", { className:
|
|
4294
|
+
}) => /* @__PURE__ */ i("div", { className: u("flex items-center gap-2 mb-3", s), children: [
|
|
4292
4295
|
r && /* @__PURE__ */ e(re, { variant: "ghost", size: "sm", onClick: r, leftIcon: /* @__PURE__ */ e(Ee, { size: 14 }), children: n }),
|
|
4293
4296
|
a && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: a }),
|
|
4294
|
-
t.length > 0 && /* @__PURE__ */ e("div", { className:
|
|
4297
|
+
t.length > 0 && /* @__PURE__ */ e("div", { className: u("flex flex-wrap gap-2", !a && "ml-auto"), children: t.map(
|
|
4295
4298
|
(l) => l.splitOptions && l.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
4296
4299
|
Pe,
|
|
4297
4300
|
{
|
|
@@ -4321,7 +4324,7 @@ const bn = ({
|
|
|
4321
4324
|
] });
|
|
4322
4325
|
function pn({ label: t, trailing: r, align: n = "center", className: s }) {
|
|
4323
4326
|
const a = /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-border-subtle", "aria-hidden": !0 });
|
|
4324
|
-
return !t && !r ? /* @__PURE__ */ e("div", { className:
|
|
4327
|
+
return !t && !r ? /* @__PURE__ */ e("div", { className: u("flex items-center py-2", s), children: a }) : /* @__PURE__ */ i("div", { className: u("flex items-center gap-3 py-2", s), children: [
|
|
4325
4328
|
n === "center" && a,
|
|
4326
4329
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-xs font-medium text-text-muted", children: t }),
|
|
4327
4330
|
a,
|
|
@@ -4339,7 +4342,7 @@ function vn({
|
|
|
4339
4342
|
return /* @__PURE__ */ i(
|
|
4340
4343
|
"div",
|
|
4341
4344
|
{
|
|
4342
|
-
className:
|
|
4345
|
+
className: u(
|
|
4343
4346
|
"flex items-center justify-between gap-4 py-2",
|
|
4344
4347
|
s && "rounded-lg border border-border px-3",
|
|
4345
4348
|
a && "opacity-50",
|
|
@@ -4363,7 +4366,7 @@ function yn({
|
|
|
4363
4366
|
children: a,
|
|
4364
4367
|
className: l
|
|
4365
4368
|
}) {
|
|
4366
|
-
return /* @__PURE__ */ i("section", { className:
|
|
4369
|
+
return /* @__PURE__ */ i("section", { className: u("flex flex-col gap-2", l), children: [
|
|
4367
4370
|
/* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
|
|
4368
4371
|
t && /* @__PURE__ */ e(J, { icon: t, size: "md", color: "secondary", className: "mt-0.5" }),
|
|
4369
4372
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -4372,7 +4375,7 @@ function yn({
|
|
|
4372
4375
|
] }),
|
|
4373
4376
|
s && /* @__PURE__ */ e("div", { className: "shrink-0", children: s })
|
|
4374
4377
|
] }),
|
|
4375
|
-
/* @__PURE__ */ e("div", { className:
|
|
4378
|
+
/* @__PURE__ */ e("div", { className: u("flex flex-col", t && "pl-6"), children: a })
|
|
4376
4379
|
] });
|
|
4377
4380
|
}
|
|
4378
4381
|
function Nn({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
@@ -4381,7 +4384,7 @@ function Nn({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
|
4381
4384
|
{
|
|
4382
4385
|
type: "button",
|
|
4383
4386
|
onClick: n,
|
|
4384
|
-
className:
|
|
4387
|
+
className: u(
|
|
4385
4388
|
"inline-flex max-w-full items-center gap-1.5 rounded-full bg-surface-sunk px-2.5 py-1 text-xs text-text-muted transition-colors duration-fast ease-out hover:bg-surface-hover hover:text-text",
|
|
4386
4389
|
s
|
|
4387
4390
|
),
|
|
@@ -4405,26 +4408,26 @@ const wn = ({
|
|
|
4405
4408
|
size: n = "md",
|
|
4406
4409
|
className: s
|
|
4407
4410
|
}) => {
|
|
4408
|
-
const a = (
|
|
4409
|
-
if (!
|
|
4411
|
+
const a = (f) => {
|
|
4412
|
+
if (!f) return "-";
|
|
4410
4413
|
try {
|
|
4411
|
-
return new Date(
|
|
4414
|
+
return new Date(f).toLocaleDateString("nl-NL", {
|
|
4412
4415
|
year: "numeric",
|
|
4413
4416
|
month: "long",
|
|
4414
4417
|
day: "numeric"
|
|
4415
4418
|
});
|
|
4416
4419
|
} catch {
|
|
4417
|
-
return String(
|
|
4420
|
+
return String(f);
|
|
4418
4421
|
}
|
|
4419
|
-
}, l = (
|
|
4420
|
-
if (!
|
|
4421
|
-
const
|
|
4422
|
-
return
|
|
4423
|
-
},
|
|
4424
|
-
(
|
|
4425
|
-
const
|
|
4426
|
-
if (
|
|
4427
|
-
const p =
|
|
4422
|
+
}, l = (f) => f ? "Ja" : "Nee", c = (f, m) => {
|
|
4423
|
+
if (!m) return String(f || "-");
|
|
4424
|
+
const h = m.find((p) => p.value === f);
|
|
4425
|
+
return h ? h.label : String(f || "-");
|
|
4426
|
+
}, x = ce(
|
|
4427
|
+
(f) => {
|
|
4428
|
+
const m = zr(r, f.name);
|
|
4429
|
+
if (f.type === "array") {
|
|
4430
|
+
const p = m;
|
|
4428
4431
|
return !p || p.length === 0 ? /* @__PURE__ */ e(
|
|
4429
4432
|
oe,
|
|
4430
4433
|
{
|
|
@@ -4446,15 +4449,15 @@ const wn = ({
|
|
|
4446
4449
|
weight: "medium",
|
|
4447
4450
|
className: "text-text-muted",
|
|
4448
4451
|
children: [
|
|
4449
|
-
|
|
4452
|
+
f.label,
|
|
4450
4453
|
" ",
|
|
4451
4454
|
v + 1
|
|
4452
4455
|
]
|
|
4453
4456
|
}
|
|
4454
4457
|
) }),
|
|
4455
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children:
|
|
4456
|
-
const
|
|
4457
|
-
let
|
|
4458
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: f.arrayFields?.map((g) => {
|
|
4459
|
+
const L = k?.[g.name];
|
|
4460
|
+
let $ = "-";
|
|
4458
4461
|
switch (g.type) {
|
|
4459
4462
|
case "text":
|
|
4460
4463
|
case "email":
|
|
@@ -4462,30 +4465,30 @@ const wn = ({
|
|
|
4462
4465
|
case "tel":
|
|
4463
4466
|
case "url":
|
|
4464
4467
|
case "textarea":
|
|
4465
|
-
|
|
4468
|
+
$ = L || "-";
|
|
4466
4469
|
break;
|
|
4467
4470
|
case "select":
|
|
4468
4471
|
case "radio":
|
|
4469
|
-
|
|
4470
|
-
|
|
4472
|
+
$ = c(
|
|
4473
|
+
L,
|
|
4471
4474
|
g.options
|
|
4472
4475
|
);
|
|
4473
4476
|
break;
|
|
4474
4477
|
case "checkbox":
|
|
4475
|
-
|
|
4478
|
+
$ = l(L);
|
|
4476
4479
|
break;
|
|
4477
4480
|
case "date":
|
|
4478
|
-
|
|
4481
|
+
$ = a(L);
|
|
4479
4482
|
break;
|
|
4480
4483
|
case "custom":
|
|
4481
|
-
|
|
4482
|
-
value:
|
|
4484
|
+
$ = g.customComponent?.({
|
|
4485
|
+
value: L
|
|
4483
4486
|
});
|
|
4484
4487
|
break;
|
|
4485
4488
|
default:
|
|
4486
|
-
|
|
4489
|
+
$ = String(L || "-");
|
|
4487
4490
|
}
|
|
4488
|
-
return g.format && (
|
|
4491
|
+
return g.format && ($ = g.format(L, k)), /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
4489
4492
|
/* @__PURE__ */ e(
|
|
4490
4493
|
oe,
|
|
4491
4494
|
{
|
|
@@ -4501,7 +4504,7 @@ const wn = ({
|
|
|
4501
4504
|
variant: "body",
|
|
4502
4505
|
size: "sm",
|
|
4503
4506
|
className: "text-text",
|
|
4504
|
-
children:
|
|
4507
|
+
children: $
|
|
4505
4508
|
}
|
|
4506
4509
|
)
|
|
4507
4510
|
] }, g.name);
|
|
@@ -4511,10 +4514,10 @@ const wn = ({
|
|
|
4511
4514
|
v
|
|
4512
4515
|
)) });
|
|
4513
4516
|
}
|
|
4514
|
-
if (
|
|
4515
|
-
return
|
|
4516
|
-
if (
|
|
4517
|
-
const p =
|
|
4517
|
+
if (f.type === "custom" && f.customComponent)
|
|
4518
|
+
return f.customComponent({ value: m });
|
|
4519
|
+
if (f.format) {
|
|
4520
|
+
const p = f.format(m, r);
|
|
4518
4521
|
return /* @__PURE__ */ e(
|
|
4519
4522
|
oe,
|
|
4520
4523
|
{
|
|
@@ -4525,31 +4528,31 @@ const wn = ({
|
|
|
4525
4528
|
}
|
|
4526
4529
|
);
|
|
4527
4530
|
}
|
|
4528
|
-
let
|
|
4529
|
-
switch (
|
|
4531
|
+
let h = "-";
|
|
4532
|
+
switch (f.type) {
|
|
4530
4533
|
case "text":
|
|
4531
4534
|
case "email":
|
|
4532
4535
|
case "password":
|
|
4533
4536
|
case "number":
|
|
4534
4537
|
case "tel":
|
|
4535
4538
|
case "url":
|
|
4536
|
-
|
|
4539
|
+
h = m ? String(m) : "-";
|
|
4537
4540
|
break;
|
|
4538
4541
|
case "textarea":
|
|
4539
|
-
|
|
4542
|
+
h = m ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(m || "-") }) : "-";
|
|
4540
4543
|
break;
|
|
4541
4544
|
case "select":
|
|
4542
4545
|
case "radio":
|
|
4543
|
-
|
|
4546
|
+
h = c(m, f.options);
|
|
4544
4547
|
break;
|
|
4545
4548
|
case "checkbox":
|
|
4546
|
-
|
|
4549
|
+
h = l(m);
|
|
4547
4550
|
break;
|
|
4548
4551
|
case "date":
|
|
4549
|
-
|
|
4552
|
+
h = a(m);
|
|
4550
4553
|
break;
|
|
4551
4554
|
default:
|
|
4552
|
-
|
|
4555
|
+
h = m ? String(m) : "-";
|
|
4553
4556
|
}
|
|
4554
4557
|
return /* @__PURE__ */ e(
|
|
4555
4558
|
oe,
|
|
@@ -4557,30 +4560,30 @@ const wn = ({
|
|
|
4557
4560
|
variant: "body",
|
|
4558
4561
|
size: "sm",
|
|
4559
4562
|
className: "text-text",
|
|
4560
|
-
children:
|
|
4563
|
+
children: h
|
|
4561
4564
|
}
|
|
4562
4565
|
);
|
|
4563
4566
|
},
|
|
4564
4567
|
[r]
|
|
4565
4568
|
), b = ce(
|
|
4566
|
-
(
|
|
4567
|
-
if (
|
|
4569
|
+
(f) => {
|
|
4570
|
+
if (f.conditional && !f.conditional(r))
|
|
4568
4571
|
return null;
|
|
4569
|
-
const
|
|
4570
|
-
if (
|
|
4571
|
-
const
|
|
4572
|
+
const m = f.items.filter((p) => !(p.hidden || p.conditional && !p.conditional(r)));
|
|
4573
|
+
if (m.length === 0) return null;
|
|
4574
|
+
const h = u(
|
|
4572
4575
|
"space-y-4",
|
|
4573
4576
|
{
|
|
4574
|
-
"grid gap-4":
|
|
4575
|
-
"flex flex-wrap gap-4":
|
|
4577
|
+
"grid gap-4": f.layout === "grid",
|
|
4578
|
+
"flex flex-wrap gap-4": f.layout === "flex"
|
|
4576
4579
|
},
|
|
4577
|
-
|
|
4578
|
-
"grid-cols-1": !
|
|
4579
|
-
"grid-cols-2":
|
|
4580
|
-
"grid-cols-3":
|
|
4581
|
-
"grid-cols-4":
|
|
4580
|
+
f.layout === "grid" && {
|
|
4581
|
+
"grid-cols-1": !f.columns || f.columns === 1,
|
|
4582
|
+
"grid-cols-2": f.columns === 2,
|
|
4583
|
+
"grid-cols-3": f.columns === 3,
|
|
4584
|
+
"grid-cols-4": f.columns === 4
|
|
4582
4585
|
},
|
|
4583
|
-
|
|
4586
|
+
f.className
|
|
4584
4587
|
);
|
|
4585
4588
|
return /* @__PURE__ */ i(
|
|
4586
4589
|
"div",
|
|
@@ -4595,20 +4598,20 @@ const wn = ({
|
|
|
4595
4598
|
size: "lg",
|
|
4596
4599
|
weight: "semibold",
|
|
4597
4600
|
className: "text-text",
|
|
4598
|
-
children:
|
|
4601
|
+
children: f.title
|
|
4599
4602
|
}
|
|
4600
4603
|
),
|
|
4601
|
-
|
|
4604
|
+
f.description && /* @__PURE__ */ e(
|
|
4602
4605
|
oe,
|
|
4603
4606
|
{
|
|
4604
4607
|
variant: "body",
|
|
4605
4608
|
size: "sm",
|
|
4606
4609
|
className: "text-text-muted mt-1",
|
|
4607
|
-
children:
|
|
4610
|
+
children: f.description
|
|
4608
4611
|
}
|
|
4609
4612
|
)
|
|
4610
4613
|
] }),
|
|
4611
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className:
|
|
4614
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: h, children: m.map((p) => /* @__PURE__ */ i(
|
|
4612
4615
|
"div",
|
|
4613
4616
|
{
|
|
4614
4617
|
className: "space-y-1",
|
|
@@ -4626,18 +4629,18 @@ const wn = ({
|
|
|
4626
4629
|
children: p.label
|
|
4627
4630
|
}
|
|
4628
4631
|
),
|
|
4629
|
-
|
|
4632
|
+
x(p)
|
|
4630
4633
|
]
|
|
4631
4634
|
},
|
|
4632
4635
|
p.name
|
|
4633
4636
|
)) }) })
|
|
4634
4637
|
]
|
|
4635
4638
|
},
|
|
4636
|
-
|
|
4639
|
+
f.id
|
|
4637
4640
|
);
|
|
4638
4641
|
},
|
|
4639
|
-
[r,
|
|
4640
|
-
), y =
|
|
4642
|
+
[r, x]
|
|
4643
|
+
), y = u(
|
|
4641
4644
|
"space-y-6",
|
|
4642
4645
|
{
|
|
4643
4646
|
"max-w-md": n === "sm",
|
|
@@ -4654,7 +4657,7 @@ const wn = ({
|
|
|
4654
4657
|
/* @__PURE__ */ i(
|
|
4655
4658
|
"div",
|
|
4656
4659
|
{
|
|
4657
|
-
className:
|
|
4660
|
+
className: u(
|
|
4658
4661
|
"flex items-center gap-2 px-2 pt-4 pb-1 text-xs font-semibold uppercase tracking-label text-text-subtle"
|
|
4659
4662
|
),
|
|
4660
4663
|
children: [
|
|
@@ -4663,7 +4666,7 @@ const wn = ({
|
|
|
4663
4666
|
]
|
|
4664
4667
|
}
|
|
4665
4668
|
),
|
|
4666
|
-
/* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.children?.map((c,
|
|
4669
|
+
/* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.children?.map((c, x) => /* @__PURE__ */ e(
|
|
4667
4670
|
Re,
|
|
4668
4671
|
{
|
|
4669
4672
|
item: c,
|
|
@@ -4671,7 +4674,7 @@ const wn = ({
|
|
|
4671
4674
|
onClick: n,
|
|
4672
4675
|
depth: s + 1
|
|
4673
4676
|
},
|
|
4674
|
-
|
|
4677
|
+
x
|
|
4675
4678
|
)) })
|
|
4676
4679
|
] }) : /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
4677
4680
|
"div",
|
|
@@ -4682,7 +4685,7 @@ const wn = ({
|
|
|
4682
4685
|
onKeyDown: (c) => {
|
|
4683
4686
|
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), t.path && n?.(t.path));
|
|
4684
4687
|
},
|
|
4685
|
-
className:
|
|
4688
|
+
className: u(
|
|
4686
4689
|
"flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-base no-underline",
|
|
4687
4690
|
"transition-colors duration-fast ease-out",
|
|
4688
4691
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -4694,7 +4697,7 @@ const wn = ({
|
|
|
4694
4697
|
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e(
|
|
4695
4698
|
"span",
|
|
4696
4699
|
{
|
|
4697
|
-
className:
|
|
4700
|
+
className: u(
|
|
4698
4701
|
"shrink-0 text-xs tabular-nums",
|
|
4699
4702
|
l ? "rounded-full bg-accent px-2 font-semibold text-accent-fg" : "text-text-subtle"
|
|
4700
4703
|
),
|
|
@@ -4714,29 +4717,29 @@ const wn = ({
|
|
|
4714
4717
|
}) => /* @__PURE__ */ i("nav", { className: "flex h-full shrink-0 flex-col p-3 pt-4", children: [
|
|
4715
4718
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-2 pb-3", children: [
|
|
4716
4719
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-lg font-semibold text-text", children: t }),
|
|
4717
|
-
r && r.length > 0 && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: r.map((c,
|
|
4720
|
+
r && r.length > 0 && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: r.map((c, x) => /* @__PURE__ */ e(
|
|
4718
4721
|
"span",
|
|
4719
4722
|
{
|
|
4720
|
-
className:
|
|
4723
|
+
className: u(
|
|
4721
4724
|
"flex h-control-sm w-7 cursor-pointer items-center justify-center rounded-md text-text-strong",
|
|
4722
4725
|
"transition-colors duration-fast ease-out hover:bg-surface-hover hover:text-text-strong",
|
|
4723
4726
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
4724
4727
|
),
|
|
4725
4728
|
children: c
|
|
4726
4729
|
},
|
|
4727
|
-
|
|
4730
|
+
x
|
|
4728
4731
|
)) })
|
|
4729
4732
|
] }),
|
|
4730
4733
|
l && /* @__PURE__ */ e("div", { className: "px-1 pb-3", children: l }),
|
|
4731
4734
|
/* @__PURE__ */ e("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto", children: n.map(
|
|
4732
|
-
(c,
|
|
4735
|
+
(c, x) => !c.path && !c.label && !c.children ? /* @__PURE__ */ e("li", { "aria-hidden": !0, className: "h-4" }, x) : /* @__PURE__ */ e(
|
|
4733
4736
|
Re,
|
|
4734
4737
|
{
|
|
4735
4738
|
item: c,
|
|
4736
4739
|
isSelectedHandler: s,
|
|
4737
4740
|
onClick: a
|
|
4738
4741
|
},
|
|
4739
|
-
|
|
4742
|
+
x
|
|
4740
4743
|
)
|
|
4741
4744
|
) })
|
|
4742
4745
|
] }), Er = {
|
|
@@ -4776,10 +4779,10 @@ const wn = ({
|
|
|
4776
4779
|
align: a = "left",
|
|
4777
4780
|
truncate: l = !1,
|
|
4778
4781
|
className: c,
|
|
4779
|
-
children:
|
|
4782
|
+
children: x,
|
|
4780
4783
|
...b
|
|
4781
4784
|
}) => {
|
|
4782
|
-
const y = `h${t}`,
|
|
4785
|
+
const y = `h${t}`, f = u(
|
|
4783
4786
|
"font-sans text-pretty",
|
|
4784
4787
|
Er[r || Tr(t)],
|
|
4785
4788
|
Mr[n],
|
|
@@ -4788,7 +4791,7 @@ const wn = ({
|
|
|
4788
4791
|
l && "truncate",
|
|
4789
4792
|
c
|
|
4790
4793
|
);
|
|
4791
|
-
return /* @__PURE__ */ e(y, { className:
|
|
4794
|
+
return /* @__PURE__ */ e(y, { className: f, ...b, children: x });
|
|
4792
4795
|
};
|
|
4793
4796
|
function Tr(t) {
|
|
4794
4797
|
return {
|
|
@@ -4808,44 +4811,44 @@ const Sn = ({
|
|
|
4808
4811
|
initialCommandPath: a,
|
|
4809
4812
|
initialActiveIndex: l
|
|
4810
4813
|
}) => {
|
|
4811
|
-
const [c,
|
|
4814
|
+
const [c, x] = R(""), [b, y] = R(a || []), [f, m] = R(l || 0), h = ae(null), p = ae(null), v = (b.length ? t.find((g) => g.id === b[0])?.subCommands || [] : t).filter(
|
|
4812
4815
|
(g) => g.label.toLowerCase().includes(c.toLowerCase())
|
|
4813
4816
|
);
|
|
4814
4817
|
return Y(() => {
|
|
4815
|
-
r || (
|
|
4818
|
+
r || (x(""), y(a || []), m(l || 0));
|
|
4816
4819
|
}, [r]), Y(() => {
|
|
4817
|
-
const g = (
|
|
4820
|
+
const g = (L) => {
|
|
4818
4821
|
if (r) {
|
|
4819
|
-
if (
|
|
4822
|
+
if (L.key === "Escape")
|
|
4820
4823
|
n();
|
|
4821
|
-
else if (
|
|
4822
|
-
|
|
4823
|
-
(
|
|
4824
|
+
else if (L.key === "ArrowUp")
|
|
4825
|
+
m(
|
|
4826
|
+
($) => $ > 0 ? $ - 1 : v.length - 1
|
|
4824
4827
|
);
|
|
4825
|
-
else if (
|
|
4826
|
-
|
|
4827
|
-
(
|
|
4828
|
+
else if (L.key === "ArrowDown")
|
|
4829
|
+
m(
|
|
4830
|
+
($) => $ < v.length - 1 ? $ + 1 : 0
|
|
4828
4831
|
);
|
|
4829
|
-
else if (
|
|
4830
|
-
const
|
|
4831
|
-
|
|
4832
|
+
else if (L.key === "Enter") {
|
|
4833
|
+
const $ = v[f];
|
|
4834
|
+
$ && ($.subCommands ? (y([...b, $.id]), m(0)) : $.action && ($.action(), n()));
|
|
4832
4835
|
}
|
|
4833
4836
|
}
|
|
4834
4837
|
};
|
|
4835
4838
|
return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
|
|
4836
|
-
}, [r, n, v,
|
|
4837
|
-
const g = (
|
|
4838
|
-
|
|
4839
|
+
}, [r, n, v, f, b]), Y(() => {
|
|
4840
|
+
const g = (L) => {
|
|
4841
|
+
h.current && !h.current.contains(L.target) && n();
|
|
4839
4842
|
};
|
|
4840
4843
|
return r && document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
4841
4844
|
}, [r, n]), Y(() => {
|
|
4842
4845
|
if (!r) return;
|
|
4843
|
-
p.current?.querySelector(`[data-index="${
|
|
4844
|
-
}, [
|
|
4846
|
+
p.current?.querySelector(`[data-index="${f}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4847
|
+
}, [f, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ i(
|
|
4845
4848
|
"div",
|
|
4846
4849
|
{
|
|
4847
4850
|
className: "flex flex-col w-full max-w-lg max-h-dialog p-2 mx-auto rounded-lg border border-border shadow-modal bg-surface",
|
|
4848
|
-
ref:
|
|
4851
|
+
ref: h,
|
|
4849
4852
|
children: [
|
|
4850
4853
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4851
4854
|
/* @__PURE__ */ e(Ne, { className: "w-4 h-4 text-text-muted shrink-0" }),
|
|
@@ -4856,7 +4859,7 @@ const Sn = ({
|
|
|
4856
4859
|
autoFocus: !0,
|
|
4857
4860
|
placeholder: s?.searchPlaceholder || "Search commands...",
|
|
4858
4861
|
value: c,
|
|
4859
|
-
onChange: (g) =>
|
|
4862
|
+
onChange: (g) => x(g.target.value),
|
|
4860
4863
|
className: "w-full border-0 bg-transparent py-2 text-text focus:outline-none"
|
|
4861
4864
|
}
|
|
4862
4865
|
)
|
|
@@ -4868,15 +4871,15 @@ const Sn = ({
|
|
|
4868
4871
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
4869
4872
|
children: [
|
|
4870
4873
|
v.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
4871
|
-
v.map((g,
|
|
4874
|
+
v.map((g, L) => /* @__PURE__ */ i(
|
|
4872
4875
|
"div",
|
|
4873
4876
|
{
|
|
4874
|
-
"data-index":
|
|
4875
|
-
className: `flex items-center p-2 cursor-pointer rounded-md ${
|
|
4877
|
+
"data-index": L,
|
|
4878
|
+
className: `flex items-center p-2 cursor-pointer rounded-md ${L === f ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
4876
4879
|
onClick: () => {
|
|
4877
|
-
g.subCommands ? (y([...b, g.id]),
|
|
4880
|
+
g.subCommands ? (y([...b, g.id]), m(0)) : g.action && (g.action(), n());
|
|
4878
4881
|
},
|
|
4879
|
-
onMouseEnter: () =>
|
|
4882
|
+
onMouseEnter: () => m(L),
|
|
4880
4883
|
children: [
|
|
4881
4884
|
g.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: g.icon }),
|
|
4882
4885
|
/* @__PURE__ */ e("span", { className: "flex-grow", children: g.label }),
|
|
@@ -4956,7 +4959,7 @@ const Sn = ({
|
|
|
4956
4959
|
sm: "border",
|
|
4957
4960
|
md: "border-2",
|
|
4958
4961
|
lg: "border-4"
|
|
4959
|
-
},
|
|
4962
|
+
}, Fr = {
|
|
4960
4963
|
primary: "border-accent-border",
|
|
4961
4964
|
secondary: "border-border",
|
|
4962
4965
|
accent: "border-accent-border",
|
|
@@ -4975,22 +4978,22 @@ const Sn = ({
|
|
|
4975
4978
|
shadow: a,
|
|
4976
4979
|
border: l,
|
|
4977
4980
|
borderColor: c,
|
|
4978
|
-
className:
|
|
4981
|
+
className: x,
|
|
4979
4982
|
children: b,
|
|
4980
4983
|
...y
|
|
4981
|
-
},
|
|
4984
|
+
}, f) => /* @__PURE__ */ e(
|
|
4982
4985
|
"div",
|
|
4983
4986
|
{
|
|
4984
|
-
ref:
|
|
4985
|
-
className:
|
|
4987
|
+
ref: f,
|
|
4988
|
+
className: u(
|
|
4986
4989
|
t && Ar[t],
|
|
4987
4990
|
r && Lr[r],
|
|
4988
4991
|
n && Ir[n],
|
|
4989
4992
|
s && jr[s],
|
|
4990
4993
|
a && Pr[a],
|
|
4991
4994
|
l && Or[l],
|
|
4992
|
-
c &&
|
|
4993
|
-
|
|
4995
|
+
c && Fr[c],
|
|
4996
|
+
x
|
|
4994
4997
|
),
|
|
4995
4998
|
...y,
|
|
4996
4999
|
children: b
|
|
@@ -5021,43 +5024,43 @@ function En({
|
|
|
5021
5024
|
componentProps: a,
|
|
5022
5025
|
className: l
|
|
5023
5026
|
}) {
|
|
5024
|
-
const c = ae(null), [
|
|
5027
|
+
const c = ae(null), [x, b] = R(!0), [y, f] = R(null), m = ae(null);
|
|
5025
5028
|
return ae(null), Y(() => {
|
|
5026
|
-
let
|
|
5029
|
+
let h = !0;
|
|
5027
5030
|
return (async () => {
|
|
5028
5031
|
b(!0);
|
|
5029
5032
|
try {
|
|
5030
5033
|
const k = await r();
|
|
5031
|
-
if (!
|
|
5034
|
+
if (!h) return;
|
|
5032
5035
|
const v = k.component || k.default || k;
|
|
5033
|
-
|
|
5036
|
+
f(n === "react" ? () => v : () => k);
|
|
5034
5037
|
} catch (k) {
|
|
5035
5038
|
console.error(`[FederatedResource] Load failed: ${t}`, k);
|
|
5036
5039
|
} finally {
|
|
5037
|
-
|
|
5040
|
+
h && b(!1);
|
|
5038
5041
|
}
|
|
5039
5042
|
})(), () => {
|
|
5040
|
-
|
|
5043
|
+
h = !1;
|
|
5041
5044
|
};
|
|
5042
5045
|
}, [t, r]), Y(() => {
|
|
5043
|
-
if (
|
|
5044
|
-
const
|
|
5045
|
-
if (
|
|
5046
|
+
if (x || !y || n === "react") return;
|
|
5047
|
+
const h = c.current;
|
|
5048
|
+
if (h) {
|
|
5046
5049
|
if (n === "svelte") {
|
|
5047
|
-
const p = y.default || y, k = new p({ target:
|
|
5048
|
-
return
|
|
5050
|
+
const p = y.default || y, k = new p({ target: h, props: a || {} });
|
|
5051
|
+
return m.current = k, () => k.$destroy();
|
|
5049
5052
|
}
|
|
5050
5053
|
if (y.mount) {
|
|
5051
|
-
const p = y.mount({ container:
|
|
5054
|
+
const p = y.mount({ container: h, props: a || {} });
|
|
5052
5055
|
return () => {
|
|
5053
|
-
typeof p == "function" ? p() : y.unmount?.(
|
|
5056
|
+
typeof p == "function" ? p() : y.unmount?.(h);
|
|
5054
5057
|
};
|
|
5055
5058
|
}
|
|
5056
5059
|
}
|
|
5057
|
-
}, [y, n,
|
|
5058
|
-
n === "svelte" &&
|
|
5060
|
+
}, [y, n, x]), Y(() => {
|
|
5061
|
+
n === "svelte" && m.current && m.current.$set?.(a);
|
|
5059
5062
|
}, [a, n]), /* @__PURE__ */ i("div", { ref: c, className: l, style: { display: "contents" }, children: [
|
|
5060
|
-
|
|
5063
|
+
x && s,
|
|
5061
5064
|
n === "react" && y && /* @__PURE__ */ e(y, { ...a })
|
|
5062
5065
|
] });
|
|
5063
5066
|
}
|
|
@@ -5120,13 +5123,13 @@ export {
|
|
|
5120
5123
|
fn as List,
|
|
5121
5124
|
Wr as MeetingGrid,
|
|
5122
5125
|
hn as MessageBubble,
|
|
5123
|
-
|
|
5126
|
+
Be as Modal,
|
|
5124
5127
|
bn as PageHeader,
|
|
5125
5128
|
gn as PageToolbar,
|
|
5126
5129
|
Kr as ParticipantTile,
|
|
5127
5130
|
kt as Popover,
|
|
5128
5131
|
sn as ProgressBar,
|
|
5129
|
-
|
|
5132
|
+
Ft as SearchableTextField,
|
|
5130
5133
|
pn as SectionDivider,
|
|
5131
5134
|
Xr as SegmentedToggle,
|
|
5132
5135
|
pe as Select,
|
|
@@ -5139,7 +5142,7 @@ export {
|
|
|
5139
5142
|
ln as StatusDot,
|
|
5140
5143
|
on as StepIndicator,
|
|
5141
5144
|
ar as StorageInput,
|
|
5142
|
-
|
|
5145
|
+
Bt as Switch,
|
|
5143
5146
|
Zr as TabBar,
|
|
5144
5147
|
Te as Table,
|
|
5145
5148
|
Xt as Tabs,
|
|
@@ -5148,8 +5151,8 @@ export {
|
|
|
5148
5151
|
he as TextField,
|
|
5149
5152
|
_r as VideoSurface,
|
|
5150
5153
|
wn as View,
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
+
u as cn,
|
|
5155
|
+
qr as createSizes,
|
|
5156
|
+
Ur as createVariants
|
|
5154
5157
|
};
|
|
5155
5158
|
//# sourceMappingURL=index.js.map
|