@opencxh/ui-kit 3.137.3 → 3.137.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +249 -230
- package/dist/index.js.map +1 -1
- package/dist/src/content/PageHeader.d.ts +3 -0
- package/dist/src/content/SectionCaption.d.ts +29 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx as et } from "clsx";
|
|
2
2
|
import { jsxs as i, jsx as e, Fragment as ve } from "react/jsx-runtime";
|
|
3
|
-
import { VideoOff as tt, User as rt, MicOff as nt, Mic as st, X as we, ChevronDown as Se, ExternalLink as at, Calendar as lt, ChevronLeft as Ee, ChevronRight as ze, ChevronDownIcon as ot, Loader2 as ct, Search as Me, Check as Ie, ChevronUp as it, Ellipsis as dt, FileText as Te, HardDrive as Pe, ArrowLeft as ut, FolderPlus as mt, Upload as ft, Folder as je, Trash2 as ht, Plus as xt, Sparkles as bt, ImageOff as
|
|
4
|
-
import oe, { useRef as se, useEffect as X, forwardRef as xe, useState as O, useLayoutEffect as yt, useMemo as
|
|
3
|
+
import { VideoOff as tt, User as rt, MicOff as nt, Mic as st, X as we, ChevronDown as Se, ExternalLink as at, Calendar as lt, ChevronLeft as Ee, ChevronRight as ze, ChevronDownIcon as ot, Loader2 as ct, Search as Me, Check as Ie, ChevronUp as it, Ellipsis as dt, FileText as Te, HardDrive as Pe, ArrowLeft as ut, FolderPlus as mt, Upload as ft, Folder as je, Trash2 as ht, Plus as xt, Sparkles as bt, ImageOff as pt, Pencil as gt, ArrowUpRight as vt } from "lucide-react";
|
|
4
|
+
import oe, { useRef as se, useEffect as X, forwardRef as xe, useState as O, useLayoutEffect as yt, useMemo as ge, useCallback as he, createContext as Nt, Component as wt } from "react";
|
|
5
5
|
import kt from "dompurify";
|
|
6
6
|
import Ct from "react-markdown";
|
|
7
7
|
import St from "remark-gfm";
|
|
@@ -255,8 +255,8 @@ function $e(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start
|
|
|
255
255
|
const u = () => {
|
|
256
256
|
const m = r.current;
|
|
257
257
|
if (!m) return;
|
|
258
|
-
const y = m.getBoundingClientRect(), x = window.innerHeight - y.bottom, h = y.top, b = a.startsWith("top"), v = b ? h < 200 && x > h : x < 200 && h > x, k = b !== v,
|
|
259
|
-
k ? (
|
|
258
|
+
const y = m.getBoundingClientRect(), x = window.innerHeight - y.bottom, h = y.top, b = a.startsWith("top"), v = b ? h < 200 && x > h : x < 200 && h > x, k = b !== v, p = { position: "fixed" };
|
|
259
|
+
k ? (p.bottom = window.innerHeight - y.top + n, p.maxHeight = Math.max(120, h - n * 2)) : (p.top = y.bottom + n, p.maxHeight = Math.max(120, x - n * 2)), a.endsWith("end") ? p.right = window.innerWidth - y.right : p.left = y.left, s && (p.width = y.width), o(p);
|
|
260
260
|
};
|
|
261
261
|
return u(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
262
262
|
window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
@@ -276,17 +276,17 @@ const Ve = ({
|
|
|
276
276
|
const [m, y] = O(!1), x = se(null), h = se(null), b = $e(m, h, { placement: n });
|
|
277
277
|
X(() => {
|
|
278
278
|
if (!m) return;
|
|
279
|
-
const
|
|
279
|
+
const p = ($) => {
|
|
280
280
|
x.current && !x.current.contains($.target) && y(!1);
|
|
281
281
|
}, f = ($) => {
|
|
282
282
|
$.key === "Escape" && y(!1);
|
|
283
283
|
};
|
|
284
|
-
return document.addEventListener("mousedown",
|
|
285
|
-
document.removeEventListener("mousedown",
|
|
284
|
+
return document.addEventListener("mousedown", p), document.addEventListener("keydown", f), () => {
|
|
285
|
+
document.removeEventListener("mousedown", p), document.removeEventListener("keydown", f);
|
|
286
286
|
};
|
|
287
287
|
}, [m]);
|
|
288
|
-
const v = (
|
|
289
|
-
|
|
288
|
+
const v = (p) => {
|
|
289
|
+
p.stopPropagation(), !o && y((f) => !f);
|
|
290
290
|
}, k = () => y(!1);
|
|
291
291
|
return /* @__PURE__ */ i("div", { ref: x, className: d("relative inline-flex", a), children: [
|
|
292
292
|
/* @__PURE__ */ e(
|
|
@@ -358,7 +358,7 @@ function Lt({
|
|
|
358
358
|
title: b,
|
|
359
359
|
className: v
|
|
360
360
|
}) {
|
|
361
|
-
const k = l && !!y,
|
|
361
|
+
const k = l && !!y, p = s === "pill" ? "rounded-full" : "rounded-md", f = _t({ active: l, tone: n, shape: s, size: a, className: v }), $ = /* @__PURE__ */ i(ve, { children: [
|
|
362
362
|
r,
|
|
363
363
|
t,
|
|
364
364
|
o && /* @__PURE__ */ e(Q, { icon: Se, size: "xs" })
|
|
@@ -368,7 +368,7 @@ function Lt({
|
|
|
368
368
|
type: "button",
|
|
369
369
|
"aria-label": x,
|
|
370
370
|
onClick: y,
|
|
371
|
-
className: d("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring",
|
|
371
|
+
className: d("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", p),
|
|
372
372
|
children: /* @__PURE__ */ e(Q, { icon: we, size: "xs" })
|
|
373
373
|
}
|
|
374
374
|
);
|
|
@@ -609,7 +609,7 @@ const Ht = {
|
|
|
609
609
|
id: m,
|
|
610
610
|
...y
|
|
611
611
|
}, x) => {
|
|
612
|
-
const h = oe.useId(), b = m || `checkbox-${h}`, v = !!n, k = oe.useRef(null),
|
|
612
|
+
const h = oe.useId(), b = m || `checkbox-${h}`, v = !!n, k = oe.useRef(null), p = oe.useCallback(
|
|
613
613
|
(f) => {
|
|
614
614
|
k.current = f, typeof x == "function" ? x(f) : x && typeof x == "object" && (x.current = f);
|
|
615
615
|
},
|
|
@@ -622,7 +622,7 @@ const Ht = {
|
|
|
622
622
|
/* @__PURE__ */ e(
|
|
623
623
|
"input",
|
|
624
624
|
{
|
|
625
|
-
ref:
|
|
625
|
+
ref: p,
|
|
626
626
|
id: b,
|
|
627
627
|
type: "checkbox",
|
|
628
628
|
"aria-invalid": v || void 0,
|
|
@@ -677,7 +677,7 @@ const Ut = () => /* @__PURE__ */ e(Q, { icon: lt, size: "md", color: "current" }
|
|
|
677
677
|
format: y = "MM/dd/yyyy",
|
|
678
678
|
withTime: x = !1
|
|
679
679
|
}, h) => {
|
|
680
|
-
const [b, v] = O(!1), [k,
|
|
680
|
+
const [b, v] = O(!1), [k, p] = O(() => t || /* @__PURE__ */ new Date()), f = se(null), $ = se(null), C = $e(b, $);
|
|
681
681
|
X(() => {
|
|
682
682
|
const c = (S) => {
|
|
683
683
|
f.current && !f.current.contains(S.target) && v(!1);
|
|
@@ -688,16 +688,16 @@ const Ut = () => /* @__PURE__ */ e(Q, { icon: lt, size: "md", color: "current" }
|
|
|
688
688
|
}, [b]);
|
|
689
689
|
const q = (c) => {
|
|
690
690
|
if (!c) return "";
|
|
691
|
-
const S = c.getDate().toString().padStart(2, "0"),
|
|
691
|
+
const S = c.getDate().toString().padStart(2, "0"), g = (c.getMonth() + 1).toString().padStart(2, "0"), _ = c.getFullYear(), N = y === "dd/MM/yyyy" ? `${S}/${g}/${_}` : y === "yyyy-MM-dd" ? `${_}-${g}-${S}` : `${g}/${S}/${_}`;
|
|
692
692
|
return x ? `${N} ${T(c)}` : N;
|
|
693
693
|
}, T = (c) => `${c.getHours().toString().padStart(2, "0")}:${c.getMinutes().toString().padStart(2, "0")}`, G = (c) => {
|
|
694
|
-
const [S,
|
|
695
|
-
if (Number.isNaN(S) || Number.isNaN(
|
|
694
|
+
const [S, g] = c.split(":").map(Number);
|
|
695
|
+
if (Number.isNaN(S) || Number.isNaN(g)) return;
|
|
696
696
|
const _ = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
697
|
-
_.setHours(S,
|
|
697
|
+
_.setHours(S, g, 0, 0), r?.(_);
|
|
698
698
|
}, V = () => {
|
|
699
|
-
const c = k.getFullYear(), S = k.getMonth(),
|
|
700
|
-
_.setDate(_.getDate() -
|
|
699
|
+
const c = k.getFullYear(), S = k.getMonth(), g = new Date(c, S, 1), _ = new Date(g);
|
|
700
|
+
_.setDate(_.getDate() - g.getDay());
|
|
701
701
|
const N = [], U = new Date(_);
|
|
702
702
|
for (let re = 0; re < 42; re++)
|
|
703
703
|
N.push(new Date(U)), U.setDate(U.getDate() + 1);
|
|
@@ -705,16 +705,16 @@ const Ut = () => /* @__PURE__ */ e(Q, { icon: lt, size: "md", color: "current" }
|
|
|
705
705
|
}, I = (c) => {
|
|
706
706
|
if (c.getMonth() === k.getMonth() && !(u && c < u) && !(m && c > m)) {
|
|
707
707
|
if (x) {
|
|
708
|
-
const
|
|
709
|
-
|
|
708
|
+
const g = new Date(c);
|
|
709
|
+
g.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(g);
|
|
710
710
|
return;
|
|
711
711
|
}
|
|
712
712
|
r?.(c), v(!1);
|
|
713
713
|
}
|
|
714
714
|
}, H = () => {
|
|
715
|
-
|
|
715
|
+
p(new Date(k.getFullYear(), k.getMonth() - 1, 1));
|
|
716
716
|
}, te = () => {
|
|
717
|
-
|
|
717
|
+
p(new Date(k.getFullYear(), k.getMonth() + 1, 1));
|
|
718
718
|
}, J = () => {
|
|
719
719
|
r?.(null), v(!1);
|
|
720
720
|
}, K = d(
|
|
@@ -797,7 +797,7 @@ const Ut = () => /* @__PURE__ */ e(Q, { icon: lt, size: "md", color: "current" }
|
|
|
797
797
|
] }),
|
|
798
798
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((c) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: c }, c)) }),
|
|
799
799
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: ce.map((c, S) => {
|
|
800
|
-
const
|
|
800
|
+
const g = c.getMonth() === k.getMonth(), _ = t && c.toDateString() === t.toDateString(), N = c.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), U = !g || u && c < u || m && c > m;
|
|
801
801
|
return /* @__PURE__ */ e(
|
|
802
802
|
"button",
|
|
803
803
|
{
|
|
@@ -806,7 +806,7 @@ const Ut = () => /* @__PURE__ */ e(Q, { icon: lt, size: "md", color: "current" }
|
|
|
806
806
|
className: d(
|
|
807
807
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
808
808
|
{
|
|
809
|
-
"text-text hover:bg-surface-hover":
|
|
809
|
+
"text-text hover:bg-surface-hover": g && !_ && !U,
|
|
810
810
|
"bg-accent text-accent-fg": _,
|
|
811
811
|
"bg-surface-hover text-text": N && !_,
|
|
812
812
|
"text-text-muted cursor-not-allowed": U
|
|
@@ -872,7 +872,7 @@ const Ut = () => /* @__PURE__ */ e(Q, { icon: lt, size: "md", color: "current" }
|
|
|
872
872
|
searchable: b,
|
|
873
873
|
multiple: v,
|
|
874
874
|
value: k,
|
|
875
|
-
onChange:
|
|
875
|
+
onChange: p,
|
|
876
876
|
allowCreate: f,
|
|
877
877
|
onCreateOption: $,
|
|
878
878
|
...C
|
|
@@ -889,7 +889,7 @@ const Ut = () => /* @__PURE__ */ e(Q, { icon: lt, size: "md", color: "current" }
|
|
|
889
889
|
(z) => ke(z.value) === ke(A) || ke(z.label) === ke(A)
|
|
890
890
|
),
|
|
891
891
|
[]
|
|
892
|
-
),
|
|
892
|
+
), g = oe.useCallback(
|
|
893
893
|
(D, A) => {
|
|
894
894
|
const z = [...D], F = (j) => {
|
|
895
895
|
const B = (j ?? "").trim();
|
|
@@ -904,15 +904,15 @@ const Ut = () => /* @__PURE__ */ e(Q, { icon: lt, size: "md", color: "current" }
|
|
|
904
904
|
const A = [...o];
|
|
905
905
|
return D.forEach((z) => {
|
|
906
906
|
!S(A, z.value) && !S(A, z.label) && A.push(z);
|
|
907
|
-
}),
|
|
907
|
+
}), g(A, k);
|
|
908
908
|
});
|
|
909
|
-
}, [o, k,
|
|
909
|
+
}, [o, k, g, S]);
|
|
910
910
|
const _ = (D) => {
|
|
911
911
|
if (v) {
|
|
912
912
|
const A = Array.isArray(k) ? k : [], z = A.includes(D) ? A.filter((F) => F !== D) : [...A, D];
|
|
913
|
-
|
|
913
|
+
p?.(z);
|
|
914
914
|
} else
|
|
915
|
-
|
|
915
|
+
p?.(D), I(!1), te("");
|
|
916
916
|
}, N = v ? null : w.find((D) => D.value === k), U = v ? w.filter(
|
|
917
917
|
(D) => Array.isArray(k) && k.includes(D.value)
|
|
918
918
|
) : [], re = b && H ? w.filter(
|
|
@@ -1025,7 +1025,7 @@ const Ut = () => /* @__PURE__ */ e(Q, { icon: lt, size: "md", color: "current" }
|
|
|
1025
1025
|
{
|
|
1026
1026
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
1027
1027
|
onClick: () => {
|
|
1028
|
-
|
|
1028
|
+
p?.(""), I(!1);
|
|
1029
1029
|
},
|
|
1030
1030
|
children: u
|
|
1031
1031
|
}
|
|
@@ -1098,12 +1098,12 @@ const Jt = {
|
|
|
1098
1098
|
id: h,
|
|
1099
1099
|
...b
|
|
1100
1100
|
}, v) => {
|
|
1101
|
-
const k = oe.useId(),
|
|
1101
|
+
const k = oe.useId(), p = h || `textfield-${k}`, f = !!n, $ = n || r ? `${p}-description` : void 0;
|
|
1102
1102
|
return /* @__PURE__ */ i("div", { className: d("flex flex-col", a && "w-full", m), children: [
|
|
1103
1103
|
t && /* @__PURE__ */ e(
|
|
1104
1104
|
"label",
|
|
1105
1105
|
{
|
|
1106
|
-
htmlFor:
|
|
1106
|
+
htmlFor: p,
|
|
1107
1107
|
className: d(
|
|
1108
1108
|
Ue,
|
|
1109
1109
|
f ? "text-danger-fg" : "text-text-muted",
|
|
@@ -1118,7 +1118,7 @@ const Jt = {
|
|
|
1118
1118
|
"input",
|
|
1119
1119
|
{
|
|
1120
1120
|
ref: v,
|
|
1121
|
-
id:
|
|
1121
|
+
id: p,
|
|
1122
1122
|
"aria-invalid": f || void 0,
|
|
1123
1123
|
"aria-describedby": $,
|
|
1124
1124
|
className: d(
|
|
@@ -1197,7 +1197,7 @@ function Yt({
|
|
|
1197
1197
|
)
|
|
1198
1198
|
] });
|
|
1199
1199
|
}
|
|
1200
|
-
const
|
|
1200
|
+
const pe = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(Me, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Zt = (t) => /* @__PURE__ */ e(Se, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Qt = {
|
|
1201
1201
|
sm: "h-control-sm px-3 text-sm",
|
|
1202
1202
|
md: "h-control-md px-3 text-base",
|
|
1203
1203
|
lg: "h-control-lg px-3 text-base",
|
|
@@ -1224,7 +1224,7 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1224
1224
|
onRemoteSearch: b,
|
|
1225
1225
|
onSelect: v,
|
|
1226
1226
|
debounceTime: k = 500,
|
|
1227
|
-
showAllOnOpen:
|
|
1227
|
+
showAllOnOpen: p = !1,
|
|
1228
1228
|
value: f,
|
|
1229
1229
|
onChange: $,
|
|
1230
1230
|
...C
|
|
@@ -1233,13 +1233,13 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1233
1233
|
X(() => {
|
|
1234
1234
|
f !== void 0 && te(f);
|
|
1235
1235
|
}, [f]);
|
|
1236
|
-
const
|
|
1237
|
-
if (
|
|
1236
|
+
const g = ge(() => {
|
|
1237
|
+
if (p && !c || !H) return h;
|
|
1238
1238
|
const P = String(H).toLowerCase();
|
|
1239
1239
|
return h.filter(
|
|
1240
1240
|
(D) => String(D.label).toLowerCase().includes(P)
|
|
1241
1241
|
);
|
|
1242
|
-
}, [H, h,
|
|
1242
|
+
}, [H, h, p, c]);
|
|
1243
1243
|
X(() => {
|
|
1244
1244
|
if (!b || !H) {
|
|
1245
1245
|
w(!1);
|
|
@@ -1271,11 +1271,11 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1271
1271
|
te(P.label), K(!1), S(!1), v && v(P.value);
|
|
1272
1272
|
}, U = () => {
|
|
1273
1273
|
(h.length > 0 || b) && (K(!0), S(!1));
|
|
1274
|
-
}, re = o || ce, ee = J && (
|
|
1274
|
+
}, re = o || ce, ee = J && (g.length > 0 || re), Y = ge(() => q || I, [q]);
|
|
1275
1275
|
return /* @__PURE__ */ i(
|
|
1276
1276
|
"div",
|
|
1277
1277
|
{
|
|
1278
|
-
className:
|
|
1278
|
+
className: pe(
|
|
1279
1279
|
"flex flex-col",
|
|
1280
1280
|
a ? "w-full" : "",
|
|
1281
1281
|
u || "",
|
|
@@ -1287,7 +1287,7 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1287
1287
|
"label",
|
|
1288
1288
|
{
|
|
1289
1289
|
htmlFor: T,
|
|
1290
|
-
className:
|
|
1290
|
+
className: pe(
|
|
1291
1291
|
"block text-sm font-medium mb-1",
|
|
1292
1292
|
G ? "text-danger-fg" : "text-text",
|
|
1293
1293
|
m || ""
|
|
@@ -1296,7 +1296,7 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1296
1296
|
}
|
|
1297
1297
|
),
|
|
1298
1298
|
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1299
|
-
l && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className:
|
|
1299
|
+
l && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: pe("text-text-muted", _e[s]), children: l }) }),
|
|
1300
1300
|
/* @__PURE__ */ e(
|
|
1301
1301
|
"input",
|
|
1302
1302
|
{
|
|
@@ -1305,7 +1305,7 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1305
1305
|
value: H,
|
|
1306
1306
|
onChange: _,
|
|
1307
1307
|
onFocus: U,
|
|
1308
|
-
className:
|
|
1308
|
+
className: pe(
|
|
1309
1309
|
// Base styles
|
|
1310
1310
|
"block w-full rounded-tile border bg-surface-input transition-colors duration-fast ease-out",
|
|
1311
1311
|
"placeholder:text-text-subtle focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -1328,7 +1328,7 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1328
1328
|
/* @__PURE__ */ e(
|
|
1329
1329
|
ct,
|
|
1330
1330
|
{
|
|
1331
|
-
className:
|
|
1331
|
+
className: pe("animate-spin text-info-fg", _e[s]),
|
|
1332
1332
|
"aria-hidden": !0
|
|
1333
1333
|
}
|
|
1334
1334
|
)
|
|
@@ -1337,7 +1337,7 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1337
1337
|
/* @__PURE__ */ e(
|
|
1338
1338
|
Zt,
|
|
1339
1339
|
{
|
|
1340
|
-
className:
|
|
1340
|
+
className: pe(
|
|
1341
1341
|
"text-text-muted cursor-pointer transition-transform",
|
|
1342
1342
|
_e[s],
|
|
1343
1343
|
J ? "rotate-180" : "rotate-0"
|
|
@@ -1354,7 +1354,7 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1354
1354
|
{
|
|
1355
1355
|
className: "absolute z-10 mt-1 w-full bg-surface border border-border rounded-lg shadow-lg max-h-60 overflow-auto top-full",
|
|
1356
1356
|
role: "listbox",
|
|
1357
|
-
children:
|
|
1357
|
+
children: g.length > 0 ? g.map((P) => /* @__PURE__ */ e(
|
|
1358
1358
|
"li",
|
|
1359
1359
|
{
|
|
1360
1360
|
className: "px-4 py-2 cursor-pointer text-text hover:bg-accent-soft hover:text-accent transition-colors",
|
|
@@ -1370,7 +1370,7 @@ const ge = (...t) => t.filter(Boolean).join(" "), Xt = (t) => /* @__PURE__ */ e(
|
|
|
1370
1370
|
(n || r) && /* @__PURE__ */ e(
|
|
1371
1371
|
"p",
|
|
1372
1372
|
{
|
|
1373
|
-
className:
|
|
1373
|
+
className: pe(
|
|
1374
1374
|
"mt-1 text-xs",
|
|
1375
1375
|
G ? "text-danger-fg" : "text-text-muted"
|
|
1376
1376
|
),
|
|
@@ -1566,7 +1566,7 @@ const nr = ({
|
|
|
1566
1566
|
showCheck: u = !0,
|
|
1567
1567
|
header: m
|
|
1568
1568
|
}) => {
|
|
1569
|
-
const [y, x] = O(!1), [h, b] = O(null), [v, k] = O({ top: 0, left: 0 }),
|
|
1569
|
+
const [y, x] = O(!1), [h, b] = O(null), [v, k] = O({ top: 0, left: 0 }), p = se(null), f = se(null), $ = se(null), C = se(null), q = $e(y, f, { placement: a }), T = se(null), G = () => Array.from(
|
|
1570
1570
|
C.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1571
1571
|
);
|
|
1572
1572
|
X(() => {
|
|
@@ -1574,15 +1574,15 @@ const nr = ({
|
|
|
1574
1574
|
}, [y]);
|
|
1575
1575
|
const V = (c) => {
|
|
1576
1576
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(c.key)) return;
|
|
1577
|
-
const
|
|
1578
|
-
if (
|
|
1577
|
+
const g = G();
|
|
1578
|
+
if (g.length === 0) return;
|
|
1579
1579
|
c.preventDefault();
|
|
1580
|
-
const _ =
|
|
1581
|
-
|
|
1580
|
+
const _ = g.indexOf(document.activeElement), N = c.key === "Home" ? 0 : c.key === "End" ? g.length - 1 : c.key === "ArrowDown" ? (_ + 1) % g.length : (_ - 1 + g.length) % g.length;
|
|
1581
|
+
g[N]?.focus();
|
|
1582
1582
|
};
|
|
1583
1583
|
X(() => {
|
|
1584
1584
|
const c = (S) => {
|
|
1585
|
-
|
|
1585
|
+
p.current && (!p.current.contains(S.target) || $.current && !$.current.contains(S.target)) && (x(!1), b(null), T.current && (clearTimeout(T.current), T.current = null));
|
|
1586
1586
|
};
|
|
1587
1587
|
return y && document.addEventListener("mousedown", c), () => {
|
|
1588
1588
|
document.removeEventListener("mousedown", c);
|
|
@@ -1595,8 +1595,8 @@ const nr = ({
|
|
|
1595
1595
|
document.removeEventListener("keydown", c);
|
|
1596
1596
|
};
|
|
1597
1597
|
}, [y]), X(() => {
|
|
1598
|
-
if (h &&
|
|
1599
|
-
const c =
|
|
1598
|
+
if (h && p.current) {
|
|
1599
|
+
const c = p.current.querySelector(
|
|
1600
1600
|
`[data-option-value="${h}"]`
|
|
1601
1601
|
);
|
|
1602
1602
|
if (c) {
|
|
@@ -1612,16 +1612,16 @@ const nr = ({
|
|
|
1612
1612
|
}, []);
|
|
1613
1613
|
const I = (c) => {
|
|
1614
1614
|
c.stopPropagation(), !l && (x(!y), b(null), T.current && (clearTimeout(T.current), T.current = null));
|
|
1615
|
-
}, H = (c, S,
|
|
1616
|
-
c.stopPropagation(), !S.disabled && !S.divider && (!S.children || S.children.length === 0) && (s?.(S.value,
|
|
1615
|
+
}, H = (c, S, g) => {
|
|
1616
|
+
c.stopPropagation(), !S.disabled && !S.divider && (!S.children || S.children.length === 0) && (s?.(S.value, g), x(!1), b(null));
|
|
1617
1617
|
}, te = (c) => {
|
|
1618
1618
|
T.current && (clearTimeout(T.current), T.current = null), c.children && c.children.length > 0 ? b(c.value) : b(null);
|
|
1619
1619
|
}, J = (c) => {
|
|
1620
1620
|
c.children && c.children.length > 0 ? T.current = setTimeout(() => {
|
|
1621
1621
|
b(null);
|
|
1622
1622
|
}, 150) : b(null);
|
|
1623
|
-
}, K = (c, S,
|
|
1624
|
-
c.stopPropagation(), !S.disabled && !S.divider && (s?.(S.value,
|
|
1623
|
+
}, K = (c, S, g) => {
|
|
1624
|
+
c.stopPropagation(), !S.disabled && !S.divider && (s?.(S.value, g), x(!1), b(null));
|
|
1625
1625
|
}, ce = d(
|
|
1626
1626
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1627
1627
|
"max-h-60 overflow-auto"
|
|
@@ -1632,7 +1632,7 @@ const nr = ({
|
|
|
1632
1632
|
return /* @__PURE__ */ i(
|
|
1633
1633
|
"div",
|
|
1634
1634
|
{
|
|
1635
|
-
ref:
|
|
1635
|
+
ref: p,
|
|
1636
1636
|
className: d(
|
|
1637
1637
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-surface-hover",
|
|
1638
1638
|
o
|
|
@@ -1663,14 +1663,14 @@ const nr = ({
|
|
|
1663
1663
|
},
|
|
1664
1664
|
`divider-${S}`
|
|
1665
1665
|
);
|
|
1666
|
-
const
|
|
1666
|
+
const g = c.children && c.children.length > 0, _ = h === c.value;
|
|
1667
1667
|
return /* @__PURE__ */ i("div", { className: "relative group", children: [
|
|
1668
1668
|
/* @__PURE__ */ i(
|
|
1669
1669
|
"button",
|
|
1670
1670
|
{
|
|
1671
1671
|
"data-option-value": c.value,
|
|
1672
1672
|
role: "menuitem",
|
|
1673
|
-
"aria-haspopup":
|
|
1673
|
+
"aria-haspopup": g ? "menu" : void 0,
|
|
1674
1674
|
onClick: (N) => H(N, c),
|
|
1675
1675
|
onMouseEnter: () => te(c),
|
|
1676
1676
|
onMouseLeave: () => J(c),
|
|
@@ -1679,7 +1679,7 @@ const nr = ({
|
|
|
1679
1679
|
"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover focus-visible:outline-none focus-visible:focus-ring",
|
|
1680
1680
|
{
|
|
1681
1681
|
"opacity-50 cursor-not-allowed": c.disabled,
|
|
1682
|
-
"bg-surface-hover": _ &&
|
|
1682
|
+
"bg-surface-hover": _ && g
|
|
1683
1683
|
}
|
|
1684
1684
|
),
|
|
1685
1685
|
children: [
|
|
@@ -1692,12 +1692,12 @@ const nr = ({
|
|
|
1692
1692
|
] }),
|
|
1693
1693
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1694
1694
|
u && n === c.value && /* @__PURE__ */ e(Ie, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
|
|
1695
|
-
|
|
1695
|
+
g && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
|
|
1696
1696
|
] })
|
|
1697
1697
|
]
|
|
1698
1698
|
}
|
|
1699
1699
|
),
|
|
1700
|
-
|
|
1700
|
+
g && _ && /* @__PURE__ */ e(
|
|
1701
1701
|
"div",
|
|
1702
1702
|
{
|
|
1703
1703
|
ref: $,
|
|
@@ -1760,9 +1760,9 @@ const nr = ({
|
|
|
1760
1760
|
] }, c.value);
|
|
1761
1761
|
}),
|
|
1762
1762
|
(() => {
|
|
1763
|
-
const c = r.reduce((S,
|
|
1764
|
-
if (
|
|
1765
|
-
const _ =
|
|
1763
|
+
const c = r.reduce((S, g) => {
|
|
1764
|
+
if (g.divider) return S;
|
|
1765
|
+
const _ = g.children ? g.children.filter((N) => !N.divider).length : 0;
|
|
1766
1766
|
return S + 1 + _;
|
|
1767
1767
|
}, 0);
|
|
1768
1768
|
return c > 1 && /* @__PURE__ */ e("div", { className: "border-t border-border mt-2 pt-2", children: /* @__PURE__ */ i("div", { className: "text-xs text-text-muted px-3 py-1", children: [
|
|
@@ -1808,7 +1808,7 @@ const nr = ({
|
|
|
1808
1808
|
sm: "p-2",
|
|
1809
1809
|
md: "px-5 py-4",
|
|
1810
1810
|
lg: "p-6"
|
|
1811
|
-
},
|
|
1811
|
+
}, pn = ({
|
|
1812
1812
|
actions: t = [],
|
|
1813
1813
|
onBack: r,
|
|
1814
1814
|
backLabel: n = "Back",
|
|
@@ -1828,7 +1828,7 @@ const nr = ({
|
|
|
1828
1828
|
),
|
|
1829
1829
|
l && /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: l }),
|
|
1830
1830
|
/* @__PURE__ */ e(Je, { actions: t, className: d(!l && "ml-auto") })
|
|
1831
|
-
] }),
|
|
1831
|
+
] }), gn = (t) => (r) => t(r instanceof Date ? r : null), vn = (t) => (r) => t(typeof r == "string" ? r : ""), ar = {
|
|
1832
1832
|
none: "px-0",
|
|
1833
1833
|
sm: "px-2",
|
|
1834
1834
|
md: "px-3.5",
|
|
@@ -1913,7 +1913,7 @@ const cr = (t) => {
|
|
|
1913
1913
|
onRowClick: b,
|
|
1914
1914
|
selectable: v = !1,
|
|
1915
1915
|
selectedRows: k = [],
|
|
1916
|
-
onSelectionChange:
|
|
1916
|
+
onSelectionChange: p,
|
|
1917
1917
|
getRowKey: f = (te, J) => J,
|
|
1918
1918
|
emptyContent: $,
|
|
1919
1919
|
footerSummary: C,
|
|
@@ -1927,10 +1927,10 @@ const cr = (t) => {
|
|
|
1927
1927
|
const [te, J] = O(""), K = l !== void 0, ce = K ? l : te, w = o ?? J, [c, S] = O({
|
|
1928
1928
|
column: null,
|
|
1929
1929
|
direction: null
|
|
1930
|
-
}), [
|
|
1930
|
+
}), [g, _] = O({
|
|
1931
1931
|
page: 0,
|
|
1932
1932
|
pageSize: x
|
|
1933
|
-
}), N = se(null), U =
|
|
1933
|
+
}), N = se(null), U = ge(() => {
|
|
1934
1934
|
let E = t;
|
|
1935
1935
|
if (s && !K && ce.trim()) {
|
|
1936
1936
|
const W = r.filter(
|
|
@@ -1949,7 +1949,7 @@ const cr = (t) => {
|
|
|
1949
1949
|
return String(R || "") === W.value;
|
|
1950
1950
|
}));
|
|
1951
1951
|
}), E;
|
|
1952
|
-
}, [t, ce, K, r, s, u]), re =
|
|
1952
|
+
}, [t, ce, K, r, s, u]), re = ge(() => {
|
|
1953
1953
|
if (!c.column || !c.direction) return U;
|
|
1954
1954
|
const E = r.find((W) => W.id === c.column);
|
|
1955
1955
|
return E ? [...U].sort((W, le) => {
|
|
@@ -1957,11 +1957,11 @@ const cr = (t) => {
|
|
|
1957
1957
|
let ue = 0;
|
|
1958
1958
|
return ie < R ? ue = -1 : ie > R && (ue = 1), c.direction === "desc" ? -ue : ue;
|
|
1959
1959
|
}) : U;
|
|
1960
|
-
}, [U, c, r]), ee =
|
|
1960
|
+
}, [U, c, r]), ee = ge(() => {
|
|
1961
1961
|
if (!y) return re;
|
|
1962
|
-
const E =
|
|
1962
|
+
const E = g.page * g.pageSize, W = E + g.pageSize;
|
|
1963
1963
|
return re.slice(E, W);
|
|
1964
|
-
}, [re,
|
|
1964
|
+
}, [re, g, y]), Y = he(
|
|
1965
1965
|
(E) => {
|
|
1966
1966
|
r.find((le) => le.id === E)?.sortable && S((le) => le.column !== E ? { column: E, direction: "asc" } : le.direction === "asc" ? { column: E, direction: "desc" } : { column: null, direction: null });
|
|
1967
1967
|
},
|
|
@@ -1970,25 +1970,25 @@ const cr = (t) => {
|
|
|
1970
1970
|
_((W) => ({ ...W, page: E }));
|
|
1971
1971
|
}, []), D = he(
|
|
1972
1972
|
(E, W) => {
|
|
1973
|
-
if (!
|
|
1973
|
+
if (!p) return;
|
|
1974
1974
|
const le = f(E, 0);
|
|
1975
|
-
|
|
1975
|
+
p(W ? [...k, E] : k.filter(
|
|
1976
1976
|
(ie, R) => f(k[R], R) !== le
|
|
1977
1977
|
));
|
|
1978
1978
|
},
|
|
1979
|
-
[k,
|
|
1979
|
+
[k, p, f]
|
|
1980
1980
|
), A = he(
|
|
1981
1981
|
(E) => {
|
|
1982
|
-
|
|
1982
|
+
p && p(E ? [...ee] : []);
|
|
1983
1983
|
},
|
|
1984
|
-
[ee,
|
|
1984
|
+
[ee, p]
|
|
1985
1985
|
);
|
|
1986
1986
|
X(() => {
|
|
1987
1987
|
_((E) => ({ ...E, page: 0 }));
|
|
1988
1988
|
}, [ce, c]), X(() => {
|
|
1989
1989
|
_((E) => ({ ...E, page: 0 }));
|
|
1990
1990
|
}, [u.map((E) => E.value).join(",")]);
|
|
1991
|
-
const z = re.length, F = Math.ceil(z /
|
|
1991
|
+
const z = re.length, F = Math.ceil(z / g.pageSize), j = g.page * g.pageSize + 1, B = Math.min(j + g.pageSize - 1, z), M = ee.length > 0 && ee.every((E) => {
|
|
1992
1992
|
const W = f(E, 0);
|
|
1993
1993
|
return k.some(
|
|
1994
1994
|
(le, ie) => f(le, ie) === W
|
|
@@ -2168,23 +2168,23 @@ const cr = (t) => {
|
|
|
2168
2168
|
variant: "ghost",
|
|
2169
2169
|
iconOnly: !0,
|
|
2170
2170
|
"aria-label": "Previous page",
|
|
2171
|
-
onClick: () => P(
|
|
2172
|
-
disabled:
|
|
2171
|
+
onClick: () => P(g.page - 1),
|
|
2172
|
+
disabled: g.page === 0,
|
|
2173
2173
|
children: /* @__PURE__ */ e(Q, { icon: Ee, size: "md", color: "current" })
|
|
2174
2174
|
}
|
|
2175
2175
|
),
|
|
2176
|
-
or(
|
|
2176
|
+
or(g.page, F).map(
|
|
2177
2177
|
(E, W) => E === "gap" ? /* @__PURE__ */ e("span", { className: "px-1 text-text-subtle", children: "…" }, `gap-${W}`) : /* @__PURE__ */ e(
|
|
2178
2178
|
"button",
|
|
2179
2179
|
{
|
|
2180
2180
|
type: "button",
|
|
2181
|
-
"aria-current": E ===
|
|
2181
|
+
"aria-current": E === g.page ? "page" : void 0,
|
|
2182
2182
|
onClick: () => P(E),
|
|
2183
2183
|
className: d(
|
|
2184
2184
|
"h-control-xs min-w-6 cursor-pointer rounded-sm px-1.5 tabular-nums",
|
|
2185
2185
|
"transition-colors duration-fast ease-out",
|
|
2186
2186
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2187
|
-
E ===
|
|
2187
|
+
E === g.page ? "bg-surface-sunk font-semibold text-text" : "text-text-muted hover:bg-surface-hover hover:text-text"
|
|
2188
2188
|
),
|
|
2189
2189
|
children: E + 1
|
|
2190
2190
|
},
|
|
@@ -2198,8 +2198,8 @@ const cr = (t) => {
|
|
|
2198
2198
|
variant: "ghost",
|
|
2199
2199
|
iconOnly: !0,
|
|
2200
2200
|
"aria-label": "Next page",
|
|
2201
|
-
onClick: () => P(
|
|
2202
|
-
disabled:
|
|
2201
|
+
onClick: () => P(g.page + 1),
|
|
2202
|
+
disabled: g.page >= F - 1,
|
|
2203
2203
|
children: /* @__PURE__ */ e(Q, { icon: ze, size: "md", color: "current" })
|
|
2204
2204
|
}
|
|
2205
2205
|
)
|
|
@@ -2249,12 +2249,12 @@ const cr = (t) => {
|
|
|
2249
2249
|
}) => {
|
|
2250
2250
|
const [u, m] = O(
|
|
2251
2251
|
r || n || t[0]?.id || ""
|
|
2252
|
-
), y = n || u, x = (
|
|
2253
|
-
s ? s(
|
|
2252
|
+
), y = n || u, x = (p) => {
|
|
2253
|
+
s ? s(p) : m(p);
|
|
2254
2254
|
}, h = {
|
|
2255
2255
|
activeTab: y,
|
|
2256
2256
|
setActiveTab: x
|
|
2257
|
-
}, b = t.find((
|
|
2257
|
+
}, b = t.find((p) => p.id === y), v = d(
|
|
2258
2258
|
"flex",
|
|
2259
2259
|
{
|
|
2260
2260
|
"border-b border-border px-2": a === "default" || a === "underline",
|
|
@@ -2263,7 +2263,7 @@ const cr = (t) => {
|
|
|
2263
2263
|
"space-x-8": a === "default" || a === "underline"
|
|
2264
2264
|
},
|
|
2265
2265
|
o
|
|
2266
|
-
), k = (
|
|
2266
|
+
), k = (p, f) => {
|
|
2267
2267
|
const $ = "transition-colors duration-fast font-medium", C = {
|
|
2268
2268
|
"text-xs px-2 py-1": l === "sm",
|
|
2269
2269
|
"text-sm px-3 py-2": l === "md",
|
|
@@ -2276,12 +2276,12 @@ const cr = (t) => {
|
|
|
2276
2276
|
// Underline variant
|
|
2277
2277
|
"border-b-2 pb-2": a === "underline"
|
|
2278
2278
|
}, T = {
|
|
2279
|
-
"opacity-50 cursor-not-allowed":
|
|
2280
|
-
"cursor-pointer": !
|
|
2279
|
+
"opacity-50 cursor-not-allowed": p.disabled,
|
|
2280
|
+
"cursor-pointer": !p.disabled
|
|
2281
2281
|
}, G = f ? {
|
|
2282
2282
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
2283
2283
|
"bg-surface text-text shadow-none": a === "pills"
|
|
2284
|
-
} : {}, V = !f && !
|
|
2284
|
+
} : {}, V = !f && !p.disabled ? {
|
|
2285
2285
|
"border-transparent text-text-muted hover:text-text": a === "default",
|
|
2286
2286
|
"text-text-muted hover:text-text": a === "pills",
|
|
2287
2287
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
@@ -2289,22 +2289,22 @@ const cr = (t) => {
|
|
|
2289
2289
|
return d($, C, q, T, G, V);
|
|
2290
2290
|
};
|
|
2291
2291
|
return /* @__PURE__ */ e(ir.Provider, { value: h, children: /* @__PURE__ */ i("div", { children: [
|
|
2292
|
-
/* @__PURE__ */ e("div", { className: v, role: "tablist", children: t.map((
|
|
2292
|
+
/* @__PURE__ */ e("div", { className: v, role: "tablist", children: t.map((p) => /* @__PURE__ */ e(
|
|
2293
2293
|
"button",
|
|
2294
2294
|
{
|
|
2295
2295
|
type: "button",
|
|
2296
2296
|
role: "tab",
|
|
2297
|
-
"aria-selected": y ===
|
|
2298
|
-
"aria-controls": `tabpanel-${
|
|
2299
|
-
disabled:
|
|
2300
|
-
onClick: () => !
|
|
2301
|
-
className: k(
|
|
2297
|
+
"aria-selected": y === p.id,
|
|
2298
|
+
"aria-controls": `tabpanel-${p.id}`,
|
|
2299
|
+
disabled: p.disabled,
|
|
2300
|
+
onClick: () => !p.disabled && x(p.id),
|
|
2301
|
+
className: k(p, y === p.id),
|
|
2302
2302
|
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2303
|
-
|
|
2304
|
-
|
|
2303
|
+
p.label,
|
|
2304
|
+
p.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-surface-hover text-text-muted", children: p.badge })
|
|
2305
2305
|
] })
|
|
2306
2306
|
},
|
|
2307
|
-
|
|
2307
|
+
p.id
|
|
2308
2308
|
)) }),
|
|
2309
2309
|
b?.content && /* @__PURE__ */ e(
|
|
2310
2310
|
"div",
|
|
@@ -2340,8 +2340,8 @@ function Ye({
|
|
|
2340
2340
|
const h = se(null), b = se(null);
|
|
2341
2341
|
X(() => {
|
|
2342
2342
|
if (!t || !l) return;
|
|
2343
|
-
const k = (
|
|
2344
|
-
|
|
2343
|
+
const k = (p) => {
|
|
2344
|
+
p.key === "Escape" && r();
|
|
2345
2345
|
};
|
|
2346
2346
|
return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
|
|
2347
2347
|
}, [t, l, r]), X(() => (t ? (b.current = document.activeElement, h.current && h.current.focus(), document.body.style.overflow = "hidden") : (b.current && b.current.focus(), document.body.style.overflow = ""), () => {
|
|
@@ -2450,16 +2450,16 @@ const mr = {
|
|
|
2450
2450
|
children: h,
|
|
2451
2451
|
...b
|
|
2452
2452
|
}) => {
|
|
2453
|
-
const v = y ||
|
|
2453
|
+
const v = y || pr(t), k = t === "caption", p = t === "label", f = t === "code", $ = d(
|
|
2454
2454
|
"font-sans",
|
|
2455
2455
|
// Variant — caption and label pin their own size/weight
|
|
2456
2456
|
k && "text-xs text-text-subtle",
|
|
2457
|
-
|
|
2457
|
+
p && "text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
2458
2458
|
f && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
|
|
2459
2459
|
// Size — only where the variant does not pin it
|
|
2460
|
-
!k && !
|
|
2460
|
+
!k && !p && !f && mr[r],
|
|
2461
2461
|
// Weight — label owns its weight
|
|
2462
|
-
!
|
|
2462
|
+
!p && fr[n],
|
|
2463
2463
|
hr[s],
|
|
2464
2464
|
xr[a],
|
|
2465
2465
|
// Line height only overrides the body variant
|
|
@@ -2471,7 +2471,7 @@ const mr = {
|
|
|
2471
2471
|
);
|
|
2472
2472
|
return /* @__PURE__ */ e(v, { className: $, ...b, children: h });
|
|
2473
2473
|
};
|
|
2474
|
-
function
|
|
2474
|
+
function pr(t) {
|
|
2475
2475
|
return {
|
|
2476
2476
|
body: "p",
|
|
2477
2477
|
caption: "span",
|
|
@@ -2479,7 +2479,7 @@ function gr(t) {
|
|
|
2479
2479
|
code: "code"
|
|
2480
2480
|
}[t] || "p";
|
|
2481
2481
|
}
|
|
2482
|
-
const
|
|
2482
|
+
const gr = ({
|
|
2483
2483
|
value: t,
|
|
2484
2484
|
onChange: r,
|
|
2485
2485
|
label: n,
|
|
@@ -2493,9 +2493,9 @@ const pr = ({
|
|
|
2493
2493
|
onDownloadFile: x,
|
|
2494
2494
|
onRegisterFile: h
|
|
2495
2495
|
}) => {
|
|
2496
|
-
const [b, v] = O(!1), [k,
|
|
2496
|
+
const [b, v] = O(!1), [k, p] = O([]), [f, $] = O(null), [C, q] = O("/"), [T, G] = O([]), [V, I] = O(!1), [H, te] = O(""), [J, K] = O(
|
|
2497
2497
|
typeof t == "object" ? t : null
|
|
2498
|
-
), [ce, w] = O(!1), [c, S] = O(""),
|
|
2498
|
+
), [ce, w] = O(!1), [c, S] = O(""), g = se(null);
|
|
2499
2499
|
X(() => {
|
|
2500
2500
|
b && _();
|
|
2501
2501
|
}, [b]), X(() => {
|
|
@@ -2505,7 +2505,7 @@ const pr = ({
|
|
|
2505
2505
|
I(!0);
|
|
2506
2506
|
try {
|
|
2507
2507
|
const M = await m?.();
|
|
2508
|
-
M?.data &&
|
|
2508
|
+
M?.data && p(M.data);
|
|
2509
2509
|
} catch (M) {
|
|
2510
2510
|
console.error("Failed to load mounts", M);
|
|
2511
2511
|
} finally {
|
|
@@ -2601,7 +2601,7 @@ const pr = ({
|
|
|
2601
2601
|
}
|
|
2602
2602
|
}, P = (M) => {
|
|
2603
2603
|
M.stopPropagation(), K(null), r(null);
|
|
2604
|
-
}, D =
|
|
2604
|
+
}, D = ge(() => {
|
|
2605
2605
|
const M = /* @__PURE__ */ new Set(), L = [];
|
|
2606
2606
|
return T.forEach((Z) => {
|
|
2607
2607
|
if (Z.type === "folder") {
|
|
@@ -2619,7 +2619,7 @@ const pr = ({
|
|
|
2619
2619
|
}, z = () => {
|
|
2620
2620
|
const M = C.split("/").filter((L) => L !== "");
|
|
2621
2621
|
M.pop(), M.length === 0 ? q("/") : q(`${M.join("/")}/`);
|
|
2622
|
-
}, F =
|
|
2622
|
+
}, F = ge(() => {
|
|
2623
2623
|
const M = D.folders.map((L) => ({
|
|
2624
2624
|
id: `folder-${L}`,
|
|
2625
2625
|
name: L,
|
|
@@ -2775,7 +2775,7 @@ const pr = ({
|
|
|
2775
2775
|
ae,
|
|
2776
2776
|
{
|
|
2777
2777
|
variant: "primary",
|
|
2778
|
-
onClick: () =>
|
|
2778
|
+
onClick: () => g.current?.click(),
|
|
2779
2779
|
leftIcon: /* @__PURE__ */ e(Q, { icon: ft, size: "xs" }),
|
|
2780
2780
|
loading: V,
|
|
2781
2781
|
children: "Upload"
|
|
@@ -2786,7 +2786,7 @@ const pr = ({
|
|
|
2786
2786
|
{
|
|
2787
2787
|
type: "file",
|
|
2788
2788
|
className: "hidden",
|
|
2789
|
-
ref:
|
|
2789
|
+
ref: g,
|
|
2790
2790
|
onChange: re,
|
|
2791
2791
|
accept: o
|
|
2792
2792
|
}
|
|
@@ -2880,7 +2880,7 @@ const pr = ({
|
|
|
2880
2880
|
rows: x = 4,
|
|
2881
2881
|
...h
|
|
2882
2882
|
}, b) => {
|
|
2883
|
-
const v = oe.useId(), k = y || `textarea-${v}`,
|
|
2883
|
+
const v = oe.useId(), k = y || `textarea-${v}`, p = !!n, f = n || r ? `${k}-description` : void 0;
|
|
2884
2884
|
return /* @__PURE__ */ i("div", { className: d("flex flex-col", a && "w-full", o), children: [
|
|
2885
2885
|
t && /* @__PURE__ */ e(
|
|
2886
2886
|
"label",
|
|
@@ -2888,7 +2888,7 @@ const pr = ({
|
|
|
2888
2888
|
htmlFor: k,
|
|
2889
2889
|
className: d(
|
|
2890
2890
|
Ue,
|
|
2891
|
-
|
|
2891
|
+
p ? "text-danger-fg" : "text-text-muted",
|
|
2892
2892
|
u
|
|
2893
2893
|
),
|
|
2894
2894
|
children: t
|
|
@@ -2901,13 +2901,13 @@ const pr = ({
|
|
|
2901
2901
|
ref: b,
|
|
2902
2902
|
id: k,
|
|
2903
2903
|
rows: x,
|
|
2904
|
-
"aria-invalid":
|
|
2904
|
+
"aria-invalid": p || void 0,
|
|
2905
2905
|
"aria-describedby": f,
|
|
2906
2906
|
className: d(
|
|
2907
2907
|
We,
|
|
2908
2908
|
"resize-y leading-relaxed",
|
|
2909
2909
|
vr[s],
|
|
2910
|
-
Ke(
|
|
2910
|
+
Ke(p),
|
|
2911
2911
|
m
|
|
2912
2912
|
),
|
|
2913
2913
|
...h
|
|
@@ -2925,7 +2925,7 @@ const pr = ({
|
|
|
2925
2925
|
"p",
|
|
2926
2926
|
{
|
|
2927
2927
|
id: f,
|
|
2928
|
-
className: d("mt-1 text-xs",
|
|
2928
|
+
className: d("mt-1 text-xs", p ? "text-danger-fg" : "text-text-subtle"),
|
|
2929
2929
|
children: n || r
|
|
2930
2930
|
}
|
|
2931
2931
|
)
|
|
@@ -2988,7 +2988,7 @@ const Nn = ({
|
|
|
2988
2988
|
loading: b = !1,
|
|
2989
2989
|
className: v,
|
|
2990
2990
|
ref: k,
|
|
2991
|
-
sdk:
|
|
2991
|
+
sdk: p
|
|
2992
2992
|
}) => {
|
|
2993
2993
|
const [f, $] = O(r || {}), [C, q] = O({}), [T, G] = O({});
|
|
2994
2994
|
X(() => {
|
|
@@ -2996,21 +2996,21 @@ const Nn = ({
|
|
|
2996
2996
|
}, [r]);
|
|
2997
2997
|
const V = he(
|
|
2998
2998
|
(w, c, S) => {
|
|
2999
|
-
const
|
|
3000
|
-
if (!
|
|
3001
|
-
if (
|
|
3002
|
-
return `${
|
|
3003
|
-
if (
|
|
3004
|
-
if (
|
|
3005
|
-
return `${
|
|
2999
|
+
const g = t.flatMap((_) => _.items).find((_) => _.name === w);
|
|
3000
|
+
if (!g) return null;
|
|
3001
|
+
if (g.required && (c == null || c === ""))
|
|
3002
|
+
return `${g.label} is required`;
|
|
3003
|
+
if (g.type === "array") {
|
|
3004
|
+
if (g.required && (!c || c.length === 0))
|
|
3005
|
+
return `${g.label} cannot be empty.`;
|
|
3006
3006
|
if (c && !Array.isArray(c))
|
|
3007
|
-
return `${
|
|
3008
|
-
if (Array.isArray(c) &&
|
|
3007
|
+
return `${g.label} must be an array.`;
|
|
3008
|
+
if (Array.isArray(c) && g.arrayFields) {
|
|
3009
3009
|
const _ = [];
|
|
3010
3010
|
let N = !1;
|
|
3011
3011
|
if (c.forEach((U, re) => {
|
|
3012
3012
|
const ee = {};
|
|
3013
|
-
for (const Y of
|
|
3013
|
+
for (const Y of g.arrayFields) {
|
|
3014
3014
|
const P = U?.[Y.name];
|
|
3015
3015
|
if (Y.required && (P == null || P === ""))
|
|
3016
3016
|
ee[Y.name] = `${Y.label} is required`, N = !0;
|
|
@@ -3024,7 +3024,7 @@ const Nn = ({
|
|
|
3024
3024
|
return JSON.stringify(_);
|
|
3025
3025
|
}
|
|
3026
3026
|
}
|
|
3027
|
-
return
|
|
3027
|
+
return g.validator ? g.validator(c, S) : null;
|
|
3028
3028
|
},
|
|
3029
3029
|
[t]
|
|
3030
3030
|
), I = he(
|
|
@@ -3062,15 +3062,15 @@ const Nn = ({
|
|
|
3062
3062
|
}
|
|
3063
3063
|
if (q(c), Object.keys(c).some((_) => c[_]))
|
|
3064
3064
|
return;
|
|
3065
|
-
const
|
|
3066
|
-
await n?.(f,
|
|
3065
|
+
const g = l ? l(f) : f;
|
|
3066
|
+
await n?.(f, g);
|
|
3067
3067
|
},
|
|
3068
3068
|
[f, t, V, o, l, n, b]
|
|
3069
3069
|
), te = he(
|
|
3070
3070
|
(w) => {
|
|
3071
|
-
const c = Be(f, w.name), S = T[w.name] ? C[w.name] : void 0,
|
|
3071
|
+
const c = Be(f, w.name), S = T[w.name] ? C[w.name] : void 0, g = w.disabled || b, _ = {
|
|
3072
3072
|
value: c || "",
|
|
3073
|
-
disabled:
|
|
3073
|
+
disabled: g,
|
|
3074
3074
|
required: w.required,
|
|
3075
3075
|
placeholder: w.placeholder,
|
|
3076
3076
|
...w.fieldProps
|
|
@@ -3164,7 +3164,7 @@ const Nn = ({
|
|
|
3164
3164
|
value: N.value,
|
|
3165
3165
|
checked: c === N.value,
|
|
3166
3166
|
onChange: () => I(w.name, N.value),
|
|
3167
|
-
disabled:
|
|
3167
|
+
disabled: g || N.disabled,
|
|
3168
3168
|
className: "size-checkbox shrink-0 rounded-xs border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3169
3169
|
}
|
|
3170
3170
|
),
|
|
@@ -3185,31 +3185,31 @@ const Nn = ({
|
|
|
3185
3185
|
);
|
|
3186
3186
|
case "file":
|
|
3187
3187
|
return /* @__PURE__ */ e(
|
|
3188
|
-
|
|
3188
|
+
gr,
|
|
3189
3189
|
{
|
|
3190
3190
|
..._,
|
|
3191
3191
|
value: c,
|
|
3192
3192
|
onChange: (N) => I(w.name, N),
|
|
3193
3193
|
error: S,
|
|
3194
|
-
onListFiles: (N) =>
|
|
3194
|
+
onListFiles: (N) => p?.http.invoke({
|
|
3195
3195
|
method: "POST",
|
|
3196
3196
|
action: "storage.file.list",
|
|
3197
3197
|
body: N
|
|
3198
3198
|
}),
|
|
3199
|
-
onListMounts: () =>
|
|
3199
|
+
onListMounts: () => p?.http.invoke({
|
|
3200
3200
|
method: "GET",
|
|
3201
3201
|
action: "storage.mount"
|
|
3202
3202
|
}),
|
|
3203
|
-
onUploadFile: (N) =>
|
|
3203
|
+
onUploadFile: (N) => p?.http.invoke({
|
|
3204
3204
|
method: "POST",
|
|
3205
3205
|
action: "storage.file.upload",
|
|
3206
3206
|
body: N
|
|
3207
3207
|
}),
|
|
3208
|
-
onDownloadFile: (N) =>
|
|
3208
|
+
onDownloadFile: (N) => p?.http.invoke({
|
|
3209
3209
|
method: "GET",
|
|
3210
3210
|
action: `storage.file.${N}.download`
|
|
3211
3211
|
}),
|
|
3212
|
-
onRegisterFile: (N) =>
|
|
3212
|
+
onRegisterFile: (N) => p?.http.invoke({
|
|
3213
3213
|
method: "POST",
|
|
3214
3214
|
action: "storage.file.folder",
|
|
3215
3215
|
body: N
|
|
@@ -3222,11 +3222,11 @@ const Nn = ({
|
|
|
3222
3222
|
{
|
|
3223
3223
|
value: c || {},
|
|
3224
3224
|
onChange: (N) => I(w.name, N),
|
|
3225
|
-
onListFolders: () =>
|
|
3225
|
+
onListFolders: () => p?.http.invoke({
|
|
3226
3226
|
method: "GET",
|
|
3227
3227
|
action: "storage.mount"
|
|
3228
3228
|
}),
|
|
3229
|
-
disabled:
|
|
3229
|
+
disabled: g,
|
|
3230
3230
|
size: h,
|
|
3231
3231
|
placeholder: w.placeholder
|
|
3232
3232
|
}
|
|
@@ -3236,7 +3236,7 @@ const Nn = ({
|
|
|
3236
3236
|
value: c,
|
|
3237
3237
|
onChange: (N) => I(w.name, N),
|
|
3238
3238
|
error: S,
|
|
3239
|
-
disabled:
|
|
3239
|
+
disabled: g
|
|
3240
3240
|
});
|
|
3241
3241
|
case "array": {
|
|
3242
3242
|
const N = c || [];
|
|
@@ -3276,7 +3276,7 @@ const Nn = ({
|
|
|
3276
3276
|
(() => {
|
|
3277
3277
|
const F = {
|
|
3278
3278
|
value: P?.[A.name] || "",
|
|
3279
|
-
disabled:
|
|
3279
|
+
disabled: g,
|
|
3280
3280
|
required: A.required,
|
|
3281
3281
|
placeholder: A.placeholder,
|
|
3282
3282
|
...A.fieldProps
|
|
@@ -3373,7 +3373,7 @@ const Nn = ({
|
|
|
3373
3373
|
A.name,
|
|
3374
3374
|
j.value
|
|
3375
3375
|
),
|
|
3376
|
-
disabled:
|
|
3376
|
+
disabled: g || j.disabled,
|
|
3377
3377
|
className: "size-checkbox shrink-0 rounded-xs border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3378
3378
|
}
|
|
3379
3379
|
),
|
|
@@ -3407,7 +3407,7 @@ const Nn = ({
|
|
|
3407
3407
|
j
|
|
3408
3408
|
),
|
|
3409
3409
|
error: z,
|
|
3410
|
-
disabled:
|
|
3410
|
+
disabled: g
|
|
3411
3411
|
});
|
|
3412
3412
|
// Add other field types here as needed
|
|
3413
3413
|
default:
|
|
@@ -3433,7 +3433,7 @@ const Nn = ({
|
|
|
3433
3433
|
size: "md",
|
|
3434
3434
|
"aria-label": `${w.label} verwijderen`,
|
|
3435
3435
|
onClick: () => ee(D),
|
|
3436
|
-
disabled:
|
|
3436
|
+
disabled: g,
|
|
3437
3437
|
className: d("shrink-0", D === 0 && "mt-5"),
|
|
3438
3438
|
children: /* @__PURE__ */ e(ht, { className: "size-icon-md" })
|
|
3439
3439
|
}
|
|
@@ -3446,7 +3446,7 @@ const Nn = ({
|
|
|
3446
3446
|
variant: "secondary",
|
|
3447
3447
|
leftIcon: /* @__PURE__ */ e(xt, { className: "size-icon-sm" }),
|
|
3448
3448
|
onClick: re,
|
|
3449
|
-
disabled:
|
|
3449
|
+
disabled: g,
|
|
3450
3450
|
children: [
|
|
3451
3451
|
w.label,
|
|
3452
3452
|
" toevoegen"
|
|
@@ -3464,7 +3464,7 @@ const Nn = ({
|
|
|
3464
3464
|
(w) => {
|
|
3465
3465
|
if (w.conditional && !w.conditional(f))
|
|
3466
3466
|
return null;
|
|
3467
|
-
const c = w.items.filter((
|
|
3467
|
+
const c = w.items.filter((g) => !(g.hidden || g.conditional && !g.conditional(f)));
|
|
3468
3468
|
if (c.length === 0) return null;
|
|
3469
3469
|
const S = d(
|
|
3470
3470
|
w.layout === "flex" ? "flex flex-wrap gap-3.5" : "grid gap-3.5",
|
|
@@ -3486,29 +3486,29 @@ const Nn = ({
|
|
|
3486
3486
|
title: w.title,
|
|
3487
3487
|
description: w.description,
|
|
3488
3488
|
className: "not-last:border-b not-last:border-border-subtle",
|
|
3489
|
-
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className: S, children: c.map((
|
|
3490
|
-
const _ = T[
|
|
3489
|
+
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className: S, children: c.map((g) => {
|
|
3490
|
+
const _ = T[g.name] ? C[g.name] : void 0;
|
|
3491
3491
|
return /* @__PURE__ */ i(
|
|
3492
3492
|
"div",
|
|
3493
3493
|
{
|
|
3494
3494
|
className: d(
|
|
3495
3495
|
"flex min-w-0 flex-col gap-1.5",
|
|
3496
|
-
|
|
3496
|
+
g.type === "checkbox" && "justify-center"
|
|
3497
3497
|
),
|
|
3498
3498
|
style: {
|
|
3499
|
-
width: typeof
|
|
3500
|
-
gridColumn: typeof
|
|
3499
|
+
width: typeof g.width == "string" ? g.width : void 0,
|
|
3500
|
+
gridColumn: typeof g.width == "number" ? `span ${g.width} / span ${g.width}` : void 0
|
|
3501
3501
|
},
|
|
3502
3502
|
children: [
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3503
|
+
g.type !== "custom" && g.type !== "checkbox" && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-text-muted", children: [
|
|
3504
|
+
g.label,
|
|
3505
|
+
g.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3506
3506
|
] }),
|
|
3507
|
-
te(
|
|
3508
|
-
|
|
3507
|
+
te(g),
|
|
3508
|
+
g.help && !_ && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-text-subtle", children: g.help })
|
|
3509
3509
|
]
|
|
3510
3510
|
},
|
|
3511
|
-
|
|
3511
|
+
g.name
|
|
3512
3512
|
);
|
|
3513
3513
|
}) }) })
|
|
3514
3514
|
},
|
|
@@ -4029,11 +4029,11 @@ const An = ({
|
|
|
4029
4029
|
onError: b,
|
|
4030
4030
|
...v
|
|
4031
4031
|
}) => {
|
|
4032
|
-
const [k,
|
|
4033
|
-
|
|
4032
|
+
const [k, p] = O(!0), [f, $] = O(!1), [C, q] = O(t), T = (K) => {
|
|
4033
|
+
p(!1), $(!1), h?.(K);
|
|
4034
4034
|
}, G = (K) => {
|
|
4035
|
-
if (
|
|
4036
|
-
q(u), $(!1),
|
|
4035
|
+
if (p(!1), $(!0), u && C !== u) {
|
|
4036
|
+
q(u), $(!1), p(!0);
|
|
4037
4037
|
return;
|
|
4038
4038
|
}
|
|
4039
4039
|
b?.(K);
|
|
@@ -4075,7 +4075,7 @@ const An = ({
|
|
|
4075
4075
|
"absolute inset-0 flex items-center justify-center",
|
|
4076
4076
|
"text-text-muted"
|
|
4077
4077
|
), te = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), J = /* @__PURE__ */ i("div", { className: "text-center", children: [
|
|
4078
|
-
/* @__PURE__ */ e(Q, { icon:
|
|
4078
|
+
/* @__PURE__ */ e(Q, { icon: pt, size: "lg", className: "mx-auto mb-1" }),
|
|
4079
4079
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
4080
4080
|
] });
|
|
4081
4081
|
return /* @__PURE__ */ i("div", { className: V, children: [
|
|
@@ -4133,7 +4133,7 @@ function In({
|
|
|
4133
4133
|
groups: b,
|
|
4134
4134
|
renderGroupHeader: v,
|
|
4135
4135
|
stickyGroupHeaders: k = !1,
|
|
4136
|
-
collapsibleGroups:
|
|
4136
|
+
collapsibleGroups: p = !1,
|
|
4137
4137
|
hideGroupCount: f = !1,
|
|
4138
4138
|
selectable: $ = !1,
|
|
4139
4139
|
selectedItems: C = [],
|
|
@@ -4152,7 +4152,7 @@ function In({
|
|
|
4152
4152
|
() => Object.fromEntries(
|
|
4153
4153
|
(b ?? []).filter((z) => z.defaultCollapsed).map((z) => [z.id, !0])
|
|
4154
4154
|
)
|
|
4155
|
-
), S = oe.useRef(null),
|
|
4155
|
+
), S = oe.useRef(null), g = (z) => {
|
|
4156
4156
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(z.key)) return;
|
|
4157
4157
|
const j = Array.from(
|
|
4158
4158
|
S.current?.querySelectorAll("li[data-list-row]") ?? []
|
|
@@ -4256,10 +4256,10 @@ function In({
|
|
|
4256
4256
|
...F.filter((B) => z.has(B.id)),
|
|
4257
4257
|
...[...z.keys()].filter((B) => !F.some((M) => M.id === B)).map((B) => ({ id: B }))
|
|
4258
4258
|
].flatMap((B, M) => {
|
|
4259
|
-
const L = z.get(B.id) ?? [], Z =
|
|
4259
|
+
const L = z.get(B.id) ?? [], Z = p && w[B.id], ne = B.title ?? B.id, de = B.count ?? L.length, be = /* @__PURE__ */ e(
|
|
4260
4260
|
"li",
|
|
4261
4261
|
{
|
|
4262
|
-
onClick:
|
|
4262
|
+
onClick: p ? () => c((fe) => ({ ...fe, [B.id]: !fe[B.id] })) : void 0,
|
|
4263
4263
|
className: d(
|
|
4264
4264
|
// A caption over its rows, not a band across the table: same
|
|
4265
4265
|
// surface as the rows, no rules, and the count as a quiet pill.
|
|
@@ -4268,12 +4268,12 @@ function In({
|
|
|
4268
4268
|
M > 0 ? "pt-5" : "pt-3",
|
|
4269
4269
|
B.tone === "danger" ? "text-danger-fg" : B.tone === "muted" ? "text-text-subtle" : "text-text",
|
|
4270
4270
|
k && "sticky z-10",
|
|
4271
|
-
|
|
4271
|
+
p && "cursor-pointer select-none"
|
|
4272
4272
|
),
|
|
4273
|
-
"aria-expanded":
|
|
4273
|
+
"aria-expanded": p ? !Z : void 0,
|
|
4274
4274
|
style: k ? { top: V ? 28 : 0 } : void 0,
|
|
4275
4275
|
children: v ? v(B, L.map((fe) => fe.item)) : /* @__PURE__ */ i(ve, { children: [
|
|
4276
|
-
|
|
4276
|
+
p && /* @__PURE__ */ e(
|
|
4277
4277
|
ze,
|
|
4278
4278
|
{
|
|
4279
4279
|
"aria-hidden": !0,
|
|
@@ -4306,7 +4306,7 @@ function In({
|
|
|
4306
4306
|
];
|
|
4307
4307
|
});
|
|
4308
4308
|
})();
|
|
4309
|
-
return /* @__PURE__ */ i("div", { ref: S, className: ee, onKeyDown: o ?
|
|
4309
|
+
return /* @__PURE__ */ i("div", { ref: S, className: ee, onKeyDown: o ? g : void 0, children: [
|
|
4310
4310
|
G && /* @__PURE__ */ i(
|
|
4311
4311
|
"div",
|
|
4312
4312
|
{
|
|
@@ -4408,18 +4408,18 @@ const On = ({
|
|
|
4408
4408
|
editable: x = !1,
|
|
4409
4409
|
onTitleChange: h
|
|
4410
4410
|
}) => {
|
|
4411
|
-
const [b, v] = O(!1), [k,
|
|
4411
|
+
const [b, v] = O(!1), [k, p] = O(r), f = se(null);
|
|
4412
4412
|
X(() => {
|
|
4413
|
-
|
|
4413
|
+
p(r);
|
|
4414
4414
|
}, [r]), X(() => {
|
|
4415
4415
|
b && f.current && (f.current.focus(), f.current.select());
|
|
4416
4416
|
}, [b]);
|
|
4417
4417
|
const $ = () => {
|
|
4418
4418
|
x && v(!0);
|
|
4419
4419
|
}, C = () => {
|
|
4420
|
-
v(!1), k.trim() !== "" && k !== r && h ? h(k.trim()) :
|
|
4420
|
+
v(!1), k.trim() !== "" && k !== r && h ? h(k.trim()) : p(r);
|
|
4421
4421
|
}, q = (T) => {
|
|
4422
|
-
T.key === "Enter" ? f.current?.blur() : T.key === "Escape" && (
|
|
4422
|
+
T.key === "Enter" ? f.current?.blur() : T.key === "Escape" && (p(r), v(!1));
|
|
4423
4423
|
};
|
|
4424
4424
|
return /* @__PURE__ */ i(
|
|
4425
4425
|
"div",
|
|
@@ -4444,7 +4444,7 @@ const On = ({
|
|
|
4444
4444
|
ref: f,
|
|
4445
4445
|
type: "text",
|
|
4446
4446
|
value: k,
|
|
4447
|
-
onChange: (T) =>
|
|
4447
|
+
onChange: (T) => p(T.target.value),
|
|
4448
4448
|
onBlur: C,
|
|
4449
4449
|
onKeyDown: q,
|
|
4450
4450
|
className: "text-1xl font-semibold bg-transparent border-b-1 border-border rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 w-full"
|
|
@@ -4464,7 +4464,7 @@ const On = ({
|
|
|
4464
4464
|
),
|
|
4465
4465
|
n && /* @__PURE__ */ e("span", { className: "shrink-0 text-base text-text-muted truncate", children: n }),
|
|
4466
4466
|
x && /* @__PURE__ */ e(
|
|
4467
|
-
|
|
4467
|
+
gt,
|
|
4468
4468
|
{
|
|
4469
4469
|
size: 15,
|
|
4470
4470
|
onClick: $,
|
|
@@ -4472,7 +4472,20 @@ const On = ({
|
|
|
4472
4472
|
}
|
|
4473
4473
|
)
|
|
4474
4474
|
] }),
|
|
4475
|
-
s &&
|
|
4475
|
+
s && // A string meta is one line and ellipsises; a node may be a row
|
|
4476
|
+
// of controls (the interaction header's property line) that has
|
|
4477
|
+
// to be allowed to wrap — `truncate` would clip it to one line
|
|
4478
|
+
// and hide the last properties.
|
|
4479
|
+
/* @__PURE__ */ e(
|
|
4480
|
+
"div",
|
|
4481
|
+
{
|
|
4482
|
+
className: d(
|
|
4483
|
+
"mt-1 min-w-0 text-sm text-text-subtle",
|
|
4484
|
+
typeof s == "string" && "truncate"
|
|
4485
|
+
),
|
|
4486
|
+
children: s
|
|
4487
|
+
}
|
|
4488
|
+
)
|
|
4476
4489
|
] })
|
|
4477
4490
|
] }) }),
|
|
4478
4491
|
a.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: a.map(
|
|
@@ -4554,7 +4567,12 @@ function Fn({ text: t, className: r, as: n }) {
|
|
|
4554
4567
|
}
|
|
4555
4568
|
) : /* @__PURE__ */ e("div", { className: d("break-words", r), children: /* @__PURE__ */ e(Ct, { remarkPlugins: [St], components: Rr, children: s }) });
|
|
4556
4569
|
}
|
|
4557
|
-
|
|
4570
|
+
const Bn = ({ label: t, meta: r, action: n, className: s }) => /* @__PURE__ */ i("div", { className: d("flex items-center gap-2 px-1 pb-2 pt-7 first:pt-0", s), children: [
|
|
4571
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-2xs font-semibold uppercase tracking-label text-text-subtle", children: t }),
|
|
4572
|
+
r && /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-right text-xs tabular-nums text-text-subtle", children: r }),
|
|
4573
|
+
n && /* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: n })
|
|
4574
|
+
] });
|
|
4575
|
+
function Rn({ label: t, trailing: r, align: n = "center", className: s }) {
|
|
4558
4576
|
const a = /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-border-subtle", "aria-hidden": !0 });
|
|
4559
4577
|
return !t && !r ? /* @__PURE__ */ e("div", { className: d("flex items-center py-2", s), children: a }) : /* @__PURE__ */ i("div", { className: d("flex items-center gap-3 py-2", s), children: [
|
|
4560
4578
|
n === "center" && a,
|
|
@@ -4563,7 +4581,7 @@ function Bn({ label: t, trailing: r, align: n = "center", className: s }) {
|
|
|
4563
4581
|
r && /* @__PURE__ */ e("span", { className: "shrink-0", children: r })
|
|
4564
4582
|
] });
|
|
4565
4583
|
}
|
|
4566
|
-
function
|
|
4584
|
+
function Hn({
|
|
4567
4585
|
label: t,
|
|
4568
4586
|
description: r,
|
|
4569
4587
|
control: n,
|
|
@@ -4590,7 +4608,7 @@ function Rn({
|
|
|
4590
4608
|
}
|
|
4591
4609
|
);
|
|
4592
4610
|
}
|
|
4593
|
-
function
|
|
4611
|
+
function Vn({
|
|
4594
4612
|
icon: t,
|
|
4595
4613
|
title: r,
|
|
4596
4614
|
description: n,
|
|
@@ -4610,7 +4628,7 @@ function Hn({
|
|
|
4610
4628
|
/* @__PURE__ */ e("div", { className: d("flex flex-col", t && "pl-6"), children: a })
|
|
4611
4629
|
] });
|
|
4612
4630
|
}
|
|
4613
|
-
function
|
|
4631
|
+
function qn({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
4614
4632
|
return /* @__PURE__ */ i(
|
|
4615
4633
|
"button",
|
|
4616
4634
|
{
|
|
@@ -4634,7 +4652,7 @@ function Hr(t, r) {
|
|
|
4634
4652
|
t
|
|
4635
4653
|
);
|
|
4636
4654
|
}
|
|
4637
|
-
const
|
|
4655
|
+
const Un = ({
|
|
4638
4656
|
groups: t,
|
|
4639
4657
|
data: r,
|
|
4640
4658
|
size: n = "md",
|
|
@@ -4668,7 +4686,7 @@ const qn = ({
|
|
|
4668
4686
|
className: "text-text-muted",
|
|
4669
4687
|
children: "Geen items"
|
|
4670
4688
|
}
|
|
4671
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: v.map((k,
|
|
4689
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: v.map((k, p) => /* @__PURE__ */ i(
|
|
4672
4690
|
"div",
|
|
4673
4691
|
{
|
|
4674
4692
|
className: "p-4 border border-border rounded-xl space-y-3",
|
|
@@ -4683,7 +4701,7 @@ const qn = ({
|
|
|
4683
4701
|
children: [
|
|
4684
4702
|
x.label,
|
|
4685
4703
|
" ",
|
|
4686
|
-
|
|
4704
|
+
p + 1
|
|
4687
4705
|
]
|
|
4688
4706
|
}
|
|
4689
4707
|
) }),
|
|
@@ -4743,7 +4761,7 @@ const qn = ({
|
|
|
4743
4761
|
}) })
|
|
4744
4762
|
]
|
|
4745
4763
|
},
|
|
4746
|
-
|
|
4764
|
+
p
|
|
4747
4765
|
)) });
|
|
4748
4766
|
}
|
|
4749
4767
|
if (x.type === "custom" && x.customComponent)
|
|
@@ -4975,7 +4993,7 @@ const qn = ({
|
|
|
4975
4993
|
]
|
|
4976
4994
|
}
|
|
4977
4995
|
) });
|
|
4978
|
-
},
|
|
4996
|
+
}, Wn = ({
|
|
4979
4997
|
items: t,
|
|
4980
4998
|
isSelectedHandler: r,
|
|
4981
4999
|
onClick: n,
|
|
@@ -5022,7 +5040,7 @@ const qn = ({
|
|
|
5022
5040
|
left: "text-left",
|
|
5023
5041
|
center: "text-center",
|
|
5024
5042
|
right: "text-right"
|
|
5025
|
-
},
|
|
5043
|
+
}, Kn = ({
|
|
5026
5044
|
level: t = 1,
|
|
5027
5045
|
size: r,
|
|
5028
5046
|
weight: n = "semibold",
|
|
@@ -5054,7 +5072,7 @@ function Kr(t) {
|
|
|
5054
5072
|
6: "md"
|
|
5055
5073
|
}[t] || "md";
|
|
5056
5074
|
}
|
|
5057
|
-
const
|
|
5075
|
+
const Gn = ({
|
|
5058
5076
|
commands: t,
|
|
5059
5077
|
isOpen: r,
|
|
5060
5078
|
onClose: n,
|
|
@@ -5062,7 +5080,7 @@ const Kn = ({
|
|
|
5062
5080
|
initialCommandPath: a,
|
|
5063
5081
|
initialActiveIndex: l
|
|
5064
5082
|
}) => {
|
|
5065
|
-
const [o, u] = O(""), [m, y] = O(a || []), [x, h] = O(l || 0), b = se(null), v = se(null),
|
|
5083
|
+
const [o, u] = O(""), [m, y] = O(a || []), [x, h] = O(l || 0), b = se(null), v = se(null), p = (m.length ? t.find((f) => f.id === m[0])?.subCommands || [] : t).filter(
|
|
5066
5084
|
(f) => f.label.toLowerCase().includes(o.toLowerCase())
|
|
5067
5085
|
);
|
|
5068
5086
|
return X(() => {
|
|
@@ -5074,20 +5092,20 @@ const Kn = ({
|
|
|
5074
5092
|
n();
|
|
5075
5093
|
else if ($.key === "ArrowUp")
|
|
5076
5094
|
h(
|
|
5077
|
-
(C) => C > 0 ? C - 1 :
|
|
5095
|
+
(C) => C > 0 ? C - 1 : p.length - 1
|
|
5078
5096
|
);
|
|
5079
5097
|
else if ($.key === "ArrowDown")
|
|
5080
5098
|
h(
|
|
5081
|
-
(C) => C <
|
|
5099
|
+
(C) => C < p.length - 1 ? C + 1 : 0
|
|
5082
5100
|
);
|
|
5083
5101
|
else if ($.key === "Enter") {
|
|
5084
|
-
const C =
|
|
5102
|
+
const C = p[x];
|
|
5085
5103
|
C && (C.subCommands ? (y([...m, C.id]), h(0)) : C.action && (C.action(), n()));
|
|
5086
5104
|
}
|
|
5087
5105
|
}
|
|
5088
5106
|
};
|
|
5089
5107
|
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
5090
|
-
}, [r, n,
|
|
5108
|
+
}, [r, n, p, x, m]), X(() => {
|
|
5091
5109
|
const f = ($) => {
|
|
5092
5110
|
b.current && !b.current.contains($.target) && n();
|
|
5093
5111
|
};
|
|
@@ -5121,8 +5139,8 @@ const Kn = ({
|
|
|
5121
5139
|
ref: v,
|
|
5122
5140
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
5123
5141
|
children: [
|
|
5124
|
-
|
|
5125
|
-
|
|
5142
|
+
p.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
5143
|
+
p.map((f, $) => /* @__PURE__ */ i(
|
|
5126
5144
|
"div",
|
|
5127
5145
|
{
|
|
5128
5146
|
"data-index": $,
|
|
@@ -5252,7 +5270,7 @@ const Kn = ({
|
|
|
5252
5270
|
)
|
|
5253
5271
|
);
|
|
5254
5272
|
Ze.displayName = "Box";
|
|
5255
|
-
const
|
|
5273
|
+
const Jn = ({ children: t, title: r, ...n }) => /* @__PURE__ */ i(
|
|
5256
5274
|
Ze,
|
|
5257
5275
|
{
|
|
5258
5276
|
background: "module",
|
|
@@ -5267,7 +5285,7 @@ const Gn = ({ children: t, title: r, ...n }) => /* @__PURE__ */ i(
|
|
|
5267
5285
|
]
|
|
5268
5286
|
}
|
|
5269
5287
|
);
|
|
5270
|
-
function
|
|
5288
|
+
function Yn({
|
|
5271
5289
|
identifier: t,
|
|
5272
5290
|
resourceLoader: r,
|
|
5273
5291
|
framework: n = "react",
|
|
@@ -5278,13 +5296,13 @@ function Jn({
|
|
|
5278
5296
|
}) {
|
|
5279
5297
|
const u = se(null), [m, y] = O(!0), [x, h] = O(!1), [b, v] = O(null), k = se(null);
|
|
5280
5298
|
se(null);
|
|
5281
|
-
const
|
|
5282
|
-
return
|
|
5299
|
+
const p = se(r);
|
|
5300
|
+
return p.current = r, X(() => {
|
|
5283
5301
|
let f = !0;
|
|
5284
5302
|
return (async () => {
|
|
5285
5303
|
y(!0), h(!1), v(null);
|
|
5286
5304
|
try {
|
|
5287
|
-
const C = await
|
|
5305
|
+
const C = await p.current();
|
|
5288
5306
|
if (!f) return;
|
|
5289
5307
|
const q = C.component || C.default || C;
|
|
5290
5308
|
v(n === "react" ? () => q : () => C);
|
|
@@ -5319,7 +5337,7 @@ function Jn({
|
|
|
5319
5337
|
n === "react" && !x && b && /* @__PURE__ */ e(b, { ...l })
|
|
5320
5338
|
] });
|
|
5321
5339
|
}
|
|
5322
|
-
class
|
|
5340
|
+
class Xn extends wt {
|
|
5323
5341
|
constructor() {
|
|
5324
5342
|
super(...arguments), this.state = {
|
|
5325
5343
|
hasError: !1,
|
|
@@ -5355,22 +5373,22 @@ export {
|
|
|
5355
5373
|
Ze as Box,
|
|
5356
5374
|
ae as Button,
|
|
5357
5375
|
xn as ButtonGroup,
|
|
5358
|
-
|
|
5376
|
+
Jn as Card,
|
|
5359
5377
|
_n as ChannelBadge,
|
|
5360
5378
|
ye as Checkbox,
|
|
5361
|
-
|
|
5379
|
+
Gn as CommandPalette,
|
|
5362
5380
|
wn as ConfirmDialog,
|
|
5363
5381
|
rr as ContentLoading,
|
|
5364
5382
|
Ae as DatePicker,
|
|
5365
5383
|
nr as Dropdown,
|
|
5366
5384
|
Cn as EmptyState,
|
|
5367
|
-
|
|
5368
|
-
|
|
5385
|
+
Xn as ErrorBoundary,
|
|
5386
|
+
Yn as FederatedResource,
|
|
5369
5387
|
Lt as FilterChip,
|
|
5370
5388
|
Yt as FolderSelect,
|
|
5371
5389
|
Nn as Form,
|
|
5372
5390
|
wr as FormSection,
|
|
5373
|
-
|
|
5391
|
+
Kn as Heading,
|
|
5374
5392
|
Q as Icon,
|
|
5375
5393
|
An as Image,
|
|
5376
5394
|
Sn as Kbd,
|
|
@@ -5382,7 +5400,7 @@ export {
|
|
|
5382
5400
|
Pn as MessageBubble,
|
|
5383
5401
|
Ye as Modal,
|
|
5384
5402
|
On as PageHeader,
|
|
5385
|
-
|
|
5403
|
+
pn as PageToolbar,
|
|
5386
5404
|
Je as PageToolbarActions,
|
|
5387
5405
|
fn as ParticipantTile,
|
|
5388
5406
|
Ve as Popover,
|
|
@@ -5390,18 +5408,19 @@ export {
|
|
|
5390
5408
|
Fn as RichText,
|
|
5391
5409
|
Ge as SearchField,
|
|
5392
5410
|
er as SearchableTextField,
|
|
5393
|
-
Bn as
|
|
5411
|
+
Bn as SectionCaption,
|
|
5412
|
+
Rn as SectionDivider,
|
|
5394
5413
|
Ft as SegmentedToggle,
|
|
5395
5414
|
Ce as Select,
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5415
|
+
Hn as SettingsRow,
|
|
5416
|
+
Vn as SettingsSection,
|
|
5417
|
+
Wn as SidebarMenu,
|
|
5418
|
+
qn as SourceChip,
|
|
5400
5419
|
zn as Spinner,
|
|
5401
5420
|
qe as SplitButton,
|
|
5402
5421
|
Mn as StatusDot,
|
|
5403
5422
|
$n as StepIndicator,
|
|
5404
|
-
|
|
5423
|
+
gr as StorageInput,
|
|
5405
5424
|
tr as Switch,
|
|
5406
5425
|
yn as TabBar,
|
|
5407
5426
|
Fe as Table,
|
|
@@ -5410,12 +5429,12 @@ export {
|
|
|
5410
5429
|
Le as TextArea,
|
|
5411
5430
|
Ne as TextField,
|
|
5412
5431
|
hn as VideoSurface,
|
|
5413
|
-
|
|
5432
|
+
Un as View,
|
|
5414
5433
|
un as catTone,
|
|
5415
5434
|
d as cn,
|
|
5416
5435
|
dn as createSizes,
|
|
5417
5436
|
cn as createVariants,
|
|
5418
|
-
|
|
5437
|
+
gn as dateFilterHandler,
|
|
5419
5438
|
vn as selectFilterHandler
|
|
5420
5439
|
};
|
|
5421
5440
|
//# sourceMappingURL=index.js.map
|