@opencxh/ui-kit 3.57.2 → 3.57.3
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 +942 -942
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { clsx as Ae } from "clsx";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { VideoOff as Ie, User as je, MicOff as Be, Mic as Pe, ChevronDown as _e, FileText as pe, HardDrive as
|
|
4
|
-
import se, { useRef as X, useEffect as G, forwardRef as ce, useState as V, useCallback as
|
|
2
|
+
import { jsxs as i, jsx as e, Fragment as Ee } from "react/jsx-runtime";
|
|
3
|
+
import { VideoOff as Ie, User as je, MicOff as Be, Mic as Pe, ChevronDown as _e, FileText as pe, HardDrive as ke, X as Oe, ArrowLeft as we, Search as Ve, FolderPlus as Fe, Upload as We, Folder as Ce, ChevronDownIcon as Re, ChevronRight as qe } from "lucide-react";
|
|
4
|
+
import se, { useRef as X, useEffect as G, forwardRef as ce, useState as V, useCallback as ne, useMemo as de, createContext as He, Component as Ue } from "react";
|
|
5
5
|
function b(...t) {
|
|
6
6
|
return Ae(t);
|
|
7
7
|
}
|
|
8
8
|
function Gt(t) {
|
|
9
|
-
return (
|
|
9
|
+
return (a, r) => t[a]?.[r] || "";
|
|
10
10
|
}
|
|
11
11
|
function Kt(t) {
|
|
12
|
-
return (
|
|
12
|
+
return (a) => t[a] || "";
|
|
13
13
|
}
|
|
14
|
-
function Jt({ tiles: t, pinned:
|
|
15
|
-
if (
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */ e("div", { className: "flex-1 min-h-[240px]", children:
|
|
14
|
+
function Jt({ tiles: t, pinned: a, className: r }) {
|
|
15
|
+
if (a)
|
|
16
|
+
return /* @__PURE__ */ i("div", { className: b("flex flex-col md:flex-row gap-2 h-full", r), children: [
|
|
17
|
+
/* @__PURE__ */ e("div", { className: "flex-1 min-h-[240px]", children: a }),
|
|
18
18
|
t.length > 0 && /* @__PURE__ */ e("div", { className: "flex md:flex-col gap-2 md:w-48 overflow-auto", children: t.map((s, c) => /* @__PURE__ */ e("div", { className: "min-w-[160px] md:min-w-0", children: s }, c)) })
|
|
19
19
|
] });
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */ e("div", { className: b("grid gap-2 h-full",
|
|
20
|
+
const n = 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: b("grid gap-2 h-full", n, r), children: t.map((s, c) => /* @__PURE__ */ e("div", { children: s }, c)) });
|
|
22
22
|
}
|
|
23
23
|
function Yt({
|
|
24
24
|
name: t,
|
|
25
|
-
avatarUrl:
|
|
25
|
+
avatarUrl: a,
|
|
26
26
|
muted: r,
|
|
27
|
-
speaking:
|
|
27
|
+
speaking: n,
|
|
28
28
|
hasVideo: s,
|
|
29
29
|
videoSlot: c,
|
|
30
|
-
className:
|
|
30
|
+
className: f
|
|
31
31
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ i(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
35
|
className: b(
|
|
36
36
|
"relative rounded-lg overflow-hidden bg-gray-800 aspect-video flex items-center justify-center",
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
n && "ring-2 ring-emerald-400",
|
|
38
|
+
f
|
|
39
39
|
),
|
|
40
40
|
children: [
|
|
41
|
-
s && c ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: c }) : /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 text-gray-300", children:
|
|
42
|
-
/* @__PURE__ */
|
|
41
|
+
s && c ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: c }) : /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: a ? /* @__PURE__ */ e("img", { src: a, alt: t, className: "w-16 h-16 rounded-full object-cover" }) : /* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-gray-700 flex items-center justify-center", children: s ? /* @__PURE__ */ e(Ie, { className: "w-8 h-8" }) : /* @__PURE__ */ e(je, { className: "w-8 h-8" }) }) }),
|
|
42
|
+
/* @__PURE__ */ i("div", { className: "absolute bottom-2 left-2 flex items-center gap-1.5 px-2 py-1 rounded bg-black/50 text-white text-xs", children: [
|
|
43
43
|
r ? /* @__PURE__ */ e(Be, { className: "w-3 h-3" }) : /* @__PURE__ */ e(Pe, { className: "w-3 h-3" }),
|
|
44
44
|
/* @__PURE__ */ e("span", { className: "truncate max-w-[140px]", children: t })
|
|
45
45
|
] })
|
|
@@ -47,22 +47,22 @@ function Yt({
|
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
|
-
function Zt({ attach: t, active:
|
|
50
|
+
function Zt({ attach: t, active: a = !0, mirrored: r = !1, className: n }) {
|
|
51
51
|
const s = X(null);
|
|
52
52
|
return G(() => {
|
|
53
|
-
if (!
|
|
53
|
+
if (!a || !s.current) return;
|
|
54
54
|
const c = t(s.current);
|
|
55
55
|
return () => {
|
|
56
56
|
typeof c == "function" && c(), s.current && (s.current.innerHTML = "");
|
|
57
57
|
};
|
|
58
|
-
}, [t,
|
|
58
|
+
}, [t, a]), /* @__PURE__ */ e(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
ref: s,
|
|
62
62
|
className: b(
|
|
63
63
|
"w-full h-full bg-gray-900 overflow-hidden",
|
|
64
64
|
r && "[&>*]:scale-x-[-1]",
|
|
65
|
-
|
|
65
|
+
n
|
|
66
66
|
)
|
|
67
67
|
}
|
|
68
68
|
);
|
|
@@ -90,19 +90,19 @@ const Ge = {
|
|
|
90
90
|
}, ee = ce(
|
|
91
91
|
({
|
|
92
92
|
variant: t = "primary",
|
|
93
|
-
size:
|
|
93
|
+
size: a = "md",
|
|
94
94
|
fullWidth: r = !1,
|
|
95
|
-
loading:
|
|
95
|
+
loading: n = !1,
|
|
96
96
|
leftIcon: s,
|
|
97
97
|
rightIcon: c,
|
|
98
|
-
iconOnly:
|
|
98
|
+
iconOnly: f = !1,
|
|
99
99
|
className: g,
|
|
100
100
|
children: p,
|
|
101
101
|
disabled: y,
|
|
102
102
|
...u
|
|
103
103
|
}, l) => {
|
|
104
|
-
const
|
|
105
|
-
return /* @__PURE__ */
|
|
104
|
+
const d = y || n;
|
|
105
|
+
return /* @__PURE__ */ i(
|
|
106
106
|
"button",
|
|
107
107
|
{
|
|
108
108
|
ref: l,
|
|
@@ -114,22 +114,22 @@ const Ge = {
|
|
|
114
114
|
// Variant styles
|
|
115
115
|
Ge[t],
|
|
116
116
|
// Size styles
|
|
117
|
-
|
|
117
|
+
f ? Je[a] : Ke[a],
|
|
118
118
|
// Full width
|
|
119
119
|
r && "w-full",
|
|
120
120
|
// Loading state
|
|
121
|
-
|
|
121
|
+
n && "cursor-wait",
|
|
122
122
|
g
|
|
123
123
|
),
|
|
124
|
-
disabled:
|
|
124
|
+
disabled: d,
|
|
125
125
|
...u,
|
|
126
126
|
children: [
|
|
127
|
-
|
|
127
|
+
n && /* @__PURE__ */ i(
|
|
128
128
|
"svg",
|
|
129
129
|
{
|
|
130
130
|
className: b(
|
|
131
131
|
"animate-spin",
|
|
132
|
-
|
|
132
|
+
f ? "h-4 w-4" : "h-4 w-4 mr-2"
|
|
133
133
|
),
|
|
134
134
|
fill: "none",
|
|
135
135
|
viewBox: "0 0 24 24",
|
|
@@ -156,10 +156,10 @@ const Ge = {
|
|
|
156
156
|
]
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
|
-
!
|
|
160
|
-
!
|
|
161
|
-
!
|
|
162
|
-
|
|
159
|
+
!n && s && /* @__PURE__ */ e("span", { className: b("flex-shrink-0", !f && "mr-2"), children: s }),
|
|
160
|
+
!f && p,
|
|
161
|
+
!n && c && /* @__PURE__ */ e("span", { className: b("flex-shrink-0", !f && "ml-2"), children: c }),
|
|
162
|
+
f && !n && !s && !c && p
|
|
163
163
|
]
|
|
164
164
|
}
|
|
165
165
|
);
|
|
@@ -168,9 +168,9 @@ const Ge = {
|
|
|
168
168
|
ee.displayName = "Button";
|
|
169
169
|
const Xt = ({
|
|
170
170
|
children: t,
|
|
171
|
-
size:
|
|
171
|
+
size: a = "md",
|
|
172
172
|
orientation: r = "horizontal",
|
|
173
|
-
attached:
|
|
173
|
+
attached: n = !0,
|
|
174
174
|
className: s
|
|
175
175
|
}) => {
|
|
176
176
|
const c = b(
|
|
@@ -180,64 +180,64 @@ const Xt = ({
|
|
|
180
180
|
"flex-row": r === "horizontal",
|
|
181
181
|
"flex-col": r === "vertical",
|
|
182
182
|
// Attached styling
|
|
183
|
-
"[&>*:not(:first-child):not(:last-child)]:rounded-none":
|
|
184
|
-
"[&>*:first-child]:rounded-r-none":
|
|
185
|
-
"[&>*:last-child]:rounded-l-none":
|
|
186
|
-
"[&>*:first-child]:rounded-b-none":
|
|
187
|
-
"[&>*:last-child]:rounded-t-none":
|
|
183
|
+
"[&>*:not(:first-child):not(:last-child)]:rounded-none": n,
|
|
184
|
+
"[&>*:first-child]:rounded-r-none": n && r === "horizontal",
|
|
185
|
+
"[&>*:last-child]:rounded-l-none": n && r === "horizontal",
|
|
186
|
+
"[&>*:first-child]:rounded-b-none": n && r === "vertical",
|
|
187
|
+
"[&>*:last-child]:rounded-t-none": n && r === "vertical",
|
|
188
188
|
// Borders for attached buttons
|
|
189
|
-
"[&>*:not(:first-child)]:-ml-px":
|
|
190
|
-
"[&>*:not(:first-child)]:-mt-px":
|
|
189
|
+
"[&>*:not(:first-child)]:-ml-px": n && r === "horizontal",
|
|
190
|
+
"[&>*:not(:first-child)]:-mt-px": n && r === "vertical",
|
|
191
191
|
// Spacing for non-attached buttons
|
|
192
|
-
"gap-1": !
|
|
193
|
-
"gap-2": !
|
|
194
|
-
"gap-3": !
|
|
192
|
+
"gap-1": !n && a === "xs",
|
|
193
|
+
"gap-2": !n && (a === "sm" || a === "md"),
|
|
194
|
+
"gap-3": !n && (a === "lg" || a === "xl")
|
|
195
195
|
},
|
|
196
196
|
s
|
|
197
197
|
);
|
|
198
198
|
return /* @__PURE__ */ e("div", { className: c, role: "group", children: t });
|
|
199
199
|
}, Qt = ({
|
|
200
200
|
variant: t = "default",
|
|
201
|
-
size:
|
|
201
|
+
size: a = "md",
|
|
202
202
|
color: r = "primary",
|
|
203
|
-
disabled:
|
|
203
|
+
disabled: n = !1,
|
|
204
204
|
external: s = !1,
|
|
205
205
|
className: c,
|
|
206
|
-
children:
|
|
206
|
+
children: f,
|
|
207
207
|
href: g,
|
|
208
208
|
target: p,
|
|
209
209
|
rel: y,
|
|
210
210
|
...u
|
|
211
211
|
}) => {
|
|
212
|
-
const l = s || g && (g.startsWith("http") || g.startsWith("mailto:")),
|
|
212
|
+
const l = s || g && (g.startsWith("http") || g.startsWith("mailto:")), d = b(
|
|
213
213
|
// Base styles
|
|
214
214
|
"inline-flex items-center gap-1 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
215
215
|
// Size variants
|
|
216
216
|
{
|
|
217
|
-
"text-xs":
|
|
218
|
-
"text-sm":
|
|
219
|
-
"text-base":
|
|
220
|
-
"text-lg":
|
|
221
|
-
"text-xl":
|
|
217
|
+
"text-xs": a === "xs",
|
|
218
|
+
"text-sm": a === "sm",
|
|
219
|
+
"text-base": a === "md",
|
|
220
|
+
"text-lg": a === "lg",
|
|
221
|
+
"text-xl": a === "xl"
|
|
222
222
|
},
|
|
223
223
|
// Color variants
|
|
224
224
|
{
|
|
225
225
|
// Primary
|
|
226
|
-
"text-primary hover:text-primary/80 focus:ring-primary/20": r === "primary" && !
|
|
226
|
+
"text-primary hover:text-primary/80 focus:ring-primary/20": r === "primary" && !n,
|
|
227
227
|
// Secondary
|
|
228
|
-
"text-secondary hover:text-secondary/80 focus:ring-secondary/20": r === "secondary" && !
|
|
228
|
+
"text-secondary hover:text-secondary/80 focus:ring-secondary/20": r === "secondary" && !n,
|
|
229
229
|
// Accent
|
|
230
|
-
"text-accent hover:text-accent/80 focus:ring-accent/20": r === "accent" && !
|
|
230
|
+
"text-accent hover:text-accent/80 focus:ring-accent/20": r === "accent" && !n,
|
|
231
231
|
// Success
|
|
232
|
-
"text-success hover:text-success/80 focus:ring-success/20": r === "success" && !
|
|
232
|
+
"text-success hover:text-success/80 focus:ring-success/20": r === "success" && !n,
|
|
233
233
|
// Warning
|
|
234
|
-
"text-warning hover:text-warning/80 focus:ring-warning/20": r === "warning" && !
|
|
234
|
+
"text-warning hover:text-warning/80 focus:ring-warning/20": r === "warning" && !n,
|
|
235
235
|
// Error
|
|
236
|
-
"text-error hover:text-error/80 focus:ring-error/20": r === "error" && !
|
|
236
|
+
"text-error hover:text-error/80 focus:ring-error/20": r === "error" && !n,
|
|
237
237
|
// Info
|
|
238
|
-
"text-info hover:text-info/80 focus:ring-info/20": r === "info" && !
|
|
238
|
+
"text-info hover:text-info/80 focus:ring-info/20": r === "info" && !n,
|
|
239
239
|
// Neutral
|
|
240
|
-
"text-neutral hover:text-neutral/80 focus:ring-neutral/20": r === "neutral" && !
|
|
240
|
+
"text-neutral hover:text-neutral/80 focus:ring-neutral/20": r === "neutral" && !n
|
|
241
241
|
},
|
|
242
242
|
// Variant styles
|
|
243
243
|
{
|
|
@@ -260,17 +260,17 @@ const Xt = ({
|
|
|
260
260
|
},
|
|
261
261
|
// Disabled state
|
|
262
262
|
{
|
|
263
|
-
"opacity-50 cursor-not-allowed pointer-events-none":
|
|
263
|
+
"opacity-50 cursor-not-allowed pointer-events-none": n
|
|
264
264
|
},
|
|
265
265
|
c
|
|
266
|
-
),
|
|
266
|
+
), h = {
|
|
267
267
|
...u,
|
|
268
|
-
href:
|
|
268
|
+
href: n ? void 0 : g,
|
|
269
269
|
target: l ? "_blank" : p,
|
|
270
270
|
rel: l ? "noopener noreferrer" : y
|
|
271
271
|
};
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
|
|
272
|
+
return /* @__PURE__ */ i("a", { className: d, ...h, children: [
|
|
273
|
+
f,
|
|
274
274
|
l && /* @__PURE__ */ e(
|
|
275
275
|
"svg",
|
|
276
276
|
{
|
|
@@ -301,34 +301,34 @@ const Xt = ({
|
|
|
301
301
|
};
|
|
302
302
|
function $e({
|
|
303
303
|
label: t,
|
|
304
|
-
onClick:
|
|
304
|
+
onClick: a,
|
|
305
305
|
variant: r = "primary",
|
|
306
|
-
size:
|
|
306
|
+
size: n = "md",
|
|
307
307
|
icon: s,
|
|
308
308
|
options: c,
|
|
309
|
-
disabled:
|
|
309
|
+
disabled: f = !1
|
|
310
310
|
}) {
|
|
311
|
-
const [g, p] = V(!1), y = X(null), u =
|
|
311
|
+
const [g, p] = V(!1), y = X(null), u = ne(() => {
|
|
312
312
|
p((l) => !l);
|
|
313
313
|
}, []);
|
|
314
314
|
return G(() => {
|
|
315
|
-
const l = (
|
|
316
|
-
y.current && !y.current.contains(
|
|
315
|
+
const l = (d) => {
|
|
316
|
+
y.current && !y.current.contains(d.target) && p(!1);
|
|
317
317
|
};
|
|
318
318
|
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
319
|
-
}, []), /* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */
|
|
319
|
+
}, []), /* @__PURE__ */ i("div", { ref: y, className: "relative inline-flex items-center gap-px", children: [
|
|
320
|
+
/* @__PURE__ */ i(
|
|
321
321
|
"button",
|
|
322
322
|
{
|
|
323
323
|
type: "button",
|
|
324
|
-
onClick:
|
|
325
|
-
disabled:
|
|
324
|
+
onClick: a,
|
|
325
|
+
disabled: f,
|
|
326
326
|
className: b(
|
|
327
327
|
"inline-flex items-center justify-center font-medium transition-colors duration-200",
|
|
328
328
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
329
329
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
330
330
|
Se[r],
|
|
331
|
-
Ye[
|
|
331
|
+
Ye[n],
|
|
332
332
|
"!rounded-r-none"
|
|
333
333
|
),
|
|
334
334
|
children: [
|
|
@@ -342,13 +342,13 @@ function $e({
|
|
|
342
342
|
{
|
|
343
343
|
type: "button",
|
|
344
344
|
onClick: u,
|
|
345
|
-
disabled:
|
|
345
|
+
disabled: f,
|
|
346
346
|
className: b(
|
|
347
347
|
"inline-flex items-center justify-center font-medium transition-colors duration-200",
|
|
348
348
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
349
349
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
350
350
|
Se[r],
|
|
351
|
-
|
|
351
|
+
n === "sm" ? "px-1.5 py-1.5" : "px-2 py-2",
|
|
352
352
|
"!rounded-l-none"
|
|
353
353
|
),
|
|
354
354
|
children: /* @__PURE__ */ e(_e, { className: "h-4 w-4" })
|
|
@@ -384,21 +384,21 @@ const Ze = {
|
|
|
384
384
|
}, ge = ce(
|
|
385
385
|
({
|
|
386
386
|
label: t,
|
|
387
|
-
helperText:
|
|
387
|
+
helperText: a,
|
|
388
388
|
error: r,
|
|
389
|
-
size:
|
|
389
|
+
size: n = "md",
|
|
390
390
|
indeterminate: s = !1,
|
|
391
391
|
containerClassName: c,
|
|
392
|
-
labelClassName:
|
|
392
|
+
labelClassName: f,
|
|
393
393
|
className: g,
|
|
394
394
|
id: p,
|
|
395
395
|
...y
|
|
396
396
|
}, u) => {
|
|
397
|
-
const l = p || `checkbox-${Math.random().toString(36).substr(2, 9)}`,
|
|
397
|
+
const l = p || `checkbox-${Math.random().toString(36).substr(2, 9)}`, d = !!r;
|
|
398
398
|
return se.useEffect(() => {
|
|
399
399
|
u && typeof u == "object" && u.current && (u.current.indeterminate = s);
|
|
400
|
-
}, [s, u]), /* @__PURE__ */
|
|
401
|
-
/* @__PURE__ */
|
|
400
|
+
}, [s, u]), /* @__PURE__ */ i("div", { className: b("flex flex-col", c), children: [
|
|
401
|
+
/* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
402
402
|
/* @__PURE__ */ e("div", { className: "flex items-center h-5", children: /* @__PURE__ */ e(
|
|
403
403
|
"input",
|
|
404
404
|
{
|
|
@@ -411,29 +411,29 @@ const Ze = {
|
|
|
411
411
|
"focus:ring-2 focus:ring-offset-2 focus:outline-none",
|
|
412
412
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
413
413
|
// Size styles
|
|
414
|
-
Ze[
|
|
414
|
+
Ze[n],
|
|
415
415
|
// State styles
|
|
416
|
-
|
|
416
|
+
d ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-primary focus:border-primary focus:ring-primary",
|
|
417
417
|
g
|
|
418
418
|
),
|
|
419
419
|
...y
|
|
420
420
|
}
|
|
421
421
|
) }),
|
|
422
|
-
t && /* @__PURE__ */
|
|
422
|
+
t && /* @__PURE__ */ i("div", { className: "ml-3 flex-1", children: [
|
|
423
423
|
/* @__PURE__ */ e(
|
|
424
424
|
"label",
|
|
425
425
|
{
|
|
426
426
|
htmlFor: l,
|
|
427
427
|
className: b(
|
|
428
428
|
"font-medium cursor-pointer",
|
|
429
|
-
|
|
430
|
-
Xe[
|
|
431
|
-
|
|
429
|
+
d ? "text-error" : "text-default",
|
|
430
|
+
Xe[n],
|
|
431
|
+
f
|
|
432
432
|
),
|
|
433
433
|
children: t
|
|
434
434
|
}
|
|
435
435
|
),
|
|
436
|
-
|
|
436
|
+
a && !r && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-muted", children: a })
|
|
437
437
|
] })
|
|
438
438
|
] }),
|
|
439
439
|
r && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-error", children: r })
|
|
@@ -443,26 +443,26 @@ const Ze = {
|
|
|
443
443
|
ge.displayName = "Checkbox";
|
|
444
444
|
const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }), ye = ce(({
|
|
445
445
|
value: t,
|
|
446
|
-
onChange:
|
|
446
|
+
onChange: a,
|
|
447
447
|
placeholder: r = "Select date",
|
|
448
|
-
disabled:
|
|
448
|
+
disabled: n = !1,
|
|
449
449
|
required: s = !1,
|
|
450
450
|
size: c = "md",
|
|
451
|
-
className:
|
|
451
|
+
className: f,
|
|
452
452
|
minDate: g,
|
|
453
453
|
maxDate: p,
|
|
454
454
|
format: y = "MM/dd/yyyy"
|
|
455
455
|
}, u) => {
|
|
456
|
-
const [l,
|
|
456
|
+
const [l, d] = V(!1), [h, C] = V(() => t || /* @__PURE__ */ new Date()), w = X(null);
|
|
457
457
|
G(() => {
|
|
458
458
|
const z = (v) => {
|
|
459
|
-
|
|
459
|
+
w.current && !w.current.contains(v.target) && d(!1);
|
|
460
460
|
};
|
|
461
461
|
return l && document.addEventListener("mousedown", z), () => {
|
|
462
462
|
document.removeEventListener("mousedown", z);
|
|
463
463
|
};
|
|
464
464
|
}, [l]);
|
|
465
|
-
const
|
|
465
|
+
const N = (z) => {
|
|
466
466
|
if (!z) return "";
|
|
467
467
|
const v = z.getDate().toString().padStart(2, "0"), T = (z.getMonth() + 1).toString().padStart(2, "0"), m = z.getFullYear();
|
|
468
468
|
switch (y) {
|
|
@@ -475,33 +475,33 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
475
475
|
return `${T}/${v}/${m}`;
|
|
476
476
|
}
|
|
477
477
|
}, B = () => {
|
|
478
|
-
const z =
|
|
478
|
+
const z = h.getFullYear(), v = h.getMonth(), T = new Date(z, v, 1), m = new Date(T);
|
|
479
479
|
m.setDate(m.getDate() - T.getDay());
|
|
480
480
|
const $ = [], L = new Date(m);
|
|
481
481
|
for (let D = 0; D < 42; D++)
|
|
482
482
|
$.push(new Date(L)), L.setDate(L.getDate() + 1);
|
|
483
483
|
return $;
|
|
484
484
|
}, x = (z) => {
|
|
485
|
-
z.getMonth() ===
|
|
485
|
+
z.getMonth() === h.getMonth() && (g && z < g || p && z > p || (a?.(z), d(!1)));
|
|
486
486
|
}, q = () => {
|
|
487
|
-
C(new Date(
|
|
487
|
+
C(new Date(h.getFullYear(), h.getMonth() - 1, 1));
|
|
488
488
|
}, K = () => {
|
|
489
|
-
C(new Date(
|
|
489
|
+
C(new Date(h.getFullYear(), h.getMonth() + 1, 1));
|
|
490
490
|
}, H = () => {
|
|
491
|
-
|
|
491
|
+
a?.(null), d(!1);
|
|
492
492
|
}, F = b(
|
|
493
|
-
"w-full border border-neutral
|
|
494
|
-
"bg-
|
|
495
|
-
"placeholder:text-
|
|
493
|
+
"w-full border border-neutral rounded-md transition-colors duration-200",
|
|
494
|
+
"bg-module text-default",
|
|
495
|
+
"placeholder:text-default dark:placeholder:text-muted",
|
|
496
496
|
"focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
|
|
497
|
-
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-
|
|
497
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-module-subtle",
|
|
498
498
|
{
|
|
499
499
|
"px-3 py-2 text-sm": c === "sm",
|
|
500
500
|
"px-3 py-2 text-base": c === "md",
|
|
501
501
|
"px-4 py-3 text-lg": c === "lg",
|
|
502
502
|
"px-4 py-3 text-base": c === "full"
|
|
503
503
|
},
|
|
504
|
-
|
|
504
|
+
f
|
|
505
505
|
), E = B(), J = [
|
|
506
506
|
"January",
|
|
507
507
|
"February",
|
|
@@ -516,19 +516,19 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
516
516
|
"November",
|
|
517
517
|
"December"
|
|
518
518
|
];
|
|
519
|
-
return /* @__PURE__ */
|
|
520
|
-
/* @__PURE__ */
|
|
519
|
+
return /* @__PURE__ */ i("div", { ref: w, className: "relative", children: [
|
|
520
|
+
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
521
521
|
/* @__PURE__ */ e(
|
|
522
522
|
"input",
|
|
523
523
|
{
|
|
524
524
|
ref: u,
|
|
525
525
|
type: "text",
|
|
526
|
-
value:
|
|
526
|
+
value: N(t ?? null),
|
|
527
527
|
placeholder: r,
|
|
528
|
-
disabled:
|
|
528
|
+
disabled: n,
|
|
529
529
|
required: s,
|
|
530
530
|
readOnly: !0,
|
|
531
|
-
onClick: () => !
|
|
531
|
+
onClick: () => !n && d(!l),
|
|
532
532
|
className: b(F, "pr-10 cursor-pointer")
|
|
533
533
|
}
|
|
534
534
|
),
|
|
@@ -536,40 +536,40 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
536
536
|
"button",
|
|
537
537
|
{
|
|
538
538
|
type: "button",
|
|
539
|
-
onClick: () => !
|
|
540
|
-
disabled:
|
|
541
|
-
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-
|
|
539
|
+
onClick: () => !n && d(!l),
|
|
540
|
+
disabled: n,
|
|
541
|
+
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted hover:text-muted",
|
|
542
542
|
children: /* @__PURE__ */ e(Qe, {})
|
|
543
543
|
}
|
|
544
544
|
)
|
|
545
545
|
] }),
|
|
546
|
-
l && /* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
546
|
+
l && /* @__PURE__ */ i("div", { className: "absolute z-50 mt-1 bg-module border border-neutral rounded-md shadow-lg p-4 min-w-[280px]", children: [
|
|
547
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
548
548
|
/* @__PURE__ */ e(
|
|
549
549
|
"button",
|
|
550
550
|
{
|
|
551
551
|
onClick: q,
|
|
552
|
-
className: "p-1 hover:bg-neutral-
|
|
552
|
+
className: "p-1 hover:bg-neutral-container rounded",
|
|
553
553
|
children: /* @__PURE__ */ e(et, {})
|
|
554
554
|
}
|
|
555
555
|
),
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
J[
|
|
556
|
+
/* @__PURE__ */ i("h3", { className: "text-sm font-medium text-default", children: [
|
|
557
|
+
J[h.getMonth()],
|
|
558
558
|
" ",
|
|
559
|
-
|
|
559
|
+
h.getFullYear()
|
|
560
560
|
] }),
|
|
561
561
|
/* @__PURE__ */ e(
|
|
562
562
|
"button",
|
|
563
563
|
{
|
|
564
564
|
onClick: K,
|
|
565
|
-
className: "p-1 hover:bg-neutral-
|
|
565
|
+
className: "p-1 hover:bg-neutral-container rounded",
|
|
566
566
|
children: /* @__PURE__ */ e(tt, {})
|
|
567
567
|
}
|
|
568
568
|
)
|
|
569
569
|
] }),
|
|
570
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((z) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-
|
|
570
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((z) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted text-center py-1", children: z }, z)) }),
|
|
571
571
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: E.map((z, v) => {
|
|
572
|
-
const T = z.getMonth() ===
|
|
572
|
+
const T = z.getMonth() === h.getMonth(), m = t && z.toDateString() === t.toDateString(), $ = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), L = !T || g && z < g || p && z > p;
|
|
573
573
|
return /* @__PURE__ */ e(
|
|
574
574
|
"button",
|
|
575
575
|
{
|
|
@@ -578,10 +578,10 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
578
578
|
className: b(
|
|
579
579
|
"w-8 h-8 text-sm rounded transition-colors duration-200",
|
|
580
580
|
{
|
|
581
|
-
"text-
|
|
581
|
+
"text-default hover:bg-neutral-container": T && !m && !L,
|
|
582
582
|
"bg-primary text-white": m,
|
|
583
|
-
"bg-neutral-
|
|
584
|
-
"text-
|
|
583
|
+
"bg-neutral-container text-default": $ && !m,
|
|
584
|
+
"text-muted cursor-not-allowed": L
|
|
585
585
|
}
|
|
586
586
|
),
|
|
587
587
|
children: z.getDate()
|
|
@@ -589,19 +589,19 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
589
589
|
v
|
|
590
590
|
);
|
|
591
591
|
}) }),
|
|
592
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ i("div", { className: "flex justify-between items-center mt-4 pt-3 border-t border-neutral", children: [
|
|
593
593
|
/* @__PURE__ */ e(
|
|
594
594
|
"button",
|
|
595
595
|
{
|
|
596
596
|
onClick: H,
|
|
597
|
-
className: "text-sm text-
|
|
597
|
+
className: "text-sm text-muted hover:text-default",
|
|
598
598
|
children: "Clear"
|
|
599
599
|
}
|
|
600
600
|
),
|
|
601
601
|
/* @__PURE__ */ e(
|
|
602
602
|
"button",
|
|
603
603
|
{
|
|
604
|
-
onClick: () =>
|
|
604
|
+
onClick: () => d(!1),
|
|
605
605
|
className: "text-sm text-primary hover:text-primary/80",
|
|
606
606
|
children: "Close"
|
|
607
607
|
}
|
|
@@ -609,7 +609,7 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
609
609
|
] })
|
|
610
610
|
] })
|
|
611
611
|
] });
|
|
612
|
-
}),
|
|
612
|
+
}), ie = (...t) => t.filter(Boolean).join(" "), rt = (t) => /* @__PURE__ */ e(
|
|
613
613
|
"svg",
|
|
614
614
|
{
|
|
615
615
|
...t,
|
|
@@ -627,7 +627,7 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
627
627
|
}
|
|
628
628
|
)
|
|
629
629
|
}
|
|
630
|
-
),
|
|
630
|
+
), nt = (t) => /* @__PURE__ */ e(
|
|
631
631
|
"svg",
|
|
632
632
|
{
|
|
633
633
|
...t,
|
|
@@ -645,7 +645,7 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
645
645
|
}
|
|
646
646
|
)
|
|
647
647
|
}
|
|
648
|
-
),
|
|
648
|
+
), at = {
|
|
649
649
|
sm: "px-3 py-1.5 text-sm",
|
|
650
650
|
md: "px-3 py-2 text-sm",
|
|
651
651
|
lg: "px-3 py-2 text-sm",
|
|
@@ -658,29 +658,29 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
658
658
|
}, lt = ce(
|
|
659
659
|
({
|
|
660
660
|
label: t,
|
|
661
|
-
helperText:
|
|
661
|
+
helperText: a,
|
|
662
662
|
error: r,
|
|
663
|
-
size:
|
|
663
|
+
size: n = "md",
|
|
664
664
|
fullWidth: s = !1,
|
|
665
665
|
startIcon: c = /* @__PURE__ */ e(rt, {}),
|
|
666
|
-
loading:
|
|
666
|
+
loading: f = !1,
|
|
667
667
|
containerClassName: g,
|
|
668
668
|
labelClassName: p,
|
|
669
669
|
className: y,
|
|
670
670
|
id: u,
|
|
671
671
|
options: l,
|
|
672
|
-
onRemoteSearch:
|
|
673
|
-
onSelect:
|
|
672
|
+
onRemoteSearch: d,
|
|
673
|
+
onSelect: h,
|
|
674
674
|
debounceTime: C = 500,
|
|
675
|
-
value:
|
|
676
|
-
onChange:
|
|
675
|
+
value: w,
|
|
676
|
+
onChange: N,
|
|
677
677
|
...B
|
|
678
678
|
}, x) => {
|
|
679
|
-
const q = u || `searchfield-${Math.random().toString(36).substr(2, 9)}`, K = !!r, H = X(null), F = X(null), [E, J] = V(
|
|
679
|
+
const q = u || `searchfield-${Math.random().toString(36).substr(2, 9)}`, K = !!r, H = X(null), F = X(null), [E, J] = V(w || ""), [z, v] = V(!1), [T, m] = V(!1);
|
|
680
680
|
G(() => {
|
|
681
|
-
|
|
682
|
-
}, [
|
|
683
|
-
const $ =
|
|
681
|
+
w !== void 0 && J(w);
|
|
682
|
+
}, [w]);
|
|
683
|
+
const $ = de(() => {
|
|
684
684
|
if (!E) return l;
|
|
685
685
|
const W = String(E).toLowerCase();
|
|
686
686
|
return l.filter(
|
|
@@ -688,14 +688,14 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
688
688
|
);
|
|
689
689
|
}, [E, l]);
|
|
690
690
|
G(() => {
|
|
691
|
-
if (!
|
|
691
|
+
if (!d || !E) {
|
|
692
692
|
m(!1);
|
|
693
693
|
return;
|
|
694
694
|
}
|
|
695
695
|
const W = setTimeout(async () => {
|
|
696
696
|
m(!0);
|
|
697
697
|
try {
|
|
698
|
-
await
|
|
698
|
+
await d(String(E));
|
|
699
699
|
} catch (S) {
|
|
700
700
|
console.error("Remote search failed:", S);
|
|
701
701
|
} finally {
|
|
@@ -705,7 +705,7 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
705
705
|
return () => {
|
|
706
706
|
clearTimeout(W), m(!1);
|
|
707
707
|
};
|
|
708
|
-
}, [E, C,
|
|
708
|
+
}, [E, C, d]), G(() => {
|
|
709
709
|
const W = (S) => {
|
|
710
710
|
H.current && !H.current.contains(S.target) && v(!1);
|
|
711
711
|
};
|
|
@@ -713,16 +713,16 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
713
713
|
}, []);
|
|
714
714
|
const L = (W) => {
|
|
715
715
|
const S = W.target.value;
|
|
716
|
-
J(S), v(!0),
|
|
716
|
+
J(S), v(!0), N && N(W);
|
|
717
717
|
}, D = (W) => {
|
|
718
|
-
J(W.label), v(!1),
|
|
718
|
+
J(W.label), v(!1), h && h(W.value);
|
|
719
719
|
}, P = () => {
|
|
720
|
-
(l.length > 0 ||
|
|
721
|
-
}, M =
|
|
722
|
-
return /* @__PURE__ */
|
|
720
|
+
(l.length > 0 || d) && v(!0);
|
|
721
|
+
}, M = f || T, te = z && ($.length > 0 || M), ae = de(() => x || F, [x]);
|
|
722
|
+
return /* @__PURE__ */ i(
|
|
723
723
|
"div",
|
|
724
724
|
{
|
|
725
|
-
className:
|
|
725
|
+
className: ie(
|
|
726
726
|
"flex flex-col",
|
|
727
727
|
s ? "w-full" : "",
|
|
728
728
|
g || "",
|
|
@@ -734,48 +734,48 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
734
734
|
"label",
|
|
735
735
|
{
|
|
736
736
|
htmlFor: q,
|
|
737
|
-
className:
|
|
737
|
+
className: ie(
|
|
738
738
|
"block text-sm font-medium mb-1",
|
|
739
|
-
K ? "text-
|
|
739
|
+
K ? "text-error" : "text-default",
|
|
740
740
|
p || ""
|
|
741
741
|
),
|
|
742
742
|
children: t
|
|
743
743
|
}
|
|
744
744
|
),
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
c && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className:
|
|
745
|
+
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
746
|
+
c && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: ie("text-muted", xe[n]), children: c }) }),
|
|
747
747
|
/* @__PURE__ */ e(
|
|
748
748
|
"input",
|
|
749
749
|
{
|
|
750
|
-
ref:
|
|
750
|
+
ref: ae,
|
|
751
751
|
id: q,
|
|
752
752
|
value: E,
|
|
753
753
|
onChange: L,
|
|
754
754
|
onFocus: P,
|
|
755
|
-
className:
|
|
755
|
+
className: ie(
|
|
756
756
|
// Base styles
|
|
757
|
-
"block w-full rounded-lg border
|
|
758
|
-
"placeholder
|
|
757
|
+
"block w-full rounded-lg border transition-colors duration-200",
|
|
758
|
+
"placeholder:text-[var(--text-muted)] focus:outline-none",
|
|
759
759
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
760
760
|
// Size styles
|
|
761
|
-
|
|
761
|
+
at[n],
|
|
762
762
|
// Icon padding
|
|
763
763
|
c ? "pl-10" : "",
|
|
764
764
|
"pr-10",
|
|
765
765
|
// Altijd padding rechts voor de dropdown/loading icon
|
|
766
766
|
// State styles
|
|
767
|
-
K ? "border-red-500 text-
|
|
767
|
+
K ? "border-red-500 text-error focus:border-red-500 focus:ring-red-500" : "border-neutral text-default",
|
|
768
768
|
y || ""
|
|
769
769
|
),
|
|
770
770
|
...B
|
|
771
771
|
}
|
|
772
772
|
),
|
|
773
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: M ||
|
|
773
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: M || f ? (
|
|
774
774
|
// Loading Spinner
|
|
775
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ i(
|
|
776
776
|
"svg",
|
|
777
777
|
{
|
|
778
|
-
className:
|
|
778
|
+
className: ie("animate-spin text-link", xe[n]),
|
|
779
779
|
xmlns: "http://www.w3.org/2000/svg",
|
|
780
780
|
fill: "none",
|
|
781
781
|
viewBox: "0 0 24 24",
|
|
@@ -805,11 +805,11 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
805
805
|
) : (
|
|
806
806
|
// Dropdown Chevron
|
|
807
807
|
/* @__PURE__ */ e(
|
|
808
|
-
|
|
808
|
+
nt,
|
|
809
809
|
{
|
|
810
|
-
className:
|
|
811
|
-
"text-
|
|
812
|
-
xe[
|
|
810
|
+
className: ie(
|
|
811
|
+
"text-muted cursor-pointer transition-transform",
|
|
812
|
+
xe[n],
|
|
813
813
|
z ? "rotate-180" : "rotate-0"
|
|
814
814
|
),
|
|
815
815
|
onClick: () => v((W) => !W)
|
|
@@ -820,32 +820,32 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
820
820
|
te && /* @__PURE__ */ e(
|
|
821
821
|
"ul",
|
|
822
822
|
{
|
|
823
|
-
className: "absolute z-10 mt-1 w-full bg-
|
|
823
|
+
className: "absolute z-10 mt-1 w-full bg-module border border-neutral rounded-lg shadow-lg max-h-60 overflow-auto top-full",
|
|
824
824
|
role: "listbox",
|
|
825
825
|
children: $.length > 0 ? $.map((W) => /* @__PURE__ */ e(
|
|
826
826
|
"li",
|
|
827
827
|
{
|
|
828
|
-
className: "px-4 py-2 cursor-pointer text-
|
|
828
|
+
className: "px-4 py-2 cursor-pointer text-default hover:bg-accent-container hover:text-accent transition-colors",
|
|
829
829
|
onClick: () => D(W),
|
|
830
830
|
role: "option",
|
|
831
831
|
"aria-selected": E === W.label,
|
|
832
832
|
children: W.label
|
|
833
833
|
},
|
|
834
834
|
W.value
|
|
835
|
-
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-
|
|
835
|
+
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-muted", children: M || f ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
|
|
836
836
|
}
|
|
837
837
|
),
|
|
838
|
-
(r ||
|
|
838
|
+
(r || a) && /* @__PURE__ */ e(
|
|
839
839
|
"p",
|
|
840
840
|
{
|
|
841
|
-
className:
|
|
841
|
+
className: ie(
|
|
842
842
|
"mt-1 text-xs",
|
|
843
|
-
K ? "text-
|
|
843
|
+
K ? "text-error" : "text-muted"
|
|
844
844
|
),
|
|
845
|
-
children: r ||
|
|
845
|
+
children: r || a
|
|
846
846
|
}
|
|
847
847
|
),
|
|
848
|
-
|
|
848
|
+
d && /* @__PURE__ */ i("p", { className: "mt-2 text-xs text-success dark:text-success", children: [
|
|
849
849
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
850
850
|
String(E)
|
|
851
851
|
] })
|
|
@@ -863,22 +863,22 @@ const st = {
|
|
|
863
863
|
}, me = (t) => t.trim().toLowerCase(), ve = ce(
|
|
864
864
|
({
|
|
865
865
|
label: t,
|
|
866
|
-
helperText:
|
|
866
|
+
helperText: a,
|
|
867
867
|
error: r,
|
|
868
|
-
size:
|
|
868
|
+
size: n = "md",
|
|
869
869
|
fullWidth: s = !1,
|
|
870
870
|
options: c,
|
|
871
|
-
placeholder:
|
|
871
|
+
placeholder: f,
|
|
872
872
|
containerClassName: g,
|
|
873
873
|
labelClassName: p,
|
|
874
874
|
className: y,
|
|
875
875
|
id: u,
|
|
876
876
|
searchable: l,
|
|
877
|
-
multiple:
|
|
878
|
-
value:
|
|
877
|
+
multiple: d,
|
|
878
|
+
value: h,
|
|
879
879
|
onChange: C,
|
|
880
|
-
allowCreate:
|
|
881
|
-
onCreateOption:
|
|
880
|
+
allowCreate: w,
|
|
881
|
+
onCreateOption: N,
|
|
882
882
|
...B
|
|
883
883
|
}, x) => {
|
|
884
884
|
const q = u || `select-${Math.random().toString(36).substr(2, 9)}`, K = !!r, [H, F] = se.useState(!1), [E, J] = se.useState(""), z = se.useRef(null), [v, T] = se.useState(c);
|
|
@@ -908,33 +908,33 @@ const st = {
|
|
|
908
908
|
const I = [...c];
|
|
909
909
|
return S.forEach((O) => {
|
|
910
910
|
!m(I, O.value) && !m(I, O.label) && I.push(O);
|
|
911
|
-
}), $(I,
|
|
911
|
+
}), $(I, h);
|
|
912
912
|
});
|
|
913
|
-
}, [c,
|
|
913
|
+
}, [c, h, $, m]);
|
|
914
914
|
const L = (S) => {
|
|
915
|
-
if (
|
|
916
|
-
const I = Array.isArray(
|
|
915
|
+
if (d) {
|
|
916
|
+
const I = Array.isArray(h) ? h : [], O = I.includes(S) ? I.filter((A) => A !== S) : [...I, S];
|
|
917
917
|
C?.(O);
|
|
918
918
|
} else
|
|
919
919
|
C?.(S), F(!1), J("");
|
|
920
|
-
}, D =
|
|
921
|
-
(S) => Array.isArray(
|
|
920
|
+
}, D = d ? null : v.find((S) => S.value === h), P = d ? v.filter(
|
|
921
|
+
(S) => Array.isArray(h) && h.includes(S.value)
|
|
922
922
|
) : [], M = l && E ? v.filter(
|
|
923
923
|
(S) => S.label.toLowerCase().includes(E.toLowerCase())
|
|
924
|
-
) : v, te = !!
|
|
924
|
+
) : v, te = !!w && !!l && !!E.trim() && !m(v, E), ae = (S) => {
|
|
925
925
|
const I = S.trim();
|
|
926
926
|
if (!I) return;
|
|
927
|
-
const O =
|
|
927
|
+
const O = N?.(I) ?? {
|
|
928
928
|
value: I,
|
|
929
929
|
label: I
|
|
930
930
|
};
|
|
931
931
|
if (m(v, O.value) || m(v, O.label)) {
|
|
932
|
-
L(O.value), J(""),
|
|
932
|
+
L(O.value), J(""), d || F(!1);
|
|
933
933
|
return;
|
|
934
934
|
}
|
|
935
|
-
T((A) => [...A, O]), L(O.value), J(""),
|
|
936
|
-
}, W = () =>
|
|
937
|
-
return /* @__PURE__ */
|
|
935
|
+
T((A) => [...A, O]), L(O.value), J(""), d || F(!1);
|
|
936
|
+
}, W = () => d ? P.length > 0 ? P.map((S) => S.label).join(", ") : f || "Select options" : D?.label || f || "Select an option";
|
|
937
|
+
return /* @__PURE__ */ i(
|
|
938
938
|
"div",
|
|
939
939
|
{
|
|
940
940
|
ref: z,
|
|
@@ -952,13 +952,13 @@ const st = {
|
|
|
952
952
|
onClick: () => F(!H),
|
|
953
953
|
className: b(
|
|
954
954
|
"block text-sm font-medium mb-1",
|
|
955
|
-
K ? "text-error" : "text-
|
|
955
|
+
K ? "text-error" : "text-default",
|
|
956
956
|
p
|
|
957
957
|
),
|
|
958
958
|
children: t
|
|
959
959
|
}
|
|
960
960
|
),
|
|
961
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
962
962
|
/* @__PURE__ */ e(
|
|
963
963
|
"button",
|
|
964
964
|
{
|
|
@@ -969,15 +969,15 @@ const st = {
|
|
|
969
969
|
"block w-full rounded-lg border transition-colors duration-200 text-left",
|
|
970
970
|
"focus:outline-none focus:ring-0 focus:ring-offset-0",
|
|
971
971
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
972
|
-
"bg-
|
|
973
|
-
st[
|
|
974
|
-
K ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-
|
|
972
|
+
"bg-module",
|
|
973
|
+
st[n],
|
|
974
|
+
K ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
|
|
975
975
|
y
|
|
976
976
|
),
|
|
977
977
|
children: /* @__PURE__ */ e("span", { className: "block truncate", children: W() })
|
|
978
978
|
}
|
|
979
979
|
),
|
|
980
|
-
H && /* @__PURE__ */
|
|
980
|
+
H && /* @__PURE__ */ i("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-module shadow-lg border border-neutral", children: [
|
|
981
981
|
l && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
982
982
|
"input",
|
|
983
983
|
{
|
|
@@ -986,22 +986,22 @@ const st = {
|
|
|
986
986
|
value: E,
|
|
987
987
|
onChange: (S) => J(S.target.value),
|
|
988
988
|
onKeyDown: (S) => {
|
|
989
|
-
S.key === "Enter" && te && (S.preventDefault(),
|
|
989
|
+
S.key === "Enter" && te && (S.preventDefault(), ae(E));
|
|
990
990
|
},
|
|
991
991
|
className: b(
|
|
992
992
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
993
|
-
"text-
|
|
993
|
+
"text-default border-neutral focus:outline-none focus:ring-0"
|
|
994
994
|
)
|
|
995
995
|
}
|
|
996
996
|
) }),
|
|
997
|
-
te && /* @__PURE__ */
|
|
997
|
+
te && /* @__PURE__ */ i(
|
|
998
998
|
"div",
|
|
999
999
|
{
|
|
1000
1000
|
className: b(
|
|
1001
1001
|
"px-4 py-2 text-sm cursor-pointer",
|
|
1002
|
-
"text-primary hover:bg-
|
|
1002
|
+
"text-primary hover:bg-neutral-container"
|
|
1003
1003
|
),
|
|
1004
|
-
onClick: () =>
|
|
1004
|
+
onClick: () => ae(E),
|
|
1005
1005
|
children: [
|
|
1006
1006
|
"+: “",
|
|
1007
1007
|
E.trim(),
|
|
@@ -1009,37 +1009,37 @@ const st = {
|
|
|
1009
1009
|
]
|
|
1010
1010
|
}
|
|
1011
1011
|
),
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
-
|
|
1012
|
+
/* @__PURE__ */ i("ul", { className: "max-h-60 overflow-auto py-1", children: [
|
|
1013
|
+
f && !d && /* @__PURE__ */ e(
|
|
1014
1014
|
"li",
|
|
1015
1015
|
{
|
|
1016
|
-
className: "px-4 py-2 text-sm text-
|
|
1016
|
+
className: "px-4 py-2 text-sm text-muted cursor-pointer hover:bg-neutral-container",
|
|
1017
1017
|
onClick: () => {
|
|
1018
1018
|
C?.(""), F(!1);
|
|
1019
1019
|
},
|
|
1020
|
-
children:
|
|
1020
|
+
children: f
|
|
1021
1021
|
}
|
|
1022
1022
|
),
|
|
1023
1023
|
M.map((S) => {
|
|
1024
|
-
const I =
|
|
1024
|
+
const I = d ? Array.isArray(h) && h.includes(S.value) : h === S.value;
|
|
1025
1025
|
return /* @__PURE__ */ e(
|
|
1026
1026
|
"li",
|
|
1027
1027
|
{
|
|
1028
1028
|
onClick: () => !S.disabled && L(S.value),
|
|
1029
1029
|
className: b(
|
|
1030
1030
|
"px-4 py-2 text-sm cursor-pointer",
|
|
1031
|
-
"text-
|
|
1032
|
-
S.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-
|
|
1031
|
+
"text-default",
|
|
1032
|
+
S.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-neutral-container",
|
|
1033
1033
|
I && "font-semibold"
|
|
1034
1034
|
),
|
|
1035
|
-
children: /* @__PURE__ */
|
|
1036
|
-
|
|
1035
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1036
|
+
d && /* @__PURE__ */ e(
|
|
1037
1037
|
"input",
|
|
1038
1038
|
{
|
|
1039
1039
|
type: "checkbox",
|
|
1040
1040
|
checked: I,
|
|
1041
1041
|
readOnly: !0,
|
|
1042
|
-
className: "mr-3 h-4 w-4 rounded border-
|
|
1042
|
+
className: "mr-3 h-4 w-4 rounded border-neutral text-primary focus:ring-primary"
|
|
1043
1043
|
}
|
|
1044
1044
|
),
|
|
1045
1045
|
/* @__PURE__ */ e("span", { children: S.label })
|
|
@@ -1051,14 +1051,14 @@ const st = {
|
|
|
1051
1051
|
] })
|
|
1052
1052
|
] })
|
|
1053
1053
|
] }),
|
|
1054
|
-
(r ||
|
|
1054
|
+
(r || a) && /* @__PURE__ */ e(
|
|
1055
1055
|
"p",
|
|
1056
1056
|
{
|
|
1057
1057
|
className: b(
|
|
1058
1058
|
"mt-1 text-xs",
|
|
1059
|
-
K ? "text-error" : "text-
|
|
1059
|
+
K ? "text-error" : "text-muted"
|
|
1060
1060
|
),
|
|
1061
|
-
children: r ||
|
|
1061
|
+
children: r || a
|
|
1062
1062
|
}
|
|
1063
1063
|
)
|
|
1064
1064
|
]
|
|
@@ -1072,60 +1072,60 @@ const ot = {
|
|
|
1072
1072
|
md: "px-3 py-2 text-sm",
|
|
1073
1073
|
lg: "px-4 py-3 text-base",
|
|
1074
1074
|
full: "px-4 py-3 text-base"
|
|
1075
|
-
},
|
|
1075
|
+
}, Ne = ce(
|
|
1076
1076
|
({
|
|
1077
1077
|
label: t,
|
|
1078
|
-
helperText:
|
|
1078
|
+
helperText: a,
|
|
1079
1079
|
error: r,
|
|
1080
|
-
size:
|
|
1080
|
+
size: n = "md",
|
|
1081
1081
|
fullWidth: s = !1,
|
|
1082
1082
|
loading: c = !1,
|
|
1083
|
-
containerClassName:
|
|
1083
|
+
containerClassName: f,
|
|
1084
1084
|
labelClassName: g,
|
|
1085
1085
|
className: p,
|
|
1086
1086
|
id: y,
|
|
1087
1087
|
rows: u = 4,
|
|
1088
1088
|
...l
|
|
1089
|
-
},
|
|
1090
|
-
const
|
|
1091
|
-
return /* @__PURE__ */
|
|
1089
|
+
}, d) => {
|
|
1090
|
+
const h = y || `textarea-${Math.random().toString(36).substr(2, 9)}`, C = !!r;
|
|
1091
|
+
return /* @__PURE__ */ i("div", { className: b("flex flex-col", s && "w-full", f), children: [
|
|
1092
1092
|
t && /* @__PURE__ */ e(
|
|
1093
1093
|
"label",
|
|
1094
1094
|
{
|
|
1095
|
-
htmlFor:
|
|
1095
|
+
htmlFor: h,
|
|
1096
1096
|
className: b(
|
|
1097
1097
|
"block text-sm font-medium mb-1",
|
|
1098
|
-
C ? "text-error" : "text-
|
|
1098
|
+
C ? "text-error" : "text-default",
|
|
1099
1099
|
g
|
|
1100
1100
|
),
|
|
1101
1101
|
children: t
|
|
1102
1102
|
}
|
|
1103
1103
|
),
|
|
1104
|
-
/* @__PURE__ */
|
|
1104
|
+
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1105
1105
|
/* @__PURE__ */ e(
|
|
1106
1106
|
"textarea",
|
|
1107
1107
|
{
|
|
1108
|
-
ref:
|
|
1109
|
-
id:
|
|
1108
|
+
ref: d,
|
|
1109
|
+
id: h,
|
|
1110
1110
|
rows: u,
|
|
1111
1111
|
className: b(
|
|
1112
1112
|
// Base styles
|
|
1113
1113
|
"block w-full rounded-lg border transition-colors duration-200 resize-vertical",
|
|
1114
|
-
"placeholder-
|
|
1114
|
+
"placeholder:text-[var(--text-muted)] focus:outline-none focus:ring-0",
|
|
1115
1115
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1116
1116
|
// Size styles
|
|
1117
|
-
ot[
|
|
1117
|
+
ot[n],
|
|
1118
1118
|
// State styles
|
|
1119
|
-
C ? "border-error text-error focus:border-error focus:ring-error" : "border-
|
|
1119
|
+
C ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
|
|
1120
1120
|
p
|
|
1121
1121
|
),
|
|
1122
1122
|
...l
|
|
1123
1123
|
}
|
|
1124
1124
|
),
|
|
1125
|
-
c && /* @__PURE__ */ e("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */
|
|
1125
|
+
c && /* @__PURE__ */ e("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ i(
|
|
1126
1126
|
"svg",
|
|
1127
1127
|
{
|
|
1128
|
-
className: "animate-spin h-4 w-4 text-
|
|
1128
|
+
className: "animate-spin h-4 w-4 text-muted",
|
|
1129
1129
|
fill: "none",
|
|
1130
1130
|
viewBox: "0 0 24 24",
|
|
1131
1131
|
children: [
|
|
@@ -1152,20 +1152,20 @@ const ot = {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
) })
|
|
1154
1154
|
] }),
|
|
1155
|
-
(r ||
|
|
1155
|
+
(r || a) && /* @__PURE__ */ e(
|
|
1156
1156
|
"p",
|
|
1157
1157
|
{
|
|
1158
1158
|
className: b(
|
|
1159
1159
|
"mt-1 text-xs",
|
|
1160
|
-
C ? "text-error" : "text-
|
|
1160
|
+
C ? "text-error" : "text-muted"
|
|
1161
1161
|
),
|
|
1162
|
-
children: r ||
|
|
1162
|
+
children: r || a
|
|
1163
1163
|
}
|
|
1164
1164
|
)
|
|
1165
1165
|
] });
|
|
1166
1166
|
}
|
|
1167
1167
|
);
|
|
1168
|
-
|
|
1168
|
+
Ne.displayName = "TextArea";
|
|
1169
1169
|
const ct = {
|
|
1170
1170
|
sm: "px-3 py-1.5 text-sm",
|
|
1171
1171
|
md: "px-3 py-2 text-sm",
|
|
@@ -1179,62 +1179,62 @@ const ct = {
|
|
|
1179
1179
|
}, ue = ce(
|
|
1180
1180
|
({
|
|
1181
1181
|
label: t,
|
|
1182
|
-
helperText:
|
|
1182
|
+
helperText: a,
|
|
1183
1183
|
error: r,
|
|
1184
|
-
size:
|
|
1184
|
+
size: n = "md",
|
|
1185
1185
|
fullWidth: s = !1,
|
|
1186
1186
|
startIcon: c,
|
|
1187
|
-
endIcon:
|
|
1187
|
+
endIcon: f,
|
|
1188
1188
|
loading: g = !1,
|
|
1189
1189
|
containerClassName: p,
|
|
1190
1190
|
labelClassName: y,
|
|
1191
1191
|
className: u,
|
|
1192
1192
|
id: l,
|
|
1193
|
-
...
|
|
1194
|
-
},
|
|
1195
|
-
const C = l || `textfield-${Math.random().toString(36).substr(2, 9)}`,
|
|
1196
|
-
return /* @__PURE__ */
|
|
1193
|
+
...d
|
|
1194
|
+
}, h) => {
|
|
1195
|
+
const C = l || `textfield-${Math.random().toString(36).substr(2, 9)}`, w = !!r;
|
|
1196
|
+
return /* @__PURE__ */ i("div", { className: b("flex flex-col", s && "w-full", p), children: [
|
|
1197
1197
|
t && /* @__PURE__ */ e(
|
|
1198
1198
|
"label",
|
|
1199
1199
|
{
|
|
1200
1200
|
htmlFor: C,
|
|
1201
1201
|
className: b(
|
|
1202
1202
|
"block text-sm font-medium mb-1",
|
|
1203
|
-
|
|
1203
|
+
w ? "text-error" : "text-default",
|
|
1204
1204
|
y
|
|
1205
1205
|
),
|
|
1206
1206
|
children: t
|
|
1207
1207
|
}
|
|
1208
1208
|
),
|
|
1209
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1210
1210
|
c && // Todo fix inset not showing correctly on different sizes
|
|
1211
|
-
/* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: b("text-
|
|
1211
|
+
/* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: b("text-muted", be[n]), children: c }) }),
|
|
1212
1212
|
/* @__PURE__ */ e(
|
|
1213
1213
|
"input",
|
|
1214
1214
|
{
|
|
1215
|
-
ref:
|
|
1215
|
+
ref: h,
|
|
1216
1216
|
id: C,
|
|
1217
1217
|
className: b(
|
|
1218
1218
|
// Base styles
|
|
1219
|
-
"block w-full rounded-lg border
|
|
1220
|
-
"placeholder
|
|
1219
|
+
"block w-full rounded-lg border transition-colors duration-200",
|
|
1220
|
+
"placeholder:text-[var(--text-muted)] focus:outline-none focus:ring-1 focus:ring-offset-0",
|
|
1221
1221
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1222
1222
|
// Size styles
|
|
1223
|
-
ct[
|
|
1223
|
+
ct[n],
|
|
1224
1224
|
// Icon padding
|
|
1225
1225
|
c && "pl-10",
|
|
1226
|
-
|
|
1226
|
+
f && "pr-10",
|
|
1227
1227
|
// State styles
|
|
1228
|
-
|
|
1228
|
+
w ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default focus:border-primary focus:ring-primary",
|
|
1229
1229
|
u
|
|
1230
1230
|
),
|
|
1231
|
-
...
|
|
1231
|
+
...d
|
|
1232
1232
|
}
|
|
1233
1233
|
),
|
|
1234
|
-
(
|
|
1234
|
+
(f || g) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: g ? /* @__PURE__ */ i(
|
|
1235
1235
|
"svg",
|
|
1236
1236
|
{
|
|
1237
|
-
className: b("animate-spin text-
|
|
1237
|
+
className: b("animate-spin text-muted", be[n]),
|
|
1238
1238
|
fill: "none",
|
|
1239
1239
|
viewBox: "0 0 24 24",
|
|
1240
1240
|
children: [
|
|
@@ -1259,16 +1259,16 @@ const ct = {
|
|
|
1259
1259
|
)
|
|
1260
1260
|
]
|
|
1261
1261
|
}
|
|
1262
|
-
) :
|
|
1262
|
+
) : f && /* @__PURE__ */ e("span", { className: b("text-muted", be[n]), children: f }) })
|
|
1263
1263
|
] }),
|
|
1264
|
-
(r ||
|
|
1264
|
+
(r || a) && /* @__PURE__ */ e(
|
|
1265
1265
|
"p",
|
|
1266
1266
|
{
|
|
1267
1267
|
className: b(
|
|
1268
1268
|
"mt-1 text-xs",
|
|
1269
|
-
|
|
1269
|
+
w ? "text-error" : "text-muted"
|
|
1270
1270
|
),
|
|
1271
|
-
children: r ||
|
|
1271
|
+
children: r || a
|
|
1272
1272
|
}
|
|
1273
1273
|
)
|
|
1274
1274
|
] });
|
|
@@ -1277,15 +1277,15 @@ const ct = {
|
|
|
1277
1277
|
ue.displayName = "TextField";
|
|
1278
1278
|
const oe = ({
|
|
1279
1279
|
icon: t,
|
|
1280
|
-
size:
|
|
1280
|
+
size: a = "md",
|
|
1281
1281
|
color: r = "current",
|
|
1282
|
-
clickable:
|
|
1282
|
+
clickable: n = !1,
|
|
1283
1283
|
onClick: s,
|
|
1284
1284
|
className: c,
|
|
1285
|
-
"aria-label":
|
|
1285
|
+
"aria-label": f,
|
|
1286
1286
|
...g
|
|
1287
1287
|
}) => {
|
|
1288
|
-
const p = typeof
|
|
1288
|
+
const p = typeof a == "number" ? a : it(a), y = b(
|
|
1289
1289
|
"inline-block",
|
|
1290
1290
|
// Color variants
|
|
1291
1291
|
{
|
|
@@ -1301,25 +1301,25 @@ const oe = ({
|
|
|
1301
1301
|
},
|
|
1302
1302
|
// Clickable styles
|
|
1303
1303
|
{
|
|
1304
|
-
"cursor-pointer hover:opacity-80 transition-opacity duration-200":
|
|
1305
|
-
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/20 rounded":
|
|
1304
|
+
"cursor-pointer hover:opacity-80 transition-opacity duration-200": n,
|
|
1305
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/20 rounded": n
|
|
1306
1306
|
},
|
|
1307
1307
|
c
|
|
1308
1308
|
), u = {
|
|
1309
1309
|
size: p,
|
|
1310
1310
|
className: y,
|
|
1311
|
-
onClick:
|
|
1312
|
-
"aria-label":
|
|
1313
|
-
role:
|
|
1314
|
-
tabIndex:
|
|
1315
|
-
onKeyDown:
|
|
1311
|
+
onClick: n ? s : void 0,
|
|
1312
|
+
"aria-label": f,
|
|
1313
|
+
role: n ? "button" : void 0,
|
|
1314
|
+
tabIndex: n ? 0 : void 0,
|
|
1315
|
+
onKeyDown: n ? (l) => {
|
|
1316
1316
|
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), s?.());
|
|
1317
1317
|
} : void 0,
|
|
1318
1318
|
...g
|
|
1319
1319
|
};
|
|
1320
1320
|
return /* @__PURE__ */ e(t, { ...u });
|
|
1321
1321
|
};
|
|
1322
|
-
function
|
|
1322
|
+
function it(t) {
|
|
1323
1323
|
return {
|
|
1324
1324
|
xs: 12,
|
|
1325
1325
|
sm: 16,
|
|
@@ -1328,21 +1328,21 @@ function dt(t) {
|
|
|
1328
1328
|
xl: 32
|
|
1329
1329
|
}[t];
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1331
|
+
function dt({
|
|
1332
1332
|
children: t,
|
|
1333
|
-
showTableSkeleton:
|
|
1333
|
+
showTableSkeleton: a = !1,
|
|
1334
1334
|
tableColumns: r = 6,
|
|
1335
|
-
tableRows:
|
|
1335
|
+
tableRows: n = 8
|
|
1336
1336
|
}) {
|
|
1337
|
-
return t ? /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */ e("div", { className: "w-full max-w-6xl mx-auto animate-pulse", children: t }) }) : /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */
|
|
1338
|
-
!
|
|
1337
|
+
return t ? /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */ e("div", { className: "w-full max-w-6xl mx-auto animate-pulse", children: t }) }) : /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */ i("div", { className: "w-full mx-auto space-y-6 animate-pulse", children: [
|
|
1338
|
+
!a && /* @__PURE__ */ i(Ee, { children: [
|
|
1339
1339
|
/* @__PURE__ */ e("div", { className: "h-6 bg-neutral-container-emphasis rounded w-1/4" }),
|
|
1340
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
1341
1341
|
/* @__PURE__ */ e("div", { className: "h-4 bg-neutral-container-emphasis rounded w-3/4" }),
|
|
1342
1342
|
/* @__PURE__ */ e("div", { className: "h-4 bg-neutral-container-emphasis rounded w-1/2" })
|
|
1343
1343
|
] })
|
|
1344
1344
|
] }),
|
|
1345
|
-
|
|
1345
|
+
a && /* @__PURE__ */ i("div", { className: "rounded-lg overflow-hidden", children: [
|
|
1346
1346
|
/* @__PURE__ */ e("div", { className: `grid grid-cols-${r} gap-2 bg-neutral-container p-3`, children: Array.from({ length: r }).map((s, c) => /* @__PURE__ */ e(
|
|
1347
1347
|
"div",
|
|
1348
1348
|
{
|
|
@@ -1350,11 +1350,11 @@ function it({
|
|
|
1350
1350
|
},
|
|
1351
1351
|
`header-${c}`
|
|
1352
1352
|
)) }),
|
|
1353
|
-
Array.from({ length:
|
|
1353
|
+
Array.from({ length: n }).map((s, c) => /* @__PURE__ */ e(
|
|
1354
1354
|
"div",
|
|
1355
1355
|
{
|
|
1356
1356
|
className: `grid grid-cols-${r} gap-2 p-3 border-t border-neutral`,
|
|
1357
|
-
children: Array.from({ length: r }).map((
|
|
1357
|
+
children: Array.from({ length: r }).map((f, g) => /* @__PURE__ */ e(
|
|
1358
1358
|
"div",
|
|
1359
1359
|
{
|
|
1360
1360
|
className: "h-4 bg-neutral-container-emphasis rounded w-full"
|
|
@@ -1369,33 +1369,33 @@ function it({
|
|
|
1369
1369
|
}
|
|
1370
1370
|
const ut = ({
|
|
1371
1371
|
trigger: t,
|
|
1372
|
-
options:
|
|
1372
|
+
options: a,
|
|
1373
1373
|
value: r,
|
|
1374
|
-
onSelect:
|
|
1374
|
+
onSelect: n,
|
|
1375
1375
|
placement: s = "bottom-start",
|
|
1376
1376
|
disabled: c = !1,
|
|
1377
|
-
className:
|
|
1377
|
+
className: f,
|
|
1378
1378
|
showCheck: g = !0,
|
|
1379
1379
|
header: p
|
|
1380
1380
|
}) => {
|
|
1381
|
-
const [y, u] = V(!1), [l,
|
|
1381
|
+
const [y, u] = V(!1), [l, d] = V(null), [h, C] = V({ top: 0, left: 0 }), w = X(null), N = X(null), B = X(null), x = X(null);
|
|
1382
1382
|
G(() => {
|
|
1383
1383
|
const v = (T) => {
|
|
1384
|
-
|
|
1384
|
+
w.current && (!w.current.contains(T.target) || B.current && !B.current.contains(T.target)) && (u(!1), d(null), x.current && (clearTimeout(x.current), x.current = null));
|
|
1385
1385
|
};
|
|
1386
1386
|
return y && document.addEventListener("mousedown", v), () => {
|
|
1387
1387
|
document.removeEventListener("mousedown", v);
|
|
1388
1388
|
};
|
|
1389
1389
|
}, [y]), G(() => {
|
|
1390
1390
|
const v = (T) => {
|
|
1391
|
-
T.key === "Escape" && (u(!1),
|
|
1391
|
+
T.key === "Escape" && (u(!1), d(null), x.current && (clearTimeout(x.current), x.current = null));
|
|
1392
1392
|
};
|
|
1393
1393
|
return y && document.addEventListener("keydown", v), () => {
|
|
1394
1394
|
document.removeEventListener("keydown", v);
|
|
1395
1395
|
};
|
|
1396
1396
|
}, [y]), G(() => {
|
|
1397
|
-
if (l &&
|
|
1398
|
-
const v =
|
|
1397
|
+
if (l && w.current) {
|
|
1398
|
+
const v = w.current.querySelector(
|
|
1399
1399
|
`[data-option-value="${l}"]`
|
|
1400
1400
|
);
|
|
1401
1401
|
if (v) {
|
|
@@ -1410,19 +1410,19 @@ const ut = ({
|
|
|
1410
1410
|
x.current && clearTimeout(x.current);
|
|
1411
1411
|
}, []);
|
|
1412
1412
|
const q = (v) => {
|
|
1413
|
-
v.stopPropagation(), c || (u(!y),
|
|
1413
|
+
v.stopPropagation(), c || (u(!y), d(null), x.current && (clearTimeout(x.current), x.current = null));
|
|
1414
1414
|
}, K = (v, T, m) => {
|
|
1415
|
-
v.stopPropagation(), !T.disabled && !T.divider && (!T.children || T.children.length === 0) && (
|
|
1415
|
+
v.stopPropagation(), !T.disabled && !T.divider && (!T.children || T.children.length === 0) && (n?.(T.value, m), u(!1), d(null));
|
|
1416
1416
|
}, H = (v) => {
|
|
1417
|
-
x.current && (clearTimeout(x.current), x.current = null), v.children && v.children.length > 0 ?
|
|
1417
|
+
x.current && (clearTimeout(x.current), x.current = null), v.children && v.children.length > 0 ? d(v.value) : d(null);
|
|
1418
1418
|
}, F = (v) => {
|
|
1419
1419
|
v.children && v.children.length > 0 ? x.current = setTimeout(() => {
|
|
1420
|
-
|
|
1421
|
-
}, 150) :
|
|
1420
|
+
d(null);
|
|
1421
|
+
}, 150) : d(null);
|
|
1422
1422
|
}, E = (v, T, m) => {
|
|
1423
|
-
v.stopPropagation(), !T.disabled && !T.divider && (
|
|
1423
|
+
v.stopPropagation(), !T.disabled && !T.divider && (n?.(T.value, m), u(!1), d(null));
|
|
1424
1424
|
}, J = b(
|
|
1425
|
-
"absolute z-50 min-w-[200px] bg-
|
|
1425
|
+
"absolute z-50 min-w-[200px] bg-module rounded-md shadow-xs border border-neutral",
|
|
1426
1426
|
"max-h-60 overflow-auto",
|
|
1427
1427
|
{
|
|
1428
1428
|
"top-full left-0 mt-2": s === "bottom-start",
|
|
@@ -1431,22 +1431,22 @@ const ut = ({
|
|
|
1431
1431
|
"bottom-full right-0 mb-2": s === "top-end"
|
|
1432
1432
|
}
|
|
1433
1433
|
), z = b(
|
|
1434
|
-
"fixed z-[60] min-w-[200px] bg-
|
|
1434
|
+
"fixed z-[60] min-w-[200px] bg-module rounded-md shadow-lg border border-neutral",
|
|
1435
1435
|
"max-h-60 overflow-auto"
|
|
1436
1436
|
);
|
|
1437
|
-
return /* @__PURE__ */
|
|
1437
|
+
return /* @__PURE__ */ i(
|
|
1438
1438
|
"div",
|
|
1439
1439
|
{
|
|
1440
|
-
ref:
|
|
1440
|
+
ref: w,
|
|
1441
1441
|
className: b(
|
|
1442
|
-
"relative flex flex-row items-center justify-center rounded-lg hover:bg-
|
|
1443
|
-
|
|
1442
|
+
"relative flex flex-row items-center justify-center rounded-lg hover:bg-neutral-container",
|
|
1443
|
+
f
|
|
1444
1444
|
),
|
|
1445
1445
|
children: [
|
|
1446
1446
|
/* @__PURE__ */ e(
|
|
1447
1447
|
"button",
|
|
1448
1448
|
{
|
|
1449
|
-
ref:
|
|
1449
|
+
ref: N,
|
|
1450
1450
|
onClick: q,
|
|
1451
1451
|
disabled: c,
|
|
1452
1452
|
className: b("inline-flex items-center justify-center", {
|
|
@@ -1455,20 +1455,20 @@ const ut = ({
|
|
|
1455
1455
|
children: t
|
|
1456
1456
|
}
|
|
1457
1457
|
),
|
|
1458
|
-
y && /* @__PURE__ */ e("div", { className: J, children: /* @__PURE__ */
|
|
1459
|
-
p && (typeof p == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-
|
|
1460
|
-
|
|
1458
|
+
y && /* @__PURE__ */ e("div", { className: J, children: /* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
1459
|
+
p && (typeof p == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted uppercase tracking-wider px-3 py-2", children: p }) : p),
|
|
1460
|
+
a.map((v, T) => {
|
|
1461
1461
|
if (v.divider)
|
|
1462
1462
|
return /* @__PURE__ */ e(
|
|
1463
1463
|
"div",
|
|
1464
1464
|
{
|
|
1465
|
-
className: "border-t border-
|
|
1465
|
+
className: "border-t border-neutral my-2"
|
|
1466
1466
|
},
|
|
1467
1467
|
`divider-${T}`
|
|
1468
1468
|
);
|
|
1469
1469
|
const m = v.children && v.children.length > 0, $ = l === v.value;
|
|
1470
|
-
return /* @__PURE__ */
|
|
1471
|
-
/* @__PURE__ */
|
|
1470
|
+
return /* @__PURE__ */ i("div", { className: "relative group", children: [
|
|
1471
|
+
/* @__PURE__ */ i(
|
|
1472
1472
|
"button",
|
|
1473
1473
|
{
|
|
1474
1474
|
"data-option-value": v.value,
|
|
@@ -1477,23 +1477,23 @@ const ut = ({
|
|
|
1477
1477
|
onMouseLeave: () => F(v),
|
|
1478
1478
|
disabled: v.disabled,
|
|
1479
1479
|
className: b(
|
|
1480
|
-
"w-full flex items-center justify-between px-3 py-2 text-sm text-
|
|
1480
|
+
"w-full flex items-center justify-between px-3 py-2 text-sm text-default hover:bg-neutral-container rounded-md transition-colors",
|
|
1481
1481
|
{
|
|
1482
1482
|
"opacity-50 cursor-not-allowed": v.disabled,
|
|
1483
|
-
"bg-
|
|
1483
|
+
"bg-neutral-container": $ && m
|
|
1484
1484
|
}
|
|
1485
1485
|
),
|
|
1486
1486
|
children: [
|
|
1487
|
-
/* @__PURE__ */
|
|
1487
|
+
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1488
1488
|
v.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: v.icon }),
|
|
1489
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1490
1490
|
/* @__PURE__ */ e("span", { className: "font-base truncate", children: v.label }),
|
|
1491
|
-
v.description && /* @__PURE__ */ e("span", { className: "text-xs text-
|
|
1491
|
+
v.description && /* @__PURE__ */ e("span", { className: "text-xs text-muted", children: v.description })
|
|
1492
1492
|
] })
|
|
1493
1493
|
] }),
|
|
1494
|
-
/* @__PURE__ */
|
|
1495
|
-
g && r === v.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-
|
|
1496
|
-
m && /* @__PURE__ */ e("span", { className: "text-
|
|
1494
|
+
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1495
|
+
g && r === v.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" }),
|
|
1496
|
+
m && /* @__PURE__ */ e("span", { className: "text-muted text-xs", children: "▶" })
|
|
1497
1497
|
] })
|
|
1498
1498
|
]
|
|
1499
1499
|
}
|
|
@@ -1504,15 +1504,15 @@ const ut = ({
|
|
|
1504
1504
|
ref: B,
|
|
1505
1505
|
className: z,
|
|
1506
1506
|
style: {
|
|
1507
|
-
top: `${
|
|
1508
|
-
left: `${
|
|
1507
|
+
top: `${h.top}px`,
|
|
1508
|
+
left: `${h.left}px`
|
|
1509
1509
|
},
|
|
1510
1510
|
onMouseEnter: () => {
|
|
1511
|
-
x.current && (clearTimeout(x.current), x.current = null),
|
|
1511
|
+
x.current && (clearTimeout(x.current), x.current = null), d(v.value);
|
|
1512
1512
|
},
|
|
1513
1513
|
onMouseLeave: () => {
|
|
1514
1514
|
x.current = setTimeout(() => {
|
|
1515
|
-
|
|
1515
|
+
d(null);
|
|
1516
1516
|
}, 150);
|
|
1517
1517
|
},
|
|
1518
1518
|
children: /* @__PURE__ */ e("div", { className: "p-2", children: v.children.map((L, D) => {
|
|
@@ -1520,14 +1520,14 @@ const ut = ({
|
|
|
1520
1520
|
return /* @__PURE__ */ e(
|
|
1521
1521
|
"div",
|
|
1522
1522
|
{
|
|
1523
|
-
className: "border-t border-
|
|
1523
|
+
className: "border-t border-neutral my-2"
|
|
1524
1524
|
},
|
|
1525
1525
|
`divider-${D}`
|
|
1526
1526
|
);
|
|
1527
1527
|
const P = typeof r == "object" && r[v.value] && r[v.value].includes(
|
|
1528
1528
|
L.value
|
|
1529
1529
|
) || r === L.value;
|
|
1530
|
-
return /* @__PURE__ */
|
|
1530
|
+
return /* @__PURE__ */ i(
|
|
1531
1531
|
"button",
|
|
1532
1532
|
{
|
|
1533
1533
|
onClick: (M) => E(
|
|
@@ -1537,20 +1537,20 @@ const ut = ({
|
|
|
1537
1537
|
),
|
|
1538
1538
|
disabled: L.disabled,
|
|
1539
1539
|
className: b(
|
|
1540
|
-
"w-full flex items-center justify-between px-3 py-2 text-sm text-
|
|
1540
|
+
"w-full flex items-center justify-between px-3 py-2 text-sm text-default hover:bg-neutral-container rounded-md transition-colors",
|
|
1541
1541
|
{
|
|
1542
1542
|
"opacity-50 cursor-not-allowed": L.disabled
|
|
1543
1543
|
}
|
|
1544
1544
|
),
|
|
1545
1545
|
children: [
|
|
1546
|
-
/* @__PURE__ */
|
|
1546
|
+
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1547
1547
|
L.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: L.icon }),
|
|
1548
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1549
1549
|
/* @__PURE__ */ e("span", { className: "font-base truncate", children: L.label }),
|
|
1550
|
-
L.description && /* @__PURE__ */ e("span", { className: "text-xs text-
|
|
1550
|
+
L.description && /* @__PURE__ */ e("span", { className: "text-xs text-muted", children: L.description })
|
|
1551
1551
|
] })
|
|
1552
1552
|
] }),
|
|
1553
|
-
g && P && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-
|
|
1553
|
+
g && P && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" })
|
|
1554
1554
|
]
|
|
1555
1555
|
},
|
|
1556
1556
|
L.value
|
|
@@ -1561,12 +1561,12 @@ const ut = ({
|
|
|
1561
1561
|
] }, v.value);
|
|
1562
1562
|
}),
|
|
1563
1563
|
(() => {
|
|
1564
|
-
const v =
|
|
1564
|
+
const v = a.reduce((T, m) => {
|
|
1565
1565
|
if (m.divider) return T;
|
|
1566
1566
|
const $ = m.children ? m.children.filter((L) => !L.divider).length : 0;
|
|
1567
1567
|
return T + 1 + $;
|
|
1568
1568
|
}, 0);
|
|
1569
|
-
return v > 1 && /* @__PURE__ */ e("div", { className: "border-t border-
|
|
1569
|
+
return v > 1 && /* @__PURE__ */ e("div", { className: "border-t border-neutral mt-2 pt-2", children: /* @__PURE__ */ i("div", { className: "text-xs text-muted px-3 py-1", children: [
|
|
1570
1570
|
v,
|
|
1571
1571
|
" options available"
|
|
1572
1572
|
] }) });
|
|
@@ -1592,12 +1592,12 @@ const ut = ({
|
|
|
1592
1592
|
}
|
|
1593
1593
|
)
|
|
1594
1594
|
}
|
|
1595
|
-
),
|
|
1595
|
+
), ft = ({ active: t }) => /* @__PURE__ */ e(
|
|
1596
1596
|
"svg",
|
|
1597
1597
|
{
|
|
1598
1598
|
className: b(
|
|
1599
1599
|
"h-3 w-3",
|
|
1600
|
-
t ? "text-
|
|
1600
|
+
t ? "text-default" : "text-muted"
|
|
1601
1601
|
),
|
|
1602
1602
|
fill: "none",
|
|
1603
1603
|
stroke: "currentColor",
|
|
@@ -1612,12 +1612,12 @@ const ut = ({
|
|
|
1612
1612
|
}
|
|
1613
1613
|
)
|
|
1614
1614
|
}
|
|
1615
|
-
),
|
|
1615
|
+
), ht = ({ active: t }) => /* @__PURE__ */ e(
|
|
1616
1616
|
"svg",
|
|
1617
1617
|
{
|
|
1618
1618
|
className: b(
|
|
1619
1619
|
"h-3 w-3",
|
|
1620
|
-
t ? "text-
|
|
1620
|
+
t ? "text-default" : "text-muted"
|
|
1621
1621
|
),
|
|
1622
1622
|
fill: "none",
|
|
1623
1623
|
stroke: "currentColor",
|
|
@@ -1718,41 +1718,41 @@ const ut = ({
|
|
|
1718
1718
|
)
|
|
1719
1719
|
}
|
|
1720
1720
|
), yt = (t) => {
|
|
1721
|
-
const
|
|
1722
|
-
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((s) => s !==
|
|
1721
|
+
const a = (n) => t.multiSelect && Array.isArray(t.value) ? t.value?.includes(n) : t.value === n, r = (n) => {
|
|
1722
|
+
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((s) => s !== n)) : t.onChange(n);
|
|
1723
1723
|
};
|
|
1724
1724
|
return t.type === "date" ? /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-[160px]", children: /* @__PURE__ */ e(
|
|
1725
1725
|
ye,
|
|
1726
1726
|
{
|
|
1727
1727
|
size: "sm",
|
|
1728
1728
|
value: t.value,
|
|
1729
|
-
onChange: (
|
|
1729
|
+
onChange: (n) => t.onChange(n),
|
|
1730
1730
|
placeholder: t.placeholder || `Select ${t.label.toLowerCase()}`,
|
|
1731
1731
|
className: "min-w-[160px] btn btn o__secondary"
|
|
1732
1732
|
}
|
|
1733
|
-
) }) : /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-[240px]", children: /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */
|
|
1734
|
-
/* @__PURE__ */
|
|
1733
|
+
) }) : /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-[240px]", children: /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ i("details", { className: "group", children: [
|
|
1734
|
+
/* @__PURE__ */ i("summary", { className: "flex items-center space-x-2 cursor-pointer rounded-full px-3 py-2 text-sm btn btn o__secondary", children: [
|
|
1735
1735
|
/* @__PURE__ */ e("span", { children: t.label }),
|
|
1736
1736
|
/* @__PURE__ */ e("span", { className: "text-default", children: t.multiSelect && Array.isArray(t.value) ? t.value?.map(
|
|
1737
|
-
(
|
|
1738
|
-
).join(", ") : t.options?.find((
|
|
1737
|
+
(n) => t.options?.find((s) => s.value === n)?.label
|
|
1738
|
+
).join(", ") : t.options?.find((n) => n.value === t.value)?.label }),
|
|
1739
1739
|
/* @__PURE__ */ e("span", { className: "text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(ze, {}) })
|
|
1740
1740
|
] }),
|
|
1741
|
-
/* @__PURE__ */
|
|
1742
|
-
t.options?.map((
|
|
1741
|
+
/* @__PURE__ */ i("div", { className: "absolute z-10 left-0 mt-1 bg-module border border-neutral rounded-lg shadow-lvl-0 p-2 w-48", children: [
|
|
1742
|
+
t.options?.map((n) => /* @__PURE__ */ e(
|
|
1743
1743
|
"button",
|
|
1744
1744
|
{
|
|
1745
1745
|
className: "w-full text-left px-3 py-2 rounded-md hover:bg-module-subtle text-sm text-default flex items-center space-x-2",
|
|
1746
|
-
onClick: () => r(
|
|
1746
|
+
onClick: () => r(n.value),
|
|
1747
1747
|
children: /* @__PURE__ */ e(
|
|
1748
1748
|
"span",
|
|
1749
1749
|
{
|
|
1750
|
-
className: b(n
|
|
1751
|
-
children:
|
|
1750
|
+
className: b(a(n.value) && "text-primary-500"),
|
|
1751
|
+
children: n.label
|
|
1752
1752
|
}
|
|
1753
1753
|
)
|
|
1754
1754
|
},
|
|
1755
|
-
|
|
1755
|
+
n.value
|
|
1756
1756
|
)),
|
|
1757
1757
|
t.value && /* @__PURE__ */ e(
|
|
1758
1758
|
"button",
|
|
@@ -1766,22 +1766,22 @@ const ut = ({
|
|
|
1766
1766
|
] }) }) });
|
|
1767
1767
|
}, Le = ({
|
|
1768
1768
|
data: t,
|
|
1769
|
-
columns:
|
|
1769
|
+
columns: a,
|
|
1770
1770
|
loading: r = !1,
|
|
1771
|
-
searchable:
|
|
1771
|
+
searchable: n = !1,
|
|
1772
1772
|
searchPlaceholder: s = "Search...",
|
|
1773
1773
|
filters: c = [],
|
|
1774
|
-
paginated:
|
|
1774
|
+
paginated: f = !1,
|
|
1775
1775
|
pageSizeOptions: g = [10, 25, 50, 100],
|
|
1776
1776
|
defaultPageSize: p = 10,
|
|
1777
1777
|
actions: y = [],
|
|
1778
1778
|
onRowClick: u,
|
|
1779
1779
|
selectable: l = !1,
|
|
1780
|
-
selectedRows:
|
|
1781
|
-
onSelectionChange:
|
|
1780
|
+
selectedRows: d = [],
|
|
1781
|
+
onSelectionChange: h,
|
|
1782
1782
|
getRowKey: C = (H, F) => F,
|
|
1783
|
-
emptyContent:
|
|
1784
|
-
hoverable:
|
|
1783
|
+
emptyContent: w,
|
|
1784
|
+
hoverable: N = !0,
|
|
1785
1785
|
bordered: B = !1,
|
|
1786
1786
|
striped: x = !1,
|
|
1787
1787
|
className: q,
|
|
@@ -1793,60 +1793,60 @@ const ut = ({
|
|
|
1793
1793
|
}), [z, v] = V({
|
|
1794
1794
|
page: 0,
|
|
1795
1795
|
pageSize: p
|
|
1796
|
-
}), T = X(null), m =
|
|
1796
|
+
}), T = X(null), m = de(() => {
|
|
1797
1797
|
let o = t;
|
|
1798
|
-
if (
|
|
1799
|
-
const
|
|
1798
|
+
if (n && H.trim()) {
|
|
1799
|
+
const k = a.filter(
|
|
1800
1800
|
(R) => R.searchable !== !1
|
|
1801
1801
|
), _ = H.toLowerCase();
|
|
1802
|
-
o = o.filter((R) =>
|
|
1802
|
+
o = o.filter((R) => k.some((j) => {
|
|
1803
1803
|
const Y = typeof j.accessor == "function" ? j.accessor(R) : R[j.accessor];
|
|
1804
1804
|
return String(Y || "").toLowerCase().includes(_);
|
|
1805
1805
|
}));
|
|
1806
1806
|
}
|
|
1807
|
-
return c.forEach((
|
|
1808
|
-
|
|
1809
|
-
const R =
|
|
1807
|
+
return c.forEach((k) => {
|
|
1808
|
+
k.value && k.value !== "all" && (o = o.filter((_) => {
|
|
1809
|
+
const R = a.find((Y) => Y.id === k.id);
|
|
1810
1810
|
if (!R) return !0;
|
|
1811
1811
|
const j = typeof R.accessor == "function" ? R.accessor(_) : _[R.accessor];
|
|
1812
|
-
return String(j || "") ===
|
|
1812
|
+
return String(j || "") === k.value;
|
|
1813
1813
|
}));
|
|
1814
1814
|
}), o;
|
|
1815
|
-
}, [t, H,
|
|
1815
|
+
}, [t, H, a, n, c]), $ = de(() => {
|
|
1816
1816
|
if (!E.column || !E.direction) return m;
|
|
1817
|
-
const o =
|
|
1818
|
-
return o ? [...m].sort((
|
|
1819
|
-
const R = typeof o.accessor == "function" ? o.accessor(
|
|
1817
|
+
const o = a.find((k) => k.id === E.column);
|
|
1818
|
+
return o ? [...m].sort((k, _) => {
|
|
1819
|
+
const R = typeof o.accessor == "function" ? o.accessor(k) : k[o.accessor], j = typeof o.accessor == "function" ? o.accessor(_) : _[o.accessor];
|
|
1820
1820
|
let Y = 0;
|
|
1821
1821
|
return R < j ? Y = -1 : R > j && (Y = 1), E.direction === "desc" ? -Y : Y;
|
|
1822
1822
|
}) : m;
|
|
1823
|
-
}, [m, E,
|
|
1824
|
-
if (!
|
|
1825
|
-
const o = z.page * z.pageSize,
|
|
1826
|
-
return $.slice(o,
|
|
1827
|
-
}, [$, z,
|
|
1823
|
+
}, [m, E, a]), L = de(() => {
|
|
1824
|
+
if (!f) return $;
|
|
1825
|
+
const o = z.page * z.pageSize, k = o + z.pageSize;
|
|
1826
|
+
return $.slice(o, k);
|
|
1827
|
+
}, [$, z, f]), D = ne(
|
|
1828
1828
|
(o) => {
|
|
1829
|
-
|
|
1829
|
+
a.find((_) => _.id === o)?.sortable && J((_) => _.column !== o ? { column: o, direction: "asc" } : _.direction === "asc" ? { column: o, direction: "desc" } : { column: null, direction: null });
|
|
1830
1830
|
},
|
|
1831
|
-
[
|
|
1832
|
-
), P =
|
|
1833
|
-
v((
|
|
1834
|
-
}, []), M =
|
|
1831
|
+
[a]
|
|
1832
|
+
), P = ne((o) => {
|
|
1833
|
+
v((k) => ({ ...k, page: o }));
|
|
1834
|
+
}, []), M = ne((o) => {
|
|
1835
1835
|
v({ page: 0, pageSize: o });
|
|
1836
|
-
}, []), te =
|
|
1837
|
-
(o,
|
|
1838
|
-
if (!
|
|
1836
|
+
}, []), te = ne(
|
|
1837
|
+
(o, k) => {
|
|
1838
|
+
if (!h) return;
|
|
1839
1839
|
const _ = C(o, 0);
|
|
1840
|
-
|
|
1841
|
-
(R, j) => C(
|
|
1840
|
+
d.map((R, j) => C(R, j)), h(k ? [...d, o] : d.filter(
|
|
1841
|
+
(R, j) => C(d[j], j) !== _
|
|
1842
1842
|
));
|
|
1843
1843
|
},
|
|
1844
|
-
[
|
|
1845
|
-
),
|
|
1844
|
+
[d, h, C]
|
|
1845
|
+
), ae = ne(
|
|
1846
1846
|
(o) => {
|
|
1847
|
-
|
|
1847
|
+
h && h(o ? [...L] : []);
|
|
1848
1848
|
},
|
|
1849
|
-
[L,
|
|
1849
|
+
[L, h]
|
|
1850
1850
|
);
|
|
1851
1851
|
G(() => {
|
|
1852
1852
|
v((o) => ({ ...o, page: 0 }));
|
|
@@ -1854,26 +1854,26 @@ const ut = ({
|
|
|
1854
1854
|
v((o) => ({ ...o, page: 0 }));
|
|
1855
1855
|
}, [c.map((o) => o.value).join(",")]);
|
|
1856
1856
|
const W = $.length, S = Math.ceil(W / z.pageSize), I = z.page * z.pageSize + 1, O = Math.min(I + z.pageSize - 1, W), A = L.length > 0 && L.every((o) => {
|
|
1857
|
-
const
|
|
1858
|
-
return
|
|
1859
|
-
(_, R) => C(_, R) ===
|
|
1857
|
+
const k = C(o, 0);
|
|
1858
|
+
return d.some(
|
|
1859
|
+
(_, R) => C(_, R) === k
|
|
1860
1860
|
);
|
|
1861
1861
|
}), Q = L.some((o) => {
|
|
1862
|
-
const
|
|
1863
|
-
return
|
|
1864
|
-
(_, R) => C(_, R) ===
|
|
1862
|
+
const k = C(o, 0);
|
|
1863
|
+
return d.some(
|
|
1864
|
+
(_, R) => C(_, R) === k
|
|
1865
1865
|
);
|
|
1866
1866
|
}), re = b(
|
|
1867
1867
|
"w-full text-sm leading-5 text-[var(--text-default)] border-collapse",
|
|
1868
1868
|
q
|
|
1869
1869
|
), U = b("bg-[var(--base-module)]"), le = b(
|
|
1870
1870
|
"text-[var(--text-default)] dark:text-[var(--text-on-neutral)] p-3 border-b border-[var(--neutral-border)]"
|
|
1871
|
-
),
|
|
1872
|
-
"hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]":
|
|
1871
|
+
), fe = b("h-12", {
|
|
1872
|
+
"hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]": N,
|
|
1873
1873
|
"cursor-pointer": u
|
|
1874
1874
|
});
|
|
1875
|
-
return /* @__PURE__ */
|
|
1876
|
-
(
|
|
1875
|
+
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
1876
|
+
(n || c.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */ i("div", { className: "flex flex-wrap gap-4 items-start", children: [
|
|
1877
1877
|
c.map((o) => /* @__PURE__ */ e(yt, { ...o }, o.id)),
|
|
1878
1878
|
/* @__PURE__ */ e("div", { className: "w-full sm:w-auto sm:ml-auto min-w-[200px]", children: /* @__PURE__ */ e(
|
|
1879
1879
|
ue,
|
|
@@ -1886,17 +1886,17 @@ const ut = ({
|
|
|
1886
1886
|
}
|
|
1887
1887
|
) })
|
|
1888
1888
|
] }) }),
|
|
1889
|
-
/* @__PURE__ */
|
|
1889
|
+
/* @__PURE__ */ i("div", { className: "relative w-full overflow-x-auto min-h-[400px]", children: [
|
|
1890
1890
|
r && /* @__PURE__ */ e("div", { className: "flex items-center justify-center z-10", children: /* @__PURE__ */ e(
|
|
1891
|
-
|
|
1891
|
+
dt,
|
|
1892
1892
|
{
|
|
1893
1893
|
showTableSkeleton: !0,
|
|
1894
1894
|
tableRows: 10,
|
|
1895
|
-
tableColumns:
|
|
1895
|
+
tableColumns: a.length
|
|
1896
1896
|
}
|
|
1897
1897
|
) }),
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */ e("thead", { className: U, children: /* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ i("table", { ref: T, className: b(re, "min-w-full"), children: [
|
|
1899
|
+
/* @__PURE__ */ e("thead", { className: U, children: /* @__PURE__ */ i("tr", { children: [
|
|
1900
1900
|
l && /* @__PURE__ */ e("th", { className: b(le, "w-12"), children: /* @__PURE__ */ e(
|
|
1901
1901
|
"input",
|
|
1902
1902
|
{
|
|
@@ -1905,11 +1905,11 @@ const ut = ({
|
|
|
1905
1905
|
ref: (o) => {
|
|
1906
1906
|
o && (o.indeterminate = Q && !A);
|
|
1907
1907
|
},
|
|
1908
|
-
onChange: (o) =>
|
|
1909
|
-
className: "rounded border-neutral
|
|
1908
|
+
onChange: (o) => ae(o.target.checked),
|
|
1909
|
+
className: "rounded border-neutral"
|
|
1910
1910
|
}
|
|
1911
1911
|
) }),
|
|
1912
|
-
!r &&
|
|
1912
|
+
!r && a.map((o) => /* @__PURE__ */ e(
|
|
1913
1913
|
"th",
|
|
1914
1914
|
{
|
|
1915
1915
|
className: b(
|
|
@@ -1927,9 +1927,9 @@ const ut = ({
|
|
|
1927
1927
|
),
|
|
1928
1928
|
style: { width: o.width },
|
|
1929
1929
|
onClick: () => o.sortable && D(o.id),
|
|
1930
|
-
children: /* @__PURE__ */
|
|
1930
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1931
1931
|
o.headerCell ? o.headerCell() : o.header,
|
|
1932
|
-
o.sortable && /* @__PURE__ */
|
|
1932
|
+
o.sortable && /* @__PURE__ */ i(
|
|
1933
1933
|
"div",
|
|
1934
1934
|
{
|
|
1935
1935
|
className: b(
|
|
@@ -1938,13 +1938,13 @@ const ut = ({
|
|
|
1938
1938
|
),
|
|
1939
1939
|
children: [
|
|
1940
1940
|
/* @__PURE__ */ e(
|
|
1941
|
-
|
|
1941
|
+
ft,
|
|
1942
1942
|
{
|
|
1943
1943
|
active: E.column === o.id && E.direction === "asc"
|
|
1944
1944
|
}
|
|
1945
1945
|
),
|
|
1946
1946
|
/* @__PURE__ */ e(
|
|
1947
|
-
|
|
1947
|
+
ht,
|
|
1948
1948
|
{
|
|
1949
1949
|
active: E.column === o.id && E.direction === "desc"
|
|
1950
1950
|
}
|
|
@@ -1961,27 +1961,27 @@ const ut = ({
|
|
|
1961
1961
|
/* @__PURE__ */ e("tbody", { children: L.length === 0 || r ? !r && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1962
1962
|
"td",
|
|
1963
1963
|
{
|
|
1964
|
-
colSpan:
|
|
1964
|
+
colSpan: a.length + (l ? 1 : 0) + (y.length > 0 ? 1 : 0),
|
|
1965
1965
|
className: b(
|
|
1966
1966
|
le,
|
|
1967
|
-
"text-center py-8 text-
|
|
1967
|
+
"text-center py-8 text-muted"
|
|
1968
1968
|
),
|
|
1969
|
-
children:
|
|
1969
|
+
children: w || "No data available"
|
|
1970
1970
|
}
|
|
1971
|
-
) }) : L.map((o,
|
|
1972
|
-
const _ = C(o,
|
|
1971
|
+
) }) : L.map((o, k) => {
|
|
1972
|
+
const _ = C(o, k), R = d.some(
|
|
1973
1973
|
(j, Y) => C(j, Y) === _
|
|
1974
1974
|
);
|
|
1975
|
-
return /* @__PURE__ */
|
|
1975
|
+
return /* @__PURE__ */ i(
|
|
1976
1976
|
"tr",
|
|
1977
1977
|
{
|
|
1978
1978
|
className: b(
|
|
1979
|
-
|
|
1980
|
-
{ "bg-
|
|
1981
|
-
K?.(o,
|
|
1979
|
+
fe,
|
|
1980
|
+
{ "bg-accent-container": R },
|
|
1981
|
+
K?.(o, k)
|
|
1982
1982
|
),
|
|
1983
1983
|
onClick: (j) => {
|
|
1984
|
-
j.stopPropagation(), u?.(o,
|
|
1984
|
+
j.stopPropagation(), u?.(o, k);
|
|
1985
1985
|
},
|
|
1986
1986
|
children: [
|
|
1987
1987
|
l && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
|
|
@@ -1992,10 +1992,10 @@ const ut = ({
|
|
|
1992
1992
|
onChange: (j) => {
|
|
1993
1993
|
j.stopPropagation(), te(o, j.target.checked);
|
|
1994
1994
|
},
|
|
1995
|
-
className: "rounded border-neutral
|
|
1995
|
+
className: "rounded border-neutral"
|
|
1996
1996
|
}
|
|
1997
1997
|
) }),
|
|
1998
|
-
|
|
1998
|
+
a.map((j) => {
|
|
1999
1999
|
const Y = typeof j.accessor == "function" ? j.accessor(o) : o[j.accessor];
|
|
2000
2000
|
return /* @__PURE__ */ e(
|
|
2001
2001
|
"td",
|
|
@@ -2007,7 +2007,7 @@ const ut = ({
|
|
|
2007
2007
|
"sticky left-0 bg-module": j.sticky === "left",
|
|
2008
2008
|
"sticky right-0 bg-module": j.sticky === "right"
|
|
2009
2009
|
}),
|
|
2010
|
-
children: j.cell ? j.cell(Y, o,
|
|
2010
|
+
children: j.cell ? j.cell(Y, o, k) : String(Y || "")
|
|
2011
2011
|
},
|
|
2012
2012
|
j.id
|
|
2013
2013
|
);
|
|
@@ -2015,7 +2015,7 @@ const ut = ({
|
|
|
2015
2015
|
y.length > 0 && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
|
|
2016
2016
|
ut,
|
|
2017
2017
|
{
|
|
2018
|
-
trigger: /* @__PURE__ */
|
|
2018
|
+
trigger: /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-muted hover:text-default", children: [
|
|
2019
2019
|
/* @__PURE__ */ e("span", { children: "Options" }),
|
|
2020
2020
|
/* @__PURE__ */ e(ze, {})
|
|
2021
2021
|
] }),
|
|
@@ -2027,9 +2027,9 @@ const ut = ({
|
|
|
2027
2027
|
})),
|
|
2028
2028
|
onSelect: (j) => {
|
|
2029
2029
|
const Y = y.find(
|
|
2030
|
-
(
|
|
2030
|
+
(he) => he.id === j
|
|
2031
2031
|
);
|
|
2032
|
-
Y && Y.onClick(o,
|
|
2032
|
+
Y && Y.onClick(o, k);
|
|
2033
2033
|
},
|
|
2034
2034
|
placement: "bottom-end"
|
|
2035
2035
|
}
|
|
@@ -2041,9 +2041,9 @@ const ut = ({
|
|
|
2041
2041
|
}) })
|
|
2042
2042
|
] })
|
|
2043
2043
|
] }),
|
|
2044
|
-
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2044
|
+
f && W > 0 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between px-6", children: [
|
|
2045
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-4", children: [
|
|
2046
|
+
/* @__PURE__ */ i("span", { className: "text-sm text-muted", children: [
|
|
2047
2047
|
"Showing ",
|
|
2048
2048
|
I,
|
|
2049
2049
|
" to ",
|
|
@@ -2052,8 +2052,8 @@ const ut = ({
|
|
|
2052
2052
|
W,
|
|
2053
2053
|
" results"
|
|
2054
2054
|
] }),
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-
|
|
2055
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
2056
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-muted", children: "Rows per page:" }),
|
|
2057
2057
|
/* @__PURE__ */ e(
|
|
2058
2058
|
"select",
|
|
2059
2059
|
{
|
|
@@ -2065,7 +2065,7 @@ const ut = ({
|
|
|
2065
2065
|
)
|
|
2066
2066
|
] })
|
|
2067
2067
|
] }),
|
|
2068
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
2069
2069
|
/* @__PURE__ */ e(
|
|
2070
2070
|
ee,
|
|
2071
2071
|
{
|
|
@@ -2088,7 +2088,7 @@ const ut = ({
|
|
|
2088
2088
|
children: /* @__PURE__ */ e(pt, {})
|
|
2089
2089
|
}
|
|
2090
2090
|
),
|
|
2091
|
-
/* @__PURE__ */
|
|
2091
|
+
/* @__PURE__ */ i("span", { className: "px-3 py-1 text-sm text-muted", children: [
|
|
2092
2092
|
"Page ",
|
|
2093
2093
|
z.page + 1,
|
|
2094
2094
|
" of ",
|
|
@@ -2121,14 +2121,14 @@ const ut = ({
|
|
|
2121
2121
|
] });
|
|
2122
2122
|
}, vt = He(null), er = ({
|
|
2123
2123
|
items: t,
|
|
2124
|
-
activeTab:
|
|
2124
|
+
activeTab: a,
|
|
2125
2125
|
onTabChange: r,
|
|
2126
|
-
className:
|
|
2126
|
+
className: n
|
|
2127
2127
|
}) => {
|
|
2128
|
-
const [s, c] = V(t[0]?.id || ""),
|
|
2128
|
+
const [s, c] = V(t[0]?.id || ""), f = a || s, g = (p) => {
|
|
2129
2129
|
r ? r(p) : c(p);
|
|
2130
2130
|
};
|
|
2131
|
-
return /* @__PURE__ */ e("div", { className: b("border-b border-neutral-200 dark:border-neutral-700",
|
|
2131
|
+
return /* @__PURE__ */ e("div", { className: b("border-b border-neutral-200 dark:border-neutral-700", n), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((p) => /* @__PURE__ */ e(
|
|
2132
2132
|
"button",
|
|
2133
2133
|
{
|
|
2134
2134
|
onClick: () => !p.disabled && g(p.id),
|
|
@@ -2136,38 +2136,38 @@ const ut = ({
|
|
|
2136
2136
|
className: b(
|
|
2137
2137
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-200",
|
|
2138
2138
|
{
|
|
2139
|
-
"border-primary text-primary":
|
|
2140
|
-
"border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300":
|
|
2139
|
+
"border-primary text-primary": f === p.id,
|
|
2140
|
+
"border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": f !== p.id && !p.disabled,
|
|
2141
2141
|
"border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": p.disabled
|
|
2142
2142
|
}
|
|
2143
2143
|
),
|
|
2144
|
-
children: /* @__PURE__ */
|
|
2144
|
+
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2145
2145
|
p.label,
|
|
2146
2146
|
p.badge && /* @__PURE__ */ e("span", { className: b(
|
|
2147
2147
|
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
|
2148
|
-
|
|
2148
|
+
f === p.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
|
|
2149
2149
|
), children: p.badge })
|
|
2150
2150
|
] })
|
|
2151
2151
|
},
|
|
2152
2152
|
p.id
|
|
2153
2153
|
)) }) });
|
|
2154
|
-
},
|
|
2154
|
+
}, Nt = ({
|
|
2155
2155
|
items: t,
|
|
2156
|
-
defaultTab:
|
|
2156
|
+
defaultTab: a,
|
|
2157
2157
|
activeTab: r,
|
|
2158
|
-
onTabChange:
|
|
2158
|
+
onTabChange: n,
|
|
2159
2159
|
variant: s = "default",
|
|
2160
2160
|
size: c = "md",
|
|
2161
|
-
className:
|
|
2161
|
+
className: f
|
|
2162
2162
|
}) => {
|
|
2163
2163
|
const [g, p] = V(
|
|
2164
|
-
|
|
2165
|
-
), y = r || g, u = (
|
|
2166
|
-
|
|
2164
|
+
a || r || t[0]?.id || ""
|
|
2165
|
+
), y = r || g, u = (w) => {
|
|
2166
|
+
n ? n(w) : p(w);
|
|
2167
2167
|
}, l = {
|
|
2168
2168
|
activeTab: y,
|
|
2169
2169
|
setActiveTab: u
|
|
2170
|
-
},
|
|
2170
|
+
}, d = t.find((w) => w.id === y), h = b(
|
|
2171
2171
|
"flex",
|
|
2172
2172
|
{
|
|
2173
2173
|
"border-b border-neutral-200 dark:border-neutral-700 px-2": s === "default" || s === "underline",
|
|
@@ -2175,8 +2175,8 @@ const ut = ({
|
|
|
2175
2175
|
"space-x-1": s === "pills",
|
|
2176
2176
|
"space-x-8": s === "default" || s === "underline"
|
|
2177
2177
|
},
|
|
2178
|
-
|
|
2179
|
-
), C = (
|
|
2178
|
+
f
|
|
2179
|
+
), C = (w, N) => {
|
|
2180
2180
|
const B = "transition-colors duration-200 font-medium", x = {
|
|
2181
2181
|
"text-xs px-2 py-1": c === "sm",
|
|
2182
2182
|
"text-sm px-3 py-2": c === "md",
|
|
@@ -2189,79 +2189,79 @@ const ut = ({
|
|
|
2189
2189
|
// Underline variant
|
|
2190
2190
|
"border-b-2 pb-2": s === "underline"
|
|
2191
2191
|
}, K = {
|
|
2192
|
-
"opacity-50 cursor-not-allowed":
|
|
2193
|
-
"cursor-pointer": !
|
|
2194
|
-
}, H =
|
|
2192
|
+
"opacity-50 cursor-not-allowed": w.disabled,
|
|
2193
|
+
"cursor-pointer": !w.disabled
|
|
2194
|
+
}, H = N ? {
|
|
2195
2195
|
"border-primary text-primary": s === "default" || s === "underline",
|
|
2196
2196
|
"bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": s === "pills"
|
|
2197
|
-
} : {}, F = !
|
|
2197
|
+
} : {}, F = !N && !w.disabled ? {
|
|
2198
2198
|
"border-transparent text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "default",
|
|
2199
2199
|
"text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "pills",
|
|
2200
2200
|
"border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": s === "underline"
|
|
2201
2201
|
} : {};
|
|
2202
2202
|
return b(B, x, q, K, H, F);
|
|
2203
2203
|
};
|
|
2204
|
-
return /* @__PURE__ */ e(vt.Provider, { value: l, children: /* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */ e("div", { className:
|
|
2204
|
+
return /* @__PURE__ */ e(vt.Provider, { value: l, children: /* @__PURE__ */ i("div", { children: [
|
|
2205
|
+
/* @__PURE__ */ e("div", { className: h, role: "tablist", children: t.map((w) => /* @__PURE__ */ e(
|
|
2206
2206
|
"button",
|
|
2207
2207
|
{
|
|
2208
2208
|
type: "button",
|
|
2209
2209
|
role: "tab",
|
|
2210
|
-
"aria-selected": y ===
|
|
2211
|
-
"aria-controls": `tabpanel-${
|
|
2212
|
-
disabled:
|
|
2213
|
-
onClick: () => !
|
|
2214
|
-
className: C(
|
|
2215
|
-
children: /* @__PURE__ */
|
|
2216
|
-
|
|
2217
|
-
|
|
2210
|
+
"aria-selected": y === w.id,
|
|
2211
|
+
"aria-controls": `tabpanel-${w.id}`,
|
|
2212
|
+
disabled: w.disabled,
|
|
2213
|
+
onClick: () => !w.disabled && u(w.id),
|
|
2214
|
+
className: C(w, y === w.id),
|
|
2215
|
+
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2216
|
+
w.label,
|
|
2217
|
+
w.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300", children: w.badge })
|
|
2218
2218
|
] })
|
|
2219
2219
|
},
|
|
2220
|
-
|
|
2220
|
+
w.id
|
|
2221
2221
|
)) }),
|
|
2222
|
-
|
|
2222
|
+
d?.content && /* @__PURE__ */ e(
|
|
2223
2223
|
"div",
|
|
2224
2224
|
{
|
|
2225
2225
|
role: "tabpanel",
|
|
2226
2226
|
id: `tabpanel-${y}`,
|
|
2227
2227
|
"aria-labelledby": `tab-${y}`,
|
|
2228
2228
|
className: "mt-4",
|
|
2229
|
-
children:
|
|
2229
|
+
children: d.content
|
|
2230
2230
|
}
|
|
2231
2231
|
)
|
|
2232
2232
|
] }) });
|
|
2233
|
-
},
|
|
2233
|
+
}, wt = {
|
|
2234
2234
|
sm: "max-w-md",
|
|
2235
2235
|
md: "max-w-lg",
|
|
2236
2236
|
lg: "max-w-2xl",
|
|
2237
2237
|
xl: "max-w-4xl",
|
|
2238
2238
|
full: "max-w-full mx-4"
|
|
2239
2239
|
};
|
|
2240
|
-
function
|
|
2240
|
+
function kt({
|
|
2241
2241
|
open: t,
|
|
2242
|
-
onClose:
|
|
2242
|
+
onClose: a,
|
|
2243
2243
|
title: r,
|
|
2244
|
-
size:
|
|
2244
|
+
size: n = "md",
|
|
2245
2245
|
closeOnBackdropClick: s = !0,
|
|
2246
2246
|
closeOnEscape: c = !0,
|
|
2247
|
-
className:
|
|
2247
|
+
className: f,
|
|
2248
2248
|
backdropClassName: g,
|
|
2249
2249
|
children: p,
|
|
2250
2250
|
footer: y,
|
|
2251
2251
|
showCloseButton: u = !0
|
|
2252
2252
|
}) {
|
|
2253
|
-
const l = X(null),
|
|
2253
|
+
const l = X(null), d = X(null);
|
|
2254
2254
|
G(() => {
|
|
2255
2255
|
if (!t || !c) return;
|
|
2256
|
-
const C = (
|
|
2257
|
-
|
|
2256
|
+
const C = (w) => {
|
|
2257
|
+
w.key === "Escape" && a();
|
|
2258
2258
|
};
|
|
2259
2259
|
return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
|
|
2260
|
-
}, [t, c,
|
|
2260
|
+
}, [t, c, a]), G(() => (t ? (d.current = document.activeElement, l.current && l.current.focus(), document.body.style.overflow = "hidden") : (d.current && d.current.focus(), document.body.style.overflow = ""), () => {
|
|
2261
2261
|
document.body.style.overflow = "";
|
|
2262
2262
|
}), [t]);
|
|
2263
|
-
const
|
|
2264
|
-
s && C.target === C.currentTarget &&
|
|
2263
|
+
const h = (C) => {
|
|
2264
|
+
s && C.target === C.currentTarget && a();
|
|
2265
2265
|
};
|
|
2266
2266
|
return t ? /* @__PURE__ */ e(
|
|
2267
2267
|
"div",
|
|
@@ -2272,37 +2272,37 @@ function wt({
|
|
|
2272
2272
|
// 'animate-fade-in',
|
|
2273
2273
|
g
|
|
2274
2274
|
),
|
|
2275
|
-
onClick:
|
|
2276
|
-
children: /* @__PURE__ */
|
|
2275
|
+
onClick: h,
|
|
2276
|
+
children: /* @__PURE__ */ i(
|
|
2277
2277
|
"div",
|
|
2278
2278
|
{
|
|
2279
2279
|
ref: l,
|
|
2280
2280
|
className: b(
|
|
2281
|
-
"relative w-full bg-
|
|
2281
|
+
"relative w-full bg-module rounded-modal shadow-modal rounded-md",
|
|
2282
2282
|
// 'animate-scale-in',
|
|
2283
2283
|
"focus:outline-none",
|
|
2284
|
-
|
|
2285
|
-
|
|
2284
|
+
wt[n],
|
|
2285
|
+
f
|
|
2286
2286
|
),
|
|
2287
2287
|
role: "dialog",
|
|
2288
2288
|
"aria-modal": "true",
|
|
2289
2289
|
"aria-labelledby": r ? "modal-title" : void 0,
|
|
2290
2290
|
tabIndex: -1,
|
|
2291
2291
|
children: [
|
|
2292
|
-
(r || u) && /* @__PURE__ */
|
|
2292
|
+
(r || u) && /* @__PURE__ */ i("div", { className: "flex items-center justify-between p-6 pb-0", children: [
|
|
2293
2293
|
r && /* @__PURE__ */ e(
|
|
2294
2294
|
"span",
|
|
2295
2295
|
{
|
|
2296
2296
|
id: "modal-title",
|
|
2297
|
-
className: "text-lg font-semibold text-
|
|
2297
|
+
className: "text-lg font-semibold text-default",
|
|
2298
2298
|
children: r
|
|
2299
2299
|
}
|
|
2300
2300
|
),
|
|
2301
2301
|
u && /* @__PURE__ */ e(
|
|
2302
2302
|
"button",
|
|
2303
2303
|
{
|
|
2304
|
-
onClick:
|
|
2305
|
-
className: "p-1 text-
|
|
2304
|
+
onClick: a,
|
|
2305
|
+
className: "p-1 text-muted hover:text-muted transition-colors",
|
|
2306
2306
|
"aria-label": "Close modal",
|
|
2307
2307
|
children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
2308
2308
|
}
|
|
@@ -2318,20 +2318,20 @@ function wt({
|
|
|
2318
2318
|
}
|
|
2319
2319
|
const Z = ({
|
|
2320
2320
|
variant: t = "body",
|
|
2321
|
-
size:
|
|
2321
|
+
size: a = "md",
|
|
2322
2322
|
weight: r = "normal",
|
|
2323
|
-
color:
|
|
2323
|
+
color: n = "current",
|
|
2324
2324
|
align: s = "left",
|
|
2325
2325
|
truncate: c = !1,
|
|
2326
|
-
italic:
|
|
2326
|
+
italic: f = !1,
|
|
2327
2327
|
underline: g = !1,
|
|
2328
2328
|
lineHeight: p = "normal",
|
|
2329
2329
|
as: y,
|
|
2330
2330
|
className: u,
|
|
2331
2331
|
children: l,
|
|
2332
|
-
...
|
|
2332
|
+
...d
|
|
2333
2333
|
}) => {
|
|
2334
|
-
const
|
|
2334
|
+
const h = y || Ct(t), C = b(
|
|
2335
2335
|
// Base styles
|
|
2336
2336
|
"font-primary",
|
|
2337
2337
|
// Variant styles
|
|
@@ -2343,11 +2343,11 @@ const Z = ({
|
|
|
2343
2343
|
},
|
|
2344
2344
|
// Size variants (override variant sizes)
|
|
2345
2345
|
t !== "code" && {
|
|
2346
|
-
"text-xs":
|
|
2347
|
-
"text-sm":
|
|
2348
|
-
"text-base":
|
|
2349
|
-
"text-lg":
|
|
2350
|
-
"text-xl":
|
|
2346
|
+
"text-xs": a === "xs",
|
|
2347
|
+
"text-sm": a === "sm",
|
|
2348
|
+
"text-base": a === "md",
|
|
2349
|
+
"text-lg": a === "lg",
|
|
2350
|
+
"text-xl": a === "xl"
|
|
2351
2351
|
},
|
|
2352
2352
|
// Weight variants
|
|
2353
2353
|
t !== "label" && {
|
|
@@ -2362,16 +2362,16 @@ const Z = ({
|
|
|
2362
2362
|
// rest van de interface (zelfde tokens als bv. Table). De `--text-*` vars
|
|
2363
2363
|
// worden in `.dark` overschreven, dus geen aparte `dark:`-varianten nodig.
|
|
2364
2364
|
{
|
|
2365
|
-
"text-primary":
|
|
2366
|
-
"text-secondary":
|
|
2367
|
-
"text-[var(--text-accent)]":
|
|
2368
|
-
"text-[var(--text-success)]":
|
|
2369
|
-
"text-warning":
|
|
2370
|
-
"text-[var(--text-error)]":
|
|
2371
|
-
"text-info":
|
|
2372
|
-
"text-[var(--text-default)]":
|
|
2373
|
-
"text-current":
|
|
2374
|
-
"text-[var(--text-muted)]":
|
|
2365
|
+
"text-primary": n === "primary",
|
|
2366
|
+
"text-secondary": n === "secondary",
|
|
2367
|
+
"text-[var(--text-accent)]": n === "accent",
|
|
2368
|
+
"text-[var(--text-success)]": n === "success",
|
|
2369
|
+
"text-warning": n === "warning",
|
|
2370
|
+
"text-[var(--text-error)]": n === "error",
|
|
2371
|
+
"text-info": n === "info",
|
|
2372
|
+
"text-[var(--text-default)]": n === "neutral",
|
|
2373
|
+
"text-current": n === "current",
|
|
2374
|
+
"text-[var(--text-muted)]": n === "muted"
|
|
2375
2375
|
},
|
|
2376
2376
|
// Alignment
|
|
2377
2377
|
{
|
|
@@ -2388,13 +2388,13 @@ const Z = ({
|
|
|
2388
2388
|
},
|
|
2389
2389
|
// Text decorations
|
|
2390
2390
|
{
|
|
2391
|
-
italic:
|
|
2391
|
+
italic: f,
|
|
2392
2392
|
underline: g,
|
|
2393
2393
|
truncate: c
|
|
2394
2394
|
},
|
|
2395
2395
|
u
|
|
2396
2396
|
);
|
|
2397
|
-
return /* @__PURE__ */ e(
|
|
2397
|
+
return /* @__PURE__ */ e(h, { className: C, ...d, children: l });
|
|
2398
2398
|
};
|
|
2399
2399
|
function Ct(t) {
|
|
2400
2400
|
return {
|
|
@@ -2406,41 +2406,41 @@ function Ct(t) {
|
|
|
2406
2406
|
}
|
|
2407
2407
|
const St = ({
|
|
2408
2408
|
value: t,
|
|
2409
|
-
onChange:
|
|
2409
|
+
onChange: a,
|
|
2410
2410
|
label: r,
|
|
2411
|
-
placeholder:
|
|
2411
|
+
placeholder: n = "Select or upload a file",
|
|
2412
2412
|
error: s,
|
|
2413
2413
|
disabled: c,
|
|
2414
|
-
accept:
|
|
2414
|
+
accept: f,
|
|
2415
2415
|
onListFiles: g,
|
|
2416
2416
|
onListMounts: p,
|
|
2417
2417
|
onUploadFile: y,
|
|
2418
2418
|
onDownloadFile: u,
|
|
2419
2419
|
onRegisterFile: l
|
|
2420
2420
|
}) => {
|
|
2421
|
-
const [
|
|
2421
|
+
const [d, h] = V(!1), [C, w] = V([]), [N, B] = V(null), [x, q] = V("/"), [K, H] = V([]), [F, E] = V(!1), [J, z] = V(""), [v, T] = V(
|
|
2422
2422
|
typeof t == "object" ? t : null
|
|
2423
2423
|
), [m, $] = V(!1), [L, D] = V(""), P = X(null);
|
|
2424
2424
|
G(() => {
|
|
2425
|
-
|
|
2426
|
-
}, [
|
|
2427
|
-
|
|
2428
|
-
}, [
|
|
2425
|
+
d && M();
|
|
2426
|
+
}, [d]), G(() => {
|
|
2427
|
+
d && N && te();
|
|
2428
|
+
}, [d, N, x, J]);
|
|
2429
2429
|
const M = async () => {
|
|
2430
2430
|
E(!0);
|
|
2431
2431
|
try {
|
|
2432
2432
|
const o = await p?.();
|
|
2433
|
-
o?.data &&
|
|
2433
|
+
o?.data && w(o.data);
|
|
2434
2434
|
} catch (o) {
|
|
2435
2435
|
console.error("Failed to load mounts", o);
|
|
2436
2436
|
} finally {
|
|
2437
2437
|
E(!1);
|
|
2438
2438
|
}
|
|
2439
2439
|
}, te = async () => {
|
|
2440
|
-
if (
|
|
2440
|
+
if (N) {
|
|
2441
2441
|
E(!0);
|
|
2442
2442
|
try {
|
|
2443
|
-
const o = await g?.({ mountId:
|
|
2443
|
+
const o = await g?.({ mountId: N.id, name: J, path: x });
|
|
2444
2444
|
o?.data && H(o.data);
|
|
2445
2445
|
} catch (o) {
|
|
2446
2446
|
console.error("Failed to load files", o);
|
|
@@ -2448,23 +2448,23 @@ const St = ({
|
|
|
2448
2448
|
E(!1);
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
|
-
},
|
|
2452
|
-
const
|
|
2453
|
-
if (
|
|
2451
|
+
}, ae = async (o) => {
|
|
2452
|
+
const k = o.target.files?.[0];
|
|
2453
|
+
if (k) {
|
|
2454
2454
|
E(!0);
|
|
2455
2455
|
try {
|
|
2456
|
-
const _ = await
|
|
2456
|
+
const _ = await k.arrayBuffer(), R = new Uint8Array(_), j = {
|
|
2457
2457
|
id: `local-${Date.now()}`,
|
|
2458
|
-
name:
|
|
2458
|
+
name: k.name,
|
|
2459
2459
|
type: "file",
|
|
2460
2460
|
path: "/",
|
|
2461
|
-
mimeType:
|
|
2462
|
-
size:
|
|
2461
|
+
mimeType: k.type || "application/octet-stream",
|
|
2462
|
+
size: k.size,
|
|
2463
2463
|
mountId: "local",
|
|
2464
|
-
providerKey:
|
|
2464
|
+
providerKey: k.name,
|
|
2465
2465
|
ownerId: "me"
|
|
2466
2466
|
};
|
|
2467
|
-
T(j),
|
|
2467
|
+
T(j), a(j, R), h(!1);
|
|
2468
2468
|
} catch (_) {
|
|
2469
2469
|
console.error("Local file selection failed", _);
|
|
2470
2470
|
} finally {
|
|
@@ -2472,20 +2472,20 @@ const St = ({
|
|
|
2472
2472
|
}
|
|
2473
2473
|
}
|
|
2474
2474
|
}, W = async (o) => {
|
|
2475
|
-
const
|
|
2476
|
-
if (!(!
|
|
2475
|
+
const k = o.target.files?.[0];
|
|
2476
|
+
if (!(!k || !N)) {
|
|
2477
2477
|
E(!0);
|
|
2478
2478
|
try {
|
|
2479
|
-
const _ = await
|
|
2479
|
+
const _ = await k.arrayBuffer(), R = await y?.({
|
|
2480
2480
|
file: new Uint8Array(_),
|
|
2481
|
-
filename:
|
|
2482
|
-
mimeType:
|
|
2483
|
-
mountId:
|
|
2481
|
+
filename: k.name,
|
|
2482
|
+
mimeType: k.type || "application/octet-stream",
|
|
2483
|
+
mountId: N.id,
|
|
2484
2484
|
path: x
|
|
2485
2485
|
});
|
|
2486
2486
|
if (R?.data) {
|
|
2487
2487
|
const j = R.data;
|
|
2488
|
-
T(j),
|
|
2488
|
+
T(j), a(j, new Uint8Array(_)), h(!1);
|
|
2489
2489
|
}
|
|
2490
2490
|
} catch (_) {
|
|
2491
2491
|
console.error("Upload failed", _);
|
|
@@ -2494,7 +2494,7 @@ const St = ({
|
|
|
2494
2494
|
}
|
|
2495
2495
|
}
|
|
2496
2496
|
}, S = async () => {
|
|
2497
|
-
if (!(!L || !
|
|
2497
|
+
if (!(!L || !N)) {
|
|
2498
2498
|
E(!0);
|
|
2499
2499
|
try {
|
|
2500
2500
|
const o = `${x}${L}/`;
|
|
@@ -2504,7 +2504,7 @@ const St = ({
|
|
|
2504
2504
|
path: x,
|
|
2505
2505
|
mimeType: "application/x-directory",
|
|
2506
2506
|
size: 0,
|
|
2507
|
-
mountId:
|
|
2507
|
+
mountId: N.id,
|
|
2508
2508
|
providerKey: o,
|
|
2509
2509
|
ownerId: "me"
|
|
2510
2510
|
}), await te()), $(!1), D("");
|
|
@@ -2517,42 +2517,42 @@ const St = ({
|
|
|
2517
2517
|
}, I = async (o) => {
|
|
2518
2518
|
E(!0);
|
|
2519
2519
|
try {
|
|
2520
|
-
const
|
|
2521
|
-
T(o),
|
|
2522
|
-
} catch (
|
|
2523
|
-
console.error("Failed to download file",
|
|
2520
|
+
const k = await u?.(o.id);
|
|
2521
|
+
T(o), a(o, k), h(!1);
|
|
2522
|
+
} catch (k) {
|
|
2523
|
+
console.error("Failed to download file", k);
|
|
2524
2524
|
} finally {
|
|
2525
2525
|
E(!1);
|
|
2526
2526
|
}
|
|
2527
2527
|
}, O = (o) => {
|
|
2528
|
-
o.stopPropagation(), T(null),
|
|
2529
|
-
}, A =
|
|
2530
|
-
const o = /* @__PURE__ */ new Set(),
|
|
2528
|
+
o.stopPropagation(), T(null), a(null);
|
|
2529
|
+
}, A = de(() => {
|
|
2530
|
+
const o = /* @__PURE__ */ new Set(), k = [];
|
|
2531
2531
|
return K.forEach((_) => {
|
|
2532
2532
|
if (_.type === "folder") {
|
|
2533
2533
|
_.path === x && o.add(_.name);
|
|
2534
2534
|
return;
|
|
2535
2535
|
}
|
|
2536
|
-
const R = _.providerKey || _.name, Y = (x ? R.substring(x.length) : R).split("/").filter((
|
|
2537
|
-
Y.length > 1 ? o.add(Y[0]) : Y.length === 1 &&
|
|
2536
|
+
const R = _.providerKey || _.name, Y = (x ? R.substring(x.length) : R).split("/").filter((he) => he !== "");
|
|
2537
|
+
Y.length > 1 ? o.add(Y[0]) : Y.length === 1 && k.push(_);
|
|
2538
2538
|
}), {
|
|
2539
2539
|
folders: Array.from(o).sort(),
|
|
2540
|
-
files:
|
|
2540
|
+
files: k.sort((_, R) => _.name.localeCompare(R.name))
|
|
2541
2541
|
};
|
|
2542
2542
|
}, [K, x]), Q = (o) => {
|
|
2543
|
-
q((
|
|
2543
|
+
q((k) => `${k}${o}/`);
|
|
2544
2544
|
}, re = () => {
|
|
2545
|
-
const o = x.split("/").filter((
|
|
2545
|
+
const o = x.split("/").filter((k) => k !== "");
|
|
2546
2546
|
o.pop(), o.length === 0 ? q("/") : q(`${o.join("/")}/`);
|
|
2547
|
-
}, U =
|
|
2548
|
-
const o = A.folders.map((
|
|
2549
|
-
id: `folder-${
|
|
2550
|
-
name:
|
|
2547
|
+
}, U = de(() => {
|
|
2548
|
+
const o = A.folders.map((k) => ({
|
|
2549
|
+
id: `folder-${k}`,
|
|
2550
|
+
name: k,
|
|
2551
2551
|
type: "folder"
|
|
2552
2552
|
}));
|
|
2553
|
-
return A.files.forEach((
|
|
2553
|
+
return A.files.forEach((k) => {
|
|
2554
2554
|
o.push({
|
|
2555
|
-
...
|
|
2555
|
+
...k,
|
|
2556
2556
|
type: "file"
|
|
2557
2557
|
});
|
|
2558
2558
|
}), o;
|
|
@@ -2561,16 +2561,16 @@ const St = ({
|
|
|
2561
2561
|
id: "name",
|
|
2562
2562
|
header: "Name",
|
|
2563
2563
|
accessor: "name",
|
|
2564
|
-
cell: (o,
|
|
2564
|
+
cell: (o, k) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
2565
2565
|
/* @__PURE__ */ e(
|
|
2566
2566
|
oe,
|
|
2567
2567
|
{
|
|
2568
|
-
icon:
|
|
2568
|
+
icon: k.type === "folder" ? Ce : pe,
|
|
2569
2569
|
size: "sm",
|
|
2570
|
-
color:
|
|
2570
|
+
color: k.type === "folder" ? "warning" : "secondary"
|
|
2571
2571
|
}
|
|
2572
2572
|
),
|
|
2573
|
-
/* @__PURE__ */ e("span", { className: b(
|
|
2573
|
+
/* @__PURE__ */ e("span", { className: b(k.type === "folder" && "font-medium"), children: o })
|
|
2574
2574
|
] })
|
|
2575
2575
|
},
|
|
2576
2576
|
{
|
|
@@ -2588,26 +2588,26 @@ const St = ({
|
|
|
2588
2588
|
header: "",
|
|
2589
2589
|
accessor: "id",
|
|
2590
2590
|
align: "right",
|
|
2591
|
-
cell: (o,
|
|
2591
|
+
cell: (o, k) => /* @__PURE__ */ e(
|
|
2592
2592
|
ee,
|
|
2593
2593
|
{
|
|
2594
2594
|
size: "sm",
|
|
2595
2595
|
variant: "outline",
|
|
2596
2596
|
onClick: (_) => {
|
|
2597
|
-
_.stopPropagation(),
|
|
2597
|
+
_.stopPropagation(), k.type === "folder" ? Q(k.name) : I(k);
|
|
2598
2598
|
},
|
|
2599
|
-
loading: F &&
|
|
2600
|
-
children:
|
|
2599
|
+
loading: F && k.type === "file" && v?.id === k.id,
|
|
2600
|
+
children: k.type === "folder" ? "Open" : "Select"
|
|
2601
2601
|
}
|
|
2602
2602
|
)
|
|
2603
2603
|
}
|
|
2604
|
-
],
|
|
2604
|
+
], fe = [
|
|
2605
2605
|
{
|
|
2606
2606
|
id: "name",
|
|
2607
2607
|
header: "Mount Name",
|
|
2608
2608
|
accessor: "name",
|
|
2609
|
-
cell: (o) => /* @__PURE__ */
|
|
2610
|
-
/* @__PURE__ */ e(oe, { icon:
|
|
2609
|
+
cell: (o) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2 font-medium", children: [
|
|
2610
|
+
/* @__PURE__ */ e(oe, { icon: ke, size: "sm", color: "primary" }),
|
|
2611
2611
|
/* @__PURE__ */ e("span", { children: o })
|
|
2612
2612
|
] })
|
|
2613
2613
|
},
|
|
@@ -2616,29 +2616,29 @@ const St = ({
|
|
|
2616
2616
|
header: "",
|
|
2617
2617
|
accessor: "id",
|
|
2618
2618
|
align: "right",
|
|
2619
|
-
cell: (o,
|
|
2619
|
+
cell: (o, k) => /* @__PURE__ */ e(ee, { size: "sm", variant: "outline", onClick: () => B(k), children: "Open" })
|
|
2620
2620
|
}
|
|
2621
2621
|
];
|
|
2622
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
2623
2623
|
r && /* @__PURE__ */ e(Z, { variant: "label", size: "sm", weight: "medium", children: r }),
|
|
2624
|
-
/* @__PURE__ */
|
|
2624
|
+
/* @__PURE__ */ i(
|
|
2625
2625
|
"div",
|
|
2626
2626
|
{
|
|
2627
|
-
onClick: () => !c &&
|
|
2627
|
+
onClick: () => !c && h(!0),
|
|
2628
2628
|
className: b(
|
|
2629
2629
|
"flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
|
|
2630
|
-
"hover:border-primary-400 bg-
|
|
2631
|
-
s ? "border-error" : "border-neutral
|
|
2632
|
-
c && "opacity-50 cursor-not-allowed bg-
|
|
2630
|
+
"hover:border-primary-400 bg-module",
|
|
2631
|
+
s ? "border-error" : "border-neutral",
|
|
2632
|
+
c && "opacity-50 cursor-not-allowed bg-module-subtle"
|
|
2633
2633
|
),
|
|
2634
2634
|
children: [
|
|
2635
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: v ? pe :
|
|
2636
|
-
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: v ? /* @__PURE__ */ e("span", { className: "text-sm text-
|
|
2635
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: v ? pe : ke, color: v ? "primary" : "secondary" }) }),
|
|
2636
|
+
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: v ? /* @__PURE__ */ e("span", { className: "text-sm text-default font-medium", children: v.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-muted", children: n }) }),
|
|
2637
2637
|
v && !c && /* @__PURE__ */ e(
|
|
2638
2638
|
"button",
|
|
2639
2639
|
{
|
|
2640
2640
|
onClick: O,
|
|
2641
|
-
className: "p-1 hover:bg-neutral-
|
|
2641
|
+
className: "p-1 hover:bg-neutral-container rounded",
|
|
2642
2642
|
children: /* @__PURE__ */ e(oe, { icon: Oe, size: "xs" })
|
|
2643
2643
|
}
|
|
2644
2644
|
)
|
|
@@ -2647,24 +2647,24 @@ const St = ({
|
|
|
2647
2647
|
),
|
|
2648
2648
|
s && /* @__PURE__ */ e(Z, { variant: "body", size: "xs", className: "text-error", children: s }),
|
|
2649
2649
|
/* @__PURE__ */ e(
|
|
2650
|
-
|
|
2650
|
+
kt,
|
|
2651
2651
|
{
|
|
2652
|
-
open:
|
|
2652
|
+
open: d,
|
|
2653
2653
|
onClose: () => {
|
|
2654
|
-
|
|
2654
|
+
h(!1), B(null), q("/"), $(!1);
|
|
2655
2655
|
},
|
|
2656
|
-
title:
|
|
2656
|
+
title: N ? `Explorer: ${N.name}` : "Select Storage Mount",
|
|
2657
2657
|
size: "lg",
|
|
2658
2658
|
children: /* @__PURE__ */ e(
|
|
2659
|
-
|
|
2659
|
+
Nt,
|
|
2660
2660
|
{
|
|
2661
2661
|
variant: "pills",
|
|
2662
2662
|
items: [
|
|
2663
2663
|
{
|
|
2664
2664
|
id: "remote",
|
|
2665
2665
|
label: "Platform Storage",
|
|
2666
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
2667
|
-
/* @__PURE__ */
|
|
2666
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: N ? /* @__PURE__ */ i(Ee, { children: [
|
|
2667
|
+
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2668
2668
|
/* @__PURE__ */ e(
|
|
2669
2669
|
ee,
|
|
2670
2670
|
{
|
|
@@ -2673,11 +2673,11 @@ const St = ({
|
|
|
2673
2673
|
onClick: () => {
|
|
2674
2674
|
x && x !== "/" ? re() : B(null);
|
|
2675
2675
|
},
|
|
2676
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2676
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: we, size: "xs" }),
|
|
2677
2677
|
children: x ? "Back" : "Back to Mounts"
|
|
2678
2678
|
}
|
|
2679
2679
|
),
|
|
2680
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-
|
|
2680
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-muted overflow-hidden bg-neutral-container px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children: x }) }),
|
|
2681
2681
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-[150px]", children: /* @__PURE__ */ e(
|
|
2682
2682
|
ue,
|
|
2683
2683
|
{
|
|
@@ -2689,7 +2689,7 @@ const St = ({
|
|
|
2689
2689
|
size: "sm"
|
|
2690
2690
|
}
|
|
2691
2691
|
) }),
|
|
2692
|
-
/* @__PURE__ */
|
|
2692
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
2693
2693
|
/* @__PURE__ */ e(
|
|
2694
2694
|
ee,
|
|
2695
2695
|
{
|
|
@@ -2718,12 +2718,12 @@ const St = ({
|
|
|
2718
2718
|
className: "hidden",
|
|
2719
2719
|
ref: P,
|
|
2720
2720
|
onChange: W,
|
|
2721
|
-
accept:
|
|
2721
|
+
accept: f
|
|
2722
2722
|
}
|
|
2723
2723
|
)
|
|
2724
2724
|
] })
|
|
2725
2725
|
] }),
|
|
2726
|
-
m && /* @__PURE__ */
|
|
2726
|
+
m && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 p-3 bg-module-subtle rounded-lg border border-neutral", children: [
|
|
2727
2727
|
/* @__PURE__ */ e(oe, { icon: Ce, size: "sm", color: "warning" }),
|
|
2728
2728
|
/* @__PURE__ */ e(
|
|
2729
2729
|
ue,
|
|
@@ -2738,7 +2738,7 @@ const St = ({
|
|
|
2738
2738
|
/* @__PURE__ */ e(ee, { size: "sm", onClick: S, loading: F, children: "Create" }),
|
|
2739
2739
|
/* @__PURE__ */ e(ee, { size: "sm", variant: "ghost", onClick: () => $(!1), children: "Cancel" })
|
|
2740
2740
|
] }),
|
|
2741
|
-
/* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral
|
|
2741
|
+
/* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral", children: /* @__PURE__ */ e(
|
|
2742
2742
|
Le,
|
|
2743
2743
|
{
|
|
2744
2744
|
data: U,
|
|
@@ -2748,11 +2748,11 @@ const St = ({
|
|
|
2748
2748
|
onRowClick: (o) => o.type === "folder" ? Q(o.name) : I(o)
|
|
2749
2749
|
}
|
|
2750
2750
|
) })
|
|
2751
|
-
] }) : /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral
|
|
2751
|
+
] }) : /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral", children: /* @__PURE__ */ e(
|
|
2752
2752
|
Le,
|
|
2753
2753
|
{
|
|
2754
2754
|
data: C,
|
|
2755
|
-
columns:
|
|
2755
|
+
columns: fe,
|
|
2756
2756
|
loading: F,
|
|
2757
2757
|
emptyContent: "No storage mounts configured",
|
|
2758
2758
|
onRowClick: (o) => B(o)
|
|
@@ -2762,20 +2762,20 @@ const St = ({
|
|
|
2762
2762
|
{
|
|
2763
2763
|
id: "local",
|
|
2764
2764
|
label: "Local File",
|
|
2765
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */
|
|
2765
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-neutral rounded-xl bg-module-subtle/50", children: [
|
|
2766
2766
|
/* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: pe, size: "xl", color: "primary" }) }),
|
|
2767
2767
|
/* @__PURE__ */ e(Z, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
|
|
2768
|
-
/* @__PURE__ */
|
|
2768
|
+
/* @__PURE__ */ i(Z, { variant: "body", size: "sm", className: "text-muted mt-1 mb-6 text-center max-w-xs", children: [
|
|
2769
2769
|
"This file will be used directly in the form and will ",
|
|
2770
2770
|
/* @__PURE__ */ e("strong", { children: "not" }),
|
|
2771
2771
|
" be uploaded to platform storage."
|
|
2772
2772
|
] }),
|
|
2773
|
-
/* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2773
|
+
/* @__PURE__ */ i("label", { className: "cursor-pointer", children: [
|
|
2774
|
+
/* @__PURE__ */ i("div", { className: b(
|
|
2775
2775
|
"inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200 px-6 py-3 text-base bg-primary text-white hover:bg-primary-600",
|
|
2776
2776
|
F && "opacity-50 cursor-wait"
|
|
2777
2777
|
), children: [
|
|
2778
|
-
F && /* @__PURE__ */
|
|
2778
|
+
F && /* @__PURE__ */ i("svg", { className: "animate-spin h-4 w-4 mr-2", fill: "none", viewBox: "0 0 24 24", children: [
|
|
2779
2779
|
/* @__PURE__ */ e("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
2780
2780
|
/* @__PURE__ */ e("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
2781
2781
|
] }),
|
|
@@ -2786,8 +2786,8 @@ const St = ({
|
|
|
2786
2786
|
{
|
|
2787
2787
|
type: "file",
|
|
2788
2788
|
className: "hidden",
|
|
2789
|
-
onChange:
|
|
2790
|
-
accept:
|
|
2789
|
+
onChange: ae,
|
|
2790
|
+
accept: f,
|
|
2791
2791
|
disabled: F
|
|
2792
2792
|
}
|
|
2793
2793
|
)
|
|
@@ -2801,54 +2801,54 @@ const St = ({
|
|
|
2801
2801
|
)
|
|
2802
2802
|
] });
|
|
2803
2803
|
};
|
|
2804
|
-
function Me(t,
|
|
2805
|
-
return
|
|
2806
|
-
(r,
|
|
2804
|
+
function Me(t, a) {
|
|
2805
|
+
return a.split(".").reduce(
|
|
2806
|
+
(r, n) => r && typeof r == "object" && n in r ? r[n] : void 0,
|
|
2807
2807
|
t
|
|
2808
2808
|
);
|
|
2809
2809
|
}
|
|
2810
|
-
function Lt(t,
|
|
2811
|
-
const
|
|
2810
|
+
function Lt(t, a, r) {
|
|
2811
|
+
const n = a.split("."), s = Array.isArray(t) ? [...t] : { ...t };
|
|
2812
2812
|
let c = s;
|
|
2813
|
-
for (let
|
|
2814
|
-
const g =
|
|
2813
|
+
for (let f = 0; f < n.length - 1; f++) {
|
|
2814
|
+
const g = n[f], p = c[g];
|
|
2815
2815
|
c[g] = p && typeof p == "object" ? Array.isArray(p) ? [...p] : { ...p } : {}, c = c[g];
|
|
2816
2816
|
}
|
|
2817
|
-
return c[
|
|
2817
|
+
return c[n[n.length - 1]] = r, s;
|
|
2818
2818
|
}
|
|
2819
|
-
function Mt(t,
|
|
2820
|
-
const r =
|
|
2821
|
-
let s =
|
|
2819
|
+
function Mt(t, a) {
|
|
2820
|
+
const r = a.split("."), n = Array.isArray(t) ? [...t] : { ...t };
|
|
2821
|
+
let s = n;
|
|
2822
2822
|
for (let c = 0; c < r.length - 1; c++) {
|
|
2823
|
-
const
|
|
2824
|
-
if (!s[
|
|
2825
|
-
s[
|
|
2823
|
+
const f = r[c];
|
|
2824
|
+
if (!s[f] || typeof s[f] != "object") return n;
|
|
2825
|
+
s[f] = Array.isArray(s[f]) ? [...s[f]] : { ...s[f] }, s = s[f];
|
|
2826
2826
|
}
|
|
2827
|
-
return delete s[r[r.length - 1]],
|
|
2827
|
+
return delete s[r[r.length - 1]], n;
|
|
2828
2828
|
}
|
|
2829
2829
|
const tr = ({
|
|
2830
2830
|
groups: t,
|
|
2831
|
-
data:
|
|
2831
|
+
data: a,
|
|
2832
2832
|
onSubmit: r,
|
|
2833
|
-
onCancel:
|
|
2833
|
+
onCancel: n,
|
|
2834
2834
|
onChange: s,
|
|
2835
2835
|
transform: c,
|
|
2836
|
-
validate:
|
|
2836
|
+
validate: f,
|
|
2837
2837
|
submitButton: g = { label: "Submit", variant: "primary" },
|
|
2838
2838
|
cancelButton: p = { label: "Cancel", variant: "outline" },
|
|
2839
2839
|
showButtons: y = !0,
|
|
2840
2840
|
layout: u = "vertical",
|
|
2841
2841
|
size: l = "md",
|
|
2842
|
-
loading:
|
|
2843
|
-
className:
|
|
2842
|
+
loading: d = !1,
|
|
2843
|
+
className: h,
|
|
2844
2844
|
ref: C,
|
|
2845
|
-
sdk:
|
|
2845
|
+
sdk: w
|
|
2846
2846
|
}) => {
|
|
2847
|
-
const [
|
|
2847
|
+
const [N, B] = V(a || {}), [x, q] = V({}), [K, H] = V({});
|
|
2848
2848
|
G(() => {
|
|
2849
|
-
|
|
2850
|
-
}, [
|
|
2851
|
-
const F =
|
|
2849
|
+
a && B({ ...a });
|
|
2850
|
+
}, [a]);
|
|
2851
|
+
const F = ne(
|
|
2852
2852
|
(m, $, L) => {
|
|
2853
2853
|
const D = t.flatMap((P) => P.items).find((P) => P.name === m);
|
|
2854
2854
|
if (!D) return null;
|
|
@@ -2862,7 +2862,7 @@ const tr = ({
|
|
|
2862
2862
|
if (Array.isArray($) && D.arrayFields) {
|
|
2863
2863
|
const P = [];
|
|
2864
2864
|
let M = !1;
|
|
2865
|
-
if ($.forEach((te,
|
|
2865
|
+
if ($.forEach((te, ae) => {
|
|
2866
2866
|
const W = {};
|
|
2867
2867
|
for (const S of D.arrayFields) {
|
|
2868
2868
|
const I = te?.[S.name];
|
|
@@ -2873,7 +2873,7 @@ const tr = ({
|
|
|
2873
2873
|
O && (W[S.name] = O, M = !0);
|
|
2874
2874
|
}
|
|
2875
2875
|
}
|
|
2876
|
-
P[
|
|
2876
|
+
P[ae] = W;
|
|
2877
2877
|
}), M)
|
|
2878
2878
|
return JSON.stringify(P);
|
|
2879
2879
|
}
|
|
@@ -2881,10 +2881,10 @@ const tr = ({
|
|
|
2881
2881
|
return D.validator ? D.validator($, L) : null;
|
|
2882
2882
|
},
|
|
2883
2883
|
[t]
|
|
2884
|
-
), E =
|
|
2884
|
+
), E = ne(
|
|
2885
2885
|
(m, $) => {
|
|
2886
2886
|
let L = Lt(
|
|
2887
|
-
|
|
2887
|
+
N,
|
|
2888
2888
|
m,
|
|
2889
2889
|
$
|
|
2890
2890
|
);
|
|
@@ -2895,34 +2895,34 @@ const tr = ({
|
|
|
2895
2895
|
[m]: P || ""
|
|
2896
2896
|
})), s?.(L, m);
|
|
2897
2897
|
},
|
|
2898
|
-
[
|
|
2899
|
-
), J =
|
|
2898
|
+
[N, t, F, s]
|
|
2899
|
+
), J = ne(
|
|
2900
2900
|
async (m) => {
|
|
2901
|
-
if (console.log("handleSubmit"), m.preventDefault(),
|
|
2901
|
+
if (console.log("handleSubmit"), m.preventDefault(), d) return;
|
|
2902
2902
|
const $ = {}, L = t.flatMap((P) => P.items);
|
|
2903
2903
|
for (const P of L) {
|
|
2904
|
-
if (P.hidden || P.conditional && !P.conditional(
|
|
2904
|
+
if (P.hidden || P.conditional && !P.conditional(N))
|
|
2905
2905
|
continue;
|
|
2906
2906
|
const M = F(
|
|
2907
2907
|
P.name,
|
|
2908
|
-
Me(
|
|
2909
|
-
|
|
2908
|
+
Me(N, P.name),
|
|
2909
|
+
N
|
|
2910
2910
|
);
|
|
2911
2911
|
M && ($[P.name] = M);
|
|
2912
2912
|
}
|
|
2913
|
-
if (
|
|
2914
|
-
const P =
|
|
2913
|
+
if (f) {
|
|
2914
|
+
const P = f(N);
|
|
2915
2915
|
P && Object.assign($, P);
|
|
2916
2916
|
}
|
|
2917
2917
|
if (q($), console.log("newErrors", $), Object.keys($).some((P) => $[P]))
|
|
2918
2918
|
return;
|
|
2919
|
-
const D = c ? c(
|
|
2920
|
-
await r?.(
|
|
2919
|
+
const D = c ? c(N) : N;
|
|
2920
|
+
await r?.(N, D);
|
|
2921
2921
|
},
|
|
2922
|
-
[
|
|
2923
|
-
), z =
|
|
2922
|
+
[N, t, F, f, c, r, d]
|
|
2923
|
+
), z = ne(
|
|
2924
2924
|
(m) => {
|
|
2925
|
-
const $ = Me(
|
|
2925
|
+
const $ = Me(N, m.name), L = K[m.name] ? x[m.name] : void 0, D = m.disabled || d, P = {
|
|
2926
2926
|
value: $ || "",
|
|
2927
2927
|
disabled: D,
|
|
2928
2928
|
required: m.required,
|
|
@@ -2949,7 +2949,7 @@ const tr = ({
|
|
|
2949
2949
|
);
|
|
2950
2950
|
case "textarea":
|
|
2951
2951
|
return /* @__PURE__ */ e(
|
|
2952
|
-
|
|
2952
|
+
Ne,
|
|
2953
2953
|
{
|
|
2954
2954
|
...P,
|
|
2955
2955
|
onChange: (M) => E(m.name, M.target.value),
|
|
@@ -2986,7 +2986,7 @@ const tr = ({
|
|
|
2986
2986
|
}
|
|
2987
2987
|
);
|
|
2988
2988
|
case "radio":
|
|
2989
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1", children: m.options?.map((M) => /* @__PURE__ */
|
|
2989
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1", children: m.options?.map((M) => /* @__PURE__ */ i("label", { className: "flex items-center gap-2", children: [
|
|
2990
2990
|
/* @__PURE__ */ e(
|
|
2991
2991
|
"input",
|
|
2992
2992
|
{
|
|
@@ -3019,25 +3019,25 @@ const tr = ({
|
|
|
3019
3019
|
value: $,
|
|
3020
3020
|
onChange: (M) => E(m.name, M),
|
|
3021
3021
|
error: L,
|
|
3022
|
-
onListFiles: (M) =>
|
|
3022
|
+
onListFiles: (M) => w?.http.invoke({
|
|
3023
3023
|
method: "POST",
|
|
3024
3024
|
action: "storage.file.list",
|
|
3025
3025
|
body: M
|
|
3026
3026
|
}),
|
|
3027
|
-
onListMounts: () =>
|
|
3027
|
+
onListMounts: () => w?.http.invoke({
|
|
3028
3028
|
method: "GET",
|
|
3029
3029
|
action: "storage.mount"
|
|
3030
3030
|
}),
|
|
3031
|
-
onUploadFile: (M) =>
|
|
3031
|
+
onUploadFile: (M) => w?.http.invoke({
|
|
3032
3032
|
method: "POST",
|
|
3033
3033
|
action: "storage.file.upload",
|
|
3034
3034
|
body: M
|
|
3035
3035
|
}),
|
|
3036
|
-
onDownloadFile: (M) =>
|
|
3036
|
+
onDownloadFile: (M) => w?.http.invoke({
|
|
3037
3037
|
method: "GET",
|
|
3038
3038
|
action: `storage.file.${M}.download`
|
|
3039
3039
|
}),
|
|
3040
|
-
onRegisterFile: (M) =>
|
|
3040
|
+
onRegisterFile: (M) => w?.http.invoke({
|
|
3041
3041
|
method: "POST",
|
|
3042
3042
|
action: "storage.file.folder",
|
|
3043
3043
|
body: M
|
|
@@ -3059,7 +3059,7 @@ const tr = ({
|
|
|
3059
3059
|
te = JSON.parse(L);
|
|
3060
3060
|
} catch {
|
|
3061
3061
|
}
|
|
3062
|
-
const
|
|
3062
|
+
const ae = () => {
|
|
3063
3063
|
E(m.name, [...M, {}]);
|
|
3064
3064
|
}, W = (I) => {
|
|
3065
3065
|
E(
|
|
@@ -3073,8 +3073,8 @@ const tr = ({
|
|
|
3073
3073
|
[O]: A
|
|
3074
3074
|
}, E(m.name, Q);
|
|
3075
3075
|
};
|
|
3076
|
-
return /* @__PURE__ */
|
|
3077
|
-
M.map((I, O) => /* @__PURE__ */
|
|
3076
|
+
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
3077
|
+
M.map((I, O) => /* @__PURE__ */ i(
|
|
3078
3078
|
"div",
|
|
3079
3079
|
{
|
|
3080
3080
|
className: "p-4 border rounded-md dark:border-neutral-700 space-y-2 relative",
|
|
@@ -3092,12 +3092,12 @@ const tr = ({
|
|
|
3092
3092
|
) }),
|
|
3093
3093
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: m.arrayFields?.map((A) => {
|
|
3094
3094
|
const Q = te?.[O]?.[A.name];
|
|
3095
|
-
return /* @__PURE__ */
|
|
3095
|
+
return /* @__PURE__ */ i(
|
|
3096
3096
|
"div",
|
|
3097
3097
|
{
|
|
3098
3098
|
className: "space-y-1",
|
|
3099
3099
|
children: [
|
|
3100
|
-
/* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */
|
|
3100
|
+
/* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */ i(
|
|
3101
3101
|
Z,
|
|
3102
3102
|
{
|
|
3103
3103
|
variant: "label",
|
|
@@ -3141,7 +3141,7 @@ const tr = ({
|
|
|
3141
3141
|
);
|
|
3142
3142
|
case "textarea":
|
|
3143
3143
|
return /* @__PURE__ */ e(
|
|
3144
|
-
|
|
3144
|
+
Ne,
|
|
3145
3145
|
{
|
|
3146
3146
|
...re,
|
|
3147
3147
|
onChange: (U) => S(
|
|
@@ -3192,7 +3192,7 @@ const tr = ({
|
|
|
3192
3192
|
}
|
|
3193
3193
|
);
|
|
3194
3194
|
case "radio":
|
|
3195
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1", children: A.options?.map((U) => /* @__PURE__ */
|
|
3195
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1", children: A.options?.map((U) => /* @__PURE__ */ i(
|
|
3196
3196
|
"label",
|
|
3197
3197
|
{
|
|
3198
3198
|
className: "flex items-center gap-2",
|
|
@@ -3247,7 +3247,7 @@ const tr = ({
|
|
|
3247
3247
|
});
|
|
3248
3248
|
// Add other field types here as needed
|
|
3249
3249
|
default:
|
|
3250
|
-
return /* @__PURE__ */
|
|
3250
|
+
return /* @__PURE__ */ i("p", { children: [
|
|
3251
3251
|
"Unsupported field type in array:",
|
|
3252
3252
|
" ",
|
|
3253
3253
|
A.type
|
|
@@ -3272,13 +3272,13 @@ const tr = ({
|
|
|
3272
3272
|
},
|
|
3273
3273
|
O
|
|
3274
3274
|
)),
|
|
3275
|
-
/* @__PURE__ */
|
|
3275
|
+
/* @__PURE__ */ i(
|
|
3276
3276
|
ee,
|
|
3277
3277
|
{
|
|
3278
3278
|
type: "button",
|
|
3279
3279
|
variant: "outline",
|
|
3280
3280
|
size: "sm",
|
|
3281
|
-
onClick:
|
|
3281
|
+
onClick: ae,
|
|
3282
3282
|
disabled: D,
|
|
3283
3283
|
children: [
|
|
3284
3284
|
"Add ",
|
|
@@ -3292,12 +3292,12 @@ const tr = ({
|
|
|
3292
3292
|
return null;
|
|
3293
3293
|
}
|
|
3294
3294
|
},
|
|
3295
|
-
[
|
|
3296
|
-
), v =
|
|
3295
|
+
[N, K, x, d, l, E]
|
|
3296
|
+
), v = ne(
|
|
3297
3297
|
(m) => {
|
|
3298
|
-
if (m.conditional && !m.conditional(
|
|
3298
|
+
if (m.conditional && !m.conditional(N))
|
|
3299
3299
|
return null;
|
|
3300
|
-
const $ = m.items.filter((D) => !(D.hidden || D.conditional && !D.conditional(
|
|
3300
|
+
const $ = m.items.filter((D) => !(D.hidden || D.conditional && !D.conditional(N)));
|
|
3301
3301
|
if ($.length === 0) return null;
|
|
3302
3302
|
const L = b(
|
|
3303
3303
|
"space-y-2",
|
|
@@ -3313,12 +3313,12 @@ const tr = ({
|
|
|
3313
3313
|
},
|
|
3314
3314
|
m.className
|
|
3315
3315
|
);
|
|
3316
|
-
return /* @__PURE__ */
|
|
3316
|
+
return /* @__PURE__ */ i(
|
|
3317
3317
|
"div",
|
|
3318
3318
|
{
|
|
3319
3319
|
className: "grid grid-cols-1 md:grid-cols-3 gap-8 p-6 border border-neutral dark:border-neutral-700 rounded-xl",
|
|
3320
3320
|
children: [
|
|
3321
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ i("div", { className: "md:col-span-1", children: [
|
|
3322
3322
|
/* @__PURE__ */ e(
|
|
3323
3323
|
Z,
|
|
3324
3324
|
{
|
|
@@ -3339,7 +3339,7 @@ const tr = ({
|
|
|
3339
3339
|
}
|
|
3340
3340
|
)
|
|
3341
3341
|
] }),
|
|
3342
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: L, children: $.map((D) => (K[D.name] && x[D.name], /* @__PURE__ */
|
|
3342
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: L, children: $.map((D) => (K[D.name] && x[D.name], /* @__PURE__ */ i(
|
|
3343
3343
|
"div",
|
|
3344
3344
|
{
|
|
3345
3345
|
className: b(
|
|
@@ -3348,7 +3348,7 @@ const tr = ({
|
|
|
3348
3348
|
D.width && typeof D.width == "number" && `col-span-${D.width}`
|
|
3349
3349
|
),
|
|
3350
3350
|
children: [
|
|
3351
|
-
D.type !== "custom" && /* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */
|
|
3351
|
+
D.type !== "custom" && /* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */ i(
|
|
3352
3352
|
Z,
|
|
3353
3353
|
{
|
|
3354
3354
|
variant: "label",
|
|
@@ -3370,7 +3370,7 @@ const tr = ({
|
|
|
3370
3370
|
m.id
|
|
3371
3371
|
);
|
|
3372
3372
|
},
|
|
3373
|
-
[
|
|
3373
|
+
[N, K, x, z]
|
|
3374
3374
|
), T = b(
|
|
3375
3375
|
"space-y-6",
|
|
3376
3376
|
{
|
|
@@ -3379,19 +3379,19 @@ const tr = ({
|
|
|
3379
3379
|
"max-w-4xl": l === "lg",
|
|
3380
3380
|
"max-w-full": l === "full"
|
|
3381
3381
|
},
|
|
3382
|
-
|
|
3382
|
+
h
|
|
3383
3383
|
);
|
|
3384
|
-
return /* @__PURE__ */
|
|
3384
|
+
return /* @__PURE__ */ i("form", { ref: C, onSubmit: J, className: T, children: [
|
|
3385
3385
|
/* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(v) }),
|
|
3386
|
-
y && /* @__PURE__ */
|
|
3387
|
-
|
|
3386
|
+
y && /* @__PURE__ */ i("div", { className: b("flex gap-3 justify-end pt-8"), children: [
|
|
3387
|
+
n && /* @__PURE__ */ e(
|
|
3388
3388
|
ee,
|
|
3389
3389
|
{
|
|
3390
3390
|
type: "button",
|
|
3391
3391
|
variant: p.variant,
|
|
3392
3392
|
size: p.size || l,
|
|
3393
|
-
disabled: p.disabled ||
|
|
3394
|
-
onClick:
|
|
3393
|
+
disabled: p.disabled || d,
|
|
3394
|
+
onClick: n,
|
|
3395
3395
|
className: p.className,
|
|
3396
3396
|
children: p.label
|
|
3397
3397
|
}
|
|
@@ -3402,8 +3402,8 @@ const tr = ({
|
|
|
3402
3402
|
type: "submit",
|
|
3403
3403
|
variant: g.variant,
|
|
3404
3404
|
size: g.size || l,
|
|
3405
|
-
disabled: g.disabled ||
|
|
3406
|
-
loading:
|
|
3405
|
+
disabled: g.disabled || d,
|
|
3406
|
+
loading: d,
|
|
3407
3407
|
className: g.className,
|
|
3408
3408
|
children: g.label
|
|
3409
3409
|
}
|
|
@@ -3433,16 +3433,16 @@ const tr = ({
|
|
|
3433
3433
|
};
|
|
3434
3434
|
function rr({
|
|
3435
3435
|
variant: t = "default",
|
|
3436
|
-
size:
|
|
3436
|
+
size: a = "md",
|
|
3437
3437
|
dot: r = !1,
|
|
3438
|
-
icon:
|
|
3438
|
+
icon: n,
|
|
3439
3439
|
dismissible: s = !1,
|
|
3440
3440
|
onDismiss: c,
|
|
3441
|
-
className:
|
|
3441
|
+
className: f,
|
|
3442
3442
|
children: g,
|
|
3443
3443
|
...p
|
|
3444
3444
|
}) {
|
|
3445
|
-
return /* @__PURE__ */
|
|
3445
|
+
return /* @__PURE__ */ i(
|
|
3446
3446
|
"span",
|
|
3447
3447
|
{
|
|
3448
3448
|
className: b(
|
|
@@ -3451,8 +3451,8 @@ function rr({
|
|
|
3451
3451
|
// Variant styles
|
|
3452
3452
|
Et[t],
|
|
3453
3453
|
// Size styles
|
|
3454
|
-
$t[
|
|
3455
|
-
|
|
3454
|
+
$t[a],
|
|
3455
|
+
f
|
|
3456
3456
|
),
|
|
3457
3457
|
...p,
|
|
3458
3458
|
children: [
|
|
@@ -3465,7 +3465,7 @@ function rr({
|
|
|
3465
3465
|
)
|
|
3466
3466
|
}
|
|
3467
3467
|
),
|
|
3468
|
-
|
|
3468
|
+
n && /* @__PURE__ */ e("span", { className: b("flex-shrink-0", g && "mr-1"), children: n }),
|
|
3469
3469
|
g,
|
|
3470
3470
|
s && c && /* @__PURE__ */ e(
|
|
3471
3471
|
"button",
|
|
@@ -3505,36 +3505,36 @@ const Dt = {
|
|
|
3505
3505
|
lg: "text-base",
|
|
3506
3506
|
xl: "text-lg"
|
|
3507
3507
|
};
|
|
3508
|
-
function
|
|
3508
|
+
function nr({
|
|
3509
3509
|
size: t = "md",
|
|
3510
|
-
variant:
|
|
3510
|
+
variant: a = "primary",
|
|
3511
3511
|
label: r = "Loading...",
|
|
3512
|
-
showLabel:
|
|
3512
|
+
showLabel: n = !1,
|
|
3513
3513
|
className: s,
|
|
3514
3514
|
...c
|
|
3515
3515
|
}) {
|
|
3516
|
-
return /* @__PURE__ */
|
|
3516
|
+
return /* @__PURE__ */ i(
|
|
3517
3517
|
"div",
|
|
3518
3518
|
{
|
|
3519
3519
|
className: b(
|
|
3520
3520
|
"inline-flex items-center",
|
|
3521
|
-
|
|
3521
|
+
n ? "flex-col space-y-2" : "",
|
|
3522
3522
|
s
|
|
3523
3523
|
),
|
|
3524
3524
|
...c,
|
|
3525
3525
|
children: [
|
|
3526
|
-
/* @__PURE__ */
|
|
3526
|
+
/* @__PURE__ */ i(
|
|
3527
3527
|
"svg",
|
|
3528
3528
|
{
|
|
3529
3529
|
className: b(
|
|
3530
3530
|
"animate-spin",
|
|
3531
3531
|
Dt[t],
|
|
3532
|
-
Tt[
|
|
3532
|
+
Tt[a]
|
|
3533
3533
|
),
|
|
3534
3534
|
fill: "none",
|
|
3535
3535
|
viewBox: "0 0 24 24",
|
|
3536
|
-
"aria-hidden": !
|
|
3537
|
-
role:
|
|
3536
|
+
"aria-hidden": !n,
|
|
3537
|
+
role: n ? "status" : void 0,
|
|
3538
3538
|
children: [
|
|
3539
3539
|
/* @__PURE__ */ e(
|
|
3540
3540
|
"circle",
|
|
@@ -3558,7 +3558,7 @@ function ar({
|
|
|
3558
3558
|
]
|
|
3559
3559
|
}
|
|
3560
3560
|
),
|
|
3561
|
-
|
|
3561
|
+
n && /* @__PURE__ */ e(
|
|
3562
3562
|
"span",
|
|
3563
3563
|
{
|
|
3564
3564
|
className: b(
|
|
@@ -3568,35 +3568,35 @@ function ar({
|
|
|
3568
3568
|
children: r
|
|
3569
3569
|
}
|
|
3570
3570
|
),
|
|
3571
|
-
!
|
|
3571
|
+
!n && /* @__PURE__ */ e("span", { className: "sr-only", children: r })
|
|
3572
3572
|
]
|
|
3573
3573
|
}
|
|
3574
3574
|
);
|
|
3575
3575
|
}
|
|
3576
|
-
const
|
|
3576
|
+
const ar = ({
|
|
3577
3577
|
src: t,
|
|
3578
|
-
alt:
|
|
3578
|
+
alt: a,
|
|
3579
3579
|
size: r = "md",
|
|
3580
|
-
aspectRatio:
|
|
3580
|
+
aspectRatio: n = "auto",
|
|
3581
3581
|
radius: s = "md",
|
|
3582
3582
|
showLoading: c = !0,
|
|
3583
|
-
showError:
|
|
3583
|
+
showError: f = !0,
|
|
3584
3584
|
fallback: g,
|
|
3585
3585
|
loadingContent: p,
|
|
3586
3586
|
errorContent: y,
|
|
3587
3587
|
className: u,
|
|
3588
3588
|
onLoad: l,
|
|
3589
|
-
onError:
|
|
3590
|
-
...
|
|
3589
|
+
onError: d,
|
|
3590
|
+
...h
|
|
3591
3591
|
}) => {
|
|
3592
|
-
const [C,
|
|
3593
|
-
|
|
3592
|
+
const [C, w] = V(!0), [N, B] = V(!1), [x, q] = V(t), K = (T) => {
|
|
3593
|
+
w(!1), B(!1), l?.(T);
|
|
3594
3594
|
}, H = (T) => {
|
|
3595
|
-
if (
|
|
3596
|
-
q(g), B(!1),
|
|
3595
|
+
if (w(!1), B(!0), g && x !== g) {
|
|
3596
|
+
q(g), B(!1), w(!0);
|
|
3597
3597
|
return;
|
|
3598
3598
|
}
|
|
3599
|
-
|
|
3599
|
+
d?.(T);
|
|
3600
3600
|
}, F = b(
|
|
3601
3601
|
"relative overflow-hidden bg-neutral-100 dark:bg-neutral-800",
|
|
3602
3602
|
// Size variants
|
|
@@ -3610,10 +3610,10 @@ const nr = ({
|
|
|
3610
3610
|
},
|
|
3611
3611
|
// Aspect ratio variants
|
|
3612
3612
|
{
|
|
3613
|
-
"aspect-square":
|
|
3614
|
-
"aspect-video":
|
|
3615
|
-
"aspect-[3/4]":
|
|
3616
|
-
"aspect-[4/3]":
|
|
3613
|
+
"aspect-square": n === "square",
|
|
3614
|
+
"aspect-video": n === "video",
|
|
3615
|
+
"aspect-[3/4]": n === "portrait",
|
|
3616
|
+
"aspect-[4/3]": n === "landscape"
|
|
3617
3617
|
},
|
|
3618
3618
|
// Border radius variants
|
|
3619
3619
|
{
|
|
@@ -3628,13 +3628,13 @@ const nr = ({
|
|
|
3628
3628
|
), E = b(
|
|
3629
3629
|
"w-full h-full object-cover transition-opacity duration-200",
|
|
3630
3630
|
{
|
|
3631
|
-
"opacity-0": C ||
|
|
3632
|
-
"opacity-100": !C && !
|
|
3631
|
+
"opacity-0": C || N,
|
|
3632
|
+
"opacity-100": !C && !N
|
|
3633
3633
|
}
|
|
3634
3634
|
), J = b(
|
|
3635
3635
|
"absolute inset-0 flex items-center justify-center",
|
|
3636
3636
|
"text-neutral-400 dark:text-neutral-500"
|
|
3637
|
-
), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), v = /* @__PURE__ */
|
|
3637
|
+
), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), v = /* @__PURE__ */ i("div", { className: "text-center", children: [
|
|
3638
3638
|
/* @__PURE__ */ e(
|
|
3639
3639
|
"svg",
|
|
3640
3640
|
{
|
|
@@ -3655,47 +3655,47 @@ const nr = ({
|
|
|
3655
3655
|
),
|
|
3656
3656
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
3657
3657
|
] });
|
|
3658
|
-
return /* @__PURE__ */
|
|
3658
|
+
return /* @__PURE__ */ i("div", { className: F, children: [
|
|
3659
3659
|
/* @__PURE__ */ e(
|
|
3660
3660
|
"img",
|
|
3661
3661
|
{
|
|
3662
|
-
...
|
|
3662
|
+
...h,
|
|
3663
3663
|
src: x,
|
|
3664
|
-
alt:
|
|
3664
|
+
alt: a,
|
|
3665
3665
|
className: E,
|
|
3666
3666
|
onLoad: K,
|
|
3667
3667
|
onError: H
|
|
3668
3668
|
}
|
|
3669
3669
|
),
|
|
3670
3670
|
C && c && /* @__PURE__ */ e("div", { className: J, children: p || z }),
|
|
3671
|
-
|
|
3671
|
+
N && f && /* @__PURE__ */ e("div", { className: J, children: y || v })
|
|
3672
3672
|
] });
|
|
3673
3673
|
}, lr = ({
|
|
3674
3674
|
title: t,
|
|
3675
|
-
subtitle:
|
|
3675
|
+
subtitle: a,
|
|
3676
3676
|
actions: r = [],
|
|
3677
|
-
children:
|
|
3677
|
+
children: n,
|
|
3678
3678
|
className: s,
|
|
3679
3679
|
backLabel: c = "Back",
|
|
3680
|
-
backClassName:
|
|
3680
|
+
backClassName: f,
|
|
3681
3681
|
onBack: g,
|
|
3682
3682
|
editable: p = !1,
|
|
3683
3683
|
onTitleChange: y
|
|
3684
3684
|
}) => {
|
|
3685
|
-
const [u, l] = V(!1), [
|
|
3685
|
+
const [u, l] = V(!1), [d, h] = V(t), C = X(null);
|
|
3686
3686
|
G(() => {
|
|
3687
|
-
|
|
3687
|
+
h(t);
|
|
3688
3688
|
}, [t]), G(() => {
|
|
3689
3689
|
u && C.current && (C.current.focus(), C.current.select());
|
|
3690
3690
|
}, [u]);
|
|
3691
|
-
const
|
|
3691
|
+
const w = () => {
|
|
3692
3692
|
p && l(!0);
|
|
3693
|
-
},
|
|
3694
|
-
l(!1),
|
|
3693
|
+
}, N = () => {
|
|
3694
|
+
l(!1), d.trim() !== "" && d !== t && y ? y(d.trim()) : h(t);
|
|
3695
3695
|
}, B = (x) => {
|
|
3696
|
-
x.key === "Enter" ? C.current?.blur() : x.key === "Escape" && (
|
|
3696
|
+
x.key === "Enter" ? C.current?.blur() : x.key === "Escape" && (h(t), l(!1));
|
|
3697
3697
|
};
|
|
3698
|
-
return /* @__PURE__ */
|
|
3698
|
+
return /* @__PURE__ */ i(
|
|
3699
3699
|
"div",
|
|
3700
3700
|
{
|
|
3701
3701
|
className: b(
|
|
@@ -3703,8 +3703,8 @@ const nr = ({
|
|
|
3703
3703
|
s
|
|
3704
3704
|
),
|
|
3705
3705
|
children: [
|
|
3706
|
-
/* @__PURE__ */
|
|
3707
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */
|
|
3706
|
+
/* @__PURE__ */ i("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
3707
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2 text-neutral-900 dark:text-neutral-100", children: [
|
|
3708
3708
|
g && /* @__PURE__ */ e(
|
|
3709
3709
|
"button",
|
|
3710
3710
|
{
|
|
@@ -3712,9 +3712,9 @@ const nr = ({
|
|
|
3712
3712
|
onClick: g,
|
|
3713
3713
|
className: b(
|
|
3714
3714
|
"flex items-center text-sm dark:hover:text-neutral-300 cursor-pointer transition",
|
|
3715
|
-
|
|
3715
|
+
f
|
|
3716
3716
|
),
|
|
3717
|
-
children: /* @__PURE__ */ e(
|
|
3717
|
+
children: /* @__PURE__ */ e(we, { size: 16, color: "currentColor" })
|
|
3718
3718
|
}
|
|
3719
3719
|
),
|
|
3720
3720
|
u ? /* @__PURE__ */ e(
|
|
@@ -3722,16 +3722,16 @@ const nr = ({
|
|
|
3722
3722
|
{
|
|
3723
3723
|
ref: C,
|
|
3724
3724
|
type: "text",
|
|
3725
|
-
value:
|
|
3726
|
-
onChange: (x) =>
|
|
3727
|
-
onBlur:
|
|
3725
|
+
value: d,
|
|
3726
|
+
onChange: (x) => h(x.target.value),
|
|
3727
|
+
onBlur: N,
|
|
3728
3728
|
onKeyDown: B,
|
|
3729
3729
|
className: "text-1xl font-semibold bg-transparent border-b-1 border-gray-200 dark:border-gray-700 rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 flex-1"
|
|
3730
3730
|
}
|
|
3731
3731
|
) : /* @__PURE__ */ e(
|
|
3732
3732
|
"h2",
|
|
3733
3733
|
{
|
|
3734
|
-
onClick:
|
|
3734
|
+
onClick: w,
|
|
3735
3735
|
className: b(
|
|
3736
3736
|
"text-2xl font-semibold truncate",
|
|
3737
3737
|
p && "cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
|
|
@@ -3753,7 +3753,7 @@ const nr = ({
|
|
|
3753
3753
|
disabled: x.disabled
|
|
3754
3754
|
},
|
|
3755
3755
|
x.id
|
|
3756
|
-
) : /* @__PURE__ */
|
|
3756
|
+
) : /* @__PURE__ */ i(
|
|
3757
3757
|
"button",
|
|
3758
3758
|
{
|
|
3759
3759
|
type: "button",
|
|
@@ -3776,25 +3776,25 @@ const nr = ({
|
|
|
3776
3776
|
)
|
|
3777
3777
|
) })
|
|
3778
3778
|
] }),
|
|
3779
|
-
|
|
3779
|
+
n && /* @__PURE__ */ e("div", { className: "mt-4", children: n })
|
|
3780
3780
|
]
|
|
3781
3781
|
}
|
|
3782
3782
|
);
|
|
3783
3783
|
}, sr = ({
|
|
3784
3784
|
actions: t = [],
|
|
3785
|
-
onBack:
|
|
3785
|
+
onBack: a,
|
|
3786
3786
|
backLabel: r = "Back",
|
|
3787
|
-
className:
|
|
3787
|
+
className: n,
|
|
3788
3788
|
children: s
|
|
3789
|
-
}) => /* @__PURE__ */
|
|
3790
|
-
|
|
3789
|
+
}) => /* @__PURE__ */ i("div", { className: b("flex items-center gap-2 mb-3", n), children: [
|
|
3790
|
+
a && /* @__PURE__ */ i(
|
|
3791
3791
|
"button",
|
|
3792
3792
|
{
|
|
3793
3793
|
type: "button",
|
|
3794
|
-
onClick:
|
|
3794
|
+
onClick: a,
|
|
3795
3795
|
className: "flex items-center gap-1 text-sm text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 cursor-pointer transition px-2 py-1 rounded",
|
|
3796
3796
|
children: [
|
|
3797
|
-
/* @__PURE__ */ e(
|
|
3797
|
+
/* @__PURE__ */ e(we, { size: 16 }),
|
|
3798
3798
|
/* @__PURE__ */ e("span", { children: r })
|
|
3799
3799
|
]
|
|
3800
3800
|
}
|
|
@@ -3812,12 +3812,12 @@ const nr = ({
|
|
|
3812
3812
|
disabled: c.disabled
|
|
3813
3813
|
},
|
|
3814
3814
|
c.id
|
|
3815
|
-
) : /* @__PURE__ */
|
|
3815
|
+
) : /* @__PURE__ */ i(
|
|
3816
3816
|
"button",
|
|
3817
3817
|
{
|
|
3818
3818
|
type: "button",
|
|
3819
|
-
onClick: (
|
|
3820
|
-
|
|
3819
|
+
onClick: (f) => {
|
|
3820
|
+
f.stopPropagation(), f.target.blur(), c.onClick();
|
|
3821
3821
|
},
|
|
3822
3822
|
disabled: c.disabled,
|
|
3823
3823
|
className: b("btn", {
|
|
@@ -3835,17 +3835,17 @@ const nr = ({
|
|
|
3835
3835
|
)
|
|
3836
3836
|
) })
|
|
3837
3837
|
] });
|
|
3838
|
-
function It(t,
|
|
3839
|
-
return
|
|
3840
|
-
(r,
|
|
3838
|
+
function It(t, a) {
|
|
3839
|
+
return a.split(".").reduce(
|
|
3840
|
+
(r, n) => r && typeof r == "object" && n in r ? r[n] : void 0,
|
|
3841
3841
|
t
|
|
3842
3842
|
);
|
|
3843
3843
|
}
|
|
3844
3844
|
const or = ({
|
|
3845
3845
|
groups: t,
|
|
3846
|
-
data:
|
|
3846
|
+
data: a,
|
|
3847
3847
|
size: r = "md",
|
|
3848
|
-
className:
|
|
3848
|
+
className: n
|
|
3849
3849
|
}) => {
|
|
3850
3850
|
const s = (u) => {
|
|
3851
3851
|
if (!u) return "-";
|
|
@@ -3858,16 +3858,16 @@ const or = ({
|
|
|
3858
3858
|
} catch {
|
|
3859
3859
|
return String(u);
|
|
3860
3860
|
}
|
|
3861
|
-
}, c = (u) => u ? "Ja" : "Nee",
|
|
3861
|
+
}, c = (u) => u ? "Ja" : "Nee", f = (u, l) => {
|
|
3862
3862
|
if (!l) return String(u || "-");
|
|
3863
|
-
const
|
|
3864
|
-
return
|
|
3865
|
-
}, g =
|
|
3863
|
+
const d = l.find((h) => h.value === u);
|
|
3864
|
+
return d ? d.label : String(u || "-");
|
|
3865
|
+
}, g = ne(
|
|
3866
3866
|
(u) => {
|
|
3867
|
-
const l = It(
|
|
3867
|
+
const l = It(a, u.name);
|
|
3868
3868
|
if (u.type === "array") {
|
|
3869
|
-
const
|
|
3870
|
-
return !
|
|
3869
|
+
const h = l;
|
|
3870
|
+
return !h || h.length === 0 ? /* @__PURE__ */ e(
|
|
3871
3871
|
Z,
|
|
3872
3872
|
{
|
|
3873
3873
|
variant: "body",
|
|
@@ -3875,12 +3875,12 @@ const or = ({
|
|
|
3875
3875
|
className: "text-neutral-500 dark:text-neutral-400",
|
|
3876
3876
|
children: "Geen items"
|
|
3877
3877
|
}
|
|
3878
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
3878
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: h.map((C, w) => /* @__PURE__ */ i(
|
|
3879
3879
|
"div",
|
|
3880
3880
|
{
|
|
3881
3881
|
className: "p-4 border border-neutral-200 dark:border-neutral-700 rounded-lg space-y-3",
|
|
3882
3882
|
children: [
|
|
3883
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */
|
|
3883
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ i(
|
|
3884
3884
|
Z,
|
|
3885
3885
|
{
|
|
3886
3886
|
variant: "label",
|
|
@@ -3890,14 +3890,14 @@ const or = ({
|
|
|
3890
3890
|
children: [
|
|
3891
3891
|
u.label,
|
|
3892
3892
|
" ",
|
|
3893
|
-
|
|
3893
|
+
w + 1
|
|
3894
3894
|
]
|
|
3895
3895
|
}
|
|
3896
3896
|
) }),
|
|
3897
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: u.arrayFields?.map((
|
|
3898
|
-
const B = C?.[
|
|
3897
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: u.arrayFields?.map((N) => {
|
|
3898
|
+
const B = C?.[N.name];
|
|
3899
3899
|
let x = "-";
|
|
3900
|
-
switch (
|
|
3900
|
+
switch (N.type) {
|
|
3901
3901
|
case "text":
|
|
3902
3902
|
case "email":
|
|
3903
3903
|
case "number":
|
|
@@ -3908,9 +3908,9 @@ const or = ({
|
|
|
3908
3908
|
break;
|
|
3909
3909
|
case "select":
|
|
3910
3910
|
case "radio":
|
|
3911
|
-
x =
|
|
3911
|
+
x = f(
|
|
3912
3912
|
B,
|
|
3913
|
-
|
|
3913
|
+
N.options
|
|
3914
3914
|
);
|
|
3915
3915
|
break;
|
|
3916
3916
|
case "checkbox":
|
|
@@ -3920,21 +3920,21 @@ const or = ({
|
|
|
3920
3920
|
x = s(B);
|
|
3921
3921
|
break;
|
|
3922
3922
|
case "custom":
|
|
3923
|
-
x =
|
|
3923
|
+
x = N.customComponent?.({
|
|
3924
3924
|
value: B
|
|
3925
3925
|
});
|
|
3926
3926
|
break;
|
|
3927
3927
|
default:
|
|
3928
3928
|
x = String(B || "-");
|
|
3929
3929
|
}
|
|
3930
|
-
return
|
|
3930
|
+
return N.format && (x = N.format(B, C)), /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
3931
3931
|
/* @__PURE__ */ e(
|
|
3932
3932
|
Z,
|
|
3933
3933
|
{
|
|
3934
3934
|
variant: "label",
|
|
3935
3935
|
size: "xs",
|
|
3936
3936
|
className: "text-neutral-600 dark:text-neutral-400",
|
|
3937
|
-
children:
|
|
3937
|
+
children: N.label
|
|
3938
3938
|
}
|
|
3939
3939
|
),
|
|
3940
3940
|
/* @__PURE__ */ e(
|
|
@@ -3946,28 +3946,28 @@ const or = ({
|
|
|
3946
3946
|
children: x
|
|
3947
3947
|
}
|
|
3948
3948
|
)
|
|
3949
|
-
] },
|
|
3949
|
+
] }, N.name);
|
|
3950
3950
|
}) })
|
|
3951
3951
|
]
|
|
3952
3952
|
},
|
|
3953
|
-
|
|
3953
|
+
w
|
|
3954
3954
|
)) });
|
|
3955
3955
|
}
|
|
3956
3956
|
if (u.type === "custom" && u.customComponent)
|
|
3957
3957
|
return u.customComponent({ value: l });
|
|
3958
3958
|
if (u.format) {
|
|
3959
|
-
const
|
|
3959
|
+
const h = u.format(l, a);
|
|
3960
3960
|
return /* @__PURE__ */ e(
|
|
3961
3961
|
Z,
|
|
3962
3962
|
{
|
|
3963
3963
|
variant: "body",
|
|
3964
3964
|
size: "sm",
|
|
3965
3965
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
3966
|
-
children:
|
|
3966
|
+
children: h
|
|
3967
3967
|
}
|
|
3968
3968
|
);
|
|
3969
3969
|
}
|
|
3970
|
-
let
|
|
3970
|
+
let d = "-";
|
|
3971
3971
|
switch (u.type) {
|
|
3972
3972
|
case "text":
|
|
3973
3973
|
case "email":
|
|
@@ -3975,23 +3975,23 @@ const or = ({
|
|
|
3975
3975
|
case "number":
|
|
3976
3976
|
case "tel":
|
|
3977
3977
|
case "url":
|
|
3978
|
-
|
|
3978
|
+
d = l ? String(l) : "-";
|
|
3979
3979
|
break;
|
|
3980
3980
|
case "textarea":
|
|
3981
|
-
|
|
3981
|
+
d = l ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(l || "-") }) : "-";
|
|
3982
3982
|
break;
|
|
3983
3983
|
case "select":
|
|
3984
3984
|
case "radio":
|
|
3985
|
-
|
|
3985
|
+
d = f(l, u.options);
|
|
3986
3986
|
break;
|
|
3987
3987
|
case "checkbox":
|
|
3988
|
-
|
|
3988
|
+
d = c(l);
|
|
3989
3989
|
break;
|
|
3990
3990
|
case "date":
|
|
3991
|
-
|
|
3991
|
+
d = s(l);
|
|
3992
3992
|
break;
|
|
3993
3993
|
default:
|
|
3994
|
-
|
|
3994
|
+
d = l ? String(l) : "-";
|
|
3995
3995
|
}
|
|
3996
3996
|
return /* @__PURE__ */ e(
|
|
3997
3997
|
Z,
|
|
@@ -3999,18 +3999,18 @@ const or = ({
|
|
|
3999
3999
|
variant: "body",
|
|
4000
4000
|
size: "sm",
|
|
4001
4001
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
4002
|
-
children:
|
|
4002
|
+
children: d
|
|
4003
4003
|
}
|
|
4004
4004
|
);
|
|
4005
4005
|
},
|
|
4006
|
-
[
|
|
4007
|
-
), p =
|
|
4006
|
+
[a]
|
|
4007
|
+
), p = ne(
|
|
4008
4008
|
(u) => {
|
|
4009
|
-
if (u.conditional && !u.conditional(
|
|
4009
|
+
if (u.conditional && !u.conditional(a))
|
|
4010
4010
|
return null;
|
|
4011
|
-
const l = u.items.filter((
|
|
4011
|
+
const l = u.items.filter((h) => !(h.hidden || h.conditional && !h.conditional(a)));
|
|
4012
4012
|
if (l.length === 0) return null;
|
|
4013
|
-
const
|
|
4013
|
+
const d = b(
|
|
4014
4014
|
"space-y-4",
|
|
4015
4015
|
{
|
|
4016
4016
|
"grid gap-4": u.layout === "grid",
|
|
@@ -4024,12 +4024,12 @@ const or = ({
|
|
|
4024
4024
|
},
|
|
4025
4025
|
u.className
|
|
4026
4026
|
);
|
|
4027
|
-
return /* @__PURE__ */
|
|
4027
|
+
return /* @__PURE__ */ i(
|
|
4028
4028
|
"div",
|
|
4029
4029
|
{
|
|
4030
4030
|
className: "grid grid-cols-1 md:grid-cols-3 gap-8 p-6 border border-neutral dark:border-neutral-700 rounded-xl",
|
|
4031
4031
|
children: [
|
|
4032
|
-
/* @__PURE__ */
|
|
4032
|
+
/* @__PURE__ */ i("div", { className: "md:col-span-1", children: [
|
|
4033
4033
|
/* @__PURE__ */ e(
|
|
4034
4034
|
Z,
|
|
4035
4035
|
{
|
|
@@ -4050,35 +4050,35 @@ const or = ({
|
|
|
4050
4050
|
}
|
|
4051
4051
|
)
|
|
4052
4052
|
] }),
|
|
4053
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className:
|
|
4053
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: d, children: l.map((h) => /* @__PURE__ */ i(
|
|
4054
4054
|
"div",
|
|
4055
4055
|
{
|
|
4056
4056
|
className: b(
|
|
4057
4057
|
"space-y-1",
|
|
4058
|
-
|
|
4059
|
-
|
|
4058
|
+
h.width && typeof h.width == "string" && `w-[${h.width}]`,
|
|
4059
|
+
h.width && typeof h.width == "number" && `col-span-${h.width}`
|
|
4060
4060
|
),
|
|
4061
4061
|
children: [
|
|
4062
|
-
|
|
4062
|
+
h.type !== "custom" && /* @__PURE__ */ e(
|
|
4063
4063
|
Z,
|
|
4064
4064
|
{
|
|
4065
4065
|
variant: "label",
|
|
4066
4066
|
size: "sm",
|
|
4067
4067
|
className: "font-medium text-neutral-700 dark:text-neutral-300",
|
|
4068
|
-
children:
|
|
4068
|
+
children: h.label
|
|
4069
4069
|
}
|
|
4070
4070
|
),
|
|
4071
|
-
g(
|
|
4071
|
+
g(h)
|
|
4072
4072
|
]
|
|
4073
4073
|
},
|
|
4074
|
-
|
|
4074
|
+
h.name
|
|
4075
4075
|
)) }) })
|
|
4076
4076
|
]
|
|
4077
4077
|
},
|
|
4078
4078
|
u.id
|
|
4079
4079
|
);
|
|
4080
4080
|
},
|
|
4081
|
-
[
|
|
4081
|
+
[a, g]
|
|
4082
4082
|
), y = b(
|
|
4083
4083
|
"space-y-6",
|
|
4084
4084
|
{
|
|
@@ -4087,15 +4087,15 @@ const or = ({
|
|
|
4087
4087
|
"max-w-4xl": r === "lg",
|
|
4088
4088
|
"max-w-full": r === "full"
|
|
4089
4089
|
},
|
|
4090
|
-
|
|
4090
|
+
n
|
|
4091
4091
|
);
|
|
4092
4092
|
return /* @__PURE__ */ e("div", { className: y, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(p) }) });
|
|
4093
|
-
}, De = ({ item: t, isSelectedHandler:
|
|
4094
|
-
const [
|
|
4095
|
-
c && s(!
|
|
4096
|
-
}, g =
|
|
4097
|
-
return /* @__PURE__ */
|
|
4098
|
-
/* @__PURE__ */
|
|
4093
|
+
}, De = ({ item: t, isSelectedHandler: a, onClick: r }) => {
|
|
4094
|
+
const [n, s] = V(!1), c = t.children && t.children.length > 0, f = () => {
|
|
4095
|
+
c && s(!n);
|
|
4096
|
+
}, g = a ? a(t.path) : !1;
|
|
4097
|
+
return /* @__PURE__ */ i("li", { children: [
|
|
4098
|
+
/* @__PURE__ */ i(
|
|
4099
4099
|
"div",
|
|
4100
4100
|
{
|
|
4101
4101
|
className: b(
|
|
@@ -4107,21 +4107,21 @@ const or = ({
|
|
|
4107
4107
|
}
|
|
4108
4108
|
),
|
|
4109
4109
|
onClick: () => {
|
|
4110
|
-
c ?
|
|
4110
|
+
c ? f() : t.path && r?.(t.path);
|
|
4111
4111
|
},
|
|
4112
4112
|
children: [
|
|
4113
4113
|
t.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: t.icon }),
|
|
4114
4114
|
/* @__PURE__ */ e("span", { className: "flex-1", children: t.label }),
|
|
4115
4115
|
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e("span", { className: "ml-2 mr-1.5", children: t.count }),
|
|
4116
|
-
c && /* @__PURE__ */ e("span", { className: `${
|
|
4116
|
+
c && /* @__PURE__ */ e("span", { className: `${n ? "collapsed" : ""}`, children: /* @__PURE__ */ e(Re, { className: "w-4 h-4 text-muted" }) })
|
|
4117
4117
|
]
|
|
4118
4118
|
}
|
|
4119
4119
|
),
|
|
4120
|
-
c && !
|
|
4120
|
+
c && !n && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: t.children?.map((p, y) => /* @__PURE__ */ e(
|
|
4121
4121
|
De,
|
|
4122
4122
|
{
|
|
4123
4123
|
item: p,
|
|
4124
|
-
isSelectedHandler:
|
|
4124
|
+
isSelectedHandler: a,
|
|
4125
4125
|
onClick: r
|
|
4126
4126
|
},
|
|
4127
4127
|
y
|
|
@@ -4129,40 +4129,40 @@ const or = ({
|
|
|
4129
4129
|
] });
|
|
4130
4130
|
}, cr = ({
|
|
4131
4131
|
title: t,
|
|
4132
|
-
actionIcons:
|
|
4132
|
+
actionIcons: a,
|
|
4133
4133
|
items: r,
|
|
4134
|
-
isSelectedHandler:
|
|
4134
|
+
isSelectedHandler: n,
|
|
4135
4135
|
onClick: s,
|
|
4136
4136
|
preMenuItemsComponent: c
|
|
4137
|
-
}) => /* @__PURE__ */
|
|
4138
|
-
/* @__PURE__ */
|
|
4137
|
+
}) => /* @__PURE__ */ i("div", { className: "flex flex-col h-screen mb-6", children: [
|
|
4138
|
+
/* @__PURE__ */ i("div", { className: "sidebar-menu-header", children: [
|
|
4139
4139
|
/* @__PURE__ */ e("span", { className: "text-xl font-semibold text-default mb-2", children: t }),
|
|
4140
|
-
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children:
|
|
4140
|
+
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: a?.map((f, g) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: f }, g)) })
|
|
4141
4141
|
] }),
|
|
4142
4142
|
c && /* @__PURE__ */ e("div", { className: "sidebar-menu-pre-items mb-4", children: c }),
|
|
4143
4143
|
/* @__PURE__ */ e("ul", { children: r.map(
|
|
4144
|
-
(
|
|
4144
|
+
(f, g) => !f.path && !f.label && !f.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, g) : /* @__PURE__ */ e(
|
|
4145
4145
|
De,
|
|
4146
4146
|
{
|
|
4147
|
-
item:
|
|
4148
|
-
isSelectedHandler:
|
|
4147
|
+
item: f,
|
|
4148
|
+
isSelectedHandler: n,
|
|
4149
4149
|
onClick: s
|
|
4150
4150
|
},
|
|
4151
4151
|
g
|
|
4152
4152
|
)
|
|
4153
4153
|
) })
|
|
4154
|
-
] }),
|
|
4154
|
+
] }), ir = ({
|
|
4155
4155
|
level: t = 1,
|
|
4156
|
-
size:
|
|
4156
|
+
size: a,
|
|
4157
4157
|
weight: r = "bold",
|
|
4158
|
-
color:
|
|
4158
|
+
color: n = "current",
|
|
4159
4159
|
align: s = "left",
|
|
4160
4160
|
truncate: c = !1,
|
|
4161
|
-
className:
|
|
4161
|
+
className: f,
|
|
4162
4162
|
children: g,
|
|
4163
4163
|
...p
|
|
4164
4164
|
}) => {
|
|
4165
|
-
const y =
|
|
4165
|
+
const y = a || jt(t), u = b(
|
|
4166
4166
|
"font-primary",
|
|
4167
4167
|
// Size variants
|
|
4168
4168
|
{
|
|
@@ -4185,15 +4185,15 @@ const or = ({
|
|
|
4185
4185
|
},
|
|
4186
4186
|
// Color variants — semantische `--text-*` tokens (light+dark) net als Text/Table.
|
|
4187
4187
|
{
|
|
4188
|
-
"text-primary":
|
|
4189
|
-
"text-secondary":
|
|
4190
|
-
"text-[var(--text-accent)]":
|
|
4191
|
-
"text-[var(--text-success)]":
|
|
4192
|
-
"text-warning":
|
|
4193
|
-
"text-[var(--text-error)]":
|
|
4194
|
-
"text-info":
|
|
4195
|
-
"text-[var(--text-default)]":
|
|
4196
|
-
"text-current":
|
|
4188
|
+
"text-primary": n === "primary",
|
|
4189
|
+
"text-secondary": n === "secondary",
|
|
4190
|
+
"text-[var(--text-accent)]": n === "accent",
|
|
4191
|
+
"text-[var(--text-success)]": n === "success",
|
|
4192
|
+
"text-warning": n === "warning",
|
|
4193
|
+
"text-[var(--text-error)]": n === "error",
|
|
4194
|
+
"text-info": n === "info",
|
|
4195
|
+
"text-[var(--text-default)]": n === "neutral",
|
|
4196
|
+
"text-current": n === "current"
|
|
4197
4197
|
},
|
|
4198
4198
|
// Alignment
|
|
4199
4199
|
{
|
|
@@ -4205,7 +4205,7 @@ const or = ({
|
|
|
4205
4205
|
{
|
|
4206
4206
|
truncate: c
|
|
4207
4207
|
},
|
|
4208
|
-
|
|
4208
|
+
f
|
|
4209
4209
|
), l = `h${t}`;
|
|
4210
4210
|
return /* @__PURE__ */ e(l, { className: u, ...p, children: g });
|
|
4211
4211
|
};
|
|
@@ -4219,14 +4219,14 @@ function jt(t) {
|
|
|
4219
4219
|
6: "md"
|
|
4220
4220
|
}[t] || "md";
|
|
4221
4221
|
}
|
|
4222
|
-
const
|
|
4222
|
+
const dr = ({
|
|
4223
4223
|
items: t,
|
|
4224
|
-
type:
|
|
4224
|
+
type: a = "unordered",
|
|
4225
4225
|
variant: r = "default",
|
|
4226
|
-
size:
|
|
4226
|
+
size: n = "md",
|
|
4227
4227
|
interactive: s = !1,
|
|
4228
4228
|
className: c,
|
|
4229
|
-
itemClassName:
|
|
4229
|
+
itemClassName: f
|
|
4230
4230
|
}) => {
|
|
4231
4231
|
const g = b(
|
|
4232
4232
|
// Base styles
|
|
@@ -4244,19 +4244,19 @@ const ir = ({
|
|
|
4244
4244
|
},
|
|
4245
4245
|
// Size variants
|
|
4246
4246
|
{
|
|
4247
|
-
"text-sm":
|
|
4248
|
-
"text-base":
|
|
4249
|
-
"text-lg":
|
|
4247
|
+
"text-sm": n === "sm",
|
|
4248
|
+
"text-base": n === "md",
|
|
4249
|
+
"text-lg": n === "lg"
|
|
4250
4250
|
},
|
|
4251
4251
|
c
|
|
4252
|
-
), p = (l,
|
|
4252
|
+
), p = (l, d) => b(
|
|
4253
4253
|
// Base item styles
|
|
4254
4254
|
"transition-colors duration-200",
|
|
4255
4255
|
// Size-based padding
|
|
4256
4256
|
{
|
|
4257
|
-
"py-1 px-2":
|
|
4258
|
-
"py-2 px-3":
|
|
4259
|
-
"py-3 px-4":
|
|
4257
|
+
"py-1 px-2": n === "sm" && (r === "bordered" || r === "divided"),
|
|
4258
|
+
"py-2 px-3": n === "md" && (r === "bordered" || r === "divided"),
|
|
4259
|
+
"py-3 px-4": n === "lg" && (r === "bordered" || r === "divided")
|
|
4260
4260
|
},
|
|
4261
4261
|
// Interactive styles
|
|
4262
4262
|
s && !l.disabled && {
|
|
@@ -4267,145 +4267,145 @@ const ir = ({
|
|
|
4267
4267
|
l.disabled && {
|
|
4268
4268
|
"opacity-50 cursor-not-allowed": !0
|
|
4269
4269
|
},
|
|
4270
|
-
|
|
4270
|
+
f
|
|
4271
4271
|
), y = (l) => {
|
|
4272
4272
|
s && !l.disabled && l.onClick && l.onClick();
|
|
4273
|
-
}, u = (l,
|
|
4274
|
-
s && !
|
|
4273
|
+
}, u = (l, d) => {
|
|
4274
|
+
s && !d.disabled && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), d.onClick?.());
|
|
4275
4275
|
};
|
|
4276
|
-
return
|
|
4276
|
+
return a === "ordered" ? /* @__PURE__ */ e("ol", { className: g, children: t.map((l, d) => /* @__PURE__ */ e(
|
|
4277
4277
|
"li",
|
|
4278
4278
|
{
|
|
4279
4279
|
className: p(l),
|
|
4280
4280
|
onClick: () => y(l),
|
|
4281
|
-
onKeyDown: (
|
|
4281
|
+
onKeyDown: (h) => u(h, l),
|
|
4282
4282
|
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
4283
4283
|
role: s ? "button" : void 0,
|
|
4284
4284
|
children: l.content
|
|
4285
4285
|
},
|
|
4286
|
-
l.id ||
|
|
4287
|
-
)) }) :
|
|
4286
|
+
l.id || d
|
|
4287
|
+
)) }) : a === "description" ? /* @__PURE__ */ e("dl", { className: g, children: t.map((l, d) => /* @__PURE__ */ e(
|
|
4288
4288
|
"div",
|
|
4289
4289
|
{
|
|
4290
4290
|
className: p(l),
|
|
4291
4291
|
onClick: () => y(l),
|
|
4292
|
-
onKeyDown: (
|
|
4292
|
+
onKeyDown: (h) => u(h, l),
|
|
4293
4293
|
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
4294
4294
|
role: s ? "button" : void 0,
|
|
4295
4295
|
children: l.content
|
|
4296
4296
|
},
|
|
4297
|
-
l.id ||
|
|
4298
|
-
)) }) : /* @__PURE__ */ e("ul", { className: g, children: t.map((l,
|
|
4297
|
+
l.id || d
|
|
4298
|
+
)) }) : /* @__PURE__ */ e("ul", { className: g, children: t.map((l, d) => /* @__PURE__ */ e(
|
|
4299
4299
|
"li",
|
|
4300
4300
|
{
|
|
4301
4301
|
className: p(l),
|
|
4302
4302
|
onClick: () => y(l),
|
|
4303
|
-
onKeyDown: (
|
|
4303
|
+
onKeyDown: (h) => u(h, l),
|
|
4304
4304
|
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
4305
4305
|
role: s ? "button" : void 0,
|
|
4306
4306
|
children: l.content
|
|
4307
4307
|
},
|
|
4308
|
-
l.id ||
|
|
4308
|
+
l.id || d
|
|
4309
4309
|
)) });
|
|
4310
4310
|
}, ur = ({
|
|
4311
4311
|
commands: t,
|
|
4312
|
-
isOpen:
|
|
4312
|
+
isOpen: a,
|
|
4313
4313
|
onClose: r,
|
|
4314
|
-
labels:
|
|
4314
|
+
labels: n,
|
|
4315
4315
|
initialCommandPath: s,
|
|
4316
4316
|
initialActiveIndex: c
|
|
4317
4317
|
}) => {
|
|
4318
|
-
const [
|
|
4319
|
-
(
|
|
4318
|
+
const [f, g] = V(""), [p, y] = V(s || []), [u, l] = V(c || 0), d = X(null), h = X(null), w = (p.length ? t.find((N) => N.id === p[0])?.subCommands || [] : t).filter(
|
|
4319
|
+
(N) => N.label.toLowerCase().includes(f.toLowerCase())
|
|
4320
4320
|
);
|
|
4321
4321
|
return G(() => {
|
|
4322
|
-
|
|
4323
|
-
}, [
|
|
4324
|
-
const
|
|
4325
|
-
if (
|
|
4322
|
+
a || (g(""), y(s || []), l(c || 0));
|
|
4323
|
+
}, [a]), G(() => {
|
|
4324
|
+
const N = (B) => {
|
|
4325
|
+
if (a) {
|
|
4326
4326
|
if (B.key === "Escape")
|
|
4327
4327
|
r();
|
|
4328
4328
|
else if (B.key === "ArrowUp")
|
|
4329
4329
|
l(
|
|
4330
|
-
(x) => x > 0 ? x - 1 :
|
|
4330
|
+
(x) => x > 0 ? x - 1 : w.length - 1
|
|
4331
4331
|
);
|
|
4332
4332
|
else if (B.key === "ArrowDown")
|
|
4333
4333
|
l(
|
|
4334
|
-
(x) => x <
|
|
4334
|
+
(x) => x < w.length - 1 ? x + 1 : 0
|
|
4335
4335
|
);
|
|
4336
4336
|
else if (B.key === "Enter") {
|
|
4337
|
-
const x =
|
|
4337
|
+
const x = w[u];
|
|
4338
4338
|
x && (x.subCommands ? (y([...p, x.id]), l(0)) : x.action && (x.action(), r()));
|
|
4339
4339
|
}
|
|
4340
4340
|
}
|
|
4341
4341
|
};
|
|
4342
|
-
return document.addEventListener("keydown",
|
|
4343
|
-
}, [
|
|
4344
|
-
const
|
|
4345
|
-
|
|
4342
|
+
return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
|
|
4343
|
+
}, [a, r, w, u, p]), G(() => {
|
|
4344
|
+
const N = (B) => {
|
|
4345
|
+
d.current && !d.current.contains(B.target) && r();
|
|
4346
4346
|
};
|
|
4347
|
-
return
|
|
4348
|
-
}, [
|
|
4349
|
-
if (!
|
|
4350
|
-
|
|
4351
|
-
}, [u,
|
|
4347
|
+
return a && document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
4348
|
+
}, [a, r]), G(() => {
|
|
4349
|
+
if (!a) return;
|
|
4350
|
+
h.current?.querySelector(`[data-index="${u}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4351
|
+
}, [u, a]), a ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 flex items-center justify-center shadow-lvl-0", children: /* @__PURE__ */ i(
|
|
4352
4352
|
"div",
|
|
4353
4353
|
{
|
|
4354
4354
|
className: "flex flex-col w-full max-w-lg max-h-[80vh] p-2 mx-auto rounded-lg shadow-lg bg-white",
|
|
4355
|
-
ref:
|
|
4355
|
+
ref: d,
|
|
4356
4356
|
children: [
|
|
4357
4357
|
/* @__PURE__ */ e(
|
|
4358
4358
|
"input",
|
|
4359
4359
|
{
|
|
4360
4360
|
type: "text",
|
|
4361
|
-
placeholder:
|
|
4362
|
-
value:
|
|
4363
|
-
onChange: (
|
|
4361
|
+
placeholder: n?.searchPlaceholder || "Search commands...",
|
|
4362
|
+
value: f,
|
|
4363
|
+
onChange: (N) => g(N.target.value),
|
|
4364
4364
|
className: "w-full px-4 py-2 text-gray-800 border-none border-b border-gray-200 focus:outline-none focus:ring-0 rounded-lg bg-transparent flex-shrink-0"
|
|
4365
4365
|
}
|
|
4366
4366
|
),
|
|
4367
|
-
/* @__PURE__ */
|
|
4367
|
+
/* @__PURE__ */ i(
|
|
4368
4368
|
"div",
|
|
4369
4369
|
{
|
|
4370
|
-
ref:
|
|
4370
|
+
ref: h,
|
|
4371
4371
|
className: "mt-2 pt-2 text-sm border-t border-gray-200 max-h-[50vh] overflow-y-auto",
|
|
4372
4372
|
children: [
|
|
4373
|
-
|
|
4374
|
-
|
|
4373
|
+
w.length === 0 && /* @__PURE__ */ e("div", { className: "text-gray-500 text-center text-sm", children: n?.noCommandsFound || "No commands found" }),
|
|
4374
|
+
w.map((N, B) => /* @__PURE__ */ i(
|
|
4375
4375
|
"div",
|
|
4376
4376
|
{
|
|
4377
4377
|
"data-index": B,
|
|
4378
4378
|
className: `flex items-center p-2 cursor-pointer rounded-md text-secondary-800 ${B === u ? "bg-gray-100" : ""}`,
|
|
4379
4379
|
onClick: () => {
|
|
4380
|
-
|
|
4380
|
+
N.subCommands ? (y([...p, N.id]), l(0)) : N.action && (N.action(), r());
|
|
4381
4381
|
},
|
|
4382
4382
|
onMouseEnter: () => l(B),
|
|
4383
4383
|
children: [
|
|
4384
|
-
|
|
4385
|
-
/* @__PURE__ */ e("span", { className: "flex-grow", children:
|
|
4386
|
-
|
|
4384
|
+
N.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: N.icon }),
|
|
4385
|
+
/* @__PURE__ */ e("span", { className: "flex-grow", children: N.label }),
|
|
4386
|
+
N.subCommands && /* @__PURE__ */ e("span", { className: "text-gray-400", children: /* @__PURE__ */ e(qe, { className: "w-4 h-4" }) })
|
|
4387
4387
|
]
|
|
4388
4388
|
},
|
|
4389
|
-
|
|
4389
|
+
N.id
|
|
4390
4390
|
))
|
|
4391
4391
|
]
|
|
4392
4392
|
}
|
|
4393
4393
|
),
|
|
4394
|
-
/* @__PURE__ */
|
|
4395
|
-
/* @__PURE__ */
|
|
4394
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between pt-2 mt-2 text-xs text-gray-500 border-t border-gray-200", children: [
|
|
4395
|
+
/* @__PURE__ */ i("span", { children: [
|
|
4396
4396
|
/* @__PURE__ */ e("span", { className: "font-bold", children: "↑↓" }),
|
|
4397
4397
|
" ",
|
|
4398
|
-
|
|
4398
|
+
n?.navigate || "to navigate"
|
|
4399
4399
|
] }),
|
|
4400
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ i("span", { children: [
|
|
4401
4401
|
/* @__PURE__ */ e("span", { className: "font-bold", children: "↵" }),
|
|
4402
4402
|
" ",
|
|
4403
|
-
|
|
4403
|
+
n?.select || "to select"
|
|
4404
4404
|
] }),
|
|
4405
|
-
/* @__PURE__ */
|
|
4405
|
+
/* @__PURE__ */ i("span", { children: [
|
|
4406
4406
|
/* @__PURE__ */ e("span", { className: "font-bold", children: "Esc" }),
|
|
4407
4407
|
" ",
|
|
4408
|
-
|
|
4408
|
+
n?.close || "to close"
|
|
4409
4409
|
] })
|
|
4410
4410
|
] })
|
|
4411
4411
|
]
|
|
@@ -4475,12 +4475,12 @@ const ir = ({
|
|
|
4475
4475
|
}, Te = ce(
|
|
4476
4476
|
({
|
|
4477
4477
|
padding: t,
|
|
4478
|
-
margin:
|
|
4478
|
+
margin: a,
|
|
4479
4479
|
background: r,
|
|
4480
|
-
radius:
|
|
4480
|
+
radius: n,
|
|
4481
4481
|
shadow: s,
|
|
4482
4482
|
border: c,
|
|
4483
|
-
borderColor:
|
|
4483
|
+
borderColor: f,
|
|
4484
4484
|
className: g,
|
|
4485
4485
|
children: p,
|
|
4486
4486
|
...y
|
|
@@ -4490,12 +4490,12 @@ const ir = ({
|
|
|
4490
4490
|
ref: u,
|
|
4491
4491
|
className: b(
|
|
4492
4492
|
t && Bt[t],
|
|
4493
|
-
|
|
4493
|
+
a && Pt[a],
|
|
4494
4494
|
r && _t[r],
|
|
4495
|
-
|
|
4495
|
+
n && Ot[n],
|
|
4496
4496
|
s && Vt[s],
|
|
4497
4497
|
c && Ft[c],
|
|
4498
|
-
|
|
4498
|
+
f && Wt[f],
|
|
4499
4499
|
g
|
|
4500
4500
|
),
|
|
4501
4501
|
...y,
|
|
@@ -4504,73 +4504,73 @@ const ir = ({
|
|
|
4504
4504
|
)
|
|
4505
4505
|
);
|
|
4506
4506
|
Te.displayName = "Box";
|
|
4507
|
-
const mr = ({ children: t, title:
|
|
4508
|
-
|
|
4507
|
+
const mr = ({ children: t, title: a, ...r }) => /* @__PURE__ */ i(Te, { background: "module", radius: "xl", shadow: "sm", ...r, children: [
|
|
4508
|
+
a && /* @__PURE__ */ e("span", { className: "text-base font-medium text-default mb-2", children: a }),
|
|
4509
4509
|
t
|
|
4510
4510
|
] });
|
|
4511
|
-
function
|
|
4511
|
+
function fr({
|
|
4512
4512
|
identifier: t,
|
|
4513
|
-
resourceLoader:
|
|
4513
|
+
resourceLoader: a,
|
|
4514
4514
|
framework: r = "react",
|
|
4515
|
-
fallback:
|
|
4515
|
+
fallback: n,
|
|
4516
4516
|
componentProps: s,
|
|
4517
4517
|
className: c
|
|
4518
4518
|
}) {
|
|
4519
|
-
const
|
|
4519
|
+
const f = X(null), [g, p] = V(!0), [y, u] = V(null), l = X(null);
|
|
4520
4520
|
return X(null), G(() => {
|
|
4521
|
-
let
|
|
4521
|
+
let d = !0;
|
|
4522
4522
|
return (async () => {
|
|
4523
4523
|
p(!0);
|
|
4524
4524
|
try {
|
|
4525
|
-
const C = await
|
|
4526
|
-
if (!
|
|
4527
|
-
const
|
|
4528
|
-
u(r === "react" ? () =>
|
|
4525
|
+
const C = await a();
|
|
4526
|
+
if (!d) return;
|
|
4527
|
+
const w = C.component || C.default || C;
|
|
4528
|
+
u(r === "react" ? () => w : () => C);
|
|
4529
4529
|
} catch (C) {
|
|
4530
4530
|
console.error(`[FederatedResource] Load failed: ${t}`, C);
|
|
4531
4531
|
} finally {
|
|
4532
|
-
|
|
4532
|
+
d && p(!1);
|
|
4533
4533
|
}
|
|
4534
4534
|
})(), () => {
|
|
4535
|
-
|
|
4535
|
+
d = !1;
|
|
4536
4536
|
};
|
|
4537
|
-
}, [t,
|
|
4537
|
+
}, [t, a]), G(() => {
|
|
4538
4538
|
if (g || !y || r === "react") return;
|
|
4539
|
-
const
|
|
4540
|
-
if (
|
|
4539
|
+
const d = f.current;
|
|
4540
|
+
if (d) {
|
|
4541
4541
|
if (r === "svelte") {
|
|
4542
|
-
const
|
|
4542
|
+
const h = y.default || y, C = new h({ target: d, props: s || {} });
|
|
4543
4543
|
return l.current = C, () => C.$destroy();
|
|
4544
4544
|
}
|
|
4545
4545
|
if (y.mount) {
|
|
4546
|
-
const
|
|
4546
|
+
const h = y.mount({ container: d, props: s || {} });
|
|
4547
4547
|
return () => {
|
|
4548
|
-
typeof
|
|
4548
|
+
typeof h == "function" ? h() : y.unmount?.(d);
|
|
4549
4549
|
};
|
|
4550
4550
|
}
|
|
4551
4551
|
}
|
|
4552
4552
|
}, [y, r, g]), G(() => {
|
|
4553
4553
|
r === "svelte" && l.current && l.current.$set?.(s);
|
|
4554
|
-
}, [s, r]), /* @__PURE__ */
|
|
4555
|
-
g &&
|
|
4554
|
+
}, [s, r]), /* @__PURE__ */ i("div", { ref: f, className: c, style: { display: "contents" }, children: [
|
|
4555
|
+
g && n,
|
|
4556
4556
|
r === "react" && y && /* @__PURE__ */ e(y, { ...s })
|
|
4557
4557
|
] });
|
|
4558
4558
|
}
|
|
4559
|
-
class
|
|
4559
|
+
class hr extends Ue {
|
|
4560
4560
|
constructor() {
|
|
4561
4561
|
super(...arguments), this.state = {
|
|
4562
4562
|
hasError: !1,
|
|
4563
4563
|
error: null
|
|
4564
4564
|
};
|
|
4565
4565
|
}
|
|
4566
|
-
static getDerivedStateFromError(
|
|
4567
|
-
return { hasError: !0, error:
|
|
4566
|
+
static getDerivedStateFromError(a) {
|
|
4567
|
+
return { hasError: !0, error: a };
|
|
4568
4568
|
}
|
|
4569
|
-
componentDidCatch(
|
|
4570
|
-
console.error(`[ErrorBoundary] Error in ${this.props.name || "Component"}:`,
|
|
4569
|
+
componentDidCatch(a, r) {
|
|
4570
|
+
console.error(`[ErrorBoundary] Error in ${this.props.name || "Component"}:`, a, r);
|
|
4571
4571
|
}
|
|
4572
4572
|
render() {
|
|
4573
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
4573
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ i("div", { className: "p-4 m-4 border border-red-200 bg-red-50 rounded-lg", children: [
|
|
4574
4574
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-red-800", children: "Something went wrong" }),
|
|
4575
4575
|
/* @__PURE__ */ e("p", { className: "text-sm text-red-600 mt-1", children: this.props.name ? `Error in ${this.props.name}` : "The component failed to render." }),
|
|
4576
4576
|
/* @__PURE__ */ e(
|
|
@@ -4592,33 +4592,33 @@ export {
|
|
|
4592
4592
|
mr as Card,
|
|
4593
4593
|
ge as Checkbox,
|
|
4594
4594
|
ur as CommandPalette,
|
|
4595
|
-
|
|
4595
|
+
dt as ContentLoading,
|
|
4596
4596
|
ye as DatePicker,
|
|
4597
4597
|
ut as Dropdown,
|
|
4598
|
-
|
|
4599
|
-
|
|
4598
|
+
hr as ErrorBoundary,
|
|
4599
|
+
fr as FederatedResource,
|
|
4600
4600
|
tr as Form,
|
|
4601
|
-
|
|
4601
|
+
ir as Heading,
|
|
4602
4602
|
oe as Icon,
|
|
4603
|
-
|
|
4603
|
+
ar as Image,
|
|
4604
4604
|
Qt as Link,
|
|
4605
|
-
|
|
4605
|
+
dr as List,
|
|
4606
4606
|
Jt as MeetingGrid,
|
|
4607
|
-
|
|
4607
|
+
kt as Modal,
|
|
4608
4608
|
lr as PageHeader,
|
|
4609
4609
|
sr as PageToolbar,
|
|
4610
4610
|
Yt as ParticipantTile,
|
|
4611
4611
|
lt as SearchableTextField,
|
|
4612
4612
|
ve as Select,
|
|
4613
4613
|
cr as SidebarMenu,
|
|
4614
|
-
|
|
4614
|
+
nr as Spinner,
|
|
4615
4615
|
$e as SplitButton,
|
|
4616
4616
|
St as StorageInput,
|
|
4617
4617
|
er as TabBar,
|
|
4618
4618
|
Le as Table,
|
|
4619
|
-
|
|
4619
|
+
Nt as Tabs,
|
|
4620
4620
|
Z as Text,
|
|
4621
|
-
|
|
4621
|
+
Ne as TextArea,
|
|
4622
4622
|
ue as TextField,
|
|
4623
4623
|
Zt as VideoSurface,
|
|
4624
4624
|
or as View,
|