@rinzai/zen 0.3.2 → 0.4.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/actions-menu/index.d.ts.map +1 -1
- package/dist/animated-number/index.d.ts +25 -0
- package/dist/animated-number/index.d.ts.map +1 -0
- package/dist/avatar/index.d.ts +24 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/backdrop/index.d.ts.map +1 -1
- package/dist/badge/index.d.ts +1 -1
- package/dist/base.css +100 -0
- package/dist/button/index.d.ts +2 -2
- package/dist/button/index.d.ts.map +1 -1
- package/dist/collapse/index.d.ts.map +1 -1
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dropdown/index.d.ts.map +1 -1
- package/dist/editable-cell/index.d.ts +24 -0
- package/dist/editable-cell/index.d.ts.map +1 -0
- package/dist/field/index.d.ts +25 -0
- package/dist/field/index.d.ts.map +1 -0
- package/dist/header/index.d.ts.map +1 -1
- package/dist/icons/chevron-left.d.ts +3 -0
- package/dist/icons/chevron-left.d.ts.map +1 -0
- package/dist/icons/chevron-right.d.ts +3 -0
- package/dist/icons/chevron-right.d.ts.map +1 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/status.d.ts +2 -0
- package/dist/icons/status.d.ts.map +1 -0
- package/dist/index.d.ts +21 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/input-group/index.d.ts +17 -0
- package/dist/input-group/index.d.ts.map +1 -0
- package/dist/lib.d.ts +2 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/meter/index.d.ts +25 -0
- package/dist/meter/index.d.ts.map +1 -0
- package/dist/money-input/index.d.ts +70 -0
- package/dist/money-input/index.d.ts.map +1 -0
- package/dist/month-picker/index.d.ts +28 -0
- package/dist/month-picker/index.d.ts.map +1 -0
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/segmented/index.d.ts +2 -1
- package/dist/segmented/index.d.ts.map +1 -1
- package/dist/select/index.d.ts +32 -0
- package/dist/select/index.d.ts.map +1 -0
- package/dist/slider/index.d.ts +25 -0
- package/dist/slider/index.d.ts.map +1 -0
- package/dist/tab-bar/index.d.ts +23 -0
- package/dist/tab-bar/index.d.ts.map +1 -0
- package/dist/table/index.d.ts +76 -7
- package/dist/table/index.d.ts.map +1 -1
- package/dist/tailwind.css +7 -0
- package/dist/theme.css +888 -0
- package/dist/toast/index.d.ts +11 -3
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/tree/index.d.ts +79 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/utils/cx.d.ts +5 -0
- package/dist/utils/cx.d.ts.map +1 -1
- package/dist/utils/field-chevron.d.ts +6 -0
- package/dist/utils/field-chevron.d.ts.map +1 -0
- package/dist/utils/graphics.d.ts +20 -0
- package/dist/utils/graphics.d.ts.map +1 -0
- package/dist/utils/merge.d.ts +12 -0
- package/dist/utils/merge.d.ts.map +1 -0
- package/dist/utils/money.d.ts +30 -0
- package/dist/utils/money.d.ts.map +1 -0
- package/dist/utils/month.d.ts +16 -0
- package/dist/utils/month.d.ts.map +1 -0
- package/dist/utils/status-icons.d.ts +11 -0
- package/dist/utils/status-icons.d.ts.map +1 -0
- package/dist/utils/styles.d.ts +6 -0
- package/dist/utils/styles.d.ts.map +1 -1
- package/dist/utils/theme.d.ts +92 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/useAnchoredPopup.d.ts +36 -0
- package/dist/utils/useAnchoredPopup.d.ts.map +1 -0
- package/dist/utils/useHydrated.d.ts +3 -0
- package/dist/utils/useHydrated.d.ts.map +1 -0
- package/dist/utils/useVirtualList.d.ts +4 -0
- package/dist/utils/useVirtualList.d.ts.map +1 -1
- package/dist/variables.css +90 -0
- package/dist/zen.css +1 -1
- package/dist/zen.js +2107 -532
- package/package.json +9 -1
package/dist/zen.js
CHANGED
|
@@ -1,128 +1,677 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
//#region packages/utils/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { Children as e, cloneElement as t, createContext as n, isValidElement as r, useCallback as i, useContext as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as f } from "react";
|
|
3
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal as g } from "react-dom";
|
|
5
|
+
//#region packages/utils/merge.ts
|
|
6
|
+
function _(e) {
|
|
7
|
+
let t = v.get(e);
|
|
8
|
+
if (t !== void 0) return t;
|
|
9
|
+
let n = e.split(/\s+/).filter(Boolean), r = /* @__PURE__ */ new Set(), i = [];
|
|
10
|
+
for (let e = n.length - 1; e >= 0; e--) {
|
|
11
|
+
let t = n[e], a = y(t);
|
|
12
|
+
if (!a) {
|
|
13
|
+
i.push(t);
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
let o = a.scope;
|
|
17
|
+
if (!r.has(o + a.group)) {
|
|
18
|
+
r.add(o + a.group);
|
|
19
|
+
for (let e of ae[a.group] ?? []) r.add(o + e);
|
|
20
|
+
i.push(t);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
let a = i.reverse().join(" ");
|
|
24
|
+
return v.size >= 1e3 && v.clear(), v.set(e, a), a;
|
|
25
|
+
}
|
|
26
|
+
var v = /* @__PURE__ */ new Map();
|
|
27
|
+
function y(e) {
|
|
28
|
+
let t = b(e), n = t.pop(), r = !1;
|
|
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 = ie(n);
|
|
31
|
+
return i ? {
|
|
32
|
+
group: i,
|
|
33
|
+
scope: t.sort().join(":") + (r ? "!" : "") + "|"
|
|
34
|
+
} : null;
|
|
35
|
+
}
|
|
36
|
+
function b(e) {
|
|
37
|
+
let t = [], n = 0, r = 0;
|
|
38
|
+
for (let i = 0; i < e.length; i++) {
|
|
39
|
+
let a = e[i];
|
|
40
|
+
a === "[" || a === "(" ? n++ : a === "]" || a === ")" ? n-- : a === ":" && n === 0 && (t.push(e.slice(r, i)), r = i + 1);
|
|
41
|
+
}
|
|
42
|
+
return t.push(e.slice(r)), t;
|
|
43
|
+
}
|
|
44
|
+
var x = /^\d+(\.\d+)?$/, S = /^(\d?xs|sm|md|lg|\d?xl|base|none|full)$/, C = /^[[(](length:|size:|percentage:|number:)?(-?[\d.]+[a-z%]*|calc\(|min\(|max\(|clamp\(|var\(--[\w-]*(size|width|radius|spacing|length)[\w-]*\))/, w = (e) => e.replace(/\/[^/[\]()]*$/, ""), T = (e) => e === "" || x.test(e) || C.test(e), E = [
|
|
45
|
+
"x",
|
|
46
|
+
"y",
|
|
47
|
+
"t",
|
|
48
|
+
"r",
|
|
49
|
+
"b",
|
|
50
|
+
"l",
|
|
51
|
+
"s",
|
|
52
|
+
"e"
|
|
53
|
+
], ee = [
|
|
54
|
+
"t",
|
|
55
|
+
"r",
|
|
56
|
+
"b",
|
|
57
|
+
"l",
|
|
58
|
+
"s",
|
|
59
|
+
"e",
|
|
60
|
+
"tl",
|
|
61
|
+
"tr",
|
|
62
|
+
"br",
|
|
63
|
+
"bl",
|
|
64
|
+
"ss",
|
|
65
|
+
"se",
|
|
66
|
+
"es",
|
|
67
|
+
"ee"
|
|
68
|
+
], te = {}, D = (e, t) => t.split(" ").forEach((t) => te[t] = e);
|
|
69
|
+
D("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"), D("position", "static fixed absolute relative sticky"), D("visibility", "visible invisible collapse"), D("isolation", "isolate isolation-auto"), D("text-overflow", "truncate text-ellipsis text-clip"), D("text-transform", "uppercase lowercase capitalize normal-case"), D("font-style", "italic not-italic"), D("text-decoration-line", "underline overline line-through no-underline"), D("font-smoothing", "antialiased subpixel-antialiased"), D("sr", "sr-only not-sr-only"), D("flex-direction", "flex-row flex-row-reverse flex-col flex-col-reverse"), D("flex-wrap", "flex-wrap flex-wrap-reverse flex-nowrap"), D("border-style", "border-solid border-dashed border-dotted border-double border-hidden border-none"), D("border-collapse", "border-collapse border-separate"), D("table-layout", "table-auto table-fixed"), D("box-sizing", "box-border box-content"), D("grow", "grow"), D("shrink", "shrink"), D("transition", "transition"), D("shadow", "shadow"), D("ring-w", "ring"), D("ring-inset", "ring-inset"), D("outline-w", "outline"), D("border-w", "border"), D("rounded", "rounded");
|
|
70
|
+
for (let e of E) D(`border-w-${e}`, `border-${e}`);
|
|
71
|
+
for (let e of ee) D(`rounded-${e}`, `rounded-${e}`);
|
|
72
|
+
var O = {
|
|
73
|
+
inset: "inset",
|
|
74
|
+
"inset-x": "inset-x",
|
|
75
|
+
"inset-y": "inset-y",
|
|
76
|
+
top: "top",
|
|
77
|
+
right: "right",
|
|
78
|
+
bottom: "bottom",
|
|
79
|
+
left: "left",
|
|
80
|
+
start: "start",
|
|
81
|
+
end: "end",
|
|
82
|
+
z: "z",
|
|
83
|
+
order: "order",
|
|
84
|
+
basis: "basis",
|
|
85
|
+
grow: "grow",
|
|
86
|
+
shrink: "shrink",
|
|
87
|
+
flex: "flex",
|
|
88
|
+
"grid-cols": "grid-cols",
|
|
89
|
+
"grid-rows": "grid-rows",
|
|
90
|
+
"grid-flow": "grid-flow",
|
|
91
|
+
"auto-cols": "auto-cols",
|
|
92
|
+
"auto-rows": "auto-rows",
|
|
93
|
+
col: "col",
|
|
94
|
+
"col-span": "col-span",
|
|
95
|
+
"col-start": "col-start",
|
|
96
|
+
"col-end": "col-end",
|
|
97
|
+
row: "row",
|
|
98
|
+
"row-span": "row-span",
|
|
99
|
+
"row-start": "row-start",
|
|
100
|
+
"row-end": "row-end",
|
|
101
|
+
gap: "gap",
|
|
102
|
+
"gap-x": "gap-x",
|
|
103
|
+
"gap-y": "gap-y",
|
|
104
|
+
"space-x": "space-x",
|
|
105
|
+
"space-y": "space-y",
|
|
106
|
+
w: "w",
|
|
107
|
+
"min-w": "min-w",
|
|
108
|
+
"max-w": "max-w",
|
|
109
|
+
h: "h",
|
|
110
|
+
"min-h": "min-h",
|
|
111
|
+
"max-h": "max-h",
|
|
112
|
+
size: "size",
|
|
113
|
+
justify: "justify-content",
|
|
114
|
+
"justify-items": "justify-items",
|
|
115
|
+
"justify-self": "justify-self",
|
|
116
|
+
items: "align-items",
|
|
117
|
+
self: "align-self",
|
|
118
|
+
content: (e) => e === "none" || e.startsWith("[") || e.startsWith("(") ? "content" : "align-content",
|
|
119
|
+
"place-content": "place-content",
|
|
120
|
+
"place-items": "place-items",
|
|
121
|
+
"place-self": "place-self",
|
|
122
|
+
overflow: "overflow",
|
|
123
|
+
"overflow-x": "overflow-x",
|
|
124
|
+
"overflow-y": "overflow-y",
|
|
125
|
+
"border-spacing": "border-spacing",
|
|
126
|
+
"border-spacing-x": "border-spacing-x",
|
|
127
|
+
"border-spacing-y": "border-spacing-y",
|
|
128
|
+
bg: (e) => {
|
|
129
|
+
let t = w(e);
|
|
130
|
+
return [
|
|
131
|
+
"fixed",
|
|
132
|
+
"local",
|
|
133
|
+
"scroll"
|
|
134
|
+
].includes(t) ? "bg-attachment" : /^(clip|origin)-/.test(t) ? "bg-" + t.split("-")[0] : /^(repeat|no-repeat)/.test(t) ? "bg-repeat" : [
|
|
135
|
+
"auto",
|
|
136
|
+
"cover",
|
|
137
|
+
"contain"
|
|
138
|
+
].includes(t) ? "bg-size" : /^(top|bottom|left|right|center)/.test(t) ? "bg-position" : t === "none" || /^(linear|radial|conic|gradient)-/.test(t) || /^\[(url|image:|(repeating-)?(linear|radial|conic)-gradient)/.test(t) ? "bg-image" : "bg-color";
|
|
139
|
+
},
|
|
140
|
+
text: (e) => {
|
|
141
|
+
let t = w(e);
|
|
142
|
+
return [
|
|
143
|
+
"left",
|
|
144
|
+
"center",
|
|
145
|
+
"right",
|
|
146
|
+
"justify",
|
|
147
|
+
"start",
|
|
148
|
+
"end"
|
|
149
|
+
].includes(t) ? "text-align" : [
|
|
150
|
+
"wrap",
|
|
151
|
+
"nowrap",
|
|
152
|
+
"balance",
|
|
153
|
+
"pretty"
|
|
154
|
+
].includes(t) ? "text-wrap" : S.test(t) || C.test(t) ? "font-size" : "text-color";
|
|
155
|
+
},
|
|
156
|
+
font: (e) => /^(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/.test(e) || /^[[(](number:|\d)/.test(e) ? "font-weight" : "font-family",
|
|
157
|
+
leading: "leading",
|
|
158
|
+
tracking: "tracking",
|
|
159
|
+
whitespace: "whitespace",
|
|
160
|
+
break: (e) => [
|
|
161
|
+
"normal",
|
|
162
|
+
"words",
|
|
163
|
+
"all",
|
|
164
|
+
"keep"
|
|
165
|
+
].includes(e) ? "word-break" : null,
|
|
166
|
+
"line-clamp": "line-clamp",
|
|
167
|
+
align: "vertical-align",
|
|
168
|
+
opacity: "opacity",
|
|
169
|
+
shadow: (e) => e === "" || S.test(w(e)) || e === "inner" || /^\[(?!color:)/.test(e) ? "shadow" : "shadow-color",
|
|
170
|
+
ring: (e) => T(e) ? "ring-w" : "ring-color",
|
|
171
|
+
"ring-offset": (e) => T(e) ? "ring-offset-w" : "ring-offset-color",
|
|
172
|
+
outline: (e) => [
|
|
173
|
+
"none",
|
|
174
|
+
"hidden",
|
|
175
|
+
"solid",
|
|
176
|
+
"dashed",
|
|
177
|
+
"dotted",
|
|
178
|
+
"double"
|
|
179
|
+
].includes(e) ? "outline-style" : T(e) ? "outline-w" : "outline-color",
|
|
180
|
+
"outline-offset": "outline-offset",
|
|
181
|
+
cursor: "cursor",
|
|
182
|
+
"pointer-events": "pointer-events",
|
|
183
|
+
select: "user-select",
|
|
184
|
+
resize: "resize",
|
|
185
|
+
transition: "transition",
|
|
186
|
+
duration: "duration",
|
|
187
|
+
ease: "ease",
|
|
188
|
+
delay: "delay",
|
|
189
|
+
animate: "animate",
|
|
190
|
+
scale: "scale",
|
|
191
|
+
"scale-x": "scale-x",
|
|
192
|
+
"scale-y": "scale-y",
|
|
193
|
+
rotate: "rotate",
|
|
194
|
+
translate: "translate",
|
|
195
|
+
"translate-x": "translate-x",
|
|
196
|
+
"translate-y": "translate-y",
|
|
197
|
+
origin: "transform-origin",
|
|
198
|
+
fill: "fill",
|
|
199
|
+
stroke: (e) => x.test(e) ? "stroke-w" : "stroke-color",
|
|
200
|
+
aspect: "aspect",
|
|
201
|
+
object: (e) => [
|
|
202
|
+
"contain",
|
|
203
|
+
"cover",
|
|
204
|
+
"fill",
|
|
205
|
+
"none",
|
|
206
|
+
"scale-down"
|
|
207
|
+
].includes(e) ? "object-fit" : "object-position",
|
|
208
|
+
blur: "blur",
|
|
209
|
+
"backdrop-blur": "backdrop-blur",
|
|
210
|
+
"mix-blend": "mix-blend",
|
|
211
|
+
appearance: "appearance",
|
|
212
|
+
"will-change": "will-change",
|
|
213
|
+
"underline-offset": "underline-offset",
|
|
214
|
+
accent: "accent-color",
|
|
215
|
+
caret: "caret-color",
|
|
216
|
+
float: "float",
|
|
217
|
+
clear: "clear",
|
|
218
|
+
columns: "columns",
|
|
219
|
+
rounded: "rounded",
|
|
220
|
+
border: (e) => T(e) ? "border-w" : "border-color"
|
|
221
|
+
};
|
|
222
|
+
for (let e of ["p", "m"]) {
|
|
223
|
+
O[e] = e;
|
|
224
|
+
for (let t of E) O[e + t] = e + t;
|
|
225
|
+
}
|
|
226
|
+
for (let e of E) O[`border-${e}`] = (t) => T(t) ? `border-w-${e}` : `border-color-${e}`;
|
|
227
|
+
for (let e of ee) O[`rounded-${e}`] = `rounded-${e}`;
|
|
228
|
+
var ne = /* @__PURE__ */ new Set(["text-glow", "text-aurora"]), re = Object.keys(O).sort((e, t) => t.length - e.length);
|
|
229
|
+
function ie(e) {
|
|
230
|
+
if (ne.has(e)) return null;
|
|
231
|
+
if (te[e]) return te[e];
|
|
232
|
+
if (e.startsWith("[")) {
|
|
233
|
+
let t = e.indexOf(":");
|
|
234
|
+
return t > 1 ? "prop:" + e.slice(1, t) : null;
|
|
235
|
+
}
|
|
236
|
+
for (let t of re) {
|
|
237
|
+
if (!e.startsWith(t + "-")) continue;
|
|
238
|
+
let n = O[t];
|
|
239
|
+
return typeof n == "string" ? n : n(e.slice(t.length + 1));
|
|
240
|
+
}
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
var ae = {
|
|
244
|
+
p: E.map((e) => "p" + e),
|
|
245
|
+
m: E.map((e) => "m" + e),
|
|
246
|
+
px: [
|
|
247
|
+
"pl",
|
|
248
|
+
"pr",
|
|
249
|
+
"ps",
|
|
250
|
+
"pe"
|
|
251
|
+
],
|
|
252
|
+
py: ["pt", "pb"],
|
|
253
|
+
mx: [
|
|
254
|
+
"ml",
|
|
255
|
+
"mr",
|
|
256
|
+
"ms",
|
|
257
|
+
"me"
|
|
258
|
+
],
|
|
259
|
+
my: ["mt", "mb"],
|
|
260
|
+
inset: [
|
|
261
|
+
"inset-x",
|
|
262
|
+
"inset-y",
|
|
263
|
+
"top",
|
|
264
|
+
"right",
|
|
265
|
+
"bottom",
|
|
266
|
+
"left",
|
|
267
|
+
"start",
|
|
268
|
+
"end"
|
|
269
|
+
],
|
|
270
|
+
"inset-x": ["left", "right"],
|
|
271
|
+
"inset-y": ["top", "bottom"],
|
|
272
|
+
size: ["w", "h"],
|
|
273
|
+
gap: ["gap-x", "gap-y"],
|
|
274
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
275
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
276
|
+
"border-w": E.map((e) => "border-w-" + e),
|
|
277
|
+
"border-w-x": [
|
|
278
|
+
"border-w-l",
|
|
279
|
+
"border-w-r",
|
|
280
|
+
"border-w-s",
|
|
281
|
+
"border-w-e"
|
|
282
|
+
],
|
|
283
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
284
|
+
"border-color": E.map((e) => "border-color-" + e),
|
|
285
|
+
"border-color-x": [
|
|
286
|
+
"border-color-l",
|
|
287
|
+
"border-color-r",
|
|
288
|
+
"border-color-s",
|
|
289
|
+
"border-color-e"
|
|
290
|
+
],
|
|
291
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
292
|
+
rounded: ee.map((e) => "rounded-" + e),
|
|
293
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
294
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
295
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
296
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
297
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
298
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
299
|
+
translate: ["translate-x", "translate-y"],
|
|
300
|
+
scale: ["scale-x", "scale-y"],
|
|
301
|
+
flex: [
|
|
302
|
+
"grow",
|
|
303
|
+
"shrink",
|
|
304
|
+
"basis"
|
|
305
|
+
]
|
|
306
|
+
}, k = (...e) => _(oe(e)), oe = (e) => e.reduce((e, t) => t == null || t === !1 ? e : typeof t == "string" || typeof t == "number" ? e + " " + t : Array.isArray(t) ? e + " " + oe(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, ""), se = "data-zen-graphics", ce = /swiftshader|llvmpipe|softpipe|software|basic render driver|mesa offscreen/i, A;
|
|
307
|
+
function le() {
|
|
308
|
+
if (A) return A;
|
|
309
|
+
if (typeof document > "u") return "full";
|
|
310
|
+
try {
|
|
311
|
+
let e = document.createElement("canvas"), t = e.getContext("webgl", { failIfMajorPerformanceCaveat: !0 }) ?? e.getContext("experimental-webgl", { failIfMajorPerformanceCaveat: !0 });
|
|
312
|
+
if (!t) A = "lite";
|
|
313
|
+
else {
|
|
314
|
+
let e = t.getExtension("WEBGL_debug_renderer_info"), n = String(t.getParameter(e ? e.UNMASKED_RENDERER_WEBGL : t.RENDERER) ?? "");
|
|
315
|
+
A = ce.test(n) ? "lite" : "full", t.getExtension("WEBGL_lose_context")?.loseContext();
|
|
316
|
+
}
|
|
317
|
+
} catch {
|
|
318
|
+
A = "lite";
|
|
319
|
+
}
|
|
320
|
+
return A;
|
|
321
|
+
}
|
|
322
|
+
function j() {
|
|
323
|
+
if (typeof document > "u") return "full";
|
|
324
|
+
let e = document.documentElement, t = e.getAttribute(se);
|
|
325
|
+
if (t === "full" || t === "lite") return t;
|
|
326
|
+
let n = le();
|
|
327
|
+
return e.setAttribute(se, n), n;
|
|
328
|
+
}
|
|
329
|
+
function M() {
|
|
330
|
+
o(() => {
|
|
331
|
+
j();
|
|
332
|
+
}, []);
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region packages/utils/useAnchoredPopup.ts
|
|
336
|
+
function N({ align: e = "start", offset: t = 4, matchWidth: n = !1, onOpenChange: r } = {}) {
|
|
337
|
+
let a = `zen__popup-${s().replace(/[^\w-]/g, "")}`, c = u(null), [l, f] = d(!1), p = u(r);
|
|
338
|
+
p.current = r;
|
|
339
|
+
let m = u(!1), h = i((e) => {
|
|
340
|
+
f(e), m.current !== e && (m.current = e, p.current?.(e));
|
|
341
|
+
}, []), g = i((e) => {
|
|
342
|
+
let t = c.current;
|
|
343
|
+
if (t) {
|
|
344
|
+
try {
|
|
345
|
+
e ? t.showPopover?.() : t.hidePopover?.();
|
|
346
|
+
} catch {}
|
|
347
|
+
h(e);
|
|
348
|
+
}
|
|
349
|
+
}, [h]);
|
|
350
|
+
return o(() => {
|
|
351
|
+
let e = c.current;
|
|
352
|
+
if (!e) return;
|
|
353
|
+
let t = (e) => h(e.newState === "open");
|
|
354
|
+
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
355
|
+
}, [h]), {
|
|
356
|
+
id: a,
|
|
357
|
+
open: l,
|
|
358
|
+
setOpen: g,
|
|
359
|
+
triggerProps: {
|
|
360
|
+
popoverTarget: a,
|
|
361
|
+
"aria-expanded": l,
|
|
362
|
+
"aria-controls": a,
|
|
363
|
+
"data-popup-open": l || void 0,
|
|
364
|
+
style: { anchorName: `--${a}` }
|
|
365
|
+
},
|
|
366
|
+
popupProps: {
|
|
367
|
+
ref: c,
|
|
368
|
+
id: a,
|
|
369
|
+
popover: "auto",
|
|
370
|
+
style: {
|
|
371
|
+
positionAnchor: `--${a}`,
|
|
372
|
+
positionArea: e === "start" ? "block-end span-inline-end" : "block-end span-inline-start",
|
|
373
|
+
positionTryFallbacks: "flip-block",
|
|
374
|
+
inset: "auto",
|
|
375
|
+
margin: `${t}px 0`,
|
|
376
|
+
...n && { minWidth: "anchor-size(width)" }
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
popupRef: c
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region packages/actions-menu/index.tsx
|
|
384
|
+
var ue = "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 de({ label: e, actions: t, className: n }) {
|
|
386
|
+
M();
|
|
387
|
+
let r = N({
|
|
388
|
+
align: "end",
|
|
389
|
+
offset: 6,
|
|
390
|
+
onOpenChange: (e) => e && r.popupRef.current?.focus()
|
|
391
|
+
}), i = r.popupRef, a = t.filter((e) => !!e), o = (e) => {
|
|
392
|
+
let t = Array.from(i.current?.querySelectorAll("[role=\"menuitem\"]") ?? []), n = t.indexOf(document.activeElement), r = t.length - 1, a = {
|
|
393
|
+
ArrowDown: n + 1,
|
|
394
|
+
ArrowUp: n === -1 ? r : n - 1,
|
|
395
|
+
Home: 0,
|
|
396
|
+
End: r
|
|
397
|
+
}[e.key];
|
|
398
|
+
a !== void 0 && (e.preventDefault(), t[(a + t.length) % t.length]?.focus());
|
|
399
|
+
};
|
|
400
|
+
return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("button", {
|
|
10
401
|
type: "button",
|
|
11
402
|
"aria-label": e,
|
|
12
403
|
"aria-haspopup": "menu",
|
|
13
|
-
|
|
14
|
-
className:
|
|
15
|
-
|
|
16
|
-
children: /* @__PURE__ */ p("svg", {
|
|
404
|
+
...r.triggerProps,
|
|
405
|
+
className: k("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
|
+
children: /* @__PURE__ */ h("svg", {
|
|
17
407
|
viewBox: "0 0 16 16",
|
|
18
408
|
fill: "currentColor",
|
|
19
409
|
className: "size-4",
|
|
20
410
|
"aria-hidden": !0,
|
|
21
411
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ m("circle", {
|
|
23
413
|
cx: "3",
|
|
24
414
|
cy: "8",
|
|
25
415
|
r: "1.4"
|
|
26
416
|
}),
|
|
27
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ m("circle", {
|
|
28
418
|
cx: "8",
|
|
29
419
|
cy: "8",
|
|
30
420
|
r: "1.4"
|
|
31
421
|
}),
|
|
32
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ m("circle", {
|
|
33
423
|
cx: "13",
|
|
34
424
|
cy: "8",
|
|
35
425
|
r: "1.4"
|
|
36
426
|
})
|
|
37
427
|
]
|
|
38
428
|
})
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
id: r,
|
|
42
|
-
popover: "auto",
|
|
429
|
+
}), /* @__PURE__ */ m("div", {
|
|
430
|
+
...r.popupProps,
|
|
43
431
|
role: "menu",
|
|
44
432
|
"aria-label": e,
|
|
45
433
|
tabIndex: -1,
|
|
46
|
-
onKeyDown:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
ArrowUp: n === -1 ? r : n - 1,
|
|
50
|
-
Home: 0,
|
|
51
|
-
End: r
|
|
52
|
-
}[e.key];
|
|
53
|
-
a !== void 0 && (e.preventDefault(), t[(a + t.length) % t.length]?.focus());
|
|
54
|
-
},
|
|
55
|
-
onToggle: (e) => {
|
|
56
|
-
e.nativeEvent.newState === "open" && i.current?.focus();
|
|
57
|
-
},
|
|
58
|
-
className: h("zen__popover glass glass-blur text-foreground min-w-44 rounded-xl p-1.5 outline-hidden", "[position-area:block-end_span-inline-start] [position-try-fallbacks:flip-block]"),
|
|
59
|
-
style: {
|
|
60
|
-
positionAnchor: `--${r}`,
|
|
61
|
-
inset: "auto",
|
|
62
|
-
margin: "6px 0"
|
|
63
|
-
},
|
|
64
|
-
children: a.map((e) => /* @__PURE__ */ f("button", {
|
|
434
|
+
onKeyDown: o,
|
|
435
|
+
className: "zen__popover glass glass-blur text-foreground min-w-44 rounded-xl p-1.5 outline-hidden",
|
|
436
|
+
children: a.map((e) => /* @__PURE__ */ m("button", {
|
|
65
437
|
type: "button",
|
|
66
438
|
role: "menuitem",
|
|
67
439
|
tabIndex: -1,
|
|
68
|
-
className:
|
|
440
|
+
className: k(ue, e.destructive && "text-destructive hover:bg-destructive/10 focus:bg-destructive/10"),
|
|
69
441
|
onClick: () => {
|
|
70
|
-
|
|
442
|
+
r.setOpen(!1), e.onClick();
|
|
71
443
|
},
|
|
72
444
|
children: e.label
|
|
73
445
|
}, e.label))
|
|
74
446
|
})] });
|
|
75
447
|
}
|
|
76
448
|
//#endregion
|
|
449
|
+
//#region packages/utils/money.ts
|
|
450
|
+
function P(e) {
|
|
451
|
+
return new Intl.NumberFormat("en", {
|
|
452
|
+
style: "currency",
|
|
453
|
+
currency: e
|
|
454
|
+
}).resolvedOptions().maximumFractionDigits ?? 2;
|
|
455
|
+
}
|
|
456
|
+
function F(e, t, n, { showDecimals: r = !0 } = {}) {
|
|
457
|
+
let i = P(t);
|
|
458
|
+
return new Intl.NumberFormat(n, {
|
|
459
|
+
style: "currency",
|
|
460
|
+
currency: t,
|
|
461
|
+
minimumFractionDigits: r ? i : 0,
|
|
462
|
+
maximumFractionDigits: r ? i : 0
|
|
463
|
+
}).format(e / 10 ** i);
|
|
464
|
+
}
|
|
465
|
+
function I(e, t, n) {
|
|
466
|
+
let r = P(t), i = e % 10 ** r != 0;
|
|
467
|
+
return new Intl.NumberFormat(n, {
|
|
468
|
+
minimumFractionDigits: i ? r : 0,
|
|
469
|
+
maximumFractionDigits: r
|
|
470
|
+
}).format(e / 10 ** r);
|
|
471
|
+
}
|
|
472
|
+
function fe(e, t) {
|
|
473
|
+
return new Intl.NumberFormat(t, {
|
|
474
|
+
style: "currency",
|
|
475
|
+
currency: e
|
|
476
|
+
}).formatToParts(0).find((e) => e.type === "currency")?.value ?? e;
|
|
477
|
+
}
|
|
478
|
+
var L = class extends Error {
|
|
479
|
+
constructor(e) {
|
|
480
|
+
super(`Not an amount: ${e}`), this.name = "MoneyParseError";
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
function pe(e, t) {
|
|
484
|
+
let n = P(t), r = e.trim().replace(/[\s,_]/g, "").replace(/^([+-]?)[^\d.+-]+/, "$1"), i = /^([+-]?)(\d*)(?:\.(\d*))?$/.exec(r);
|
|
485
|
+
if (!i || i[2] === "" && (i[3] ?? "") === "") throw new L(e);
|
|
486
|
+
let [, a, o, s = ""] = i;
|
|
487
|
+
if (s.length > n) throw new L(e);
|
|
488
|
+
let c = Number((o || "0") + s.padEnd(n, "0"));
|
|
489
|
+
if (!Number.isSafeInteger(c)) throw new L(e);
|
|
490
|
+
return a === "-" ? -c : c;
|
|
491
|
+
}
|
|
492
|
+
var me = {
|
|
493
|
+
k: 3,
|
|
494
|
+
thousand: 3,
|
|
495
|
+
l: 5,
|
|
496
|
+
lac: 5,
|
|
497
|
+
lakh: 5,
|
|
498
|
+
lakhs: 5,
|
|
499
|
+
cr: 7,
|
|
500
|
+
crore: 7,
|
|
501
|
+
crores: 7,
|
|
502
|
+
m: 6,
|
|
503
|
+
mn: 6,
|
|
504
|
+
million: 6
|
|
505
|
+
};
|
|
506
|
+
function he(e, t) {
|
|
507
|
+
let n = /^\s*(.*?)\s*([a-z]+)\s*$/i.exec(e), r = me[n ? n[2].toLowerCase() : ""];
|
|
508
|
+
if (!n || r === void 0) return pe(e, t);
|
|
509
|
+
let i = P(t), a = /^([+-]?)[^\d.+-]*([\d,\s_]*)(?:\.(\d*))?$/.exec(n[1]);
|
|
510
|
+
if (!a) throw new L(e);
|
|
511
|
+
let o = a[2].replace(/[,\s_]/g, ""), s = a[3] ?? "";
|
|
512
|
+
if (o === "" && s === "") throw new L(e);
|
|
513
|
+
let c = r + i;
|
|
514
|
+
if (s.length > c) throw new L(e);
|
|
515
|
+
let l = Number((o || "0") + s.padEnd(c, "0"));
|
|
516
|
+
if (!Number.isSafeInteger(l)) throw new L(e);
|
|
517
|
+
return a[1] === "-" ? -l : l;
|
|
518
|
+
}
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region packages/animated-number/index.tsx
|
|
521
|
+
var ge = typeof window > "u" ? o : c, _e = (e) => 1 - (1 - e) ** 3;
|
|
522
|
+
function ve({ value: e, format: t = String, duration: n = 650, fromZero: r = !0, className: i }) {
|
|
523
|
+
let [a, o] = d(r ? 0 : e), s = u(r ? 0 : e);
|
|
524
|
+
return ge(() => {
|
|
525
|
+
if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || document.documentElement.classList.contains("reduce-motion") || n <= 0) {
|
|
526
|
+
s.current = e, o(e);
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
let t = s.current, r = performance.now(), i = requestAnimationFrame(function a(c) {
|
|
530
|
+
let l = Math.min(1, (c - r) / n), u = Math.round(t + (e - t) * _e(l));
|
|
531
|
+
s.current = u, o(u), l < 1 && (i = requestAnimationFrame(a));
|
|
532
|
+
});
|
|
533
|
+
return () => cancelAnimationFrame(i);
|
|
534
|
+
}, [e, n]), /* @__PURE__ */ m("span", {
|
|
535
|
+
className: k("zen__animated-number tabular-nums", i),
|
|
536
|
+
children: t(a)
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
function ye({ value: e, currency: t, locale: n, showDecimals: r = !1, ...i }) {
|
|
540
|
+
return /* @__PURE__ */ m(ve, {
|
|
541
|
+
value: e,
|
|
542
|
+
format: (e) => F(e, t, n, { showDecimals: r }),
|
|
543
|
+
...i
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
//#endregion
|
|
547
|
+
//#region packages/avatar/index.tsx
|
|
548
|
+
function be({ src: e, name: t, alt: n, className: r }) {
|
|
549
|
+
let i = (t.trim()[0] ?? "?").toUpperCase();
|
|
550
|
+
return /* @__PURE__ */ m("span", {
|
|
551
|
+
role: n ? "img" : void 0,
|
|
552
|
+
"aria-label": n,
|
|
553
|
+
"aria-hidden": !n || void 0,
|
|
554
|
+
className: k("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
|
+
children: e ? /* @__PURE__ */ m("img", {
|
|
556
|
+
src: e,
|
|
557
|
+
alt: "",
|
|
558
|
+
className: "size-full object-cover",
|
|
559
|
+
draggable: !1
|
|
560
|
+
}) : i
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
var R = class extends Error {};
|
|
564
|
+
async function xe(e, t = 160, n = .85) {
|
|
565
|
+
if (!e.type.startsWith("image/")) throw new R("Choose an image file.");
|
|
566
|
+
if (e.size > 20971520) throw new R("That image is too large (over 20 MB).");
|
|
567
|
+
let r;
|
|
568
|
+
try {
|
|
569
|
+
r = await createImageBitmap(e);
|
|
570
|
+
} catch {
|
|
571
|
+
throw new R("That image couldn't be read.");
|
|
572
|
+
}
|
|
573
|
+
let i = Math.min(r.width, r.height), a = document.createElement("canvas");
|
|
574
|
+
a.width = a.height = t;
|
|
575
|
+
let o = a.getContext("2d");
|
|
576
|
+
o.imageSmoothingQuality = "high", o.drawImage(r, (r.width - i) / 2, (r.height - i) / 2, i, i, 0, 0, t, t), r.close();
|
|
577
|
+
let s = a.toDataURL("image/webp", n);
|
|
578
|
+
return s.startsWith("data:image/webp") ? s : a.toDataURL("image/jpeg", n);
|
|
579
|
+
}
|
|
580
|
+
//#endregion
|
|
77
581
|
//#region packages/backdrop/index.tsx
|
|
78
|
-
function
|
|
79
|
-
let n = e ?? (t ? "contours" : "dots");
|
|
80
|
-
return
|
|
81
|
-
let e = document.documentElement, t =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
582
|
+
function Se({ pattern: e, topoSrc: t }) {
|
|
583
|
+
let n = e ?? (t ? "contours" : "dots"), r = u(null);
|
|
584
|
+
return o(() => {
|
|
585
|
+
let e = document.documentElement, t = r.current, n = 0, i = -9999, a = -9999, o = /* @__PURE__ */ new WeakSet(), s = !0, c = /* @__PURE__ */ new WeakMap(), l = (e, t, n, r = "--gx", i = "--gy") => {
|
|
586
|
+
let a = t + " " + n;
|
|
587
|
+
c.get(e) !== a && (c.set(e, a), e.style.setProperty(r, t), e.style.setProperty(i, n));
|
|
588
|
+
}, u = () => {
|
|
589
|
+
if (n = 0, t) {
|
|
590
|
+
let e = s ? "out" : "in";
|
|
591
|
+
t.dataset.pointer !== e && (t.dataset.pointer = e);
|
|
592
|
+
let n = t.querySelector(".zen-light");
|
|
593
|
+
n && !s && l(n, `${i}px`, `${a}px`, "left", "top");
|
|
594
|
+
}
|
|
595
|
+
let e = Array.from(document.querySelectorAll(".glow-edge")), r = e.map((e) => e.getBoundingClientRect());
|
|
596
|
+
e.forEach((e, t) => {
|
|
597
|
+
let n = r[t];
|
|
598
|
+
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));
|
|
87
599
|
});
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
600
|
+
}, d = () => {
|
|
601
|
+
n ||= requestAnimationFrame(u);
|
|
602
|
+
}, f = (e) => {
|
|
603
|
+
i = e.clientX, a = e.clientY, s = !1, d();
|
|
604
|
+
}, p = () => {
|
|
605
|
+
i = a = -9999, s = !0, d();
|
|
606
|
+
};
|
|
607
|
+
if (window.matchMedia?.("(hover: none), (pointer: coarse)").matches || j() === "lite") return;
|
|
608
|
+
window.addEventListener("pointermove", f, { passive: !0 }), e.addEventListener("pointerleave", p);
|
|
609
|
+
let m = 0, h = () => {
|
|
610
|
+
clearTimeout(m), m = window.setTimeout(d, 120);
|
|
94
611
|
};
|
|
95
|
-
|
|
612
|
+
return window.addEventListener("scroll", h, {
|
|
96
613
|
passive: !0,
|
|
97
614
|
capture: !0
|
|
98
|
-
}), window.addEventListener("resize",
|
|
99
|
-
window.removeEventListener("pointermove",
|
|
615
|
+
}), window.addEventListener("resize", d, { passive: !0 }), () => {
|
|
616
|
+
window.removeEventListener("pointermove", f), e.removeEventListener("pointerleave", p), window.removeEventListener("scroll", h, { capture: !0 }), clearTimeout(m), window.removeEventListener("resize", d), cancelAnimationFrame(n);
|
|
100
617
|
};
|
|
101
|
-
}, []),
|
|
618
|
+
}, []), o(() => {
|
|
619
|
+
let e = r.current;
|
|
620
|
+
if (!t || !e || typeof document > "u") return;
|
|
621
|
+
let n = "", i = !1, a = 0, o = new Image();
|
|
622
|
+
o.src = t;
|
|
623
|
+
let s = async () => {
|
|
624
|
+
try {
|
|
625
|
+
await o.decode();
|
|
626
|
+
let t = window.devicePixelRatio || 1, r = Math.round(e.clientWidth * t), a = Math.round(e.clientHeight * t);
|
|
627
|
+
if (!r || !a) return;
|
|
628
|
+
let s = document.createElement("canvas");
|
|
629
|
+
s.width = r, s.height = a;
|
|
630
|
+
let c = o.naturalWidth || r, l = o.naturalHeight || a, u = Math.max(r / c, a / l);
|
|
631
|
+
s.getContext("2d")?.drawImage(o, (r - c * u) / 2, (a - l * u) / 2, c * u, l * u);
|
|
632
|
+
let d = await new Promise((e) => s.toBlob(e));
|
|
633
|
+
if (i || !d) return;
|
|
634
|
+
let f = URL.createObjectURL(d);
|
|
635
|
+
e.style.setProperty("--zen-topo", `url("${f}")`), n && URL.revokeObjectURL(n), n = f;
|
|
636
|
+
} catch {}
|
|
637
|
+
};
|
|
638
|
+
s();
|
|
639
|
+
let c = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
|
|
640
|
+
clearTimeout(a), a = window.setTimeout(s, 200);
|
|
641
|
+
});
|
|
642
|
+
return c?.observe(e), () => {
|
|
643
|
+
i = !0, clearTimeout(a), c?.disconnect(), n && URL.revokeObjectURL(n), e.style.setProperty("--zen-topo", `url("${t}")`);
|
|
644
|
+
};
|
|
645
|
+
}, [t]), /* @__PURE__ */ h("div", {
|
|
646
|
+
ref: r,
|
|
102
647
|
className: "zen-backdrop",
|
|
103
648
|
"aria-hidden": !0,
|
|
104
649
|
style: t ? { "--zen-topo": `url("${t}")` } : void 0,
|
|
105
650
|
children: [
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ m("div", { className: "zen-aurora" }),
|
|
652
|
+
n === "contours" ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", { className: "zen-topo" }), /* @__PURE__ */ m("div", {
|
|
653
|
+
className: "zen-topo zen-topo--lit",
|
|
654
|
+
children: /* @__PURE__ */ m("div", { className: "zen-light" })
|
|
655
|
+
})] }) : /* @__PURE__ */ h(p, { children: [
|
|
656
|
+
/* @__PURE__ */ m("div", { className: "zen-dots" }),
|
|
657
|
+
/* @__PURE__ */ m("div", { className: "zen-dots zen-dots--ambient" }),
|
|
658
|
+
/* @__PURE__ */ m("div", {
|
|
659
|
+
className: "zen-dots zen-dots--lit",
|
|
660
|
+
children: /* @__PURE__ */ m("div", { className: "zen-light" })
|
|
661
|
+
})
|
|
113
662
|
] }),
|
|
114
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ m("div", { className: "zen-vignette" })
|
|
115
664
|
]
|
|
116
665
|
});
|
|
117
666
|
}
|
|
118
667
|
//#endregion
|
|
119
668
|
//#region packages/utils/cva.ts
|
|
120
|
-
var
|
|
121
|
-
if (t?.variants == null) return
|
|
669
|
+
var Ce = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, we = (e, t) => (n) => {
|
|
670
|
+
if (t?.variants == null) return k(e, n?.class, n?.className);
|
|
122
671
|
let { variants: r, defaultVariants: i } = t, a = Object.keys(r).map((e) => {
|
|
123
672
|
let t = n?.[e], a = i?.[e];
|
|
124
673
|
if (t === null) return null;
|
|
125
|
-
let o =
|
|
674
|
+
let o = Ce(t) || Ce(a);
|
|
126
675
|
return r[e][o];
|
|
127
676
|
}), o = n && Object.entries(n).reduce((e, [t, n]) => (n === void 0 || (e[t] = n), e), {}), s = t?.compoundVariants?.reduce((e, { class: t, className: n, ...r }) => Object.entries(r).every(([e, t]) => Array.isArray(t) ? t.includes({
|
|
128
677
|
...i,
|
|
@@ -135,20 +684,20 @@ var y = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, b = (e, t) =>
|
|
|
135
684
|
t,
|
|
136
685
|
n
|
|
137
686
|
] : e, []);
|
|
138
|
-
return
|
|
687
|
+
return k(e, a, s, n?.class, n?.className);
|
|
139
688
|
};
|
|
140
689
|
//#endregion
|
|
141
690
|
//#region packages/badge/index.tsx
|
|
142
|
-
function
|
|
143
|
-
return /* @__PURE__ */
|
|
691
|
+
function z({ variant: e, className: t, ...n }) {
|
|
692
|
+
return /* @__PURE__ */ m("span", {
|
|
144
693
|
...n,
|
|
145
|
-
className:
|
|
694
|
+
className: Te({
|
|
146
695
|
variant: e,
|
|
147
696
|
className: t
|
|
148
697
|
})
|
|
149
698
|
});
|
|
150
699
|
}
|
|
151
|
-
var
|
|
700
|
+
var Te = we("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", {
|
|
152
701
|
variants: { variant: {
|
|
153
702
|
default: "border-glow/30 bg-glow/10 text-primary",
|
|
154
703
|
secondary: "border-tint/10 bg-tint/[0.06] text-foreground",
|
|
@@ -159,28 +708,29 @@ var S = b("zen__badge inline-flex items-center rounded-md border px-1.5 py-0.5 t
|
|
|
159
708
|
});
|
|
160
709
|
//#endregion
|
|
161
710
|
//#region packages/spinner/index.tsx
|
|
162
|
-
function
|
|
163
|
-
return /* @__PURE__ */
|
|
711
|
+
function Ee({ className: e }) {
|
|
712
|
+
return /* @__PURE__ */ m("span", {
|
|
164
713
|
"aria-hidden": !0,
|
|
165
|
-
className:
|
|
714
|
+
className: k("zen__spinner inline-block size-4 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent", e)
|
|
166
715
|
});
|
|
167
716
|
}
|
|
168
717
|
//#endregion
|
|
169
718
|
//#region packages/button/index.tsx
|
|
170
|
-
function
|
|
171
|
-
return /* @__PURE__ */
|
|
719
|
+
function B({ className: e, variant: t, size: n, loading: r = !1, disabled: i, type: a = "button", children: o, ...s }) {
|
|
720
|
+
return /* @__PURE__ */ h("button", {
|
|
721
|
+
type: a,
|
|
172
722
|
disabled: i || r,
|
|
173
723
|
"aria-busy": r || void 0,
|
|
174
|
-
className:
|
|
724
|
+
className: De({
|
|
175
725
|
variant: t,
|
|
176
726
|
size: n,
|
|
177
727
|
className: e
|
|
178
728
|
}),
|
|
179
|
-
...
|
|
180
|
-
children: [r && /* @__PURE__ */
|
|
729
|
+
...s,
|
|
730
|
+
children: [r && /* @__PURE__ */ m(Ee, {}), o]
|
|
181
731
|
});
|
|
182
732
|
}
|
|
183
|
-
var
|
|
733
|
+
var De = we("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", {
|
|
184
734
|
variants: {
|
|
185
735
|
variant: {
|
|
186
736
|
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)]",
|
|
@@ -205,213 +755,219 @@ var T = b("zen__button inline-flex items-center justify-center gap-2 rounded-lg
|
|
|
205
755
|
});
|
|
206
756
|
//#endregion
|
|
207
757
|
//#region packages/card/index.tsx
|
|
208
|
-
function
|
|
209
|
-
return /* @__PURE__ */
|
|
210
|
-
className:
|
|
758
|
+
function Oe({ title: e, action: t, children: n, className: r, ...i }) {
|
|
759
|
+
return /* @__PURE__ */ h("section", {
|
|
760
|
+
className: k("zen__card glass glow-edge text-card-foreground rounded-xl p-4 md:p-5", r),
|
|
211
761
|
...i,
|
|
212
|
-
children: [(e || t) && /* @__PURE__ */
|
|
762
|
+
children: [(e || t) && /* @__PURE__ */ h("header", {
|
|
213
763
|
className: "mb-4 flex items-center justify-between gap-4",
|
|
214
|
-
children: [e && /* @__PURE__ */
|
|
215
|
-
className: "text-base tracking-tight",
|
|
764
|
+
children: [e && /* @__PURE__ */ m("h4", {
|
|
765
|
+
className: "text-base font-semibold tracking-tight",
|
|
216
766
|
children: e
|
|
217
767
|
}), t]
|
|
218
768
|
}), n]
|
|
219
769
|
});
|
|
220
770
|
}
|
|
221
|
-
function
|
|
222
|
-
return /* @__PURE__ */
|
|
223
|
-
className:
|
|
771
|
+
function ke({ label: e, value: t, hint: n, tone: r = "default", className: i }) {
|
|
772
|
+
return /* @__PURE__ */ h("div", {
|
|
773
|
+
className: k("zen__stat glass glow-edge flex flex-col gap-1 rounded-xl p-3.5 md:p-4", i),
|
|
224
774
|
children: [
|
|
225
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ m("span", {
|
|
226
776
|
className: "text-muted-foreground truncate text-[0.68rem] tracking-[0.1em] uppercase sm:text-xs",
|
|
227
777
|
children: e
|
|
228
778
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
className:
|
|
779
|
+
/* @__PURE__ */ m("span", {
|
|
780
|
+
className: k("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"),
|
|
231
781
|
children: t
|
|
232
782
|
}),
|
|
233
|
-
n && /* @__PURE__ */
|
|
783
|
+
n && /* @__PURE__ */ m("span", {
|
|
234
784
|
className: "text-muted-foreground text-xs",
|
|
235
785
|
children: n
|
|
236
786
|
})
|
|
237
787
|
]
|
|
238
788
|
});
|
|
239
789
|
}
|
|
240
|
-
function
|
|
241
|
-
return /* @__PURE__ */
|
|
242
|
-
className:
|
|
790
|
+
function Ae({ children: e, className: t }) {
|
|
791
|
+
return /* @__PURE__ */ m("div", {
|
|
792
|
+
className: k("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),
|
|
243
793
|
children: e
|
|
244
794
|
});
|
|
245
795
|
}
|
|
246
796
|
//#endregion
|
|
247
797
|
//#region packages/code-block/index.tsx
|
|
248
|
-
function
|
|
249
|
-
let c = e.trim(), [l,
|
|
250
|
-
return
|
|
798
|
+
function je({ code: e, language: t, highlight: n, copyable: r = !0, variant: i = "glass", className: a, ...s }) {
|
|
799
|
+
let c = e.trim(), [l, u] = d(!1);
|
|
800
|
+
return o(() => {
|
|
251
801
|
if (!l) return;
|
|
252
|
-
let e = setTimeout(() =>
|
|
802
|
+
let e = setTimeout(() => u(!1), 1500);
|
|
253
803
|
return () => clearTimeout(e);
|
|
254
|
-
}, [l]), /* @__PURE__ */
|
|
255
|
-
className:
|
|
804
|
+
}, [l]), /* @__PURE__ */ h("div", {
|
|
805
|
+
className: k("zen__code-block group relative", i === "glass" && "glass glow-edge overflow-hidden rounded-xl", a),
|
|
256
806
|
"data-language": t,
|
|
257
807
|
...s,
|
|
258
|
-
children: [/* @__PURE__ */
|
|
808
|
+
children: [/* @__PURE__ */ m("pre", {
|
|
259
809
|
className: "text-foreground m-0! overflow-x-auto rounded-none! bg-transparent! p-5! font-mono text-[13px]! leading-6 font-normal!",
|
|
260
|
-
children: n ? /* @__PURE__ */
|
|
810
|
+
children: n ? /* @__PURE__ */ m("code", {
|
|
261
811
|
className: "bg-transparent! p-0! text-inherit!",
|
|
262
812
|
dangerouslySetInnerHTML: { __html: n(c, t) }
|
|
263
|
-
}) : /* @__PURE__ */
|
|
813
|
+
}) : /* @__PURE__ */ m("code", {
|
|
264
814
|
className: "bg-transparent! p-0! text-inherit!",
|
|
265
815
|
children: c
|
|
266
816
|
})
|
|
267
|
-
}), r && /* @__PURE__ */
|
|
817
|
+
}), r && /* @__PURE__ */ m("button", {
|
|
268
818
|
type: "button",
|
|
269
819
|
onClick: async () => {
|
|
270
|
-
await navigator.clipboard?.writeText(c),
|
|
820
|
+
await navigator.clipboard?.writeText(c), u(!0);
|
|
271
821
|
},
|
|
272
|
-
className:
|
|
822
|
+
className: k("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"),
|
|
273
823
|
children: l ? "Copied" : "Copy"
|
|
274
824
|
})]
|
|
275
825
|
});
|
|
276
826
|
}
|
|
277
827
|
//#endregion
|
|
278
828
|
//#region packages/utils/styles.ts
|
|
279
|
-
var
|
|
829
|
+
var V = "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", H = k(V, "inline-flex items-center justify-between gap-2 whitespace-nowrap"), U = "glass glass-blur rounded-xl text-foreground shadow-[var(--popup-shadow),0_0_40px_-20px_oklch(var(--glow)/0.5)] outline-hidden", Me = "relative flex w-fit items-center gap-1 rounded-full border border-tint/5 bg-tint/[0.03] p-1", Ne = "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)]", Pe = "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", Fe = "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";
|
|
280
830
|
//#endregion
|
|
281
831
|
//#region packages/popover/index.tsx
|
|
282
|
-
function
|
|
283
|
-
let { className: t, content: n, children: r, role: i = "tooltip", triggerType:
|
|
284
|
-
|
|
285
|
-
|
|
832
|
+
function W(e) {
|
|
833
|
+
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
|
+
M();
|
|
835
|
+
let [S, C] = d(!1), w = u(null);
|
|
836
|
+
return o(() => {
|
|
837
|
+
let e = w.current;
|
|
286
838
|
if (!e) return;
|
|
287
|
-
let t = () => {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
w(!1), b?.();
|
|
839
|
+
let t = (e) => {
|
|
840
|
+
let t = e.newState === "open";
|
|
841
|
+
C(t), t ? v?.() : y?.();
|
|
291
842
|
};
|
|
292
|
-
return e.addEventListener("
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}, [
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
style: { anchorName: `--zen-popover-anchor-${S}` },
|
|
301
|
-
popoverTarget: `zen__popover-${S}`,
|
|
843
|
+
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
844
|
+
}, [v, y]), o(() => {
|
|
845
|
+
a === "manual" && (p ? w.current?.showPopover?.() : w.current?.hidePopover?.());
|
|
846
|
+
}, [p, a]), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
847
|
+
"aria-expanded": S,
|
|
848
|
+
className: k("max-w-fit min-w-fit", f),
|
|
849
|
+
style: { anchorName: `--zen-popover-anchor-${x}` },
|
|
850
|
+
popoverTarget: `zen__popover-${x}`,
|
|
302
851
|
popoverTargetAction: "toggle",
|
|
303
852
|
onClick: c === "click" ? (e) => {
|
|
304
|
-
switch (e.stopPropagation(), e.nativeEvent.stopImmediatePropagation(),
|
|
853
|
+
switch (e.stopPropagation(), e.nativeEvent.stopImmediatePropagation(), a) {
|
|
305
854
|
case "auto":
|
|
306
|
-
|
|
855
|
+
w.current?.togglePopover?.();
|
|
307
856
|
break;
|
|
308
|
-
case "manual":
|
|
857
|
+
case "manual": g?.(!p);
|
|
309
858
|
}
|
|
310
859
|
} : void 0,
|
|
311
860
|
onMouseEnter: c === "hover" ? (e) => {
|
|
312
|
-
e.stopPropagation(),
|
|
861
|
+
e.stopPropagation(), w.current?.showPopover?.();
|
|
313
862
|
} : void 0,
|
|
314
863
|
onMouseLeave: c === "hover" ? (e) => {
|
|
315
|
-
e.stopPropagation(),
|
|
864
|
+
e.stopPropagation(), w.current?.hidePopover?.();
|
|
316
865
|
} : void 0,
|
|
317
866
|
children: r
|
|
318
|
-
}), /* @__PURE__ */
|
|
319
|
-
...
|
|
320
|
-
ref:
|
|
867
|
+
}), /* @__PURE__ */ m("div", {
|
|
868
|
+
...b,
|
|
869
|
+
ref: w,
|
|
321
870
|
role: i,
|
|
322
|
-
popover:
|
|
323
|
-
id: `zen__popover-${
|
|
324
|
-
className:
|
|
871
|
+
popover: a,
|
|
872
|
+
id: `zen__popover-${x}`,
|
|
873
|
+
className: k("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]", U, t),
|
|
325
874
|
style: {
|
|
326
|
-
...
|
|
327
|
-
"--gap":
|
|
875
|
+
..._,
|
|
876
|
+
"--gap": l,
|
|
328
877
|
top: "calc(anchor(bottom) + var(--gap))",
|
|
329
878
|
left: "calc(anchor(center) - 50%)",
|
|
330
|
-
positionAnchor: `--zen-popover-anchor-${
|
|
879
|
+
positionAnchor: `--zen-popover-anchor-${x}`
|
|
331
880
|
},
|
|
332
881
|
children: n
|
|
333
882
|
})] });
|
|
334
883
|
}
|
|
335
884
|
//#endregion
|
|
336
885
|
//#region packages/collapse/index.tsx
|
|
337
|
-
function
|
|
338
|
-
let { items: t = [], children: n, moreItemsLabel: r = "", parentRef: i, data:
|
|
886
|
+
function Ie(e) {
|
|
887
|
+
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({
|
|
339
888
|
visible: t,
|
|
340
889
|
hidden: []
|
|
341
|
-
}),
|
|
890
|
+
}), v = l(() => {
|
|
342
891
|
if (typeof document > "u") return null;
|
|
343
892
|
let e = document.createElement("canvas").getContext("2d");
|
|
344
|
-
return e && (e.font =
|
|
345
|
-
}, []),
|
|
893
|
+
return e && (e.font = c), e;
|
|
894
|
+
}, []), y = () => {
|
|
346
895
|
let e = i?.current;
|
|
347
896
|
if (!e) return;
|
|
348
897
|
let n = e.offsetWidth;
|
|
349
|
-
if (
|
|
350
|
-
|
|
898
|
+
if (b.reduce((e, t) => e + t, 0) <= n - 20) {
|
|
899
|
+
_({
|
|
351
900
|
visible: t,
|
|
352
901
|
hidden: []
|
|
353
902
|
});
|
|
354
903
|
return;
|
|
355
904
|
}
|
|
356
|
-
let a = [], o = [], c = s(r, (
|
|
357
|
-
|
|
905
|
+
let a = [], o = [], c = s(r, (v?.measureText(r).width ?? 0) + 10);
|
|
906
|
+
b?.reduce((e, r, i) => (e + r + c > n - 20 ? o.push(t[i]) : a.push(t[i]), e + r), 0), _({
|
|
358
907
|
visible: a,
|
|
359
908
|
hidden: o
|
|
360
909
|
});
|
|
361
|
-
},
|
|
362
|
-
return
|
|
363
|
-
|
|
364
|
-
}, [t]),
|
|
910
|
+
}, b = l(() => t?.map((e) => s(e, v?.measureText(e).width ?? 0)) ?? [], [t]);
|
|
911
|
+
return o(() => {
|
|
912
|
+
y();
|
|
913
|
+
}, [t]), o(() => {
|
|
365
914
|
if (!i?.current) return;
|
|
366
915
|
let e = new ResizeObserver(() => {
|
|
367
|
-
|
|
916
|
+
y();
|
|
368
917
|
});
|
|
369
918
|
return e.observe(i.current), () => {
|
|
370
919
|
e.disconnect();
|
|
371
920
|
};
|
|
372
|
-
}, [t]), /* @__PURE__ */ p
|
|
921
|
+
}, [t]), /* @__PURE__ */ h(p, { children: [g.visible?.map((e, t) => n(e, t, a?.[t])), g.hidden?.length > 0 && /* @__PURE__ */ m(W, {
|
|
373
922
|
trigger: "click",
|
|
374
|
-
|
|
923
|
+
triggerClassName: "flex rounded-md",
|
|
924
|
+
content: /* @__PURE__ */ m("div", {
|
|
375
925
|
className: "grid max-h-60 grid-flow-row grid-cols-2 gap-3 overflow-auto p-2",
|
|
376
|
-
children:
|
|
926
|
+
children: g.hidden.map((e, t) => n(e, g.visible.length + t, a?.[g.visible.length + t]))
|
|
377
927
|
}),
|
|
378
|
-
children: /* @__PURE__ */
|
|
379
|
-
className:
|
|
380
|
-
variant:
|
|
381
|
-
"aria-label": `Show ${
|
|
382
|
-
children: /* @__PURE__ */
|
|
928
|
+
children: /* @__PURE__ */ m(z, {
|
|
929
|
+
className: k("cursor-pointer", f),
|
|
930
|
+
variant: u,
|
|
931
|
+
"aria-label": `Show ${g.hidden.length} more ${r}`,
|
|
932
|
+
children: /* @__PURE__ */ m("span", { children: `+${g.hidden.length} ${r}` })
|
|
383
933
|
}, "more_items_button")
|
|
384
934
|
})] });
|
|
385
935
|
}
|
|
386
936
|
//#endregion
|
|
387
937
|
//#region packages/dialog/index.tsx
|
|
388
|
-
function
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
938
|
+
function Le({ open: e, onOpenChange: t, title: n, description: r, children: i, dismissible: a = !0, initialFocus: c, size: l = "md", className: d, role: f }) {
|
|
939
|
+
M();
|
|
940
|
+
let p = u(null), g = s(), _ = s();
|
|
941
|
+
return o(() => {
|
|
942
|
+
let t = p.current;
|
|
943
|
+
if (t) {
|
|
944
|
+
if (e && !t.open) {
|
|
945
|
+
let e = document.documentElement;
|
|
946
|
+
e.toggleAttribute("data-zen-scrollbar", window.innerWidth > e.clientWidth), t.showModal(), c?.current?.focus();
|
|
947
|
+
} else !e && t.open && t.close();
|
|
948
|
+
}
|
|
949
|
+
}, [e, c]), /* @__PURE__ */ m("dialog", {
|
|
950
|
+
ref: p,
|
|
951
|
+
role: f,
|
|
952
|
+
"aria-labelledby": g,
|
|
953
|
+
"aria-describedby": r ? _ : void 0,
|
|
954
|
+
className: k("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),
|
|
399
955
|
onCancel: (e) => {
|
|
400
|
-
e.preventDefault(),
|
|
956
|
+
e.preventDefault(), a && t?.(!1);
|
|
401
957
|
},
|
|
402
958
|
onClick: (e) => {
|
|
403
|
-
e.target === e.currentTarget &&
|
|
959
|
+
e.target === e.currentTarget && a && t?.(!1);
|
|
404
960
|
},
|
|
405
|
-
children: /* @__PURE__ */
|
|
961
|
+
children: /* @__PURE__ */ h("div", {
|
|
406
962
|
className: "flex max-h-[calc(100dvh-2rem)] flex-col gap-4 overflow-x-hidden overflow-y-auto p-6",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
963
|
+
children: [/* @__PURE__ */ h("div", {
|
|
408
964
|
className: "flex flex-col gap-2",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
410
|
-
id:
|
|
411
|
-
className: "text-lg font-semibold",
|
|
965
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
966
|
+
id: g,
|
|
967
|
+
className: "text-lg font-semibold tracking-tight",
|
|
412
968
|
children: n
|
|
413
|
-
}), r && /* @__PURE__ */
|
|
414
|
-
id:
|
|
969
|
+
}), r && /* @__PURE__ */ m("p", {
|
|
970
|
+
id: _,
|
|
415
971
|
className: "text-muted-foreground mt-0! text-sm leading-5",
|
|
416
972
|
children: r
|
|
417
973
|
})]
|
|
@@ -421,22 +977,22 @@ function N({ open: e, onOpenChange: t, title: n, description: r, children: i, di
|
|
|
421
977
|
}
|
|
422
978
|
//#endregion
|
|
423
979
|
//#region packages/confirm-dialog/index.tsx
|
|
424
|
-
function
|
|
425
|
-
return /* @__PURE__ */
|
|
980
|
+
function Re({ open: e, onOpenChange: t, title: n, description: r, confirmLabel: i, cancelLabel: a = "Cancel", destructive: o = !1, onConfirm: s }) {
|
|
981
|
+
return /* @__PURE__ */ m(Le, {
|
|
426
982
|
role: "alertdialog",
|
|
427
983
|
open: e,
|
|
428
984
|
onOpenChange: t,
|
|
429
985
|
title: n,
|
|
430
986
|
description: r,
|
|
431
987
|
className: "w-[26rem]",
|
|
432
|
-
children: /* @__PURE__ */
|
|
988
|
+
children: /* @__PURE__ */ h("div", {
|
|
433
989
|
className: "flex justify-end gap-2",
|
|
434
|
-
children: [/* @__PURE__ */
|
|
990
|
+
children: [/* @__PURE__ */ m(B, {
|
|
435
991
|
variant: "outline",
|
|
436
992
|
autoFocus: !0,
|
|
437
993
|
onClick: () => t(!1),
|
|
438
994
|
children: a
|
|
439
|
-
}), /* @__PURE__ */
|
|
995
|
+
}), /* @__PURE__ */ m(B, {
|
|
440
996
|
variant: o ? "destructive" : "default",
|
|
441
997
|
onClick: () => {
|
|
442
998
|
s(), t(!1);
|
|
@@ -447,9 +1003,111 @@ function ae({ open: e, onOpenChange: t, title: n, description: r, confirmLabel:
|
|
|
447
1003
|
});
|
|
448
1004
|
}
|
|
449
1005
|
//#endregion
|
|
1006
|
+
//#region packages/editable-cell/index.tsx
|
|
1007
|
+
function ze({ children: e, editor: t, label: n, readOnly: r = !1, editing: i, onEditingChange: a, title: o, className: s }) {
|
|
1008
|
+
let [c, l] = d(!1), u = i ?? c, f = (e) => {
|
|
1009
|
+
i === void 0 && l(e), a?.(e);
|
|
1010
|
+
};
|
|
1011
|
+
return r ? /* @__PURE__ */ m("span", {
|
|
1012
|
+
title: o,
|
|
1013
|
+
className: k("zen__editable-cell block px-1 text-right tabular-nums", s),
|
|
1014
|
+
children: e
|
|
1015
|
+
}) : u ? /* @__PURE__ */ m(p, { children: t(() => f(!1)) }) : /* @__PURE__ */ m("button", {
|
|
1016
|
+
type: "button",
|
|
1017
|
+
title: o,
|
|
1018
|
+
"aria-label": n ? `${n}. Edit` : void 0,
|
|
1019
|
+
onClick: () => f(!0),
|
|
1020
|
+
className: k("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
|
+
children: e
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
//#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
|
+
//#region packages/field/index.tsx
|
|
1070
|
+
function Be({ label: e, hint: n, error: i, children: a, className: o }) {
|
|
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 = k(l?.props["aria-describedby"], d, f).trim() || void 0;
|
|
1072
|
+
return /* @__PURE__ */ h("div", {
|
|
1073
|
+
className: k("zen__field flex flex-col gap-2", o),
|
|
1074
|
+
children: [
|
|
1075
|
+
/* @__PURE__ */ m("label", {
|
|
1076
|
+
htmlFor: u,
|
|
1077
|
+
className: "text-sm leading-none font-medium",
|
|
1078
|
+
children: e
|
|
1079
|
+
}),
|
|
1080
|
+
l ? t(l, {
|
|
1081
|
+
id: u,
|
|
1082
|
+
"aria-describedby": p,
|
|
1083
|
+
"aria-invalid": i ? !0 : l.props["aria-invalid"]
|
|
1084
|
+
}) : a,
|
|
1085
|
+
n && /* @__PURE__ */ m("p", {
|
|
1086
|
+
id: d,
|
|
1087
|
+
className: "text-muted-foreground mt-0! text-xs",
|
|
1088
|
+
children: n
|
|
1089
|
+
}),
|
|
1090
|
+
i && /* @__PURE__ */ h("p", {
|
|
1091
|
+
id: f,
|
|
1092
|
+
role: "alert",
|
|
1093
|
+
className: "text-destructive mt-0! flex items-center gap-1.5 text-xs font-medium",
|
|
1094
|
+
children: [/* @__PURE__ */ m(K, { className: "shrink-0" }), i]
|
|
1095
|
+
})
|
|
1096
|
+
]
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
function Ve({ tone: e = "info", children: t, className: n }) {
|
|
1100
|
+
let r = e === "error" ? K : e === "success" ? G : q;
|
|
1101
|
+
return /* @__PURE__ */ h("p", {
|
|
1102
|
+
role: e === "error" ? "alert" : "status",
|
|
1103
|
+
className: k("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
|
+
children: [/* @__PURE__ */ m(r, { className: "mt-0.5 shrink-0" }), /* @__PURE__ */ m("span", { children: t })]
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
//#endregion
|
|
450
1108
|
//#region packages/icons/search.tsx
|
|
451
|
-
function
|
|
452
|
-
return /* @__PURE__ */
|
|
1109
|
+
function He(e) {
|
|
1110
|
+
return /* @__PURE__ */ m("svg", {
|
|
453
1111
|
xmlns: "http://www.w3.org/2000/svg",
|
|
454
1112
|
fill: "none",
|
|
455
1113
|
viewBox: "0 0 24 24",
|
|
@@ -457,7 +1115,7 @@ function P(e) {
|
|
|
457
1115
|
stroke: "currentColor",
|
|
458
1116
|
className: "h-6 w-6",
|
|
459
1117
|
...e,
|
|
460
|
-
children: /* @__PURE__ */
|
|
1118
|
+
children: /* @__PURE__ */ m("path", {
|
|
461
1119
|
strokeLinecap: "round",
|
|
462
1120
|
strokeLinejoin: "round",
|
|
463
1121
|
d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
|
|
@@ -466,8 +1124,8 @@ function P(e) {
|
|
|
466
1124
|
}
|
|
467
1125
|
//#endregion
|
|
468
1126
|
//#region packages/icons/x-mark.tsx
|
|
469
|
-
function
|
|
470
|
-
return /* @__PURE__ */
|
|
1127
|
+
function Ue(e) {
|
|
1128
|
+
return /* @__PURE__ */ m("svg", {
|
|
471
1129
|
xmlns: "http://www.w3.org/2000/svg",
|
|
472
1130
|
fill: "none",
|
|
473
1131
|
viewBox: "0 0 24 24",
|
|
@@ -475,7 +1133,7 @@ function oe(e) {
|
|
|
475
1133
|
stroke: "currentColor",
|
|
476
1134
|
className: "h-6 w-6",
|
|
477
1135
|
...e,
|
|
478
|
-
children: /* @__PURE__ */
|
|
1136
|
+
children: /* @__PURE__ */ m("path", {
|
|
479
1137
|
strokeLinecap: "round",
|
|
480
1138
|
strokeLinejoin: "round",
|
|
481
1139
|
d: "M6 18 18 6M6 6l12 12"
|
|
@@ -483,46 +1141,101 @@ function oe(e) {
|
|
|
483
1141
|
});
|
|
484
1142
|
}
|
|
485
1143
|
//#endregion
|
|
486
|
-
//#region packages/
|
|
487
|
-
function
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
1144
|
+
//#region packages/input-group/index.tsx
|
|
1145
|
+
function We({ invalid: e, className: t, onMouseDown: n, ...r }) {
|
|
1146
|
+
return /* @__PURE__ */ m("div", {
|
|
1147
|
+
"data-invalid": e || void 0,
|
|
1148
|
+
className: k("zen__input-group cursor-text", Fe, "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
|
+
onMouseDown: (e) => {
|
|
1150
|
+
n?.(e);
|
|
1151
|
+
let t = e.target;
|
|
1152
|
+
if (e.defaultPrevented || t.closest("input, textarea, button, a, select, [tabindex]")) return;
|
|
1153
|
+
let r = e.currentTarget.querySelector("input:not(:disabled)");
|
|
1154
|
+
r && (e.preventDefault(), r.focus());
|
|
1155
|
+
},
|
|
1156
|
+
...r
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
function J({ className: e, ...t }) {
|
|
1160
|
+
return /* @__PURE__ */ m("input", {
|
|
1161
|
+
className: k("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
|
+
...t
|
|
491
1163
|
});
|
|
492
|
-
|
|
1164
|
+
}
|
|
1165
|
+
function Y({ className: e, ...t }) {
|
|
1166
|
+
return /* @__PURE__ */ m("span", {
|
|
1167
|
+
className: k("text-muted-foreground flex shrink-0 items-center gap-1 text-sm select-none [&_svg]:size-4", e),
|
|
1168
|
+
...t
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
//#endregion
|
|
1172
|
+
//#region packages/utils/field-chevron.tsx
|
|
1173
|
+
function X({ open: e, className: t }) {
|
|
1174
|
+
return /* @__PURE__ */ m("svg", {
|
|
1175
|
+
viewBox: "0 0 16 16",
|
|
1176
|
+
fill: "none",
|
|
1177
|
+
stroke: "currentColor",
|
|
1178
|
+
strokeWidth: "1.6",
|
|
1179
|
+
strokeLinecap: "round",
|
|
1180
|
+
strokeLinejoin: "round",
|
|
1181
|
+
"aria-hidden": !0,
|
|
1182
|
+
className: k("text-muted-foreground size-4 shrink-0 transition-transform duration-300", e && "rotate-180", t),
|
|
1183
|
+
children: /* @__PURE__ */ m("path", { d: "m4 6 4 4 4-4" })
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
//#endregion
|
|
1187
|
+
//#region packages/utils/useVirtualList.ts
|
|
1188
|
+
function Ge({ count: e, itemHeight: t, scrollRef: n, overscan: r = 6 }) {
|
|
1189
|
+
let i = (n, i) => {
|
|
1190
|
+
let a = i || t * 10;
|
|
1191
|
+
return {
|
|
1192
|
+
first: Math.max(0, Math.floor(n / t) - r),
|
|
1193
|
+
last: Math.min(e, Math.ceil((n + a) / t) + r)
|
|
1194
|
+
};
|
|
1195
|
+
}, [a, o] = d(() => i(0, 0));
|
|
1196
|
+
c(() => {
|
|
493
1197
|
let e = n.current;
|
|
494
1198
|
if (!e) return;
|
|
495
|
-
let t = () =>
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
1199
|
+
let t = () => {
|
|
1200
|
+
let t = i(e.scrollTop, e.clientHeight);
|
|
1201
|
+
o((e) => e.first === t.first && e.last === t.last ? e : t);
|
|
1202
|
+
};
|
|
499
1203
|
t(), e.addEventListener("scroll", t, { passive: !0 });
|
|
500
1204
|
let r = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
501
1205
|
return r?.observe(e), () => {
|
|
502
1206
|
e.removeEventListener("scroll", t), r?.disconnect();
|
|
503
1207
|
};
|
|
504
|
-
}, [
|
|
505
|
-
|
|
506
|
-
|
|
1208
|
+
}, [
|
|
1209
|
+
n,
|
|
1210
|
+
e,
|
|
1211
|
+
t,
|
|
1212
|
+
r
|
|
1213
|
+
]);
|
|
1214
|
+
let s = Math.min(a.first, e), l = Math.min(a.last, e), u = [];
|
|
1215
|
+
for (let e = s; e < l; e++) u.push({
|
|
507
1216
|
index: e,
|
|
508
1217
|
start: e * t,
|
|
509
1218
|
size: t
|
|
510
1219
|
});
|
|
1220
|
+
let f = e * t;
|
|
511
1221
|
return {
|
|
512
|
-
items:
|
|
513
|
-
totalSize:
|
|
1222
|
+
items: u,
|
|
1223
|
+
totalSize: f,
|
|
1224
|
+
paddingTop: u.length ? u[0].start : 0,
|
|
1225
|
+
paddingBottom: u.length ? f - (u[u.length - 1].start + t) : 0
|
|
514
1226
|
};
|
|
515
1227
|
}
|
|
516
1228
|
//#endregion
|
|
517
1229
|
//#region packages/dropdown/index.tsx
|
|
518
|
-
function
|
|
519
|
-
let { items: t, selected: n, className: r, onChange: i, disabled: a, placeholder: o = "Select an Item", multiple: s, mutable: c, onAdd:
|
|
520
|
-
return /* @__PURE__ */
|
|
521
|
-
triggerClassName:
|
|
522
|
-
|
|
1230
|
+
function Ke(e) {
|
|
1231
|
+
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(W, {
|
|
1233
|
+
triggerClassName: _ ? "w-full max-w-none" : void 0,
|
|
1234
|
+
className: "min-w-0",
|
|
1235
|
+
content: /* @__PURE__ */ m(qe, {
|
|
523
1236
|
...c ? {
|
|
524
1237
|
mutable: c,
|
|
525
|
-
onAdd:
|
|
1238
|
+
onAdd: l
|
|
526
1239
|
} : { mutable: c },
|
|
527
1240
|
...s ? {
|
|
528
1241
|
multiple: s,
|
|
@@ -535,119 +1248,110 @@ function F(e) {
|
|
|
535
1248
|
selected: n
|
|
536
1249
|
}
|
|
537
1250
|
}),
|
|
538
|
-
onOpen: () =>
|
|
539
|
-
onClose: () =>
|
|
540
|
-
children: /* @__PURE__ */
|
|
1251
|
+
onOpen: () => g(!0),
|
|
1252
|
+
onClose: () => g(!1),
|
|
1253
|
+
children: /* @__PURE__ */ h("div", {
|
|
541
1254
|
role: "combobox",
|
|
542
|
-
"aria-expanded":
|
|
1255
|
+
"aria-expanded": p,
|
|
543
1256
|
"aria-haspopup": "listbox",
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
1257
|
+
onClick: (e) => e.preventDefault(),
|
|
1258
|
+
className: k(H, "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
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1260
|
+
className: k("flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm", a ? "text-muted-foreground" : "text-foreground"),
|
|
1261
|
+
ref: f,
|
|
1262
|
+
children: s && !n.length ? /* @__PURE__ */ m("span", {
|
|
549
1263
|
className: "text-muted-foreground",
|
|
550
1264
|
children: o
|
|
551
|
-
}) : s ? /* @__PURE__ */
|
|
1265
|
+
}) : s ? /* @__PURE__ */ m(Ie, {
|
|
552
1266
|
items: n.map((e) => e.text),
|
|
553
1267
|
data: n,
|
|
554
|
-
parentRef:
|
|
1268
|
+
parentRef: f,
|
|
555
1269
|
estimator: (e, t) => t + 40,
|
|
556
1270
|
badgeVariant: "secondary",
|
|
557
1271
|
badgeStyles: "h-6 min-w-min gap-2",
|
|
558
|
-
children: (e, t, r) => /* @__PURE__ */
|
|
1272
|
+
children: (e, t, r) => /* @__PURE__ */ h(z, {
|
|
559
1273
|
className: "flex h-6 min-w-min gap-2 pr-1",
|
|
560
1274
|
variant: "secondary",
|
|
561
|
-
children: [e, /* @__PURE__ */
|
|
1275
|
+
children: [e, /* @__PURE__ */ m(B, {
|
|
562
1276
|
onClick: () => {
|
|
563
1277
|
i(n.filter((e) => e.key !== r?.key));
|
|
564
1278
|
},
|
|
565
1279
|
variant: "icon",
|
|
566
1280
|
size: "icon",
|
|
567
|
-
className: "group size-4 rounded-sm p-0.5",
|
|
568
|
-
children: /* @__PURE__ */
|
|
1281
|
+
className: "group relative -top-px size-4 rounded-sm p-0.5",
|
|
1282
|
+
children: /* @__PURE__ */ m(Ue, { className: "size-3 transition duration-300 group-hover:rotate-90" })
|
|
569
1283
|
})]
|
|
570
1284
|
}, `collapsed_item_${r?.key ?? t}`)
|
|
571
1285
|
}) : n.text ?? o
|
|
572
|
-
}), /* @__PURE__ */
|
|
573
|
-
viewBox: "0 0 16 16",
|
|
574
|
-
fill: "none",
|
|
575
|
-
stroke: "currentColor",
|
|
576
|
-
strokeWidth: "1.6",
|
|
577
|
-
strokeLinecap: "round",
|
|
578
|
-
strokeLinejoin: "round",
|
|
579
|
-
"aria-hidden": !0,
|
|
580
|
-
className: h("text-muted-foreground size-4 shrink-0 transition-transform duration-300", g && "rotate-180"),
|
|
581
|
-
children: /* @__PURE__ */ f("path", { d: "m4 6 4 4 4-4" })
|
|
582
|
-
})]
|
|
1286
|
+
}), /* @__PURE__ */ m(X, { open: p })]
|
|
583
1287
|
})
|
|
584
1288
|
});
|
|
585
1289
|
}
|
|
586
|
-
function
|
|
587
|
-
let { items: t, multiple: n, selected: r, onChange: i, mutable:
|
|
588
|
-
count:
|
|
1290
|
+
function qe(e) {
|
|
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]), _ = Ge({
|
|
1292
|
+
count: g.length,
|
|
589
1293
|
itemHeight: 35,
|
|
590
|
-
scrollRef:
|
|
1294
|
+
scrollRef: p
|
|
591
1295
|
});
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
}, [
|
|
595
|
-
let
|
|
596
|
-
return /* @__PURE__ */
|
|
1296
|
+
o(() => {
|
|
1297
|
+
p.current && (p.current.scrollTop = 0);
|
|
1298
|
+
}, [c]);
|
|
1299
|
+
let v = r instanceof Array ? r.map((e) => e.key) : [r.key];
|
|
1300
|
+
return /* @__PURE__ */ h("div", {
|
|
597
1301
|
className: "divide-tint/10 flex w-full flex-col divide-y overflow-hidden rounded-xl",
|
|
598
|
-
children: [/* @__PURE__ */
|
|
599
|
-
className:
|
|
600
|
-
children: [/* @__PURE__ */
|
|
601
|
-
className: "text-foreground inline-flex grow bg-transparent text-sm outline-hidden",
|
|
1302
|
+
children: [/* @__PURE__ */ h("div", {
|
|
1303
|
+
className: "flex h-10 grow items-center gap-2 px-3",
|
|
1304
|
+
children: [/* @__PURE__ */ m(Y, { children: /* @__PURE__ */ m(He, {}) }), /* @__PURE__ */ m(J, {
|
|
602
1305
|
placeholder: "Search",
|
|
603
|
-
|
|
604
|
-
|
|
1306
|
+
"aria-label": "Search options",
|
|
1307
|
+
value: c,
|
|
1308
|
+
onChange: (e) => f(e.target.value)
|
|
605
1309
|
})]
|
|
606
|
-
}), /* @__PURE__ */
|
|
1310
|
+
}), /* @__PURE__ */ h("ul", {
|
|
607
1311
|
role: "listbox",
|
|
608
|
-
className:
|
|
609
|
-
ref:
|
|
610
|
-
children: [/* @__PURE__ */
|
|
1312
|
+
className: k("max-h-72 grow overflow-y-auto py-1", "focus:ring-0 focus:outline-hidden"),
|
|
1313
|
+
ref: p,
|
|
1314
|
+
children: [/* @__PURE__ */ m("div", {
|
|
611
1315
|
style: {
|
|
612
|
-
height: `${
|
|
1316
|
+
height: `${_.totalSize}px`,
|
|
613
1317
|
width: "100%",
|
|
614
1318
|
position: "relative"
|
|
615
1319
|
},
|
|
616
|
-
children:
|
|
1320
|
+
children: _.items.map((e) => /* @__PURE__ */ h("li", {
|
|
617
1321
|
role: "option",
|
|
618
|
-
"aria-selected":
|
|
1322
|
+
"aria-selected": v.includes(g[e.index].key),
|
|
619
1323
|
style: {
|
|
620
1324
|
height: `${e.size}px`,
|
|
621
1325
|
transform: `translateY(${e.start}px)`
|
|
622
1326
|
},
|
|
623
|
-
className:
|
|
1327
|
+
className: k("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"),
|
|
624
1328
|
onClick: () => {
|
|
625
|
-
n ?
|
|
1329
|
+
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]);
|
|
626
1330
|
},
|
|
627
|
-
children: [/* @__PURE__ */
|
|
1331
|
+
children: [/* @__PURE__ */ m("span", {
|
|
628
1332
|
className: "text-primary col-start-1",
|
|
629
1333
|
"aria-hidden": !0,
|
|
630
|
-
children:
|
|
631
|
-
}), /* @__PURE__ */
|
|
1334
|
+
children: v.includes(g[e.index].key) && /* @__PURE__ */ m(G, {})
|
|
1335
|
+
}), /* @__PURE__ */ m("span", {
|
|
632
1336
|
className: "col-start-2 truncate",
|
|
633
|
-
children:
|
|
1337
|
+
children: g[e.index].text
|
|
634
1338
|
})]
|
|
635
1339
|
}, e.index))
|
|
636
|
-
}),
|
|
1340
|
+
}), c.length > 0 && g.length === 0 && (a ? /* @__PURE__ */ h("li", {
|
|
637
1341
|
role: "option",
|
|
638
1342
|
"aria-selected": !1,
|
|
639
|
-
className:
|
|
1343
|
+
className: k("hover:bg-muted cursor-pointer px-3 py-2 text-sm select-none"),
|
|
640
1344
|
onClick: () => {
|
|
641
1345
|
s({
|
|
642
|
-
text:
|
|
643
|
-
key:
|
|
644
|
-
}),
|
|
1346
|
+
text: c,
|
|
1347
|
+
key: c
|
|
1348
|
+
}), f("");
|
|
645
1349
|
},
|
|
646
|
-
children: ["Add ",
|
|
647
|
-
}) : /* @__PURE__ */
|
|
1350
|
+
children: ["Add ", c]
|
|
1351
|
+
}) : /* @__PURE__ */ m("li", {
|
|
648
1352
|
role: "option",
|
|
649
1353
|
"aria-selected": !1,
|
|
650
|
-
className:
|
|
1354
|
+
className: k("text-muted-foreground cursor-not-allowed px-3 py-2 text-sm"),
|
|
651
1355
|
children: "No results found"
|
|
652
1356
|
}))]
|
|
653
1357
|
})]
|
|
@@ -655,11 +1359,11 @@ function I(e) {
|
|
|
655
1359
|
}
|
|
656
1360
|
//#endregion
|
|
657
1361
|
//#region packages/header/index.tsx
|
|
658
|
-
function
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
className:
|
|
1362
|
+
function Je({ className: e, children: t, ...n }) {
|
|
1363
|
+
return M(), /* @__PURE__ */ m("header", {
|
|
1364
|
+
className: k("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),
|
|
661
1365
|
...n,
|
|
662
|
-
children: /* @__PURE__ */
|
|
1366
|
+
children: /* @__PURE__ */ m("div", {
|
|
663
1367
|
className: "flex items-center justify-between gap-4 px-4 py-2.5 md:gap-6 md:px-6 md:py-3",
|
|
664
1368
|
children: t
|
|
665
1369
|
})
|
|
@@ -667,8 +1371,8 @@ function L({ className: e, children: t, ...n }) {
|
|
|
667
1371
|
}
|
|
668
1372
|
//#endregion
|
|
669
1373
|
//#region packages/icons/chevron-down.tsx
|
|
670
|
-
function
|
|
671
|
-
return /* @__PURE__ */
|
|
1374
|
+
function Ye(e) {
|
|
1375
|
+
return /* @__PURE__ */ m("svg", {
|
|
672
1376
|
xmlns: "http://www.w3.org/2000/svg",
|
|
673
1377
|
fill: "none",
|
|
674
1378
|
viewBox: "0 0 24 24",
|
|
@@ -676,7 +1380,7 @@ function R(e) {
|
|
|
676
1380
|
stroke: "currentColor",
|
|
677
1381
|
className: "h-6 w-6",
|
|
678
1382
|
...e,
|
|
679
|
-
children: /* @__PURE__ */
|
|
1383
|
+
children: /* @__PURE__ */ m("path", {
|
|
680
1384
|
strokeLinecap: "round",
|
|
681
1385
|
strokeLinejoin: "round",
|
|
682
1386
|
d: "m19.5 8.25-7.5 7.5-7.5-7.5"
|
|
@@ -684,9 +1388,45 @@ function R(e) {
|
|
|
684
1388
|
});
|
|
685
1389
|
}
|
|
686
1390
|
//#endregion
|
|
1391
|
+
//#region packages/icons/chevron-left.tsx
|
|
1392
|
+
function Xe(e) {
|
|
1393
|
+
return /* @__PURE__ */ m("svg", {
|
|
1394
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1395
|
+
fill: "none",
|
|
1396
|
+
viewBox: "0 0 24 24",
|
|
1397
|
+
strokeWidth: 1.5,
|
|
1398
|
+
stroke: "currentColor",
|
|
1399
|
+
className: "h-6 w-6",
|
|
1400
|
+
...e,
|
|
1401
|
+
children: /* @__PURE__ */ m("path", {
|
|
1402
|
+
strokeLinecap: "round",
|
|
1403
|
+
strokeLinejoin: "round",
|
|
1404
|
+
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
1405
|
+
})
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
//#endregion
|
|
1409
|
+
//#region packages/icons/chevron-right.tsx
|
|
1410
|
+
function Ze(e) {
|
|
1411
|
+
return /* @__PURE__ */ m("svg", {
|
|
1412
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1413
|
+
fill: "none",
|
|
1414
|
+
viewBox: "0 0 24 24",
|
|
1415
|
+
strokeWidth: 1.5,
|
|
1416
|
+
stroke: "currentColor",
|
|
1417
|
+
className: "h-6 w-6",
|
|
1418
|
+
...e,
|
|
1419
|
+
children: /* @__PURE__ */ m("path", {
|
|
1420
|
+
strokeLinecap: "round",
|
|
1421
|
+
strokeLinejoin: "round",
|
|
1422
|
+
d: "m8.25 4.5 7.5 7.5-7.5 7.5"
|
|
1423
|
+
})
|
|
1424
|
+
});
|
|
1425
|
+
}
|
|
1426
|
+
//#endregion
|
|
687
1427
|
//#region packages/icons/chevron-up.tsx
|
|
688
|
-
function
|
|
689
|
-
return /* @__PURE__ */
|
|
1428
|
+
function Qe(e) {
|
|
1429
|
+
return /* @__PURE__ */ m("svg", {
|
|
690
1430
|
xmlns: "http://www.w3.org/2000/svg",
|
|
691
1431
|
fill: "none",
|
|
692
1432
|
viewBox: "0 0 24 24",
|
|
@@ -694,7 +1434,7 @@ function z(e) {
|
|
|
694
1434
|
stroke: "currentColor",
|
|
695
1435
|
className: "h-6 w-6",
|
|
696
1436
|
...e,
|
|
697
|
-
children: /* @__PURE__ */
|
|
1437
|
+
children: /* @__PURE__ */ m("path", {
|
|
698
1438
|
strokeLinecap: "round",
|
|
699
1439
|
strokeLinejoin: "round",
|
|
700
1440
|
d: "m4.5 15.75 7.5-7.5 7.5 7.5"
|
|
@@ -703,29 +1443,290 @@ function z(e) {
|
|
|
703
1443
|
}
|
|
704
1444
|
//#endregion
|
|
705
1445
|
//#region packages/input/index.tsx
|
|
706
|
-
function
|
|
1446
|
+
function $e(e) {
|
|
707
1447
|
let { className: t, ...n } = e;
|
|
708
|
-
return /* @__PURE__ */
|
|
709
|
-
className:
|
|
1448
|
+
return /* @__PURE__ */ m("input", {
|
|
1449
|
+
className: k(V, "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),
|
|
710
1450
|
...n
|
|
711
1451
|
});
|
|
712
1452
|
}
|
|
713
1453
|
//#endregion
|
|
1454
|
+
//#region packages/meter/index.tsx
|
|
1455
|
+
function et({ value: e, max: t = 100, label: n, detail: r, hint: i, valueText: a, tone: o = "auto", warnAt: c = .85, className: l }) {
|
|
1456
|
+
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
|
+
return /* @__PURE__ */ h("div", {
|
|
1458
|
+
role: "meter",
|
|
1459
|
+
"aria-labelledby": n ? u : void 0,
|
|
1460
|
+
"aria-valuemin": 0,
|
|
1461
|
+
"aria-valuemax": t,
|
|
1462
|
+
"aria-valuenow": Math.min(e, t),
|
|
1463
|
+
"aria-valuetext": a,
|
|
1464
|
+
className: k("zen__meter grid grid-cols-2 gap-y-1.5", l),
|
|
1465
|
+
children: [
|
|
1466
|
+
n && /* @__PURE__ */ m("span", {
|
|
1467
|
+
id: u,
|
|
1468
|
+
className: "text-sm font-medium",
|
|
1469
|
+
children: n
|
|
1470
|
+
}),
|
|
1471
|
+
r && /* @__PURE__ */ m("span", {
|
|
1472
|
+
className: k("col-start-2 text-right text-sm tabular-nums", g === "danger" ? "text-destructive" : "text-muted-foreground"),
|
|
1473
|
+
children: r
|
|
1474
|
+
}),
|
|
1475
|
+
/* @__PURE__ */ m("div", {
|
|
1476
|
+
className: "bg-muted col-span-2 h-2 overflow-hidden rounded-full",
|
|
1477
|
+
children: /* @__PURE__ */ m("div", {
|
|
1478
|
+
className: k("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
|
+
style: { width: `${p}%` }
|
|
1480
|
+
})
|
|
1481
|
+
}),
|
|
1482
|
+
i && /* @__PURE__ */ m("span", {
|
|
1483
|
+
className: k("col-span-2 text-xs", g === "danger" ? "text-destructive" : "text-muted-foreground"),
|
|
1484
|
+
children: i
|
|
1485
|
+
})
|
|
1486
|
+
]
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
//#endregion
|
|
1490
|
+
//#region packages/utils/month.ts
|
|
1491
|
+
var tt = /^(\d{4})-(0[1-9]|1[0-2])$/;
|
|
1492
|
+
function nt(e) {
|
|
1493
|
+
return typeof e == "string" && tt.test(e);
|
|
1494
|
+
}
|
|
1495
|
+
function Z(e) {
|
|
1496
|
+
let t = tt.exec(e);
|
|
1497
|
+
if (!t) throw Error(`Invalid month: ${e}`);
|
|
1498
|
+
return Number(t[1]) * 12 + Number(t[2]) - 1;
|
|
1499
|
+
}
|
|
1500
|
+
function rt(e) {
|
|
1501
|
+
let t = Math.floor(e / 12);
|
|
1502
|
+
return `${String(t).padStart(4, "0")}-${String(e % 12 + 1).padStart(2, "0")}`;
|
|
1503
|
+
}
|
|
1504
|
+
function it(e, t) {
|
|
1505
|
+
return rt(Z(e) + t);
|
|
1506
|
+
}
|
|
1507
|
+
function at(e, t) {
|
|
1508
|
+
let n = [];
|
|
1509
|
+
for (let r = Z(e); r <= Z(t); r++) n.push(rt(r));
|
|
1510
|
+
return n;
|
|
1511
|
+
}
|
|
1512
|
+
function ot(e, t) {
|
|
1513
|
+
return Z(t) - Z(e);
|
|
1514
|
+
}
|
|
1515
|
+
function st(e = /* @__PURE__ */ new Date()) {
|
|
1516
|
+
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`;
|
|
1517
|
+
}
|
|
1518
|
+
function ct(e, t, n = "short") {
|
|
1519
|
+
let [r, i] = e.split("-").map(Number);
|
|
1520
|
+
return new Intl.DateTimeFormat(t, {
|
|
1521
|
+
month: n,
|
|
1522
|
+
year: "numeric",
|
|
1523
|
+
timeZone: "UTC"
|
|
1524
|
+
}).format(Date.UTC(r, i - 1, 1));
|
|
1525
|
+
}
|
|
1526
|
+
function lt(e) {
|
|
1527
|
+
let t = new Intl.DateTimeFormat(e, {
|
|
1528
|
+
month: "short",
|
|
1529
|
+
timeZone: "UTC"
|
|
1530
|
+
});
|
|
1531
|
+
return Array.from({ length: 12 }, (e, n) => t.format(Date.UTC(2e3, n, 1)));
|
|
1532
|
+
}
|
|
1533
|
+
//#endregion
|
|
1534
|
+
//#region packages/month-picker/index.tsx
|
|
1535
|
+
function ut({ 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 }) {
|
|
1536
|
+
let [g, _] = d(() => Number((e ?? (/* @__PURE__ */ new Date()).toISOString()).slice(0, 4))), v = N({ onOpenChange: (t) => t && e && _(Number(e.slice(0, 4))) }), y = lt(n), b = (e) => (!r || e >= r) && (!i || e <= i);
|
|
1537
|
+
return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("button", {
|
|
1538
|
+
type: "button",
|
|
1539
|
+
id: a,
|
|
1540
|
+
disabled: s,
|
|
1541
|
+
"aria-label": f,
|
|
1542
|
+
...v.triggerProps,
|
|
1543
|
+
className: k("zen__month-picker group", H, "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
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1545
|
+
className: e ? void 0 : "text-muted-foreground",
|
|
1546
|
+
children: e ? ct(e, n) : c
|
|
1547
|
+
}), /* @__PURE__ */ m(X, { open: v.open })]
|
|
1548
|
+
}), /* @__PURE__ */ h("div", {
|
|
1549
|
+
...v.popupProps,
|
|
1550
|
+
role: "dialog",
|
|
1551
|
+
"aria-label": "Choose month",
|
|
1552
|
+
className: k("zen__popover", U, "w-64 p-3"),
|
|
1553
|
+
children: [
|
|
1554
|
+
/* @__PURE__ */ h("div", {
|
|
1555
|
+
className: "mb-2 flex items-center justify-between",
|
|
1556
|
+
children: [
|
|
1557
|
+
/* @__PURE__ */ m("button", {
|
|
1558
|
+
type: "button",
|
|
1559
|
+
"aria-label": "Previous year",
|
|
1560
|
+
onClick: () => _((e) => e - 1),
|
|
1561
|
+
className: "hover:bg-muted rounded p-1.5",
|
|
1562
|
+
children: /* @__PURE__ */ m(Xe, { className: "size-4" })
|
|
1563
|
+
}),
|
|
1564
|
+
/* @__PURE__ */ m("span", {
|
|
1565
|
+
className: "text-sm font-semibold tabular-nums",
|
|
1566
|
+
"aria-live": "polite",
|
|
1567
|
+
children: g
|
|
1568
|
+
}),
|
|
1569
|
+
/* @__PURE__ */ m("button", {
|
|
1570
|
+
type: "button",
|
|
1571
|
+
"aria-label": "Next year",
|
|
1572
|
+
onClick: () => _((e) => e + 1),
|
|
1573
|
+
className: "hover:bg-muted rounded p-1.5",
|
|
1574
|
+
children: /* @__PURE__ */ m(Ze, { className: "size-4" })
|
|
1575
|
+
})
|
|
1576
|
+
]
|
|
1577
|
+
}),
|
|
1578
|
+
/* @__PURE__ */ m("div", {
|
|
1579
|
+
className: "grid grid-cols-3 gap-1",
|
|
1580
|
+
children: y.map((r, i) => {
|
|
1581
|
+
let a = `${g}-${String(i + 1).padStart(2, "0")}`, o = a === e;
|
|
1582
|
+
return /* @__PURE__ */ m("button", {
|
|
1583
|
+
type: "button",
|
|
1584
|
+
disabled: !b(a),
|
|
1585
|
+
"aria-pressed": o,
|
|
1586
|
+
"aria-label": ct(a, n, "long"),
|
|
1587
|
+
onClick: () => {
|
|
1588
|
+
t(a), v.setOpen(!1);
|
|
1589
|
+
},
|
|
1590
|
+
className: k("rounded-sm py-2 text-sm disabled:cursor-not-allowed disabled:opacity-40", o ? "bg-primary text-primary-foreground" : "hover:bg-muted"),
|
|
1591
|
+
children: r
|
|
1592
|
+
}, a);
|
|
1593
|
+
})
|
|
1594
|
+
}),
|
|
1595
|
+
l && e && /* @__PURE__ */ m("button", {
|
|
1596
|
+
type: "button",
|
|
1597
|
+
onClick: () => {
|
|
1598
|
+
l(), v.setOpen(!1);
|
|
1599
|
+
},
|
|
1600
|
+
className: "border-tint/[0.06] text-muted-foreground hover:text-foreground focus-visible:ring-ring/40 mt-2 w-full rounded-lg border-t px-2 pt-2.5 pb-1.5 text-sm outline-hidden focus-visible:ring-2",
|
|
1601
|
+
children: u
|
|
1602
|
+
})
|
|
1603
|
+
]
|
|
1604
|
+
})] });
|
|
1605
|
+
}
|
|
1606
|
+
//#endregion
|
|
1607
|
+
//#region packages/money-input/index.tsx
|
|
1608
|
+
function dt({ start: e, end: t, compact: n = !1, disabled: r = !1, id: i, autoFocus: a, className: o, "aria-label": s, ...c }) {
|
|
1609
|
+
let l = ft(c);
|
|
1610
|
+
return /* @__PURE__ */ h("div", {
|
|
1611
|
+
className: k("zen__money-input flex flex-col gap-1", o),
|
|
1612
|
+
children: [/* @__PURE__ */ h(We, {
|
|
1613
|
+
invalid: !!l.error,
|
|
1614
|
+
className: k(n && "h-7! border!"),
|
|
1615
|
+
children: [
|
|
1616
|
+
e ?? /* @__PURE__ */ m(Y, {
|
|
1617
|
+
"aria-hidden": !0,
|
|
1618
|
+
"data-slot": "symbol",
|
|
1619
|
+
children: l.symbol
|
|
1620
|
+
}),
|
|
1621
|
+
/* @__PURE__ */ m(J, {
|
|
1622
|
+
...l.inputProps,
|
|
1623
|
+
id: i,
|
|
1624
|
+
autoFocus: a,
|
|
1625
|
+
disabled: r,
|
|
1626
|
+
"aria-label": s,
|
|
1627
|
+
className: k("tabular-nums", n ? "text-right" : "text-left")
|
|
1628
|
+
}),
|
|
1629
|
+
t
|
|
1630
|
+
]
|
|
1631
|
+
}), l.error && /* @__PURE__ */ h("p", {
|
|
1632
|
+
id: l.errorId,
|
|
1633
|
+
role: "alert",
|
|
1634
|
+
className: "text-destructive mt-0! flex items-center gap-1.5 text-xs font-medium",
|
|
1635
|
+
children: [/* @__PURE__ */ m(K, { className: "shrink-0" }), l.error]
|
|
1636
|
+
})]
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
1639
|
+
function ft({ value: e, onChange: t, currency: n, locale: r, allowNegative: i = !1, allowEmpty: a = !1, live: c = !1, onCancel: l }) {
|
|
1640
|
+
let u = (e) => e === null ? "" : I(e, n, r), [f, p] = d(() => u(e)), [m, h] = d(null), [g, _] = d(!1), [v, y] = d(!1), b = s();
|
|
1641
|
+
o(() => {
|
|
1642
|
+
!g && !(c && v) && p(u(e));
|
|
1643
|
+
}, [
|
|
1644
|
+
e,
|
|
1645
|
+
n,
|
|
1646
|
+
r
|
|
1647
|
+
]);
|
|
1648
|
+
let x = `Not an amount. Try ${I(3274e3, n, r)} or ${r.endsWith("-IN") ? "1.5L" : "10k"}.`;
|
|
1649
|
+
function S(e) {
|
|
1650
|
+
let t = e.trim();
|
|
1651
|
+
if (t === "") {
|
|
1652
|
+
if (a) return null;
|
|
1653
|
+
h("Enter an amount.");
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
let r;
|
|
1657
|
+
try {
|
|
1658
|
+
r = he(t, n);
|
|
1659
|
+
} catch {
|
|
1660
|
+
h(x);
|
|
1661
|
+
return;
|
|
1662
|
+
}
|
|
1663
|
+
if (!i && r < 0) {
|
|
1664
|
+
h("Amount can't be negative.");
|
|
1665
|
+
return;
|
|
1666
|
+
}
|
|
1667
|
+
return h(null), r;
|
|
1668
|
+
}
|
|
1669
|
+
function C() {
|
|
1670
|
+
let e = S(f);
|
|
1671
|
+
return e !== void 0 && (p(u(e)), t(e), !0);
|
|
1672
|
+
}
|
|
1673
|
+
function w() {
|
|
1674
|
+
let e = S(f);
|
|
1675
|
+
e !== void 0 && p(u(e));
|
|
1676
|
+
}
|
|
1677
|
+
return {
|
|
1678
|
+
inputProps: {
|
|
1679
|
+
type: "text",
|
|
1680
|
+
inputMode: "decimal",
|
|
1681
|
+
autoComplete: "off",
|
|
1682
|
+
spellCheck: !1,
|
|
1683
|
+
value: f,
|
|
1684
|
+
"aria-invalid": m ? !0 : void 0,
|
|
1685
|
+
"aria-describedby": m ? b : void 0,
|
|
1686
|
+
onChange: (e) => {
|
|
1687
|
+
if (p(e.target.value), c) {
|
|
1688
|
+
y(!0);
|
|
1689
|
+
try {
|
|
1690
|
+
let r = e.target.value.trim();
|
|
1691
|
+
t(r === "" ? null : he(r, n));
|
|
1692
|
+
} catch {
|
|
1693
|
+
t(null);
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
},
|
|
1697
|
+
onFocus: () => _(!0),
|
|
1698
|
+
onBlur: () => {
|
|
1699
|
+
_(!1), c ? w() : C();
|
|
1700
|
+
},
|
|
1701
|
+
onKeyDown: (t) => {
|
|
1702
|
+
t.key === "Enter" ? (t.preventDefault(), c ? w() : C()) : t.key === "Escape" && (t.preventDefault(), p(u(e)), h(null), l?.());
|
|
1703
|
+
}
|
|
1704
|
+
},
|
|
1705
|
+
symbol: fe(n, r),
|
|
1706
|
+
error: m,
|
|
1707
|
+
errorId: b,
|
|
1708
|
+
text: f,
|
|
1709
|
+
setText: p,
|
|
1710
|
+
commit: C,
|
|
1711
|
+
formatted: e === null ? "" : F(e, n, r)
|
|
1712
|
+
};
|
|
1713
|
+
}
|
|
1714
|
+
//#endregion
|
|
714
1715
|
//#region packages/utils/slot.tsx
|
|
715
|
-
function
|
|
716
|
-
if (!
|
|
717
|
-
let a =
|
|
718
|
-
return
|
|
1716
|
+
function pt({ children: e, className: n, ...i }) {
|
|
1717
|
+
if (!r(e)) return null;
|
|
1718
|
+
let a = e;
|
|
1719
|
+
return t(a, {
|
|
719
1720
|
...i,
|
|
720
|
-
className:
|
|
1721
|
+
className: k(n, a.props.className)
|
|
721
1722
|
});
|
|
722
1723
|
}
|
|
723
1724
|
//#endregion
|
|
724
1725
|
//#region packages/nav-pills/index.tsx
|
|
725
|
-
var
|
|
726
|
-
function
|
|
727
|
-
let r =
|
|
728
|
-
return
|
|
1726
|
+
var mt = n(null);
|
|
1727
|
+
function ht({ className: e, children: t, ...n }) {
|
|
1728
|
+
let r = u(null), [i, a] = d(null);
|
|
1729
|
+
return c(() => {
|
|
729
1730
|
let e = r.current;
|
|
730
1731
|
if (!e) return;
|
|
731
1732
|
let t = () => {
|
|
@@ -747,60 +1748,60 @@ function U({ className: e, children: t, ...n }) {
|
|
|
747
1748
|
return i?.observe(e), () => {
|
|
748
1749
|
n.disconnect(), i?.disconnect();
|
|
749
1750
|
};
|
|
750
|
-
}, []), /* @__PURE__ */
|
|
751
|
-
className:
|
|
1751
|
+
}, []), /* @__PURE__ */ m("nav", {
|
|
1752
|
+
className: k("zen__nav-pills", e),
|
|
752
1753
|
...n,
|
|
753
|
-
children: /* @__PURE__ */
|
|
1754
|
+
children: /* @__PURE__ */ m("div", {
|
|
754
1755
|
ref: r,
|
|
755
|
-
className:
|
|
756
|
-
children: /* @__PURE__ */
|
|
1756
|
+
className: Me,
|
|
1757
|
+
children: /* @__PURE__ */ m(mt.Provider, {
|
|
757
1758
|
value: i,
|
|
758
1759
|
children: t
|
|
759
1760
|
})
|
|
760
1761
|
})
|
|
761
1762
|
});
|
|
762
1763
|
}
|
|
763
|
-
function
|
|
764
|
-
let t =
|
|
765
|
-
return t ? /* @__PURE__ */
|
|
1764
|
+
function gt({ className: e }) {
|
|
1765
|
+
let t = a(mt);
|
|
1766
|
+
return t ? /* @__PURE__ */ m("span", {
|
|
766
1767
|
"aria-hidden": !0,
|
|
767
|
-
className:
|
|
1768
|
+
className: k(Ne, e),
|
|
768
1769
|
style: {
|
|
769
1770
|
translate: `${t.x}px 0`,
|
|
770
1771
|
width: t.w
|
|
771
1772
|
}
|
|
772
1773
|
}) : null;
|
|
773
1774
|
}
|
|
774
|
-
var
|
|
775
|
-
function
|
|
1775
|
+
var _t = k(Pe, "text-muted-foreground hover:text-foreground aria-[current=page]:text-foreground aria-[current=page]:hover:text-foreground");
|
|
1776
|
+
function vt({ active: e, asChild: t, className: n, children: r, ...i }) {
|
|
776
1777
|
let a = {
|
|
777
1778
|
...i,
|
|
778
1779
|
"aria-current": e ? "page" : void 0,
|
|
779
|
-
className:
|
|
1780
|
+
className: k(_t, n)
|
|
780
1781
|
};
|
|
781
|
-
return t ? (e || delete a["aria-current"], /* @__PURE__ */
|
|
1782
|
+
return t ? (e || delete a["aria-current"], /* @__PURE__ */ m(pt, {
|
|
782
1783
|
...a,
|
|
783
1784
|
children: r
|
|
784
|
-
})) : /* @__PURE__ */
|
|
1785
|
+
})) : /* @__PURE__ */ m("a", {
|
|
785
1786
|
...a,
|
|
786
1787
|
children: r
|
|
787
1788
|
});
|
|
788
1789
|
}
|
|
789
1790
|
//#endregion
|
|
790
1791
|
//#region packages/page-header/index.tsx
|
|
791
|
-
function
|
|
792
|
-
return /* @__PURE__ */
|
|
793
|
-
className:
|
|
1792
|
+
function yt({ eyebrow: e, title: t, lead: n, children: r, className: i }) {
|
|
1793
|
+
return /* @__PURE__ */ h("header", {
|
|
1794
|
+
className: k("zen__page-header flex flex-col gap-3", i),
|
|
794
1795
|
children: [
|
|
795
|
-
e && /* @__PURE__ */
|
|
1796
|
+
e && /* @__PURE__ */ m("p", {
|
|
796
1797
|
className: "text-muted-foreground mt-0! text-xs tracking-[0.1em] uppercase",
|
|
797
1798
|
children: e
|
|
798
1799
|
}),
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
className: "text-aurora",
|
|
1800
|
+
/* @__PURE__ */ m("h1", {
|
|
1801
|
+
className: "text-aurora text-4xl font-semibold tracking-tight lg:text-5xl",
|
|
801
1802
|
children: t
|
|
802
1803
|
}),
|
|
803
|
-
n && /* @__PURE__ */
|
|
1804
|
+
n && /* @__PURE__ */ m("p", {
|
|
804
1805
|
className: "text-muted-foreground mt-0! max-w-2xl text-lg leading-relaxed",
|
|
805
1806
|
children: n
|
|
806
1807
|
}),
|
|
@@ -810,33 +1811,33 @@ function ce({ eyebrow: e, title: t, lead: n, children: r, className: i }) {
|
|
|
810
1811
|
}
|
|
811
1812
|
//#endregion
|
|
812
1813
|
//#region packages/progress-ring/index.tsx
|
|
813
|
-
function
|
|
1814
|
+
function bt({ value: e, size: t = 84, stroke: n = 7, label: r, children: i, className: a }) {
|
|
814
1815
|
let o = (t - n) / 2, s = 2 * Math.PI * o, c = Math.min(Math.max(e, 0), 1);
|
|
815
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ h("div", {
|
|
816
1817
|
role: "progressbar",
|
|
817
1818
|
"aria-label": r,
|
|
818
1819
|
"aria-valuemin": 0,
|
|
819
1820
|
"aria-valuemax": 100,
|
|
820
1821
|
"aria-valuenow": Math.round(c * 100),
|
|
821
|
-
className:
|
|
1822
|
+
className: k("zen__progress-ring relative grid shrink-0 place-items-center", a),
|
|
822
1823
|
style: {
|
|
823
1824
|
width: t,
|
|
824
1825
|
height: t
|
|
825
1826
|
},
|
|
826
|
-
children: [/* @__PURE__ */
|
|
1827
|
+
children: [/* @__PURE__ */ h("svg", {
|
|
827
1828
|
width: t,
|
|
828
1829
|
height: t,
|
|
829
1830
|
viewBox: `0 0 ${t} ${t}`,
|
|
830
1831
|
className: "-rotate-90",
|
|
831
1832
|
"aria-hidden": !0,
|
|
832
|
-
children: [/* @__PURE__ */
|
|
1833
|
+
children: [/* @__PURE__ */ m("circle", {
|
|
833
1834
|
cx: t / 2,
|
|
834
1835
|
cy: t / 2,
|
|
835
1836
|
r: o,
|
|
836
1837
|
fill: "none",
|
|
837
1838
|
strokeWidth: n,
|
|
838
1839
|
className: "stroke-tint/[0.07]"
|
|
839
|
-
}), /* @__PURE__ */
|
|
1840
|
+
}), /* @__PURE__ */ m("circle", {
|
|
840
1841
|
cx: t / 2,
|
|
841
1842
|
cy: t / 2,
|
|
842
1843
|
r: o,
|
|
@@ -847,7 +1848,7 @@ function le({ value: e, size: t = 84, stroke: n = 7, label: r, children: i, clas
|
|
|
847
1848
|
strokeDashoffset: s * (1 - c),
|
|
848
1849
|
className: "stroke-primary [filter:drop-shadow(0_0_6px_oklch(var(--glow)/0.45))] transition-[stroke-dashoffset] duration-700 ease-out"
|
|
849
1850
|
})]
|
|
850
|
-
}), /* @__PURE__ */
|
|
1851
|
+
}), /* @__PURE__ */ m("div", {
|
|
851
1852
|
className: "absolute inset-0 grid place-items-center text-center",
|
|
852
1853
|
children: i
|
|
853
1854
|
})]
|
|
@@ -855,118 +1856,402 @@ function le({ value: e, size: t = 84, stroke: n = 7, label: r, children: i, clas
|
|
|
855
1856
|
}
|
|
856
1857
|
//#endregion
|
|
857
1858
|
//#region packages/segmented/index.tsx
|
|
858
|
-
function
|
|
859
|
-
let s =
|
|
860
|
-
return
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
1859
|
+
function xt({ label: e, value: t, options: n, onChange: r, name: i, className: a }) {
|
|
1860
|
+
let o = s(), l = u(null), [f, p] = d(null);
|
|
1861
|
+
return c(() => {
|
|
1862
|
+
let e = l.current;
|
|
1863
|
+
if (!e) return;
|
|
1864
|
+
let t = () => {
|
|
1865
|
+
let t = e.querySelector("label:has(input:checked)");
|
|
1866
|
+
p(t ? {
|
|
1867
|
+
x: t.offsetLeft,
|
|
1868
|
+
y: t.offsetTop,
|
|
1869
|
+
w: t.offsetWidth,
|
|
1870
|
+
h: t.offsetHeight
|
|
1871
|
+
} : null);
|
|
1872
|
+
};
|
|
1873
|
+
t();
|
|
1874
|
+
let n = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
1875
|
+
return n?.observe(e), () => n?.disconnect();
|
|
1876
|
+
}, [t, n]), /* @__PURE__ */ h("div", {
|
|
1877
|
+
className: k("zen__segmented flex flex-col gap-2", a),
|
|
1878
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1879
|
+
id: o,
|
|
864
1880
|
className: "text-sm font-medium",
|
|
865
1881
|
children: e
|
|
866
|
-
}), /* @__PURE__ */
|
|
1882
|
+
}), /* @__PURE__ */ h("div", {
|
|
1883
|
+
ref: l,
|
|
867
1884
|
role: "radiogroup",
|
|
868
|
-
"aria-labelledby":
|
|
869
|
-
className: "border-tint/10 bg-tint/[0.03] inline-flex w-fit flex-wrap gap-1 rounded-xl border p-1",
|
|
870
|
-
children:
|
|
871
|
-
|
|
872
|
-
|
|
1885
|
+
"aria-labelledby": o,
|
|
1886
|
+
className: "border-tint/10 bg-tint/[0.03] relative inline-flex w-fit flex-wrap gap-1 rounded-xl border p-1",
|
|
1887
|
+
children: [f && /* @__PURE__ */ m("span", {
|
|
1888
|
+
"aria-hidden": !0,
|
|
1889
|
+
className: "bg-primary/15 absolute top-0 left-0 rounded-lg shadow-[inset_0_0_0_1px_oklch(var(--primary)/0.4)] transition-[translate,width,height] duration-500 ease-[cubic-bezier(0.2,0.8,0.2,1)]",
|
|
1890
|
+
style: {
|
|
1891
|
+
translate: `${f.x}px ${f.y}px`,
|
|
1892
|
+
width: f.w,
|
|
1893
|
+
height: f.h
|
|
1894
|
+
}
|
|
1895
|
+
}), n.map((e) => /* @__PURE__ */ h("label", {
|
|
1896
|
+
className: k("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
|
+
children: [/* @__PURE__ */ m("input", {
|
|
873
1898
|
type: "radio",
|
|
874
1899
|
className: "sr-only",
|
|
875
|
-
name: i ??
|
|
1900
|
+
name: i ?? o,
|
|
876
1901
|
value: e.value,
|
|
877
1902
|
checked: t === e.value,
|
|
878
1903
|
onChange: () => r(e.value)
|
|
879
1904
|
}), e.label]
|
|
880
|
-
}, e.value))
|
|
1905
|
+
}, e.value))]
|
|
881
1906
|
})]
|
|
882
1907
|
});
|
|
883
1908
|
}
|
|
884
1909
|
//#endregion
|
|
1910
|
+
//#region packages/select/index.tsx
|
|
1911
|
+
function St({ 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
|
+
let _ = u(null), [v, y] = d(-1), b = u({
|
|
1913
|
+
text: "",
|
|
1914
|
+
at: 0
|
|
1915
|
+
}), x = N({
|
|
1916
|
+
matchWidth: !0,
|
|
1917
|
+
onOpenChange: (n) => {
|
|
1918
|
+
n && y(Math.max(0, t.findIndex((t) => t.value === e)));
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1921
|
+
o(() => {
|
|
1922
|
+
x.open && _.current?.focus();
|
|
1923
|
+
}, [x.open]);
|
|
1924
|
+
let S = t.find((t) => t.value === e), C = (e) => `${x.id}-option-${e}`, w = (e) => {
|
|
1925
|
+
let r = t[e];
|
|
1926
|
+
r && !r.disabled && (n(r.value), x.setOpen(!1));
|
|
1927
|
+
}, T = (e, n) => {
|
|
1928
|
+
for (let r = 1; r <= t.length; r++) {
|
|
1929
|
+
let i = (e + n * r + t.length * 2) % t.length;
|
|
1930
|
+
if (!t[i].disabled) return i;
|
|
1931
|
+
}
|
|
1932
|
+
return e;
|
|
1933
|
+
}, E = (e) => {
|
|
1934
|
+
let n = {
|
|
1935
|
+
ArrowDown: () => y((e) => T(e, 1)),
|
|
1936
|
+
ArrowUp: () => y((e) => T(e, -1)),
|
|
1937
|
+
Home: () => y(T(-1, 1)),
|
|
1938
|
+
End: () => y(T(t.length, -1)),
|
|
1939
|
+
Enter: () => w(v),
|
|
1940
|
+
" ": () => w(v),
|
|
1941
|
+
Tab: () => x.setOpen(!1)
|
|
1942
|
+
};
|
|
1943
|
+
if (n[e.key]) {
|
|
1944
|
+
e.key !== "Tab" && e.preventDefault(), n[e.key]();
|
|
1945
|
+
return;
|
|
1946
|
+
}
|
|
1947
|
+
if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
1948
|
+
let n = Date.now(), r = (n - b.current.at < 700 ? b.current.text : "") + e.key.toLowerCase();
|
|
1949
|
+
b.current = {
|
|
1950
|
+
text: r,
|
|
1951
|
+
at: n
|
|
1952
|
+
};
|
|
1953
|
+
let i = t.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(r));
|
|
1954
|
+
i >= 0 && y(i);
|
|
1955
|
+
}
|
|
1956
|
+
};
|
|
1957
|
+
return /* @__PURE__ */ h(p, { children: [
|
|
1958
|
+
/* @__PURE__ */ h("button", {
|
|
1959
|
+
type: "button",
|
|
1960
|
+
id: c,
|
|
1961
|
+
disabled: i,
|
|
1962
|
+
"aria-haspopup": "listbox",
|
|
1963
|
+
"aria-label": g,
|
|
1964
|
+
...x.triggerProps,
|
|
1965
|
+
onKeyDown: (e) => {
|
|
1966
|
+
["ArrowDown", "ArrowUp"].includes(e.key) && !x.open && (e.preventDefault(), x.setOpen(!0));
|
|
1967
|
+
},
|
|
1968
|
+
className: k("zen__select group", H, "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
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1970
|
+
className: k("truncate", !S && "text-muted-foreground"),
|
|
1971
|
+
children: S ? S.label : r
|
|
1972
|
+
}), /* @__PURE__ */ m(X, { open: x.open })]
|
|
1973
|
+
}),
|
|
1974
|
+
s && /* @__PURE__ */ m("input", {
|
|
1975
|
+
type: "hidden",
|
|
1976
|
+
name: s,
|
|
1977
|
+
value: e ?? ""
|
|
1978
|
+
}),
|
|
1979
|
+
/* @__PURE__ */ m("div", {
|
|
1980
|
+
...x.popupProps,
|
|
1981
|
+
className: k("zen__popover", U, "overflow-visible py-1", f),
|
|
1982
|
+
children: /* @__PURE__ */ m("div", {
|
|
1983
|
+
ref: _,
|
|
1984
|
+
role: "listbox",
|
|
1985
|
+
tabIndex: -1,
|
|
1986
|
+
"aria-label": g,
|
|
1987
|
+
"aria-activedescendant": v >= 0 ? C(v) : void 0,
|
|
1988
|
+
onKeyDown: E,
|
|
1989
|
+
className: "max-h-72 overflow-y-auto outline-hidden",
|
|
1990
|
+
children: t.map((t, n) => /* @__PURE__ */ h("div", {
|
|
1991
|
+
id: C(n),
|
|
1992
|
+
role: "option",
|
|
1993
|
+
"aria-selected": t.value === e,
|
|
1994
|
+
"aria-disabled": t.disabled || void 0,
|
|
1995
|
+
"data-highlighted": n === v || void 0,
|
|
1996
|
+
onMouseMove: () => !t.disabled && y(n),
|
|
1997
|
+
onClick: () => w(n),
|
|
1998
|
+
className: k("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
|
+
children: [/* @__PURE__ */ m("span", {
|
|
2000
|
+
className: "text-primary col-start-1",
|
|
2001
|
+
"aria-hidden": !0,
|
|
2002
|
+
children: t.value === e && /* @__PURE__ */ m(G, {})
|
|
2003
|
+
}), /* @__PURE__ */ m("span", {
|
|
2004
|
+
className: "col-start-2 truncate",
|
|
2005
|
+
children: a ? a(t) : t.label
|
|
2006
|
+
})]
|
|
2007
|
+
}, t.value))
|
|
2008
|
+
})
|
|
2009
|
+
})
|
|
2010
|
+
] });
|
|
2011
|
+
}
|
|
2012
|
+
//#endregion
|
|
885
2013
|
//#region packages/side-nav/index.tsx
|
|
886
|
-
function
|
|
887
|
-
return /* @__PURE__ */
|
|
888
|
-
className:
|
|
2014
|
+
function Ct({ className: e, ...t }) {
|
|
2015
|
+
return /* @__PURE__ */ m("nav", {
|
|
2016
|
+
className: k("zen__side-nav flex flex-col gap-6", e),
|
|
889
2017
|
...t
|
|
890
2018
|
});
|
|
891
2019
|
}
|
|
892
|
-
function
|
|
893
|
-
return /* @__PURE__ */
|
|
894
|
-
className:
|
|
895
|
-
children: [e && /* @__PURE__ */
|
|
2020
|
+
function wt({ title: e, children: t, className: n }) {
|
|
2021
|
+
return /* @__PURE__ */ h("div", {
|
|
2022
|
+
className: k("flex flex-col gap-1", n),
|
|
2023
|
+
children: [e && /* @__PURE__ */ m("span", {
|
|
896
2024
|
className: "text-muted-foreground px-3 pb-1 text-[0.68rem] tracking-[0.1em] uppercase",
|
|
897
2025
|
children: e
|
|
898
2026
|
}), t]
|
|
899
2027
|
});
|
|
900
2028
|
}
|
|
901
|
-
var
|
|
902
|
-
function
|
|
2029
|
+
var Tt = k("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)]");
|
|
2030
|
+
function Et({ active: e, asChild: t, className: n, children: r, ...i }) {
|
|
903
2031
|
let a = {
|
|
904
2032
|
...i,
|
|
905
2033
|
"aria-current": e ? "page" : void 0,
|
|
906
|
-
className:
|
|
2034
|
+
className: k(Tt, n)
|
|
907
2035
|
};
|
|
908
|
-
return t ? (e || delete a["aria-current"], /* @__PURE__ */
|
|
2036
|
+
return t ? (e || delete a["aria-current"], /* @__PURE__ */ m(pt, {
|
|
909
2037
|
...a,
|
|
910
2038
|
children: r
|
|
911
|
-
})) : /* @__PURE__ */
|
|
2039
|
+
})) : /* @__PURE__ */ m("a", {
|
|
912
2040
|
...a,
|
|
913
2041
|
children: r
|
|
914
2042
|
});
|
|
915
2043
|
}
|
|
916
2044
|
//#endregion
|
|
917
2045
|
//#region packages/skeleton/index.tsx
|
|
918
|
-
function
|
|
919
|
-
return /* @__PURE__ */
|
|
2046
|
+
function Dt({ className: e }) {
|
|
2047
|
+
return /* @__PURE__ */ m("span", {
|
|
920
2048
|
"aria-hidden": !0,
|
|
921
|
-
className:
|
|
2049
|
+
className: k("zen__skeleton block rounded-md", e)
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
//#endregion
|
|
2053
|
+
//#region packages/slider/index.tsx
|
|
2054
|
+
function Ot({ 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
|
+
let h = u(null), g = u(a);
|
|
2056
|
+
g.current = a, o(() => {
|
|
2057
|
+
let e = h.current;
|
|
2058
|
+
if (!e) return;
|
|
2059
|
+
let t = () => g.current?.(Number(e.value));
|
|
2060
|
+
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
2061
|
+
}, []);
|
|
2062
|
+
let _ = n > t ? (e - t) / (n - t) * 100 : 0, v = s ?? `linear-gradient(to right, oklch(var(--primary)) ${_}%, oklch(var(--muted)) ${_}%)`;
|
|
2063
|
+
return /* @__PURE__ */ m("input", {
|
|
2064
|
+
ref: h,
|
|
2065
|
+
type: "range",
|
|
2066
|
+
min: t,
|
|
2067
|
+
max: n,
|
|
2068
|
+
step: r,
|
|
2069
|
+
value: e,
|
|
2070
|
+
"aria-valuetext": l?.(e),
|
|
2071
|
+
onChange: (e) => i?.(Number(e.target.value)),
|
|
2072
|
+
style: {
|
|
2073
|
+
...f,
|
|
2074
|
+
"--zen-track": v,
|
|
2075
|
+
"--zen-thumb": c ?? "oklch(var(--primary))"
|
|
2076
|
+
},
|
|
2077
|
+
className: k("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
|
+
...p
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2081
|
+
//#endregion
|
|
2082
|
+
//#region packages/tab-bar/index.tsx
|
|
2083
|
+
function kt({ hideFrom: t = "md", className: n, children: r, ...i }) {
|
|
2084
|
+
return /* @__PURE__ */ m("nav", {
|
|
2085
|
+
className: k("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
|
+
...i,
|
|
2087
|
+
children: /* @__PURE__ */ m("div", {
|
|
2088
|
+
className: "grid",
|
|
2089
|
+
style: { gridTemplateColumns: `repeat(${e.count(r)}, 1fr)` },
|
|
2090
|
+
children: r
|
|
2091
|
+
})
|
|
2092
|
+
});
|
|
2093
|
+
}
|
|
2094
|
+
var At = k("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)]");
|
|
2095
|
+
function jt({ icon: e, active: t, asChild: n, className: r, children: i, ...a }) {
|
|
2096
|
+
let o = {
|
|
2097
|
+
...a,
|
|
2098
|
+
"aria-current": t ? "page" : void 0,
|
|
2099
|
+
className: k(At, r)
|
|
2100
|
+
};
|
|
2101
|
+
return n ? (t || delete o["aria-current"], /* @__PURE__ */ m(pt, {
|
|
2102
|
+
...o,
|
|
2103
|
+
children: i
|
|
2104
|
+
})) : /* @__PURE__ */ h("a", {
|
|
2105
|
+
...o,
|
|
2106
|
+
children: [e, i]
|
|
922
2107
|
});
|
|
923
2108
|
}
|
|
924
2109
|
//#endregion
|
|
925
2110
|
//#region packages/table/index.tsx
|
|
926
|
-
function
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
2111
|
+
function Mt({ label: e, className: t, ref: n, onScroll: r, ...a }) {
|
|
2112
|
+
let s = u(null), c = i(() => {
|
|
2113
|
+
let e = s.current;
|
|
2114
|
+
if (!e) return;
|
|
2115
|
+
let t = (t, n) => n !== e.hasAttribute(t) && e.toggleAttribute(t, n);
|
|
2116
|
+
t("data-under-top", e.scrollTop > 0), t("data-under-left", e.scrollLeft > 0), t("data-under-bottom", e.scrollTop + e.clientHeight < e.scrollHeight - 1);
|
|
2117
|
+
}, []);
|
|
2118
|
+
return o(() => {
|
|
2119
|
+
let e = s.current;
|
|
2120
|
+
if (!e) return;
|
|
2121
|
+
c();
|
|
2122
|
+
let t = typeof ResizeObserver > "u" ? null : new ResizeObserver(c);
|
|
2123
|
+
return t?.observe(e), e.firstElementChild && t?.observe(e.firstElementChild), () => t?.disconnect();
|
|
2124
|
+
}, [c]), /* @__PURE__ */ m("div", {
|
|
2125
|
+
className: k("zen__table-panel glass glow-edge isolate flex flex-col overflow-hidden rounded-xl", t),
|
|
2126
|
+
children: /* @__PURE__ */ m("div", {
|
|
2127
|
+
ref: (e) => {
|
|
2128
|
+
s.current = e, typeof n == "function" ? n(e) : n && (n.current = e);
|
|
2129
|
+
},
|
|
2130
|
+
onScroll: (e) => {
|
|
2131
|
+
c(), r?.(e);
|
|
2132
|
+
},
|
|
2133
|
+
role: e ? "region" : void 0,
|
|
2134
|
+
"aria-label": e,
|
|
2135
|
+
tabIndex: e ? 0 : void 0,
|
|
2136
|
+
className: "zen__table-container focus-visible:ring-ring/30 min-h-0 overflow-auto rounded-[inherit] outline-hidden will-change-scroll focus-visible:ring-2 focus-visible:ring-inset",
|
|
2137
|
+
...a
|
|
932
2138
|
})
|
|
933
2139
|
});
|
|
934
2140
|
}
|
|
935
|
-
function
|
|
936
|
-
return /* @__PURE__ */
|
|
937
|
-
className:
|
|
2141
|
+
function Nt({ className: e, ...t }) {
|
|
2142
|
+
return /* @__PURE__ */ m("table", {
|
|
2143
|
+
className: k("zen__table w-full border-separate border-spacing-0 text-sm", e),
|
|
938
2144
|
...t
|
|
939
2145
|
});
|
|
940
2146
|
}
|
|
941
|
-
function
|
|
942
|
-
return /* @__PURE__ */
|
|
943
|
-
className:
|
|
2147
|
+
function Pt({ className: e, ...t }) {
|
|
2148
|
+
return /* @__PURE__ */ m("thead", {
|
|
2149
|
+
className: k("zen__sticky-top sticky top-0 z-20", e),
|
|
944
2150
|
...t
|
|
945
2151
|
});
|
|
946
2152
|
}
|
|
947
|
-
function
|
|
948
|
-
return /* @__PURE__ */
|
|
949
|
-
|
|
2153
|
+
function Ft(e) {
|
|
2154
|
+
return /* @__PURE__ */ m("tbody", { ...e });
|
|
2155
|
+
}
|
|
2156
|
+
function It({ className: e, ...t }) {
|
|
2157
|
+
return /* @__PURE__ */ m("tfoot", {
|
|
2158
|
+
className: k("zen__sticky-bottom sticky bottom-0 z-20", e),
|
|
950
2159
|
...t
|
|
951
2160
|
});
|
|
952
2161
|
}
|
|
953
|
-
function
|
|
954
|
-
return /* @__PURE__ */
|
|
955
|
-
className:
|
|
2162
|
+
function Lt({ className: e, ...t }) {
|
|
2163
|
+
return /* @__PURE__ */ m("tr", {
|
|
2164
|
+
className: k("group", e),
|
|
956
2165
|
...t
|
|
957
2166
|
});
|
|
958
2167
|
}
|
|
959
|
-
function
|
|
960
|
-
return /* @__PURE__ */
|
|
961
|
-
|
|
962
|
-
|
|
2168
|
+
function Rt({ numeric: e, sticky: t, sortDirection: n, onSort: r, scope: i = "col", className: a, children: o, ...s }) {
|
|
2169
|
+
return /* @__PURE__ */ m("th", {
|
|
2170
|
+
scope: i,
|
|
2171
|
+
"aria-sort": n === "asc" ? "ascending" : n === "desc" ? "descending" : void 0,
|
|
2172
|
+
className: k("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
|
+
...s,
|
|
2174
|
+
children: r ? /* @__PURE__ */ h("button", {
|
|
2175
|
+
type: "button",
|
|
2176
|
+
onClick: r,
|
|
2177
|
+
className: k("hover:text-foreground inline-flex items-center gap-1 align-middle leading-5 tracking-wider uppercase", e && "flex-row-reverse"),
|
|
2178
|
+
children: [o, /* @__PURE__ */ m("span", {
|
|
2179
|
+
"aria-hidden": !0,
|
|
2180
|
+
className: "inline-flex w-3",
|
|
2181
|
+
children: n === "asc" ? /* @__PURE__ */ m(Qe, {
|
|
2182
|
+
className: "size-3",
|
|
2183
|
+
strokeWidth: 2.5
|
|
2184
|
+
}) : n === "desc" ? /* @__PURE__ */ m(Ye, {
|
|
2185
|
+
className: "size-3",
|
|
2186
|
+
strokeWidth: 2.5
|
|
2187
|
+
}) : null
|
|
2188
|
+
})]
|
|
2189
|
+
}) : o
|
|
963
2190
|
});
|
|
964
2191
|
}
|
|
2192
|
+
function zt({ numeric: e, sticky: t, className: n, ...r }) {
|
|
2193
|
+
return /* @__PURE__ */ m("td", {
|
|
2194
|
+
className: k("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
|
+
...r
|
|
2196
|
+
});
|
|
2197
|
+
}
|
|
2198
|
+
function Bt({ numeric: e, sticky: t, className: n, ...r }) {
|
|
2199
|
+
return /* @__PURE__ */ m("td", {
|
|
2200
|
+
className: k("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
|
+
...r
|
|
2202
|
+
});
|
|
2203
|
+
}
|
|
2204
|
+
function Vt({ height: e, colSpan: t }) {
|
|
2205
|
+
return e <= 0 ? null : /* @__PURE__ */ m("tr", {
|
|
2206
|
+
"aria-hidden": !0,
|
|
2207
|
+
children: /* @__PURE__ */ m("td", {
|
|
2208
|
+
colSpan: t,
|
|
2209
|
+
style: {
|
|
2210
|
+
height: e,
|
|
2211
|
+
padding: 0,
|
|
2212
|
+
border: 0
|
|
2213
|
+
}
|
|
2214
|
+
})
|
|
2215
|
+
});
|
|
2216
|
+
}
|
|
2217
|
+
function Ht({ colSpan: e, children: t = "Nothing here yet." }) {
|
|
2218
|
+
return /* @__PURE__ */ m("tr", { children: /* @__PURE__ */ m("td", {
|
|
2219
|
+
colSpan: e,
|
|
2220
|
+
className: "text-muted-foreground px-3 py-8 text-center",
|
|
2221
|
+
children: t
|
|
2222
|
+
}) });
|
|
2223
|
+
}
|
|
2224
|
+
function Ut(e, t, n) {
|
|
2225
|
+
let [r, i] = d(n ?? null);
|
|
2226
|
+
return {
|
|
2227
|
+
rows: l(() => {
|
|
2228
|
+
if (!r) return e;
|
|
2229
|
+
let n = t[r.key], i = [...e].sort(n);
|
|
2230
|
+
return r.direction === "desc" ? i.reverse() : i;
|
|
2231
|
+
}, [
|
|
2232
|
+
e,
|
|
2233
|
+
r,
|
|
2234
|
+
t
|
|
2235
|
+
]),
|
|
2236
|
+
sort: r,
|
|
2237
|
+
setSort: i,
|
|
2238
|
+
headProps: (e) => ({
|
|
2239
|
+
sortDirection: r?.key === e ? r.direction : void 0,
|
|
2240
|
+
onSort: () => i((t) => t?.key === e ? t.direction === "asc" ? {
|
|
2241
|
+
key: e,
|
|
2242
|
+
direction: "desc"
|
|
2243
|
+
} : null : {
|
|
2244
|
+
key: e,
|
|
2245
|
+
direction: "asc"
|
|
2246
|
+
})
|
|
2247
|
+
})
|
|
2248
|
+
};
|
|
2249
|
+
}
|
|
965
2250
|
//#endregion
|
|
966
2251
|
//#region packages/table-of-contents/index.tsx
|
|
967
|
-
function
|
|
968
|
-
let [r, i] =
|
|
969
|
-
return
|
|
2252
|
+
function Wt({ items: e, title: t = "On this page", className: n }) {
|
|
2253
|
+
let [r, i] = d();
|
|
2254
|
+
return o(() => {
|
|
970
2255
|
if (typeof IntersectionObserver > "u") return;
|
|
971
2256
|
let t = e.map((e) => document.getElementById(e.id)).filter((e) => !!e), n = /* @__PURE__ */ new Set(), r = new IntersectionObserver((t) => {
|
|
972
2257
|
for (let e of t) e.isIntersecting ? n.add(e.target.id) : n.delete(e.target.id);
|
|
@@ -974,20 +2259,20 @@ function Se({ items: e, title: t = "On this page", className: n }) {
|
|
|
974
2259
|
r && i(r.id);
|
|
975
2260
|
}, { rootMargin: "0px 0px -65% 0px" });
|
|
976
2261
|
return t.forEach((e) => r.observe(e)), () => r.disconnect();
|
|
977
|
-
}, [e]), e.length ? /* @__PURE__ */
|
|
2262
|
+
}, [e]), e.length ? /* @__PURE__ */ h("nav", {
|
|
978
2263
|
"aria-label": t,
|
|
979
|
-
className:
|
|
980
|
-
children: [/* @__PURE__ */
|
|
2264
|
+
className: k("zen__toc flex flex-col gap-3", n),
|
|
2265
|
+
children: [/* @__PURE__ */ m("p", {
|
|
981
2266
|
className: "text-muted-foreground mt-0! text-[0.68rem] tracking-[0.1em] uppercase",
|
|
982
2267
|
children: t
|
|
983
|
-
}), /* @__PURE__ */
|
|
2268
|
+
}), /* @__PURE__ */ m("ul", {
|
|
984
2269
|
className: "border-tint/[0.07] flex flex-col gap-2 border-l text-sm",
|
|
985
|
-
children: e.map((e) => /* @__PURE__ */
|
|
986
|
-
className:
|
|
987
|
-
children: /* @__PURE__ */
|
|
2270
|
+
children: e.map((e) => /* @__PURE__ */ m("li", {
|
|
2271
|
+
className: k("-ml-px", e.depth === 2 && "pl-3"),
|
|
2272
|
+
children: /* @__PURE__ */ m("a", {
|
|
988
2273
|
href: `#${e.id}`,
|
|
989
2274
|
"aria-current": e.id === r ? "location" : void 0,
|
|
990
|
-
className:
|
|
2275
|
+
className: k("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"),
|
|
991
2276
|
children: e.label
|
|
992
2277
|
})
|
|
993
2278
|
}, e.id))
|
|
@@ -996,40 +2281,40 @@ function Se({ items: e, title: t = "On this page", className: n }) {
|
|
|
996
2281
|
}
|
|
997
2282
|
//#endregion
|
|
998
2283
|
//#region packages/tabs/index.tsx
|
|
999
|
-
var
|
|
1000
|
-
function
|
|
1001
|
-
let t =
|
|
2284
|
+
var Gt = n(null);
|
|
2285
|
+
function Kt(e) {
|
|
2286
|
+
let t = a(Gt);
|
|
1002
2287
|
if (!t) throw Error(`<${e}> must be inside <Tabs>`);
|
|
1003
2288
|
return t;
|
|
1004
2289
|
}
|
|
1005
|
-
function
|
|
1006
|
-
let [a,
|
|
1007
|
-
return /* @__PURE__ */
|
|
2290
|
+
function qt({ value: e, defaultValue: t = "", onValueChange: n, className: r, ...i }) {
|
|
2291
|
+
let [a, o] = d(t), c = e ?? a, l = s();
|
|
2292
|
+
return /* @__PURE__ */ m(Gt.Provider, {
|
|
1008
2293
|
value: {
|
|
1009
2294
|
value: c,
|
|
1010
2295
|
select: (t) => {
|
|
1011
|
-
e === void 0 &&
|
|
2296
|
+
e === void 0 && o(t), n?.(t);
|
|
1012
2297
|
},
|
|
1013
2298
|
idFor: (e, t) => `${l}-${e}-${t.replace(/\s+/g, "-")}`
|
|
1014
2299
|
},
|
|
1015
|
-
children: /* @__PURE__ */
|
|
1016
|
-
className:
|
|
2300
|
+
children: /* @__PURE__ */ m("div", {
|
|
2301
|
+
className: k("zen__tabs flex flex-col gap-4", r),
|
|
1017
2302
|
...i
|
|
1018
2303
|
})
|
|
1019
2304
|
});
|
|
1020
2305
|
}
|
|
1021
|
-
var
|
|
1022
|
-
function
|
|
1023
|
-
let { value: i } =
|
|
2306
|
+
var Jt = n("underline");
|
|
2307
|
+
function Yt({ variant: e = "underline", className: t, children: n, ...r }) {
|
|
2308
|
+
let { value: i } = Kt("TabList"), a = e === "pills", o = u(null), [s, l] = d({
|
|
1024
2309
|
left: 0,
|
|
1025
2310
|
width: 0
|
|
1026
2311
|
});
|
|
1027
|
-
return
|
|
2312
|
+
return c(() => {
|
|
1028
2313
|
let e = o.current;
|
|
1029
2314
|
if (!e) return;
|
|
1030
2315
|
let t = () => {
|
|
1031
2316
|
let t = e.querySelector("[role=\"tab\"][aria-selected=\"true\"]");
|
|
1032
|
-
|
|
2317
|
+
l(t ? {
|
|
1033
2318
|
left: t.offsetLeft,
|
|
1034
2319
|
width: t.offsetWidth
|
|
1035
2320
|
} : {
|
|
@@ -1040,7 +2325,7 @@ function we({ variant: e = "underline", className: t, children: n, ...r }) {
|
|
|
1040
2325
|
if (t(), typeof ResizeObserver > "u") return;
|
|
1041
2326
|
let n = new ResizeObserver(t);
|
|
1042
2327
|
return n.observe(e), () => n.disconnect();
|
|
1043
|
-
}, [i]), /* @__PURE__ */
|
|
2328
|
+
}, [i]), /* @__PURE__ */ h("div", {
|
|
1044
2329
|
ref: o,
|
|
1045
2330
|
role: "tablist",
|
|
1046
2331
|
onKeyDown: (e) => {
|
|
@@ -1057,31 +2342,31 @@ function we({ variant: e = "underline", className: t, children: n, ...r }) {
|
|
|
1057
2342
|
let i = t[(r + t.length) % t.length];
|
|
1058
2343
|
i.focus(), i.click();
|
|
1059
2344
|
},
|
|
1060
|
-
className:
|
|
2345
|
+
className: k(a ? Me : "border-border relative flex gap-1 border-b", t),
|
|
1061
2346
|
...r,
|
|
1062
|
-
children: [/* @__PURE__ */
|
|
2347
|
+
children: [/* @__PURE__ */ m(Jt.Provider, {
|
|
1063
2348
|
value: e,
|
|
1064
2349
|
children: n
|
|
1065
|
-
}), a ?
|
|
2350
|
+
}), a ? s.width > 0 && /* @__PURE__ */ m("span", {
|
|
1066
2351
|
"aria-hidden": !0,
|
|
1067
2352
|
className: "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)]",
|
|
1068
2353
|
style: {
|
|
1069
|
-
width:
|
|
1070
|
-
translate: `${
|
|
2354
|
+
width: s.width,
|
|
2355
|
+
translate: `${s.left}px 0`
|
|
1071
2356
|
}
|
|
1072
|
-
}) : /* @__PURE__ */
|
|
2357
|
+
}) : /* @__PURE__ */ m("span", {
|
|
1073
2358
|
"aria-hidden": !0,
|
|
1074
2359
|
className: "bg-primary absolute bottom-[-1px] left-0 h-0.5 transition-[translate,width] duration-150 ease-in-out",
|
|
1075
2360
|
style: {
|
|
1076
|
-
width:
|
|
1077
|
-
translate: `${
|
|
2361
|
+
width: s.width,
|
|
2362
|
+
translate: `${s.left}px 0`
|
|
1078
2363
|
}
|
|
1079
2364
|
})]
|
|
1080
2365
|
});
|
|
1081
2366
|
}
|
|
1082
|
-
function
|
|
1083
|
-
let { value:
|
|
1084
|
-
return /* @__PURE__ */
|
|
2367
|
+
function Xt({ value: e, className: t, onClick: n, ...r }) {
|
|
2368
|
+
let { value: i, select: o, idFor: s } = Kt("Tab"), c = a(Jt), l = i === e;
|
|
2369
|
+
return /* @__PURE__ */ m("button", {
|
|
1085
2370
|
type: "button",
|
|
1086
2371
|
role: "tab",
|
|
1087
2372
|
id: s("tab", e),
|
|
@@ -1092,95 +2377,223 @@ function Te({ value: e, className: t, onClick: n, ...r }) {
|
|
|
1092
2377
|
onClick: (t) => {
|
|
1093
2378
|
o(e), n?.(t);
|
|
1094
2379
|
},
|
|
1095
|
-
className:
|
|
2380
|
+
className: k(c === "pills" ? Pe : "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),
|
|
1096
2381
|
...r
|
|
1097
2382
|
});
|
|
1098
2383
|
}
|
|
1099
|
-
function
|
|
1100
|
-
let { value: r, idFor: i } =
|
|
1101
|
-
return r === e ? /* @__PURE__ */
|
|
2384
|
+
function Zt({ value: e, className: t, ...n }) {
|
|
2385
|
+
let { value: r, idFor: i } = Kt("TabPanel");
|
|
2386
|
+
return r === e ? /* @__PURE__ */ m("div", {
|
|
1102
2387
|
role: "tabpanel",
|
|
1103
2388
|
id: i("panel", e),
|
|
1104
2389
|
"aria-labelledby": i("tab", e),
|
|
1105
2390
|
tabIndex: 0,
|
|
1106
|
-
className:
|
|
2391
|
+
className: k("outline-hidden", t),
|
|
1107
2392
|
...n
|
|
1108
2393
|
}) : null;
|
|
1109
2394
|
}
|
|
1110
2395
|
//#endregion
|
|
2396
|
+
//#region packages/tree/index.tsx
|
|
2397
|
+
function Qt({ items: e, getKey: t, getChildren: n, defaultExpanded: r = !0, rowHeight: a = 36 }) {
|
|
2398
|
+
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
|
+
let r = [], i = (e, a, o) => {
|
|
2400
|
+
for (let s of e) {
|
|
2401
|
+
let e = t(s), c = n(s), l = !!c?.length, u = l && g(e);
|
|
2402
|
+
r.push({
|
|
2403
|
+
item: s,
|
|
2404
|
+
key: e,
|
|
2405
|
+
depth: a,
|
|
2406
|
+
parentKey: o,
|
|
2407
|
+
hasChildren: l,
|
|
2408
|
+
expanded: u
|
|
2409
|
+
}), u && i(c, a + 1, e);
|
|
2410
|
+
}
|
|
2411
|
+
};
|
|
2412
|
+
return i(e, 0, null), r;
|
|
2413
|
+
}, [
|
|
2414
|
+
e,
|
|
2415
|
+
t,
|
|
2416
|
+
n,
|
|
2417
|
+
g
|
|
2418
|
+
]), v = () => {
|
|
2419
|
+
let r = [], i = (e) => {
|
|
2420
|
+
for (let a of e) {
|
|
2421
|
+
let e = n(a);
|
|
2422
|
+
e?.length && (r.push(t(a)), i(e));
|
|
2423
|
+
}
|
|
2424
|
+
};
|
|
2425
|
+
return i(e), r;
|
|
2426
|
+
}, y = i((e, t) => s((n) => {
|
|
2427
|
+
let i = new Set(n);
|
|
2428
|
+
return t === r ? i.delete(e) : i.add(e), i;
|
|
2429
|
+
}), [r]), b = () => typeof window < "u" && (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || document.documentElement.classList.contains("reduce-motion")), x = (e) => {
|
|
2430
|
+
if (!g(e)) {
|
|
2431
|
+
let t = Date.now();
|
|
2432
|
+
f({
|
|
2433
|
+
key: e,
|
|
2434
|
+
at: t
|
|
2435
|
+
}), y(e, !0), setTimeout(() => f((e) => e?.at === t ? null : e), 320);
|
|
2436
|
+
} else if (b()) y(e, !1);
|
|
2437
|
+
else {
|
|
2438
|
+
m(e);
|
|
2439
|
+
let t = () => {
|
|
2440
|
+
y(e, !1), m((t) => t === e ? null : t), h.current = null;
|
|
2441
|
+
};
|
|
2442
|
+
h.current = t, setTimeout(t, 500);
|
|
2443
|
+
}
|
|
2444
|
+
};
|
|
2445
|
+
return {
|
|
2446
|
+
rows: _,
|
|
2447
|
+
toggle: x,
|
|
2448
|
+
isExpanded: g,
|
|
2449
|
+
expand: (e) => y(e, !0),
|
|
2450
|
+
collapse: (e) => y(e, !1),
|
|
2451
|
+
expandAll: () => s(r ? /* @__PURE__ */ new Set() : new Set(v())),
|
|
2452
|
+
collapseAll: () => s(r ? new Set(v()) : /* @__PURE__ */ new Set()),
|
|
2453
|
+
rowProps: (e) => ({
|
|
2454
|
+
"aria-level": e.depth + 1,
|
|
2455
|
+
"aria-expanded": e.hasChildren ? e.expanded : void 0,
|
|
2456
|
+
"data-depth": e.depth,
|
|
2457
|
+
className: k(c && e.parentKey === c.key && "zen__tree-row-enter", p && e.parentKey === p && "zen__tree-row-exit"),
|
|
2458
|
+
style: { "--row-h": `${a - 1}px` },
|
|
2459
|
+
onAnimationEnd: (t) => {
|
|
2460
|
+
t.animationName === "zen-row-close" && p && e.parentKey === p && h.current?.();
|
|
2461
|
+
}
|
|
2462
|
+
}),
|
|
2463
|
+
toggleProps: (e) => ({
|
|
2464
|
+
expanded: e.expanded && p !== e.key,
|
|
2465
|
+
onToggle: () => x(e.key)
|
|
2466
|
+
}),
|
|
2467
|
+
rowHeight: a
|
|
2468
|
+
};
|
|
2469
|
+
}
|
|
2470
|
+
function $t({ row: e, tree: t, className: n, style: r, ...i }) {
|
|
2471
|
+
let a = t.rowProps(e);
|
|
2472
|
+
return /* @__PURE__ */ m(Lt, {
|
|
2473
|
+
...i,
|
|
2474
|
+
...a,
|
|
2475
|
+
className: k(a.className, n),
|
|
2476
|
+
style: {
|
|
2477
|
+
...a.style,
|
|
2478
|
+
...r
|
|
2479
|
+
}
|
|
2480
|
+
});
|
|
2481
|
+
}
|
|
2482
|
+
function en({ numeric: e, className: t, children: n, ...r }) {
|
|
2483
|
+
return /* @__PURE__ */ m(zt, {
|
|
2484
|
+
numeric: e,
|
|
2485
|
+
className: k("py-0 whitespace-nowrap", t),
|
|
2486
|
+
...r,
|
|
2487
|
+
children: /* @__PURE__ */ m("div", {
|
|
2488
|
+
className: k("zen__tree-cell flex h-[var(--row-h)] items-center", e && "justify-end"),
|
|
2489
|
+
children: n
|
|
2490
|
+
})
|
|
2491
|
+
});
|
|
2492
|
+
}
|
|
2493
|
+
function tn({ row: e, tree: t, indent: n = 20, children: r, className: i }) {
|
|
2494
|
+
return /* @__PURE__ */ h("div", {
|
|
2495
|
+
className: k("flex min-w-0 flex-1 items-center gap-1", i),
|
|
2496
|
+
style: { paddingLeft: e.depth * n },
|
|
2497
|
+
children: [e.hasChildren ? /* @__PURE__ */ m(nn, { ...t.toggleProps(e) }) : /* @__PURE__ */ m("span", { className: "-ml-1 w-6 shrink-0" }), r]
|
|
2498
|
+
});
|
|
2499
|
+
}
|
|
2500
|
+
function nn({ expanded: e, onToggle: t, className: n, ...r }) {
|
|
2501
|
+
return /* @__PURE__ */ m("button", {
|
|
2502
|
+
type: "button",
|
|
2503
|
+
onClick: t,
|
|
2504
|
+
"aria-label": e ? "Collapse" : "Expand",
|
|
2505
|
+
"aria-expanded": e,
|
|
2506
|
+
className: k("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
|
+
...r,
|
|
2508
|
+
children: /* @__PURE__ */ m("svg", {
|
|
2509
|
+
viewBox: "0 0 16 16",
|
|
2510
|
+
fill: "none",
|
|
2511
|
+
stroke: "currentColor",
|
|
2512
|
+
strokeWidth: "2",
|
|
2513
|
+
strokeLinecap: "round",
|
|
2514
|
+
strokeLinejoin: "round",
|
|
2515
|
+
"aria-hidden": !0,
|
|
2516
|
+
className: k("size-4 transition-transform duration-200 ease-out", e && "rotate-90"),
|
|
2517
|
+
children: /* @__PURE__ */ m("path", { d: "m6 3.5 4.5 4.5L6 12.5" })
|
|
2518
|
+
})
|
|
2519
|
+
});
|
|
2520
|
+
}
|
|
2521
|
+
//#endregion
|
|
1111
2522
|
//#region packages/textarea/index.tsx
|
|
1112
|
-
function
|
|
2523
|
+
function rn(e) {
|
|
1113
2524
|
let { className: t, ...n } = e;
|
|
1114
|
-
return /* @__PURE__ */
|
|
1115
|
-
className:
|
|
2525
|
+
return /* @__PURE__ */ m("textarea", {
|
|
2526
|
+
className: k(V.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),
|
|
1116
2527
|
...n
|
|
1117
2528
|
});
|
|
1118
2529
|
}
|
|
1119
2530
|
//#endregion
|
|
1120
2531
|
//#region packages/toast/index.tsx
|
|
1121
|
-
var
|
|
1122
|
-
function
|
|
1123
|
-
|
|
1124
|
-
a(
|
|
1125
|
-
|
|
1126
|
-
|
|
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 ? {
|
|
1127
2539
|
...t,
|
|
1128
2540
|
leaving: !0
|
|
1129
|
-
} : t)), setTimeout(() =>
|
|
1130
|
-
}, []),
|
|
1131
|
-
let o =
|
|
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 = {
|
|
1132
2544
|
id: o,
|
|
1133
2545
|
title: e,
|
|
1134
2546
|
description: t,
|
|
1135
|
-
tone:
|
|
1136
|
-
action:
|
|
1137
|
-
timeout:
|
|
2547
|
+
tone: n,
|
|
2548
|
+
action: r,
|
|
2549
|
+
timeout: i ?? (r ? 1e4 : an)
|
|
1138
2550
|
};
|
|
1139
|
-
return
|
|
1140
|
-
}, []),
|
|
1141
|
-
return /* @__PURE__ */
|
|
1142
|
-
value:
|
|
1143
|
-
children: [e,
|
|
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", {
|
|
1144
2556
|
"aria-label": "Notifications",
|
|
1145
|
-
className: "zen__toast-viewport fixed right-4 bottom-[calc(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]",
|
|
1146
|
-
|
|
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, {
|
|
1147
2560
|
toast: e,
|
|
1148
|
-
onDismiss: () =>
|
|
2561
|
+
onDismiss: () => f(e.id)
|
|
1149
2562
|
}, e.id))
|
|
1150
2563
|
}), document.body)]
|
|
1151
2564
|
});
|
|
1152
2565
|
}
|
|
1153
|
-
function
|
|
1154
|
-
let e =
|
|
2566
|
+
function ln() {
|
|
2567
|
+
let e = a(sn);
|
|
1155
2568
|
if (!e) throw Error("useToast() needs a <ToastProvider> above it");
|
|
1156
2569
|
return e;
|
|
1157
2570
|
}
|
|
1158
|
-
var
|
|
2571
|
+
var un = {
|
|
1159
2572
|
success: {
|
|
1160
|
-
icon:
|
|
2573
|
+
icon: G,
|
|
1161
2574
|
ring: "border-primary/30",
|
|
1162
2575
|
badge: "bg-primary/15 text-primary",
|
|
1163
2576
|
bar: "bg-primary",
|
|
1164
2577
|
glow: "shadow-[0_18px_50px_-18px_oklch(var(--glow)/0.55)]"
|
|
1165
2578
|
},
|
|
1166
2579
|
error: {
|
|
1167
|
-
icon:
|
|
2580
|
+
icon: K,
|
|
1168
2581
|
ring: "border-destructive/40",
|
|
1169
2582
|
badge: "bg-destructive/15 text-destructive",
|
|
1170
2583
|
bar: "bg-destructive",
|
|
1171
2584
|
glow: "shadow-[0_18px_50px_-18px_oklch(var(--destructive)/0.55)]"
|
|
1172
2585
|
},
|
|
1173
2586
|
info: {
|
|
1174
|
-
icon:
|
|
2587
|
+
icon: q,
|
|
1175
2588
|
ring: "border-tint/10",
|
|
1176
2589
|
badge: "bg-tint/[0.08] text-foreground",
|
|
1177
2590
|
bar: "bg-muted-foreground",
|
|
1178
2591
|
glow: "shadow-[var(--toast-shadow)]"
|
|
1179
2592
|
}
|
|
1180
2593
|
};
|
|
1181
|
-
function
|
|
1182
|
-
let n =
|
|
1183
|
-
return
|
|
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(() => {
|
|
1184
2597
|
if (!e.timeout || i || e.leaving) return;
|
|
1185
2598
|
let n = Date.now(), r = setTimeout(t, s.current);
|
|
1186
2599
|
return () => {
|
|
@@ -1191,30 +2604,30 @@ function je({ toast: e, onDismiss: t }) {
|
|
|
1191
2604
|
e.timeout,
|
|
1192
2605
|
e.leaving,
|
|
1193
2606
|
t
|
|
1194
|
-
]), /* @__PURE__ */
|
|
2607
|
+
]), /* @__PURE__ */ h("div", {
|
|
1195
2608
|
role: e.tone === "error" ? "alert" : "status",
|
|
1196
2609
|
"aria-atomic": "true",
|
|
1197
|
-
onMouseEnter: () =>
|
|
1198
|
-
onMouseLeave: () =>
|
|
1199
|
-
className:
|
|
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),
|
|
1200
2613
|
children: [
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
className:
|
|
2614
|
+
/* @__PURE__ */ m("span", {
|
|
2615
|
+
className: k("mt-0.5 grid size-8 shrink-0 place-items-center rounded-full", n.badge),
|
|
1203
2616
|
"aria-hidden": !0,
|
|
1204
|
-
children: /* @__PURE__ */
|
|
2617
|
+
children: /* @__PURE__ */ m(r, { className: "size-4" })
|
|
1205
2618
|
}),
|
|
1206
|
-
/* @__PURE__ */
|
|
2619
|
+
/* @__PURE__ */ h("div", {
|
|
1207
2620
|
className: "flex min-w-0 flex-1 flex-col gap-0.5 pt-0.5",
|
|
1208
2621
|
children: [
|
|
1209
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ m("div", {
|
|
1210
2623
|
className: "text-sm font-semibold",
|
|
1211
2624
|
children: e.title
|
|
1212
2625
|
}),
|
|
1213
|
-
e.description && /* @__PURE__ */
|
|
2626
|
+
e.description && /* @__PURE__ */ m("div", {
|
|
1214
2627
|
className: "text-muted-foreground text-sm leading-5",
|
|
1215
2628
|
children: e.description
|
|
1216
2629
|
}),
|
|
1217
|
-
e.action && /* @__PURE__ */
|
|
2630
|
+
e.action && /* @__PURE__ */ m("button", {
|
|
1218
2631
|
type: "button",
|
|
1219
2632
|
onClick: () => {
|
|
1220
2633
|
e.action?.onClick(), t();
|
|
@@ -1224,12 +2637,12 @@ function je({ toast: e, onDismiss: t }) {
|
|
|
1224
2637
|
})
|
|
1225
2638
|
]
|
|
1226
2639
|
}),
|
|
1227
|
-
/* @__PURE__ */
|
|
2640
|
+
/* @__PURE__ */ m("button", {
|
|
1228
2641
|
type: "button",
|
|
1229
2642
|
"aria-label": "Dismiss",
|
|
1230
2643
|
onClick: t,
|
|
1231
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",
|
|
1232
|
-
children: /* @__PURE__ */
|
|
2645
|
+
children: /* @__PURE__ */ m("svg", {
|
|
1233
2646
|
viewBox: "0 0 16 16",
|
|
1234
2647
|
fill: "none",
|
|
1235
2648
|
stroke: "currentColor",
|
|
@@ -1237,89 +2650,47 @@ function je({ toast: e, onDismiss: t }) {
|
|
|
1237
2650
|
strokeLinecap: "round",
|
|
1238
2651
|
className: "size-3.5",
|
|
1239
2652
|
"aria-hidden": !0,
|
|
1240
|
-
children: /* @__PURE__ */
|
|
2653
|
+
children: /* @__PURE__ */ m("path", { d: "m4 4 8 8M12 4l-8 8" })
|
|
1241
2654
|
})
|
|
1242
2655
|
}),
|
|
1243
|
-
e.timeout > 0 && /* @__PURE__ */
|
|
2656
|
+
e.timeout > 0 && /* @__PURE__ */ m("span", {
|
|
1244
2657
|
"aria-hidden": !0,
|
|
1245
|
-
className:
|
|
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),
|
|
1246
2659
|
style: { animationDuration: `${e.timeout}ms` }
|
|
1247
2660
|
})
|
|
1248
2661
|
]
|
|
1249
2662
|
});
|
|
1250
2663
|
}
|
|
1251
|
-
function Me({ className: e }) {
|
|
1252
|
-
return /* @__PURE__ */ f("svg", {
|
|
1253
|
-
viewBox: "0 0 16 16",
|
|
1254
|
-
fill: "none",
|
|
1255
|
-
stroke: "currentColor",
|
|
1256
|
-
strokeWidth: "2",
|
|
1257
|
-
strokeLinecap: "round",
|
|
1258
|
-
strokeLinejoin: "round",
|
|
1259
|
-
className: h("size-3.5", e),
|
|
1260
|
-
"aria-hidden": !0,
|
|
1261
|
-
children: /* @__PURE__ */ f("path", { d: "m3.5 8.5 3 3 6-7" })
|
|
1262
|
-
});
|
|
1263
|
-
}
|
|
1264
|
-
function Ne({ className: e }) {
|
|
1265
|
-
return /* @__PURE__ */ p("svg", {
|
|
1266
|
-
viewBox: "0 0 16 16",
|
|
1267
|
-
fill: "none",
|
|
1268
|
-
stroke: "currentColor",
|
|
1269
|
-
strokeWidth: "1.8",
|
|
1270
|
-
strokeLinecap: "round",
|
|
1271
|
-
strokeLinejoin: "round",
|
|
1272
|
-
className: h("size-3.5", e),
|
|
1273
|
-
"aria-hidden": !0,
|
|
1274
|
-
children: [/* @__PURE__ */ f("path", { d: "M8 2.2 1.6 13.3h12.8L8 2.2Z" }), /* @__PURE__ */ f("path", { d: "M8 6.5v3M8 11.6v.1" })]
|
|
1275
|
-
});
|
|
1276
|
-
}
|
|
1277
|
-
function Pe({ className: e }) {
|
|
1278
|
-
return /* @__PURE__ */ p("svg", {
|
|
1279
|
-
viewBox: "0 0 16 16",
|
|
1280
|
-
fill: "none",
|
|
1281
|
-
stroke: "currentColor",
|
|
1282
|
-
strokeWidth: "1.8",
|
|
1283
|
-
strokeLinecap: "round",
|
|
1284
|
-
className: h("size-3.5", e),
|
|
1285
|
-
"aria-hidden": !0,
|
|
1286
|
-
children: [/* @__PURE__ */ f("circle", {
|
|
1287
|
-
cx: "8",
|
|
1288
|
-
cy: "8",
|
|
1289
|
-
r: "6.3"
|
|
1290
|
-
}), /* @__PURE__ */ f("path", { d: "M8 7.3v3.8M8 4.9v.1" })]
|
|
1291
|
-
});
|
|
1292
|
-
}
|
|
1293
2664
|
//#endregion
|
|
1294
2665
|
//#region packages/toggle/index.tsx
|
|
1295
|
-
function
|
|
2666
|
+
function fn(e) {
|
|
1296
2667
|
let { className: t, onChange: n, disabled: r, ...i } = e;
|
|
1297
|
-
return /* @__PURE__ */
|
|
1298
|
-
className:
|
|
1299
|
-
children: [/* @__PURE__ */
|
|
2668
|
+
return /* @__PURE__ */ h("label", {
|
|
2669
|
+
className: k("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
|
+
children: [/* @__PURE__ */ m("input", {
|
|
1300
2671
|
type: "checkbox",
|
|
1301
2672
|
role: "switch",
|
|
1302
2673
|
className: "peer sr-only",
|
|
1303
2674
|
disabled: r,
|
|
1304
2675
|
onChange: (e) => n?.(e.target.checked),
|
|
1305
2676
|
...i
|
|
1306
|
-
}), /* @__PURE__ */
|
|
2677
|
+
}), /* @__PURE__ */ m("span", {
|
|
1307
2678
|
"aria-hidden": !0,
|
|
1308
|
-
className:
|
|
2679
|
+
className: k("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")
|
|
1309
2680
|
})]
|
|
1310
2681
|
});
|
|
1311
2682
|
}
|
|
1312
2683
|
//#endregion
|
|
1313
2684
|
//#region packages/theme-toggle/index.tsx
|
|
1314
|
-
var
|
|
1315
|
-
function
|
|
1316
|
-
return /* @__PURE__ */
|
|
2685
|
+
var pn = (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){}`;
|
|
2686
|
+
function mn({ storageKey: e = "theme" }) {
|
|
2687
|
+
return /* @__PURE__ */ m("script", { dangerouslySetInnerHTML: { __html: pn(e) } });
|
|
1317
2688
|
}
|
|
1318
|
-
function
|
|
1319
|
-
let [n, r] =
|
|
1320
|
-
|
|
2689
|
+
function hn({ storageKey: e = "theme", className: t }) {
|
|
2690
|
+
let [n, r] = d("dark");
|
|
2691
|
+
o(() => r(document.documentElement.classList.contains("light") ? "light" : "dark"), []);
|
|
1321
2692
|
let i = n === "dark" ? "light" : "dark";
|
|
1322
|
-
return /* @__PURE__ */
|
|
2693
|
+
return /* @__PURE__ */ m("button", {
|
|
1323
2694
|
type: "button",
|
|
1324
2695
|
"aria-label": `Switch to ${i} theme`,
|
|
1325
2696
|
onClick: () => {
|
|
@@ -1330,8 +2701,8 @@ function Le({ storageKey: e = "theme", className: t }) {
|
|
|
1330
2701
|
} catch {}
|
|
1331
2702
|
r(i);
|
|
1332
2703
|
},
|
|
1333
|
-
className:
|
|
1334
|
-
children: /* @__PURE__ */
|
|
2704
|
+
className: k("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
|
+
children: /* @__PURE__ */ m("svg", {
|
|
1335
2706
|
viewBox: "0 0 16 16",
|
|
1336
2707
|
fill: "none",
|
|
1337
2708
|
stroke: "currentColor",
|
|
@@ -1339,13 +2710,217 @@ function Le({ storageKey: e = "theme", className: t }) {
|
|
|
1339
2710
|
strokeLinecap: "round",
|
|
1340
2711
|
className: "size-4",
|
|
1341
2712
|
"aria-hidden": !0,
|
|
1342
|
-
children: n === "dark" ? /* @__PURE__ */
|
|
2713
|
+
children: n === "dark" ? /* @__PURE__ */ m("path", { d: "M13.5 9.5A5.5 5.5 0 0 1 6.5 2.5a5.5 5.5 0 1 0 7 7Z" }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("circle", {
|
|
1343
2714
|
cx: "8",
|
|
1344
2715
|
cy: "8",
|
|
1345
2716
|
r: "3"
|
|
1346
|
-
}), /* @__PURE__ */
|
|
2717
|
+
}), /* @__PURE__ */ m("path", { d: "M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M3.05 3.05l1.06 1.06M11.89 11.89l1.06 1.06M3.05 12.95l1.06-1.06M11.89 4.11l1.06-1.06" })] })
|
|
1347
2718
|
})
|
|
1348
2719
|
});
|
|
1349
2720
|
}
|
|
1350
2721
|
//#endregion
|
|
1351
|
-
|
|
2722
|
+
//#region packages/utils/theme.ts
|
|
2723
|
+
var gn = [
|
|
2724
|
+
"mono",
|
|
2725
|
+
"muted",
|
|
2726
|
+
"balanced",
|
|
2727
|
+
"vivid"
|
|
2728
|
+
], Q = [
|
|
2729
|
+
{
|
|
2730
|
+
id: "violet",
|
|
2731
|
+
label: "Violet",
|
|
2732
|
+
hue: 295,
|
|
2733
|
+
intensity: "balanced",
|
|
2734
|
+
tint: "tinted"
|
|
2735
|
+
},
|
|
2736
|
+
{
|
|
2737
|
+
id: "ocean",
|
|
2738
|
+
label: "Ocean",
|
|
2739
|
+
hue: 250,
|
|
2740
|
+
intensity: "balanced",
|
|
2741
|
+
tint: "tinted"
|
|
2742
|
+
},
|
|
2743
|
+
{
|
|
2744
|
+
id: "teal",
|
|
2745
|
+
label: "Teal",
|
|
2746
|
+
hue: 195,
|
|
2747
|
+
intensity: "balanced",
|
|
2748
|
+
tint: "tinted"
|
|
2749
|
+
},
|
|
2750
|
+
{
|
|
2751
|
+
id: "forest",
|
|
2752
|
+
label: "Forest",
|
|
2753
|
+
hue: 150,
|
|
2754
|
+
intensity: "muted",
|
|
2755
|
+
tint: "tinted"
|
|
2756
|
+
},
|
|
2757
|
+
{
|
|
2758
|
+
id: "amber",
|
|
2759
|
+
label: "Amber",
|
|
2760
|
+
hue: 75,
|
|
2761
|
+
intensity: "balanced",
|
|
2762
|
+
tint: "neutral"
|
|
2763
|
+
},
|
|
2764
|
+
{
|
|
2765
|
+
id: "rose",
|
|
2766
|
+
label: "Rose",
|
|
2767
|
+
hue: 15,
|
|
2768
|
+
intensity: "muted",
|
|
2769
|
+
tint: "neutral"
|
|
2770
|
+
},
|
|
2771
|
+
{
|
|
2772
|
+
id: "graphite",
|
|
2773
|
+
label: "Graphite",
|
|
2774
|
+
hue: 270,
|
|
2775
|
+
intensity: "mono",
|
|
2776
|
+
tint: "neutral"
|
|
2777
|
+
}
|
|
2778
|
+
], _n = {
|
|
2779
|
+
preset: "violet",
|
|
2780
|
+
hue: 295,
|
|
2781
|
+
intensity: "balanced",
|
|
2782
|
+
tint: "tinted",
|
|
2783
|
+
contrast: "standard",
|
|
2784
|
+
glow: "soft",
|
|
2785
|
+
topography: "subtle"
|
|
2786
|
+
};
|
|
2787
|
+
function vn(e, t) {
|
|
2788
|
+
let n = Q.find((e) => e.id === t);
|
|
2789
|
+
return {
|
|
2790
|
+
...e,
|
|
2791
|
+
preset: n.id,
|
|
2792
|
+
hue: n.hue,
|
|
2793
|
+
intensity: n.intensity,
|
|
2794
|
+
tint: n.tint
|
|
2795
|
+
};
|
|
2796
|
+
}
|
|
2797
|
+
function yn(e, t) {
|
|
2798
|
+
return {
|
|
2799
|
+
...e,
|
|
2800
|
+
...t,
|
|
2801
|
+
preset: "custom"
|
|
2802
|
+
};
|
|
2803
|
+
}
|
|
2804
|
+
var bn = {
|
|
2805
|
+
mono: .012,
|
|
2806
|
+
muted: .07,
|
|
2807
|
+
balanced: .13,
|
|
2808
|
+
vivid: .19
|
|
2809
|
+
}, $ = (e, t, n) => `${xn(e, 3)} ${xn(t, 3)} ${xn((n % 360 + 360) % 360, 1)}`, xn = (e, t) => Math.round(e * 10 ** t) / 10 ** t;
|
|
2810
|
+
function Sn(e, t = "dark") {
|
|
2811
|
+
let n = e.hue, r = bn[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
|
+
off: 0,
|
|
2813
|
+
subtle: .55,
|
|
2814
|
+
visible: 1
|
|
2815
|
+
}[e.topography]) };
|
|
2816
|
+
return t === "light" ? {
|
|
2817
|
+
background: s(i ? .995 : .985, .4),
|
|
2818
|
+
foreground: $(i ? .16 : .21, .02, n),
|
|
2819
|
+
card: $(1, 0, 0),
|
|
2820
|
+
"card-foreground": $(i ? .16 : .21, .02, n),
|
|
2821
|
+
popover: $(1, 0, 0),
|
|
2822
|
+
"popover-foreground": $(i ? .16 : .21, .02, n),
|
|
2823
|
+
secondary: s(.955, .6),
|
|
2824
|
+
"secondary-foreground": $(.21, .02, n),
|
|
2825
|
+
muted: s(.96, .5),
|
|
2826
|
+
"muted-foreground": s(i ? .42 : .5, 1.5),
|
|
2827
|
+
border: s(i ? .78 : .91, .8),
|
|
2828
|
+
input: s(i ? .78 : .91, .8),
|
|
2829
|
+
primary: $(o ? .3 : .48, o ? .02 : Math.min(.22, r * 1.5), n),
|
|
2830
|
+
"primary-foreground": $(.985, 0, 0),
|
|
2831
|
+
accent: $(.95, o ? .005 : r * .25, n),
|
|
2832
|
+
"accent-foreground": $(.42, o ? .02 : Math.min(.16, r * .9), n),
|
|
2833
|
+
ring: $(o ? .3 : .48, o ? .02 : Math.min(.22, r * 1.5), n),
|
|
2834
|
+
destructive: $(.55, .22, 25),
|
|
2835
|
+
"destructive-foreground": $(.985, 0, 0),
|
|
2836
|
+
glow: $(.62, o ? .02 : Math.min(.2, r * 1.4), n),
|
|
2837
|
+
"glow-2": $(.65, o ? .02 : r * 1.05, n + 30),
|
|
2838
|
+
tint: $(.21, .02, n),
|
|
2839
|
+
"glow-strength": String({
|
|
2840
|
+
off: 0,
|
|
2841
|
+
soft: .4,
|
|
2842
|
+
bright: .8
|
|
2843
|
+
}[e.glow]),
|
|
2844
|
+
...c
|
|
2845
|
+
} : {
|
|
2846
|
+
background: s(i ? .13 : .155),
|
|
2847
|
+
foreground: $(.97, .004, n),
|
|
2848
|
+
card: s(i ? .17 : .195),
|
|
2849
|
+
"card-foreground": $(.97, .004, n),
|
|
2850
|
+
popover: s(i ? .18 : .21),
|
|
2851
|
+
"popover-foreground": $(.97, .004, n),
|
|
2852
|
+
secondary: s(.25),
|
|
2853
|
+
"secondary-foreground": $(.97, .004, n),
|
|
2854
|
+
muted: s(.235),
|
|
2855
|
+
"muted-foreground": s(i ? .84 : .72, 1.5),
|
|
2856
|
+
border: s(i ? .4 : .28, 1.5),
|
|
2857
|
+
input: s(i ? .4 : .28, 1.5),
|
|
2858
|
+
primary: $(o ? .88 : .72, r, n),
|
|
2859
|
+
"primary-foreground": $(o ? .2 : .17, o ? .01 : .03, n),
|
|
2860
|
+
accent: $(.3, r * .35, n),
|
|
2861
|
+
"accent-foreground": $(.88, r * .5, n),
|
|
2862
|
+
ring: $(.72, r, n),
|
|
2863
|
+
destructive: $(.64, .2, 25),
|
|
2864
|
+
"destructive-foreground": $(.985, 0, 0),
|
|
2865
|
+
glow: $(.7, o ? .02 : r, n),
|
|
2866
|
+
"glow-2": $(.72, o ? .02 : r * .75, n + 30),
|
|
2867
|
+
tint: $(1, 0, 0),
|
|
2868
|
+
"glow-strength": String({
|
|
2869
|
+
off: 0,
|
|
2870
|
+
soft: .55,
|
|
2871
|
+
bright: 1
|
|
2872
|
+
}[e.glow]),
|
|
2873
|
+
...c
|
|
2874
|
+
};
|
|
2875
|
+
}
|
|
2876
|
+
function Cn(e, { appearance: t = "dark", target: n } = {}) {
|
|
2877
|
+
let r = n ?? document.documentElement;
|
|
2878
|
+
for (let [n, i] of Object.entries(Sn(e, t))) r.style.setProperty(`--${n}`, i);
|
|
2879
|
+
}
|
|
2880
|
+
function wn(e) {
|
|
2881
|
+
let t = e ?? document.documentElement;
|
|
2882
|
+
for (let e of Object.keys(Sn(_n))) t.style.removeProperty(`--${e}`);
|
|
2883
|
+
}
|
|
2884
|
+
function Tn(e) {
|
|
2885
|
+
let t = typeof e == "object" && e ? e : {}, n = (e, t, n) => t.includes(e) ? e : n, r = _n, i = Q.map((e) => e.id);
|
|
2886
|
+
return {
|
|
2887
|
+
preset: typeof t.preset == "string" && (t.preset === "custom" || i.includes(t.preset)) ? t.preset : r.preset,
|
|
2888
|
+
hue: typeof t.hue == "number" && Number.isFinite(t.hue) ? (Math.round(t.hue) % 360 + 360) % 360 : r.hue,
|
|
2889
|
+
intensity: n(t.intensity, gn, r.intensity),
|
|
2890
|
+
tint: n(t.tint, ["neutral", "tinted"], r.tint),
|
|
2891
|
+
contrast: n(t.contrast, ["standard", "high"], r.contrast),
|
|
2892
|
+
glow: n(t.glow, [
|
|
2893
|
+
"off",
|
|
2894
|
+
"soft",
|
|
2895
|
+
"bright"
|
|
2896
|
+
], r.glow),
|
|
2897
|
+
topography: n(t.topography, [
|
|
2898
|
+
"off",
|
|
2899
|
+
"subtle",
|
|
2900
|
+
"visible"
|
|
2901
|
+
], r.topography)
|
|
2902
|
+
};
|
|
2903
|
+
}
|
|
2904
|
+
function En(e) {
|
|
2905
|
+
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
|
+
return [
|
|
2907
|
+
l(4.0767416621 * o - 3.3077115913 * s + .2309699292 * c),
|
|
2908
|
+
l(-1.2684380046 * o + 2.6097574011 * s - .3413193965 * c),
|
|
2909
|
+
l(-.0041960863 * o - .7034186147 * s + 1.707614701 * c)
|
|
2910
|
+
];
|
|
2911
|
+
}
|
|
2912
|
+
function Dn(e, t) {
|
|
2913
|
+
let n = (e) => {
|
|
2914
|
+
let [t, n, r] = En(e);
|
|
2915
|
+
return .2126 * t + .7152 * n + .0722 * r;
|
|
2916
|
+
}, [r, i] = [n(e), n(t)].sort((e, t) => t - e);
|
|
2917
|
+
return (r + .05) / (i + .05);
|
|
2918
|
+
}
|
|
2919
|
+
//#endregion
|
|
2920
|
+
//#region packages/utils/useHydrated.ts
|
|
2921
|
+
var On = () => () => {};
|
|
2922
|
+
function kn() {
|
|
2923
|
+
return f(On, () => !0, () => !1);
|
|
2924
|
+
}
|
|
2925
|
+
//#endregion
|
|
2926
|
+
export { de as ActionsMenu, K as AlertTriangle, ye as AnimatedMoney, ve as AnimatedNumber, be as Avatar, Se as Backdrop, z as Badge, B as Button, Oe as Card, G as Check, Ye as ChevronDown, Xe as ChevronLeft, Ze as ChevronRight, Qe as ChevronUp, je as CodeBlock, Ie as Collapse, Re as ConfirmDialog, _n as DEFAULT_THEME, Le as Dialog, Ke as Dropdown, ze as EditableCell, Be as Field, Ve as FormMessage, Je as Header, gn as INTENSITIES, R as ImageCropError, q as InfoCircle, $e as Input, We as InputGroup, Y as InputGroupAddon, J as InputGroupInput, et as Meter, dt as MoneyInput, L as MoneyParseError, ut as MonthPicker, vt as NavPill, gt as NavPillIndicator, ht as NavPills, Q as PRESETS, yt as PageHeader, W as Popover, bt as ProgressRing, He as Search, xt as Segmented, St as Select, Ct as SideNav, wt as SideNavGroup, Et as SideNavLink, Dt as Skeleton, Ot as Slider, Ee as Spinner, ke as Stat, Ae as StatRow, Xt as Tab, kt as TabBar, jt as TabBarItem, Yt as TabList, Zt as TabPanel, Nt as Table, Ft as TableBody, zt as TableCell, Mt as TableContainer, Ht as TableEmpty, It as TableFooter, Bt as TableFooterCell, Rt as TableHead, Pt as TableHeader, Wt as TableOfContents, Lt as TableRow, Vt as TableSpacerRow, qt as Tabs, rn as TextArea, mn as ThemeScript, hn as ThemeToggle, cn as ToastProvider, fn as Toggle, en as TreeCell, tn as TreeLabel, $t as TreeRow, nn as TreeToggle, Ue as XMark, it as addMonths, j as applyGraphicsMode, vn as applyPreset, Cn as applyTheme, De as buttonVariants, Dn as contrastRatio, xe as cropImageToSquare, fe as currencySymbol, st as currentMonth, yn as customize, we as cva, k as cx, le as detectGraphicsMode, I as formatAmount, F as formatMoney, ct as formatMonth, rt as fromMonthIndex, nt as isMonth, P as minorDigits, Z as monthIndex, lt as monthNames, at as monthRange, ot as monthsBetween, Tn as normalizeTheme, En as oklchToLinearRgb, pe as parseMoney, he as parseMoneyInput, wn as resetTheme, pn as themeScript, Sn as themeVars, N as useAnchoredPopup, kn as useHydrated, ft as useMoneyInput, Ut as useSort, ln as useToast, Qt as useTree, Ge as useVirtualList };
|