@rinzai/zen 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backdrop/index.d.ts.map +1 -1
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/spinner/index.d.ts +8 -2
- package/dist/spinner/index.d.ts.map +1 -1
- package/dist/toast/index.d.ts +7 -1
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toggle/index.d.ts +3 -2
- package/dist/toggle/index.d.ts.map +1 -1
- package/dist/zen.css +1 -1
- package/dist/zen.js +568 -524
- package/package.json +2 -2
package/dist/zen.js
CHANGED
|
@@ -16,7 +16,7 @@ function _(e) {
|
|
|
16
16
|
let o = a.scope;
|
|
17
17
|
if (!r.has(o + a.group)) {
|
|
18
18
|
r.add(o + a.group);
|
|
19
|
-
for (let e of
|
|
19
|
+
for (let e of ie[a.group] ?? []) r.add(o + e);
|
|
20
20
|
i.push(t);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -27,7 +27,7 @@ var v = /* @__PURE__ */ new Map();
|
|
|
27
27
|
function y(e) {
|
|
28
28
|
let t = b(e), n = t.pop(), r = !1;
|
|
29
29
|
n.startsWith("!") ? [r, n] = [!0, n.slice(1)] : n.endsWith("!") && ([r, n] = [!0, n.slice(0, -1)]), n.startsWith("-") && (n = n.slice(1));
|
|
30
|
-
let i =
|
|
30
|
+
let i = re(n);
|
|
31
31
|
return i ? {
|
|
32
32
|
group: i,
|
|
33
33
|
scope: t.sort().join(":") + (r ? "!" : "") + "|"
|
|
@@ -50,7 +50,7 @@ var x = /^\d+(\.\d+)?$/, S = /^(\d?xs|sm|md|lg|\d?xl|base|none|full)$/, C = /^[[
|
|
|
50
50
|
"l",
|
|
51
51
|
"s",
|
|
52
52
|
"e"
|
|
53
|
-
],
|
|
53
|
+
], D = [
|
|
54
54
|
"t",
|
|
55
55
|
"r",
|
|
56
56
|
"b",
|
|
@@ -65,11 +65,11 @@ var x = /^\d+(\.\d+)?$/, S = /^(\d?xs|sm|md|lg|\d?xl|base|none|full)$/, C = /^[[
|
|
|
65
65
|
"se",
|
|
66
66
|
"es",
|
|
67
67
|
"ee"
|
|
68
|
-
],
|
|
69
|
-
|
|
70
|
-
for (let e of E)
|
|
71
|
-
for (let e of
|
|
72
|
-
var
|
|
68
|
+
], ee = {}, O = (e, t) => t.split(" ").forEach((t) => ee[t] = e);
|
|
69
|
+
O("display", "block inline-block inline flex inline-flex grid inline-grid contents hidden flow-root list-item table inline-table table-row table-cell table-caption table-column table-row-group table-header-group table-footer-group"), O("position", "static fixed absolute relative sticky"), O("visibility", "visible invisible collapse"), O("isolation", "isolate isolation-auto"), O("text-overflow", "truncate text-ellipsis text-clip"), O("text-transform", "uppercase lowercase capitalize normal-case"), O("font-style", "italic not-italic"), O("text-decoration-line", "underline overline line-through no-underline"), O("font-smoothing", "antialiased subpixel-antialiased"), O("sr", "sr-only not-sr-only"), O("flex-direction", "flex-row flex-row-reverse flex-col flex-col-reverse"), O("flex-wrap", "flex-wrap flex-wrap-reverse flex-nowrap"), O("border-style", "border-solid border-dashed border-dotted border-double border-hidden border-none"), O("border-collapse", "border-collapse border-separate"), O("table-layout", "table-auto table-fixed"), O("box-sizing", "box-border box-content"), O("grow", "grow"), O("shrink", "shrink"), O("transition", "transition"), O("shadow", "shadow"), O("ring-w", "ring"), O("ring-inset", "ring-inset"), O("outline-w", "outline"), O("border-w", "border"), O("rounded", "rounded");
|
|
70
|
+
for (let e of E) O(`border-w-${e}`, `border-${e}`);
|
|
71
|
+
for (let e of D) O(`rounded-${e}`, `rounded-${e}`);
|
|
72
|
+
var k = {
|
|
73
73
|
inset: "inset",
|
|
74
74
|
"inset-x": "inset-x",
|
|
75
75
|
"inset-y": "inset-y",
|
|
@@ -220,27 +220,27 @@ var O = {
|
|
|
220
220
|
border: (e) => T(e) ? "border-w" : "border-color"
|
|
221
221
|
};
|
|
222
222
|
for (let e of ["p", "m"]) {
|
|
223
|
-
|
|
224
|
-
for (let t of E)
|
|
225
|
-
}
|
|
226
|
-
for (let e of E)
|
|
227
|
-
for (let e of
|
|
228
|
-
var
|
|
229
|
-
function
|
|
230
|
-
if (
|
|
231
|
-
if (
|
|
223
|
+
k[e] = e;
|
|
224
|
+
for (let t of E) k[e + t] = e + t;
|
|
225
|
+
}
|
|
226
|
+
for (let e of E) k[`border-${e}`] = (t) => T(t) ? `border-w-${e}` : `border-color-${e}`;
|
|
227
|
+
for (let e of D) k[`rounded-${e}`] = `rounded-${e}`;
|
|
228
|
+
var te = /* @__PURE__ */ new Set(["text-glow", "text-aurora"]), ne = Object.keys(k).sort((e, t) => t.length - e.length);
|
|
229
|
+
function re(e) {
|
|
230
|
+
if (te.has(e)) return null;
|
|
231
|
+
if (ee[e]) return ee[e];
|
|
232
232
|
if (e.startsWith("[")) {
|
|
233
233
|
let t = e.indexOf(":");
|
|
234
234
|
return t > 1 ? "prop:" + e.slice(1, t) : null;
|
|
235
235
|
}
|
|
236
|
-
for (let t of
|
|
236
|
+
for (let t of ne) {
|
|
237
237
|
if (!e.startsWith(t + "-")) continue;
|
|
238
|
-
let n =
|
|
238
|
+
let n = k[t];
|
|
239
239
|
return typeof n == "string" ? n : n(e.slice(t.length + 1));
|
|
240
240
|
}
|
|
241
241
|
return null;
|
|
242
242
|
}
|
|
243
|
-
var
|
|
243
|
+
var ie = {
|
|
244
244
|
p: E.map((e) => "p" + e),
|
|
245
245
|
m: E.map((e) => "m" + e),
|
|
246
246
|
px: [
|
|
@@ -289,7 +289,7 @@ var ae = {
|
|
|
289
289
|
"border-color-e"
|
|
290
290
|
],
|
|
291
291
|
"border-color-y": ["border-color-t", "border-color-b"],
|
|
292
|
-
rounded:
|
|
292
|
+
rounded: D.map((e) => "rounded-" + e),
|
|
293
293
|
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
294
294
|
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
295
295
|
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
@@ -303,37 +303,37 @@ var ae = {
|
|
|
303
303
|
"shrink",
|
|
304
304
|
"basis"
|
|
305
305
|
]
|
|
306
|
-
},
|
|
307
|
-
function
|
|
308
|
-
if (
|
|
306
|
+
}, A = (...e) => _(ae(e)), ae = (e) => e.reduce((e, t) => t == null || t === !1 ? e : typeof t == "string" || typeof t == "number" ? e + " " + t : Array.isArray(t) ? e + " " + ae(t) : typeof t == "object" ? e + " " + Object.entries(t).reduce((e, [t, n]) => n == null || n === !1 ? e : typeof n == "string" || typeof n == "number" ? e + " " + t + "-" + n : typeof n == "boolean" && n ? e + " " + t : e, "") : e, ""), oe = "data-zen-graphics", se = /swiftshader|llvmpipe|softpipe|software|basic render driver|mesa offscreen/i, j;
|
|
307
|
+
function ce() {
|
|
308
|
+
if (j) return j;
|
|
309
309
|
if (typeof document > "u") return "full";
|
|
310
310
|
try {
|
|
311
311
|
let e = document.createElement("canvas"), t = e.getContext("webgl", { failIfMajorPerformanceCaveat: !0 }) ?? e.getContext("experimental-webgl", { failIfMajorPerformanceCaveat: !0 });
|
|
312
|
-
if (!t)
|
|
312
|
+
if (!t) j = "lite";
|
|
313
313
|
else {
|
|
314
314
|
let e = t.getExtension("WEBGL_debug_renderer_info"), n = String(t.getParameter(e ? e.UNMASKED_RENDERER_WEBGL : t.RENDERER) ?? "");
|
|
315
|
-
|
|
315
|
+
j = se.test(n) ? "lite" : "full", t.getExtension("WEBGL_lose_context")?.loseContext();
|
|
316
316
|
}
|
|
317
317
|
} catch {
|
|
318
|
-
|
|
318
|
+
j = "lite";
|
|
319
319
|
}
|
|
320
|
-
return
|
|
320
|
+
return j;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function M() {
|
|
323
323
|
if (typeof document > "u") return "full";
|
|
324
|
-
let e = document.documentElement, t = e.getAttribute(
|
|
324
|
+
let e = document.documentElement, t = e.getAttribute(oe);
|
|
325
325
|
if (t === "full" || t === "lite") return t;
|
|
326
|
-
let n =
|
|
327
|
-
return e.setAttribute(
|
|
326
|
+
let n = ce();
|
|
327
|
+
return e.setAttribute(oe, n), n;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function N() {
|
|
330
330
|
o(() => {
|
|
331
|
-
|
|
331
|
+
M();
|
|
332
332
|
}, []);
|
|
333
333
|
}
|
|
334
334
|
//#endregion
|
|
335
335
|
//#region packages/utils/useAnchoredPopup.ts
|
|
336
|
-
function
|
|
336
|
+
function P({ align: e = "start", offset: t = 4, matchWidth: n = !1, onOpenChange: r } = {}) {
|
|
337
337
|
let a = `zen__popup-${s().replace(/[^\w-]/g, "")}`, c = u(null), [l, f] = d(!1), p = u(r);
|
|
338
338
|
p.current = r;
|
|
339
339
|
let m = u(!1), h = i((e) => {
|
|
@@ -381,10 +381,10 @@ function N({ align: e = "start", offset: t = 4, matchWidth: n = !1, onOpenChange
|
|
|
381
381
|
}
|
|
382
382
|
//#endregion
|
|
383
383
|
//#region packages/actions-menu/index.tsx
|
|
384
|
-
var
|
|
385
|
-
function
|
|
386
|
-
|
|
387
|
-
let r =
|
|
384
|
+
var le = "flex w-full cursor-default items-center rounded-lg px-3 py-2 text-sm outline-hidden select-none hover:bg-tint/[0.07] focus:bg-tint/[0.07]";
|
|
385
|
+
function ue({ label: e, actions: t, className: n }) {
|
|
386
|
+
N();
|
|
387
|
+
let r = P({
|
|
388
388
|
align: "end",
|
|
389
389
|
offset: 6,
|
|
390
390
|
onOpenChange: (e) => e && r.popupRef.current?.focus()
|
|
@@ -402,7 +402,7 @@ function de({ label: e, actions: t, className: n }) {
|
|
|
402
402
|
"aria-label": e,
|
|
403
403
|
"aria-haspopup": "menu",
|
|
404
404
|
...r.triggerProps,
|
|
405
|
-
className:
|
|
405
|
+
className: A("text-muted-foreground grid size-9 shrink-0 place-items-center rounded-lg outline-hidden", "hover:bg-tint/[0.06] hover:text-foreground focus-visible:ring-ring/50 focus-visible:ring-2", "data-popup-open:bg-tint/[0.06]", n),
|
|
406
406
|
children: /* @__PURE__ */ h("svg", {
|
|
407
407
|
viewBox: "0 0 16 16",
|
|
408
408
|
fill: "currentColor",
|
|
@@ -437,7 +437,7 @@ function de({ label: e, actions: t, className: n }) {
|
|
|
437
437
|
type: "button",
|
|
438
438
|
role: "menuitem",
|
|
439
439
|
tabIndex: -1,
|
|
440
|
-
className:
|
|
440
|
+
className: A(le, e.destructive && "text-destructive hover:bg-destructive/10 focus:bg-destructive/10"),
|
|
441
441
|
onClick: () => {
|
|
442
442
|
r.setOpen(!1), e.onClick();
|
|
443
443
|
},
|
|
@@ -447,14 +447,14 @@ function de({ label: e, actions: t, className: n }) {
|
|
|
447
447
|
}
|
|
448
448
|
//#endregion
|
|
449
449
|
//#region packages/utils/money.ts
|
|
450
|
-
function
|
|
450
|
+
function F(e) {
|
|
451
451
|
return new Intl.NumberFormat("en", {
|
|
452
452
|
style: "currency",
|
|
453
453
|
currency: e
|
|
454
454
|
}).resolvedOptions().maximumFractionDigits ?? 2;
|
|
455
455
|
}
|
|
456
|
-
function
|
|
457
|
-
let i =
|
|
456
|
+
function de(e, t, n, { showDecimals: r = !0 } = {}) {
|
|
457
|
+
let i = F(t);
|
|
458
458
|
return new Intl.NumberFormat(n, {
|
|
459
459
|
style: "currency",
|
|
460
460
|
currency: t,
|
|
@@ -462,34 +462,34 @@ function F(e, t, n, { showDecimals: r = !0 } = {}) {
|
|
|
462
462
|
maximumFractionDigits: r ? i : 0
|
|
463
463
|
}).format(e / 10 ** i);
|
|
464
464
|
}
|
|
465
|
-
function
|
|
466
|
-
let r =
|
|
465
|
+
function fe(e, t, n) {
|
|
466
|
+
let r = F(t), i = e % 10 ** r != 0;
|
|
467
467
|
return new Intl.NumberFormat(n, {
|
|
468
468
|
minimumFractionDigits: i ? r : 0,
|
|
469
469
|
maximumFractionDigits: r
|
|
470
470
|
}).format(e / 10 ** r);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function pe(e, t) {
|
|
473
473
|
return new Intl.NumberFormat(t, {
|
|
474
474
|
style: "currency",
|
|
475
475
|
currency: e
|
|
476
476
|
}).formatToParts(0).find((e) => e.type === "currency")?.value ?? e;
|
|
477
477
|
}
|
|
478
|
-
var
|
|
478
|
+
var I = class extends Error {
|
|
479
479
|
constructor(e) {
|
|
480
480
|
super(`Not an amount: ${e}`), this.name = "MoneyParseError";
|
|
481
481
|
}
|
|
482
482
|
};
|
|
483
|
-
function
|
|
484
|
-
let n =
|
|
485
|
-
if (!i || i[2] === "" && (i[3] ?? "") === "") throw new
|
|
483
|
+
function me(e, t) {
|
|
484
|
+
let n = F(t), r = e.trim().replace(/[\s,_]/g, "").replace(/^([+-]?)[^\d.+-]+/, "$1"), i = /^([+-]?)(\d*)(?:\.(\d*))?$/.exec(r);
|
|
485
|
+
if (!i || i[2] === "" && (i[3] ?? "") === "") throw new I(e);
|
|
486
486
|
let [, a, o, s = ""] = i;
|
|
487
|
-
if (s.length > n) throw new
|
|
487
|
+
if (s.length > n) throw new I(e);
|
|
488
488
|
let c = Number((o || "0") + s.padEnd(n, "0"));
|
|
489
|
-
if (!Number.isSafeInteger(c)) throw new
|
|
489
|
+
if (!Number.isSafeInteger(c)) throw new I(e);
|
|
490
490
|
return a === "-" ? -c : c;
|
|
491
491
|
}
|
|
492
|
-
var
|
|
492
|
+
var he = {
|
|
493
493
|
k: 3,
|
|
494
494
|
thousand: 3,
|
|
495
495
|
l: 5,
|
|
@@ -503,17 +503,17 @@ var me = {
|
|
|
503
503
|
mn: 6,
|
|
504
504
|
million: 6
|
|
505
505
|
};
|
|
506
|
-
function
|
|
507
|
-
let n = /^\s*(.*?)\s*([a-z]+)\s*$/i.exec(e), r =
|
|
508
|
-
if (!n || r === void 0) return
|
|
509
|
-
let i =
|
|
510
|
-
if (!a) throw new
|
|
506
|
+
function L(e, t) {
|
|
507
|
+
let n = /^\s*(.*?)\s*([a-z]+)\s*$/i.exec(e), r = he[n ? n[2].toLowerCase() : ""];
|
|
508
|
+
if (!n || r === void 0) return me(e, t);
|
|
509
|
+
let i = F(t), a = /^([+-]?)[^\d.+-]*([\d,\s_]*)(?:\.(\d*))?$/.exec(n[1]);
|
|
510
|
+
if (!a) throw new I(e);
|
|
511
511
|
let o = a[2].replace(/[,\s_]/g, ""), s = a[3] ?? "";
|
|
512
|
-
if (o === "" && s === "") throw new
|
|
512
|
+
if (o === "" && s === "") throw new I(e);
|
|
513
513
|
let c = r + i;
|
|
514
|
-
if (s.length > c) throw new
|
|
514
|
+
if (s.length > c) throw new I(e);
|
|
515
515
|
let l = Number((o || "0") + s.padEnd(c, "0"));
|
|
516
|
-
if (!Number.isSafeInteger(l)) throw new
|
|
516
|
+
if (!Number.isSafeInteger(l)) throw new I(e);
|
|
517
517
|
return a[1] === "-" ? -l : l;
|
|
518
518
|
}
|
|
519
519
|
//#endregion
|
|
@@ -532,14 +532,14 @@ function ve({ value: e, format: t = String, duration: n = 650, fromZero: r = !0,
|
|
|
532
532
|
});
|
|
533
533
|
return () => cancelAnimationFrame(i);
|
|
534
534
|
}, [e, n]), /* @__PURE__ */ m("span", {
|
|
535
|
-
className:
|
|
535
|
+
className: A("zen__animated-number tabular-nums", i),
|
|
536
536
|
children: t(a)
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
539
|
function ye({ value: e, currency: t, locale: n, showDecimals: r = !1, ...i }) {
|
|
540
540
|
return /* @__PURE__ */ m(ve, {
|
|
541
541
|
value: e,
|
|
542
|
-
format: (e) =>
|
|
542
|
+
format: (e) => de(e, t, n, { showDecimals: r }),
|
|
543
543
|
...i
|
|
544
544
|
});
|
|
545
545
|
}
|
|
@@ -551,7 +551,7 @@ function be({ src: e, name: t, alt: n, className: r }) {
|
|
|
551
551
|
role: n ? "img" : void 0,
|
|
552
552
|
"aria-label": n,
|
|
553
553
|
"aria-hidden": !n || void 0,
|
|
554
|
-
className:
|
|
554
|
+
className: A("zen__avatar relative inline-grid shrink-0 place-items-center overflow-hidden rounded-full font-semibold select-none", "size-9 text-sm", "text-primary-foreground bg-[radial-gradient(circle_at_30%_25%,oklch(var(--glow)/0.9),oklch(var(--primary)/0.55))]", "shadow-[0_0_0_1px_oklch(var(--tint)/0.12),0_0_18px_-6px_oklch(var(--glow)/calc(0.9*var(--glow-strength)))]", r),
|
|
555
555
|
children: e ? /* @__PURE__ */ m("img", {
|
|
556
556
|
src: e,
|
|
557
557
|
alt: "",
|
|
@@ -586,13 +586,14 @@ function Se({ pattern: e, topoSrc: t }) {
|
|
|
586
586
|
let a = t + " " + n;
|
|
587
587
|
c.get(e) !== a && (c.set(e, a), e.style.setProperty(r, t), e.style.setProperty(i, n));
|
|
588
588
|
}, u = () => {
|
|
589
|
-
|
|
589
|
+
n = 0;
|
|
590
|
+
let e = Array.from(document.querySelectorAll(".glow-edge")), r = e.map((e) => e.getBoundingClientRect()), c = t?.getBoundingClientRect();
|
|
591
|
+
if (t && c) {
|
|
590
592
|
let e = s ? "out" : "in";
|
|
591
593
|
t.dataset.pointer !== e && (t.dataset.pointer = e);
|
|
592
594
|
let n = t.querySelector(".zen-light");
|
|
593
|
-
n && !s && l(n, `${i}px`, `${a}px`, "left", "top");
|
|
595
|
+
n && !s && l(n, `${Math.round(i - c.left)}px`, `${Math.round(a - c.top)}px`, "left", "top");
|
|
594
596
|
}
|
|
595
|
-
let e = Array.from(document.querySelectorAll(".glow-edge")), r = e.map((e) => e.getBoundingClientRect());
|
|
596
597
|
e.forEach((e, t) => {
|
|
597
598
|
let n = r[t];
|
|
598
599
|
i > n.left - 400 && i < n.right + 400 && a > n.top - 400 && a < n.bottom + 400 ? (l(e, `${Math.round(i - n.left)}px`, `${Math.round(a - n.top)}px`), o.delete(e)) : o.has(e) || (l(e, "-9999px", "-9999px"), o.add(e));
|
|
@@ -604,7 +605,7 @@ function Se({ pattern: e, topoSrc: t }) {
|
|
|
604
605
|
}, p = () => {
|
|
605
606
|
i = a = -9999, s = !0, d();
|
|
606
607
|
};
|
|
607
|
-
if (window.matchMedia?.("(hover: none), (pointer: coarse)").matches ||
|
|
608
|
+
if (window.matchMedia?.("(hover: none), (pointer: coarse)").matches || M() === "lite") return;
|
|
608
609
|
window.addEventListener("pointermove", f, { passive: !0 }), e.addEventListener("pointerleave", p);
|
|
609
610
|
let m = 0, h = () => {
|
|
610
611
|
clearTimeout(m), m = window.setTimeout(d, 120);
|
|
@@ -666,8 +667,8 @@ function Se({ pattern: e, topoSrc: t }) {
|
|
|
666
667
|
}
|
|
667
668
|
//#endregion
|
|
668
669
|
//#region packages/utils/cva.ts
|
|
669
|
-
var Ce = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e,
|
|
670
|
-
if (t?.variants == null) return
|
|
670
|
+
var Ce = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, z = (e, t) => (n) => {
|
|
671
|
+
if (t?.variants == null) return A(e, n?.class, n?.className);
|
|
671
672
|
let { variants: r, defaultVariants: i } = t, a = Object.keys(r).map((e) => {
|
|
672
673
|
let t = n?.[e], a = i?.[e];
|
|
673
674
|
if (t === null) return null;
|
|
@@ -684,20 +685,20 @@ var Ce = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, we = (e, t)
|
|
|
684
685
|
t,
|
|
685
686
|
n
|
|
686
687
|
] : e, []);
|
|
687
|
-
return
|
|
688
|
+
return A(e, a, s, n?.class, n?.className);
|
|
688
689
|
};
|
|
689
690
|
//#endregion
|
|
690
691
|
//#region packages/badge/index.tsx
|
|
691
|
-
function
|
|
692
|
+
function B({ variant: e, className: t, ...n }) {
|
|
692
693
|
return /* @__PURE__ */ m("span", {
|
|
693
694
|
...n,
|
|
694
|
-
className:
|
|
695
|
+
className: we({
|
|
695
696
|
variant: e,
|
|
696
697
|
className: t
|
|
697
698
|
})
|
|
698
699
|
});
|
|
699
700
|
}
|
|
700
|
-
var
|
|
701
|
+
var we = z("zen__badge inline-flex items-center rounded-md border px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wider uppercase whitespace-nowrap focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-glow/50", {
|
|
701
702
|
variants: { variant: {
|
|
702
703
|
default: "border-glow/30 bg-glow/10 text-primary",
|
|
703
704
|
secondary: "border-tint/10 bg-tint/[0.06] text-foreground",
|
|
@@ -708,29 +709,31 @@ var Te = we("zen__badge inline-flex items-center rounded-md border px-1.5 py-0.5
|
|
|
708
709
|
});
|
|
709
710
|
//#endregion
|
|
710
711
|
//#region packages/spinner/index.tsx
|
|
711
|
-
function
|
|
712
|
+
function Te({ label: e, className: t }) {
|
|
712
713
|
return /* @__PURE__ */ m("span", {
|
|
713
|
-
"
|
|
714
|
-
|
|
714
|
+
role: e ? "status" : void 0,
|
|
715
|
+
"aria-label": e,
|
|
716
|
+
"aria-hidden": !e || void 0,
|
|
717
|
+
className: A("zen__spinner inline-block size-4 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent", t)
|
|
715
718
|
});
|
|
716
719
|
}
|
|
717
720
|
//#endregion
|
|
718
721
|
//#region packages/button/index.tsx
|
|
719
|
-
function
|
|
722
|
+
function V({ className: e, variant: t, size: n, loading: r = !1, disabled: i, type: a = "button", children: o, ...s }) {
|
|
720
723
|
return /* @__PURE__ */ h("button", {
|
|
721
724
|
type: a,
|
|
722
725
|
disabled: i || r,
|
|
723
726
|
"aria-busy": r || void 0,
|
|
724
|
-
className:
|
|
727
|
+
className: Ee({
|
|
725
728
|
variant: t,
|
|
726
729
|
size: n,
|
|
727
730
|
className: e
|
|
728
731
|
}),
|
|
729
732
|
...s,
|
|
730
|
-
children: [r && /* @__PURE__ */ m(
|
|
733
|
+
children: [r && /* @__PURE__ */ m(Te, {}), o]
|
|
731
734
|
});
|
|
732
735
|
}
|
|
733
|
-
var
|
|
736
|
+
var Ee = z("zen__button inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium whitespace-nowrap outline-hidden select-none transition-[background-color,border-color,box-shadow,color,transform] duration-200 ease-out active:scale-[0.97] focus-visible:ring-2 focus-visible:ring-glow/50 disabled:pointer-events-none disabled:opacity-50", {
|
|
734
737
|
variants: {
|
|
735
738
|
variant: {
|
|
736
739
|
default: "bg-primary bg-[linear-gradient(to_bottom,oklch(1_0_0/0.16),transparent)] text-primary-foreground shadow-[0_0_0_1px_oklch(var(--glow)/0.55),0_0_22px_-6px_oklch(var(--glow)/0.7),inset_0_1px_0_hsl(0_0%_100%/0.3)] hover:shadow-[0_0_0_1px_oklch(var(--glow)/0.8),0_0_28px_-4px_oklch(var(--glow)/0.85),inset_0_1px_0_hsl(0_0%_100%/0.35)]",
|
|
@@ -755,9 +758,9 @@ var De = we("zen__button inline-flex items-center justify-center gap-2 rounded-l
|
|
|
755
758
|
});
|
|
756
759
|
//#endregion
|
|
757
760
|
//#region packages/card/index.tsx
|
|
758
|
-
function
|
|
761
|
+
function De({ title: e, action: t, children: n, className: r, ...i }) {
|
|
759
762
|
return /* @__PURE__ */ h("section", {
|
|
760
|
-
className:
|
|
763
|
+
className: A("zen__card glass glow-edge text-card-foreground rounded-xl p-4 md:p-5", r),
|
|
761
764
|
...i,
|
|
762
765
|
children: [(e || t) && /* @__PURE__ */ h("header", {
|
|
763
766
|
className: "mb-4 flex items-center justify-between gap-4",
|
|
@@ -768,16 +771,16 @@ function Oe({ title: e, action: t, children: n, className: r, ...i }) {
|
|
|
768
771
|
}), n]
|
|
769
772
|
});
|
|
770
773
|
}
|
|
771
|
-
function
|
|
774
|
+
function Oe({ label: e, value: t, hint: n, tone: r = "default", className: i }) {
|
|
772
775
|
return /* @__PURE__ */ h("div", {
|
|
773
|
-
className:
|
|
776
|
+
className: A("zen__stat glass glow-edge flex flex-col gap-1 rounded-xl p-3.5 md:p-4", i),
|
|
774
777
|
children: [
|
|
775
778
|
/* @__PURE__ */ m("span", {
|
|
776
779
|
className: "text-muted-foreground truncate text-[0.68rem] tracking-[0.1em] uppercase sm:text-xs",
|
|
777
780
|
children: e
|
|
778
781
|
}),
|
|
779
782
|
/* @__PURE__ */ m("span", {
|
|
780
|
-
className:
|
|
783
|
+
className: A("truncate text-lg font-semibold tracking-tight tabular-nums sm:text-xl md:text-2xl", r === "positive" && "text-primary text-glow", r === "negative" && "text-destructive"),
|
|
781
784
|
children: t
|
|
782
785
|
}),
|
|
783
786
|
n && /* @__PURE__ */ m("span", {
|
|
@@ -787,22 +790,22 @@ function ke({ label: e, value: t, hint: n, tone: r = "default", className: i })
|
|
|
787
790
|
]
|
|
788
791
|
});
|
|
789
792
|
}
|
|
790
|
-
function
|
|
793
|
+
function ke({ children: e, className: t }) {
|
|
791
794
|
return /* @__PURE__ */ m("div", {
|
|
792
|
-
className:
|
|
795
|
+
className: A("grid grid-cols-2 gap-3 sm:grid-cols-3 md:gap-4 [&>*]:min-w-0", "[&>*:last-child:nth-child(odd)]:col-span-2 sm:[&>*:last-child:nth-child(odd)]:col-span-1", t),
|
|
793
796
|
children: e
|
|
794
797
|
});
|
|
795
798
|
}
|
|
796
799
|
//#endregion
|
|
797
800
|
//#region packages/code-block/index.tsx
|
|
798
|
-
function
|
|
801
|
+
function Ae({ code: e, language: t, highlight: n, copyable: r = !0, variant: i = "glass", className: a, ...s }) {
|
|
799
802
|
let c = e.trim(), [l, u] = d(!1);
|
|
800
803
|
return o(() => {
|
|
801
804
|
if (!l) return;
|
|
802
805
|
let e = setTimeout(() => u(!1), 1500);
|
|
803
806
|
return () => clearTimeout(e);
|
|
804
807
|
}, [l]), /* @__PURE__ */ h("div", {
|
|
805
|
-
className:
|
|
808
|
+
className: A("zen__code-block group relative", i === "glass" && "glass glow-edge overflow-hidden rounded-xl", a),
|
|
806
809
|
"data-language": t,
|
|
807
810
|
...s,
|
|
808
811
|
children: [/* @__PURE__ */ m("pre", {
|
|
@@ -819,19 +822,19 @@ function je({ code: e, language: t, highlight: n, copyable: r = !0, variant: i =
|
|
|
819
822
|
onClick: async () => {
|
|
820
823
|
await navigator.clipboard?.writeText(c), u(!0);
|
|
821
824
|
},
|
|
822
|
-
className:
|
|
825
|
+
className: A("text-muted-foreground hover:bg-tint/[0.07] hover:text-foreground focus-visible:ring-ring/50 absolute top-2.5 right-2.5 rounded-lg px-2.5 py-1 text-xs font-medium outline-hidden transition-[opacity,background-color,color] focus-visible:ring-2", "opacity-0 group-hover:opacity-100 focus-visible:opacity-100", l && "text-primary opacity-100"),
|
|
823
826
|
children: l ? "Copied" : "Copy"
|
|
824
827
|
})]
|
|
825
828
|
});
|
|
826
829
|
}
|
|
827
830
|
//#endregion
|
|
828
831
|
//#region packages/utils/styles.ts
|
|
829
|
-
var
|
|
832
|
+
var H = "h-10 rounded-lg border border-tint/10 bg-tint/[0.035] px-3 text-sm text-foreground shadow-[inset_0_1px_0_hsl(0_0%_100%/0.04)] transition-[border-color,background-color,box-shadow] duration-200 placeholder:text-muted-foreground hover:border-tint/20 focus-visible:border-glow/60 focus-visible:bg-tint/[0.05] focus-visible:shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)] focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50", U = A(H, "inline-flex items-center justify-between gap-2 whitespace-nowrap"), W = "glass glass-blur rounded-xl text-foreground shadow-[var(--popup-shadow),0_0_40px_-20px_oklch(var(--glow)/0.5)] outline-hidden", je = "relative flex w-fit items-center gap-1 rounded-full border border-tint/5 bg-tint/[0.03] p-1", Me = "absolute top-1 bottom-1 left-0 rounded-full bg-primary/15 shadow-[inset_0_0_0_1px_oklch(var(--glow)/0.35),0_0_24px_-4px_oklch(var(--glow)/0.6)] transition-[translate,width] duration-500 ease-[cubic-bezier(0.2,0.8,0.2,1)]", Ne = "relative z-10 rounded-full px-3.5 py-1.5 text-sm whitespace-nowrap outline-hidden transition-colors duration-300 select-none focus-visible:ring-2 focus-visible:ring-ring/40", Pe = "flex w-full items-center gap-1.5 h-10 rounded-lg border border-tint/10 bg-tint/[0.035] px-3 text-sm text-foreground shadow-[inset_0_1px_0_hsl(0_0%_100%/0.04)] transition-[border-color,background-color,box-shadow] duration-200 placeholder:text-muted-foreground hover:border-tint/20 focus-within:border-glow/60 focus-within:bg-tint/[0.05] focus-within:shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)] focus-within:outline-hidden disabled:cursor-not-allowed disabled:opacity-50";
|
|
830
833
|
//#endregion
|
|
831
834
|
//#region packages/popover/index.tsx
|
|
832
|
-
function
|
|
835
|
+
function G(e) {
|
|
833
836
|
let { className: t, content: n, children: r, role: i = "tooltip", triggerType: a = "auto", trigger: c = "click", gap: l = "5px", triggerClassName: f, show: p, setShow: g, style: _, onOpen: v, onClose: y, ...b } = e, x = s().replace(/[^\w-]/g, "");
|
|
834
|
-
|
|
837
|
+
N();
|
|
835
838
|
let [S, C] = d(!1), w = u(null);
|
|
836
839
|
return o(() => {
|
|
837
840
|
let e = w.current;
|
|
@@ -845,7 +848,7 @@ function W(e) {
|
|
|
845
848
|
a === "manual" && (p ? w.current?.showPopover?.() : w.current?.hidePopover?.());
|
|
846
849
|
}, [p, a]), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
847
850
|
"aria-expanded": S,
|
|
848
|
-
className:
|
|
851
|
+
className: A("max-w-fit min-w-fit", f),
|
|
849
852
|
style: { anchorName: `--zen-popover-anchor-${x}` },
|
|
850
853
|
popoverTarget: `zen__popover-${x}`,
|
|
851
854
|
popoverTargetAction: "toggle",
|
|
@@ -870,7 +873,7 @@ function W(e) {
|
|
|
870
873
|
role: i,
|
|
871
874
|
popover: a,
|
|
872
875
|
id: `zen__popover-${x}`,
|
|
873
|
-
className:
|
|
876
|
+
className: A("zen__popover fixed z-50 w-[anchor-size(width)] min-w-max [justify-self:anchor-center] overflow-visible p-0 [position-area:block-end_center]", W, t),
|
|
874
877
|
style: {
|
|
875
878
|
..._,
|
|
876
879
|
"--gap": l,
|
|
@@ -883,7 +886,7 @@ function W(e) {
|
|
|
883
886
|
}
|
|
884
887
|
//#endregion
|
|
885
888
|
//#region packages/collapse/index.tsx
|
|
886
|
-
function
|
|
889
|
+
function Fe(e) {
|
|
887
890
|
let { items: t = [], children: n, moreItemsLabel: r = "", parentRef: i, data: a, estimator: s = (e, t) => t + 30, font: c = "12px Inter", badgeVariant: u = "secondary", badgeStyles: f } = e, [g, _] = d({
|
|
888
891
|
visible: t,
|
|
889
892
|
hidden: []
|
|
@@ -918,15 +921,15 @@ function Ie(e) {
|
|
|
918
921
|
return e.observe(i.current), () => {
|
|
919
922
|
e.disconnect();
|
|
920
923
|
};
|
|
921
|
-
}, [t]), /* @__PURE__ */ h(p, { children: [g.visible?.map((e, t) => n(e, t, a?.[t])), g.hidden?.length > 0 && /* @__PURE__ */ m(
|
|
924
|
+
}, [t]), /* @__PURE__ */ h(p, { children: [g.visible?.map((e, t) => n(e, t, a?.[t])), g.hidden?.length > 0 && /* @__PURE__ */ m(G, {
|
|
922
925
|
trigger: "click",
|
|
923
926
|
triggerClassName: "flex rounded-md",
|
|
924
927
|
content: /* @__PURE__ */ m("div", {
|
|
925
928
|
className: "grid max-h-60 grid-flow-row grid-cols-2 gap-3 overflow-auto p-2",
|
|
926
929
|
children: g.hidden.map((e, t) => n(e, g.visible.length + t, a?.[g.visible.length + t]))
|
|
927
930
|
}),
|
|
928
|
-
children: /* @__PURE__ */ m(
|
|
929
|
-
className:
|
|
931
|
+
children: /* @__PURE__ */ m(B, {
|
|
932
|
+
className: A("cursor-pointer", f),
|
|
930
933
|
variant: u,
|
|
931
934
|
"aria-label": `Show ${g.hidden.length} more ${r}`,
|
|
932
935
|
children: /* @__PURE__ */ m("span", { children: `+${g.hidden.length} ${r}` })
|
|
@@ -934,9 +937,225 @@ function Ie(e) {
|
|
|
934
937
|
})] });
|
|
935
938
|
}
|
|
936
939
|
//#endregion
|
|
940
|
+
//#region packages/utils/status-icons.tsx
|
|
941
|
+
function K({ className: e }) {
|
|
942
|
+
return /* @__PURE__ */ m("svg", {
|
|
943
|
+
viewBox: "0 0 16 16",
|
|
944
|
+
fill: "none",
|
|
945
|
+
stroke: "currentColor",
|
|
946
|
+
strokeWidth: "2",
|
|
947
|
+
strokeLinecap: "round",
|
|
948
|
+
strokeLinejoin: "round",
|
|
949
|
+
className: A("size-3.5", e),
|
|
950
|
+
"aria-hidden": !0,
|
|
951
|
+
children: /* @__PURE__ */ m("path", { d: "m3.5 8.5 3 3 6-7" })
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
function q({ className: e }) {
|
|
955
|
+
return /* @__PURE__ */ h("svg", {
|
|
956
|
+
viewBox: "0 0 16 16",
|
|
957
|
+
fill: "none",
|
|
958
|
+
stroke: "currentColor",
|
|
959
|
+
strokeWidth: "1.8",
|
|
960
|
+
strokeLinecap: "round",
|
|
961
|
+
strokeLinejoin: "round",
|
|
962
|
+
className: A("size-3.5", e),
|
|
963
|
+
"aria-hidden": !0,
|
|
964
|
+
children: [/* @__PURE__ */ m("path", { d: "M8 2.2 1.6 13.3h12.8L8 2.2Z" }), /* @__PURE__ */ m("path", { d: "M8 6.5v3M8 11.6v.1" })]
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
function J({ className: e }) {
|
|
968
|
+
return /* @__PURE__ */ h("svg", {
|
|
969
|
+
viewBox: "0 0 16 16",
|
|
970
|
+
fill: "none",
|
|
971
|
+
stroke: "currentColor",
|
|
972
|
+
strokeWidth: "1.8",
|
|
973
|
+
strokeLinecap: "round",
|
|
974
|
+
className: A("size-3.5", e),
|
|
975
|
+
"aria-hidden": !0,
|
|
976
|
+
children: [/* @__PURE__ */ m("circle", {
|
|
977
|
+
cx: "8",
|
|
978
|
+
cy: "8",
|
|
979
|
+
r: "6.3"
|
|
980
|
+
}), /* @__PURE__ */ m("path", { d: "M8 7.3v3.8M8 4.9v.1" })]
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
//#endregion
|
|
984
|
+
//#region packages/toast/index.tsx
|
|
985
|
+
var Ie = 5e3, Le = 300, Re = n(null), ze = n(null);
|
|
986
|
+
function Be({ children: e, offset: t, viewportClassName: n }) {
|
|
987
|
+
N();
|
|
988
|
+
let [r, a] = d([]), s = u(0), c = u(/* @__PURE__ */ new Map()), l = u(/* @__PURE__ */ new Set()), [f, p] = d([]), [_, v] = d(!1);
|
|
989
|
+
o(() => v(!0), []);
|
|
990
|
+
let y = i((e) => (p((t) => [...t, e]), () => p((t) => t.filter((t) => t !== e))), []), b = f.at(-1) ?? (_ ? document.body : null), x = i((e) => {
|
|
991
|
+
a((t) => t.map((t) => t.id === e ? {
|
|
992
|
+
...t,
|
|
993
|
+
leaving: !0
|
|
994
|
+
} : t)), setTimeout(() => {
|
|
995
|
+
a((t) => t.filter((t) => t.id !== e)), c.current.delete(e), l.current.delete(e);
|
|
996
|
+
}, Le);
|
|
997
|
+
}, []), S = i((e, { description: t, tone: n = "info", action: r, timeout: i } = {}) => {
|
|
998
|
+
let o = s.current++, c = {
|
|
999
|
+
id: o,
|
|
1000
|
+
title: e,
|
|
1001
|
+
description: t,
|
|
1002
|
+
tone: n,
|
|
1003
|
+
action: r,
|
|
1004
|
+
timeout: i ?? (r ? 1e4 : Ie)
|
|
1005
|
+
};
|
|
1006
|
+
return a((e) => [...e, c]), o;
|
|
1007
|
+
}, []), C = r.slice(-3);
|
|
1008
|
+
return /* @__PURE__ */ h(Re.Provider, {
|
|
1009
|
+
value: S,
|
|
1010
|
+
children: [/* @__PURE__ */ m(ze.Provider, {
|
|
1011
|
+
value: y,
|
|
1012
|
+
children: e
|
|
1013
|
+
}), b && g(/* @__PURE__ */ m("section", {
|
|
1014
|
+
ref: He,
|
|
1015
|
+
popover: "manual",
|
|
1016
|
+
"aria-label": "Notifications",
|
|
1017
|
+
className: A("zen__toast-viewport fixed top-auto right-4 bottom-[calc(var(--zen-toast-offset,1rem)+env(safe-area-inset-bottom))] left-auto z-50 m-0 flex w-[calc(100vw-2rem)] flex-col-reverse gap-2.5 overflow-visible border-0 bg-transparent p-0 text-inherit md:bottom-5 md:w-[24rem]", n),
|
|
1018
|
+
style: t ? { "--zen-toast-offset": t } : void 0,
|
|
1019
|
+
children: C.map((e) => /* @__PURE__ */ m(Ge, {
|
|
1020
|
+
toast: e,
|
|
1021
|
+
onDismiss: () => x(e.id),
|
|
1022
|
+
clocks: c.current,
|
|
1023
|
+
entered: l.current
|
|
1024
|
+
}, e.id))
|
|
1025
|
+
}), b)]
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
function Ve(e, t) {
|
|
1029
|
+
let n = a(ze);
|
|
1030
|
+
o(() => {
|
|
1031
|
+
let r = e.current;
|
|
1032
|
+
if (n && t && r) return n(r);
|
|
1033
|
+
}, [
|
|
1034
|
+
n,
|
|
1035
|
+
t,
|
|
1036
|
+
e
|
|
1037
|
+
]);
|
|
1038
|
+
}
|
|
1039
|
+
function He(e) {
|
|
1040
|
+
if (e?.showPopover) try {
|
|
1041
|
+
e.showPopover();
|
|
1042
|
+
} catch {}
|
|
1043
|
+
}
|
|
1044
|
+
function Ue() {
|
|
1045
|
+
let e = a(Re);
|
|
1046
|
+
if (!e) throw Error("useToast() needs a <ToastProvider> above it");
|
|
1047
|
+
return e;
|
|
1048
|
+
}
|
|
1049
|
+
var We = {
|
|
1050
|
+
success: {
|
|
1051
|
+
icon: K,
|
|
1052
|
+
ring: "border-primary/30",
|
|
1053
|
+
badge: "bg-primary/15 text-primary",
|
|
1054
|
+
bar: "bg-primary",
|
|
1055
|
+
glow: "shadow-[0_18px_50px_-18px_oklch(var(--glow)/0.55)]"
|
|
1056
|
+
},
|
|
1057
|
+
error: {
|
|
1058
|
+
icon: q,
|
|
1059
|
+
ring: "border-destructive/40",
|
|
1060
|
+
badge: "bg-destructive/15 text-destructive",
|
|
1061
|
+
bar: "bg-destructive",
|
|
1062
|
+
glow: "shadow-[0_18px_50px_-18px_oklch(var(--destructive)/0.55)]"
|
|
1063
|
+
},
|
|
1064
|
+
info: {
|
|
1065
|
+
icon: J,
|
|
1066
|
+
ring: "border-tint/10",
|
|
1067
|
+
badge: "bg-tint/[0.08] text-foreground",
|
|
1068
|
+
bar: "bg-muted-foreground",
|
|
1069
|
+
glow: "shadow-[var(--toast-shadow)]"
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
function Ge({ toast: e, onDismiss: t, clocks: n, entered: r }) {
|
|
1073
|
+
let i = We[e.tone] ?? We.info, a = i.icon, [s, c] = d(!1), l = u(null), [f] = d(() => !r.has(e.id));
|
|
1074
|
+
o(() => {
|
|
1075
|
+
l.current?.isConnected && r.add(e.id);
|
|
1076
|
+
}, [r, e.id]), n.has(e.id) || n.set(e.id, {
|
|
1077
|
+
spent: 0,
|
|
1078
|
+
since: null
|
|
1079
|
+
});
|
|
1080
|
+
let p = n.get(e.id), g = p.spent + (p.since === null ? 0 : Date.now() - p.since);
|
|
1081
|
+
return o(() => {
|
|
1082
|
+
if (!e.timeout || s || e.leaving) return;
|
|
1083
|
+
p.since = Date.now();
|
|
1084
|
+
let n = setTimeout(t, Math.max(0, e.timeout - p.spent));
|
|
1085
|
+
return () => {
|
|
1086
|
+
clearTimeout(n), p.since !== null && (p.spent += Date.now() - p.since), p.since = null;
|
|
1087
|
+
};
|
|
1088
|
+
}, [
|
|
1089
|
+
s,
|
|
1090
|
+
e.timeout,
|
|
1091
|
+
e.leaving,
|
|
1092
|
+
t,
|
|
1093
|
+
p
|
|
1094
|
+
]), /* @__PURE__ */ h("div", {
|
|
1095
|
+
ref: l,
|
|
1096
|
+
role: e.tone === "error" ? "alert" : "status",
|
|
1097
|
+
"aria-atomic": "true",
|
|
1098
|
+
onMouseEnter: () => c(!0),
|
|
1099
|
+
onMouseLeave: () => c(!1),
|
|
1100
|
+
className: A("zen__toast group glass glass-blur text-card-foreground relative flex items-start gap-3 overflow-hidden rounded-2xl border p-3.5 pr-10 select-none", "transition-[transform,opacity] duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)]", f && "starting:translate-y-3 starting:scale-[0.97] starting:opacity-0", e.leaving && "translate-x-6 opacity-0", i.ring, i.glow),
|
|
1101
|
+
children: [
|
|
1102
|
+
/* @__PURE__ */ m("span", {
|
|
1103
|
+
className: A("mt-0.5 grid size-8 shrink-0 place-items-center rounded-full", i.badge),
|
|
1104
|
+
"aria-hidden": !0,
|
|
1105
|
+
children: /* @__PURE__ */ m(a, { className: "size-4" })
|
|
1106
|
+
}),
|
|
1107
|
+
/* @__PURE__ */ h("div", {
|
|
1108
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5 pt-0.5",
|
|
1109
|
+
children: [
|
|
1110
|
+
/* @__PURE__ */ m("div", {
|
|
1111
|
+
className: "text-sm font-semibold",
|
|
1112
|
+
children: e.title
|
|
1113
|
+
}),
|
|
1114
|
+
e.description && /* @__PURE__ */ m("div", {
|
|
1115
|
+
className: "text-muted-foreground text-sm leading-5",
|
|
1116
|
+
children: e.description
|
|
1117
|
+
}),
|
|
1118
|
+
e.action && /* @__PURE__ */ m("button", {
|
|
1119
|
+
type: "button",
|
|
1120
|
+
onClick: () => {
|
|
1121
|
+
e.action?.onClick(), t();
|
|
1122
|
+
},
|
|
1123
|
+
className: "border-tint/10 bg-tint/[0.06] hover:bg-tint/[0.12] focus-visible:ring-ring/50 mt-2 self-start rounded-lg border px-3 py-1 text-xs font-medium outline-hidden transition-colors focus-visible:ring-2",
|
|
1124
|
+
children: e.action.label
|
|
1125
|
+
})
|
|
1126
|
+
]
|
|
1127
|
+
}),
|
|
1128
|
+
/* @__PURE__ */ m("button", {
|
|
1129
|
+
type: "button",
|
|
1130
|
+
"aria-label": "Dismiss",
|
|
1131
|
+
onClick: t,
|
|
1132
|
+
className: "text-muted-foreground hover:bg-tint/[0.07] hover:text-foreground focus-visible:ring-ring/50 absolute top-2.5 right-2.5 grid size-7 place-items-center rounded-lg outline-hidden transition-colors focus-visible:ring-2",
|
|
1133
|
+
children: /* @__PURE__ */ m("svg", {
|
|
1134
|
+
viewBox: "0 0 16 16",
|
|
1135
|
+
fill: "none",
|
|
1136
|
+
stroke: "currentColor",
|
|
1137
|
+
strokeWidth: "1.8",
|
|
1138
|
+
strokeLinecap: "round",
|
|
1139
|
+
className: "size-3.5",
|
|
1140
|
+
"aria-hidden": !0,
|
|
1141
|
+
children: /* @__PURE__ */ m("path", { d: "m4 4 8 8M12 4l-8 8" })
|
|
1142
|
+
})
|
|
1143
|
+
}),
|
|
1144
|
+
e.timeout > 0 && /* @__PURE__ */ m("span", {
|
|
1145
|
+
"aria-hidden": !0,
|
|
1146
|
+
className: A("zen__toast-timer absolute bottom-0 left-0 h-0.5 w-full origin-left opacity-60 group-hover:[animation-play-state:paused]", i.bar),
|
|
1147
|
+
style: {
|
|
1148
|
+
animationDuration: `${e.timeout}ms`,
|
|
1149
|
+
animationDelay: `${-g}ms`
|
|
1150
|
+
}
|
|
1151
|
+
})
|
|
1152
|
+
]
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
//#endregion
|
|
937
1156
|
//#region packages/dialog/index.tsx
|
|
938
|
-
function
|
|
939
|
-
|
|
1157
|
+
function Ke({ open: e, onOpenChange: t, title: n, description: r, children: i, dismissible: a = !0, initialFocus: c, size: l = "md", className: d, role: f }) {
|
|
1158
|
+
N();
|
|
940
1159
|
let p = u(null), g = s(), _ = s();
|
|
941
1160
|
return o(() => {
|
|
942
1161
|
let t = p.current;
|
|
@@ -946,12 +1165,12 @@ function Le({ open: e, onOpenChange: t, title: n, description: r, children: i, d
|
|
|
946
1165
|
e.toggleAttribute("data-zen-scrollbar", window.innerWidth > e.clientWidth), t.showModal(), c?.current?.focus();
|
|
947
1166
|
} else !e && t.open && t.close();
|
|
948
1167
|
}
|
|
949
|
-
}, [e, c]), /* @__PURE__ */ m("dialog", {
|
|
1168
|
+
}, [e, c]), Ve(p, e), /* @__PURE__ */ m("dialog", {
|
|
950
1169
|
ref: p,
|
|
951
1170
|
role: f,
|
|
952
1171
|
"aria-labelledby": g,
|
|
953
1172
|
"aria-describedby": r ? _ : void 0,
|
|
954
|
-
className:
|
|
1173
|
+
className: A("zen__dialog glass glass-blur glow-edge text-card-foreground", "bg-card/90! m-auto max-h-[calc(100dvh-2rem)] max-w-[calc(100vw-2rem)] overflow-visible rounded-xl p-0", l === "lg" ? "w-[60rem]" : "w-[28rem]", "backdrop:bg-black/50 backdrop:backdrop-blur-sm pointer-coarse:backdrop:backdrop-blur-none", d),
|
|
955
1174
|
onCancel: (e) => {
|
|
956
1175
|
e.preventDefault(), a && t?.(!1);
|
|
957
1176
|
},
|
|
@@ -977,8 +1196,8 @@ function Le({ open: e, onOpenChange: t, title: n, description: r, children: i, d
|
|
|
977
1196
|
}
|
|
978
1197
|
//#endregion
|
|
979
1198
|
//#region packages/confirm-dialog/index.tsx
|
|
980
|
-
function
|
|
981
|
-
return /* @__PURE__ */ m(
|
|
1199
|
+
function qe({ open: e, onOpenChange: t, title: n, description: r, confirmLabel: i, cancelLabel: a = "Cancel", destructive: o = !1, onConfirm: s }) {
|
|
1200
|
+
return /* @__PURE__ */ m(Ke, {
|
|
982
1201
|
role: "alertdialog",
|
|
983
1202
|
open: e,
|
|
984
1203
|
onOpenChange: t,
|
|
@@ -987,12 +1206,12 @@ function Re({ open: e, onOpenChange: t, title: n, description: r, confirmLabel:
|
|
|
987
1206
|
className: "w-[26rem]",
|
|
988
1207
|
children: /* @__PURE__ */ h("div", {
|
|
989
1208
|
className: "flex justify-end gap-2",
|
|
990
|
-
children: [/* @__PURE__ */ m(
|
|
1209
|
+
children: [/* @__PURE__ */ m(V, {
|
|
991
1210
|
variant: "outline",
|
|
992
1211
|
autoFocus: !0,
|
|
993
1212
|
onClick: () => t(!1),
|
|
994
1213
|
children: a
|
|
995
|
-
}), /* @__PURE__ */ m(
|
|
1214
|
+
}), /* @__PURE__ */ m(V, {
|
|
996
1215
|
variant: o ? "destructive" : "default",
|
|
997
1216
|
onClick: () => {
|
|
998
1217
|
s(), t(!1);
|
|
@@ -1004,73 +1223,29 @@ function Re({ open: e, onOpenChange: t, title: n, description: r, confirmLabel:
|
|
|
1004
1223
|
}
|
|
1005
1224
|
//#endregion
|
|
1006
1225
|
//#region packages/editable-cell/index.tsx
|
|
1007
|
-
function
|
|
1226
|
+
function Je({ children: e, editor: t, label: n, readOnly: r = !1, editing: i, onEditingChange: a, title: o, className: s }) {
|
|
1008
1227
|
let [c, l] = d(!1), u = i ?? c, f = (e) => {
|
|
1009
1228
|
i === void 0 && l(e), a?.(e);
|
|
1010
1229
|
};
|
|
1011
1230
|
return r ? /* @__PURE__ */ m("span", {
|
|
1012
1231
|
title: o,
|
|
1013
|
-
className:
|
|
1232
|
+
className: A("zen__editable-cell block px-1 text-right tabular-nums", s),
|
|
1014
1233
|
children: e
|
|
1015
1234
|
}) : u ? /* @__PURE__ */ m(p, { children: t(() => f(!1)) }) : /* @__PURE__ */ m("button", {
|
|
1016
1235
|
type: "button",
|
|
1017
1236
|
title: o,
|
|
1018
1237
|
"aria-label": n ? `${n}. Edit` : void 0,
|
|
1019
1238
|
onClick: () => f(!0),
|
|
1020
|
-
className:
|
|
1239
|
+
className: A("zen__editable-cell hover:bg-primary/10 focus-visible:ring-ring/50 w-full rounded-md px-1.5 py-0.5 text-right tabular-nums transition-colors focus-visible:ring-2 focus-visible:outline-hidden", s),
|
|
1021
1240
|
children: e
|
|
1022
1241
|
});
|
|
1023
1242
|
}
|
|
1024
1243
|
//#endregion
|
|
1025
|
-
//#region packages/utils/status-icons.tsx
|
|
1026
|
-
function G({ className: e }) {
|
|
1027
|
-
return /* @__PURE__ */ m("svg", {
|
|
1028
|
-
viewBox: "0 0 16 16",
|
|
1029
|
-
fill: "none",
|
|
1030
|
-
stroke: "currentColor",
|
|
1031
|
-
strokeWidth: "2",
|
|
1032
|
-
strokeLinecap: "round",
|
|
1033
|
-
strokeLinejoin: "round",
|
|
1034
|
-
className: k("size-3.5", e),
|
|
1035
|
-
"aria-hidden": !0,
|
|
1036
|
-
children: /* @__PURE__ */ m("path", { d: "m3.5 8.5 3 3 6-7" })
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
function K({ className: e }) {
|
|
1040
|
-
return /* @__PURE__ */ h("svg", {
|
|
1041
|
-
viewBox: "0 0 16 16",
|
|
1042
|
-
fill: "none",
|
|
1043
|
-
stroke: "currentColor",
|
|
1044
|
-
strokeWidth: "1.8",
|
|
1045
|
-
strokeLinecap: "round",
|
|
1046
|
-
strokeLinejoin: "round",
|
|
1047
|
-
className: k("size-3.5", e),
|
|
1048
|
-
"aria-hidden": !0,
|
|
1049
|
-
children: [/* @__PURE__ */ m("path", { d: "M8 2.2 1.6 13.3h12.8L8 2.2Z" }), /* @__PURE__ */ m("path", { d: "M8 6.5v3M8 11.6v.1" })]
|
|
1050
|
-
});
|
|
1051
|
-
}
|
|
1052
|
-
function q({ className: e }) {
|
|
1053
|
-
return /* @__PURE__ */ h("svg", {
|
|
1054
|
-
viewBox: "0 0 16 16",
|
|
1055
|
-
fill: "none",
|
|
1056
|
-
stroke: "currentColor",
|
|
1057
|
-
strokeWidth: "1.8",
|
|
1058
|
-
strokeLinecap: "round",
|
|
1059
|
-
className: k("size-3.5", e),
|
|
1060
|
-
"aria-hidden": !0,
|
|
1061
|
-
children: [/* @__PURE__ */ m("circle", {
|
|
1062
|
-
cx: "8",
|
|
1063
|
-
cy: "8",
|
|
1064
|
-
r: "6.3"
|
|
1065
|
-
}), /* @__PURE__ */ m("path", { d: "M8 7.3v3.8M8 4.9v.1" })]
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
//#endregion
|
|
1069
1244
|
//#region packages/field/index.tsx
|
|
1070
|
-
function
|
|
1071
|
-
let c = s(), l = r(a) ? a : null, u = l?.props.id ?? `${c}-control`, d = n ? `${c}-hint` : void 0, f = i ? `${c}-error` : void 0, p =
|
|
1245
|
+
function Ye({ label: e, hint: n, error: i, children: a, className: o }) {
|
|
1246
|
+
let c = s(), l = r(a) ? a : null, u = l?.props.id ?? `${c}-control`, d = n ? `${c}-hint` : void 0, f = i ? `${c}-error` : void 0, p = A(l?.props["aria-describedby"], d, f).trim() || void 0;
|
|
1072
1247
|
return /* @__PURE__ */ h("div", {
|
|
1073
|
-
className:
|
|
1248
|
+
className: A("zen__field flex flex-col gap-2", o),
|
|
1074
1249
|
children: [
|
|
1075
1250
|
/* @__PURE__ */ m("label", {
|
|
1076
1251
|
htmlFor: u,
|
|
@@ -1091,22 +1266,22 @@ function Be({ label: e, hint: n, error: i, children: a, className: o }) {
|
|
|
1091
1266
|
id: f,
|
|
1092
1267
|
role: "alert",
|
|
1093
1268
|
className: "text-destructive mt-0! flex items-center gap-1.5 text-xs font-medium",
|
|
1094
|
-
children: [/* @__PURE__ */ m(
|
|
1269
|
+
children: [/* @__PURE__ */ m(q, { className: "shrink-0" }), i]
|
|
1095
1270
|
})
|
|
1096
1271
|
]
|
|
1097
1272
|
});
|
|
1098
1273
|
}
|
|
1099
|
-
function
|
|
1100
|
-
let r = e === "error" ?
|
|
1274
|
+
function Xe({ tone: e = "info", children: t, className: n }) {
|
|
1275
|
+
let r = e === "error" ? q : e === "success" ? K : J;
|
|
1101
1276
|
return /* @__PURE__ */ h("p", {
|
|
1102
1277
|
role: e === "error" ? "alert" : "status",
|
|
1103
|
-
className:
|
|
1278
|
+
className: A("mt-0! flex items-start gap-2 text-sm", e === "error" && "border-destructive/35 bg-destructive/10 text-destructive rounded-lg border px-3 py-2", e === "success" && "border-primary/30 bg-primary/10 text-primary rounded-lg border px-3 py-2", e === "info" && "text-muted-foreground", n),
|
|
1104
1279
|
children: [/* @__PURE__ */ m(r, { className: "mt-0.5 shrink-0" }), /* @__PURE__ */ m("span", { children: t })]
|
|
1105
1280
|
});
|
|
1106
1281
|
}
|
|
1107
1282
|
//#endregion
|
|
1108
1283
|
//#region packages/icons/search.tsx
|
|
1109
|
-
function
|
|
1284
|
+
function Ze(e) {
|
|
1110
1285
|
return /* @__PURE__ */ m("svg", {
|
|
1111
1286
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1112
1287
|
fill: "none",
|
|
@@ -1124,7 +1299,7 @@ function He(e) {
|
|
|
1124
1299
|
}
|
|
1125
1300
|
//#endregion
|
|
1126
1301
|
//#region packages/icons/x-mark.tsx
|
|
1127
|
-
function
|
|
1302
|
+
function Qe(e) {
|
|
1128
1303
|
return /* @__PURE__ */ m("svg", {
|
|
1129
1304
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1130
1305
|
fill: "none",
|
|
@@ -1142,10 +1317,10 @@ function Ue(e) {
|
|
|
1142
1317
|
}
|
|
1143
1318
|
//#endregion
|
|
1144
1319
|
//#region packages/input-group/index.tsx
|
|
1145
|
-
function
|
|
1320
|
+
function $e({ invalid: e, className: t, onMouseDown: n, ...r }) {
|
|
1146
1321
|
return /* @__PURE__ */ m("div", {
|
|
1147
1322
|
"data-invalid": e || void 0,
|
|
1148
|
-
className:
|
|
1323
|
+
className: A("zen__input-group cursor-text", Pe, "has-disabled:bg-muted! has-disabled:text-muted-foreground has-disabled:cursor-not-allowed", e && "border-destructive! focus-within:shadow-[0_0_0_3px_oklch(var(--destructive)/0.16)]!", t),
|
|
1149
1324
|
onMouseDown: (e) => {
|
|
1150
1325
|
n?.(e);
|
|
1151
1326
|
let t = e.target;
|
|
@@ -1156,21 +1331,21 @@ function We({ invalid: e, className: t, onMouseDown: n, ...r }) {
|
|
|
1156
1331
|
...r
|
|
1157
1332
|
});
|
|
1158
1333
|
}
|
|
1159
|
-
function
|
|
1334
|
+
function Y({ className: e, ...t }) {
|
|
1160
1335
|
return /* @__PURE__ */ m("input", {
|
|
1161
|
-
className:
|
|
1336
|
+
className: A("placeholder:text-muted-foreground h-full w-full min-w-0 flex-1 bg-transparent text-sm outline-hidden disabled:cursor-not-allowed", e),
|
|
1162
1337
|
...t
|
|
1163
1338
|
});
|
|
1164
1339
|
}
|
|
1165
|
-
function
|
|
1340
|
+
function X({ className: e, ...t }) {
|
|
1166
1341
|
return /* @__PURE__ */ m("span", {
|
|
1167
|
-
className:
|
|
1342
|
+
className: A("text-muted-foreground flex shrink-0 items-center gap-1 text-sm select-none [&_svg]:size-4", e),
|
|
1168
1343
|
...t
|
|
1169
1344
|
});
|
|
1170
1345
|
}
|
|
1171
1346
|
//#endregion
|
|
1172
1347
|
//#region packages/utils/field-chevron.tsx
|
|
1173
|
-
function
|
|
1348
|
+
function Z({ open: e, className: t }) {
|
|
1174
1349
|
return /* @__PURE__ */ m("svg", {
|
|
1175
1350
|
viewBox: "0 0 16 16",
|
|
1176
1351
|
fill: "none",
|
|
@@ -1179,13 +1354,13 @@ function X({ open: e, className: t }) {
|
|
|
1179
1354
|
strokeLinecap: "round",
|
|
1180
1355
|
strokeLinejoin: "round",
|
|
1181
1356
|
"aria-hidden": !0,
|
|
1182
|
-
className:
|
|
1357
|
+
className: A("text-muted-foreground size-4 shrink-0 transition-transform duration-300", e && "rotate-180", t),
|
|
1183
1358
|
children: /* @__PURE__ */ m("path", { d: "m4 6 4 4 4-4" })
|
|
1184
1359
|
});
|
|
1185
1360
|
}
|
|
1186
1361
|
//#endregion
|
|
1187
1362
|
//#region packages/utils/useVirtualList.ts
|
|
1188
|
-
function
|
|
1363
|
+
function et({ count: e, itemHeight: t, scrollRef: n, overscan: r = 6 }) {
|
|
1189
1364
|
let i = (n, i) => {
|
|
1190
1365
|
let a = i || t * 10;
|
|
1191
1366
|
return {
|
|
@@ -1227,12 +1402,12 @@ function Ge({ count: e, itemHeight: t, scrollRef: n, overscan: r = 6 }) {
|
|
|
1227
1402
|
}
|
|
1228
1403
|
//#endregion
|
|
1229
1404
|
//#region packages/dropdown/index.tsx
|
|
1230
|
-
function
|
|
1405
|
+
function tt(e) {
|
|
1231
1406
|
let { items: t, selected: n, className: r, onChange: i, disabled: a, placeholder: o = "Select an Item", multiple: s, mutable: c, onAdd: l } = e, f = u(null), [p, g] = d(!1), _ = !!r && /(^|\s)w-full(\s|$)/.test(r);
|
|
1232
|
-
return /* @__PURE__ */ m(
|
|
1407
|
+
return /* @__PURE__ */ m(G, {
|
|
1233
1408
|
triggerClassName: _ ? "w-full max-w-none" : void 0,
|
|
1234
1409
|
className: "min-w-0",
|
|
1235
|
-
content: /* @__PURE__ */ m(
|
|
1410
|
+
content: /* @__PURE__ */ m(nt, {
|
|
1236
1411
|
...c ? {
|
|
1237
1412
|
mutable: c,
|
|
1238
1413
|
onAdd: l
|
|
@@ -1255,40 +1430,40 @@ function Ke(e) {
|
|
|
1255
1430
|
"aria-expanded": p,
|
|
1256
1431
|
"aria-haspopup": "listbox",
|
|
1257
1432
|
onClick: (e) => e.preventDefault(),
|
|
1258
|
-
className:
|
|
1433
|
+
className: A(U, "w-56", "grow", a ? "cursor-not-allowed opacity-50" : "cursor-pointer", p && "border-glow/60 shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)]", r),
|
|
1259
1434
|
children: [/* @__PURE__ */ m("div", {
|
|
1260
|
-
className:
|
|
1435
|
+
className: A("flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm", a ? "text-muted-foreground" : "text-foreground"),
|
|
1261
1436
|
ref: f,
|
|
1262
1437
|
children: s && !n.length ? /* @__PURE__ */ m("span", {
|
|
1263
1438
|
className: "text-muted-foreground",
|
|
1264
1439
|
children: o
|
|
1265
|
-
}) : s ? /* @__PURE__ */ m(
|
|
1440
|
+
}) : s ? /* @__PURE__ */ m(Fe, {
|
|
1266
1441
|
items: n.map((e) => e.text),
|
|
1267
1442
|
data: n,
|
|
1268
1443
|
parentRef: f,
|
|
1269
1444
|
estimator: (e, t) => t + 40,
|
|
1270
1445
|
badgeVariant: "secondary",
|
|
1271
1446
|
badgeStyles: "h-6 min-w-min gap-2",
|
|
1272
|
-
children: (e, t, r) => /* @__PURE__ */ h(
|
|
1447
|
+
children: (e, t, r) => /* @__PURE__ */ h(B, {
|
|
1273
1448
|
className: "flex h-6 min-w-min gap-2 pr-1",
|
|
1274
1449
|
variant: "secondary",
|
|
1275
|
-
children: [e, /* @__PURE__ */ m(
|
|
1450
|
+
children: [e, /* @__PURE__ */ m(V, {
|
|
1276
1451
|
onClick: () => {
|
|
1277
1452
|
i(n.filter((e) => e.key !== r?.key));
|
|
1278
1453
|
},
|
|
1279
1454
|
variant: "icon",
|
|
1280
1455
|
size: "icon",
|
|
1281
1456
|
className: "group relative -top-px size-4 rounded-sm p-0.5",
|
|
1282
|
-
children: /* @__PURE__ */ m(
|
|
1457
|
+
children: /* @__PURE__ */ m(Qe, { className: "size-3 transition duration-300 group-hover:rotate-90" })
|
|
1283
1458
|
})]
|
|
1284
1459
|
}, `collapsed_item_${r?.key ?? t}`)
|
|
1285
1460
|
}) : n.text ?? o
|
|
1286
|
-
}), /* @__PURE__ */ m(
|
|
1461
|
+
}), /* @__PURE__ */ m(Z, { open: p })]
|
|
1287
1462
|
})
|
|
1288
1463
|
});
|
|
1289
1464
|
}
|
|
1290
|
-
function
|
|
1291
|
-
let { items: t, multiple: n, selected: r, onChange: i, mutable: a, onAdd: s } = e, [c, f] = d(""), p = u(null), g = l(() => t.reduce((e, t) => ((!c.length || t.text.toLowerCase().includes(c.toLowerCase())) && e.push(t), e), []), [t, c]), _ =
|
|
1465
|
+
function nt(e) {
|
|
1466
|
+
let { items: t, multiple: n, selected: r, onChange: i, mutable: a, onAdd: s } = e, [c, f] = d(""), p = u(null), g = l(() => t.reduce((e, t) => ((!c.length || t.text.toLowerCase().includes(c.toLowerCase())) && e.push(t), e), []), [t, c]), _ = et({
|
|
1292
1467
|
count: g.length,
|
|
1293
1468
|
itemHeight: 35,
|
|
1294
1469
|
scrollRef: p
|
|
@@ -1301,7 +1476,7 @@ function qe(e) {
|
|
|
1301
1476
|
className: "divide-tint/10 flex w-full flex-col divide-y overflow-hidden rounded-xl",
|
|
1302
1477
|
children: [/* @__PURE__ */ h("div", {
|
|
1303
1478
|
className: "flex h-10 grow items-center gap-2 px-3",
|
|
1304
|
-
children: [/* @__PURE__ */ m(
|
|
1479
|
+
children: [/* @__PURE__ */ m(X, { children: /* @__PURE__ */ m(Ze, {}) }), /* @__PURE__ */ m(Y, {
|
|
1305
1480
|
placeholder: "Search",
|
|
1306
1481
|
"aria-label": "Search options",
|
|
1307
1482
|
value: c,
|
|
@@ -1309,7 +1484,7 @@ function qe(e) {
|
|
|
1309
1484
|
})]
|
|
1310
1485
|
}), /* @__PURE__ */ h("ul", {
|
|
1311
1486
|
role: "listbox",
|
|
1312
|
-
className:
|
|
1487
|
+
className: A("max-h-72 grow overflow-y-auto py-1", "focus:ring-0 focus:outline-hidden"),
|
|
1313
1488
|
ref: p,
|
|
1314
1489
|
children: [/* @__PURE__ */ m("div", {
|
|
1315
1490
|
style: {
|
|
@@ -1324,14 +1499,14 @@ function qe(e) {
|
|
|
1324
1499
|
height: `${e.size}px`,
|
|
1325
1500
|
transform: `translateY(${e.start}px)`
|
|
1326
1501
|
},
|
|
1327
|
-
className:
|
|
1502
|
+
className: A("hover:bg-muted absolute top-0 left-0 grid w-full cursor-pointer grid-cols-[1rem_1fr] items-center gap-2 px-3 py-2 text-sm outline-hidden select-none"),
|
|
1328
1503
|
onClick: () => {
|
|
1329
1504
|
n ? v.includes(g[e.index].key) ? i(structuredClone(r.filter((t) => t.key !== g[e.index].key))) : i(structuredClone([...r, g[e.index]])) : i(g[e.index]);
|
|
1330
1505
|
},
|
|
1331
1506
|
children: [/* @__PURE__ */ m("span", {
|
|
1332
1507
|
className: "text-primary col-start-1",
|
|
1333
1508
|
"aria-hidden": !0,
|
|
1334
|
-
children: v.includes(g[e.index].key) && /* @__PURE__ */ m(
|
|
1509
|
+
children: v.includes(g[e.index].key) && /* @__PURE__ */ m(K, {})
|
|
1335
1510
|
}), /* @__PURE__ */ m("span", {
|
|
1336
1511
|
className: "col-start-2 truncate",
|
|
1337
1512
|
children: g[e.index].text
|
|
@@ -1340,7 +1515,7 @@ function qe(e) {
|
|
|
1340
1515
|
}), c.length > 0 && g.length === 0 && (a ? /* @__PURE__ */ h("li", {
|
|
1341
1516
|
role: "option",
|
|
1342
1517
|
"aria-selected": !1,
|
|
1343
|
-
className:
|
|
1518
|
+
className: A("hover:bg-muted cursor-pointer px-3 py-2 text-sm select-none"),
|
|
1344
1519
|
onClick: () => {
|
|
1345
1520
|
s({
|
|
1346
1521
|
text: c,
|
|
@@ -1351,7 +1526,7 @@ function qe(e) {
|
|
|
1351
1526
|
}) : /* @__PURE__ */ m("li", {
|
|
1352
1527
|
role: "option",
|
|
1353
1528
|
"aria-selected": !1,
|
|
1354
|
-
className:
|
|
1529
|
+
className: A("text-muted-foreground cursor-not-allowed px-3 py-2 text-sm"),
|
|
1355
1530
|
children: "No results found"
|
|
1356
1531
|
}))]
|
|
1357
1532
|
})]
|
|
@@ -1359,9 +1534,9 @@ function qe(e) {
|
|
|
1359
1534
|
}
|
|
1360
1535
|
//#endregion
|
|
1361
1536
|
//#region packages/header/index.tsx
|
|
1362
|
-
function
|
|
1363
|
-
return
|
|
1364
|
-
className:
|
|
1537
|
+
function rt({ className: e, children: t, ...n }) {
|
|
1538
|
+
return N(), /* @__PURE__ */ m("header", {
|
|
1539
|
+
className: A("zen__header border-tint/5 bg-background/60 sticky top-0 z-40 border-b pt-[env(safe-area-inset-top)] backdrop-blur-xl", "pointer-coarse:bg-background/95 pointer-coarse:backdrop-blur-none", e),
|
|
1365
1540
|
...n,
|
|
1366
1541
|
children: /* @__PURE__ */ m("div", {
|
|
1367
1542
|
className: "flex items-center justify-between gap-4 px-4 py-2.5 md:gap-6 md:px-6 md:py-3",
|
|
@@ -1371,7 +1546,7 @@ function Je({ className: e, children: t, ...n }) {
|
|
|
1371
1546
|
}
|
|
1372
1547
|
//#endregion
|
|
1373
1548
|
//#region packages/icons/chevron-down.tsx
|
|
1374
|
-
function
|
|
1549
|
+
function it(e) {
|
|
1375
1550
|
return /* @__PURE__ */ m("svg", {
|
|
1376
1551
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1377
1552
|
fill: "none",
|
|
@@ -1389,7 +1564,7 @@ function Ye(e) {
|
|
|
1389
1564
|
}
|
|
1390
1565
|
//#endregion
|
|
1391
1566
|
//#region packages/icons/chevron-left.tsx
|
|
1392
|
-
function
|
|
1567
|
+
function at(e) {
|
|
1393
1568
|
return /* @__PURE__ */ m("svg", {
|
|
1394
1569
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1395
1570
|
fill: "none",
|
|
@@ -1407,7 +1582,7 @@ function Xe(e) {
|
|
|
1407
1582
|
}
|
|
1408
1583
|
//#endregion
|
|
1409
1584
|
//#region packages/icons/chevron-right.tsx
|
|
1410
|
-
function
|
|
1585
|
+
function ot(e) {
|
|
1411
1586
|
return /* @__PURE__ */ m("svg", {
|
|
1412
1587
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1413
1588
|
fill: "none",
|
|
@@ -1425,7 +1600,7 @@ function Ze(e) {
|
|
|
1425
1600
|
}
|
|
1426
1601
|
//#endregion
|
|
1427
1602
|
//#region packages/icons/chevron-up.tsx
|
|
1428
|
-
function
|
|
1603
|
+
function st(e) {
|
|
1429
1604
|
return /* @__PURE__ */ m("svg", {
|
|
1430
1605
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1431
1606
|
fill: "none",
|
|
@@ -1443,16 +1618,16 @@ function Qe(e) {
|
|
|
1443
1618
|
}
|
|
1444
1619
|
//#endregion
|
|
1445
1620
|
//#region packages/input/index.tsx
|
|
1446
|
-
function
|
|
1621
|
+
function ct(e) {
|
|
1447
1622
|
let { className: t, ...n } = e;
|
|
1448
1623
|
return /* @__PURE__ */ m("input", {
|
|
1449
|
-
className:
|
|
1624
|
+
className: A(H, "w-full", "read-only:text-foreground read-only:cursor-default read-only:border-none! read-only:bg-transparent read-only:shadow-none! read-only:outline-hidden!", "file:text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium", "[[type=\"checkbox\"]]:accent-primary [[type=\"checkbox\"]]:h-4 [[type=\"checkbox\"]]:w-4 [[type=\"checkbox\"]]:rounded-sm", "[[type=\"radio\"]]:accent-primary [[type=\"radio\"]]:h-4 [[type=\"radio\"]]:w-4", t),
|
|
1450
1625
|
...n
|
|
1451
1626
|
});
|
|
1452
1627
|
}
|
|
1453
1628
|
//#endregion
|
|
1454
1629
|
//#region packages/meter/index.tsx
|
|
1455
|
-
function
|
|
1630
|
+
function lt({ value: e, max: t = 100, label: n, detail: r, hint: i, valueText: a, tone: o = "auto", warnAt: c = .85, className: l }) {
|
|
1456
1631
|
let u = s(), d = e > t, f = t > 0 ? e / t : +(e > 0), p = Math.min(100, Math.max(0, Math.round(f * 100))), g = o === "auto" ? d ? "danger" : f >= c ? "warning" : "default" : o;
|
|
1457
1632
|
return /* @__PURE__ */ h("div", {
|
|
1458
1633
|
role: "meter",
|
|
@@ -1461,7 +1636,7 @@ function et({ value: e, max: t = 100, label: n, detail: r, hint: i, valueText: a
|
|
|
1461
1636
|
"aria-valuemax": t,
|
|
1462
1637
|
"aria-valuenow": Math.min(e, t),
|
|
1463
1638
|
"aria-valuetext": a,
|
|
1464
|
-
className:
|
|
1639
|
+
className: A("zen__meter grid grid-cols-2 gap-y-1.5", l),
|
|
1465
1640
|
children: [
|
|
1466
1641
|
n && /* @__PURE__ */ m("span", {
|
|
1467
1642
|
id: u,
|
|
@@ -1469,18 +1644,18 @@ function et({ value: e, max: t = 100, label: n, detail: r, hint: i, valueText: a
|
|
|
1469
1644
|
children: n
|
|
1470
1645
|
}),
|
|
1471
1646
|
r && /* @__PURE__ */ m("span", {
|
|
1472
|
-
className:
|
|
1647
|
+
className: A("col-start-2 text-right text-sm tabular-nums", g === "danger" ? "text-destructive" : "text-muted-foreground"),
|
|
1473
1648
|
children: r
|
|
1474
1649
|
}),
|
|
1475
1650
|
/* @__PURE__ */ m("div", {
|
|
1476
1651
|
className: "bg-muted col-span-2 h-2 overflow-hidden rounded-full",
|
|
1477
1652
|
children: /* @__PURE__ */ m("div", {
|
|
1478
|
-
className:
|
|
1653
|
+
className: A("h-full rounded-full transition-[width] duration-700 ease-[cubic-bezier(0.2,0.8,0.2,1)]", g === "danger" ? "bg-destructive shadow-[0_0_12px_oklch(var(--destructive)/0.7)]" : g === "warning" ? "bg-accent-foreground shadow-[0_0_12px_oklch(var(--accent-foreground)/0.6)]" : "from-primary to-glow-2 bg-gradient-to-r shadow-[0_0_12px_oklch(var(--glow)/0.6)]"),
|
|
1479
1654
|
style: { width: `${p}%` }
|
|
1480
1655
|
})
|
|
1481
1656
|
}),
|
|
1482
1657
|
i && /* @__PURE__ */ m("span", {
|
|
1483
|
-
className:
|
|
1658
|
+
className: A("col-span-2 text-xs", g === "danger" ? "text-destructive" : "text-muted-foreground"),
|
|
1484
1659
|
children: i
|
|
1485
1660
|
})
|
|
1486
1661
|
]
|
|
@@ -1488,34 +1663,34 @@ function et({ value: e, max: t = 100, label: n, detail: r, hint: i, valueText: a
|
|
|
1488
1663
|
}
|
|
1489
1664
|
//#endregion
|
|
1490
1665
|
//#region packages/utils/month.ts
|
|
1491
|
-
var
|
|
1492
|
-
function
|
|
1493
|
-
return typeof e == "string" &&
|
|
1666
|
+
var ut = /^(\d{4})-(0[1-9]|1[0-2])$/;
|
|
1667
|
+
function dt(e) {
|
|
1668
|
+
return typeof e == "string" && ut.test(e);
|
|
1494
1669
|
}
|
|
1495
|
-
function
|
|
1496
|
-
let t =
|
|
1670
|
+
function Q(e) {
|
|
1671
|
+
let t = ut.exec(e);
|
|
1497
1672
|
if (!t) throw Error(`Invalid month: ${e}`);
|
|
1498
1673
|
return Number(t[1]) * 12 + Number(t[2]) - 1;
|
|
1499
1674
|
}
|
|
1500
|
-
function
|
|
1675
|
+
function ft(e) {
|
|
1501
1676
|
let t = Math.floor(e / 12);
|
|
1502
1677
|
return `${String(t).padStart(4, "0")}-${String(e % 12 + 1).padStart(2, "0")}`;
|
|
1503
1678
|
}
|
|
1504
|
-
function
|
|
1505
|
-
return
|
|
1679
|
+
function pt(e, t) {
|
|
1680
|
+
return ft(Q(e) + t);
|
|
1506
1681
|
}
|
|
1507
|
-
function
|
|
1682
|
+
function mt(e, t) {
|
|
1508
1683
|
let n = [];
|
|
1509
|
-
for (let r =
|
|
1684
|
+
for (let r = Q(e); r <= Q(t); r++) n.push(ft(r));
|
|
1510
1685
|
return n;
|
|
1511
1686
|
}
|
|
1512
|
-
function
|
|
1513
|
-
return
|
|
1687
|
+
function ht(e, t) {
|
|
1688
|
+
return Q(t) - Q(e);
|
|
1514
1689
|
}
|
|
1515
|
-
function
|
|
1690
|
+
function gt(e = /* @__PURE__ */ new Date()) {
|
|
1516
1691
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`;
|
|
1517
1692
|
}
|
|
1518
|
-
function
|
|
1693
|
+
function _t(e, t, n = "short") {
|
|
1519
1694
|
let [r, i] = e.split("-").map(Number);
|
|
1520
1695
|
return new Intl.DateTimeFormat(t, {
|
|
1521
1696
|
month: n,
|
|
@@ -1523,7 +1698,7 @@ function ct(e, t, n = "short") {
|
|
|
1523
1698
|
timeZone: "UTC"
|
|
1524
1699
|
}).format(Date.UTC(r, i - 1, 1));
|
|
1525
1700
|
}
|
|
1526
|
-
function
|
|
1701
|
+
function vt(e) {
|
|
1527
1702
|
let t = new Intl.DateTimeFormat(e, {
|
|
1528
1703
|
month: "short",
|
|
1529
1704
|
timeZone: "UTC"
|
|
@@ -1532,24 +1707,24 @@ function lt(e) {
|
|
|
1532
1707
|
}
|
|
1533
1708
|
//#endregion
|
|
1534
1709
|
//#region packages/month-picker/index.tsx
|
|
1535
|
-
function
|
|
1536
|
-
let [g, _] = d(() => Number((e ?? (/* @__PURE__ */ new Date()).toISOString()).slice(0, 4))), v =
|
|
1710
|
+
function yt({ value: e, onChange: t, locale: n, min: r, max: i, id: a, className: o, disabled: s = !1, placeholder: c = "Pick a month", onClear: l, clearLabel: u = "Clear", "aria-label": f }) {
|
|
1711
|
+
let [g, _] = d(() => Number((e ?? (/* @__PURE__ */ new Date()).toISOString()).slice(0, 4))), v = P({ onOpenChange: (t) => t && e && _(Number(e.slice(0, 4))) }), y = vt(n), b = (e) => (!r || e >= r) && (!i || e <= i);
|
|
1537
1712
|
return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("button", {
|
|
1538
1713
|
type: "button",
|
|
1539
1714
|
id: a,
|
|
1540
1715
|
disabled: s,
|
|
1541
1716
|
"aria-label": f,
|
|
1542
1717
|
...v.triggerProps,
|
|
1543
|
-
className:
|
|
1718
|
+
className: A("zen__month-picker group", U, "w-full", v.open && "border-glow/60 shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)]", o),
|
|
1544
1719
|
children: [/* @__PURE__ */ m("span", {
|
|
1545
1720
|
className: e ? void 0 : "text-muted-foreground",
|
|
1546
|
-
children: e ?
|
|
1547
|
-
}), /* @__PURE__ */ m(
|
|
1721
|
+
children: e ? _t(e, n) : c
|
|
1722
|
+
}), /* @__PURE__ */ m(Z, { open: v.open })]
|
|
1548
1723
|
}), /* @__PURE__ */ h("div", {
|
|
1549
1724
|
...v.popupProps,
|
|
1550
1725
|
role: "dialog",
|
|
1551
1726
|
"aria-label": "Choose month",
|
|
1552
|
-
className:
|
|
1727
|
+
className: A("zen__popover", W, "w-64 p-3"),
|
|
1553
1728
|
children: [
|
|
1554
1729
|
/* @__PURE__ */ h("div", {
|
|
1555
1730
|
className: "mb-2 flex items-center justify-between",
|
|
@@ -1559,7 +1734,7 @@ function ut({ value: e, onChange: t, locale: n, min: r, max: i, id: a, className
|
|
|
1559
1734
|
"aria-label": "Previous year",
|
|
1560
1735
|
onClick: () => _((e) => e - 1),
|
|
1561
1736
|
className: "hover:bg-muted rounded p-1.5",
|
|
1562
|
-
children: /* @__PURE__ */ m(
|
|
1737
|
+
children: /* @__PURE__ */ m(at, { className: "size-4" })
|
|
1563
1738
|
}),
|
|
1564
1739
|
/* @__PURE__ */ m("span", {
|
|
1565
1740
|
className: "text-sm font-semibold tabular-nums",
|
|
@@ -1571,7 +1746,7 @@ function ut({ value: e, onChange: t, locale: n, min: r, max: i, id: a, className
|
|
|
1571
1746
|
"aria-label": "Next year",
|
|
1572
1747
|
onClick: () => _((e) => e + 1),
|
|
1573
1748
|
className: "hover:bg-muted rounded p-1.5",
|
|
1574
|
-
children: /* @__PURE__ */ m(
|
|
1749
|
+
children: /* @__PURE__ */ m(ot, { className: "size-4" })
|
|
1575
1750
|
})
|
|
1576
1751
|
]
|
|
1577
1752
|
}),
|
|
@@ -1583,11 +1758,11 @@ function ut({ value: e, onChange: t, locale: n, min: r, max: i, id: a, className
|
|
|
1583
1758
|
type: "button",
|
|
1584
1759
|
disabled: !b(a),
|
|
1585
1760
|
"aria-pressed": o,
|
|
1586
|
-
"aria-label":
|
|
1761
|
+
"aria-label": _t(a, n, "long"),
|
|
1587
1762
|
onClick: () => {
|
|
1588
1763
|
t(a), v.setOpen(!1);
|
|
1589
1764
|
},
|
|
1590
|
-
className:
|
|
1765
|
+
className: A("rounded-sm py-2 text-sm disabled:cursor-not-allowed disabled:opacity-40", o ? "bg-primary text-primary-foreground" : "hover:bg-muted"),
|
|
1591
1766
|
children: r
|
|
1592
1767
|
}, a);
|
|
1593
1768
|
})
|
|
@@ -1605,26 +1780,26 @@ function ut({ value: e, onChange: t, locale: n, min: r, max: i, id: a, className
|
|
|
1605
1780
|
}
|
|
1606
1781
|
//#endregion
|
|
1607
1782
|
//#region packages/money-input/index.tsx
|
|
1608
|
-
function
|
|
1609
|
-
let l =
|
|
1783
|
+
function bt({ start: e, end: t, compact: n = !1, disabled: r = !1, id: i, autoFocus: a, className: o, "aria-label": s, ...c }) {
|
|
1784
|
+
let l = xt(c);
|
|
1610
1785
|
return /* @__PURE__ */ h("div", {
|
|
1611
|
-
className:
|
|
1612
|
-
children: [/* @__PURE__ */ h(
|
|
1786
|
+
className: A("zen__money-input flex flex-col gap-1", o),
|
|
1787
|
+
children: [/* @__PURE__ */ h($e, {
|
|
1613
1788
|
invalid: !!l.error,
|
|
1614
|
-
className:
|
|
1789
|
+
className: A(n && "h-7! border!"),
|
|
1615
1790
|
children: [
|
|
1616
|
-
e ?? /* @__PURE__ */ m(
|
|
1791
|
+
e ?? /* @__PURE__ */ m(X, {
|
|
1617
1792
|
"aria-hidden": !0,
|
|
1618
1793
|
"data-slot": "symbol",
|
|
1619
1794
|
children: l.symbol
|
|
1620
1795
|
}),
|
|
1621
|
-
/* @__PURE__ */ m(
|
|
1796
|
+
/* @__PURE__ */ m(Y, {
|
|
1622
1797
|
...l.inputProps,
|
|
1623
1798
|
id: i,
|
|
1624
1799
|
autoFocus: a,
|
|
1625
1800
|
disabled: r,
|
|
1626
1801
|
"aria-label": s,
|
|
1627
|
-
className:
|
|
1802
|
+
className: A("tabular-nums", n ? "text-right" : "text-left")
|
|
1628
1803
|
}),
|
|
1629
1804
|
t
|
|
1630
1805
|
]
|
|
@@ -1632,12 +1807,12 @@ function dt({ start: e, end: t, compact: n = !1, disabled: r = !1, id: i, autoFo
|
|
|
1632
1807
|
id: l.errorId,
|
|
1633
1808
|
role: "alert",
|
|
1634
1809
|
className: "text-destructive mt-0! flex items-center gap-1.5 text-xs font-medium",
|
|
1635
|
-
children: [/* @__PURE__ */ m(
|
|
1810
|
+
children: [/* @__PURE__ */ m(q, { className: "shrink-0" }), l.error]
|
|
1636
1811
|
})]
|
|
1637
1812
|
});
|
|
1638
1813
|
}
|
|
1639
|
-
function
|
|
1640
|
-
let u = (e) => e === null ? "" :
|
|
1814
|
+
function xt({ value: e, onChange: t, currency: n, locale: r, allowNegative: i = !1, allowEmpty: a = !1, live: c = !1, onCancel: l }) {
|
|
1815
|
+
let u = (e) => e === null ? "" : fe(e, n, r), [f, p] = d(() => u(e)), [m, h] = d(null), [g, _] = d(!1), [v, y] = d(!1), b = s();
|
|
1641
1816
|
o(() => {
|
|
1642
1817
|
!g && !(c && v) && p(u(e));
|
|
1643
1818
|
}, [
|
|
@@ -1645,7 +1820,7 @@ function ft({ value: e, onChange: t, currency: n, locale: r, allowNegative: i =
|
|
|
1645
1820
|
n,
|
|
1646
1821
|
r
|
|
1647
1822
|
]);
|
|
1648
|
-
let x = `Not an amount. Try ${
|
|
1823
|
+
let x = `Not an amount. Try ${fe(3274e3, n, r)} or ${r.endsWith("-IN") ? "1.5L" : "10k"}.`;
|
|
1649
1824
|
function S(e) {
|
|
1650
1825
|
let t = e.trim();
|
|
1651
1826
|
if (t === "") {
|
|
@@ -1655,7 +1830,7 @@ function ft({ value: e, onChange: t, currency: n, locale: r, allowNegative: i =
|
|
|
1655
1830
|
}
|
|
1656
1831
|
let r;
|
|
1657
1832
|
try {
|
|
1658
|
-
r =
|
|
1833
|
+
r = L(t, n);
|
|
1659
1834
|
} catch {
|
|
1660
1835
|
h(x);
|
|
1661
1836
|
return;
|
|
@@ -1688,7 +1863,7 @@ function ft({ value: e, onChange: t, currency: n, locale: r, allowNegative: i =
|
|
|
1688
1863
|
y(!0);
|
|
1689
1864
|
try {
|
|
1690
1865
|
let r = e.target.value.trim();
|
|
1691
|
-
t(r === "" ? null :
|
|
1866
|
+
t(r === "" ? null : L(r, n));
|
|
1692
1867
|
} catch {
|
|
1693
1868
|
t(null);
|
|
1694
1869
|
}
|
|
@@ -1702,29 +1877,29 @@ function ft({ value: e, onChange: t, currency: n, locale: r, allowNegative: i =
|
|
|
1702
1877
|
t.key === "Enter" ? (t.preventDefault(), c ? w() : C()) : t.key === "Escape" && (t.preventDefault(), p(u(e)), h(null), l?.());
|
|
1703
1878
|
}
|
|
1704
1879
|
},
|
|
1705
|
-
symbol:
|
|
1880
|
+
symbol: pe(n, r),
|
|
1706
1881
|
error: m,
|
|
1707
1882
|
errorId: b,
|
|
1708
1883
|
text: f,
|
|
1709
1884
|
setText: p,
|
|
1710
1885
|
commit: C,
|
|
1711
|
-
formatted: e === null ? "" :
|
|
1886
|
+
formatted: e === null ? "" : de(e, n, r)
|
|
1712
1887
|
};
|
|
1713
1888
|
}
|
|
1714
1889
|
//#endregion
|
|
1715
1890
|
//#region packages/utils/slot.tsx
|
|
1716
|
-
function
|
|
1891
|
+
function St({ children: e, className: n, ...i }) {
|
|
1717
1892
|
if (!r(e)) return null;
|
|
1718
1893
|
let a = e;
|
|
1719
1894
|
return t(a, {
|
|
1720
1895
|
...i,
|
|
1721
|
-
className:
|
|
1896
|
+
className: A(n, a.props.className)
|
|
1722
1897
|
});
|
|
1723
1898
|
}
|
|
1724
1899
|
//#endregion
|
|
1725
1900
|
//#region packages/nav-pills/index.tsx
|
|
1726
|
-
var
|
|
1727
|
-
function
|
|
1901
|
+
var Ct = n(null);
|
|
1902
|
+
function wt({ className: e, children: t, ...n }) {
|
|
1728
1903
|
let r = u(null), [i, a] = d(null);
|
|
1729
1904
|
return c(() => {
|
|
1730
1905
|
let e = r.current;
|
|
@@ -1749,37 +1924,37 @@ function ht({ className: e, children: t, ...n }) {
|
|
|
1749
1924
|
n.disconnect(), i?.disconnect();
|
|
1750
1925
|
};
|
|
1751
1926
|
}, []), /* @__PURE__ */ m("nav", {
|
|
1752
|
-
className:
|
|
1927
|
+
className: A("zen__nav-pills", e),
|
|
1753
1928
|
...n,
|
|
1754
1929
|
children: /* @__PURE__ */ m("div", {
|
|
1755
1930
|
ref: r,
|
|
1756
|
-
className:
|
|
1757
|
-
children: /* @__PURE__ */ m(
|
|
1931
|
+
className: je,
|
|
1932
|
+
children: /* @__PURE__ */ m(Ct.Provider, {
|
|
1758
1933
|
value: i,
|
|
1759
1934
|
children: t
|
|
1760
1935
|
})
|
|
1761
1936
|
})
|
|
1762
1937
|
});
|
|
1763
1938
|
}
|
|
1764
|
-
function
|
|
1765
|
-
let t = a(
|
|
1939
|
+
function Tt({ className: e }) {
|
|
1940
|
+
let t = a(Ct);
|
|
1766
1941
|
return t ? /* @__PURE__ */ m("span", {
|
|
1767
1942
|
"aria-hidden": !0,
|
|
1768
|
-
className:
|
|
1943
|
+
className: A(Me, e),
|
|
1769
1944
|
style: {
|
|
1770
1945
|
translate: `${t.x}px 0`,
|
|
1771
1946
|
width: t.w
|
|
1772
1947
|
}
|
|
1773
1948
|
}) : null;
|
|
1774
1949
|
}
|
|
1775
|
-
var
|
|
1776
|
-
function
|
|
1950
|
+
var Et = A(Ne, "text-muted-foreground hover:text-foreground aria-[current=page]:text-foreground aria-[current=page]:hover:text-foreground");
|
|
1951
|
+
function Dt({ active: e, asChild: t, className: n, children: r, ...i }) {
|
|
1777
1952
|
let a = {
|
|
1778
1953
|
...i,
|
|
1779
1954
|
"aria-current": e ? "page" : void 0,
|
|
1780
|
-
className:
|
|
1955
|
+
className: A(Et, n)
|
|
1781
1956
|
};
|
|
1782
|
-
return t ? (e || delete a["aria-current"], /* @__PURE__ */ m(
|
|
1957
|
+
return t ? (e || delete a["aria-current"], /* @__PURE__ */ m(St, {
|
|
1783
1958
|
...a,
|
|
1784
1959
|
children: r
|
|
1785
1960
|
})) : /* @__PURE__ */ m("a", {
|
|
@@ -1789,9 +1964,9 @@ function vt({ active: e, asChild: t, className: n, children: r, ...i }) {
|
|
|
1789
1964
|
}
|
|
1790
1965
|
//#endregion
|
|
1791
1966
|
//#region packages/page-header/index.tsx
|
|
1792
|
-
function
|
|
1967
|
+
function Ot({ eyebrow: e, title: t, lead: n, children: r, className: i }) {
|
|
1793
1968
|
return /* @__PURE__ */ h("header", {
|
|
1794
|
-
className:
|
|
1969
|
+
className: A("zen__page-header flex flex-col gap-3", i),
|
|
1795
1970
|
children: [
|
|
1796
1971
|
e && /* @__PURE__ */ m("p", {
|
|
1797
1972
|
className: "text-muted-foreground mt-0! text-xs tracking-[0.1em] uppercase",
|
|
@@ -1811,7 +1986,7 @@ function yt({ eyebrow: e, title: t, lead: n, children: r, className: i }) {
|
|
|
1811
1986
|
}
|
|
1812
1987
|
//#endregion
|
|
1813
1988
|
//#region packages/progress-ring/index.tsx
|
|
1814
|
-
function
|
|
1989
|
+
function kt({ value: e, size: t = 84, stroke: n = 7, label: r, children: i, className: a }) {
|
|
1815
1990
|
let o = (t - n) / 2, s = 2 * Math.PI * o, c = Math.min(Math.max(e, 0), 1);
|
|
1816
1991
|
return /* @__PURE__ */ h("div", {
|
|
1817
1992
|
role: "progressbar",
|
|
@@ -1819,7 +1994,7 @@ function bt({ value: e, size: t = 84, stroke: n = 7, label: r, children: i, clas
|
|
|
1819
1994
|
"aria-valuemin": 0,
|
|
1820
1995
|
"aria-valuemax": 100,
|
|
1821
1996
|
"aria-valuenow": Math.round(c * 100),
|
|
1822
|
-
className:
|
|
1997
|
+
className: A("zen__progress-ring relative grid shrink-0 place-items-center", a),
|
|
1823
1998
|
style: {
|
|
1824
1999
|
width: t,
|
|
1825
2000
|
height: t
|
|
@@ -1856,7 +2031,7 @@ function bt({ value: e, size: t = 84, stroke: n = 7, label: r, children: i, clas
|
|
|
1856
2031
|
}
|
|
1857
2032
|
//#endregion
|
|
1858
2033
|
//#region packages/segmented/index.tsx
|
|
1859
|
-
function
|
|
2034
|
+
function At({ label: e, value: t, options: n, onChange: r, name: i, className: a }) {
|
|
1860
2035
|
let o = s(), l = u(null), [f, p] = d(null);
|
|
1861
2036
|
return c(() => {
|
|
1862
2037
|
let e = l.current;
|
|
@@ -1874,7 +2049,7 @@ function xt({ label: e, value: t, options: n, onChange: r, name: i, className: a
|
|
|
1874
2049
|
let n = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
1875
2050
|
return n?.observe(e), () => n?.disconnect();
|
|
1876
2051
|
}, [t, n]), /* @__PURE__ */ h("div", {
|
|
1877
|
-
className:
|
|
2052
|
+
className: A("zen__segmented flex flex-col gap-2", a),
|
|
1878
2053
|
children: [/* @__PURE__ */ m("span", {
|
|
1879
2054
|
id: o,
|
|
1880
2055
|
className: "text-sm font-medium",
|
|
@@ -1893,7 +2068,7 @@ function xt({ label: e, value: t, options: n, onChange: r, name: i, className: a
|
|
|
1893
2068
|
height: f.h
|
|
1894
2069
|
}
|
|
1895
2070
|
}), n.map((e) => /* @__PURE__ */ h("label", {
|
|
1896
|
-
className:
|
|
2071
|
+
className: A("text-muted-foreground relative cursor-pointer rounded-lg px-3 py-1.5 text-sm transition-colors duration-300", "hover:text-foreground has-checked:text-foreground has-focus-visible:ring-ring/50 has-focus-visible:ring-2", !f && "has-checked:bg-primary/15 has-checked:shadow-[inset_0_0_0_1px_oklch(var(--primary)/0.4)]"),
|
|
1897
2072
|
children: [/* @__PURE__ */ m("input", {
|
|
1898
2073
|
type: "radio",
|
|
1899
2074
|
className: "sr-only",
|
|
@@ -1908,11 +2083,11 @@ function xt({ label: e, value: t, options: n, onChange: r, name: i, className: a
|
|
|
1908
2083
|
}
|
|
1909
2084
|
//#endregion
|
|
1910
2085
|
//#region packages/select/index.tsx
|
|
1911
|
-
function
|
|
2086
|
+
function jt({ value: e, options: t, onChange: n, placeholder: r = "Select…", disabled: i = !1, renderOption: a, name: s, id: c, className: l, listClassName: f, "aria-label": g }) {
|
|
1912
2087
|
let _ = u(null), [v, y] = d(-1), b = u({
|
|
1913
2088
|
text: "",
|
|
1914
2089
|
at: 0
|
|
1915
|
-
}), x =
|
|
2090
|
+
}), x = P({
|
|
1916
2091
|
matchWidth: !0,
|
|
1917
2092
|
onOpenChange: (n) => {
|
|
1918
2093
|
n && y(Math.max(0, t.findIndex((t) => t.value === e)));
|
|
@@ -1965,11 +2140,11 @@ function St({ value: e, options: t, onChange: n, placeholder: r = "Select…", d
|
|
|
1965
2140
|
onKeyDown: (e) => {
|
|
1966
2141
|
["ArrowDown", "ArrowUp"].includes(e.key) && !x.open && (e.preventDefault(), x.setOpen(!0));
|
|
1967
2142
|
},
|
|
1968
|
-
className:
|
|
2143
|
+
className: A("zen__select group", U, "w-full", x.open && "border-glow/60 shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)]", l),
|
|
1969
2144
|
children: [/* @__PURE__ */ m("span", {
|
|
1970
|
-
className:
|
|
2145
|
+
className: A("truncate", !S && "text-muted-foreground"),
|
|
1971
2146
|
children: S ? S.label : r
|
|
1972
|
-
}), /* @__PURE__ */ m(
|
|
2147
|
+
}), /* @__PURE__ */ m(Z, { open: x.open })]
|
|
1973
2148
|
}),
|
|
1974
2149
|
s && /* @__PURE__ */ m("input", {
|
|
1975
2150
|
type: "hidden",
|
|
@@ -1978,7 +2153,7 @@ function St({ value: e, options: t, onChange: n, placeholder: r = "Select…", d
|
|
|
1978
2153
|
}),
|
|
1979
2154
|
/* @__PURE__ */ m("div", {
|
|
1980
2155
|
...x.popupProps,
|
|
1981
|
-
className:
|
|
2156
|
+
className: A("zen__popover", W, "overflow-visible py-1", f),
|
|
1982
2157
|
children: /* @__PURE__ */ m("div", {
|
|
1983
2158
|
ref: _,
|
|
1984
2159
|
role: "listbox",
|
|
@@ -1995,11 +2170,11 @@ function St({ value: e, options: t, onChange: n, placeholder: r = "Select…", d
|
|
|
1995
2170
|
"data-highlighted": n === v || void 0,
|
|
1996
2171
|
onMouseMove: () => !t.disabled && y(n),
|
|
1997
2172
|
onClick: () => w(n),
|
|
1998
|
-
className:
|
|
2173
|
+
className: A("grid cursor-pointer grid-cols-[1rem_1fr] items-center gap-2 px-3 py-2 text-sm outline-hidden select-none", "data-highlighted:bg-muted aria-disabled:cursor-not-allowed aria-disabled:opacity-50"),
|
|
1999
2174
|
children: [/* @__PURE__ */ m("span", {
|
|
2000
2175
|
className: "text-primary col-start-1",
|
|
2001
2176
|
"aria-hidden": !0,
|
|
2002
|
-
children: t.value === e && /* @__PURE__ */ m(
|
|
2177
|
+
children: t.value === e && /* @__PURE__ */ m(K, {})
|
|
2003
2178
|
}), /* @__PURE__ */ m("span", {
|
|
2004
2179
|
className: "col-start-2 truncate",
|
|
2005
2180
|
children: a ? a(t) : t.label
|
|
@@ -2011,29 +2186,29 @@ function St({ value: e, options: t, onChange: n, placeholder: r = "Select…", d
|
|
|
2011
2186
|
}
|
|
2012
2187
|
//#endregion
|
|
2013
2188
|
//#region packages/side-nav/index.tsx
|
|
2014
|
-
function
|
|
2189
|
+
function Mt({ className: e, ...t }) {
|
|
2015
2190
|
return /* @__PURE__ */ m("nav", {
|
|
2016
|
-
className:
|
|
2191
|
+
className: A("zen__side-nav flex flex-col gap-6", e),
|
|
2017
2192
|
...t
|
|
2018
2193
|
});
|
|
2019
2194
|
}
|
|
2020
|
-
function
|
|
2195
|
+
function Nt({ title: e, children: t, className: n }) {
|
|
2021
2196
|
return /* @__PURE__ */ h("div", {
|
|
2022
|
-
className:
|
|
2197
|
+
className: A("flex flex-col gap-1", n),
|
|
2023
2198
|
children: [e && /* @__PURE__ */ m("span", {
|
|
2024
2199
|
className: "text-muted-foreground px-3 pb-1 text-[0.68rem] tracking-[0.1em] uppercase",
|
|
2025
2200
|
children: e
|
|
2026
2201
|
}), t]
|
|
2027
2202
|
});
|
|
2028
2203
|
}
|
|
2029
|
-
var
|
|
2030
|
-
function
|
|
2204
|
+
var Pt = A("rounded-lg px-3 py-1.5 text-sm outline-hidden transition-[background-color,color,box-shadow] duration-200", "text-muted-foreground hover:bg-tint/[0.05] hover:text-foreground focus-visible:ring-ring/50 focus-visible:ring-2", "aria-[current=page]:bg-primary/15 aria-[current=page]:text-foreground aria-[current=page]:shadow-[inset_0_0_0_1px_oklch(var(--primary)/0.25)]");
|
|
2205
|
+
function Ft({ active: e, asChild: t, className: n, children: r, ...i }) {
|
|
2031
2206
|
let a = {
|
|
2032
2207
|
...i,
|
|
2033
2208
|
"aria-current": e ? "page" : void 0,
|
|
2034
|
-
className:
|
|
2209
|
+
className: A(Pt, n)
|
|
2035
2210
|
};
|
|
2036
|
-
return t ? (e || delete a["aria-current"], /* @__PURE__ */ m(
|
|
2211
|
+
return t ? (e || delete a["aria-current"], /* @__PURE__ */ m(St, {
|
|
2037
2212
|
...a,
|
|
2038
2213
|
children: r
|
|
2039
2214
|
})) : /* @__PURE__ */ m("a", {
|
|
@@ -2043,15 +2218,15 @@ function Et({ active: e, asChild: t, className: n, children: r, ...i }) {
|
|
|
2043
2218
|
}
|
|
2044
2219
|
//#endregion
|
|
2045
2220
|
//#region packages/skeleton/index.tsx
|
|
2046
|
-
function
|
|
2221
|
+
function It({ className: e }) {
|
|
2047
2222
|
return /* @__PURE__ */ m("span", {
|
|
2048
2223
|
"aria-hidden": !0,
|
|
2049
|
-
className:
|
|
2224
|
+
className: A("zen__skeleton block rounded-md", e)
|
|
2050
2225
|
});
|
|
2051
2226
|
}
|
|
2052
2227
|
//#endregion
|
|
2053
2228
|
//#region packages/slider/index.tsx
|
|
2054
|
-
function
|
|
2229
|
+
function Lt({ value: e, min: t = 0, max: n = 100, step: r = 1, onValueChange: i, onValueCommit: a, trackBackground: s, thumbColor: c, valueText: l, className: d, style: f, ...p }) {
|
|
2055
2230
|
let h = u(null), g = u(a);
|
|
2056
2231
|
g.current = a, o(() => {
|
|
2057
2232
|
let e = h.current;
|
|
@@ -2074,15 +2249,15 @@ function Ot({ value: e, min: t = 0, max: n = 100, step: r = 1, onValueChange: i,
|
|
|
2074
2249
|
"--zen-track": v,
|
|
2075
2250
|
"--zen-thumb": c ?? "oklch(var(--primary))"
|
|
2076
2251
|
},
|
|
2077
|
-
className:
|
|
2252
|
+
className: A("zen__slider h-5 w-full cursor-pointer appearance-none bg-transparent outline-hidden disabled:cursor-not-allowed disabled:opacity-50", "[&::-webkit-slider-runnable-track]:h-2.5 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:[background:var(--zen-track)]", "[&::-moz-range-track]:h-2.5 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:[background:var(--zen-track)]", "[&::-webkit-slider-thumb]:-mt-[5px] [&::-webkit-slider-thumb]:size-5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-[0_0_0_1px_oklch(0_0_0/0.3),0_0_16px_oklch(var(--glow)/0.8)] [&::-webkit-slider-thumb]:[background:var(--zen-thumb)]", "[&::-moz-range-thumb]:size-5 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-white [&::-moz-range-thumb]:shadow-[0_0_0_1px_oklch(0_0_0/0.3),0_0_16px_oklch(var(--glow)/0.8)] [&::-moz-range-thumb]:[background:var(--zen-thumb)]", "focus-visible:[&::-webkit-slider-thumb]:ring-ring/40 focus-visible:[&::-webkit-slider-thumb]:ring-4", d),
|
|
2078
2253
|
...p
|
|
2079
2254
|
});
|
|
2080
2255
|
}
|
|
2081
2256
|
//#endregion
|
|
2082
2257
|
//#region packages/tab-bar/index.tsx
|
|
2083
|
-
function
|
|
2258
|
+
function Rt({ hideFrom: t = "md", className: n, children: r, ...i }) {
|
|
2084
2259
|
return /* @__PURE__ */ m("nav", {
|
|
2085
|
-
className:
|
|
2260
|
+
className: A("zen__tab-bar glass glass-blur fixed inset-x-0 bottom-0 z-40 rounded-none! border-x-0! border-b-0! pb-[env(safe-area-inset-bottom)]", t === "sm" && "sm:hidden", t === "md" && "md:hidden", t === "lg" && "lg:hidden", n),
|
|
2086
2261
|
...i,
|
|
2087
2262
|
children: /* @__PURE__ */ m("div", {
|
|
2088
2263
|
className: "grid",
|
|
@@ -2091,14 +2266,14 @@ function kt({ hideFrom: t = "md", className: n, children: r, ...i }) {
|
|
|
2091
2266
|
})
|
|
2092
2267
|
});
|
|
2093
2268
|
}
|
|
2094
|
-
var
|
|
2095
|
-
function
|
|
2269
|
+
var zt = A("flex flex-col items-center gap-1 py-2.5 text-[0.7rem] outline-hidden transition-colors duration-200 focus-visible:bg-tint/5", "text-muted-foreground aria-[current=page]:text-primary [&_svg]:size-5 aria-[current=page]:[&_svg]:drop-shadow-[0_0_8px_oklch(var(--glow)/0.8)]");
|
|
2270
|
+
function Bt({ icon: e, active: t, asChild: n, className: r, children: i, ...a }) {
|
|
2096
2271
|
let o = {
|
|
2097
2272
|
...a,
|
|
2098
2273
|
"aria-current": t ? "page" : void 0,
|
|
2099
|
-
className:
|
|
2274
|
+
className: A(zt, r)
|
|
2100
2275
|
};
|
|
2101
|
-
return n ? (t || delete o["aria-current"], /* @__PURE__ */ m(
|
|
2276
|
+
return n ? (t || delete o["aria-current"], /* @__PURE__ */ m(St, {
|
|
2102
2277
|
...o,
|
|
2103
2278
|
children: i
|
|
2104
2279
|
})) : /* @__PURE__ */ h("a", {
|
|
@@ -2108,7 +2283,7 @@ function jt({ icon: e, active: t, asChild: n, className: r, children: i, ...a })
|
|
|
2108
2283
|
}
|
|
2109
2284
|
//#endregion
|
|
2110
2285
|
//#region packages/table/index.tsx
|
|
2111
|
-
function
|
|
2286
|
+
function Vt({ label: e, className: t, ref: n, onScroll: r, ...a }) {
|
|
2112
2287
|
let s = u(null), c = i(() => {
|
|
2113
2288
|
let e = s.current;
|
|
2114
2289
|
if (!e) return;
|
|
@@ -2122,7 +2297,7 @@ function Mt({ label: e, className: t, ref: n, onScroll: r, ...a }) {
|
|
|
2122
2297
|
let t = typeof ResizeObserver > "u" ? null : new ResizeObserver(c);
|
|
2123
2298
|
return t?.observe(e), e.firstElementChild && t?.observe(e.firstElementChild), () => t?.disconnect();
|
|
2124
2299
|
}, [c]), /* @__PURE__ */ m("div", {
|
|
2125
|
-
className:
|
|
2300
|
+
className: A("zen__table-panel glass glow-edge isolate flex flex-col overflow-hidden rounded-xl", t),
|
|
2126
2301
|
children: /* @__PURE__ */ m("div", {
|
|
2127
2302
|
ref: (e) => {
|
|
2128
2303
|
s.current = e, typeof n == "function" ? n(e) : n && (n.current = e);
|
|
@@ -2138,50 +2313,50 @@ function Mt({ label: e, className: t, ref: n, onScroll: r, ...a }) {
|
|
|
2138
2313
|
})
|
|
2139
2314
|
});
|
|
2140
2315
|
}
|
|
2141
|
-
function
|
|
2316
|
+
function Ht({ className: e, ...t }) {
|
|
2142
2317
|
return /* @__PURE__ */ m("table", {
|
|
2143
|
-
className:
|
|
2318
|
+
className: A("zen__table w-full border-separate border-spacing-0 text-sm", e),
|
|
2144
2319
|
...t
|
|
2145
2320
|
});
|
|
2146
2321
|
}
|
|
2147
|
-
function
|
|
2322
|
+
function Ut({ className: e, ...t }) {
|
|
2148
2323
|
return /* @__PURE__ */ m("thead", {
|
|
2149
|
-
className:
|
|
2324
|
+
className: A("zen__sticky-top sticky top-0 z-20", e),
|
|
2150
2325
|
...t
|
|
2151
2326
|
});
|
|
2152
2327
|
}
|
|
2153
|
-
function
|
|
2328
|
+
function Wt(e) {
|
|
2154
2329
|
return /* @__PURE__ */ m("tbody", { ...e });
|
|
2155
2330
|
}
|
|
2156
|
-
function
|
|
2331
|
+
function Gt({ className: e, ...t }) {
|
|
2157
2332
|
return /* @__PURE__ */ m("tfoot", {
|
|
2158
|
-
className:
|
|
2333
|
+
className: A("zen__sticky-bottom sticky bottom-0 z-20", e),
|
|
2159
2334
|
...t
|
|
2160
2335
|
});
|
|
2161
2336
|
}
|
|
2162
|
-
function
|
|
2337
|
+
function Kt({ className: e, ...t }) {
|
|
2163
2338
|
return /* @__PURE__ */ m("tr", {
|
|
2164
|
-
className:
|
|
2339
|
+
className: A("group", e),
|
|
2165
2340
|
...t
|
|
2166
2341
|
});
|
|
2167
2342
|
}
|
|
2168
|
-
function
|
|
2343
|
+
function qt({ numeric: e, sticky: t, sortDirection: n, onSort: r, scope: i = "col", className: a, children: o, ...s }) {
|
|
2169
2344
|
return /* @__PURE__ */ m("th", {
|
|
2170
2345
|
scope: i,
|
|
2171
2346
|
"aria-sort": n === "asc" ? "ascending" : n === "desc" ? "descending" : void 0,
|
|
2172
|
-
className:
|
|
2347
|
+
className: A("border-tint/[0.07] text-muted-foreground border-b px-3 py-2.5 align-middle text-xs leading-5 font-medium tracking-wider whitespace-nowrap uppercase", t === "left" && "zen__sticky-left sticky left-0 z-10", e ? "text-right" : "text-left", a),
|
|
2173
2348
|
...s,
|
|
2174
2349
|
children: r ? /* @__PURE__ */ h("button", {
|
|
2175
2350
|
type: "button",
|
|
2176
2351
|
onClick: r,
|
|
2177
|
-
className:
|
|
2352
|
+
className: A("hover:text-foreground inline-flex items-center gap-1 align-middle leading-5 tracking-wider uppercase", e && "flex-row-reverse"),
|
|
2178
2353
|
children: [o, /* @__PURE__ */ m("span", {
|
|
2179
2354
|
"aria-hidden": !0,
|
|
2180
2355
|
className: "inline-flex w-3",
|
|
2181
|
-
children: n === "asc" ? /* @__PURE__ */ m(
|
|
2356
|
+
children: n === "asc" ? /* @__PURE__ */ m(st, {
|
|
2182
2357
|
className: "size-3",
|
|
2183
2358
|
strokeWidth: 2.5
|
|
2184
|
-
}) : n === "desc" ? /* @__PURE__ */ m(
|
|
2359
|
+
}) : n === "desc" ? /* @__PURE__ */ m(it, {
|
|
2185
2360
|
className: "size-3",
|
|
2186
2361
|
strokeWidth: 2.5
|
|
2187
2362
|
}) : null
|
|
@@ -2189,19 +2364,19 @@ function Rt({ numeric: e, sticky: t, sortDirection: n, onSort: r, scope: i = "co
|
|
|
2189
2364
|
}) : o
|
|
2190
2365
|
});
|
|
2191
2366
|
}
|
|
2192
|
-
function
|
|
2367
|
+
function Jt({ numeric: e, sticky: t, className: n, ...r }) {
|
|
2193
2368
|
return /* @__PURE__ */ m("td", {
|
|
2194
|
-
className:
|
|
2369
|
+
className: A("border-tint/[0.045] border-b px-3 py-2.5 transition-colors duration-150", "group-hover:[background-image:linear-gradient(oklch(var(--tint)/0.035),oklch(var(--tint)/0.035))]", t === "left" && "zen__sticky-left sticky left-0 z-10 shadow-[inset_-1px_0_0_oklch(var(--tint)/0.06)]", e && "text-right tabular-nums", n),
|
|
2195
2370
|
...r
|
|
2196
2371
|
});
|
|
2197
2372
|
}
|
|
2198
|
-
function
|
|
2373
|
+
function Yt({ numeric: e, sticky: t, className: n, ...r }) {
|
|
2199
2374
|
return /* @__PURE__ */ m("td", {
|
|
2200
|
-
className:
|
|
2375
|
+
className: A("border-tint/[0.07] h-9 border-t px-3 font-medium whitespace-nowrap", t === "left" && "zen__sticky-left sticky left-0 z-10 shadow-[inset_-1px_0_0_oklch(var(--tint)/0.06)]", e && "text-right tabular-nums", n),
|
|
2201
2376
|
...r
|
|
2202
2377
|
});
|
|
2203
2378
|
}
|
|
2204
|
-
function
|
|
2379
|
+
function Xt({ height: e, colSpan: t }) {
|
|
2205
2380
|
return e <= 0 ? null : /* @__PURE__ */ m("tr", {
|
|
2206
2381
|
"aria-hidden": !0,
|
|
2207
2382
|
children: /* @__PURE__ */ m("td", {
|
|
@@ -2214,14 +2389,14 @@ function Vt({ height: e, colSpan: t }) {
|
|
|
2214
2389
|
})
|
|
2215
2390
|
});
|
|
2216
2391
|
}
|
|
2217
|
-
function
|
|
2392
|
+
function Zt({ colSpan: e, children: t = "Nothing here yet." }) {
|
|
2218
2393
|
return /* @__PURE__ */ m("tr", { children: /* @__PURE__ */ m("td", {
|
|
2219
2394
|
colSpan: e,
|
|
2220
2395
|
className: "text-muted-foreground px-3 py-8 text-center",
|
|
2221
2396
|
children: t
|
|
2222
2397
|
}) });
|
|
2223
2398
|
}
|
|
2224
|
-
function
|
|
2399
|
+
function Qt(e, t, n) {
|
|
2225
2400
|
let [r, i] = d(n ?? null);
|
|
2226
2401
|
return {
|
|
2227
2402
|
rows: l(() => {
|
|
@@ -2249,7 +2424,7 @@ function Ut(e, t, n) {
|
|
|
2249
2424
|
}
|
|
2250
2425
|
//#endregion
|
|
2251
2426
|
//#region packages/table-of-contents/index.tsx
|
|
2252
|
-
function
|
|
2427
|
+
function $t({ items: e, title: t = "On this page", className: n }) {
|
|
2253
2428
|
let [r, i] = d();
|
|
2254
2429
|
return o(() => {
|
|
2255
2430
|
if (typeof IntersectionObserver > "u") return;
|
|
@@ -2261,18 +2436,18 @@ function Wt({ items: e, title: t = "On this page", className: n }) {
|
|
|
2261
2436
|
return t.forEach((e) => r.observe(e)), () => r.disconnect();
|
|
2262
2437
|
}, [e]), e.length ? /* @__PURE__ */ h("nav", {
|
|
2263
2438
|
"aria-label": t,
|
|
2264
|
-
className:
|
|
2439
|
+
className: A("zen__toc flex flex-col gap-3", n),
|
|
2265
2440
|
children: [/* @__PURE__ */ m("p", {
|
|
2266
2441
|
className: "text-muted-foreground mt-0! text-[0.68rem] tracking-[0.1em] uppercase",
|
|
2267
2442
|
children: t
|
|
2268
2443
|
}), /* @__PURE__ */ m("ul", {
|
|
2269
2444
|
className: "border-tint/[0.07] flex flex-col gap-2 border-l text-sm",
|
|
2270
2445
|
children: e.map((e) => /* @__PURE__ */ m("li", {
|
|
2271
|
-
className:
|
|
2446
|
+
className: A("-ml-px", e.depth === 2 && "pl-3"),
|
|
2272
2447
|
children: /* @__PURE__ */ m("a", {
|
|
2273
2448
|
href: `#${e.id}`,
|
|
2274
2449
|
"aria-current": e.id === r ? "location" : void 0,
|
|
2275
|
-
className:
|
|
2450
|
+
className: A("text-muted-foreground hover:text-foreground block border-l border-transparent pl-3 transition-colors", "aria-[current=location]:border-primary aria-[current=location]:text-foreground"),
|
|
2276
2451
|
children: e.label
|
|
2277
2452
|
})
|
|
2278
2453
|
}, e.id))
|
|
@@ -2281,15 +2456,15 @@ function Wt({ items: e, title: t = "On this page", className: n }) {
|
|
|
2281
2456
|
}
|
|
2282
2457
|
//#endregion
|
|
2283
2458
|
//#region packages/tabs/index.tsx
|
|
2284
|
-
var
|
|
2285
|
-
function
|
|
2286
|
-
let t = a(
|
|
2459
|
+
var en = n(null);
|
|
2460
|
+
function tn(e) {
|
|
2461
|
+
let t = a(en);
|
|
2287
2462
|
if (!t) throw Error(`<${e}> must be inside <Tabs>`);
|
|
2288
2463
|
return t;
|
|
2289
2464
|
}
|
|
2290
|
-
function
|
|
2465
|
+
function nn({ value: e, defaultValue: t = "", onValueChange: n, className: r, ...i }) {
|
|
2291
2466
|
let [a, o] = d(t), c = e ?? a, l = s();
|
|
2292
|
-
return /* @__PURE__ */ m(
|
|
2467
|
+
return /* @__PURE__ */ m(en.Provider, {
|
|
2293
2468
|
value: {
|
|
2294
2469
|
value: c,
|
|
2295
2470
|
select: (t) => {
|
|
@@ -2298,14 +2473,14 @@ function qt({ value: e, defaultValue: t = "", onValueChange: n, className: r, ..
|
|
|
2298
2473
|
idFor: (e, t) => `${l}-${e}-${t.replace(/\s+/g, "-")}`
|
|
2299
2474
|
},
|
|
2300
2475
|
children: /* @__PURE__ */ m("div", {
|
|
2301
|
-
className:
|
|
2476
|
+
className: A("zen__tabs flex flex-col gap-4", r),
|
|
2302
2477
|
...i
|
|
2303
2478
|
})
|
|
2304
2479
|
});
|
|
2305
2480
|
}
|
|
2306
|
-
var
|
|
2307
|
-
function
|
|
2308
|
-
let { value: i } =
|
|
2481
|
+
var rn = n("underline");
|
|
2482
|
+
function an({ variant: e = "underline", className: t, children: n, ...r }) {
|
|
2483
|
+
let { value: i } = tn("TabList"), a = e === "pills", o = u(null), [s, l] = d({
|
|
2309
2484
|
left: 0,
|
|
2310
2485
|
width: 0
|
|
2311
2486
|
});
|
|
@@ -2342,9 +2517,9 @@ function Yt({ variant: e = "underline", className: t, children: n, ...r }) {
|
|
|
2342
2517
|
let i = t[(r + t.length) % t.length];
|
|
2343
2518
|
i.focus(), i.click();
|
|
2344
2519
|
},
|
|
2345
|
-
className:
|
|
2520
|
+
className: A(a ? je : "border-border relative flex gap-1 border-b", t),
|
|
2346
2521
|
...r,
|
|
2347
|
-
children: [/* @__PURE__ */ m(
|
|
2522
|
+
children: [/* @__PURE__ */ m(rn.Provider, {
|
|
2348
2523
|
value: e,
|
|
2349
2524
|
children: n
|
|
2350
2525
|
}), a ? s.width > 0 && /* @__PURE__ */ m("span", {
|
|
@@ -2364,8 +2539,8 @@ function Yt({ variant: e = "underline", className: t, children: n, ...r }) {
|
|
|
2364
2539
|
})]
|
|
2365
2540
|
});
|
|
2366
2541
|
}
|
|
2367
|
-
function
|
|
2368
|
-
let { value: i, select: o, idFor: s } =
|
|
2542
|
+
function on({ value: e, className: t, onClick: n, ...r }) {
|
|
2543
|
+
let { value: i, select: o, idFor: s } = tn("Tab"), c = a(rn), l = i === e;
|
|
2369
2544
|
return /* @__PURE__ */ m("button", {
|
|
2370
2545
|
type: "button",
|
|
2371
2546
|
role: "tab",
|
|
@@ -2377,24 +2552,24 @@ function Xt({ value: e, className: t, onClick: n, ...r }) {
|
|
|
2377
2552
|
onClick: (t) => {
|
|
2378
2553
|
o(e), n?.(t);
|
|
2379
2554
|
},
|
|
2380
|
-
className:
|
|
2555
|
+
className: A(c === "pills" ? Ne : "focus-visible:ring-ring px-3 py-2 text-sm whitespace-nowrap outline-hidden select-none focus-visible:ring-1", "text-muted-foreground hover:text-foreground data-active:text-foreground", t),
|
|
2381
2556
|
...r
|
|
2382
2557
|
});
|
|
2383
2558
|
}
|
|
2384
|
-
function
|
|
2385
|
-
let { value: r, idFor: i } =
|
|
2559
|
+
function sn({ value: e, className: t, ...n }) {
|
|
2560
|
+
let { value: r, idFor: i } = tn("TabPanel");
|
|
2386
2561
|
return r === e ? /* @__PURE__ */ m("div", {
|
|
2387
2562
|
role: "tabpanel",
|
|
2388
2563
|
id: i("panel", e),
|
|
2389
2564
|
"aria-labelledby": i("tab", e),
|
|
2390
2565
|
tabIndex: 0,
|
|
2391
|
-
className:
|
|
2566
|
+
className: A("outline-hidden", t),
|
|
2392
2567
|
...n
|
|
2393
2568
|
}) : null;
|
|
2394
2569
|
}
|
|
2395
2570
|
//#endregion
|
|
2396
2571
|
//#region packages/tree/index.tsx
|
|
2397
|
-
function
|
|
2572
|
+
function cn({ items: e, getKey: t, getChildren: n, defaultExpanded: r = !0, rowHeight: a = 36 }) {
|
|
2398
2573
|
let [o, s] = d(() => /* @__PURE__ */ new Set()), [c, f] = d(null), [p, m] = d(null), h = u(null), g = i((e) => o.has(e) !== r, [o, r]), _ = l(() => {
|
|
2399
2574
|
let r = [], i = (e, a, o) => {
|
|
2400
2575
|
for (let s of e) {
|
|
@@ -2454,7 +2629,7 @@ function Qt({ items: e, getKey: t, getChildren: n, defaultExpanded: r = !0, rowH
|
|
|
2454
2629
|
"aria-level": e.depth + 1,
|
|
2455
2630
|
"aria-expanded": e.hasChildren ? e.expanded : void 0,
|
|
2456
2631
|
"data-depth": e.depth,
|
|
2457
|
-
className:
|
|
2632
|
+
className: A(c && e.parentKey === c.key && "zen__tree-row-enter", p && e.parentKey === p && "zen__tree-row-exit"),
|
|
2458
2633
|
style: { "--row-h": `${a - 1}px` },
|
|
2459
2634
|
onAnimationEnd: (t) => {
|
|
2460
2635
|
t.animationName === "zen-row-close" && p && e.parentKey === p && h.current?.();
|
|
@@ -2467,43 +2642,43 @@ function Qt({ items: e, getKey: t, getChildren: n, defaultExpanded: r = !0, rowH
|
|
|
2467
2642
|
rowHeight: a
|
|
2468
2643
|
};
|
|
2469
2644
|
}
|
|
2470
|
-
function
|
|
2645
|
+
function ln({ row: e, tree: t, className: n, style: r, ...i }) {
|
|
2471
2646
|
let a = t.rowProps(e);
|
|
2472
|
-
return /* @__PURE__ */ m(
|
|
2647
|
+
return /* @__PURE__ */ m(Kt, {
|
|
2473
2648
|
...i,
|
|
2474
2649
|
...a,
|
|
2475
|
-
className:
|
|
2650
|
+
className: A(a.className, n),
|
|
2476
2651
|
style: {
|
|
2477
2652
|
...a.style,
|
|
2478
2653
|
...r
|
|
2479
2654
|
}
|
|
2480
2655
|
});
|
|
2481
2656
|
}
|
|
2482
|
-
function
|
|
2483
|
-
return /* @__PURE__ */ m(
|
|
2657
|
+
function un({ numeric: e, className: t, children: n, ...r }) {
|
|
2658
|
+
return /* @__PURE__ */ m(Jt, {
|
|
2484
2659
|
numeric: e,
|
|
2485
|
-
className:
|
|
2660
|
+
className: A("py-0 whitespace-nowrap", t),
|
|
2486
2661
|
...r,
|
|
2487
2662
|
children: /* @__PURE__ */ m("div", {
|
|
2488
|
-
className:
|
|
2663
|
+
className: A("zen__tree-cell flex h-[var(--row-h)] items-center", e && "justify-end"),
|
|
2489
2664
|
children: n
|
|
2490
2665
|
})
|
|
2491
2666
|
});
|
|
2492
2667
|
}
|
|
2493
|
-
function
|
|
2668
|
+
function dn({ row: e, tree: t, indent: n = 20, children: r, className: i }) {
|
|
2494
2669
|
return /* @__PURE__ */ h("div", {
|
|
2495
|
-
className:
|
|
2670
|
+
className: A("flex min-w-0 flex-1 items-center gap-1", i),
|
|
2496
2671
|
style: { paddingLeft: e.depth * n },
|
|
2497
|
-
children: [e.hasChildren ? /* @__PURE__ */ m(
|
|
2672
|
+
children: [e.hasChildren ? /* @__PURE__ */ m(fn, { ...t.toggleProps(e) }) : /* @__PURE__ */ m("span", { className: "-ml-1 w-6 shrink-0" }), r]
|
|
2498
2673
|
});
|
|
2499
2674
|
}
|
|
2500
|
-
function
|
|
2675
|
+
function fn({ expanded: e, onToggle: t, className: n, ...r }) {
|
|
2501
2676
|
return /* @__PURE__ */ m("button", {
|
|
2502
2677
|
type: "button",
|
|
2503
2678
|
onClick: t,
|
|
2504
2679
|
"aria-label": e ? "Collapse" : "Expand",
|
|
2505
2680
|
"aria-expanded": e,
|
|
2506
|
-
className:
|
|
2681
|
+
className: A("text-muted-foreground hover:bg-tint/[0.08] hover:text-foreground focus-visible:ring-ring/50 -ml-1 grid size-6 shrink-0 place-items-center rounded-md outline-hidden transition-colors focus-visible:ring-2", n),
|
|
2507
2682
|
...r,
|
|
2508
2683
|
children: /* @__PURE__ */ m("svg", {
|
|
2509
2684
|
viewBox: "0 0 16 16",
|
|
@@ -2513,180 +2688,49 @@ function nn({ expanded: e, onToggle: t, className: n, ...r }) {
|
|
|
2513
2688
|
strokeLinecap: "round",
|
|
2514
2689
|
strokeLinejoin: "round",
|
|
2515
2690
|
"aria-hidden": !0,
|
|
2516
|
-
className:
|
|
2691
|
+
className: A("size-4 transition-transform duration-200 ease-out", e && "rotate-90"),
|
|
2517
2692
|
children: /* @__PURE__ */ m("path", { d: "m6 3.5 4.5 4.5L6 12.5" })
|
|
2518
2693
|
})
|
|
2519
2694
|
});
|
|
2520
2695
|
}
|
|
2521
2696
|
//#endregion
|
|
2522
2697
|
//#region packages/textarea/index.tsx
|
|
2523
|
-
function
|
|
2698
|
+
function pn(e) {
|
|
2524
2699
|
let { className: t, ...n } = e;
|
|
2525
2700
|
return /* @__PURE__ */ m("textarea", {
|
|
2526
|
-
className:
|
|
2701
|
+
className: A(H.replace("h-10", ""), "h-32 w-full resize-y py-2", "read-only:text-foreground read-only:cursor-default read-only:border-none! read-only:bg-transparent read-only:shadow-none! read-only:outline-hidden!", t),
|
|
2527
2702
|
...n
|
|
2528
2703
|
});
|
|
2529
2704
|
}
|
|
2530
2705
|
//#endregion
|
|
2531
|
-
//#region packages/toast/index.tsx
|
|
2532
|
-
var an = 5e3, on = 300, sn = n(null);
|
|
2533
|
-
function cn({ children: e, offset: t, viewportClassName: n }) {
|
|
2534
|
-
M();
|
|
2535
|
-
let [r, a] = d([]), [s, c] = d(!1), l = u(0);
|
|
2536
|
-
o(() => c(!0), []);
|
|
2537
|
-
let f = i((e) => {
|
|
2538
|
-
a((t) => t.map((t) => t.id === e ? {
|
|
2539
|
-
...t,
|
|
2540
|
-
leaving: !0
|
|
2541
|
-
} : t)), setTimeout(() => a((t) => t.filter((t) => t.id !== e)), on);
|
|
2542
|
-
}, []), p = i((e, { description: t, tone: n = "info", action: r, timeout: i } = {}) => {
|
|
2543
|
-
let o = l.current++, s = {
|
|
2544
|
-
id: o,
|
|
2545
|
-
title: e,
|
|
2546
|
-
description: t,
|
|
2547
|
-
tone: n,
|
|
2548
|
-
action: r,
|
|
2549
|
-
timeout: i ?? (r ? 1e4 : an)
|
|
2550
|
-
};
|
|
2551
|
-
return a((e) => [...e, s]), o;
|
|
2552
|
-
}, []), _ = r.slice(-3);
|
|
2553
|
-
return /* @__PURE__ */ h(sn.Provider, {
|
|
2554
|
-
value: p,
|
|
2555
|
-
children: [e, s && g(/* @__PURE__ */ m("section", {
|
|
2556
|
-
"aria-label": "Notifications",
|
|
2557
|
-
className: k("zen__toast-viewport fixed right-4 bottom-[calc(var(--zen-toast-offset,1rem)+env(safe-area-inset-bottom))] z-50 flex w-[calc(100vw-2rem)] flex-col-reverse gap-2.5 md:bottom-5 md:w-[24rem]", n),
|
|
2558
|
-
style: t ? { "--zen-toast-offset": t } : void 0,
|
|
2559
|
-
children: _.map((e) => /* @__PURE__ */ m(dn, {
|
|
2560
|
-
toast: e,
|
|
2561
|
-
onDismiss: () => f(e.id)
|
|
2562
|
-
}, e.id))
|
|
2563
|
-
}), document.body)]
|
|
2564
|
-
});
|
|
2565
|
-
}
|
|
2566
|
-
function ln() {
|
|
2567
|
-
let e = a(sn);
|
|
2568
|
-
if (!e) throw Error("useToast() needs a <ToastProvider> above it");
|
|
2569
|
-
return e;
|
|
2570
|
-
}
|
|
2571
|
-
var un = {
|
|
2572
|
-
success: {
|
|
2573
|
-
icon: G,
|
|
2574
|
-
ring: "border-primary/30",
|
|
2575
|
-
badge: "bg-primary/15 text-primary",
|
|
2576
|
-
bar: "bg-primary",
|
|
2577
|
-
glow: "shadow-[0_18px_50px_-18px_oklch(var(--glow)/0.55)]"
|
|
2578
|
-
},
|
|
2579
|
-
error: {
|
|
2580
|
-
icon: K,
|
|
2581
|
-
ring: "border-destructive/40",
|
|
2582
|
-
badge: "bg-destructive/15 text-destructive",
|
|
2583
|
-
bar: "bg-destructive",
|
|
2584
|
-
glow: "shadow-[0_18px_50px_-18px_oklch(var(--destructive)/0.55)]"
|
|
2585
|
-
},
|
|
2586
|
-
info: {
|
|
2587
|
-
icon: q,
|
|
2588
|
-
ring: "border-tint/10",
|
|
2589
|
-
badge: "bg-tint/[0.08] text-foreground",
|
|
2590
|
-
bar: "bg-muted-foreground",
|
|
2591
|
-
glow: "shadow-[var(--toast-shadow)]"
|
|
2592
|
-
}
|
|
2593
|
-
};
|
|
2594
|
-
function dn({ toast: e, onDismiss: t }) {
|
|
2595
|
-
let n = un[e.tone] ?? un.info, r = n.icon, [i, a] = d(!1), s = u(e.timeout);
|
|
2596
|
-
return o(() => {
|
|
2597
|
-
if (!e.timeout || i || e.leaving) return;
|
|
2598
|
-
let n = Date.now(), r = setTimeout(t, s.current);
|
|
2599
|
-
return () => {
|
|
2600
|
-
clearTimeout(r), s.current -= Date.now() - n;
|
|
2601
|
-
};
|
|
2602
|
-
}, [
|
|
2603
|
-
i,
|
|
2604
|
-
e.timeout,
|
|
2605
|
-
e.leaving,
|
|
2606
|
-
t
|
|
2607
|
-
]), /* @__PURE__ */ h("div", {
|
|
2608
|
-
role: e.tone === "error" ? "alert" : "status",
|
|
2609
|
-
"aria-atomic": "true",
|
|
2610
|
-
onMouseEnter: () => a(!0),
|
|
2611
|
-
onMouseLeave: () => a(!1),
|
|
2612
|
-
className: k("zen__toast group glass glass-blur text-card-foreground relative flex items-start gap-3 overflow-hidden rounded-2xl border p-3.5 pr-10 select-none", "transition-[transform,opacity] duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)]", "starting:translate-y-3 starting:scale-[0.97] starting:opacity-0", e.leaving && "translate-x-6 opacity-0", n.ring, n.glow),
|
|
2613
|
-
children: [
|
|
2614
|
-
/* @__PURE__ */ m("span", {
|
|
2615
|
-
className: k("mt-0.5 grid size-8 shrink-0 place-items-center rounded-full", n.badge),
|
|
2616
|
-
"aria-hidden": !0,
|
|
2617
|
-
children: /* @__PURE__ */ m(r, { className: "size-4" })
|
|
2618
|
-
}),
|
|
2619
|
-
/* @__PURE__ */ h("div", {
|
|
2620
|
-
className: "flex min-w-0 flex-1 flex-col gap-0.5 pt-0.5",
|
|
2621
|
-
children: [
|
|
2622
|
-
/* @__PURE__ */ m("div", {
|
|
2623
|
-
className: "text-sm font-semibold",
|
|
2624
|
-
children: e.title
|
|
2625
|
-
}),
|
|
2626
|
-
e.description && /* @__PURE__ */ m("div", {
|
|
2627
|
-
className: "text-muted-foreground text-sm leading-5",
|
|
2628
|
-
children: e.description
|
|
2629
|
-
}),
|
|
2630
|
-
e.action && /* @__PURE__ */ m("button", {
|
|
2631
|
-
type: "button",
|
|
2632
|
-
onClick: () => {
|
|
2633
|
-
e.action?.onClick(), t();
|
|
2634
|
-
},
|
|
2635
|
-
className: "border-tint/10 bg-tint/[0.06] hover:bg-tint/[0.12] focus-visible:ring-ring/50 mt-2 self-start rounded-lg border px-3 py-1 text-xs font-medium outline-hidden transition-colors focus-visible:ring-2",
|
|
2636
|
-
children: e.action.label
|
|
2637
|
-
})
|
|
2638
|
-
]
|
|
2639
|
-
}),
|
|
2640
|
-
/* @__PURE__ */ m("button", {
|
|
2641
|
-
type: "button",
|
|
2642
|
-
"aria-label": "Dismiss",
|
|
2643
|
-
onClick: t,
|
|
2644
|
-
className: "text-muted-foreground hover:bg-tint/[0.07] hover:text-foreground focus-visible:ring-ring/50 absolute top-2.5 right-2.5 grid size-7 place-items-center rounded-lg outline-hidden transition-colors focus-visible:ring-2",
|
|
2645
|
-
children: /* @__PURE__ */ m("svg", {
|
|
2646
|
-
viewBox: "0 0 16 16",
|
|
2647
|
-
fill: "none",
|
|
2648
|
-
stroke: "currentColor",
|
|
2649
|
-
strokeWidth: "1.8",
|
|
2650
|
-
strokeLinecap: "round",
|
|
2651
|
-
className: "size-3.5",
|
|
2652
|
-
"aria-hidden": !0,
|
|
2653
|
-
children: /* @__PURE__ */ m("path", { d: "m4 4 8 8M12 4l-8 8" })
|
|
2654
|
-
})
|
|
2655
|
-
}),
|
|
2656
|
-
e.timeout > 0 && /* @__PURE__ */ m("span", {
|
|
2657
|
-
"aria-hidden": !0,
|
|
2658
|
-
className: k("zen__toast-timer absolute bottom-0 left-0 h-0.5 w-full origin-left opacity-60 group-hover:[animation-play-state:paused]", n.bar),
|
|
2659
|
-
style: { animationDuration: `${e.timeout}ms` }
|
|
2660
|
-
})
|
|
2661
|
-
]
|
|
2662
|
-
});
|
|
2663
|
-
}
|
|
2664
|
-
//#endregion
|
|
2665
2706
|
//#region packages/toggle/index.tsx
|
|
2666
|
-
function
|
|
2667
|
-
let { className: t, onChange: n,
|
|
2707
|
+
function mn(e) {
|
|
2708
|
+
let { className: t, onChange: n, onKeyDown: r, disabled: i, ...a } = e;
|
|
2668
2709
|
return /* @__PURE__ */ h("label", {
|
|
2669
|
-
className:
|
|
2710
|
+
className: A("zen__toggle border-tint/10 bg-tint/[0.06] relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border p-0.5", "has-focus-visible:ring-glow/50 transition-[background-color,box-shadow,border-color] duration-300 has-focus-visible:ring-2", "has-checked:border-glow/60 has-checked:bg-glow/40 has-checked:shadow-[0_0_18px_-2px_oklch(var(--glow)/0.8)]", "has-disabled:cursor-not-allowed has-disabled:opacity-50", t),
|
|
2670
2711
|
children: [/* @__PURE__ */ m("input", {
|
|
2671
2712
|
type: "checkbox",
|
|
2672
2713
|
role: "switch",
|
|
2673
2714
|
className: "peer sr-only",
|
|
2674
|
-
disabled:
|
|
2715
|
+
disabled: i,
|
|
2675
2716
|
onChange: (e) => n?.(e.target.checked),
|
|
2676
|
-
|
|
2717
|
+
onKeyDown: (e) => {
|
|
2718
|
+
r?.(e), e.key === "Enter" && !e.defaultPrevented && (e.preventDefault(), e.currentTarget.click());
|
|
2719
|
+
},
|
|
2720
|
+
...a
|
|
2677
2721
|
}), /* @__PURE__ */ m("span", {
|
|
2678
2722
|
"aria-hidden": !0,
|
|
2679
|
-
className:
|
|
2723
|
+
className: A("size-[1.125rem] rounded-full bg-white/70 shadow-md", "transition-[translate,background-color] duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)]", "peer-checked:translate-x-5 peer-checked:bg-white")
|
|
2680
2724
|
})]
|
|
2681
2725
|
});
|
|
2682
2726
|
}
|
|
2683
2727
|
//#endregion
|
|
2684
2728
|
//#region packages/theme-toggle/index.tsx
|
|
2685
|
-
var
|
|
2686
|
-
function
|
|
2687
|
-
return /* @__PURE__ */ m("script", { dangerouslySetInnerHTML: { __html:
|
|
2729
|
+
var hn = (e = "theme") => `try{var t=localStorage.getItem(${JSON.stringify(e)}),r=document.documentElement;if(t==='light'||t==='dark'){r.classList.remove('light','dark');r.classList.add(t)}}catch(e){}`;
|
|
2730
|
+
function gn({ storageKey: e = "theme" }) {
|
|
2731
|
+
return /* @__PURE__ */ m("script", { dangerouslySetInnerHTML: { __html: hn(e) } });
|
|
2688
2732
|
}
|
|
2689
|
-
function
|
|
2733
|
+
function _n({ storageKey: e = "theme", className: t }) {
|
|
2690
2734
|
let [n, r] = d("dark");
|
|
2691
2735
|
o(() => r(document.documentElement.classList.contains("light") ? "light" : "dark"), []);
|
|
2692
2736
|
let i = n === "dark" ? "light" : "dark";
|
|
@@ -2701,7 +2745,7 @@ function hn({ storageKey: e = "theme", className: t }) {
|
|
|
2701
2745
|
} catch {}
|
|
2702
2746
|
r(i);
|
|
2703
2747
|
},
|
|
2704
|
-
className:
|
|
2748
|
+
className: A("zen__theme-toggle text-muted-foreground hover:bg-tint/[0.06] hover:text-foreground focus-visible:ring-ring/50 grid size-9 place-items-center rounded-lg outline-hidden focus-visible:ring-2", t),
|
|
2705
2749
|
children: /* @__PURE__ */ m("svg", {
|
|
2706
2750
|
viewBox: "0 0 16 16",
|
|
2707
2751
|
fill: "none",
|
|
@@ -2720,12 +2764,12 @@ function hn({ storageKey: e = "theme", className: t }) {
|
|
|
2720
2764
|
}
|
|
2721
2765
|
//#endregion
|
|
2722
2766
|
//#region packages/utils/theme.ts
|
|
2723
|
-
var
|
|
2767
|
+
var vn = [
|
|
2724
2768
|
"mono",
|
|
2725
2769
|
"muted",
|
|
2726
2770
|
"balanced",
|
|
2727
2771
|
"vivid"
|
|
2728
|
-
],
|
|
2772
|
+
], yn = [
|
|
2729
2773
|
{
|
|
2730
2774
|
id: "violet",
|
|
2731
2775
|
label: "Violet",
|
|
@@ -2775,7 +2819,7 @@ var gn = [
|
|
|
2775
2819
|
intensity: "mono",
|
|
2776
2820
|
tint: "neutral"
|
|
2777
2821
|
}
|
|
2778
|
-
],
|
|
2822
|
+
], bn = {
|
|
2779
2823
|
preset: "violet",
|
|
2780
2824
|
hue: 295,
|
|
2781
2825
|
intensity: "balanced",
|
|
@@ -2784,8 +2828,8 @@ var gn = [
|
|
|
2784
2828
|
glow: "soft",
|
|
2785
2829
|
topography: "subtle"
|
|
2786
2830
|
};
|
|
2787
|
-
function
|
|
2788
|
-
let n =
|
|
2831
|
+
function xn(e, t) {
|
|
2832
|
+
let n = yn.find((e) => e.id === t);
|
|
2789
2833
|
return {
|
|
2790
2834
|
...e,
|
|
2791
2835
|
preset: n.id,
|
|
@@ -2794,21 +2838,21 @@ function vn(e, t) {
|
|
|
2794
2838
|
tint: n.tint
|
|
2795
2839
|
};
|
|
2796
2840
|
}
|
|
2797
|
-
function
|
|
2841
|
+
function Sn(e, t) {
|
|
2798
2842
|
return {
|
|
2799
2843
|
...e,
|
|
2800
2844
|
...t,
|
|
2801
2845
|
preset: "custom"
|
|
2802
2846
|
};
|
|
2803
2847
|
}
|
|
2804
|
-
var
|
|
2848
|
+
var Cn = {
|
|
2805
2849
|
mono: .012,
|
|
2806
2850
|
muted: .07,
|
|
2807
2851
|
balanced: .13,
|
|
2808
2852
|
vivid: .19
|
|
2809
|
-
}, $ = (e, t, n) => `${
|
|
2810
|
-
function
|
|
2811
|
-
let n = e.hue, r =
|
|
2853
|
+
}, $ = (e, t, n) => `${wn(e, 3)} ${wn(t, 3)} ${wn((n % 360 + 360) % 360, 1)}`, wn = (e, t) => Math.round(e * 10 ** t) / 10 ** t;
|
|
2854
|
+
function Tn(e, t = "dark") {
|
|
2855
|
+
let n = e.hue, r = Cn[e.intensity], i = e.contrast === "high", a = e.tint === "tinted" ? Math.min(.014, r * .12) : .003, o = e.intensity === "mono", s = (e, t = 1) => $(e, a * t, n), c = { "topo-strength": String({
|
|
2812
2856
|
off: 0,
|
|
2813
2857
|
subtle: .55,
|
|
2814
2858
|
visible: 1
|
|
@@ -2873,20 +2917,20 @@ function Sn(e, t = "dark") {
|
|
|
2873
2917
|
...c
|
|
2874
2918
|
};
|
|
2875
2919
|
}
|
|
2876
|
-
function
|
|
2920
|
+
function En(e, { appearance: t = "dark", target: n } = {}) {
|
|
2877
2921
|
let r = n ?? document.documentElement;
|
|
2878
|
-
for (let [n, i] of Object.entries(
|
|
2922
|
+
for (let [n, i] of Object.entries(Tn(e, t))) r.style.setProperty(`--${n}`, i);
|
|
2879
2923
|
}
|
|
2880
|
-
function
|
|
2924
|
+
function Dn(e) {
|
|
2881
2925
|
let t = e ?? document.documentElement;
|
|
2882
|
-
for (let e of Object.keys(
|
|
2926
|
+
for (let e of Object.keys(Tn(bn))) t.style.removeProperty(`--${e}`);
|
|
2883
2927
|
}
|
|
2884
|
-
function
|
|
2885
|
-
let t = typeof e == "object" && e ? e : {}, n = (e, t, n) => t.includes(e) ? e : n, r =
|
|
2928
|
+
function On(e) {
|
|
2929
|
+
let t = typeof e == "object" && e ? e : {}, n = (e, t, n) => t.includes(e) ? e : n, r = bn, i = yn.map((e) => e.id);
|
|
2886
2930
|
return {
|
|
2887
2931
|
preset: typeof t.preset == "string" && (t.preset === "custom" || i.includes(t.preset)) ? t.preset : r.preset,
|
|
2888
2932
|
hue: typeof t.hue == "number" && Number.isFinite(t.hue) ? (Math.round(t.hue) % 360 + 360) % 360 : r.hue,
|
|
2889
|
-
intensity: n(t.intensity,
|
|
2933
|
+
intensity: n(t.intensity, vn, r.intensity),
|
|
2890
2934
|
tint: n(t.tint, ["neutral", "tinted"], r.tint),
|
|
2891
2935
|
contrast: n(t.contrast, ["standard", "high"], r.contrast),
|
|
2892
2936
|
glow: n(t.glow, [
|
|
@@ -2901,7 +2945,7 @@ function Tn(e) {
|
|
|
2901
2945
|
], r.topography)
|
|
2902
2946
|
};
|
|
2903
2947
|
}
|
|
2904
|
-
function
|
|
2948
|
+
function kn(e) {
|
|
2905
2949
|
let [t, n, r] = e.split(" ").map(Number), i = n * Math.cos(r * Math.PI / 180), a = n * Math.sin(r * Math.PI / 180), o = (t + .3963377774 * i + .2158037573 * a) ** 3, s = (t - .1055613458 * i - .0638541728 * a) ** 3, c = (t - .0894841775 * i - 1.291485548 * a) ** 3, l = (e) => Math.min(1, Math.max(0, e));
|
|
2906
2950
|
return [
|
|
2907
2951
|
l(4.0767416621 * o - 3.3077115913 * s + .2309699292 * c),
|
|
@@ -2909,18 +2953,18 @@ function En(e) {
|
|
|
2909
2953
|
l(-.0041960863 * o - .7034186147 * s + 1.707614701 * c)
|
|
2910
2954
|
];
|
|
2911
2955
|
}
|
|
2912
|
-
function
|
|
2956
|
+
function An(e, t) {
|
|
2913
2957
|
let n = (e) => {
|
|
2914
|
-
let [t, n, r] =
|
|
2958
|
+
let [t, n, r] = kn(e);
|
|
2915
2959
|
return .2126 * t + .7152 * n + .0722 * r;
|
|
2916
2960
|
}, [r, i] = [n(e), n(t)].sort((e, t) => t - e);
|
|
2917
2961
|
return (r + .05) / (i + .05);
|
|
2918
2962
|
}
|
|
2919
2963
|
//#endregion
|
|
2920
2964
|
//#region packages/utils/useHydrated.ts
|
|
2921
|
-
var
|
|
2922
|
-
function
|
|
2923
|
-
return f(
|
|
2965
|
+
var jn = () => () => {};
|
|
2966
|
+
function Mn() {
|
|
2967
|
+
return f(jn, () => !0, () => !1);
|
|
2924
2968
|
}
|
|
2925
2969
|
//#endregion
|
|
2926
|
-
export {
|
|
2970
|
+
export { ue as ActionsMenu, q as AlertTriangle, ye as AnimatedMoney, ve as AnimatedNumber, be as Avatar, Se as Backdrop, B as Badge, V as Button, De as Card, K as Check, it as ChevronDown, at as ChevronLeft, ot as ChevronRight, st as ChevronUp, Ae as CodeBlock, Fe as Collapse, qe as ConfirmDialog, bn as DEFAULT_THEME, Ke as Dialog, tt as Dropdown, Je as EditableCell, Ye as Field, Z as FieldChevron, Xe as FormMessage, rt as Header, vn as INTENSITIES, R as ImageCropError, J as InfoCircle, ct as Input, $e as InputGroup, X as InputGroupAddon, Y as InputGroupInput, lt as Meter, bt as MoneyInput, I as MoneyParseError, yt as MonthPicker, Dt as NavPill, Tt as NavPillIndicator, wt as NavPills, yn as PRESETS, Ot as PageHeader, G as Popover, kt as ProgressRing, Ze as Search, At as Segmented, jt as Select, Mt as SideNav, Nt as SideNavGroup, Ft as SideNavLink, It as Skeleton, Lt as Slider, Te as Spinner, Oe as Stat, ke as StatRow, on as Tab, Rt as TabBar, Bt as TabBarItem, an as TabList, sn as TabPanel, Ht as Table, Wt as TableBody, Jt as TableCell, Vt as TableContainer, Zt as TableEmpty, Gt as TableFooter, Yt as TableFooterCell, qt as TableHead, Ut as TableHeader, $t as TableOfContents, Kt as TableRow, Xt as TableSpacerRow, nn as Tabs, pn as TextArea, gn as ThemeScript, _n as ThemeToggle, Be as ToastProvider, mn as Toggle, un as TreeCell, dn as TreeLabel, ln as TreeRow, fn as TreeToggle, Qe as XMark, pt as addMonths, M as applyGraphicsMode, xn as applyPreset, En as applyTheme, Ee as buttonVariants, An as contrastRatio, xe as cropImageToSquare, pe as currencySymbol, gt as currentMonth, Sn as customize, z as cva, A as cx, ce as detectGraphicsMode, fe as formatAmount, de as formatMoney, _t as formatMonth, ft as fromMonthIndex, dt as isMonth, F as minorDigits, Q as monthIndex, vt as monthNames, mt as monthRange, ht as monthsBetween, On as normalizeTheme, kn as oklchToLinearRgb, me as parseMoney, L as parseMoneyInput, Dn as resetTheme, hn as themeScript, Tn as themeVars, P as useAnchoredPopup, Mn as useHydrated, xt as useMoneyInput, Qt as useSort, Ue as useToast, Ve as useToastHost, cn as useTree, et as useVirtualList };
|