@jinaan/uikit 0.1.31 → 0.1.32
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/dialog.d.ts +5 -0
- package/dist/dialog.d.ts.map +1 -1
- package/dist/index.js +254 -252
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/dialog.tsx +9 -2
- package/styles.css +69 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t, jsxs as s, Fragment as Oe } from "react/jsx-runtime";
|
|
2
2
|
import { CircleNotch as Lt, Robot as Rt, Terminal as At, Check as X, Copy as Xe, XCircle as Bt, Warning as Ft, CheckCircle as $t, Info as qt, Minus as Gt, X as ie, CaretDown as oe, CaretRight as Ht, MagnifyingGlass as Vt, Columns as Ut, Lock as Wt, DotsSixVertical as Ot, FunnelSimple as $e, WarningCircle as Xt, CaretUp as Jt, CaretUpDown as Qt } from "@phosphor-icons/react";
|
|
3
|
-
import { forwardRef as f, useState as
|
|
3
|
+
import { forwardRef as f, useState as D, Children as Je, isValidElement as Qe, useRef as ae, useEffect as U, useContext as B, useCallback as Yt, createContext as J, useId as de, useMemo as qe } from "react";
|
|
4
4
|
import { Slot as Zt } from "@radix-ui/react-slot";
|
|
5
5
|
import { cva as we } from "class-variance-authority";
|
|
6
6
|
import { clsx as Kt } from "clsx";
|
|
@@ -8,8 +8,8 @@ import { twMerge as ea } from "tailwind-merge";
|
|
|
8
8
|
import * as Ce from "@radix-ui/react-avatar";
|
|
9
9
|
import * as Ge from "@radix-ui/react-checkbox";
|
|
10
10
|
import * as I from "@radix-ui/react-dialog";
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
11
|
+
import * as k from "@radix-ui/react-dropdown-menu";
|
|
12
|
+
import * as M from "@radix-ui/react-select";
|
|
13
13
|
import * as ta from "@radix-ui/react-label";
|
|
14
14
|
import * as aa from "@radix-ui/react-separator";
|
|
15
15
|
import * as O from "@radix-ui/react-tooltip";
|
|
@@ -65,49 +65,49 @@ const la = we(
|
|
|
65
65
|
lg: "[&_svg]:size-[var(--control-icon-lg)]",
|
|
66
66
|
xl: "[&_svg]:size-[var(--control-icon-xl)]",
|
|
67
67
|
icon: "[&_svg]:size-[var(--control-icon-md)]"
|
|
68
|
-
},
|
|
68
|
+
}, T = f(
|
|
69
69
|
({
|
|
70
70
|
className: e,
|
|
71
71
|
variant: a,
|
|
72
72
|
size: n = "md",
|
|
73
73
|
asChild: l = !1,
|
|
74
74
|
leadingIcon: i,
|
|
75
|
-
trailingIcon:
|
|
76
|
-
iconOnly:
|
|
77
|
-
loading:
|
|
78
|
-
fullWidth:
|
|
79
|
-
disabled:
|
|
75
|
+
trailingIcon: u,
|
|
76
|
+
iconOnly: m = !1,
|
|
77
|
+
loading: c = !1,
|
|
78
|
+
fullWidth: x = !1,
|
|
79
|
+
disabled: b,
|
|
80
80
|
children: h,
|
|
81
|
-
...
|
|
81
|
+
...N
|
|
82
82
|
}, S) => {
|
|
83
|
-
const
|
|
83
|
+
const C = l ? Zt : "button", w = ia[n ?? "md"];
|
|
84
84
|
return /* @__PURE__ */ t(
|
|
85
|
-
|
|
85
|
+
C,
|
|
86
86
|
{
|
|
87
87
|
ref: S,
|
|
88
|
-
"aria-busy":
|
|
89
|
-
disabled: l ? void 0 :
|
|
88
|
+
"aria-busy": c || void 0,
|
|
89
|
+
disabled: l ? void 0 : b || c,
|
|
90
90
|
className: o(
|
|
91
91
|
la({ variant: a, size: n }),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
m && "aspect-square px-0",
|
|
93
|
+
x && "w-full",
|
|
94
|
+
c && "disabled:opacity-100",
|
|
95
95
|
e
|
|
96
96
|
),
|
|
97
|
-
...
|
|
97
|
+
...N,
|
|
98
98
|
children: l ? h : /* @__PURE__ */ s("span", { className: "relative inline-flex w-full items-center [justify-content:inherit] gap-(--control-gap)", children: [
|
|
99
99
|
/* @__PURE__ */ s(
|
|
100
100
|
"span",
|
|
101
101
|
{
|
|
102
102
|
className: o(
|
|
103
103
|
"inline-flex w-full items-center [justify-content:inherit] gap-(--control-gap) transition-[opacity,translate] duration-150 ease-out motion-reduce:transition-none",
|
|
104
|
-
|
|
104
|
+
c && "translate-y-2 opacity-0"
|
|
105
105
|
),
|
|
106
|
-
"aria-hidden":
|
|
106
|
+
"aria-hidden": c || void 0,
|
|
107
107
|
children: [
|
|
108
|
-
!
|
|
108
|
+
!c && i ? /* @__PURE__ */ t("span", { className: o("inline-flex shrink-0", w), "aria-hidden": !0, children: i }) : null,
|
|
109
109
|
h,
|
|
110
|
-
!
|
|
110
|
+
!c && u ? /* @__PURE__ */ t("span", { className: o("inline-flex shrink-0", w), "aria-hidden": !0, children: u }) : null
|
|
111
111
|
]
|
|
112
112
|
}
|
|
113
113
|
),
|
|
@@ -117,7 +117,7 @@ const la = we(
|
|
|
117
117
|
"data-button-spinner": !0,
|
|
118
118
|
className: o(
|
|
119
119
|
"pointer-events-none absolute inset-0 flex items-center justify-center transition-[opacity,translate] duration-150 ease-out motion-reduce:transition-none",
|
|
120
|
-
|
|
120
|
+
c ? "translate-y-0 opacity-100" : "-translate-y-2 opacity-0"
|
|
121
121
|
),
|
|
122
122
|
"aria-hidden": !0,
|
|
123
123
|
children: /* @__PURE__ */ t(na, { className: o("text-current", w) })
|
|
@@ -128,16 +128,16 @@ const la = we(
|
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
);
|
|
131
|
-
|
|
131
|
+
T.displayName = "Button";
|
|
132
132
|
function rr({
|
|
133
133
|
command: e,
|
|
134
134
|
tag: a = "Build with agents",
|
|
135
135
|
icon: n,
|
|
136
136
|
className: l
|
|
137
137
|
}) {
|
|
138
|
-
const [i,
|
|
138
|
+
const [i, u] = D(!1), m = async () => {
|
|
139
139
|
try {
|
|
140
|
-
await navigator.clipboard.writeText(e),
|
|
140
|
+
await navigator.clipboard.writeText(e), u(!0), window.setTimeout(() => u(!1), 1500);
|
|
141
141
|
} catch {
|
|
142
142
|
}
|
|
143
143
|
};
|
|
@@ -150,14 +150,14 @@ function rr({
|
|
|
150
150
|
/* @__PURE__ */ t(At, { className: "size-4 shrink-0 text-subtle", "aria-hidden": !0 }),
|
|
151
151
|
/* @__PURE__ */ t("span", { className: "truncate font-mono text-sm text-fg", children: e }),
|
|
152
152
|
/* @__PURE__ */ t(
|
|
153
|
-
|
|
153
|
+
T,
|
|
154
154
|
{
|
|
155
155
|
variant: "ghost",
|
|
156
156
|
size: "sm",
|
|
157
157
|
iconOnly: !0,
|
|
158
158
|
"aria-label": "Copy prompt",
|
|
159
159
|
className: "ml-auto",
|
|
160
|
-
onClick:
|
|
160
|
+
onClick: m,
|
|
161
161
|
children: i ? /* @__PURE__ */ t(X, { className: "text-success", weight: "bold" }) : /* @__PURE__ */ t(Xe, {})
|
|
162
162
|
}
|
|
163
163
|
)
|
|
@@ -262,7 +262,7 @@ function nr({
|
|
|
262
262
|
icon: l,
|
|
263
263
|
className: i
|
|
264
264
|
}) {
|
|
265
|
-
const { Icon:
|
|
265
|
+
const { Icon: u, className: m, iconClassName: c } = ca[e];
|
|
266
266
|
return /* @__PURE__ */ s(
|
|
267
267
|
"div",
|
|
268
268
|
{
|
|
@@ -270,11 +270,11 @@ function nr({
|
|
|
270
270
|
className: o(
|
|
271
271
|
"flex items-start gap-2.5 rounded-lg border px-3.5 py-3 text-sm",
|
|
272
272
|
"animate-in fade-in-0 slide-in-from-top-1 duration-200 motion-reduce:animate-none",
|
|
273
|
-
|
|
273
|
+
m,
|
|
274
274
|
i
|
|
275
275
|
),
|
|
276
276
|
children: [
|
|
277
|
-
/* @__PURE__ */ t("span", { className: o("mt-0.5 shrink-0 [&_svg]:size-4",
|
|
277
|
+
/* @__PURE__ */ t("span", { className: o("mt-0.5 shrink-0 [&_svg]:size-4", c), children: l ?? /* @__PURE__ */ t(u, { weight: "fill" }) }),
|
|
278
278
|
/* @__PURE__ */ s("div", { className: "min-w-0 space-y-0.5", children: [
|
|
279
279
|
a ? /* @__PURE__ */ t("p", { className: "font-medium text-fg", children: a }) : null,
|
|
280
280
|
n ? /* @__PURE__ */ t("div", { className: "text-muted", children: n }) : null
|
|
@@ -382,14 +382,14 @@ function ce({
|
|
|
382
382
|
header: n,
|
|
383
383
|
children: l,
|
|
384
384
|
action: i,
|
|
385
|
-
tone:
|
|
386
|
-
className:
|
|
387
|
-
headerClassName:
|
|
388
|
-
panelClassName:
|
|
389
|
-
minHeight:
|
|
385
|
+
tone: u = "default",
|
|
386
|
+
className: m,
|
|
387
|
+
headerClassName: c,
|
|
388
|
+
panelClassName: x,
|
|
389
|
+
minHeight: b
|
|
390
390
|
}) {
|
|
391
|
-
const h = !!(e || a),
|
|
392
|
-
|
|
391
|
+
const h = !!(e || a), N = ga(i) ? /* @__PURE__ */ t(
|
|
392
|
+
T,
|
|
393
393
|
{
|
|
394
394
|
variant: i.variant ?? "primary",
|
|
395
395
|
size: "xs",
|
|
@@ -403,17 +403,17 @@ function ce({
|
|
|
403
403
|
] }) : i.label
|
|
404
404
|
}
|
|
405
405
|
) : i;
|
|
406
|
-
return /* @__PURE__ */ s(ua, { className: o("relative", ba[
|
|
406
|
+
return /* @__PURE__ */ s(ua, { className: o("relative", ba[u], m), children: [
|
|
407
407
|
/* @__PURE__ */ s("div", { className: "overflow-x-auto", children: [
|
|
408
408
|
n || h ? (
|
|
409
409
|
// Header rows must not inherit the body row hover surface.
|
|
410
|
-
/* @__PURE__ */ s("div", { className: o("[--table-row-hover:transparent] text-table-header",
|
|
410
|
+
/* @__PURE__ */ s("div", { className: o("[--table-row-hover:transparent] text-table-header", c), children: [
|
|
411
411
|
h ? /* @__PURE__ */ s(
|
|
412
412
|
"div",
|
|
413
413
|
{
|
|
414
414
|
className: o(
|
|
415
415
|
"px-(--table-pad-x) pb-3 pt-4",
|
|
416
|
-
|
|
416
|
+
N && "pr-28"
|
|
417
417
|
),
|
|
418
418
|
children: [
|
|
419
419
|
e ? /* @__PURE__ */ t("div", { className: "text-sm font-semibold text-fg", children: e }) : null,
|
|
@@ -427,13 +427,13 @@ function ce({
|
|
|
427
427
|
/* @__PURE__ */ t(
|
|
428
428
|
ma,
|
|
429
429
|
{
|
|
430
|
-
className: o(ha[
|
|
431
|
-
style:
|
|
430
|
+
className: o(ha[u], x),
|
|
431
|
+
style: b ? { minHeight: b } : void 0,
|
|
432
432
|
children: l
|
|
433
433
|
}
|
|
434
434
|
)
|
|
435
435
|
] }),
|
|
436
|
-
|
|
436
|
+
N ? /* @__PURE__ */ t("div", { className: "pointer-events-none absolute right-4 top-(--table-inset) flex h-(--table-header-h) items-center", children: /* @__PURE__ */ t("div", { className: "pointer-events-auto", children: N }) }) : null
|
|
437
437
|
] });
|
|
438
438
|
}
|
|
439
439
|
function xa(e) {
|
|
@@ -447,8 +447,8 @@ function xa(e) {
|
|
|
447
447
|
}
|
|
448
448
|
const va = f(
|
|
449
449
|
({ className: e, children: a, ...n }, l) => {
|
|
450
|
-
const { header: i, body:
|
|
451
|
-
return /* @__PURE__ */ t("div", { ref: l, ...n, children: /* @__PURE__ */ t(ce, { className: o("shadow-xs", e), header: i, children:
|
|
450
|
+
const { header: i, body: u } = xa(a);
|
|
451
|
+
return /* @__PURE__ */ t("div", { ref: l, ...n, children: /* @__PURE__ */ t(ce, { className: o("shadow-xs", e), header: i, children: u }) });
|
|
452
452
|
}
|
|
453
453
|
);
|
|
454
454
|
va.displayName = "Card";
|
|
@@ -580,39 +580,39 @@ function Ta({
|
|
|
580
580
|
children: l,
|
|
581
581
|
...i
|
|
582
582
|
}) {
|
|
583
|
-
const [
|
|
583
|
+
const [u, m] = D(
|
|
584
584
|
a ?? !1
|
|
585
|
-
), [
|
|
586
|
-
S.current =
|
|
587
|
-
const
|
|
585
|
+
), [c, x] = D(!1), b = ae(!1), h = ae(null), N = e ?? u, S = ae(N);
|
|
586
|
+
S.current = N;
|
|
587
|
+
const C = e !== void 0;
|
|
588
588
|
U(() => ka(), []), U(() => {
|
|
589
|
-
e && (h.current && clearTimeout(h.current),
|
|
589
|
+
e && (h.current && clearTimeout(h.current), b.current = !1, x(!1));
|
|
590
590
|
}, [e]), U(
|
|
591
591
|
() => () => {
|
|
592
592
|
h.current && clearTimeout(h.current);
|
|
593
593
|
},
|
|
594
594
|
[]
|
|
595
595
|
);
|
|
596
|
-
const w = (
|
|
597
|
-
if (
|
|
598
|
-
h.current && clearTimeout(h.current),
|
|
596
|
+
const w = (P) => {
|
|
597
|
+
if (P) {
|
|
598
|
+
h.current && clearTimeout(h.current), b.current = !1, x(!1), C || m(!0), n == null || n(!0);
|
|
599
599
|
return;
|
|
600
600
|
}
|
|
601
|
-
if (!
|
|
601
|
+
if (!N || b.current) return;
|
|
602
602
|
if (typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
603
|
-
|
|
603
|
+
C || m(!1), n == null || n(!1);
|
|
604
604
|
return;
|
|
605
605
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
S.current && (
|
|
606
|
+
b.current = !0, x(!0), h.current = setTimeout(() => {
|
|
607
|
+
C || m(!1), n == null || n(!1), requestAnimationFrame(() => {
|
|
608
|
+
S.current && (b.current = !1, x(!1));
|
|
609
609
|
});
|
|
610
610
|
}, Da);
|
|
611
611
|
};
|
|
612
|
-
return /* @__PURE__ */ t(rt.Provider, { value: () => w(!1), children: /* @__PURE__ */ t(at.Provider, { value:
|
|
612
|
+
return /* @__PURE__ */ t(rt.Provider, { value: () => w(!1), children: /* @__PURE__ */ t(at.Provider, { value: c, children: /* @__PURE__ */ t(ke.Provider, { value: !0, children: /* @__PURE__ */ t(
|
|
613
613
|
I.Root,
|
|
614
614
|
{
|
|
615
|
-
open:
|
|
615
|
+
open: N,
|
|
616
616
|
onOpenChange: w,
|
|
617
617
|
...i,
|
|
618
618
|
children: l
|
|
@@ -631,7 +631,7 @@ const nt = f(({ onClick: e, ...a }, n) => /* @__PURE__ */ t(
|
|
|
631
631
|
));
|
|
632
632
|
nt.displayName = "DialogTrigger";
|
|
633
633
|
const sr = I.Close, lt = f(
|
|
634
|
-
({ variant: e = "secondary", children: a = "Cancel", ...n }, l) => /* @__PURE__ */ t(I.Close, { asChild: !0, children: /* @__PURE__ */ t(
|
|
634
|
+
({ variant: e = "secondary", children: a = "Cancel", ...n }, l) => /* @__PURE__ */ t(I.Close, { asChild: !0, children: /* @__PURE__ */ t(T, { ref: l, type: "button", variant: e, ...n, children: a }) })
|
|
635
635
|
);
|
|
636
636
|
lt.displayName = "DialogCancel";
|
|
637
637
|
function it(e, a = !0) {
|
|
@@ -645,12 +645,12 @@ function it(e, a = !0) {
|
|
|
645
645
|
e.dataset.dialogMotionStarted = "true";
|
|
646
646
|
const l = za(e), i = l ? Sa(l, n) : null;
|
|
647
647
|
i ? (e.style.setProperty("--dialog-dx", `${i.dx}px`), e.style.setProperty("--dialog-dy", `${i.dy}px`), e.style.setProperty("--dialog-sx", String(i.sx)), e.style.setProperty("--dialog-sy", String(i.sy)), e.classList.add("dialog-fly-in")) : (e.style.removeProperty("--dialog-dx"), e.style.removeProperty("--dialog-dy"), e.style.removeProperty("--dialog-sx"), e.style.removeProperty("--dialog-sy"), e.classList.add("dialog-pop-in"));
|
|
648
|
-
const
|
|
648
|
+
const u = () => {
|
|
649
649
|
e.classList.remove("dialog-fly-in", "dialog-pop-in");
|
|
650
|
-
},
|
|
651
|
-
|
|
650
|
+
}, m = (c) => {
|
|
651
|
+
c.target === e && (c.animationName !== "dialog-fly-in" && c.animationName !== "dialog-pop-in" || (e.removeEventListener("animationend", m), u()));
|
|
652
652
|
};
|
|
653
|
-
e.addEventListener("animationend",
|
|
653
|
+
e.addEventListener("animationend", m);
|
|
654
654
|
}
|
|
655
655
|
function Ma(e) {
|
|
656
656
|
return e.replace(/dvh\b/g, "vh");
|
|
@@ -661,23 +661,24 @@ const ot = f(
|
|
|
661
661
|
children: a,
|
|
662
662
|
placement: n = "center",
|
|
663
663
|
topOffset: l = "11dvh",
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
664
|
+
motion: i = "auto",
|
|
665
|
+
style: u,
|
|
666
|
+
onEscapeKeyDown: m,
|
|
667
|
+
onPointerDownOutside: c,
|
|
668
|
+
...x
|
|
668
669
|
}, b) => {
|
|
669
|
-
const
|
|
670
|
+
const h = B(at), N = n === "top", S = N ? {
|
|
670
671
|
"--dialog-top-offset": l,
|
|
671
672
|
"--dialog-top-offset-fallback": Ma(l)
|
|
672
|
-
} : void 0,
|
|
673
|
-
(
|
|
674
|
-
if (
|
|
675
|
-
b(
|
|
673
|
+
} : void 0, C = B(rt), w = ae(null), P = Yt(
|
|
674
|
+
(g) => {
|
|
675
|
+
if (w.current = g, g && i === "auto" && it(g), typeof b == "function") {
|
|
676
|
+
b(g);
|
|
676
677
|
return;
|
|
677
678
|
}
|
|
678
|
-
b && (b.current =
|
|
679
|
+
b && (b.current = g);
|
|
679
680
|
},
|
|
680
|
-
[b]
|
|
681
|
+
[i, b]
|
|
681
682
|
);
|
|
682
683
|
return /* @__PURE__ */ s(I.Portal, { children: [
|
|
683
684
|
/* @__PURE__ */ t(
|
|
@@ -685,8 +686,8 @@ const ot = f(
|
|
|
685
686
|
{
|
|
686
687
|
className: o(
|
|
687
688
|
"fixed inset-0 z-50 overflow-hidden bg-overlay backdrop-blur-[3px] data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
688
|
-
!
|
|
689
|
-
|
|
689
|
+
!h && "data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
690
|
+
h && "opacity-0 transition-opacity duration-200"
|
|
690
691
|
),
|
|
691
692
|
children: /* @__PURE__ */ t(
|
|
692
693
|
"span",
|
|
@@ -702,28 +703,29 @@ const ot = f(
|
|
|
702
703
|
{
|
|
703
704
|
className: o(
|
|
704
705
|
"pointer-events-none fixed inset-0 z-50 flex justify-center overflow-y-auto p-4",
|
|
705
|
-
|
|
706
|
+
N ? "items-start" : "items-center"
|
|
706
707
|
),
|
|
707
708
|
children: /* @__PURE__ */ s(
|
|
708
709
|
I.Content,
|
|
709
710
|
{
|
|
710
|
-
ref:
|
|
711
|
-
style:
|
|
711
|
+
ref: P,
|
|
712
|
+
style: S ? { ...S, ...u } : u,
|
|
712
713
|
className: o(
|
|
713
714
|
"dialog-content pointer-events-auto relative flex max-h-[min(85vh,44rem)] w-full max-w-[22.4rem] flex-col gap-0 overflow-hidden will-change-[transform,opacity]",
|
|
714
715
|
"rounded-2xl border border-(--dialog-shell-border) bg-(--dialog-shell-bg) pb-3 shadow-(--dialog-shell-shadow) sm:pb-4",
|
|
715
|
-
|
|
716
|
-
|
|
716
|
+
N && "dialog-anchor-top",
|
|
717
|
+
i === "command" && "dialog-command-motion",
|
|
718
|
+
h && "dialog-closing",
|
|
717
719
|
"focus:outline-none",
|
|
718
720
|
e
|
|
719
721
|
),
|
|
720
|
-
onEscapeKeyDown: (
|
|
721
|
-
|
|
722
|
+
onEscapeKeyDown: (g) => {
|
|
723
|
+
m == null || m(g), !g.defaultPrevented && (g.preventDefault(), C());
|
|
722
724
|
},
|
|
723
|
-
onPointerDownOutside: (
|
|
724
|
-
|
|
725
|
+
onPointerDownOutside: (g) => {
|
|
726
|
+
c == null || c(g), !g.defaultPrevented && (g.preventDefault(), C());
|
|
725
727
|
},
|
|
726
|
-
...
|
|
728
|
+
...x,
|
|
727
729
|
children: [
|
|
728
730
|
a,
|
|
729
731
|
/* @__PURE__ */ s(I.Close, { className: "absolute right-3.5 top-3.5 z-10 rounded-sm text-subtle transition-colors hover:text-fg focus-visible:outline-none", children: [
|
|
@@ -831,14 +833,14 @@ function La({
|
|
|
831
833
|
onChange: n,
|
|
832
834
|
disabled: l = !1,
|
|
833
835
|
name: i,
|
|
834
|
-
className:
|
|
835
|
-
children:
|
|
836
|
-
...
|
|
836
|
+
className: u,
|
|
837
|
+
children: m,
|
|
838
|
+
...c
|
|
837
839
|
}) {
|
|
838
|
-
const
|
|
839
|
-
return /* @__PURE__ */ t(dt.Provider, { value: { name:
|
|
840
|
+
const x = de(), b = i ?? x;
|
|
841
|
+
return /* @__PURE__ */ t(dt.Provider, { value: { name: b, value: a, onChange: n, disabled: l }, children: /* @__PURE__ */ s("fieldset", { className: o("flex flex-col gap-6", u), ...c, children: [
|
|
840
842
|
/* @__PURE__ */ t("legend", { className: "sr-only", children: e }),
|
|
841
|
-
|
|
843
|
+
m
|
|
842
844
|
] }) });
|
|
843
845
|
}
|
|
844
846
|
function Ra({
|
|
@@ -847,34 +849,34 @@ function Ra({
|
|
|
847
849
|
description: n,
|
|
848
850
|
badge: l,
|
|
849
851
|
disabled: i = !1,
|
|
850
|
-
className:
|
|
852
|
+
className: u
|
|
851
853
|
}) {
|
|
852
|
-
const
|
|
853
|
-
if (!
|
|
854
|
+
const m = B(dt), c = de();
|
|
855
|
+
if (!m)
|
|
854
856
|
throw new Error("RadioCard must be rendered inside a RadioGroup");
|
|
855
|
-
const
|
|
857
|
+
const x = i || m.disabled, b = m.value === e;
|
|
856
858
|
return /* @__PURE__ */ s(
|
|
857
859
|
"label",
|
|
858
860
|
{
|
|
859
861
|
className: o(
|
|
860
862
|
"group relative flex items-start gap-3",
|
|
861
|
-
|
|
862
|
-
|
|
863
|
+
x ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
864
|
+
u
|
|
863
865
|
),
|
|
864
866
|
children: [
|
|
865
867
|
/* @__PURE__ */ t(
|
|
866
868
|
"input",
|
|
867
869
|
{
|
|
868
870
|
type: "radio",
|
|
869
|
-
name:
|
|
871
|
+
name: m.name,
|
|
870
872
|
value: e,
|
|
871
|
-
checked:
|
|
872
|
-
disabled:
|
|
873
|
+
checked: b,
|
|
874
|
+
disabled: x,
|
|
873
875
|
onChange: () => {
|
|
874
876
|
var h;
|
|
875
|
-
return (h =
|
|
877
|
+
return (h = m.onChange) == null ? void 0 : h.call(m, e);
|
|
876
878
|
},
|
|
877
|
-
"aria-describedby": n ?
|
|
879
|
+
"aria-describedby": n ? c : void 0,
|
|
878
880
|
className: "peer sr-only"
|
|
879
881
|
}
|
|
880
882
|
),
|
|
@@ -894,7 +896,7 @@ function Ra({
|
|
|
894
896
|
/* @__PURE__ */ t("span", { className: "text-base font-semibold text-fg", children: a }),
|
|
895
897
|
l ? /* @__PURE__ */ t(da, { variant: "primary", children: l }) : null
|
|
896
898
|
] }),
|
|
897
|
-
n ? /* @__PURE__ */ t("span", { id:
|
|
899
|
+
n ? /* @__PURE__ */ t("span", { id: c, className: "mt-1 block text-sm text-muted", children: n }) : null
|
|
898
900
|
] })
|
|
899
901
|
]
|
|
900
902
|
}
|
|
@@ -906,15 +908,15 @@ function dr({
|
|
|
906
908
|
trigger: n,
|
|
907
909
|
title: l,
|
|
908
910
|
options: i,
|
|
909
|
-
defaultValue:
|
|
910
|
-
value:
|
|
911
|
-
onValueChange:
|
|
912
|
-
cancelLabel:
|
|
913
|
-
confirmLabel:
|
|
911
|
+
defaultValue: u,
|
|
912
|
+
value: m,
|
|
913
|
+
onValueChange: c,
|
|
914
|
+
cancelLabel: x = "Cancel",
|
|
915
|
+
confirmLabel: b = "Continue",
|
|
914
916
|
onConfirm: h
|
|
915
917
|
}) {
|
|
916
|
-
var
|
|
917
|
-
const [
|
|
918
|
+
var P;
|
|
919
|
+
const [N, S] = D(u ?? ((P = i[0]) == null ? void 0 : P.value) ?? ""), C = m ?? N;
|
|
918
920
|
return /* @__PURE__ */ s(Ta, { open: e, onOpenChange: a, children: [
|
|
919
921
|
n ? /* @__PURE__ */ t(nt, { asChild: !0, children: n }) : null,
|
|
920
922
|
/* @__PURE__ */ s(
|
|
@@ -925,22 +927,22 @@ function dr({
|
|
|
925
927
|
children: [
|
|
926
928
|
/* @__PURE__ */ s(Pa, { children: [
|
|
927
929
|
/* @__PURE__ */ t(Ea, { children: /* @__PURE__ */ t(st, { className: "text-xl", children: l }) }),
|
|
928
|
-
/* @__PURE__ */ t(Ia, { children: /* @__PURE__ */ t(La, { label: l, value:
|
|
929
|
-
|
|
930
|
-
}, children: i.map((
|
|
930
|
+
/* @__PURE__ */ t(Ia, { children: /* @__PURE__ */ t(La, { label: l, value: C, onChange: (g) => {
|
|
931
|
+
m === void 0 && S(g), c == null || c(g);
|
|
932
|
+
}, children: i.map((g) => /* @__PURE__ */ t(
|
|
931
933
|
Ra,
|
|
932
934
|
{
|
|
933
|
-
value:
|
|
934
|
-
title:
|
|
935
|
-
description:
|
|
936
|
-
badge:
|
|
935
|
+
value: g.value,
|
|
936
|
+
title: g.title,
|
|
937
|
+
description: g.description,
|
|
938
|
+
badge: g.badge
|
|
937
939
|
},
|
|
938
|
-
|
|
940
|
+
g.value
|
|
939
941
|
)) }) })
|
|
940
942
|
] }),
|
|
941
943
|
/* @__PURE__ */ s(ja, { className: "gap-3 pt-2.5", children: [
|
|
942
|
-
/* @__PURE__ */ t(lt, { className: "flex-1", children:
|
|
943
|
-
/* @__PURE__ */ t(
|
|
944
|
+
/* @__PURE__ */ t(lt, { className: "flex-1", children: x }),
|
|
945
|
+
/* @__PURE__ */ t(T, { className: "flex-1", onClick: () => h == null ? void 0 : h(C), children: b })
|
|
944
946
|
] })
|
|
945
947
|
]
|
|
946
948
|
}
|
|
@@ -948,7 +950,7 @@ function dr({
|
|
|
948
950
|
] });
|
|
949
951
|
}
|
|
950
952
|
function cr({ code: e, label: a, className: n }) {
|
|
951
|
-
const [l, i] =
|
|
953
|
+
const [l, i] = D(!1);
|
|
952
954
|
return /* @__PURE__ */ t(
|
|
953
955
|
ce,
|
|
954
956
|
{
|
|
@@ -1002,31 +1004,31 @@ const Aa = {
|
|
|
1002
1004
|
type: n = "text",
|
|
1003
1005
|
size: l = "md",
|
|
1004
1006
|
leadingIcon: i,
|
|
1005
|
-
trailingIcon:
|
|
1006
|
-
onClear:
|
|
1007
|
-
value:
|
|
1008
|
-
defaultValue:
|
|
1009
|
-
error:
|
|
1007
|
+
trailingIcon: u,
|
|
1008
|
+
onClear: m,
|
|
1009
|
+
value: c,
|
|
1010
|
+
defaultValue: x,
|
|
1011
|
+
error: b = !1,
|
|
1010
1012
|
helperText: h,
|
|
1011
|
-
id:
|
|
1013
|
+
id: N,
|
|
1012
1014
|
"aria-describedby": S,
|
|
1013
|
-
disabled:
|
|
1015
|
+
disabled: C,
|
|
1014
1016
|
readOnly: w,
|
|
1015
|
-
...
|
|
1016
|
-
},
|
|
1017
|
-
const F = de(), Q =
|
|
1017
|
+
...P
|
|
1018
|
+
}, g) => {
|
|
1019
|
+
const F = de(), Q = N ?? F, $ = !!h, _ = !!(m && (c !== void 0 ? String(c).length > 0 : x !== void 0 && String(x).length > 0)), Y = $ ? `${Q}-description` : void 0, ue = [S, Y].filter(Boolean).join(" ") || void 0, Z = /* @__PURE__ */ t(
|
|
1018
1020
|
"input",
|
|
1019
1021
|
{
|
|
1020
|
-
ref:
|
|
1022
|
+
ref: g,
|
|
1021
1023
|
id: Q,
|
|
1022
1024
|
type: n,
|
|
1023
|
-
disabled:
|
|
1025
|
+
disabled: C,
|
|
1024
1026
|
readOnly: w,
|
|
1025
|
-
"aria-invalid":
|
|
1027
|
+
"aria-invalid": b || void 0,
|
|
1026
1028
|
"aria-describedby": ue,
|
|
1027
|
-
style: i ||
|
|
1029
|
+
style: i || u || _ ? {
|
|
1028
1030
|
paddingInlineStart: i ? `calc(var(--control-pad-x-${l}) + var(--control-icon-${l}) + var(--control-gap))` : void 0,
|
|
1029
|
-
paddingInlineEnd:
|
|
1031
|
+
paddingInlineEnd: u || _ ? `calc(var(--control-pad-x-${l}) + var(--control-icon-${l}) + var(--control-gap))` : void 0
|
|
1030
1032
|
} : void 0,
|
|
1031
1033
|
className: o(
|
|
1032
1034
|
"flex w-full rounded-md border bg-(--input-bg) text-(--input-fg) transition-colors",
|
|
@@ -1035,19 +1037,19 @@ const Aa = {
|
|
|
1035
1037
|
"placeholder:text-(--input-placeholder)",
|
|
1036
1038
|
"hover:border-(--input-border-hover)",
|
|
1037
1039
|
"focus-visible:outline-none focus-visible:border-(--input-border-focus) focus-visible:ring-2 focus-visible:ring-focus/30",
|
|
1038
|
-
|
|
1039
|
-
!
|
|
1040
|
+
b && "border-error hover:border-error focus-visible:border-error focus-visible:ring-error/30",
|
|
1041
|
+
!b && "border-(--input-border)",
|
|
1040
1042
|
n === "search" && "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-ms-clear]:hidden",
|
|
1041
|
-
|
|
1043
|
+
C && "cursor-not-allowed bg-(--input-bg-disabled) opacity-60 hover:border-(--input-border)",
|
|
1042
1044
|
w && "cursor-default focus-visible:ring-0",
|
|
1043
1045
|
e
|
|
1044
1046
|
),
|
|
1045
|
-
value:
|
|
1046
|
-
defaultValue:
|
|
1047
|
-
...
|
|
1047
|
+
value: c,
|
|
1048
|
+
defaultValue: x,
|
|
1049
|
+
...P
|
|
1048
1050
|
}
|
|
1049
1051
|
);
|
|
1050
|
-
return !i && !
|
|
1052
|
+
return !i && !u && !_ && !$ ? Z : /* @__PURE__ */ s("div", { className: o("w-full", a), children: [
|
|
1051
1053
|
/* @__PURE__ */ s("div", { className: "relative", children: [
|
|
1052
1054
|
i ? /* @__PURE__ */ t(
|
|
1053
1055
|
"span",
|
|
@@ -1066,14 +1068,14 @@ const Aa = {
|
|
|
1066
1068
|
{
|
|
1067
1069
|
type: "button",
|
|
1068
1070
|
"aria-label": "Clear search",
|
|
1069
|
-
onClick:
|
|
1071
|
+
onClick: m,
|
|
1070
1072
|
className: o(
|
|
1071
1073
|
"absolute inset-y-0 flex items-center text-(--input-placeholder) transition-colors hover:text-(--input-fg)",
|
|
1072
1074
|
We[l]
|
|
1073
1075
|
),
|
|
1074
1076
|
children: /* @__PURE__ */ t("span", { className: o("inline-flex items-center justify-center", ge[l]), children: /* @__PURE__ */ t(ie, {}) })
|
|
1075
1077
|
}
|
|
1076
|
-
) :
|
|
1078
|
+
) : u ? /* @__PURE__ */ t(
|
|
1077
1079
|
"span",
|
|
1078
1080
|
{
|
|
1079
1081
|
className: o(
|
|
@@ -1081,7 +1083,7 @@ const Aa = {
|
|
|
1081
1083
|
We[l]
|
|
1082
1084
|
),
|
|
1083
1085
|
"aria-hidden": !0,
|
|
1084
|
-
children: /* @__PURE__ */ t("span", { className: o("inline-flex items-center justify-center", ge[l]), children:
|
|
1086
|
+
children: /* @__PURE__ */ t("span", { className: o("inline-flex items-center justify-center", ge[l]), children: u })
|
|
1085
1087
|
}
|
|
1086
1088
|
) : null
|
|
1087
1089
|
] }),
|
|
@@ -1089,7 +1091,7 @@ const Aa = {
|
|
|
1089
1091
|
"p",
|
|
1090
1092
|
{
|
|
1091
1093
|
id: Y,
|
|
1092
|
-
className: o("mt-1.5 text-xs",
|
|
1094
|
+
className: o("mt-1.5 text-xs", b ? "text-error" : "text-muted"),
|
|
1093
1095
|
children: h
|
|
1094
1096
|
}
|
|
1095
1097
|
) : null
|
|
@@ -1101,7 +1103,7 @@ function ze(e, a) {
|
|
|
1101
1103
|
let n = 0;
|
|
1102
1104
|
return Je.forEach(e, (l) => {
|
|
1103
1105
|
if (!Qe(l)) return;
|
|
1104
|
-
if (a.some((
|
|
1106
|
+
if (a.some((u) => u === l.type)) {
|
|
1105
1107
|
n += 1;
|
|
1106
1108
|
return;
|
|
1107
1109
|
}
|
|
@@ -1119,12 +1121,12 @@ function xe({
|
|
|
1119
1121
|
W,
|
|
1120
1122
|
pt
|
|
1121
1123
|
]) === 0;
|
|
1122
|
-
return /* @__PURE__ */ t(ut.Provider, { value: n, children: /* @__PURE__ */ t(
|
|
1124
|
+
return /* @__PURE__ */ t(ut.Provider, { value: n, children: /* @__PURE__ */ t(k.Root, { ...a, children: e }) });
|
|
1123
1125
|
}
|
|
1124
1126
|
const re = f(({ className: e, disabled: a, ...n }, l) => {
|
|
1125
1127
|
const i = B(ut);
|
|
1126
1128
|
return /* @__PURE__ */ t(
|
|
1127
|
-
|
|
1129
|
+
k.Trigger,
|
|
1128
1130
|
{
|
|
1129
1131
|
ref: l,
|
|
1130
1132
|
className: o("group", e),
|
|
@@ -1147,8 +1149,8 @@ const mt = f(({ className: e, ...a }, n) => /* @__PURE__ */ t(
|
|
|
1147
1149
|
}
|
|
1148
1150
|
));
|
|
1149
1151
|
mt.displayName = "DropdownMenuChevron";
|
|
1150
|
-
const ur =
|
|
1151
|
-
|
|
1152
|
+
const ur = k.Group, mr = k.Portal, ne = f(({ className: e, sideOffset: a = 8, ...n }, l) => /* @__PURE__ */ t(k.Portal, { children: /* @__PURE__ */ t(
|
|
1153
|
+
k.Content,
|
|
1152
1154
|
{
|
|
1153
1155
|
ref: l,
|
|
1154
1156
|
sideOffset: a,
|
|
@@ -1167,7 +1169,7 @@ const ur = z.Group, mr = z.Portal, ne = f(({ className: e, sideOffset: a = 8, ..
|
|
|
1167
1169
|
) }));
|
|
1168
1170
|
ne.displayName = "DropdownMenuContent";
|
|
1169
1171
|
const se = f(({ className: e, inset: a, ...n }, l) => /* @__PURE__ */ t(
|
|
1170
|
-
|
|
1172
|
+
k.Item,
|
|
1171
1173
|
{
|
|
1172
1174
|
ref: l,
|
|
1173
1175
|
className: o(
|
|
@@ -1182,7 +1184,7 @@ const se = f(({ className: e, inset: a, ...n }, l) => /* @__PURE__ */ t(
|
|
|
1182
1184
|
));
|
|
1183
1185
|
se.displayName = "DropdownMenuItem";
|
|
1184
1186
|
const W = f(({ className: e, children: a, checked: n, ...l }, i) => /* @__PURE__ */ s(
|
|
1185
|
-
|
|
1187
|
+
k.CheckboxItem,
|
|
1186
1188
|
{
|
|
1187
1189
|
ref: i,
|
|
1188
1190
|
className: o(
|
|
@@ -1192,14 +1194,14 @@ const W = f(({ className: e, children: a, checked: n, ...l }, i) => /* @__PURE__
|
|
|
1192
1194
|
checked: n,
|
|
1193
1195
|
...l,
|
|
1194
1196
|
children: [
|
|
1195
|
-
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-4 shrink-0 items-center justify-center rounded border border-line-strong bg-transparent transition-colors group-data-[state=checked]:border-primary", children: /* @__PURE__ */ t(
|
|
1197
|
+
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-4 shrink-0 items-center justify-center rounded border border-line-strong bg-transparent transition-colors group-data-[state=checked]:border-primary", children: /* @__PURE__ */ t(k.ItemIndicator, { className: "btn-fill btn-inner-border flex size-full items-center justify-center rounded-[3px] border-0 bg-(--button-primary-bg) text-(--button-primary-fg) [--button-inner:var(--button-primary-inner)]", children: /* @__PURE__ */ t(X, { className: "size-3", weight: "bold" }) }) }),
|
|
1196
1198
|
a
|
|
1197
1199
|
]
|
|
1198
1200
|
}
|
|
1199
1201
|
));
|
|
1200
1202
|
W.displayName = "DropdownMenuCheckboxItem";
|
|
1201
1203
|
const le = f(({ className: e, ...a }, n) => /* @__PURE__ */ t(
|
|
1202
|
-
|
|
1204
|
+
k.Label,
|
|
1203
1205
|
{
|
|
1204
1206
|
ref: n,
|
|
1205
1207
|
className: o("px-2 py-1.5 text-xs font-medium text-subtle", e),
|
|
@@ -1207,8 +1209,8 @@ const le = f(({ className: e, ...a }, n) => /* @__PURE__ */ t(
|
|
|
1207
1209
|
}
|
|
1208
1210
|
));
|
|
1209
1211
|
le.displayName = "DropdownMenuLabel";
|
|
1210
|
-
const pr =
|
|
1211
|
-
|
|
1212
|
+
const pr = k.Sub, pt = f(({ className: e, inset: a, children: n, ...l }, i) => /* @__PURE__ */ s(
|
|
1213
|
+
k.SubTrigger,
|
|
1212
1214
|
{
|
|
1213
1215
|
ref: i,
|
|
1214
1216
|
className: o(
|
|
@@ -1227,7 +1229,7 @@ const pr = z.Sub, pt = f(({ className: e, inset: a, children: n, ...l }, i) => /
|
|
|
1227
1229
|
));
|
|
1228
1230
|
pt.displayName = "DropdownMenuSubTrigger";
|
|
1229
1231
|
const $a = f(({ className: e, ...a }, n) => /* @__PURE__ */ t(
|
|
1230
|
-
|
|
1232
|
+
k.SubContent,
|
|
1231
1233
|
{
|
|
1232
1234
|
ref: n,
|
|
1233
1235
|
sideOffset: 8,
|
|
@@ -1246,7 +1248,7 @@ const $a = f(({ className: e, ...a }, n) => /* @__PURE__ */ t(
|
|
|
1246
1248
|
));
|
|
1247
1249
|
$a.displayName = "DropdownMenuSubContent";
|
|
1248
1250
|
const ye = f(({ className: e, ...a }, n) => /* @__PURE__ */ t(
|
|
1249
|
-
|
|
1251
|
+
k.Separator,
|
|
1250
1252
|
{
|
|
1251
1253
|
ref: n,
|
|
1252
1254
|
className: o("-mx-1 my-1 h-px bg-line-strong", e),
|
|
@@ -1254,17 +1256,17 @@ const ye = f(({ className: e, ...a }, n) => /* @__PURE__ */ t(
|
|
|
1254
1256
|
}
|
|
1255
1257
|
));
|
|
1256
1258
|
ye.displayName = "DropdownMenuSeparator";
|
|
1257
|
-
const fr =
|
|
1259
|
+
const fr = M.Group, qa = M.Value;
|
|
1258
1260
|
function Ga({
|
|
1259
1261
|
children: e,
|
|
1260
1262
|
disabled: a,
|
|
1261
1263
|
...n
|
|
1262
1264
|
}) {
|
|
1263
1265
|
const l = ze(e, [De]) === 0;
|
|
1264
|
-
return /* @__PURE__ */ t(
|
|
1266
|
+
return /* @__PURE__ */ t(M.Root, { disabled: a || l, ...n, children: e });
|
|
1265
1267
|
}
|
|
1266
1268
|
const ft = f(({ className: e, children: a, variant: n = "field", ...l }, i) => /* @__PURE__ */ s(
|
|
1267
|
-
|
|
1269
|
+
M.Trigger,
|
|
1268
1270
|
{
|
|
1269
1271
|
ref: i,
|
|
1270
1272
|
className: o(
|
|
@@ -1278,16 +1280,16 @@ const ft = f(({ className: e, children: a, variant: n = "field", ...l }, i) => /
|
|
|
1278
1280
|
...l,
|
|
1279
1281
|
children: [
|
|
1280
1282
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-left", children: a }),
|
|
1281
|
-
/* @__PURE__ */ t(
|
|
1283
|
+
/* @__PURE__ */ t(M.Icon, { asChild: !0, children: /* @__PURE__ */ t(oe, { className: "ml-auto size-3.5 shrink-0 text-muted transition-transform duration-200 ease-out group-data-[state=open]:rotate-180 motion-reduce:transition-none" }) })
|
|
1282
1284
|
]
|
|
1283
1285
|
}
|
|
1284
1286
|
));
|
|
1285
1287
|
ft.displayName = "SelectTrigger";
|
|
1286
1288
|
const bt = f(
|
|
1287
|
-
({ className: e, children: a, position: n = "popper", sideOffset: l = 8, ...i },
|
|
1288
|
-
|
|
1289
|
+
({ className: e, children: a, position: n = "popper", sideOffset: l = 8, ...i }, u) => /* @__PURE__ */ t(M.Portal, { children: /* @__PURE__ */ t(
|
|
1290
|
+
M.Content,
|
|
1289
1291
|
{
|
|
1290
|
-
ref:
|
|
1292
|
+
ref: u,
|
|
1291
1293
|
position: n,
|
|
1292
1294
|
sideOffset: l,
|
|
1293
1295
|
className: o(
|
|
@@ -1301,13 +1303,13 @@ const bt = f(
|
|
|
1301
1303
|
e
|
|
1302
1304
|
),
|
|
1303
1305
|
...i,
|
|
1304
|
-
children: /* @__PURE__ */ t(
|
|
1306
|
+
children: /* @__PURE__ */ t(M.Viewport, { className: "p-0", children: a })
|
|
1305
1307
|
}
|
|
1306
1308
|
) })
|
|
1307
1309
|
);
|
|
1308
1310
|
bt.displayName = "SelectContent";
|
|
1309
1311
|
const De = f(({ className: e, children: a, ...n }, l) => /* @__PURE__ */ s(
|
|
1310
|
-
|
|
1312
|
+
M.Item,
|
|
1311
1313
|
{
|
|
1312
1314
|
ref: l,
|
|
1313
1315
|
className: o(
|
|
@@ -1316,14 +1318,14 @@ const De = f(({ className: e, children: a, ...n }, l) => /* @__PURE__ */ s(
|
|
|
1316
1318
|
),
|
|
1317
1319
|
...n,
|
|
1318
1320
|
children: [
|
|
1319
|
-
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ t(
|
|
1320
|
-
/* @__PURE__ */ t(
|
|
1321
|
+
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ t(M.ItemIndicator, { children: /* @__PURE__ */ t(X, { className: "size-3.5" }) }) }),
|
|
1322
|
+
/* @__PURE__ */ t(M.ItemText, { children: a })
|
|
1321
1323
|
]
|
|
1322
1324
|
}
|
|
1323
1325
|
));
|
|
1324
1326
|
De.displayName = "SelectItem";
|
|
1325
1327
|
const Ha = f(({ className: e, ...a }, n) => /* @__PURE__ */ t(
|
|
1326
|
-
|
|
1328
|
+
M.Label,
|
|
1327
1329
|
{
|
|
1328
1330
|
ref: n,
|
|
1329
1331
|
className: o("px-2 py-1.5 text-xs font-medium text-subtle", e),
|
|
@@ -1385,18 +1387,18 @@ function hr({
|
|
|
1385
1387
|
getRowId: n,
|
|
1386
1388
|
loading: l = !1,
|
|
1387
1389
|
error: i,
|
|
1388
|
-
empty:
|
|
1389
|
-
search:
|
|
1390
|
-
filters:
|
|
1391
|
-
toolbarStart:
|
|
1392
|
-
toolbarEnd:
|
|
1390
|
+
empty: u,
|
|
1391
|
+
search: m,
|
|
1392
|
+
filters: c,
|
|
1393
|
+
toolbarStart: x,
|
|
1394
|
+
toolbarEnd: b,
|
|
1393
1395
|
tabs: h,
|
|
1394
|
-
activeTab:
|
|
1396
|
+
activeTab: N,
|
|
1395
1397
|
onTabChange: S,
|
|
1396
|
-
infoBanner:
|
|
1398
|
+
infoBanner: C,
|
|
1397
1399
|
selectable: w = !1,
|
|
1398
|
-
bulkActions:
|
|
1399
|
-
rowActions:
|
|
1400
|
+
bulkActions: P,
|
|
1401
|
+
rowActions: g,
|
|
1400
1402
|
onRowClick: F,
|
|
1401
1403
|
defaultSort: Q,
|
|
1402
1404
|
pageSize: $ = 25,
|
|
@@ -1407,40 +1409,40 @@ function hr({
|
|
|
1407
1409
|
panelClassName: ht,
|
|
1408
1410
|
className: gt
|
|
1409
1411
|
}) {
|
|
1410
|
-
const [Te, Me] =
|
|
1412
|
+
const [Te, Me] = D(
|
|
1411
1413
|
() => Object.fromEntries(
|
|
1412
1414
|
a.filter((r) => r.defaultHidden && !r.required).map((r) => [r.id, !0])
|
|
1413
1415
|
)
|
|
1414
|
-
), [Pe, Ie] =
|
|
1416
|
+
), [Pe, Ie] = D(null), [me, Ee] = D(null), [y, xt] = D(
|
|
1415
1417
|
Q ?? null
|
|
1416
|
-
), [q, K] =
|
|
1418
|
+
), [q, K] = D(0), [L, vt] = D($), [R, pe] = D(/* @__PURE__ */ new Set()), [Nt, fe] = D([]), je = a.map((r) => r.id), _e = new Map(a.map((r) => [r.id, r])), Le = Pe ? Pe.map((r) => _e.get(r)).filter((r) => !!r) : a, E = Le.filter((r) => !Te[r.id]), Re = Le.filter((r) => Te[r.id] && !r.required), Ae = (r) => !!r.required, yt = (r) => _e.get(r), wt = (r, d) => {
|
|
1417
1419
|
const p = d ? yt(d) : void 0;
|
|
1418
1420
|
!p || Ae(p) || r === d || Ie((v) => {
|
|
1419
|
-
const
|
|
1420
|
-
return ra(
|
|
1421
|
+
const z = v ?? je;
|
|
1422
|
+
return ra(z, z.indexOf(r), z.indexOf(d));
|
|
1421
1423
|
});
|
|
1422
1424
|
}, Ct = (r) => {
|
|
1423
1425
|
Me((d) => ({ ...d, [r]: !1 })), Ie((d) => d && d.includes(r) ? d : [...d ?? je, r]);
|
|
1424
|
-
}, be = (
|
|
1426
|
+
}, be = (c ?? []).filter((r) => Nt.includes(r.id)), St = (c ?? []).map((r) => `${r.id}:${r.value.join(",")}`).join("|"), ee = qe(() => {
|
|
1425
1427
|
let r = e;
|
|
1426
|
-
for (const p of
|
|
1428
|
+
for (const p of c ?? [])
|
|
1427
1429
|
p.value.length > 0 && (r = r.filter((v) => p.match(v, p.value)));
|
|
1428
|
-
if (!
|
|
1429
|
-
const d =
|
|
1430
|
-
return r.filter((p) =>
|
|
1431
|
-
}, [e,
|
|
1432
|
-
if (!
|
|
1433
|
-
const r = a.find((p) => p.id ===
|
|
1430
|
+
if (!m || !m.value.trim()) return r;
|
|
1431
|
+
const d = m.value.trim().toLowerCase();
|
|
1432
|
+
return r.filter((p) => m.keys(p).toLowerCase().includes(d));
|
|
1433
|
+
}, [e, m, c]), G = qe(() => {
|
|
1434
|
+
if (!y) return ee;
|
|
1435
|
+
const r = a.find((p) => p.id === y.id);
|
|
1434
1436
|
if (!(r != null && r.sortValue)) return ee;
|
|
1435
|
-
const d =
|
|
1437
|
+
const d = y.dir === "asc" ? 1 : -1;
|
|
1436
1438
|
return [...ee].sort((p, v) => {
|
|
1437
|
-
const
|
|
1438
|
-
return
|
|
1439
|
+
const z = r.sortValue(p), V = r.sortValue(v);
|
|
1440
|
+
return z == null && V == null ? 0 : z == null ? 1 : V == null ? -1 : typeof z == "number" && typeof V == "number" ? (z - V) * d : String(z).localeCompare(String(V)) * d;
|
|
1439
1441
|
});
|
|
1440
|
-
}, [ee,
|
|
1442
|
+
}, [ee, y, a]), H = Math.max(1, Math.ceil(G.length / L));
|
|
1441
1443
|
U(() => {
|
|
1442
1444
|
K(0);
|
|
1443
|
-
}, [
|
|
1445
|
+
}, [m == null ? void 0 : m.value, L, y == null ? void 0 : y.id, y == null ? void 0 : y.dir, N, St]), U(() => {
|
|
1444
1446
|
q > H - 1 && K(H - 1);
|
|
1445
1447
|
}, [q, H]);
|
|
1446
1448
|
const te = q * L, j = G.slice(te, te + L), kt = (r) => {
|
|
@@ -1457,14 +1459,14 @@ function hr({
|
|
|
1457
1459
|
const p = new Set(d);
|
|
1458
1460
|
return p.has(r) ? p.delete(r) : p.add(r), p;
|
|
1459
1461
|
});
|
|
1460
|
-
}, Pt = !!(
|
|
1462
|
+
}, Pt = !!(m || c != null && c.length || x || b), It = E.some((r) => r.width), Et = E.length > 1 ? 70 / (E.length - 1) : 100, jt = E.map((r, d) => r.width ? r.width : It ? "auto" : `${d === 0 ? 30 : Et}%`), Fe = [
|
|
1461
1463
|
...w ? ["2.75rem"] : [],
|
|
1462
1464
|
...jt,
|
|
1463
|
-
...
|
|
1464
|
-
], _t = (r) => (
|
|
1465
|
+
...g ? ["11rem"] : []
|
|
1466
|
+
], _t = (r) => (y == null ? void 0 : y.id) === r.id ? y.dir === "asc" ? "ascending" : "descending" : void 0;
|
|
1465
1467
|
return /* @__PURE__ */ s("div", { className: o("space-y-4", gt), children: [
|
|
1466
1468
|
h && h.length > 0 && /* @__PURE__ */ t("div", { className: "flex items-center gap-1 border-b border-line", role: "tablist", children: h.map((r) => {
|
|
1467
|
-
const d = r.id ===
|
|
1469
|
+
const d = r.id === N;
|
|
1468
1470
|
return /* @__PURE__ */ t(
|
|
1469
1471
|
"button",
|
|
1470
1472
|
{
|
|
@@ -1482,24 +1484,24 @@ function hr({
|
|
|
1482
1484
|
);
|
|
1483
1485
|
}) }),
|
|
1484
1486
|
Pt && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1485
|
-
|
|
1487
|
+
m && /* @__PURE__ */ t(
|
|
1486
1488
|
ct,
|
|
1487
1489
|
{
|
|
1488
1490
|
type: "search",
|
|
1489
|
-
"aria-label":
|
|
1490
|
-
placeholder:
|
|
1491
|
-
value:
|
|
1492
|
-
onChange: (r) =>
|
|
1493
|
-
onClear: () =>
|
|
1491
|
+
"aria-label": m.placeholder ?? "Search",
|
|
1492
|
+
placeholder: m.placeholder ?? "Search...",
|
|
1493
|
+
value: m.value,
|
|
1494
|
+
onChange: (r) => m.onChange(r.target.value),
|
|
1495
|
+
onClear: () => m.onChange(""),
|
|
1494
1496
|
leadingIcon: /* @__PURE__ */ t(Vt, {}),
|
|
1495
1497
|
containerClassName: "w-full sm:w-[280px]",
|
|
1496
1498
|
className: "rounded-[6px] border-0 bg-surface shadow-xs ring-1 ring-line"
|
|
1497
1499
|
}
|
|
1498
1500
|
),
|
|
1499
|
-
|
|
1501
|
+
x,
|
|
1500
1502
|
/* @__PURE__ */ s(xe, { children: [
|
|
1501
1503
|
/* @__PURE__ */ t(re, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1502
|
-
|
|
1504
|
+
T,
|
|
1503
1505
|
{
|
|
1504
1506
|
variant: "secondary",
|
|
1505
1507
|
size: "md",
|
|
@@ -1567,9 +1569,9 @@ function hr({
|
|
|
1567
1569
|
] }) : null
|
|
1568
1570
|
] })
|
|
1569
1571
|
] }),
|
|
1570
|
-
|
|
1572
|
+
c && c.length > 0 ? /* @__PURE__ */ s(xe, { children: [
|
|
1571
1573
|
/* @__PURE__ */ t(re, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1572
|
-
|
|
1574
|
+
T,
|
|
1573
1575
|
{
|
|
1574
1576
|
variant: "secondary",
|
|
1575
1577
|
size: "md",
|
|
@@ -1578,7 +1580,7 @@ function hr({
|
|
|
1578
1580
|
children: /* @__PURE__ */ t($e, {})
|
|
1579
1581
|
}
|
|
1580
1582
|
) }),
|
|
1581
|
-
/* @__PURE__ */ t(ne, { align: "start", className: "w-54", children:
|
|
1583
|
+
/* @__PURE__ */ t(ne, { align: "start", className: "w-54", children: c.map((r) => /* @__PURE__ */ t(
|
|
1582
1584
|
se,
|
|
1583
1585
|
{
|
|
1584
1586
|
onSelect: () => fe(
|
|
@@ -1589,7 +1591,7 @@ function hr({
|
|
|
1589
1591
|
r.id
|
|
1590
1592
|
)) })
|
|
1591
1593
|
] }) : null,
|
|
1592
|
-
|
|
1594
|
+
b ? /* @__PURE__ */ t("div", { className: "flex-0 sm:ml-auto", children: b }) : null
|
|
1593
1595
|
] }),
|
|
1594
1596
|
be.length > 0 ? /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1595
1597
|
be.map((r) => {
|
|
@@ -1598,7 +1600,7 @@ function hr({
|
|
|
1598
1600
|
};
|
|
1599
1601
|
return /* @__PURE__ */ s("div", { className: "inline-flex items-center", children: [
|
|
1600
1602
|
/* @__PURE__ */ t(
|
|
1601
|
-
|
|
1603
|
+
T,
|
|
1602
1604
|
{
|
|
1603
1605
|
variant: "secondary",
|
|
1604
1606
|
size: "md",
|
|
@@ -1610,7 +1612,7 @@ function hr({
|
|
|
1610
1612
|
}
|
|
1611
1613
|
),
|
|
1612
1614
|
/* @__PURE__ */ s(xe, { children: [
|
|
1613
|
-
/* @__PURE__ */ t(re, { asChild: !0, children: /* @__PURE__ */ s(
|
|
1615
|
+
/* @__PURE__ */ t(re, { asChild: !0, children: /* @__PURE__ */ s(T, { variant: "secondary", size: "md", className: "rounded-l-none pl-2", children: [
|
|
1614
1616
|
/* @__PURE__ */ t($e, {}),
|
|
1615
1617
|
/* @__PURE__ */ t("span", { className: "font-medium", children: r.label }),
|
|
1616
1618
|
/* @__PURE__ */ t("span", { className: "h-4 w-px bg-line", "aria-hidden": !0 }),
|
|
@@ -1629,9 +1631,9 @@ function hr({
|
|
|
1629
1631
|
{
|
|
1630
1632
|
checked: v,
|
|
1631
1633
|
onCheckedChange: () => r.onChange(
|
|
1632
|
-
v ? r.value.filter((
|
|
1634
|
+
v ? r.value.filter((z) => z !== p.value) : [...r.value, p.value]
|
|
1633
1635
|
),
|
|
1634
|
-
onSelect: (
|
|
1636
|
+
onSelect: (z) => z.preventDefault(),
|
|
1635
1637
|
children: p.label
|
|
1636
1638
|
},
|
|
1637
1639
|
p.value
|
|
@@ -1656,14 +1658,14 @@ function hr({
|
|
|
1656
1658
|
}
|
|
1657
1659
|
)
|
|
1658
1660
|
] }) : null,
|
|
1659
|
-
|
|
1661
|
+
C,
|
|
1660
1662
|
w && R.size > 0 && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-3 rounded-lg border border-line bg-elevated px-3 py-2 text-sm", children: [
|
|
1661
1663
|
/* @__PURE__ */ s("span", { className: "font-medium text-fg", children: [
|
|
1662
1664
|
R.size,
|
|
1663
1665
|
" selected"
|
|
1664
1666
|
] }),
|
|
1665
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: (
|
|
1666
|
-
|
|
1667
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: (P ?? []).map((r) => /* @__PURE__ */ s(
|
|
1668
|
+
T,
|
|
1667
1669
|
{
|
|
1668
1670
|
size: "md",
|
|
1669
1671
|
variant: r.variant ?? "outline",
|
|
@@ -1715,7 +1717,7 @@ function hr({
|
|
|
1715
1717
|
{
|
|
1716
1718
|
className: o(Ua, r.align === "right" && "text-right", r.className),
|
|
1717
1719
|
children: r.sortable ? /* @__PURE__ */ s(
|
|
1718
|
-
|
|
1720
|
+
T,
|
|
1719
1721
|
{
|
|
1720
1722
|
type: "button",
|
|
1721
1723
|
variant: "ghost",
|
|
@@ -1726,18 +1728,18 @@ function hr({
|
|
|
1726
1728
|
"h-auto gap-1.5 rounded-none px-0 py-0 text-[0.8125rem] text-table-header transition-colors [&_svg]:size-3.5",
|
|
1727
1729
|
"hover:bg-transparent hover:text-table-header-active hover:shadow-none",
|
|
1728
1730
|
"active:scale-100 active:bg-transparent active:shadow-none",
|
|
1729
|
-
(
|
|
1731
|
+
(y == null ? void 0 : y.id) === r.id && "text-table-header-active"
|
|
1730
1732
|
),
|
|
1731
1733
|
children: [
|
|
1732
1734
|
r.header,
|
|
1733
|
-
(
|
|
1735
|
+
(y == null ? void 0 : y.id) === r.id ? y.dir === "asc" ? /* @__PURE__ */ t(Jt, { className: "size-3.5", weight: "bold" }) : /* @__PURE__ */ t(oe, { className: "size-3.5", weight: "bold" }) : /* @__PURE__ */ t(Qt, { className: "size-3.5 opacity-50" })
|
|
1734
1736
|
]
|
|
1735
1737
|
}
|
|
1736
1738
|
) : r.header
|
|
1737
1739
|
},
|
|
1738
1740
|
r.id
|
|
1739
1741
|
)),
|
|
1740
|
-
|
|
1742
|
+
g && /* @__PURE__ */ t("th", { className: "h-(--table-header-h) w-44 px-4 align-middle", children: /* @__PURE__ */ t("span", { className: "sr-only", children: "Actions" }) })
|
|
1741
1743
|
] }) })
|
|
1742
1744
|
] })
|
|
1743
1745
|
),
|
|
@@ -1751,17 +1753,17 @@ function hr({
|
|
|
1751
1753
|
] }) : j.length === 0 ? /* @__PURE__ */ t(
|
|
1752
1754
|
Va,
|
|
1753
1755
|
{
|
|
1754
|
-
icon:
|
|
1755
|
-
title: (
|
|
1756
|
-
description: typeof (
|
|
1757
|
-
action:
|
|
1756
|
+
icon: u == null ? void 0 : u.icon,
|
|
1757
|
+
title: (u == null ? void 0 : u.title) ?? "No results",
|
|
1758
|
+
description: typeof (u == null ? void 0 : u.description) == "string" ? u.description : void 0,
|
|
1759
|
+
action: u == null ? void 0 : u.action
|
|
1758
1760
|
}
|
|
1759
1761
|
) : /* @__PURE__ */ s("table", { className: "w-full table-fixed border-collapse", children: [
|
|
1760
1762
|
/* @__PURE__ */ t("colgroup", { children: Fe.map((r, d) => /* @__PURE__ */ t("col", { style: { width: r } }, d)) }),
|
|
1761
1763
|
/* @__PURE__ */ t("thead", { className: "sr-only", children: /* @__PURE__ */ s("tr", { children: [
|
|
1762
1764
|
w && /* @__PURE__ */ t("th", { scope: "col", children: "Select" }),
|
|
1763
1765
|
E.map((r) => /* @__PURE__ */ t("th", { scope: "col", "aria-sort": _t(r), children: r.header }, r.id)),
|
|
1764
|
-
|
|
1766
|
+
g && /* @__PURE__ */ t("th", { scope: "col", children: "Actions" })
|
|
1765
1767
|
] }) }),
|
|
1766
1768
|
/* @__PURE__ */ t(pa, { children: j.map((r) => {
|
|
1767
1769
|
const d = n(r), p = R.has(d);
|
|
@@ -1789,7 +1791,7 @@ function hr({
|
|
|
1789
1791
|
},
|
|
1790
1792
|
v.id
|
|
1791
1793
|
)),
|
|
1792
|
-
|
|
1794
|
+
g && /* @__PURE__ */ t(he, { className: "w-44 px-4 text-right", onClick: (v) => v.stopPropagation(), children: g(r) })
|
|
1793
1795
|
]
|
|
1794
1796
|
},
|
|
1795
1797
|
d
|
|
@@ -1815,7 +1817,7 @@ function hr({
|
|
|
1815
1817
|
] }, r)) })
|
|
1816
1818
|
] }),
|
|
1817
1819
|
/* @__PURE__ */ t(
|
|
1818
|
-
|
|
1820
|
+
T,
|
|
1819
1821
|
{
|
|
1820
1822
|
variant: "outline",
|
|
1821
1823
|
size: "md",
|
|
@@ -1825,7 +1827,7 @@ function hr({
|
|
|
1825
1827
|
}
|
|
1826
1828
|
),
|
|
1827
1829
|
/* @__PURE__ */ t(
|
|
1828
|
-
|
|
1830
|
+
T,
|
|
1829
1831
|
{
|
|
1830
1832
|
variant: "outline",
|
|
1831
1833
|
size: "md",
|
|
@@ -1878,21 +1880,21 @@ function vr({
|
|
|
1878
1880
|
options: n,
|
|
1879
1881
|
size: l = "sm",
|
|
1880
1882
|
className: i,
|
|
1881
|
-
...
|
|
1883
|
+
...u
|
|
1882
1884
|
}) {
|
|
1883
|
-
const
|
|
1885
|
+
const m = de();
|
|
1884
1886
|
return /* @__PURE__ */ t(
|
|
1885
1887
|
"div",
|
|
1886
1888
|
{
|
|
1887
1889
|
role: "radiogroup",
|
|
1888
|
-
"aria-label":
|
|
1890
|
+
"aria-label": u["aria-label"],
|
|
1889
1891
|
className: o(
|
|
1890
1892
|
"inline-flex w-fit items-center rounded-lg border border-line bg-canvas",
|
|
1891
1893
|
l === "sm" ? "h-(--control-h-sm)" : "h-(--control-h-md)",
|
|
1892
1894
|
i
|
|
1893
1895
|
),
|
|
1894
|
-
children: n.map((
|
|
1895
|
-
const
|
|
1896
|
+
children: n.map((c) => {
|
|
1897
|
+
const x = c.value === e;
|
|
1896
1898
|
return /* @__PURE__ */ s(
|
|
1897
1899
|
"label",
|
|
1898
1900
|
{
|
|
@@ -1900,25 +1902,25 @@ function vr({
|
|
|
1900
1902
|
"inline-flex h-full cursor-pointer items-center justify-center gap-1.5 rounded-md text-sm font-medium transition-colors",
|
|
1901
1903
|
"has-focus-visible:ring-2 has-focus-visible:ring-focus/40",
|
|
1902
1904
|
l === "sm" ? "px-(--control-pad-x-sm) [&_svg]:size-(--control-icon-sm)" : "px-(--control-pad-x-md) [&_svg]:size-(--control-icon-md)",
|
|
1903
|
-
|
|
1905
|
+
x ? "btn-fill bg-(--button-secondary-bg) text-fg" : "text-muted hover:text-fg"
|
|
1904
1906
|
),
|
|
1905
1907
|
children: [
|
|
1906
1908
|
/* @__PURE__ */ t(
|
|
1907
1909
|
"input",
|
|
1908
1910
|
{
|
|
1909
1911
|
type: "radio",
|
|
1910
|
-
name:
|
|
1911
|
-
value:
|
|
1912
|
-
checked:
|
|
1913
|
-
onChange: () => a(
|
|
1912
|
+
name: m,
|
|
1913
|
+
value: c.value,
|
|
1914
|
+
checked: x,
|
|
1915
|
+
onChange: () => a(c.value),
|
|
1914
1916
|
className: "sr-only"
|
|
1915
1917
|
}
|
|
1916
1918
|
),
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
+
c.icon,
|
|
1920
|
+
c.label
|
|
1919
1921
|
]
|
|
1920
1922
|
},
|
|
1921
|
-
|
|
1923
|
+
c.value
|
|
1922
1924
|
);
|
|
1923
1925
|
})
|
|
1924
1926
|
}
|
|
@@ -1973,7 +1975,7 @@ export {
|
|
|
1973
1975
|
Ke as AvatarFallback,
|
|
1974
1976
|
Ze as AvatarImage,
|
|
1975
1977
|
da as Badge,
|
|
1976
|
-
|
|
1978
|
+
T as Button,
|
|
1977
1979
|
nr as Callout,
|
|
1978
1980
|
va as Card,
|
|
1979
1981
|
wa as CardContent,
|