@jinaan/uikit 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -2
- package/dist/agent-prompt.d.ts +16 -0
- package/dist/agent-prompt.d.ts.map +1 -0
- package/dist/avatar.d.ts +5 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/badge.d.ts +11 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/button.d.ts +22 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/callout.d.ts +12 -0
- package/dist/callout.d.ts.map +1 -0
- package/dist/card.d.ts +8 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/checkbox.d.ts +3 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/choice-dialog.d.ts +34 -0
- package/dist/choice-dialog.d.ts.map +1 -0
- package/dist/code-block.d.ts +11 -0
- package/dist/code-block.d.ts.map +1 -0
- package/dist/data-table.d.ts +84 -0
- package/dist/data-table.d.ts.map +1 -0
- package/dist/dialog.d.ts +19 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dropdown-menu.d.ts +13 -0
- package/dist/dropdown-menu.d.ts.map +1 -0
- package/dist/empty-state.d.ts +11 -0
- package/dist/empty-state.d.ts.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1522 -0
- package/dist/index.js.map +1 -0
- package/dist/input.d.ts +19 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/kbd.d.ts +4 -0
- package/dist/kbd.d.ts.map +1 -0
- package/dist/label.d.ts +3 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/radio-group.d.ts +35 -0
- package/dist/radio-group.d.ts.map +1 -0
- package/dist/segmented.d.ts +22 -0
- package/dist/segmented.d.ts.map +1 -0
- package/dist/select.d.ts +9 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/separator.d.ts +3 -0
- package/dist/separator.d.ts.map +1 -0
- package/dist/skeleton.d.ts +3 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/spinner.d.ts +4 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/table-empty-state.d.ts +15 -0
- package/dist/table-empty-state.d.ts.map +1 -0
- package/dist/table-surface.d.ts +38 -0
- package/dist/table-surface.d.ts.map +1 -0
- package/dist/table.d.ts +15 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/tooltip.d.ts +6 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +73 -4
- package/src/agent-prompt.tsx +60 -0
- package/src/avatar.tsx +46 -0
- package/src/badge.tsx +54 -0
- package/src/button.tsx +126 -0
- package/src/callout.tsx +74 -0
- package/src/card.tsx +61 -0
- package/src/checkbox.tsx +32 -0
- package/src/choice-dialog.tsx +110 -0
- package/src/code-block.tsx +53 -0
- package/src/data-table.tsx +589 -0
- package/src/dialog.tsx +123 -0
- package/src/dropdown-menu.tsx +103 -0
- package/src/empty-state.tsx +35 -0
- package/src/index.ts +26 -0
- package/src/input.tsx +171 -0
- package/src/kbd.tsx +16 -0
- package/src/label.tsx +19 -0
- package/src/radio-group.tsx +134 -0
- package/src/segmented.tsx +76 -0
- package/src/select.tsx +91 -0
- package/src/separator.tsx +22 -0
- package/src/skeleton.tsx +12 -0
- package/src/spinner.tsx +13 -0
- package/src/table-empty-state.tsx +51 -0
- package/src/table-surface.tsx +122 -0
- package/src/table.tsx +91 -0
- package/src/tooltip.tsx +32 -0
- package/src/utils.ts +7 -0
- package/styles.css +371 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1522 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as Fe } from "react/jsx-runtime";
|
|
2
|
+
import { CircleNotch as $e, Robot as We, Terminal as qe, Check as V, Copy as oe, XCircle as Ue, Warning as Xe, CheckCircle as Ke, Info as Oe, Minus as Je, X as de, CaretDown as Q, MagnifyingGlass as Qe, Columns as Ye, WarningCircle as Ze, CaretUp as et, CaretUpDown as tt } from "@phosphor-icons/react";
|
|
3
|
+
import { forwardRef as b, useState as I, useContext as at, useId as X, createContext as rt, useMemo as ne, useEffect as le } from "react";
|
|
4
|
+
import { Slot as nt } from "@radix-ui/react-slot";
|
|
5
|
+
import { cva as Z } from "class-variance-authority";
|
|
6
|
+
import { clsx as lt } from "clsx";
|
|
7
|
+
import { twMerge as it } from "tailwind-merge";
|
|
8
|
+
import * as ee from "@radix-ui/react-avatar";
|
|
9
|
+
import * as ie from "@radix-ui/react-checkbox";
|
|
10
|
+
import * as D from "@radix-ui/react-dialog";
|
|
11
|
+
import * as z from "@radix-ui/react-dropdown-menu";
|
|
12
|
+
import * as y from "@radix-ui/react-select";
|
|
13
|
+
import * as st from "@radix-ui/react-label";
|
|
14
|
+
import * as ot from "@radix-ui/react-separator";
|
|
15
|
+
import * as G from "@radix-ui/react-tooltip";
|
|
16
|
+
function l(...t) {
|
|
17
|
+
return it(lt(t));
|
|
18
|
+
}
|
|
19
|
+
function dt({ className: t }) {
|
|
20
|
+
return /* @__PURE__ */ e(
|
|
21
|
+
$e,
|
|
22
|
+
{
|
|
23
|
+
className: l("size-4 animate-spin text-muted", t),
|
|
24
|
+
weight: "bold",
|
|
25
|
+
"aria-hidden": !0
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
const ct = Z(
|
|
30
|
+
"relative inline-flex select-none items-center justify-center gap-[var(--control-gap)] whitespace-nowrap rounded-[var(--control-radius)] border border-transparent font-medium transition-[color,background-color,border-color,box-shadow,transform] duration-[120ms] active:scale-[0.97] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus/40 focus-visible:ring-offset-1 focus-visible:ring-offset-canvas disabled:pointer-events-none disabled:opacity-50",
|
|
31
|
+
{
|
|
32
|
+
variants: {
|
|
33
|
+
variant: {
|
|
34
|
+
primary: "btn-fill btn-inner-border border-0 [--button-inner:var(--button-primary-inner)] bg-[var(--button-primary-bg)] text-[var(--button-primary-fg)] hover:bg-[var(--button-primary-hover)] active:bg-[var(--button-primary-active)]",
|
|
35
|
+
secondary: "btn-fill btn-inner-border btn-interactive border-0 bg-[var(--button-secondary-bg)] text-fg hover:bg-[var(--button-surface-hover)] active:bg-[var(--button-surface-active)]",
|
|
36
|
+
outline: "btn-interactive border-[var(--button-outline-border)] bg-transparent text-fg hover:border-fg/12 hover:bg-[var(--button-surface-hover)] active:border-fg/12 active:bg-[var(--button-surface-active)] dark:hover:border-[var(--button-outline-border)] dark:active:border-[var(--button-outline-border)]",
|
|
37
|
+
ghost: "btn-inner-border btn-interactive border-0 text-muted hover:bg-[var(--button-surface-hover)] hover:text-fg active:bg-[var(--button-surface-active)]",
|
|
38
|
+
destructive: "btn-fill btn-inner-border border-0 [--button-inner:var(--button-destructive-inner)] bg-[var(--button-destructive-bg)] text-[var(--button-destructive-fg)] hover:bg-[var(--button-destructive-hover)] active:bg-[var(--button-destructive-active)]",
|
|
39
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
xs: "h-[var(--control-h-xs)] [--control-gap:var(--control-gap-xs)] px-[var(--control-pad-x-xs)] text-xs [&_svg]:size-[var(--control-icon-xs)]",
|
|
43
|
+
sm: "h-[var(--control-h-sm)] px-[var(--control-pad-x-sm)] text-sm [&_svg]:size-[var(--control-icon-sm)]",
|
|
44
|
+
md: "h-[var(--control-h-md)] px-[var(--control-pad-x-md)] text-sm [&_svg]:size-[var(--control-icon-md)]",
|
|
45
|
+
lg: "h-[var(--control-h-lg)] px-[var(--control-pad-x-lg)] text-sm [&_svg]:size-[var(--control-icon-lg)]",
|
|
46
|
+
xl: "rounded-[var(--control-radius-xl)] h-[var(--control-h-xl)] px-[var(--control-pad-x-xl)] text-base [&_svg]:size-[var(--control-icon-xl)]",
|
|
47
|
+
icon: "h-[var(--control-h-md)] w-[var(--control-h-md)] p-0 [&_svg]:size-[var(--control-icon-md)]"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
variant: "primary",
|
|
52
|
+
size: "md"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
), mt = {
|
|
56
|
+
xs: "[&_svg]:size-[var(--control-icon-xs)]",
|
|
57
|
+
sm: "[&_svg]:size-[var(--control-icon-sm)]",
|
|
58
|
+
md: "[&_svg]:size-[var(--control-icon-md)]",
|
|
59
|
+
lg: "[&_svg]:size-[var(--control-icon-lg)]",
|
|
60
|
+
xl: "[&_svg]:size-[var(--control-icon-xl)]",
|
|
61
|
+
icon: "[&_svg]:size-[var(--control-icon-md)]"
|
|
62
|
+
}, S = b(
|
|
63
|
+
({
|
|
64
|
+
className: t,
|
|
65
|
+
variant: a,
|
|
66
|
+
size: r = "md",
|
|
67
|
+
asChild: i = !1,
|
|
68
|
+
leadingIcon: o,
|
|
69
|
+
trailingIcon: c,
|
|
70
|
+
iconOnly: d = !1,
|
|
71
|
+
loading: u = !1,
|
|
72
|
+
fullWidth: f = !1,
|
|
73
|
+
disabled: g,
|
|
74
|
+
children: v,
|
|
75
|
+
...k
|
|
76
|
+
}, P) => {
|
|
77
|
+
const N = i ? nt : "button", T = mt[r ?? "md"];
|
|
78
|
+
return /* @__PURE__ */ e(
|
|
79
|
+
N,
|
|
80
|
+
{
|
|
81
|
+
ref: P,
|
|
82
|
+
"aria-busy": u || void 0,
|
|
83
|
+
disabled: i ? void 0 : g || u,
|
|
84
|
+
className: l(
|
|
85
|
+
ct({ variant: a, size: r }),
|
|
86
|
+
d && "aspect-square px-0",
|
|
87
|
+
f && "w-full",
|
|
88
|
+
t
|
|
89
|
+
),
|
|
90
|
+
...k,
|
|
91
|
+
children: i ? v : /* @__PURE__ */ s(Fe, { children: [
|
|
92
|
+
u ? /* @__PURE__ */ e(dt, { className: l("text-current", T), "aria-hidden": !0 }) : o ? /* @__PURE__ */ e("span", { className: l("inline-flex shrink-0", T), "aria-hidden": !0, children: o }) : null,
|
|
93
|
+
v,
|
|
94
|
+
!u && c ? /* @__PURE__ */ e("span", { className: l("inline-flex shrink-0", T), "aria-hidden": !0, children: c }) : null
|
|
95
|
+
] })
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
S.displayName = "Button";
|
|
101
|
+
function oa({
|
|
102
|
+
command: t,
|
|
103
|
+
tag: a = "Build with agents",
|
|
104
|
+
icon: r,
|
|
105
|
+
className: i
|
|
106
|
+
}) {
|
|
107
|
+
const [o, c] = I(!1), d = async () => {
|
|
108
|
+
try {
|
|
109
|
+
await navigator.clipboard.writeText(t), c(!0), window.setTimeout(() => c(!1), 1500);
|
|
110
|
+
} catch {
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
return /* @__PURE__ */ s("div", { className: l("relative inline-flex max-w-full", i), children: [
|
|
114
|
+
/* @__PURE__ */ s("span", { className: "absolute -top-2.5 left-4 z-10 inline-flex items-center gap-1.5 rounded-md bg-fg px-2 py-1 text-[11px] font-medium text-canvas shadow-sm", children: [
|
|
115
|
+
r ?? /* @__PURE__ */ e(We, { className: "size-3.5", weight: "fill" }),
|
|
116
|
+
a
|
|
117
|
+
] }),
|
|
118
|
+
/* @__PURE__ */ s("div", { className: "flex w-full items-center gap-2 rounded-xl border border-line bg-surface py-2 pl-3 pr-2 shadow-sm", children: [
|
|
119
|
+
/* @__PURE__ */ e(qe, { className: "size-4 shrink-0 text-subtle", "aria-hidden": !0 }),
|
|
120
|
+
/* @__PURE__ */ e("span", { className: "truncate font-mono text-sm text-fg", children: t }),
|
|
121
|
+
/* @__PURE__ */ e(
|
|
122
|
+
S,
|
|
123
|
+
{
|
|
124
|
+
variant: "ghost",
|
|
125
|
+
size: "sm",
|
|
126
|
+
iconOnly: !0,
|
|
127
|
+
"aria-label": "Copy prompt",
|
|
128
|
+
className: "ml-auto",
|
|
129
|
+
onClick: d,
|
|
130
|
+
children: o ? /* @__PURE__ */ e(V, { className: "text-success", weight: "bold" }) : /* @__PURE__ */ e(oe, {})
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
] })
|
|
134
|
+
] });
|
|
135
|
+
}
|
|
136
|
+
const ce = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
137
|
+
ee.Root,
|
|
138
|
+
{
|
|
139
|
+
ref: r,
|
|
140
|
+
className: l(
|
|
141
|
+
"relative flex size-8 shrink-0 overflow-hidden rounded-full border border-line",
|
|
142
|
+
t
|
|
143
|
+
),
|
|
144
|
+
...a
|
|
145
|
+
}
|
|
146
|
+
));
|
|
147
|
+
ce.displayName = "Avatar";
|
|
148
|
+
const me = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
149
|
+
ee.Image,
|
|
150
|
+
{
|
|
151
|
+
ref: r,
|
|
152
|
+
className: l("aspect-square size-full object-cover", t),
|
|
153
|
+
...a
|
|
154
|
+
}
|
|
155
|
+
));
|
|
156
|
+
me.displayName = "AvatarImage";
|
|
157
|
+
const ue = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
158
|
+
ee.Fallback,
|
|
159
|
+
{
|
|
160
|
+
ref: r,
|
|
161
|
+
className: l(
|
|
162
|
+
"flex size-full items-center justify-center bg-elevated text-xs font-medium text-muted",
|
|
163
|
+
t
|
|
164
|
+
),
|
|
165
|
+
...a
|
|
166
|
+
}
|
|
167
|
+
));
|
|
168
|
+
ue.displayName = "AvatarFallback";
|
|
169
|
+
const ut = Z(
|
|
170
|
+
"inline-flex items-center gap-1.5 rounded-md border px-2 py-0.5 text-xs font-medium",
|
|
171
|
+
{
|
|
172
|
+
variants: {
|
|
173
|
+
variant: {
|
|
174
|
+
neutral: "border-line bg-elevated text-muted",
|
|
175
|
+
outline: "border-line bg-transparent text-muted",
|
|
176
|
+
success: "border-success/30 bg-success/10 text-success",
|
|
177
|
+
warning: "border-warning/30 bg-warning/10 text-warning",
|
|
178
|
+
error: "border-error/30 bg-error/10 text-error",
|
|
179
|
+
info: "border-info/30 bg-info/10 text-info",
|
|
180
|
+
primary: "border-primary/30 bg-primary/10 text-primary"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
defaultVariants: { variant: "neutral" }
|
|
184
|
+
}
|
|
185
|
+
), bt = Z("size-1.5 shrink-0 rounded-full", {
|
|
186
|
+
variants: {
|
|
187
|
+
variant: {
|
|
188
|
+
neutral: "bg-subtle",
|
|
189
|
+
outline: "bg-subtle",
|
|
190
|
+
success: "bg-success",
|
|
191
|
+
warning: "bg-warning",
|
|
192
|
+
error: "bg-error",
|
|
193
|
+
info: "bg-info",
|
|
194
|
+
primary: "bg-primary"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
defaultVariants: { variant: "neutral" }
|
|
198
|
+
});
|
|
199
|
+
function pt({ className: t, variant: a, dot: r = !1, children: i, ...o }) {
|
|
200
|
+
return /* @__PURE__ */ s("span", { className: l(ut({ variant: a }), t), ...o, children: [
|
|
201
|
+
r ? /* @__PURE__ */ e("span", { className: l(bt({ variant: a })), "aria-hidden": !0 }) : null,
|
|
202
|
+
i
|
|
203
|
+
] });
|
|
204
|
+
}
|
|
205
|
+
const ft = {
|
|
206
|
+
info: {
|
|
207
|
+
Icon: Oe,
|
|
208
|
+
className: "border-info/30 bg-info/10",
|
|
209
|
+
iconClassName: "text-info"
|
|
210
|
+
},
|
|
211
|
+
success: {
|
|
212
|
+
Icon: Ke,
|
|
213
|
+
className: "border-success/30 bg-success/10",
|
|
214
|
+
iconClassName: "text-success"
|
|
215
|
+
},
|
|
216
|
+
warning: {
|
|
217
|
+
Icon: Xe,
|
|
218
|
+
className: "border-warning/30 bg-warning/10",
|
|
219
|
+
iconClassName: "text-warning"
|
|
220
|
+
},
|
|
221
|
+
error: {
|
|
222
|
+
Icon: Ue,
|
|
223
|
+
className: "border-error/30 bg-error/10",
|
|
224
|
+
iconClassName: "text-error"
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
function da({
|
|
228
|
+
variant: t = "info",
|
|
229
|
+
title: a,
|
|
230
|
+
children: r,
|
|
231
|
+
icon: i,
|
|
232
|
+
className: o
|
|
233
|
+
}) {
|
|
234
|
+
const { Icon: c, className: d, iconClassName: u } = ft[t];
|
|
235
|
+
return /* @__PURE__ */ s(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
role: t === "error" ? "alert" : void 0,
|
|
239
|
+
className: l(
|
|
240
|
+
"flex items-start gap-2.5 rounded-lg border px-3.5 py-3 text-sm",
|
|
241
|
+
d,
|
|
242
|
+
o
|
|
243
|
+
),
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ e("span", { className: l("mt-0.5 shrink-0 [&_svg]:size-4", u), children: i ?? /* @__PURE__ */ e(c, { weight: "fill" }) }),
|
|
246
|
+
/* @__PURE__ */ s("div", { className: "min-w-0 space-y-0.5", children: [
|
|
247
|
+
a ? /* @__PURE__ */ e("p", { className: "font-medium text-fg", children: a }) : null,
|
|
248
|
+
r ? /* @__PURE__ */ e("div", { className: "text-muted", children: r }) : null
|
|
249
|
+
] })
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
const ht = b(
|
|
255
|
+
({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
256
|
+
"div",
|
|
257
|
+
{
|
|
258
|
+
ref: r,
|
|
259
|
+
className: l(
|
|
260
|
+
"rounded-card border border-line bg-surface shadow-xs",
|
|
261
|
+
t
|
|
262
|
+
),
|
|
263
|
+
...a
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
);
|
|
267
|
+
ht.displayName = "Card";
|
|
268
|
+
const xt = b(
|
|
269
|
+
({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
270
|
+
"div",
|
|
271
|
+
{
|
|
272
|
+
ref: r,
|
|
273
|
+
className: l("flex flex-col gap-1 border-b border-line px-5 py-4", t),
|
|
274
|
+
...a
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
);
|
|
278
|
+
xt.displayName = "CardHeader";
|
|
279
|
+
const vt = b(
|
|
280
|
+
({ className: t, ...a }, r) => /* @__PURE__ */ e("h2", { ref: r, className: l("text-sm font-semibold text-fg", t), ...a })
|
|
281
|
+
);
|
|
282
|
+
vt.displayName = "CardTitle";
|
|
283
|
+
const gt = b(({ className: t, ...a }, r) => /* @__PURE__ */ e("p", { ref: r, className: l("text-sm text-muted", t), ...a }));
|
|
284
|
+
gt.displayName = "CardDescription";
|
|
285
|
+
const Nt = b(
|
|
286
|
+
({ className: t, ...a }, r) => /* @__PURE__ */ e("div", { ref: r, className: l("px-5 py-4", t), ...a })
|
|
287
|
+
);
|
|
288
|
+
Nt.displayName = "CardContent";
|
|
289
|
+
const yt = b(
|
|
290
|
+
({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
291
|
+
"div",
|
|
292
|
+
{
|
|
293
|
+
ref: r,
|
|
294
|
+
className: l("flex items-center gap-3 border-t border-line px-5 py-3", t),
|
|
295
|
+
...a
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
);
|
|
299
|
+
yt.displayName = "CardFooter";
|
|
300
|
+
const Y = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
301
|
+
ie.Root,
|
|
302
|
+
{
|
|
303
|
+
ref: r,
|
|
304
|
+
className: l(
|
|
305
|
+
"peer size-4 shrink-0 rounded border border-line-strong bg-surface transition-colors",
|
|
306
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus/40",
|
|
307
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
308
|
+
"data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-fg",
|
|
309
|
+
"data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-fg",
|
|
310
|
+
t
|
|
311
|
+
),
|
|
312
|
+
...a,
|
|
313
|
+
children: /* @__PURE__ */ e(ie.Indicator, { className: "flex items-center justify-center text-current", children: a.checked === "indeterminate" ? /* @__PURE__ */ e(Je, { className: "size-3", weight: "bold" }) : /* @__PURE__ */ e(V, { className: "size-3", weight: "bold" }) })
|
|
314
|
+
}
|
|
315
|
+
));
|
|
316
|
+
Y.displayName = "Checkbox";
|
|
317
|
+
const wt = D.Root, Ct = D.Trigger, ca = D.Close, be = b(({ className: t, children: a, ...r }, i) => /* @__PURE__ */ s(D.Portal, { children: [
|
|
318
|
+
/* @__PURE__ */ e(D.Overlay, { className: "fixed inset-0 z-50 bg-overlay backdrop-blur-[1px] data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0" }),
|
|
319
|
+
/* @__PURE__ */ s(
|
|
320
|
+
D.Content,
|
|
321
|
+
{
|
|
322
|
+
ref: i,
|
|
323
|
+
className: l(
|
|
324
|
+
"fixed left-1/2 top-1/2 z-50 flex max-h-[min(85vh,44rem)] w-full max-w-[22.4rem] -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden",
|
|
325
|
+
"rounded-2xl border border-[var(--dialog-shell-border)] bg-[var(--dialog-shell-bg)] pb-3 shadow-[var(--dialog-shell-shadow)] sm:pb-4",
|
|
326
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
327
|
+
"data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
328
|
+
"data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
329
|
+
"data-[state=open]:slide-in-from-top-2 duration-200 ease-out",
|
|
330
|
+
"focus:outline-none",
|
|
331
|
+
t
|
|
332
|
+
),
|
|
333
|
+
...r,
|
|
334
|
+
children: [
|
|
335
|
+
a,
|
|
336
|
+
/* @__PURE__ */ s(D.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: [
|
|
337
|
+
/* @__PURE__ */ e(de, { className: "size-4" }),
|
|
338
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
339
|
+
] })
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
] }));
|
|
344
|
+
be.displayName = "DialogContent";
|
|
345
|
+
function zt({ className: t, ...a }) {
|
|
346
|
+
return /* @__PURE__ */ e(
|
|
347
|
+
"div",
|
|
348
|
+
{
|
|
349
|
+
"data-slot": "panel",
|
|
350
|
+
className: l(
|
|
351
|
+
"flex min-h-0 flex-1 flex-col overflow-hidden rounded-b-2xl border-x-0 border-t-0 border-b border-[var(--dialog-panel-border)] bg-[var(--dialog-panel-bg)] shadow-[var(--dialog-panel-shadow)]",
|
|
352
|
+
t
|
|
353
|
+
),
|
|
354
|
+
...a
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
function kt({ className: t, ...a }) {
|
|
359
|
+
return /* @__PURE__ */ e(
|
|
360
|
+
"div",
|
|
361
|
+
{
|
|
362
|
+
"data-slot": "body",
|
|
363
|
+
className: l("min-h-0 flex-1 overflow-y-auto px-5 py-4", t),
|
|
364
|
+
...a
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
function St({ className: t, ...a }) {
|
|
369
|
+
return /* @__PURE__ */ e(
|
|
370
|
+
"div",
|
|
371
|
+
{
|
|
372
|
+
"data-slot": "header",
|
|
373
|
+
className: l(
|
|
374
|
+
"flex shrink-0 flex-col gap-1.5 border-b border-[var(--dialog-panel-border)] px-5 py-4",
|
|
375
|
+
t
|
|
376
|
+
),
|
|
377
|
+
...a
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
function Dt({ className: t, ...a }) {
|
|
382
|
+
return /* @__PURE__ */ e(
|
|
383
|
+
"div",
|
|
384
|
+
{
|
|
385
|
+
"data-slot": "footer",
|
|
386
|
+
className: l(
|
|
387
|
+
"flex shrink-0 flex-col-reverse gap-2 px-3 pt-3 sm:flex-row sm:justify-end sm:px-4 sm:pt-3.5",
|
|
388
|
+
t
|
|
389
|
+
),
|
|
390
|
+
...a
|
|
391
|
+
}
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
const pe = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
395
|
+
D.Title,
|
|
396
|
+
{
|
|
397
|
+
ref: r,
|
|
398
|
+
className: l("text-base font-semibold text-fg", t),
|
|
399
|
+
...a
|
|
400
|
+
}
|
|
401
|
+
));
|
|
402
|
+
pe.displayName = "DialogTitle";
|
|
403
|
+
const Tt = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
404
|
+
D.Description,
|
|
405
|
+
{
|
|
406
|
+
ref: r,
|
|
407
|
+
className: l("text-sm text-muted", t),
|
|
408
|
+
...a
|
|
409
|
+
}
|
|
410
|
+
));
|
|
411
|
+
Tt.displayName = "DialogDescription";
|
|
412
|
+
const fe = rt(null);
|
|
413
|
+
function It({
|
|
414
|
+
label: t,
|
|
415
|
+
value: a,
|
|
416
|
+
onChange: r,
|
|
417
|
+
disabled: i = !1,
|
|
418
|
+
name: o,
|
|
419
|
+
className: c,
|
|
420
|
+
children: d,
|
|
421
|
+
...u
|
|
422
|
+
}) {
|
|
423
|
+
const f = X(), g = o ?? f;
|
|
424
|
+
return /* @__PURE__ */ e(fe.Provider, { value: { name: g, value: a, onChange: r, disabled: i }, children: /* @__PURE__ */ s("fieldset", { className: l("flex flex-col gap-6", c), ...u, children: [
|
|
425
|
+
/* @__PURE__ */ e("legend", { className: "sr-only", children: t }),
|
|
426
|
+
d
|
|
427
|
+
] }) });
|
|
428
|
+
}
|
|
429
|
+
function Pt({
|
|
430
|
+
value: t,
|
|
431
|
+
title: a,
|
|
432
|
+
description: r,
|
|
433
|
+
badge: i,
|
|
434
|
+
disabled: o = !1,
|
|
435
|
+
className: c
|
|
436
|
+
}) {
|
|
437
|
+
const d = at(fe), u = X();
|
|
438
|
+
if (!d)
|
|
439
|
+
throw new Error("RadioCard must be rendered inside a RadioGroup");
|
|
440
|
+
const f = o || d.disabled, g = d.value === t;
|
|
441
|
+
return /* @__PURE__ */ s(
|
|
442
|
+
"label",
|
|
443
|
+
{
|
|
444
|
+
className: l(
|
|
445
|
+
"group relative flex items-start gap-3",
|
|
446
|
+
f ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
447
|
+
c
|
|
448
|
+
),
|
|
449
|
+
children: [
|
|
450
|
+
/* @__PURE__ */ e(
|
|
451
|
+
"input",
|
|
452
|
+
{
|
|
453
|
+
type: "radio",
|
|
454
|
+
name: d.name,
|
|
455
|
+
value: t,
|
|
456
|
+
checked: g,
|
|
457
|
+
disabled: f,
|
|
458
|
+
onChange: () => {
|
|
459
|
+
var v;
|
|
460
|
+
return (v = d.onChange) == null ? void 0 : v.call(d, t);
|
|
461
|
+
},
|
|
462
|
+
"aria-describedby": r ? u : void 0,
|
|
463
|
+
className: "peer sr-only"
|
|
464
|
+
}
|
|
465
|
+
),
|
|
466
|
+
/* @__PURE__ */ e(
|
|
467
|
+
"span",
|
|
468
|
+
{
|
|
469
|
+
"aria-hidden": !0,
|
|
470
|
+
className: l(
|
|
471
|
+
"mt-0.5 grid size-4.5 shrink-0 place-items-center rounded-full border-2 border-transparent bg-line-strong transition-colors",
|
|
472
|
+
"peer-checked:border-[5px] peer-checked:border-primary peer-checked:bg-primary-fg",
|
|
473
|
+
"peer-focus-visible:ring-2 peer-focus-visible:ring-focus/40 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-canvas"
|
|
474
|
+
)
|
|
475
|
+
}
|
|
476
|
+
),
|
|
477
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
478
|
+
/* @__PURE__ */ s("span", { className: "flex flex-wrap items-center gap-2", children: [
|
|
479
|
+
/* @__PURE__ */ e("span", { className: "text-base font-semibold text-fg", children: a }),
|
|
480
|
+
i ? /* @__PURE__ */ e(pt, { variant: "primary", children: i }) : null
|
|
481
|
+
] }),
|
|
482
|
+
r ? /* @__PURE__ */ e("span", { id: u, className: "mt-1 block text-sm text-muted", children: r }) : null
|
|
483
|
+
] })
|
|
484
|
+
]
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
function ma({
|
|
489
|
+
open: t,
|
|
490
|
+
onOpenChange: a,
|
|
491
|
+
trigger: r,
|
|
492
|
+
title: i,
|
|
493
|
+
options: o,
|
|
494
|
+
defaultValue: c,
|
|
495
|
+
value: d,
|
|
496
|
+
onValueChange: u,
|
|
497
|
+
cancelLabel: f = "Cancel",
|
|
498
|
+
confirmLabel: g = "Continue",
|
|
499
|
+
onConfirm: v
|
|
500
|
+
}) {
|
|
501
|
+
var w;
|
|
502
|
+
const [k, P] = I(c ?? ((w = o[0]) == null ? void 0 : w.value) ?? ""), N = d ?? k;
|
|
503
|
+
return /* @__PURE__ */ s(wt, { open: t, onOpenChange: a, children: [
|
|
504
|
+
r ? /* @__PURE__ */ e(Ct, { asChild: !0, children: r }) : null,
|
|
505
|
+
/* @__PURE__ */ s(
|
|
506
|
+
be,
|
|
507
|
+
{
|
|
508
|
+
"aria-describedby": void 0,
|
|
509
|
+
className: "max-w-[29.4rem] [&>button]:hidden",
|
|
510
|
+
children: [
|
|
511
|
+
/* @__PURE__ */ s(zt, { children: [
|
|
512
|
+
/* @__PURE__ */ e(St, { children: /* @__PURE__ */ e(pe, { className: "text-xl", children: i }) }),
|
|
513
|
+
/* @__PURE__ */ e(kt, { children: /* @__PURE__ */ e(It, { label: i, value: N, onChange: (x) => {
|
|
514
|
+
d === void 0 && P(x), u == null || u(x);
|
|
515
|
+
}, children: o.map((x) => /* @__PURE__ */ e(
|
|
516
|
+
Pt,
|
|
517
|
+
{
|
|
518
|
+
value: x.value,
|
|
519
|
+
title: x.title,
|
|
520
|
+
description: x.description,
|
|
521
|
+
badge: x.badge
|
|
522
|
+
},
|
|
523
|
+
x.value
|
|
524
|
+
)) }) })
|
|
525
|
+
] }),
|
|
526
|
+
/* @__PURE__ */ s(Dt, { className: "gap-3 pt-2.5", children: [
|
|
527
|
+
/* @__PURE__ */ e(
|
|
528
|
+
S,
|
|
529
|
+
{
|
|
530
|
+
variant: "secondary",
|
|
531
|
+
className: "flex-1",
|
|
532
|
+
onClick: () => a == null ? void 0 : a(!1),
|
|
533
|
+
children: f
|
|
534
|
+
}
|
|
535
|
+
),
|
|
536
|
+
/* @__PURE__ */ e(S, { className: "flex-1", onClick: () => v == null ? void 0 : v(N), children: g })
|
|
537
|
+
] })
|
|
538
|
+
]
|
|
539
|
+
}
|
|
540
|
+
)
|
|
541
|
+
] });
|
|
542
|
+
}
|
|
543
|
+
function ua({ code: t, label: a, className: r }) {
|
|
544
|
+
const [i, o] = I(!1), c = async () => {
|
|
545
|
+
try {
|
|
546
|
+
await navigator.clipboard.writeText(t), o(!0), window.setTimeout(() => o(!1), 1500);
|
|
547
|
+
} catch {
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
return /* @__PURE__ */ s(
|
|
551
|
+
"div",
|
|
552
|
+
{
|
|
553
|
+
className: l(
|
|
554
|
+
"overflow-hidden rounded-lg border border-line bg-canvas",
|
|
555
|
+
r
|
|
556
|
+
),
|
|
557
|
+
children: [
|
|
558
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2 border-b border-line px-3 py-2", children: [
|
|
559
|
+
/* @__PURE__ */ e("span", { className: "truncate text-xs font-medium text-subtle", children: a }),
|
|
560
|
+
/* @__PURE__ */ e(
|
|
561
|
+
S,
|
|
562
|
+
{
|
|
563
|
+
variant: "ghost",
|
|
564
|
+
size: "sm",
|
|
565
|
+
leadingIcon: i ? /* @__PURE__ */ e(V, { className: "text-success", weight: "bold" }) : /* @__PURE__ */ e(oe, {}),
|
|
566
|
+
onClick: c,
|
|
567
|
+
children: i ? "Copied" : "Copy"
|
|
568
|
+
}
|
|
569
|
+
)
|
|
570
|
+
] }),
|
|
571
|
+
/* @__PURE__ */ e("pre", { className: "overflow-x-auto p-4 font-mono text-xs leading-relaxed text-fg", children: /* @__PURE__ */ e("code", { children: t }) })
|
|
572
|
+
]
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
const _t = {
|
|
577
|
+
sm: "h-[var(--control-h-sm)] text-sm",
|
|
578
|
+
md: "h-[var(--control-h-md)] text-sm",
|
|
579
|
+
lg: "h-[var(--control-h-lg)] text-sm",
|
|
580
|
+
xl: "h-[var(--control-h-xl)] rounded-[var(--control-radius-xl)] text-base"
|
|
581
|
+
}, jt = {
|
|
582
|
+
sm: "px-[var(--control-pad-x-sm)]",
|
|
583
|
+
md: "px-[var(--control-pad-x-md)]",
|
|
584
|
+
lg: "px-[var(--control-pad-x-lg)]",
|
|
585
|
+
xl: "px-[var(--control-pad-x-xl)]"
|
|
586
|
+
}, Mt = {
|
|
587
|
+
sm: "left-[var(--control-pad-x-sm)]",
|
|
588
|
+
md: "left-[var(--control-pad-x-md)]",
|
|
589
|
+
lg: "left-[var(--control-pad-x-lg)]",
|
|
590
|
+
xl: "left-[var(--control-pad-x-xl)]"
|
|
591
|
+
}, Et = {
|
|
592
|
+
sm: "right-[var(--control-pad-x-sm)]",
|
|
593
|
+
md: "right-[var(--control-pad-x-md)]",
|
|
594
|
+
lg: "right-[var(--control-pad-x-lg)]",
|
|
595
|
+
xl: "right-[var(--control-pad-x-xl)]"
|
|
596
|
+
}, se = {
|
|
597
|
+
sm: "size-[var(--control-icon-sm)]",
|
|
598
|
+
md: "size-[var(--control-icon-md)]",
|
|
599
|
+
lg: "size-[var(--control-icon-lg)]",
|
|
600
|
+
xl: "size-[var(--control-icon-xl)]"
|
|
601
|
+
}, he = b(
|
|
602
|
+
({
|
|
603
|
+
className: t,
|
|
604
|
+
containerClassName: a,
|
|
605
|
+
type: r = "text",
|
|
606
|
+
size: i = "md",
|
|
607
|
+
leadingIcon: o,
|
|
608
|
+
trailingIcon: c,
|
|
609
|
+
error: d = !1,
|
|
610
|
+
helperText: u,
|
|
611
|
+
id: f,
|
|
612
|
+
"aria-describedby": g,
|
|
613
|
+
disabled: v,
|
|
614
|
+
readOnly: k,
|
|
615
|
+
...P
|
|
616
|
+
}, N) => {
|
|
617
|
+
const T = X(), w = f ?? T, x = !!u, F = x ? `${w}-description` : void 0, K = [g, F].filter(Boolean).join(" ") || void 0, $ = /* @__PURE__ */ e(
|
|
618
|
+
"input",
|
|
619
|
+
{
|
|
620
|
+
ref: N,
|
|
621
|
+
id: w,
|
|
622
|
+
type: r,
|
|
623
|
+
disabled: v,
|
|
624
|
+
readOnly: k,
|
|
625
|
+
"aria-invalid": d || void 0,
|
|
626
|
+
"aria-describedby": K,
|
|
627
|
+
style: o || c ? {
|
|
628
|
+
paddingInlineStart: o ? `calc(var(--control-pad-x-${i}) + var(--control-icon-${i}) + var(--control-gap))` : void 0,
|
|
629
|
+
paddingInlineEnd: c ? `calc(var(--control-pad-x-${i}) + var(--control-icon-${i}) + var(--control-gap))` : void 0
|
|
630
|
+
} : void 0,
|
|
631
|
+
className: l(
|
|
632
|
+
"flex w-full rounded-[var(--control-radius)] border bg-[var(--input-bg)] text-[var(--input-fg)] transition-colors",
|
|
633
|
+
_t[i],
|
|
634
|
+
jt[i],
|
|
635
|
+
"placeholder:text-[var(--input-placeholder)]",
|
|
636
|
+
"hover:border-[var(--input-border-hover)]",
|
|
637
|
+
"focus-visible:outline-none focus-visible:border-[var(--input-border-focus)] focus-visible:ring-2 focus-visible:ring-focus/30",
|
|
638
|
+
d && "border-error hover:border-error focus-visible:border-error focus-visible:ring-error/30",
|
|
639
|
+
!d && "border-[var(--input-border)]",
|
|
640
|
+
v && "cursor-not-allowed bg-[var(--input-bg-disabled)] opacity-60 hover:border-[var(--input-border)]",
|
|
641
|
+
k && "cursor-default focus-visible:ring-0",
|
|
642
|
+
t
|
|
643
|
+
),
|
|
644
|
+
...P
|
|
645
|
+
}
|
|
646
|
+
);
|
|
647
|
+
return !o && !c && !x ? $ : /* @__PURE__ */ s("div", { className: l("w-full", a), children: [
|
|
648
|
+
/* @__PURE__ */ s("div", { className: "relative", children: [
|
|
649
|
+
o ? /* @__PURE__ */ e(
|
|
650
|
+
"span",
|
|
651
|
+
{
|
|
652
|
+
className: l(
|
|
653
|
+
"pointer-events-none absolute inset-y-0 flex items-center text-[var(--input-placeholder)]",
|
|
654
|
+
Mt[i]
|
|
655
|
+
),
|
|
656
|
+
"aria-hidden": !0,
|
|
657
|
+
children: /* @__PURE__ */ e("span", { className: l("inline-flex items-center justify-center", se[i]), children: o })
|
|
658
|
+
}
|
|
659
|
+
) : null,
|
|
660
|
+
$,
|
|
661
|
+
c ? /* @__PURE__ */ e(
|
|
662
|
+
"span",
|
|
663
|
+
{
|
|
664
|
+
className: l(
|
|
665
|
+
"absolute inset-y-0 flex items-center text-[var(--input-placeholder)]",
|
|
666
|
+
Et[i]
|
|
667
|
+
),
|
|
668
|
+
"aria-hidden": !0,
|
|
669
|
+
children: /* @__PURE__ */ e("span", { className: l("inline-flex items-center justify-center", se[i]), children: c })
|
|
670
|
+
}
|
|
671
|
+
) : null
|
|
672
|
+
] }),
|
|
673
|
+
x ? /* @__PURE__ */ e(
|
|
674
|
+
"p",
|
|
675
|
+
{
|
|
676
|
+
id: F,
|
|
677
|
+
className: l("mt-1.5 text-xs", d ? "text-error" : "text-muted"),
|
|
678
|
+
children: u
|
|
679
|
+
}
|
|
680
|
+
) : null
|
|
681
|
+
] });
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
he.displayName = "Input";
|
|
685
|
+
const Lt = z.Root, Rt = z.Trigger, ba = z.Group, pa = z.Portal, xe = b(({ className: t, sideOffset: a = 6, ...r }, i) => /* @__PURE__ */ e(z.Portal, { children: /* @__PURE__ */ e(
|
|
686
|
+
z.Content,
|
|
687
|
+
{
|
|
688
|
+
ref: i,
|
|
689
|
+
sideOffset: a,
|
|
690
|
+
className: l(
|
|
691
|
+
"z-50 min-w-48 overflow-hidden rounded-lg border border-line bg-surface p-1 shadow-md",
|
|
692
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
693
|
+
"data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
694
|
+
"data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
695
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
696
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
697
|
+
"duration-150 ease-out",
|
|
698
|
+
t
|
|
699
|
+
),
|
|
700
|
+
...r
|
|
701
|
+
}
|
|
702
|
+
) }));
|
|
703
|
+
xe.displayName = "DropdownMenuContent";
|
|
704
|
+
const At = b(({ className: t, inset: a, ...r }, i) => /* @__PURE__ */ e(
|
|
705
|
+
z.Item,
|
|
706
|
+
{
|
|
707
|
+
ref: i,
|
|
708
|
+
className: l(
|
|
709
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-fg outline-none transition-colors",
|
|
710
|
+
"focus:bg-elevated data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
711
|
+
"[&_svg]:size-4 [&_svg]:text-muted",
|
|
712
|
+
a && "pl-8",
|
|
713
|
+
t
|
|
714
|
+
),
|
|
715
|
+
...r
|
|
716
|
+
}
|
|
717
|
+
));
|
|
718
|
+
At.displayName = "DropdownMenuItem";
|
|
719
|
+
const ve = b(({ className: t, children: a, checked: r, ...i }, o) => /* @__PURE__ */ s(
|
|
720
|
+
z.CheckboxItem,
|
|
721
|
+
{
|
|
722
|
+
ref: o,
|
|
723
|
+
className: l(
|
|
724
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm text-fg outline-none transition-colors focus:bg-elevated",
|
|
725
|
+
t
|
|
726
|
+
),
|
|
727
|
+
checked: r,
|
|
728
|
+
...i,
|
|
729
|
+
children: [
|
|
730
|
+
/* @__PURE__ */ e("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ e(z.ItemIndicator, { children: /* @__PURE__ */ e(V, { className: "size-3.5" }) }) }),
|
|
731
|
+
a
|
|
732
|
+
]
|
|
733
|
+
}
|
|
734
|
+
));
|
|
735
|
+
ve.displayName = "DropdownMenuCheckboxItem";
|
|
736
|
+
const ge = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
737
|
+
z.Label,
|
|
738
|
+
{
|
|
739
|
+
ref: r,
|
|
740
|
+
className: l("px-2 py-1.5 text-xs font-medium text-subtle", t),
|
|
741
|
+
...a
|
|
742
|
+
}
|
|
743
|
+
));
|
|
744
|
+
ge.displayName = "DropdownMenuLabel";
|
|
745
|
+
const Ne = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
746
|
+
z.Separator,
|
|
747
|
+
{
|
|
748
|
+
ref: r,
|
|
749
|
+
className: l("-mx-1 my-1 h-px bg-line", t),
|
|
750
|
+
...a
|
|
751
|
+
}
|
|
752
|
+
));
|
|
753
|
+
Ne.displayName = "DropdownMenuSeparator";
|
|
754
|
+
const Bt = y.Root, fa = y.Group, Ht = y.Value, ye = b(({ className: t, children: a, ...r }, i) => /* @__PURE__ */ s(
|
|
755
|
+
y.Trigger,
|
|
756
|
+
{
|
|
757
|
+
ref: i,
|
|
758
|
+
className: l(
|
|
759
|
+
"flex h-9 w-full items-center justify-between gap-2 rounded-md border border-line bg-surface px-3 text-sm text-fg",
|
|
760
|
+
"focus:outline-none focus:border-primary focus:ring-2 focus:ring-focus/30 disabled:cursor-not-allowed disabled:opacity-50",
|
|
761
|
+
"[&>span]:truncate",
|
|
762
|
+
t
|
|
763
|
+
),
|
|
764
|
+
...r,
|
|
765
|
+
children: [
|
|
766
|
+
a,
|
|
767
|
+
/* @__PURE__ */ e(y.Icon, { asChild: !0, children: /* @__PURE__ */ e(Q, { className: "size-3.5 text-subtle" }) })
|
|
768
|
+
]
|
|
769
|
+
}
|
|
770
|
+
));
|
|
771
|
+
ye.displayName = "SelectTrigger";
|
|
772
|
+
const we = b(({ className: t, children: a, position: r = "popper", ...i }, o) => /* @__PURE__ */ e(y.Portal, { children: /* @__PURE__ */ e(
|
|
773
|
+
y.Content,
|
|
774
|
+
{
|
|
775
|
+
ref: o,
|
|
776
|
+
position: r,
|
|
777
|
+
className: l(
|
|
778
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-lg border border-line bg-surface p-1 shadow-md",
|
|
779
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
780
|
+
"data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
781
|
+
"data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
782
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
783
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
784
|
+
"duration-150 ease-out",
|
|
785
|
+
t
|
|
786
|
+
),
|
|
787
|
+
...i,
|
|
788
|
+
children: /* @__PURE__ */ e(y.Viewport, { className: "p-0", children: a })
|
|
789
|
+
}
|
|
790
|
+
) }));
|
|
791
|
+
we.displayName = "SelectContent";
|
|
792
|
+
const Ce = b(({ className: t, children: a, ...r }, i) => /* @__PURE__ */ s(
|
|
793
|
+
y.Item,
|
|
794
|
+
{
|
|
795
|
+
ref: i,
|
|
796
|
+
className: l(
|
|
797
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm text-fg outline-none focus:bg-elevated data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
798
|
+
t
|
|
799
|
+
),
|
|
800
|
+
...r,
|
|
801
|
+
children: [
|
|
802
|
+
/* @__PURE__ */ e("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ e(y.ItemIndicator, { children: /* @__PURE__ */ e(V, { className: "size-3.5" }) }) }),
|
|
803
|
+
/* @__PURE__ */ e(y.ItemText, { children: a })
|
|
804
|
+
]
|
|
805
|
+
}
|
|
806
|
+
));
|
|
807
|
+
Ce.displayName = "SelectItem";
|
|
808
|
+
const Gt = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
809
|
+
y.Label,
|
|
810
|
+
{
|
|
811
|
+
ref: r,
|
|
812
|
+
className: l("px-2 py-1.5 text-xs font-medium text-subtle", t),
|
|
813
|
+
...a
|
|
814
|
+
}
|
|
815
|
+
));
|
|
816
|
+
Gt.displayName = "SelectLabel";
|
|
817
|
+
function Vt({
|
|
818
|
+
className: t,
|
|
819
|
+
...a
|
|
820
|
+
}) {
|
|
821
|
+
return /* @__PURE__ */ e(
|
|
822
|
+
"div",
|
|
823
|
+
{
|
|
824
|
+
className: l(
|
|
825
|
+
"w-full overflow-hidden rounded-(--table-radius-outer) bg-table-container p-(--table-inset)",
|
|
826
|
+
t
|
|
827
|
+
),
|
|
828
|
+
...a
|
|
829
|
+
}
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
function Ft({
|
|
833
|
+
className: t,
|
|
834
|
+
...a
|
|
835
|
+
}) {
|
|
836
|
+
return /* @__PURE__ */ e(
|
|
837
|
+
"div",
|
|
838
|
+
{
|
|
839
|
+
className: l(
|
|
840
|
+
"overflow-hidden rounded-(--table-radius-panel) border border-table-panel-border bg-table-panel",
|
|
841
|
+
t
|
|
842
|
+
),
|
|
843
|
+
...a
|
|
844
|
+
}
|
|
845
|
+
);
|
|
846
|
+
}
|
|
847
|
+
function ha({ className: t, ...a }) {
|
|
848
|
+
return /* @__PURE__ */ e(
|
|
849
|
+
"table",
|
|
850
|
+
{
|
|
851
|
+
className: l("w-full table-fixed border-collapse caption-bottom text-sm", t),
|
|
852
|
+
...a
|
|
853
|
+
}
|
|
854
|
+
);
|
|
855
|
+
}
|
|
856
|
+
function xa({ className: t, ...a }) {
|
|
857
|
+
return /* @__PURE__ */ e("thead", { className: t, ...a });
|
|
858
|
+
}
|
|
859
|
+
function $t({ className: t, ...a }) {
|
|
860
|
+
return /* @__PURE__ */ e("tbody", { className: l("[&_tr:last-child]:border-0", t), ...a });
|
|
861
|
+
}
|
|
862
|
+
function Wt({ className: t, ...a }) {
|
|
863
|
+
return /* @__PURE__ */ e(
|
|
864
|
+
"tr",
|
|
865
|
+
{
|
|
866
|
+
className: l(
|
|
867
|
+
"border-b border-table-panel-border transition-colors last:border-0 hover:bg-table-row-hover data-[state=selected]:bg-table-row-selected",
|
|
868
|
+
t
|
|
869
|
+
),
|
|
870
|
+
...a
|
|
871
|
+
}
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
function va({ className: t, ...a }) {
|
|
875
|
+
return /* @__PURE__ */ e(
|
|
876
|
+
"th",
|
|
877
|
+
{
|
|
878
|
+
className: l(
|
|
879
|
+
"h-(--table-header-h) whitespace-nowrap px-(--table-pad-x) text-left align-middle text-[0.8125rem] font-medium text-table-header",
|
|
880
|
+
t
|
|
881
|
+
),
|
|
882
|
+
...a
|
|
883
|
+
}
|
|
884
|
+
);
|
|
885
|
+
}
|
|
886
|
+
function J({ className: t, ...a }) {
|
|
887
|
+
return /* @__PURE__ */ e(
|
|
888
|
+
"td",
|
|
889
|
+
{
|
|
890
|
+
className: l(
|
|
891
|
+
"px-(--table-pad-x) py-3 align-middle text-sm text-table-row data-numeric:font-numeric data-numeric:tabular-nums",
|
|
892
|
+
t
|
|
893
|
+
),
|
|
894
|
+
...a
|
|
895
|
+
}
|
|
896
|
+
);
|
|
897
|
+
}
|
|
898
|
+
function qt({
|
|
899
|
+
icon: t,
|
|
900
|
+
title: a,
|
|
901
|
+
description: r,
|
|
902
|
+
action: i,
|
|
903
|
+
className: o
|
|
904
|
+
}) {
|
|
905
|
+
return /* @__PURE__ */ s(
|
|
906
|
+
"div",
|
|
907
|
+
{
|
|
908
|
+
className: l(
|
|
909
|
+
"flex min-h-[22rem] flex-col items-center justify-center gap-5 px-6 py-16 text-center",
|
|
910
|
+
o
|
|
911
|
+
),
|
|
912
|
+
children: [
|
|
913
|
+
t ? /* @__PURE__ */ e("div", { className: "flex size-[var(--table-empty-icon)] items-center justify-center rounded-2xl border border-table-empty-icon-border bg-table-empty-icon text-table-muted [&_svg]:size-8", children: t }) : null,
|
|
914
|
+
/* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
915
|
+
/* @__PURE__ */ e("p", { className: "text-[1.75rem] font-semibold leading-tight text-table-header-active", children: a }),
|
|
916
|
+
r ? /* @__PURE__ */ e("p", { className: "mx-auto max-w-md text-base leading-relaxed text-table-muted", children: r }) : null
|
|
917
|
+
] }),
|
|
918
|
+
i ? /* @__PURE__ */ e("div", { className: "text-sm font-medium text-table-accent", children: i }) : null
|
|
919
|
+
]
|
|
920
|
+
}
|
|
921
|
+
);
|
|
922
|
+
}
|
|
923
|
+
const Ut = {
|
|
924
|
+
default: "bg-table-container",
|
|
925
|
+
muted: "bg-surface border border-line",
|
|
926
|
+
transparent: "bg-transparent"
|
|
927
|
+
}, Xt = {
|
|
928
|
+
default: "bg-table-panel border-table-panel-border",
|
|
929
|
+
muted: "bg-elevated border-line",
|
|
930
|
+
transparent: "bg-transparent border-line"
|
|
931
|
+
};
|
|
932
|
+
function Kt(t) {
|
|
933
|
+
return typeof t == "object" && t !== null && "label" in t && typeof t.label == "string";
|
|
934
|
+
}
|
|
935
|
+
function Ot({
|
|
936
|
+
header: t,
|
|
937
|
+
children: a,
|
|
938
|
+
action: r,
|
|
939
|
+
tone: i = "default",
|
|
940
|
+
className: o,
|
|
941
|
+
headerClassName: c,
|
|
942
|
+
panelClassName: d,
|
|
943
|
+
minHeight: u
|
|
944
|
+
}) {
|
|
945
|
+
const f = Kt(r) ? /* @__PURE__ */ e(
|
|
946
|
+
S,
|
|
947
|
+
{
|
|
948
|
+
variant: r.variant ?? "primary",
|
|
949
|
+
size: "xs",
|
|
950
|
+
leadingIcon: r.href ? void 0 : r.icon,
|
|
951
|
+
onClick: r.onClick,
|
|
952
|
+
disabled: r.disabled,
|
|
953
|
+
asChild: !!r.href,
|
|
954
|
+
children: r.href ? /* @__PURE__ */ s("a", { href: r.href, children: [
|
|
955
|
+
r.icon,
|
|
956
|
+
r.label
|
|
957
|
+
] }) : r.label
|
|
958
|
+
}
|
|
959
|
+
) : r;
|
|
960
|
+
return /* @__PURE__ */ s(Vt, { className: l("relative", Ut[i], o), children: [
|
|
961
|
+
/* @__PURE__ */ s("div", { className: "overflow-x-auto", children: [
|
|
962
|
+
t ? (
|
|
963
|
+
// Header rows must not inherit the body row hover surface.
|
|
964
|
+
/* @__PURE__ */ e("div", { className: l("[--table-row-hover:transparent]", c), children: t })
|
|
965
|
+
) : null,
|
|
966
|
+
/* @__PURE__ */ e(
|
|
967
|
+
Ft,
|
|
968
|
+
{
|
|
969
|
+
className: l(Xt[i], d),
|
|
970
|
+
style: u ? { minHeight: u } : void 0,
|
|
971
|
+
children: a
|
|
972
|
+
}
|
|
973
|
+
)
|
|
974
|
+
] }),
|
|
975
|
+
f ? /* @__PURE__ */ e("div", { className: "pointer-events-none absolute right-4 top-(--table-inset) flex h-(--table-header-h) items-center", children: /* @__PURE__ */ e("div", { className: "pointer-events-auto", children: f }) }) : null
|
|
976
|
+
] });
|
|
977
|
+
}
|
|
978
|
+
const Jt = "h-[var(--table-header-h)] whitespace-nowrap px-[var(--table-pad-x)] text-left align-middle text-[0.8125rem] font-medium";
|
|
979
|
+
function Qt(t) {
|
|
980
|
+
return t.split(/\s+/).slice(0, 2).map((a) => {
|
|
981
|
+
var r;
|
|
982
|
+
return ((r = a[0]) == null ? void 0 : r.toUpperCase()) ?? "";
|
|
983
|
+
}).join("");
|
|
984
|
+
}
|
|
985
|
+
function ga({
|
|
986
|
+
name: t,
|
|
987
|
+
secondary: a,
|
|
988
|
+
image: r
|
|
989
|
+
}) {
|
|
990
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
|
|
991
|
+
/* @__PURE__ */ s(ce, { className: "size-8", children: [
|
|
992
|
+
r ? /* @__PURE__ */ e(me, { src: r, alt: "" }) : null,
|
|
993
|
+
/* @__PURE__ */ e(ue, { children: Qt(t) })
|
|
994
|
+
] }),
|
|
995
|
+
/* @__PURE__ */ s("div", { className: "min-w-0", children: [
|
|
996
|
+
/* @__PURE__ */ e("div", { className: "truncate font-medium text-table-header-active", children: t }),
|
|
997
|
+
a ? /* @__PURE__ */ e("div", { className: "truncate text-xs text-table-muted", children: a }) : null
|
|
998
|
+
] })
|
|
999
|
+
] });
|
|
1000
|
+
}
|
|
1001
|
+
function Na({
|
|
1002
|
+
rows: t,
|
|
1003
|
+
columns: a,
|
|
1004
|
+
getRowId: r,
|
|
1005
|
+
loading: i = !1,
|
|
1006
|
+
error: o,
|
|
1007
|
+
empty: c,
|
|
1008
|
+
search: d,
|
|
1009
|
+
toolbarStart: u,
|
|
1010
|
+
toolbarEnd: f,
|
|
1011
|
+
tabs: g,
|
|
1012
|
+
activeTab: v,
|
|
1013
|
+
onTabChange: k,
|
|
1014
|
+
infoBanner: P,
|
|
1015
|
+
selectable: N = !1,
|
|
1016
|
+
bulkActions: T,
|
|
1017
|
+
rowActions: w,
|
|
1018
|
+
onRowClick: x,
|
|
1019
|
+
defaultSort: F,
|
|
1020
|
+
pageSize: K = 25,
|
|
1021
|
+
pageSizeOptions: $ = [10, 25, 50, 100],
|
|
1022
|
+
tone: ze,
|
|
1023
|
+
headerAction: ke,
|
|
1024
|
+
headerClassName: Se,
|
|
1025
|
+
panelClassName: De,
|
|
1026
|
+
className: Te
|
|
1027
|
+
}) {
|
|
1028
|
+
const [te, Ie] = I(
|
|
1029
|
+
() => Object.fromEntries(a.filter((n) => n.defaultHidden).map((n) => [n.id, !0]))
|
|
1030
|
+
), [p, Pe] = I(
|
|
1031
|
+
F ?? null
|
|
1032
|
+
), [L, W] = I(0), [M, _e] = I(K), [E, O] = I(/* @__PURE__ */ new Set()), _ = a.filter((n) => !te[n.id]), q = ne(() => {
|
|
1033
|
+
if (!d || !d.value.trim()) return t;
|
|
1034
|
+
const n = d.value.trim().toLowerCase();
|
|
1035
|
+
return t.filter((m) => d.keys(m).toLowerCase().includes(n));
|
|
1036
|
+
}, [t, d]), R = ne(() => {
|
|
1037
|
+
if (!p) return q;
|
|
1038
|
+
const n = a.find((h) => h.id === p.id);
|
|
1039
|
+
if (!(n != null && n.sortValue)) return q;
|
|
1040
|
+
const m = p.dir === "asc" ? 1 : -1;
|
|
1041
|
+
return [...q].sort((h, C) => {
|
|
1042
|
+
const B = n.sortValue(h), H = n.sortValue(C);
|
|
1043
|
+
return B == null && H == null ? 0 : B == null ? 1 : H == null ? -1 : typeof B == "number" && typeof H == "number" ? (B - H) * m : String(B).localeCompare(String(H)) * m;
|
|
1044
|
+
});
|
|
1045
|
+
}, [q, p, a]), A = Math.max(1, Math.ceil(R.length / M));
|
|
1046
|
+
le(() => {
|
|
1047
|
+
W(0);
|
|
1048
|
+
}, [d == null ? void 0 : d.value, M, p == null ? void 0 : p.id, p == null ? void 0 : p.dir, v]), le(() => {
|
|
1049
|
+
L > A - 1 && W(A - 1);
|
|
1050
|
+
}, [L, A]);
|
|
1051
|
+
const U = L * M, j = R.slice(U, U + M), je = (n) => {
|
|
1052
|
+
n.sortable && Pe(
|
|
1053
|
+
(m) => (m == null ? void 0 : m.id) === n.id ? m.dir === "asc" ? { id: n.id, dir: "desc" } : null : { id: n.id, dir: "asc" }
|
|
1054
|
+
);
|
|
1055
|
+
}, ae = j.length > 0 && j.every((n) => E.has(r(n))), Me = j.some((n) => E.has(r(n))), Ee = t.filter((n) => E.has(r(n))), Le = () => {
|
|
1056
|
+
O((n) => {
|
|
1057
|
+
const m = new Set(n);
|
|
1058
|
+
return ae ? j.forEach((h) => m.delete(r(h))) : j.forEach((h) => m.add(r(h))), m;
|
|
1059
|
+
});
|
|
1060
|
+
}, Re = (n) => {
|
|
1061
|
+
O((m) => {
|
|
1062
|
+
const h = new Set(m);
|
|
1063
|
+
return h.has(n) ? h.delete(n) : h.add(n), h;
|
|
1064
|
+
});
|
|
1065
|
+
}, Ae = !!(d || u || f), Be = _.some((n) => n.width), He = _.length > 1 ? 70 / (_.length - 1) : 100, Ge = _.map((n, m) => n.width ? n.width : Be ? "auto" : `${m === 0 ? 30 : He}%`), re = [
|
|
1066
|
+
...N ? ["2.75rem"] : [],
|
|
1067
|
+
...Ge,
|
|
1068
|
+
...w ? ["11rem"] : []
|
|
1069
|
+
], Ve = (n) => (p == null ? void 0 : p.id) === n.id ? p.dir === "asc" ? "ascending" : "descending" : void 0;
|
|
1070
|
+
return /* @__PURE__ */ s("div", { className: l("space-y-4", Te), children: [
|
|
1071
|
+
g && g.length > 0 && /* @__PURE__ */ e("div", { className: "flex items-center gap-1 border-b border-line", role: "tablist", children: g.map((n) => {
|
|
1072
|
+
const m = n.id === v;
|
|
1073
|
+
return /* @__PURE__ */ e(
|
|
1074
|
+
"button",
|
|
1075
|
+
{
|
|
1076
|
+
type: "button",
|
|
1077
|
+
role: "tab",
|
|
1078
|
+
"aria-selected": m,
|
|
1079
|
+
onClick: () => k == null ? void 0 : k(n.id),
|
|
1080
|
+
className: l(
|
|
1081
|
+
"-mb-px border-b-2 px-3 py-2 text-sm transition-colors",
|
|
1082
|
+
m ? "border-fg font-medium text-fg" : "border-transparent text-muted hover:text-fg"
|
|
1083
|
+
),
|
|
1084
|
+
children: n.label
|
|
1085
|
+
},
|
|
1086
|
+
n.id
|
|
1087
|
+
);
|
|
1088
|
+
}) }),
|
|
1089
|
+
Ae && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1090
|
+
d && /* @__PURE__ */ e(
|
|
1091
|
+
he,
|
|
1092
|
+
{
|
|
1093
|
+
size: "md",
|
|
1094
|
+
type: "search",
|
|
1095
|
+
"aria-label": d.placeholder ?? "Search",
|
|
1096
|
+
placeholder: d.placeholder ?? "Search…",
|
|
1097
|
+
value: d.value,
|
|
1098
|
+
onChange: (n) => d.onChange(n.target.value),
|
|
1099
|
+
leadingIcon: /* @__PURE__ */ e(Qe, {}),
|
|
1100
|
+
containerClassName: "w-full sm:w-72"
|
|
1101
|
+
}
|
|
1102
|
+
),
|
|
1103
|
+
u,
|
|
1104
|
+
/* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
1105
|
+
/* @__PURE__ */ s(Lt, { children: [
|
|
1106
|
+
/* @__PURE__ */ e(Rt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1107
|
+
S,
|
|
1108
|
+
{
|
|
1109
|
+
variant: "secondary",
|
|
1110
|
+
size: "xs",
|
|
1111
|
+
leadingIcon: /* @__PURE__ */ e(Ye, {}),
|
|
1112
|
+
trailingIcon: /* @__PURE__ */ e(Q, {}),
|
|
1113
|
+
children: "Columns"
|
|
1114
|
+
}
|
|
1115
|
+
) }),
|
|
1116
|
+
/* @__PURE__ */ s(xe, { align: "end", className: "w-44", children: [
|
|
1117
|
+
/* @__PURE__ */ e(ge, { children: "Toggle columns" }),
|
|
1118
|
+
/* @__PURE__ */ e(Ne, {}),
|
|
1119
|
+
a.map((n) => /* @__PURE__ */ e(
|
|
1120
|
+
ve,
|
|
1121
|
+
{
|
|
1122
|
+
checked: !te[n.id],
|
|
1123
|
+
onCheckedChange: (m) => Ie((h) => ({ ...h, [n.id]: !m })),
|
|
1124
|
+
onSelect: (m) => m.preventDefault(),
|
|
1125
|
+
children: n.header
|
|
1126
|
+
},
|
|
1127
|
+
n.id
|
|
1128
|
+
))
|
|
1129
|
+
] })
|
|
1130
|
+
] }),
|
|
1131
|
+
f
|
|
1132
|
+
] })
|
|
1133
|
+
] }),
|
|
1134
|
+
P,
|
|
1135
|
+
N && E.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: [
|
|
1136
|
+
/* @__PURE__ */ s("span", { className: "font-medium text-fg", children: [
|
|
1137
|
+
E.size,
|
|
1138
|
+
" selected"
|
|
1139
|
+
] }),
|
|
1140
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: (T ?? []).map((n) => /* @__PURE__ */ s(
|
|
1141
|
+
S,
|
|
1142
|
+
{
|
|
1143
|
+
size: "sm",
|
|
1144
|
+
variant: n.variant ?? "outline",
|
|
1145
|
+
disabled: n.disabled,
|
|
1146
|
+
onClick: () => void n.onRun(Ee),
|
|
1147
|
+
children: [
|
|
1148
|
+
n.icon,
|
|
1149
|
+
n.label
|
|
1150
|
+
]
|
|
1151
|
+
},
|
|
1152
|
+
n.label
|
|
1153
|
+
)) }),
|
|
1154
|
+
/* @__PURE__ */ s(
|
|
1155
|
+
"button",
|
|
1156
|
+
{
|
|
1157
|
+
type: "button",
|
|
1158
|
+
onClick: () => O(/* @__PURE__ */ new Set()),
|
|
1159
|
+
className: "ml-auto inline-flex items-center gap-1 text-xs text-muted hover:text-fg",
|
|
1160
|
+
children: [
|
|
1161
|
+
/* @__PURE__ */ e(de, { className: "size-3.5" }),
|
|
1162
|
+
"Clear"
|
|
1163
|
+
]
|
|
1164
|
+
}
|
|
1165
|
+
)
|
|
1166
|
+
] }),
|
|
1167
|
+
/* @__PURE__ */ e(
|
|
1168
|
+
Ot,
|
|
1169
|
+
{
|
|
1170
|
+
action: ke,
|
|
1171
|
+
tone: ze,
|
|
1172
|
+
headerClassName: Se,
|
|
1173
|
+
panelClassName: De,
|
|
1174
|
+
header: (
|
|
1175
|
+
// Visible header: presentational so its controls stay focusable while
|
|
1176
|
+
// the body table carries the semantic column headers (sr-only).
|
|
1177
|
+
/* @__PURE__ */ s("table", { role: "presentation", className: "w-full table-fixed border-collapse", children: [
|
|
1178
|
+
/* @__PURE__ */ e("colgroup", { children: re.map((n, m) => /* @__PURE__ */ e("col", { style: { width: n } }, m)) }),
|
|
1179
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ s("tr", { children: [
|
|
1180
|
+
N && /* @__PURE__ */ e("th", { className: "h-[var(--table-header-h)] w-11 px-4 align-middle", children: /* @__PURE__ */ e(
|
|
1181
|
+
Y,
|
|
1182
|
+
{
|
|
1183
|
+
"aria-label": "Select all rows",
|
|
1184
|
+
checked: ae ? !0 : Me ? "indeterminate" : !1,
|
|
1185
|
+
onCheckedChange: Le
|
|
1186
|
+
}
|
|
1187
|
+
) }),
|
|
1188
|
+
_.map((n) => /* @__PURE__ */ e(
|
|
1189
|
+
"th",
|
|
1190
|
+
{
|
|
1191
|
+
className: l(Jt, n.align === "right" && "text-right", n.className),
|
|
1192
|
+
children: n.sortable ? /* @__PURE__ */ s(
|
|
1193
|
+
"button",
|
|
1194
|
+
{
|
|
1195
|
+
type: "button",
|
|
1196
|
+
"aria-label": `Sort by ${n.header}`,
|
|
1197
|
+
onClick: () => je(n),
|
|
1198
|
+
className: l(
|
|
1199
|
+
"inline-flex items-center gap-1.5 transition-colors hover:text-table-header-active",
|
|
1200
|
+
(p == null ? void 0 : p.id) === n.id && "text-table-header-active"
|
|
1201
|
+
),
|
|
1202
|
+
children: [
|
|
1203
|
+
n.header,
|
|
1204
|
+
(p == null ? void 0 : p.id) === n.id ? p.dir === "asc" ? /* @__PURE__ */ e(et, { className: "size-3.5", weight: "bold" }) : /* @__PURE__ */ e(Q, { className: "size-3.5", weight: "bold" }) : /* @__PURE__ */ e(tt, { className: "size-3.5 opacity-50" })
|
|
1205
|
+
]
|
|
1206
|
+
}
|
|
1207
|
+
) : n.header
|
|
1208
|
+
},
|
|
1209
|
+
n.id
|
|
1210
|
+
)),
|
|
1211
|
+
w && /* @__PURE__ */ e("th", { className: "h-[var(--table-header-h)] w-44 px-4 align-middle", children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
1212
|
+
] }) })
|
|
1213
|
+
] })
|
|
1214
|
+
),
|
|
1215
|
+
children: i ? /* @__PURE__ */ e("div", { className: "space-y-2 p-4", children: [0, 1, 2].map((n) => /* @__PURE__ */ e("div", { className: "h-11 w-full animate-pulse rounded-lg bg-table-row-hover" }, n)) }) : o ? /* @__PURE__ */ s("div", { className: "flex min-h-[22rem] flex-col items-center justify-center gap-4 px-6 py-16 text-center", children: [
|
|
1216
|
+
/* @__PURE__ */ e("div", { className: "flex size-[var(--table-empty-icon)] items-center justify-center rounded-2xl border border-table-empty-icon-border bg-table-empty-icon text-error [&_svg]:size-8", children: /* @__PURE__ */ e(Ze, { weight: "duotone" }) }),
|
|
1217
|
+
/* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
1218
|
+
/* @__PURE__ */ e("p", { className: "text-[1.75rem] font-semibold text-table-header-active", children: o.title }),
|
|
1219
|
+
o.description ? /* @__PURE__ */ e("p", { className: "mx-auto max-w-md text-base leading-relaxed text-table-muted", children: o.description }) : null
|
|
1220
|
+
] }),
|
|
1221
|
+
o.action
|
|
1222
|
+
] }) : j.length === 0 ? /* @__PURE__ */ e(
|
|
1223
|
+
qt,
|
|
1224
|
+
{
|
|
1225
|
+
icon: c == null ? void 0 : c.icon,
|
|
1226
|
+
title: (c == null ? void 0 : c.title) ?? "No results",
|
|
1227
|
+
description: typeof (c == null ? void 0 : c.description) == "string" ? c.description : void 0,
|
|
1228
|
+
action: c == null ? void 0 : c.action
|
|
1229
|
+
}
|
|
1230
|
+
) : /* @__PURE__ */ s("table", { className: "w-full table-fixed border-collapse", children: [
|
|
1231
|
+
/* @__PURE__ */ e("colgroup", { children: re.map((n, m) => /* @__PURE__ */ e("col", { style: { width: n } }, m)) }),
|
|
1232
|
+
/* @__PURE__ */ e("thead", { className: "sr-only", children: /* @__PURE__ */ s("tr", { children: [
|
|
1233
|
+
N && /* @__PURE__ */ e("th", { scope: "col", children: "Select" }),
|
|
1234
|
+
_.map((n) => /* @__PURE__ */ e("th", { scope: "col", "aria-sort": Ve(n), children: n.header }, n.id)),
|
|
1235
|
+
w && /* @__PURE__ */ e("th", { scope: "col", children: "Actions" })
|
|
1236
|
+
] }) }),
|
|
1237
|
+
/* @__PURE__ */ e($t, { children: j.map((n) => {
|
|
1238
|
+
const m = r(n), h = E.has(m);
|
|
1239
|
+
return /* @__PURE__ */ s(
|
|
1240
|
+
Wt,
|
|
1241
|
+
{
|
|
1242
|
+
"data-state": h ? "selected" : void 0,
|
|
1243
|
+
onClick: x ? () => x(n) : void 0,
|
|
1244
|
+
className: x ? "cursor-pointer" : void 0,
|
|
1245
|
+
children: [
|
|
1246
|
+
N && /* @__PURE__ */ e(J, { className: "w-11 px-4", onClick: (C) => C.stopPropagation(), children: /* @__PURE__ */ e(
|
|
1247
|
+
Y,
|
|
1248
|
+
{
|
|
1249
|
+
"aria-label": "Select row",
|
|
1250
|
+
checked: h,
|
|
1251
|
+
onCheckedChange: () => Re(m)
|
|
1252
|
+
}
|
|
1253
|
+
) }),
|
|
1254
|
+
_.map((C) => /* @__PURE__ */ e(
|
|
1255
|
+
J,
|
|
1256
|
+
{
|
|
1257
|
+
"data-numeric": C.numeric ? "" : void 0,
|
|
1258
|
+
className: l(C.align === "right" && "text-right", C.className),
|
|
1259
|
+
children: C.cell(n)
|
|
1260
|
+
},
|
|
1261
|
+
C.id
|
|
1262
|
+
)),
|
|
1263
|
+
w && /* @__PURE__ */ e(J, { className: "w-44 px-4 text-right", onClick: (C) => C.stopPropagation(), children: w(n) })
|
|
1264
|
+
]
|
|
1265
|
+
},
|
|
1266
|
+
m
|
|
1267
|
+
);
|
|
1268
|
+
}) })
|
|
1269
|
+
] })
|
|
1270
|
+
}
|
|
1271
|
+
),
|
|
1272
|
+
!i && !o && R.length > 0 && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3 text-sm", children: [
|
|
1273
|
+
/* @__PURE__ */ s("span", { className: "text-muted", children: [
|
|
1274
|
+
U + 1,
|
|
1275
|
+
"–",
|
|
1276
|
+
Math.min(U + M, R.length),
|
|
1277
|
+
" of ",
|
|
1278
|
+
R.length
|
|
1279
|
+
] }),
|
|
1280
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
1281
|
+
/* @__PURE__ */ s(Bt, { value: String(M), onValueChange: (n) => _e(Number(n)), children: [
|
|
1282
|
+
/* @__PURE__ */ e(ye, { "aria-label": "Rows per page", className: "h-8 w-[110px]", children: /* @__PURE__ */ e(Ht, {}) }),
|
|
1283
|
+
/* @__PURE__ */ e(we, { children: $.map((n) => /* @__PURE__ */ s(Ce, { value: String(n), children: [
|
|
1284
|
+
n,
|
|
1285
|
+
" / page"
|
|
1286
|
+
] }, n)) })
|
|
1287
|
+
] }),
|
|
1288
|
+
/* @__PURE__ */ e(
|
|
1289
|
+
S,
|
|
1290
|
+
{
|
|
1291
|
+
variant: "outline",
|
|
1292
|
+
size: "sm",
|
|
1293
|
+
disabled: L <= 0,
|
|
1294
|
+
onClick: () => W((n) => Math.max(0, n - 1)),
|
|
1295
|
+
children: "Previous"
|
|
1296
|
+
}
|
|
1297
|
+
),
|
|
1298
|
+
/* @__PURE__ */ e(
|
|
1299
|
+
S,
|
|
1300
|
+
{
|
|
1301
|
+
variant: "outline",
|
|
1302
|
+
size: "sm",
|
|
1303
|
+
disabled: L >= A - 1,
|
|
1304
|
+
onClick: () => W((n) => Math.min(A - 1, n + 1)),
|
|
1305
|
+
children: "Next"
|
|
1306
|
+
}
|
|
1307
|
+
)
|
|
1308
|
+
] })
|
|
1309
|
+
] })
|
|
1310
|
+
] });
|
|
1311
|
+
}
|
|
1312
|
+
function ya({ icon: t, title: a, description: r, action: i, className: o }) {
|
|
1313
|
+
return /* @__PURE__ */ s(
|
|
1314
|
+
"div",
|
|
1315
|
+
{
|
|
1316
|
+
className: l(
|
|
1317
|
+
"flex flex-col items-center justify-center gap-4 rounded-card border border-line bg-surface px-6 py-16 text-center",
|
|
1318
|
+
o
|
|
1319
|
+
),
|
|
1320
|
+
children: [
|
|
1321
|
+
t ? /* @__PURE__ */ e("div", { className: "flex size-11 items-center justify-center rounded-xl border border-line bg-elevated text-subtle [&_svg]:size-6", children: t }) : null,
|
|
1322
|
+
/* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
1323
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-fg", children: a }),
|
|
1324
|
+
r ? /* @__PURE__ */ e("p", { className: "mx-auto max-w-sm text-sm text-muted", children: r }) : null
|
|
1325
|
+
] }),
|
|
1326
|
+
i
|
|
1327
|
+
]
|
|
1328
|
+
}
|
|
1329
|
+
);
|
|
1330
|
+
}
|
|
1331
|
+
function wa({ className: t, ...a }) {
|
|
1332
|
+
return /* @__PURE__ */ e(
|
|
1333
|
+
"kbd",
|
|
1334
|
+
{
|
|
1335
|
+
className: l(
|
|
1336
|
+
"inline-flex h-5 min-w-5 items-center justify-center rounded border border-line bg-elevated px-1.5 font-mono text-[11px] font-medium text-subtle",
|
|
1337
|
+
t
|
|
1338
|
+
),
|
|
1339
|
+
...a
|
|
1340
|
+
}
|
|
1341
|
+
);
|
|
1342
|
+
}
|
|
1343
|
+
const Yt = b(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
1344
|
+
st.Root,
|
|
1345
|
+
{
|
|
1346
|
+
ref: r,
|
|
1347
|
+
className: l(
|
|
1348
|
+
"text-sm font-medium text-fg leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
1349
|
+
t
|
|
1350
|
+
),
|
|
1351
|
+
...a
|
|
1352
|
+
}
|
|
1353
|
+
));
|
|
1354
|
+
Yt.displayName = "Label";
|
|
1355
|
+
function Ca({
|
|
1356
|
+
value: t,
|
|
1357
|
+
onValueChange: a,
|
|
1358
|
+
options: r,
|
|
1359
|
+
size: i = "sm",
|
|
1360
|
+
className: o,
|
|
1361
|
+
...c
|
|
1362
|
+
}) {
|
|
1363
|
+
const d = X();
|
|
1364
|
+
return /* @__PURE__ */ e(
|
|
1365
|
+
"div",
|
|
1366
|
+
{
|
|
1367
|
+
role: "radiogroup",
|
|
1368
|
+
"aria-label": c["aria-label"],
|
|
1369
|
+
className: l(
|
|
1370
|
+
"inline-flex w-fit items-center rounded-lg border border-line bg-canvas",
|
|
1371
|
+
i === "sm" ? "h-(--control-h-sm)" : "h-(--control-h-md)",
|
|
1372
|
+
o
|
|
1373
|
+
),
|
|
1374
|
+
children: r.map((u) => {
|
|
1375
|
+
const f = u.value === t;
|
|
1376
|
+
return /* @__PURE__ */ s(
|
|
1377
|
+
"label",
|
|
1378
|
+
{
|
|
1379
|
+
className: l(
|
|
1380
|
+
"inline-flex h-full cursor-pointer items-center justify-center gap-1.5 rounded-md text-sm font-medium transition-colors",
|
|
1381
|
+
"has-focus-visible:ring-2 has-focus-visible:ring-focus/40",
|
|
1382
|
+
i === "sm" ? "px-(--control-pad-x-sm) [&_svg]:size-(--control-icon-sm)" : "px-(--control-pad-x-md) [&_svg]:size-(--control-icon-md)",
|
|
1383
|
+
f ? "btn-fill bg-(--button-secondary-bg) text-fg" : "text-muted hover:text-fg"
|
|
1384
|
+
),
|
|
1385
|
+
children: [
|
|
1386
|
+
/* @__PURE__ */ e(
|
|
1387
|
+
"input",
|
|
1388
|
+
{
|
|
1389
|
+
type: "radio",
|
|
1390
|
+
name: d,
|
|
1391
|
+
value: u.value,
|
|
1392
|
+
checked: f,
|
|
1393
|
+
onChange: () => a(u.value),
|
|
1394
|
+
className: "sr-only"
|
|
1395
|
+
}
|
|
1396
|
+
),
|
|
1397
|
+
u.icon,
|
|
1398
|
+
u.label
|
|
1399
|
+
]
|
|
1400
|
+
},
|
|
1401
|
+
u.value
|
|
1402
|
+
);
|
|
1403
|
+
})
|
|
1404
|
+
}
|
|
1405
|
+
);
|
|
1406
|
+
}
|
|
1407
|
+
const Zt = b(({ className: t, orientation: a = "horizontal", decorative: r = !0, ...i }, o) => /* @__PURE__ */ e(
|
|
1408
|
+
ot.Root,
|
|
1409
|
+
{
|
|
1410
|
+
ref: o,
|
|
1411
|
+
decorative: r,
|
|
1412
|
+
orientation: a,
|
|
1413
|
+
className: l(
|
|
1414
|
+
"shrink-0 bg-line",
|
|
1415
|
+
a === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
1416
|
+
t
|
|
1417
|
+
),
|
|
1418
|
+
...i
|
|
1419
|
+
}
|
|
1420
|
+
));
|
|
1421
|
+
Zt.displayName = "Separator";
|
|
1422
|
+
function za({ className: t, ...a }) {
|
|
1423
|
+
return /* @__PURE__ */ e(
|
|
1424
|
+
"div",
|
|
1425
|
+
{
|
|
1426
|
+
className: l("animate-pulse rounded-md bg-elevated", t),
|
|
1427
|
+
...a
|
|
1428
|
+
}
|
|
1429
|
+
);
|
|
1430
|
+
}
|
|
1431
|
+
const ka = G.Provider, Sa = G.Root, Da = G.Trigger, ea = b(({ className: t, sideOffset: a = 6, ...r }, i) => /* @__PURE__ */ e(G.Portal, { children: /* @__PURE__ */ e(
|
|
1432
|
+
G.Content,
|
|
1433
|
+
{
|
|
1434
|
+
ref: i,
|
|
1435
|
+
sideOffset: a,
|
|
1436
|
+
className: l(
|
|
1437
|
+
"z-50 overflow-hidden rounded-md border border-line bg-elevated px-2 py-1 text-xs text-fg shadow-md",
|
|
1438
|
+
"data-[state=delayed-open]:animate-in data-[state=closed]:animate-out",
|
|
1439
|
+
"data-[state=delayed-open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
1440
|
+
"data-[state=delayed-open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
1441
|
+
"data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1",
|
|
1442
|
+
"data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1",
|
|
1443
|
+
"duration-150 ease-out",
|
|
1444
|
+
t
|
|
1445
|
+
),
|
|
1446
|
+
...r
|
|
1447
|
+
}
|
|
1448
|
+
) }));
|
|
1449
|
+
ea.displayName = "TooltipContent";
|
|
1450
|
+
export {
|
|
1451
|
+
oa as AgentPrompt,
|
|
1452
|
+
ce as Avatar,
|
|
1453
|
+
ue as AvatarFallback,
|
|
1454
|
+
me as AvatarImage,
|
|
1455
|
+
pt as Badge,
|
|
1456
|
+
S as Button,
|
|
1457
|
+
da as Callout,
|
|
1458
|
+
ht as Card,
|
|
1459
|
+
Nt as CardContent,
|
|
1460
|
+
gt as CardDescription,
|
|
1461
|
+
yt as CardFooter,
|
|
1462
|
+
xt as CardHeader,
|
|
1463
|
+
vt as CardTitle,
|
|
1464
|
+
Y as Checkbox,
|
|
1465
|
+
ma as ChoiceDialog,
|
|
1466
|
+
ua as CodeBlock,
|
|
1467
|
+
Na as DataTable,
|
|
1468
|
+
ga as DataTableIdentity,
|
|
1469
|
+
wt as Dialog,
|
|
1470
|
+
kt as DialogBody,
|
|
1471
|
+
ca as DialogClose,
|
|
1472
|
+
be as DialogContent,
|
|
1473
|
+
Tt as DialogDescription,
|
|
1474
|
+
Dt as DialogFooter,
|
|
1475
|
+
St as DialogHeader,
|
|
1476
|
+
zt as DialogPanel,
|
|
1477
|
+
pe as DialogTitle,
|
|
1478
|
+
Ct as DialogTrigger,
|
|
1479
|
+
Lt as DropdownMenu,
|
|
1480
|
+
ve as DropdownMenuCheckboxItem,
|
|
1481
|
+
xe as DropdownMenuContent,
|
|
1482
|
+
ba as DropdownMenuGroup,
|
|
1483
|
+
At as DropdownMenuItem,
|
|
1484
|
+
ge as DropdownMenuLabel,
|
|
1485
|
+
pa as DropdownMenuPortal,
|
|
1486
|
+
Ne as DropdownMenuSeparator,
|
|
1487
|
+
Rt as DropdownMenuTrigger,
|
|
1488
|
+
ya as EmptyState,
|
|
1489
|
+
he as Input,
|
|
1490
|
+
wa as Kbd,
|
|
1491
|
+
Yt as Label,
|
|
1492
|
+
Pt as RadioCard,
|
|
1493
|
+
It as RadioGroup,
|
|
1494
|
+
Ca as Segmented,
|
|
1495
|
+
Bt as Select,
|
|
1496
|
+
we as SelectContent,
|
|
1497
|
+
fa as SelectGroup,
|
|
1498
|
+
Ce as SelectItem,
|
|
1499
|
+
Gt as SelectLabel,
|
|
1500
|
+
ye as SelectTrigger,
|
|
1501
|
+
Ht as SelectValue,
|
|
1502
|
+
Zt as Separator,
|
|
1503
|
+
za as Skeleton,
|
|
1504
|
+
dt as Spinner,
|
|
1505
|
+
ha as Table,
|
|
1506
|
+
$t as TableBody,
|
|
1507
|
+
J as TableCell,
|
|
1508
|
+
Vt as TableContainer,
|
|
1509
|
+
qt as TableEmptyState,
|
|
1510
|
+
va as TableHead,
|
|
1511
|
+
xa as TableHeader,
|
|
1512
|
+
Ft as TablePanel,
|
|
1513
|
+
Wt as TableRow,
|
|
1514
|
+
Ot as TableSurface,
|
|
1515
|
+
Sa as Tooltip,
|
|
1516
|
+
ea as TooltipContent,
|
|
1517
|
+
ka as TooltipProvider,
|
|
1518
|
+
Da as TooltipTrigger,
|
|
1519
|
+
ut as badgeVariants,
|
|
1520
|
+
ct as buttonVariants
|
|
1521
|
+
};
|
|
1522
|
+
//# sourceMappingURL=index.js.map
|