@leonardaustin/ui 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/components/app-shell/MobileDrawer.d.ts.map +1 -1
- package/dist/components/app-shell/ThemeMenu.d.ts +20 -0
- package/dist/components/app-shell/ThemeMenu.d.ts.map +1 -0
- package/dist/components/app-shell/TopBar.d.ts.map +1 -1
- package/dist/components/app-shell/themeMenuEvents.d.ts +9 -0
- package/dist/components/app-shell/themeMenuEvents.d.ts.map +1 -0
- package/dist/components/ui/Button.d.ts +10 -0
- package/dist/components/ui/Button.d.ts.map +1 -1
- package/dist/hooks/useDismiss.d.ts +9 -1
- package/dist/hooks/useDismiss.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1062 -786
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { Component as e, Fragment as t, createContext as n, forwardRef 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 } from "react";
|
|
2
2
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
3
|
-
import { Accessibility as h, AlertTriangle as g, ArrowDown as _, ArrowLeft as v, ArrowUp as y, BookOpen as b, Calendar as x, Check as S, CheckCircle2 as C, ChevronDown as w, ChevronLeft as T, ChevronRight as E, ChevronsUpDown as D, Columns3 as O, Eye as k, EyeOff as A, Inbox as ee, Info as
|
|
4
|
-
import { createPortal as
|
|
3
|
+
import { Accessibility as h, AlertTriangle as g, ArrowDown as _, ArrowLeft as v, ArrowUp as y, BookOpen as b, Calendar as x, Check as S, CheckCircle2 as C, ChevronDown as w, ChevronLeft as T, ChevronRight as E, ChevronsUpDown as D, Columns3 as O, Eye as k, EyeOff as A, Inbox as ee, Info as te, Loader2 as ne, LogOut as re, Menu as ie, Minus as ae, Monitor as j, Moon as M, Palette as oe, PanelLeft as se, PanelLeftDashed as ce, Search as N, Settings as le, Sun as ue, UploadCloud as de, X as P, XCircle as fe, Zap as pe } from "lucide-react";
|
|
4
|
+
import { createPortal as F } from "react-dom";
|
|
5
5
|
//#region src/components/charts/AreaChart.tsx
|
|
6
|
-
var
|
|
6
|
+
var I = {
|
|
7
7
|
top: 16,
|
|
8
8
|
right: 12,
|
|
9
9
|
bottom: 28,
|
|
10
10
|
left: 48
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function me(e) {
|
|
13
13
|
return e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : String(e);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
let n = s(), r = u(null), [i, a] = d(null), o = 600 -
|
|
15
|
+
function he({ data: e, height: t = 240 }) {
|
|
16
|
+
let n = s(), r = u(null), [i, a] = d(null), o = 600 - I.left - I.right, c = t - I.top - I.bottom, l = Math.min(...e.map((e) => e.value)), h = Math.max(...e.map((e) => e.value)), g = h - l || 1;
|
|
17
17
|
function _(t) {
|
|
18
|
-
return
|
|
18
|
+
return I.left + t / Math.max(e.length - 1, 1) * o;
|
|
19
19
|
}
|
|
20
20
|
function v(e) {
|
|
21
|
-
return
|
|
21
|
+
return I.top + c - (e - l) / g * c;
|
|
22
22
|
}
|
|
23
23
|
let y = e.map((e, t) => `${_(t)},${v(e.value)}`).join(" "), b = [
|
|
24
|
-
`${_(0)},${
|
|
24
|
+
`${_(0)},${I.top + c}`,
|
|
25
25
|
...e.map((e, t) => `${_(t)},${v(e.value)}`),
|
|
26
|
-
`${_(e.length - 1)},${
|
|
26
|
+
`${_(e.length - 1)},${I.top + c}`
|
|
27
27
|
].join(" "), x = Math.max(1, Math.floor(e.length / 5)), S = e.filter((t, n) => n % x === 0 || n === e.length - 1), C = e.map((e, t) => t).filter((t) => t % x === 0 || t === e.length - 1);
|
|
28
28
|
function w(t) {
|
|
29
29
|
let n = r.current;
|
|
30
30
|
if (!n || e.length === 0) return;
|
|
31
|
-
let i = n.getBoundingClientRect(), s = ((t.clientX - i.left) / i.width * 600 -
|
|
31
|
+
let i = n.getBoundingClientRect(), s = ((t.clientX - i.left) / i.width * 600 - I.left) / o, c = Math.round(s * (e.length - 1)), l = Math.max(0, Math.min(e.length - 1, c));
|
|
32
32
|
a({
|
|
33
33
|
x: _(l),
|
|
34
34
|
y: v(e[l].value),
|
|
@@ -63,28 +63,28 @@ function ge({ data: e, height: t = 240 }) {
|
|
|
63
63
|
})]
|
|
64
64
|
}) }),
|
|
65
65
|
/* @__PURE__ */ p("text", {
|
|
66
|
-
x:
|
|
67
|
-
y:
|
|
66
|
+
x: I.left - 8,
|
|
67
|
+
y: I.top,
|
|
68
68
|
textAnchor: "end",
|
|
69
69
|
dominantBaseline: "central",
|
|
70
70
|
fill: "var(--text-tertiary)",
|
|
71
71
|
fontSize: 10,
|
|
72
|
-
children:
|
|
72
|
+
children: me(h)
|
|
73
73
|
}),
|
|
74
74
|
/* @__PURE__ */ p("text", {
|
|
75
|
-
x:
|
|
76
|
-
y:
|
|
75
|
+
x: I.left - 8,
|
|
76
|
+
y: I.top + c,
|
|
77
77
|
textAnchor: "end",
|
|
78
78
|
dominantBaseline: "central",
|
|
79
79
|
fill: "var(--text-tertiary)",
|
|
80
80
|
fontSize: 10,
|
|
81
|
-
children:
|
|
81
|
+
children: me(l)
|
|
82
82
|
}),
|
|
83
83
|
/* @__PURE__ */ p("line", {
|
|
84
|
-
x1:
|
|
85
|
-
y1:
|
|
86
|
-
x2:
|
|
87
|
-
y2:
|
|
84
|
+
x1: I.left,
|
|
85
|
+
y1: I.top + c,
|
|
86
|
+
x2: I.left + o,
|
|
87
|
+
y2: I.top + c,
|
|
88
88
|
stroke: "var(--border)",
|
|
89
89
|
strokeWidth: 1
|
|
90
90
|
}),
|
|
@@ -111,9 +111,9 @@ function ge({ data: e, height: t = 240 }) {
|
|
|
111
111
|
i && /* @__PURE__ */ m(f, { children: [
|
|
112
112
|
/* @__PURE__ */ p("line", {
|
|
113
113
|
x1: i.x,
|
|
114
|
-
y1:
|
|
114
|
+
y1: I.top,
|
|
115
115
|
x2: i.x,
|
|
116
|
-
y2:
|
|
116
|
+
y2: I.top + c,
|
|
117
117
|
stroke: "var(--border-strong)",
|
|
118
118
|
strokeWidth: 1,
|
|
119
119
|
strokeDasharray: "3 3"
|
|
@@ -166,14 +166,14 @@ function ge({ data: e, height: t = 240 }) {
|
|
|
166
166
|
}
|
|
167
167
|
//#endregion
|
|
168
168
|
//#region src/components/charts/BarChart.tsx
|
|
169
|
-
var
|
|
169
|
+
var ge = [
|
|
170
170
|
1,
|
|
171
171
|
.85,
|
|
172
172
|
.7,
|
|
173
173
|
.55,
|
|
174
174
|
.45
|
|
175
175
|
];
|
|
176
|
-
function
|
|
176
|
+
function _e({ data: e, height: t }) {
|
|
177
177
|
let [n, r] = d(null), i = Math.max(...e.map((e) => e.value));
|
|
178
178
|
return /* @__PURE__ */ p("svg", {
|
|
179
179
|
width: "100%",
|
|
@@ -219,7 +219,7 @@ function ve({ data: e, height: t }) {
|
|
|
219
219
|
height: 22,
|
|
220
220
|
fill: "var(--accent)",
|
|
221
221
|
rx: 6,
|
|
222
|
-
opacity: s ? 1 :
|
|
222
|
+
opacity: s ? 1 : ge[t % ge.length],
|
|
223
223
|
style: { transition: "all 150ms" }
|
|
224
224
|
}),
|
|
225
225
|
/* @__PURE__ */ p("text", {
|
|
@@ -239,19 +239,19 @@ function ve({ data: e, height: t }) {
|
|
|
239
239
|
}
|
|
240
240
|
//#endregion
|
|
241
241
|
//#region src/lib/cn.ts
|
|
242
|
-
function
|
|
242
|
+
function ve(e) {
|
|
243
243
|
if (typeof e == "string" || typeof e == "number" || typeof e == "bigint") return String(e);
|
|
244
244
|
if (!e || typeof e != "object") return "";
|
|
245
245
|
let t = "";
|
|
246
246
|
if (Array.isArray(e)) for (let n of e) {
|
|
247
247
|
if (!n) continue;
|
|
248
|
-
let e =
|
|
248
|
+
let e = ve(n);
|
|
249
249
|
e && (t = t ? `${t} ${e}` : e);
|
|
250
250
|
}
|
|
251
251
|
else for (let n in e) e[n] && (t = t ? `${t} ${n}` : n);
|
|
252
252
|
return t;
|
|
253
253
|
}
|
|
254
|
-
var
|
|
254
|
+
var ye = new Set([
|
|
255
255
|
"block",
|
|
256
256
|
"contents",
|
|
257
257
|
"flex",
|
|
@@ -261,7 +261,7 @@ var be = new Set([
|
|
|
261
261
|
"inline-block",
|
|
262
262
|
"inline-flex",
|
|
263
263
|
"table"
|
|
264
|
-
]),
|
|
264
|
+
]), be = new Set([
|
|
265
265
|
"text-2xl",
|
|
266
266
|
"text-2xs",
|
|
267
267
|
"text-2xs-f",
|
|
@@ -272,16 +272,16 @@ var be = new Set([
|
|
|
272
272
|
"text-sm",
|
|
273
273
|
"text-xl",
|
|
274
274
|
"text-xs"
|
|
275
|
-
]),
|
|
275
|
+
]), xe = new Set([
|
|
276
276
|
"text-center",
|
|
277
277
|
"text-left",
|
|
278
278
|
"text-right"
|
|
279
|
-
]),
|
|
279
|
+
]), Se = new Set(["lowercase", "uppercase"]), Ce = new Set([
|
|
280
280
|
"font-bold",
|
|
281
281
|
"font-medium",
|
|
282
282
|
"font-normal",
|
|
283
283
|
"font-semibold"
|
|
284
|
-
]),
|
|
284
|
+
]), we = {
|
|
285
285
|
m: [
|
|
286
286
|
"margin-top",
|
|
287
287
|
"margin-right",
|
|
@@ -306,7 +306,7 @@ var be = new Set([
|
|
|
306
306
|
pr: ["padding-right"],
|
|
307
307
|
pb: ["padding-bottom"],
|
|
308
308
|
pl: ["padding-left"]
|
|
309
|
-
},
|
|
309
|
+
}, Te = {
|
|
310
310
|
inset: [
|
|
311
311
|
"top",
|
|
312
312
|
"right",
|
|
@@ -321,7 +321,7 @@ var be = new Set([
|
|
|
321
321
|
left: ["left"],
|
|
322
322
|
start: ["inset-inline-start"],
|
|
323
323
|
end: ["inset-inline-end"]
|
|
324
|
-
},
|
|
324
|
+
}, Ee = {
|
|
325
325
|
border: [
|
|
326
326
|
"border-top-width",
|
|
327
327
|
"border-right-width",
|
|
@@ -334,7 +334,7 @@ var be = new Set([
|
|
|
334
334
|
"border-r": ["border-right-width"],
|
|
335
335
|
"border-b": ["border-bottom-width"],
|
|
336
336
|
"border-l": ["border-left-width"]
|
|
337
|
-
},
|
|
337
|
+
}, De = {
|
|
338
338
|
border: [
|
|
339
339
|
"border-top-color",
|
|
340
340
|
"border-right-color",
|
|
@@ -347,7 +347,7 @@ var be = new Set([
|
|
|
347
347
|
"border-r": ["border-right-color"],
|
|
348
348
|
"border-b": ["border-bottom-color"],
|
|
349
349
|
"border-l": ["border-left-color"]
|
|
350
|
-
},
|
|
350
|
+
}, Oe = new Set([
|
|
351
351
|
"border-dashed",
|
|
352
352
|
"border-dotted",
|
|
353
353
|
"border-double",
|
|
@@ -355,14 +355,14 @@ var be = new Set([
|
|
|
355
355
|
"border-none",
|
|
356
356
|
"border-solid"
|
|
357
357
|
]);
|
|
358
|
-
function
|
|
359
|
-
return
|
|
358
|
+
function L(...e) {
|
|
359
|
+
return ke(ve(e));
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function ke(e) {
|
|
362
362
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
363
363
|
for (let r of e.split(/\s+/)) {
|
|
364
364
|
if (!r) continue;
|
|
365
|
-
let e =
|
|
365
|
+
let e = Ae(r);
|
|
366
366
|
if (e.size === 0) {
|
|
367
367
|
let i = n.get(r);
|
|
368
368
|
i !== void 0 && (t[i] = null), n.set(r, t.length), t.push({
|
|
@@ -373,7 +373,7 @@ function Ae(e) {
|
|
|
373
373
|
}
|
|
374
374
|
for (let n = t.length - 1; n >= 0; n--) {
|
|
375
375
|
let r = t[n];
|
|
376
|
-
r &&
|
|
376
|
+
r && ze(r.keys, e) && (t[n] = null);
|
|
377
377
|
}
|
|
378
378
|
t.push({
|
|
379
379
|
token: r,
|
|
@@ -382,11 +382,11 @@ function Ae(e) {
|
|
|
382
382
|
}
|
|
383
383
|
return t.filter((e) => !!e).map((e) => e.token).join(" ");
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
let t =
|
|
385
|
+
function Ae(e) {
|
|
386
|
+
let t = je(e), n = t.pop() ?? e, r = n.startsWith("!"), i = Me(r ? n.slice(1) : n), a = `${t.join(":")}|${r ? "!" : ""}`, o = Ne(i);
|
|
387
387
|
return new Set(o.map((e) => `${a}${e}`));
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function je(e) {
|
|
390
390
|
let t = [], n = 0, r = 0;
|
|
391
391
|
for (let i = 0; i < e.length; i++) {
|
|
392
392
|
let a = e[i];
|
|
@@ -394,57 +394,57 @@ function Me(e) {
|
|
|
394
394
|
}
|
|
395
395
|
return t.push(e.slice(r)), t;
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Me(e) {
|
|
398
398
|
return e.startsWith("-") ? e.slice(1) : e;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
let t =
|
|
402
|
-
if (t) return [...
|
|
403
|
-
let n =
|
|
404
|
-
if (n) return [...
|
|
405
|
-
let r =
|
|
406
|
-
if (r) return [...
|
|
407
|
-
if (
|
|
400
|
+
function Ne(e) {
|
|
401
|
+
let t = Pe(e);
|
|
402
|
+
if (t) return [...we[t]];
|
|
403
|
+
let n = Fe(e);
|
|
404
|
+
if (n) return [...Te[n]];
|
|
405
|
+
let r = Ie(e);
|
|
406
|
+
if (r) return [...Ee[r]];
|
|
407
|
+
if (ye.has(e)) return ["display"];
|
|
408
408
|
if (e === "absolute" || e === "fixed" || e === "relative" || e === "static" || e === "sticky") return ["position"];
|
|
409
409
|
if (e === "visible" || e === "invisible" || e === "collapse") return ["visibility"];
|
|
410
410
|
if (e === "border-collapse") return ["border-collapse"];
|
|
411
|
-
if (
|
|
412
|
-
let i =
|
|
413
|
-
return i ? [...
|
|
411
|
+
if (Oe.has(e)) return ["border-style"];
|
|
412
|
+
let i = Le(e);
|
|
413
|
+
return i ? [...De[i]] : e === "rounded" || e.startsWith("rounded-") ? ["border-radius"] : e.startsWith("bg-") ? ["background"] : be.has(e) ? ["font-size"] : xe.has(e) ? ["text-align"] : Se.has(e) ? ["text-transform"] : e.startsWith("text-") ? ["color"] : e === "font-mono" ? ["font-family"] : Ce.has(e) ? ["font-weight"] : e.startsWith("leading-") ? ["line-height"] : e.startsWith("tracking-") ? ["letter-spacing"] : e.startsWith("w-") ? ["width"] : e.startsWith("min-w-") ? ["min-width"] : e.startsWith("max-w-") ? ["max-width"] : e.startsWith("h-") ? ["height"] : e.startsWith("min-h-") ? ["min-height"] : e.startsWith("max-h-") ? ["max-height"] : e.startsWith("translate-x-") ? ["translate-x"] : e.startsWith("translate-y-") ? ["translate-y"] : e.startsWith("scale-") ? ["scale"] : e.startsWith("rotate-") ? ["rotate"] : e === "transform" ? ["transform"] : e.startsWith("grid-cols-") ? ["grid-template-columns"] : e.startsWith("col-span-") ? ["grid-column"] : e.startsWith("columns-") ? ["columns"] : e === "flex-col" || e === "flex-row" ? ["flex-direction"] : e === "flex-wrap" ? ["flex-wrap"] : e.startsWith("flex-") ? ["flex"] : e === "shrink" || e.startsWith("shrink-") ? ["flex-shrink"] : e === "grow" || e.startsWith("grow-") ? ["flex-grow"] : e.startsWith("items-") ? ["align-items"] : e.startsWith("justify-") ? ["justify-content"] : e.startsWith("gap-") ? ["gap"] : e.startsWith("space-y-") ? ["space-y"] : e.startsWith("overflow-y-") ? ["overflow-y"] : e.startsWith("overflow-x-") ? ["overflow-x"] : e.startsWith("overflow-") ? ["overflow-x", "overflow-y"] : e.startsWith("object-") ? ["object-fit"] : e.startsWith("aspect-") ? ["aspect-ratio"] : e.startsWith("cursor-") ? ["cursor"] : e.startsWith("opacity-") ? ["opacity"] : e.startsWith("shadow-") ? ["box-shadow"] : e === "ring" || /^ring-\d/.test(e) ? ["ring-width"] : e.startsWith("ring-offset-bg-") ? ["ring-offset-color"] : e.startsWith("ring-offset-") ? ["ring-offset-width"] : e.startsWith("ring-") ? ["ring-color"] : e.startsWith("outline-offset-") ? ["outline-offset"] : /^outline-\d/.test(e) ? ["outline-width"] : e === "outline" || e === "outline-none" ? ["outline-style"] : e.startsWith("outline-") ? ["outline-color"] : e.startsWith("transition-") || e === "transition" ? ["transition-property"] : e.startsWith("duration-") ? ["transition-duration"] : e.startsWith("ease-") ? ["transition-timing-function"] : e.startsWith("animate-") ? ["animation"] : e.startsWith("z-") ? ["z-index"] : e.startsWith("whitespace-") ? ["white-space"] : e.startsWith("break-inside-") ? ["break-inside"] : e.startsWith("break-") ? ["word-break"] : e.startsWith("line-clamp-") ? ["line-clamp"] : e === "list-inside" || e === "list-outside" ? ["list-style-position"] : e.startsWith("list-") ? ["list-style-type"] : e.startsWith("resize") ? ["resize"] : e.startsWith("select-") ? ["user-select"] : e.startsWith("pointer-events-") ? ["pointer-events"] : e.startsWith("appearance-") ? ["appearance"] : e.startsWith("accent-") ? ["accent-color"] : [];
|
|
414
|
+
}
|
|
415
|
+
function Pe(e) {
|
|
416
|
+
return Re(e, we);
|
|
414
417
|
}
|
|
415
418
|
function Fe(e) {
|
|
416
|
-
return
|
|
419
|
+
return Re(e, Te);
|
|
417
420
|
}
|
|
418
421
|
function Ie(e) {
|
|
419
|
-
return ze(e, Ee);
|
|
420
|
-
}
|
|
421
|
-
function Le(e) {
|
|
422
422
|
return e === "border" ? "border" : e.match(/^(border(?:-[xytrbl])?)(?=$|-(?:0|2|4|8|\[))/)?.[1];
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function Le(e) {
|
|
425
425
|
let t = e.match(/^(border-[xytrbl])-./);
|
|
426
426
|
return t ? t[1] : e.startsWith("border-") ? "border" : void 0;
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Re(e, t) {
|
|
429
429
|
return Object.keys(t).sort((e, t) => String(t).length - String(e).length).find((t) => {
|
|
430
430
|
let n = String(t);
|
|
431
431
|
return e === n || e.startsWith(`${n}-`);
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function ze(e, t) {
|
|
435
435
|
for (let n of e) if (!t.has(n)) return !1;
|
|
436
436
|
return !0;
|
|
437
437
|
}
|
|
438
438
|
//#endregion
|
|
439
439
|
//#region src/components/charts/DonutChart.tsx
|
|
440
|
-
var
|
|
440
|
+
var Be = {
|
|
441
441
|
"text-blue": "var(--blue)",
|
|
442
442
|
"text-green": "var(--green)",
|
|
443
443
|
"text-purple": "var(--purple)",
|
|
444
444
|
"text-yellow": "var(--yellow)",
|
|
445
445
|
"text-red": "var(--red)"
|
|
446
446
|
};
|
|
447
|
-
function
|
|
447
|
+
function Ve(e, t) {
|
|
448
448
|
let n = e.reduce((e, t) => e + t.value, 0), r = 0;
|
|
449
449
|
return e.map((e) => {
|
|
450
450
|
let i = n > 0 ? e.value / n * t : 0, a = t - i, o = r / t * 360 - 90, s = o + i / t * 180, c = n > 0 ? e.value / n * 100 : 0;
|
|
@@ -458,8 +458,8 @@ function He(e, t) {
|
|
|
458
458
|
};
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
let [n, r] = d(null), i = e.reduce((e, t) => e + t.value, 0), a = (t - 28) / 2, o =
|
|
461
|
+
function He({ segments: e, size: t = 180 }) {
|
|
462
|
+
let [n, r] = d(null), i = e.reduce((e, t) => e + t.value, 0), a = (t - 28) / 2, o = Ve(e, 2 * Math.PI * a), s = t + 12, c = s / 2;
|
|
463
463
|
return /* @__PURE__ */ m("div", {
|
|
464
464
|
className: "flex flex-col items-center gap-4",
|
|
465
465
|
children: [/* @__PURE__ */ m("div", {
|
|
@@ -491,7 +491,7 @@ function Ue({ segments: e, size: t = 180 }) {
|
|
|
491
491
|
cy: c,
|
|
492
492
|
r: a,
|
|
493
493
|
fill: "none",
|
|
494
|
-
stroke:
|
|
494
|
+
stroke: Be[e.segment.color] ?? "var(--accent)",
|
|
495
495
|
strokeWidth: r ? 32 : 28,
|
|
496
496
|
strokeDasharray: `${e.segmentLength} ${e.dashOffset}`,
|
|
497
497
|
strokeLinecap: "butt",
|
|
@@ -524,7 +524,7 @@ function Ue({ segments: e, size: t = 180 }) {
|
|
|
524
524
|
})
|
|
525
525
|
]
|
|
526
526
|
}), n !== null && (() => {
|
|
527
|
-
let e = o[n], t = e.midAngle * Math.PI / 180, r = a + 28 / 2 + 20, i = c + Math.cos(t) * r, s = c + Math.sin(t) * r, l =
|
|
527
|
+
let e = o[n], t = e.midAngle * Math.PI / 180, r = a + 28 / 2 + 20, i = c + Math.cos(t) * r, s = c + Math.sin(t) * r, l = Be[e.segment.color] ?? "var(--accent)";
|
|
528
528
|
return /* @__PURE__ */ p("div", {
|
|
529
529
|
className: "bg-bg-tertiary border-border pointer-events-none absolute z-10 rounded-md border px-2.5 py-1.5 shadow-lg",
|
|
530
530
|
style: {
|
|
@@ -565,11 +565,11 @@ function Ue({ segments: e, size: t = 180 }) {
|
|
|
565
565
|
type: "button",
|
|
566
566
|
onMouseEnter: () => r(t),
|
|
567
567
|
onMouseLeave: () => r(null),
|
|
568
|
-
className:
|
|
568
|
+
className: L("flex cursor-pointer items-center gap-1.5 transition-opacity duration-[100ms]", n !== null && n !== t && "opacity-50"),
|
|
569
569
|
children: [
|
|
570
570
|
/* @__PURE__ */ p("span", {
|
|
571
571
|
className: "h-2 w-2 rounded-full",
|
|
572
|
-
style: { backgroundColor:
|
|
572
|
+
style: { backgroundColor: Be[e.color] ?? "var(--accent)" }
|
|
573
573
|
}),
|
|
574
574
|
/* @__PURE__ */ p("span", {
|
|
575
575
|
className: "text-text-secondary text-xs",
|
|
@@ -586,8 +586,8 @@ function Ue({ segments: e, size: t = 180 }) {
|
|
|
586
586
|
}
|
|
587
587
|
//#endregion
|
|
588
588
|
//#region src/components/charts/RadarChart.tsx
|
|
589
|
-
var
|
|
590
|
-
function
|
|
589
|
+
var Ue = 4;
|
|
590
|
+
function We({ data: e, maxValue: t, size: n = 240 }) {
|
|
591
591
|
let [r, i] = d(null), a = t ?? Math.max(...e.map((e) => e.value)), o = n / 2, s = (n - 60) / 2, c = 2 * Math.PI / e.length;
|
|
592
592
|
function l(e, t) {
|
|
593
593
|
return [o + t * Math.cos(e - Math.PI / 2), o + t * Math.sin(e - Math.PI / 2)];
|
|
@@ -604,8 +604,8 @@ function Ge({ data: e, maxValue: t, size: n = 240 }) {
|
|
|
604
604
|
viewBox: `0 0 ${n} ${n}`,
|
|
605
605
|
className: "select-none",
|
|
606
606
|
children: [
|
|
607
|
-
Array.from({ length:
|
|
608
|
-
let r = (n + 1) /
|
|
607
|
+
Array.from({ length: Ue }, (t, n) => {
|
|
608
|
+
let r = (n + 1) / Ue * s;
|
|
609
609
|
return /* @__PURE__ */ p("polygon", {
|
|
610
610
|
points: e.map((e, t) => l(t * c, r)).map((e) => `${e[0]},${e[1]}`).join(" "),
|
|
611
611
|
fill: "none",
|
|
@@ -682,7 +682,7 @@ function Ge({ data: e, maxValue: t, size: n = 240 }) {
|
|
|
682
682
|
children: [
|
|
683
683
|
/* @__PURE__ */ p("span", { className: "bg-accent h-2 w-2 shrink-0 rounded-full" }),
|
|
684
684
|
/* @__PURE__ */ p("span", {
|
|
685
|
-
className:
|
|
685
|
+
className: L("text-text-secondary text-xs whitespace-nowrap"),
|
|
686
686
|
children: e[r].label
|
|
687
687
|
}),
|
|
688
688
|
/* @__PURE__ */ p("span", {
|
|
@@ -696,7 +696,7 @@ function Ge({ data: e, maxValue: t, size: n = 240 }) {
|
|
|
696
696
|
}
|
|
697
697
|
//#endregion
|
|
698
698
|
//#region src/components/charts/RadialBarChart.tsx
|
|
699
|
-
var
|
|
699
|
+
var Ge = {
|
|
700
700
|
"text-blue": "var(--blue)",
|
|
701
701
|
"text-green": "var(--green)",
|
|
702
702
|
"text-purple": "var(--purple)",
|
|
@@ -704,7 +704,7 @@ var Ke = {
|
|
|
704
704
|
"text-red": "var(--red)",
|
|
705
705
|
"text-accent": "var(--accent)"
|
|
706
706
|
};
|
|
707
|
-
function
|
|
707
|
+
function Ke({ segments: e, size: t = 200 }) {
|
|
708
708
|
let [n, r] = d(null), [i, a] = d({
|
|
709
709
|
x: 0,
|
|
710
710
|
y: 0
|
|
@@ -730,7 +730,7 @@ function qe({ segments: e, size: t = 200 }) {
|
|
|
730
730
|
children: [e.map((e, t) => {
|
|
731
731
|
let i = c - t * 20;
|
|
732
732
|
if (i <= 0) return null;
|
|
733
|
-
let a = 2 * Math.PI * i, o = a * Math.min(e.value / e.max, 1), l = a - o, u =
|
|
733
|
+
let a = 2 * Math.PI * i, o = a * Math.min(e.value / e.max, 1), l = a - o, u = Ge[e.color] ?? "var(--accent)", d = n === t;
|
|
734
734
|
return /* @__PURE__ */ m("g", {
|
|
735
735
|
onMouseEnter: () => r(t),
|
|
736
736
|
onMouseLeave: () => r(null),
|
|
@@ -771,7 +771,7 @@ function qe({ segments: e, size: t = 200 }) {
|
|
|
771
771
|
});
|
|
772
772
|
})()]
|
|
773
773
|
}), n !== null && (() => {
|
|
774
|
-
let t = e[n], r = Math.round(t.value / t.max * 100), a =
|
|
774
|
+
let t = e[n], r = Math.round(t.value / t.max * 100), a = Ge[t.color] ?? "var(--accent)";
|
|
775
775
|
return /* @__PURE__ */ p("div", {
|
|
776
776
|
className: "bg-bg-tertiary border-border pointer-events-none absolute z-10 rounded-md border px-2.5 py-1.5 shadow-lg",
|
|
777
777
|
style: {
|
|
@@ -816,11 +816,11 @@ function qe({ segments: e, size: t = 200 }) {
|
|
|
816
816
|
type: "button",
|
|
817
817
|
onMouseEnter: () => r(t),
|
|
818
818
|
onMouseLeave: () => r(null),
|
|
819
|
-
className:
|
|
819
|
+
className: L("flex cursor-pointer items-center gap-1.5 transition-opacity duration-[100ms]", n !== null && n !== t && "opacity-50"),
|
|
820
820
|
children: [
|
|
821
821
|
/* @__PURE__ */ p("span", {
|
|
822
822
|
className: "h-2 w-2 rounded-full",
|
|
823
|
-
style: { backgroundColor:
|
|
823
|
+
style: { backgroundColor: Ge[e.color] ?? "var(--accent)" }
|
|
824
824
|
}),
|
|
825
825
|
/* @__PURE__ */ p("span", {
|
|
826
826
|
className: "text-text-secondary text-xs",
|
|
@@ -838,7 +838,7 @@ function qe({ segments: e, size: t = 200 }) {
|
|
|
838
838
|
}
|
|
839
839
|
//#endregion
|
|
840
840
|
//#region src/components/charts/SparkLine.tsx
|
|
841
|
-
function
|
|
841
|
+
function qe({ data: e, width: t = 60, height: n = 20, color: r }) {
|
|
842
842
|
if (e.length < 2) return null;
|
|
843
843
|
let i = Math.min(...e), a = Math.max(...e) - i || 1, o = e.map((r, o) => `${o / (e.length - 1) * t},${n - (r - i) / a * (n - 2) - 1}`).join(" ");
|
|
844
844
|
return /* @__PURE__ */ p("svg", {
|
|
@@ -858,7 +858,7 @@ function Je({ data: e, width: t = 60, height: n = 20, color: r }) {
|
|
|
858
858
|
}
|
|
859
859
|
//#endregion
|
|
860
860
|
//#region src/components/charts/VerticalBarChart.tsx
|
|
861
|
-
var
|
|
861
|
+
var Je = [
|
|
862
862
|
1,
|
|
863
863
|
.85,
|
|
864
864
|
.7,
|
|
@@ -866,33 +866,33 @@ var Ye = [
|
|
|
866
866
|
.45,
|
|
867
867
|
.35,
|
|
868
868
|
.25
|
|
869
|
-
],
|
|
869
|
+
], R = {
|
|
870
870
|
top: 20,
|
|
871
871
|
right: 8,
|
|
872
872
|
bottom: 24,
|
|
873
873
|
left: 40
|
|
874
874
|
};
|
|
875
|
-
function
|
|
875
|
+
function Ye(e) {
|
|
876
876
|
return e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : String(e);
|
|
877
877
|
}
|
|
878
|
-
function
|
|
879
|
-
let [n, r] = d(null), i = 600 -
|
|
878
|
+
function Xe({ data: e, height: t = 180 }) {
|
|
879
|
+
let [n, r] = d(null), i = 600 - R.left - R.right, a = t - R.top - R.bottom, o = Math.max(...e.map((e) => e.value), 1), s = Math.max(4, (i - 6 * (e.length - 1)) / e.length);
|
|
880
880
|
return /* @__PURE__ */ m("svg", {
|
|
881
881
|
width: "100%",
|
|
882
882
|
viewBox: `0 0 600 ${t}`,
|
|
883
883
|
className: "select-none",
|
|
884
884
|
children: [
|
|
885
885
|
/* @__PURE__ */ p("text", {
|
|
886
|
-
x:
|
|
887
|
-
y:
|
|
886
|
+
x: R.left - 6,
|
|
887
|
+
y: R.top + 4,
|
|
888
888
|
textAnchor: "end",
|
|
889
889
|
fill: "var(--text-tertiary)",
|
|
890
890
|
fontSize: 10,
|
|
891
|
-
children:
|
|
891
|
+
children: Ye(o)
|
|
892
892
|
}),
|
|
893
893
|
/* @__PURE__ */ p("text", {
|
|
894
|
-
x:
|
|
895
|
-
y:
|
|
894
|
+
x: R.left - 6,
|
|
895
|
+
y: R.top + a,
|
|
896
896
|
textAnchor: "end",
|
|
897
897
|
dominantBaseline: "central",
|
|
898
898
|
fill: "var(--text-tertiary)",
|
|
@@ -900,32 +900,32 @@ function Ze({ data: e, height: t = 180 }) {
|
|
|
900
900
|
children: "0"
|
|
901
901
|
}),
|
|
902
902
|
/* @__PURE__ */ p("line", {
|
|
903
|
-
x1:
|
|
904
|
-
y1:
|
|
905
|
-
x2:
|
|
906
|
-
y2:
|
|
903
|
+
x1: R.left,
|
|
904
|
+
y1: R.top + a,
|
|
905
|
+
x2: R.left + i,
|
|
906
|
+
y2: R.top + a,
|
|
907
907
|
stroke: "var(--border)",
|
|
908
908
|
strokeWidth: 1
|
|
909
909
|
}),
|
|
910
910
|
/* @__PURE__ */ p("line", {
|
|
911
|
-
x1:
|
|
912
|
-
y1:
|
|
913
|
-
x2:
|
|
914
|
-
y2:
|
|
911
|
+
x1: R.left,
|
|
912
|
+
y1: R.top + a / 2,
|
|
913
|
+
x2: R.left + i,
|
|
914
|
+
y2: R.top + a / 2,
|
|
915
915
|
stroke: "var(--border)",
|
|
916
916
|
strokeWidth: 1,
|
|
917
917
|
strokeDasharray: "3 3",
|
|
918
918
|
opacity: .5
|
|
919
919
|
}),
|
|
920
920
|
e.map((e, i) => {
|
|
921
|
-
let c =
|
|
921
|
+
let c = R.left + i * (s + 6), l = e.value / o * a, u = R.top + a - l, d = n === i;
|
|
922
922
|
return /* @__PURE__ */ m("g", {
|
|
923
923
|
onMouseEnter: () => r(i),
|
|
924
924
|
onMouseLeave: () => r(null),
|
|
925
925
|
children: [
|
|
926
926
|
/* @__PURE__ */ p("rect", {
|
|
927
927
|
x: c,
|
|
928
|
-
y:
|
|
928
|
+
y: R.top,
|
|
929
929
|
width: s,
|
|
930
930
|
height: a,
|
|
931
931
|
fill: "transparent"
|
|
@@ -937,7 +937,7 @@ function Ze({ data: e, height: t = 180 }) {
|
|
|
937
937
|
height: l,
|
|
938
938
|
fill: e.color ?? "var(--accent)",
|
|
939
939
|
rx: 6,
|
|
940
|
-
opacity: d ? 1 :
|
|
940
|
+
opacity: d ? 1 : Je[i % Je.length],
|
|
941
941
|
style: { transition: "all 150ms" }
|
|
942
942
|
}),
|
|
943
943
|
/* @__PURE__ */ p("text", {
|
|
@@ -965,17 +965,17 @@ function Ze({ data: e, height: t = 180 }) {
|
|
|
965
965
|
}
|
|
966
966
|
//#endregion
|
|
967
967
|
//#region src/components/app-shell/navigation.ts
|
|
968
|
-
function
|
|
968
|
+
function Ze(e, t) {
|
|
969
969
|
if (!t) return !1;
|
|
970
970
|
if (e.end ?? e.path === "/") return t === e.path;
|
|
971
971
|
let n = e.path.endsWith("/") ? e.path : `${e.path}/`;
|
|
972
972
|
return t === e.path || t.startsWith(n);
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function z(e, t, n, r) {
|
|
975
975
|
let i = e.currentTarget.getAttribute("target");
|
|
976
976
|
e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || i && i !== "_self" || (n && (e.preventDefault(), n(t)), r?.());
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function Qe(e, t) {
|
|
979
979
|
if (t) {
|
|
980
980
|
t(e);
|
|
981
981
|
return;
|
|
@@ -986,17 +986,17 @@ function z(e, t) {
|
|
|
986
986
|
//#region src/components/app-shell/BottomNav.tsx
|
|
987
987
|
function $e({ items: e, currentPath: t, onNavigate: n, className: r }) {
|
|
988
988
|
return e.length === 0 ? null : /* @__PURE__ */ p("nav", {
|
|
989
|
-
className:
|
|
989
|
+
className: L("bg-bg-secondary border-border font-navigation fixed right-0 bottom-0 left-0 z-30 border-t md:hidden", r),
|
|
990
990
|
style: { height: "var(--bottomnav-height)" },
|
|
991
991
|
children: /* @__PURE__ */ p("ul", {
|
|
992
992
|
className: "flex h-full items-center justify-around",
|
|
993
993
|
children: e.map((e) => {
|
|
994
|
-
let r =
|
|
994
|
+
let r = Ze(e, t);
|
|
995
995
|
return /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m("a", {
|
|
996
996
|
href: e.path,
|
|
997
|
-
onClick: (t) =>
|
|
997
|
+
onClick: (t) => z(t, e.path, n),
|
|
998
998
|
"aria-current": r ? "page" : void 0,
|
|
999
|
-
className:
|
|
999
|
+
className: L("font-navigation flex h-full w-14 flex-col items-center justify-center gap-0.5", "cursor-pointer transition-colors duration-[100ms]", r ? "text-accent" : "text-text-tertiary"),
|
|
1000
1000
|
children: [/* @__PURE__ */ p(e.icon, { className: "h-5 w-5" }), /* @__PURE__ */ p("span", {
|
|
1001
1001
|
className: "text-2xs",
|
|
1002
1002
|
children: e.shortLabel ?? e.label
|
|
@@ -1013,18 +1013,19 @@ function B(e, t) {
|
|
|
1013
1013
|
let n = u(null);
|
|
1014
1014
|
o(() => {
|
|
1015
1015
|
if (!t || !e.current) return;
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1016
|
+
let r = e.current.ownerDocument;
|
|
1017
|
+
n.current = r.activeElement;
|
|
1018
|
+
let i = e.current.querySelectorAll(et);
|
|
1019
|
+
i.length > 0 && i[0].focus();
|
|
1020
|
+
let a = (t) => {
|
|
1020
1021
|
if (t.key !== "Tab" || !e.current) return;
|
|
1021
1022
|
let n = e.current.querySelectorAll(et);
|
|
1022
1023
|
if (n.length === 0) return;
|
|
1023
|
-
let
|
|
1024
|
-
t.shiftKey ?
|
|
1024
|
+
let i = n[0], a = n[n.length - 1];
|
|
1025
|
+
t.shiftKey ? r.activeElement === i && (t.preventDefault(), a.focus()) : r.activeElement === a && (t.preventDefault(), i.focus());
|
|
1025
1026
|
};
|
|
1026
|
-
return
|
|
1027
|
-
|
|
1027
|
+
return r.addEventListener("keydown", a), () => {
|
|
1028
|
+
r.removeEventListener("keydown", a), n.current instanceof HTMLElement && n.current.focus();
|
|
1028
1029
|
};
|
|
1029
1030
|
}, [t, e]);
|
|
1030
1031
|
}
|
|
@@ -1078,7 +1079,7 @@ function ot({ items: e, eventName: t = tt, shortcut: n = nt, placeholder: r = "S
|
|
|
1078
1079
|
_(e), y(0);
|
|
1079
1080
|
}
|
|
1080
1081
|
function E(e) {
|
|
1081
|
-
l?.(e),
|
|
1082
|
+
l?.(e), Qe(e.path, c), h(!1);
|
|
1082
1083
|
}
|
|
1083
1084
|
function D(e) {
|
|
1084
1085
|
e.key === "ArrowDown" ? (e.preventDefault(), y((e) => Math.min(e + 1, C.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), y((e) => Math.max(e - 1, 0))) : e.key === "Enter" && C[v] ? E(C[v]) : e.key === "Escape" && h(!1);
|
|
@@ -1095,7 +1096,7 @@ function ot({ items: e, eventName: t = tt, shortcut: n = nt, placeholder: r = "S
|
|
|
1095
1096
|
children: [/* @__PURE__ */ m("div", {
|
|
1096
1097
|
className: "border-border flex items-center gap-3 border-b px-4",
|
|
1097
1098
|
children: [
|
|
1098
|
-
/* @__PURE__ */ p(
|
|
1099
|
+
/* @__PURE__ */ p(N, { className: "text-text-tertiary h-4 w-4 shrink-0" }),
|
|
1099
1100
|
/* @__PURE__ */ p("input", {
|
|
1100
1101
|
ref: b,
|
|
1101
1102
|
type: "text",
|
|
@@ -1128,7 +1129,7 @@ function ot({ items: e, eventName: t = tt, shortcut: n = nt, placeholder: r = "S
|
|
|
1128
1129
|
role: "option",
|
|
1129
1130
|
"aria-selected": t === v,
|
|
1130
1131
|
onClick: () => E(e),
|
|
1131
|
-
className:
|
|
1132
|
+
className: L("flex h-9 w-full cursor-pointer items-center gap-3 rounded-md px-3 text-left", "transition-colors duration-[100ms]", t === v ? "bg-accent-muted text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
1132
1133
|
children: [/* @__PURE__ */ p("span", {
|
|
1133
1134
|
className: "shrink-0 opacity-60",
|
|
1134
1135
|
children: /* @__PURE__ */ p(e.icon, { className: "h-4 w-4" })
|
|
@@ -1160,9 +1161,9 @@ function ct({ open: e, onClose: t, items: n, brand: r, currentPath: i, onNavigat
|
|
|
1160
1161
|
document.body.style.overflow = "hidden";
|
|
1161
1162
|
let n = (e) => {
|
|
1162
1163
|
e.key === "Escape" && t();
|
|
1163
|
-
};
|
|
1164
|
-
return
|
|
1165
|
-
document.body.style.overflow = "",
|
|
1164
|
+
}, r = c.current?.ownerDocument ?? document;
|
|
1165
|
+
return r.addEventListener("keydown", n), () => {
|
|
1166
|
+
document.body.style.overflow = "", r.removeEventListener("keydown", n);
|
|
1166
1167
|
};
|
|
1167
1168
|
}, [e, t]), e ? /* @__PURE__ */ m("div", {
|
|
1168
1169
|
className: "fixed inset-0 z-40 md:hidden",
|
|
@@ -1171,26 +1172,26 @@ function ct({ open: e, onClose: t, items: n, brand: r, currentPath: i, onNavigat
|
|
|
1171
1172
|
onClick: t
|
|
1172
1173
|
}), /* @__PURE__ */ m("div", {
|
|
1173
1174
|
ref: c,
|
|
1174
|
-
className:
|
|
1175
|
+
className: L("bg-bg-sidebar border-border animate-slide-in-left fixed inset-y-0 left-0 z-50 flex w-64 flex-col border-r", s),
|
|
1175
1176
|
children: [/* @__PURE__ */ m("div", {
|
|
1176
1177
|
className: "border-border flex h-11 items-center justify-between border-b px-4",
|
|
1177
1178
|
children: [/* @__PURE__ */ p(st, { brand: r }), /* @__PURE__ */ p("button", {
|
|
1178
1179
|
onClick: t,
|
|
1179
1180
|
className: "text-text-tertiary hover:text-text-primary flex h-7 w-7 cursor-pointer items-center justify-center rounded",
|
|
1180
1181
|
"aria-label": "Close menu",
|
|
1181
|
-
children: /* @__PURE__ */ p(
|
|
1182
|
+
children: /* @__PURE__ */ p(P, { className: "h-4 w-4" })
|
|
1182
1183
|
})]
|
|
1183
1184
|
}), /* @__PURE__ */ p("nav", {
|
|
1184
1185
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 py-2",
|
|
1185
1186
|
children: /* @__PURE__ */ p("ul", {
|
|
1186
1187
|
className: "space-y-0.5",
|
|
1187
1188
|
children: n.map((e) => {
|
|
1188
|
-
let n =
|
|
1189
|
+
let n = Ze(e, i);
|
|
1189
1190
|
return /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m("a", {
|
|
1190
1191
|
href: e.path,
|
|
1191
|
-
onClick: (n) =>
|
|
1192
|
+
onClick: (n) => z(n, e.path, a, t),
|
|
1192
1193
|
"aria-current": n ? "page" : void 0,
|
|
1193
|
-
className:
|
|
1194
|
+
className: L("flex h-10 items-center gap-3 rounded-md px-3", "cursor-pointer transition-colors duration-[100ms]", n ? "bg-accent-muted text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
1194
1195
|
children: [/* @__PURE__ */ p(e.icon, { className: "h-4 w-4" }), /* @__PURE__ */ p("span", {
|
|
1195
1196
|
className: "text-sm",
|
|
1196
1197
|
children: e.label
|
|
@@ -1208,7 +1209,7 @@ var lt = [
|
|
|
1208
1209
|
{
|
|
1209
1210
|
value: "dark",
|
|
1210
1211
|
label: "Dark",
|
|
1211
|
-
icon:
|
|
1212
|
+
icon: M,
|
|
1212
1213
|
preview: {
|
|
1213
1214
|
bg: "#0d0f12",
|
|
1214
1215
|
fg: "#2a2e38"
|
|
@@ -1217,7 +1218,7 @@ var lt = [
|
|
|
1217
1218
|
{
|
|
1218
1219
|
value: "light",
|
|
1219
1220
|
label: "Light",
|
|
1220
|
-
icon:
|
|
1221
|
+
icon: ue,
|
|
1221
1222
|
preview: {
|
|
1222
1223
|
bg: "#f5f5f5",
|
|
1223
1224
|
fg: "#d4d4d8"
|
|
@@ -1226,7 +1227,7 @@ var lt = [
|
|
|
1226
1227
|
{
|
|
1227
1228
|
value: "monokai",
|
|
1228
1229
|
label: "Monokai",
|
|
1229
|
-
icon:
|
|
1230
|
+
icon: oe,
|
|
1230
1231
|
preview: {
|
|
1231
1232
|
bg: "#272822",
|
|
1232
1233
|
fg: "#3E3D32"
|
|
@@ -1235,7 +1236,7 @@ var lt = [
|
|
|
1235
1236
|
{
|
|
1236
1237
|
value: "solarized",
|
|
1237
1238
|
label: "Solarized",
|
|
1238
|
-
icon:
|
|
1239
|
+
icon: j,
|
|
1239
1240
|
preview: {
|
|
1240
1241
|
bg: "#002B36",
|
|
1241
1242
|
fg: "#0A3F4C"
|
|
@@ -1244,7 +1245,7 @@ var lt = [
|
|
|
1244
1245
|
{
|
|
1245
1246
|
value: "cyberBrutalDark",
|
|
1246
1247
|
label: "Cyber Brutal Dark",
|
|
1247
|
-
icon:
|
|
1248
|
+
icon: pe,
|
|
1248
1249
|
preview: {
|
|
1249
1250
|
bg: "#050505",
|
|
1250
1251
|
fg: "#18181b"
|
|
@@ -1253,7 +1254,7 @@ var lt = [
|
|
|
1253
1254
|
{
|
|
1254
1255
|
value: "cyberBrutalLight",
|
|
1255
1256
|
label: "Cyber Brutal Light",
|
|
1256
|
-
icon:
|
|
1257
|
+
icon: pe,
|
|
1257
1258
|
preview: {
|
|
1258
1259
|
bg: "#e4e4e7",
|
|
1259
1260
|
fg: "#d4d4d8"
|
|
@@ -1276,7 +1277,7 @@ var lt = [
|
|
|
1276
1277
|
function V(e) {
|
|
1277
1278
|
return ut.has(e);
|
|
1278
1279
|
}
|
|
1279
|
-
var dt = lt.filter((e) => V(e.value)), ft = lt.filter((e) => !V(e.value)),
|
|
1280
|
+
var dt = lt.filter((e) => V(e.value)), ft = lt.filter((e) => !V(e.value)), pt = {
|
|
1280
1281
|
uiFont: "inter",
|
|
1281
1282
|
headingFont: "inter",
|
|
1282
1283
|
proseFont: "inter",
|
|
@@ -1291,7 +1292,7 @@ var dt = lt.filter((e) => V(e.value)), ft = lt.filter((e) => !V(e.value)), H = {
|
|
|
1291
1292
|
tracking: .05,
|
|
1292
1293
|
lineHeight: 1.45,
|
|
1293
1294
|
density: .25
|
|
1294
|
-
},
|
|
1295
|
+
}, mt = {
|
|
1295
1296
|
uiFont: "jetbrains-mono",
|
|
1296
1297
|
headingFont: "jetbrains-mono",
|
|
1297
1298
|
proseFont: "jetbrains-mono",
|
|
@@ -1306,13 +1307,13 @@ var dt = lt.filter((e) => V(e.value)), ft = lt.filter((e) => !V(e.value)), H = {
|
|
|
1306
1307
|
tracking: .2,
|
|
1307
1308
|
lineHeight: 1.4,
|
|
1308
1309
|
density: .22
|
|
1309
|
-
},
|
|
1310
|
-
dark:
|
|
1311
|
-
light:
|
|
1312
|
-
monokai:
|
|
1313
|
-
solarized:
|
|
1314
|
-
cyberBrutalDark:
|
|
1315
|
-
cyberBrutalLight:
|
|
1310
|
+
}, H = {
|
|
1311
|
+
dark: pt,
|
|
1312
|
+
light: pt,
|
|
1313
|
+
monokai: pt,
|
|
1314
|
+
solarized: pt,
|
|
1315
|
+
cyberBrutalDark: mt,
|
|
1316
|
+
cyberBrutalLight: mt,
|
|
1316
1317
|
hashiTheme: {
|
|
1317
1318
|
uiFont: "inter",
|
|
1318
1319
|
headingFont: "archivo-expanded",
|
|
@@ -1329,7 +1330,7 @@ var dt = lt.filter((e) => V(e.value)), ft = lt.filter((e) => !V(e.value)), H = {
|
|
|
1329
1330
|
lineHeight: 1.45,
|
|
1330
1331
|
density: .25
|
|
1331
1332
|
}
|
|
1332
|
-
},
|
|
1333
|
+
}, U = [
|
|
1333
1334
|
{
|
|
1334
1335
|
value: "archivo-expanded",
|
|
1335
1336
|
label: "Archivo Expanded"
|
|
@@ -1386,28 +1387,30 @@ var dt = lt.filter((e) => V(e.value)), ft = lt.filter((e) => !V(e.value)), H = {
|
|
|
1386
1387
|
];
|
|
1387
1388
|
//#endregion
|
|
1388
1389
|
//#region src/hooks/useDismiss.ts
|
|
1389
|
-
function W(e, t, n, r) {
|
|
1390
|
+
function W(e, t, n, r, i) {
|
|
1391
|
+
let a = i?.outsideClick ?? !0;
|
|
1390
1392
|
o(() => {
|
|
1391
1393
|
if (!e) return;
|
|
1392
1394
|
let i = (e) => {
|
|
1393
1395
|
let i = e.target;
|
|
1394
1396
|
r?.some((e) => e.current?.contains(i)) || n.every((e) => e.current && !e.current.contains(i)) && t();
|
|
1395
|
-
},
|
|
1397
|
+
}, o = (e) => {
|
|
1396
1398
|
e.key === "Escape" && t();
|
|
1397
1399
|
};
|
|
1398
|
-
return document.addEventListener("mousedown", i), document.addEventListener("keydown",
|
|
1399
|
-
document.removeEventListener("mousedown", i), document.removeEventListener("keydown",
|
|
1400
|
+
return a && document.addEventListener("mousedown", i), document.addEventListener("keydown", o), () => {
|
|
1401
|
+
a && document.removeEventListener("mousedown", i), document.removeEventListener("keydown", o);
|
|
1400
1402
|
};
|
|
1401
1403
|
}, [
|
|
1402
1404
|
e,
|
|
1403
1405
|
t,
|
|
1404
1406
|
n,
|
|
1405
|
-
r
|
|
1407
|
+
r,
|
|
1408
|
+
a
|
|
1406
1409
|
]);
|
|
1407
1410
|
}
|
|
1408
1411
|
//#endregion
|
|
1409
1412
|
//#region src/providers/SettingsContext.ts
|
|
1410
|
-
var
|
|
1413
|
+
var gt = n({
|
|
1411
1414
|
fontSize: 15,
|
|
1412
1415
|
setFontSize: () => {},
|
|
1413
1416
|
accentColor: "purple",
|
|
@@ -1458,44 +1461,44 @@ var G = n({
|
|
|
1458
1461
|
});
|
|
1459
1462
|
//#endregion
|
|
1460
1463
|
//#region src/hooks/useSettings.ts
|
|
1461
|
-
function
|
|
1462
|
-
return a(
|
|
1464
|
+
function G() {
|
|
1465
|
+
return a(gt);
|
|
1463
1466
|
}
|
|
1464
1467
|
//#endregion
|
|
1465
1468
|
//#region src/components/ui/Avatar.tsx
|
|
1466
|
-
var
|
|
1469
|
+
var _t = {
|
|
1467
1470
|
xs: "w-5 h-5 text-2xs",
|
|
1468
1471
|
sm: "w-7 h-7 text-2xs",
|
|
1469
1472
|
md: "w-10 h-10 text-xs",
|
|
1470
1473
|
lg: "w-16 h-16 text-lg"
|
|
1471
1474
|
};
|
|
1472
|
-
function
|
|
1475
|
+
function vt(e) {
|
|
1473
1476
|
return e.split(" ").map((e) => e[0]).join("").toUpperCase().slice(0, 2);
|
|
1474
1477
|
}
|
|
1475
|
-
function
|
|
1478
|
+
function yt(e) {
|
|
1476
1479
|
let t = 0;
|
|
1477
1480
|
for (let n = 0; n < e.length; n++) t = e.charCodeAt(n) + ((t << 5) - t);
|
|
1478
1481
|
return `hsl(${Math.abs(t) % 360}, 50%, 40%)`;
|
|
1479
1482
|
}
|
|
1480
|
-
function
|
|
1483
|
+
function K({ name: e, src: t, size: n = "md", className: r }) {
|
|
1481
1484
|
return /* @__PURE__ */ p("div", {
|
|
1482
|
-
className:
|
|
1483
|
-
style: { backgroundColor: t ? void 0 :
|
|
1485
|
+
className: L("text-text-on-avatar flex shrink-0 items-center justify-center rounded-full font-semibold", _t[n], r),
|
|
1486
|
+
style: { backgroundColor: t ? void 0 : yt(e) },
|
|
1484
1487
|
"aria-label": e,
|
|
1485
1488
|
children: t ? /* @__PURE__ */ p("img", {
|
|
1486
1489
|
src: t,
|
|
1487
1490
|
alt: e,
|
|
1488
1491
|
className: "h-full w-full rounded-full object-cover"
|
|
1489
|
-
}) :
|
|
1492
|
+
}) : vt(e)
|
|
1490
1493
|
});
|
|
1491
1494
|
}
|
|
1492
1495
|
//#endregion
|
|
1493
1496
|
//#region src/components/ui/Toast.tsx
|
|
1494
|
-
var
|
|
1495
|
-
function
|
|
1496
|
-
return a(
|
|
1497
|
+
var bt = n({ toast: () => {} });
|
|
1498
|
+
function xt() {
|
|
1499
|
+
return a(bt);
|
|
1497
1500
|
}
|
|
1498
|
-
function
|
|
1501
|
+
function St({ children: e }) {
|
|
1499
1502
|
let [t, n] = d([]), r = u(0), a = i((e, t, i = 4e3) => {
|
|
1500
1503
|
let a = r.current++;
|
|
1501
1504
|
n((n) => [...n, {
|
|
@@ -1507,36 +1510,36 @@ function xt({ children: e }) {
|
|
|
1507
1510
|
}, []), o = i((e) => {
|
|
1508
1511
|
n((t) => t.filter((t) => t.id !== e));
|
|
1509
1512
|
}, []);
|
|
1510
|
-
return /* @__PURE__ */ m(
|
|
1513
|
+
return /* @__PURE__ */ m(bt.Provider, {
|
|
1511
1514
|
value: { toast: a },
|
|
1512
1515
|
children: [e, /* @__PURE__ */ p("div", {
|
|
1513
1516
|
className: "pointer-events-none fixed top-3 right-3 z-[100] flex flex-col gap-2",
|
|
1514
1517
|
"aria-live": "polite",
|
|
1515
|
-
children: t.map((e) => /* @__PURE__ */ p(
|
|
1518
|
+
children: t.map((e) => /* @__PURE__ */ p(Et, {
|
|
1516
1519
|
toast: e,
|
|
1517
1520
|
onDismiss: () => o(e.id)
|
|
1518
1521
|
}, e.id))
|
|
1519
1522
|
})]
|
|
1520
1523
|
});
|
|
1521
1524
|
}
|
|
1522
|
-
var
|
|
1525
|
+
var Ct = {
|
|
1523
1526
|
success: C,
|
|
1524
|
-
error:
|
|
1527
|
+
error: fe,
|
|
1525
1528
|
warning: g,
|
|
1526
|
-
info:
|
|
1527
|
-
},
|
|
1529
|
+
info: te
|
|
1530
|
+
}, wt = {
|
|
1528
1531
|
success: "bg-green",
|
|
1529
1532
|
error: "bg-red",
|
|
1530
1533
|
warning: "bg-yellow",
|
|
1531
1534
|
info: "bg-blue"
|
|
1532
|
-
},
|
|
1535
|
+
}, Tt = {
|
|
1533
1536
|
success: "text-green",
|
|
1534
1537
|
error: "text-red",
|
|
1535
1538
|
warning: "text-yellow",
|
|
1536
1539
|
info: "text-blue"
|
|
1537
1540
|
};
|
|
1538
|
-
function
|
|
1539
|
-
let [n, r] = d(100), i =
|
|
1541
|
+
function Et({ toast: e, onDismiss: t }) {
|
|
1542
|
+
let [n, r] = d(100), i = Ct[e.type], a = e.type === "error" || e.type === "warning", s = u(t);
|
|
1540
1543
|
return o(() => {
|
|
1541
1544
|
s.current = t;
|
|
1542
1545
|
}, [t]), o(() => {
|
|
@@ -1550,11 +1553,11 @@ function Tt({ toast: e, onDismiss: t }) {
|
|
|
1550
1553
|
"aria-live": a ? "assertive" : "polite",
|
|
1551
1554
|
className: "bg-bg-secondary border-border animate-slide-down pointer-events-auto relative w-80 overflow-hidden rounded-lg border shadow-lg",
|
|
1552
1555
|
children: [
|
|
1553
|
-
/* @__PURE__ */ p("div", { className:
|
|
1556
|
+
/* @__PURE__ */ p("div", { className: L("absolute top-1.5 bottom-1.5 left-0 w-[3px] rounded-md", wt[e.type]) }),
|
|
1554
1557
|
/* @__PURE__ */ m("div", {
|
|
1555
1558
|
className: "flex items-center gap-2.5 p-3 pl-3.5",
|
|
1556
1559
|
children: [
|
|
1557
|
-
/* @__PURE__ */ p(i, { className:
|
|
1560
|
+
/* @__PURE__ */ p(i, { className: L("h-4 w-4 shrink-0", Tt[e.type]) }),
|
|
1558
1561
|
/* @__PURE__ */ p("p", {
|
|
1559
1562
|
className: "text-text-primary flex-1 text-xs",
|
|
1560
1563
|
children: e.message
|
|
@@ -1562,7 +1565,7 @@ function Tt({ toast: e, onDismiss: t }) {
|
|
|
1562
1565
|
/* @__PURE__ */ p("button", {
|
|
1563
1566
|
onClick: t,
|
|
1564
1567
|
className: "text-text-tertiary hover:text-text-primary flex h-5 w-5 cursor-pointer items-center justify-center rounded",
|
|
1565
|
-
children: /* @__PURE__ */ p(
|
|
1568
|
+
children: /* @__PURE__ */ p(P, { className: "h-3 w-3" })
|
|
1566
1569
|
})
|
|
1567
1570
|
]
|
|
1568
1571
|
}),
|
|
@@ -1578,14 +1581,14 @@ function Tt({ toast: e, onDismiss: t }) {
|
|
|
1578
1581
|
}
|
|
1579
1582
|
//#endregion
|
|
1580
1583
|
//#region src/components/app-shell/Sidebar.tsx
|
|
1581
|
-
var
|
|
1582
|
-
function
|
|
1583
|
-
let i =
|
|
1584
|
+
var Dt = 140, Ot = 400, kt = 48;
|
|
1585
|
+
function At({ item: e, collapsed: t, currentPath: n, onNavigate: r }) {
|
|
1586
|
+
let i = Ze(e, n);
|
|
1584
1587
|
return /* @__PURE__ */ m("a", {
|
|
1585
1588
|
href: e.path,
|
|
1586
|
-
onClick: (t) =>
|
|
1589
|
+
onClick: (t) => z(t, e.path, r),
|
|
1587
1590
|
"aria-current": i ? "page" : void 0,
|
|
1588
|
-
className:
|
|
1591
|
+
className: L("font-navigation relative flex items-center gap-2 rounded px-2", "cursor-pointer transition-colors duration-[100ms]", t ? "mx-auto w-[2em] justify-center" : "", i ? "bg-accent-muted text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
1589
1592
|
style: { height: "2em" },
|
|
1590
1593
|
title: t ? e.label : void 0,
|
|
1591
1594
|
children: [
|
|
@@ -1607,13 +1610,13 @@ function kt({ item: e, collapsed: t, currentPath: n, onNavigate: r }) {
|
|
|
1607
1610
|
]
|
|
1608
1611
|
});
|
|
1609
1612
|
}
|
|
1610
|
-
function
|
|
1613
|
+
function jt({ brand: e, collapsed: t }) {
|
|
1611
1614
|
let n = e.icon, r = e.name.trim().charAt(0).toUpperCase();
|
|
1612
1615
|
return e.logo && !t ? /* @__PURE__ */ p("div", {
|
|
1613
1616
|
className: "flex min-w-0 items-center gap-2 px-2",
|
|
1614
1617
|
children: e.logo
|
|
1615
1618
|
}) : /* @__PURE__ */ m("div", {
|
|
1616
|
-
className:
|
|
1619
|
+
className: L("flex min-w-0 items-center gap-2 px-2", t && "mx-auto justify-center px-0"),
|
|
1617
1620
|
children: [n ? /* @__PURE__ */ p(n, { className: "text-accent h-3.5 w-3.5 shrink-0" }) : t && r && /* @__PURE__ */ p("span", {
|
|
1618
1621
|
className: "text-accent shrink-0 text-xs font-bold",
|
|
1619
1622
|
children: r
|
|
@@ -1623,10 +1626,10 @@ function At({ brand: e, collapsed: t }) {
|
|
|
1623
1626
|
})]
|
|
1624
1627
|
});
|
|
1625
1628
|
}
|
|
1626
|
-
function
|
|
1629
|
+
function Mt(e) {
|
|
1627
1630
|
return e.role ?? e.email;
|
|
1628
1631
|
}
|
|
1629
|
-
function
|
|
1632
|
+
function Nt({ collapsed: e, accounts: t, initialAccountIndex: n = 0, onAccountChange: r, onSignOut: a, signOutPath: o, signOutLabel: s = "Sign out", onNavigate: c }) {
|
|
1630
1633
|
let [l, h] = d(!1), [g, _] = d(() => Math.min(n, Math.max(t.length - 1, 0))), [v, y] = d({
|
|
1631
1634
|
bottom: 0,
|
|
1632
1635
|
left: 0
|
|
@@ -1645,15 +1648,15 @@ function Mt({ collapsed: e, accounts: t, initialAccountIndex: n = 0, onAccountCh
|
|
|
1645
1648
|
_(t), r?.(e, t), h(!1);
|
|
1646
1649
|
}
|
|
1647
1650
|
function O() {
|
|
1648
|
-
h(!1), a ? a() : o &&
|
|
1651
|
+
h(!1), a ? a() : o && Qe(o, c);
|
|
1649
1652
|
}
|
|
1650
1653
|
return C ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("button", {
|
|
1651
1654
|
ref: b,
|
|
1652
1655
|
onClick: T,
|
|
1653
|
-
className:
|
|
1656
|
+
className: L("font-navigation flex w-full cursor-pointer items-center gap-2 rounded px-2 transition-colors duration-[100ms]", "text-text-secondary hover:text-text-primary hover:bg-bg-hover", e && "justify-center px-0"),
|
|
1654
1657
|
style: { height: "2.5em" },
|
|
1655
1658
|
title: e ? C.name : void 0,
|
|
1656
|
-
children: [/* @__PURE__ */ p(
|
|
1659
|
+
children: [/* @__PURE__ */ p(K, {
|
|
1657
1660
|
name: C.name,
|
|
1658
1661
|
src: C.avatarSrc,
|
|
1659
1662
|
size: "sm"
|
|
@@ -1662,12 +1665,12 @@ function Mt({ collapsed: e, accounts: t, initialAccountIndex: n = 0, onAccountCh
|
|
|
1662
1665
|
children: [/* @__PURE__ */ p("p", {
|
|
1663
1666
|
className: "text-text-primary truncate text-xs leading-tight font-medium",
|
|
1664
1667
|
children: C.name
|
|
1665
|
-
}),
|
|
1668
|
+
}), Mt(C) && /* @__PURE__ */ p("p", {
|
|
1666
1669
|
className: "text-2xs text-text-tertiary truncate leading-tight",
|
|
1667
|
-
children:
|
|
1670
|
+
children: Mt(C)
|
|
1668
1671
|
})]
|
|
1669
1672
|
}), /* @__PURE__ */ p(D, { className: "text-text-tertiary h-3 w-3 shrink-0" })] })]
|
|
1670
|
-
}), l &&
|
|
1673
|
+
}), l && F(/* @__PURE__ */ m("div", {
|
|
1671
1674
|
ref: x,
|
|
1672
1675
|
className: "bg-bg-tertiary border-border-strong animate-scale-in fixed z-[100] w-56 rounded-md border py-1 shadow-lg",
|
|
1673
1676
|
style: {
|
|
@@ -1683,7 +1686,7 @@ function Mt({ collapsed: e, accounts: t, initialAccountIndex: n = 0, onAccountCh
|
|
|
1683
1686
|
onClick: () => E(e, t),
|
|
1684
1687
|
className: "text-text-secondary hover:text-text-primary hover:bg-bg-hover font-navigation flex h-8 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
|
|
1685
1688
|
children: [
|
|
1686
|
-
/* @__PURE__ */ p(
|
|
1689
|
+
/* @__PURE__ */ p(K, {
|
|
1687
1690
|
name: e.name,
|
|
1688
1691
|
src: e.avatarSrc,
|
|
1689
1692
|
size: "sm"
|
|
@@ -1704,16 +1707,16 @@ function Mt({ collapsed: e, accounts: t, initialAccountIndex: n = 0, onAccountCh
|
|
|
1704
1707
|
w && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", { className: "border-border my-1 border-t" }), /* @__PURE__ */ m("button", {
|
|
1705
1708
|
onClick: O,
|
|
1706
1709
|
className: "text-text-secondary hover:text-text-primary hover:bg-bg-hover font-navigation flex h-7 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
|
|
1707
|
-
children: [/* @__PURE__ */ p(
|
|
1710
|
+
children: [/* @__PURE__ */ p(re, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ p("span", { children: s })]
|
|
1708
1711
|
})] })
|
|
1709
1712
|
]
|
|
1710
1713
|
}), document.body)] }) : null;
|
|
1711
1714
|
}
|
|
1712
|
-
function
|
|
1715
|
+
function Pt({ collapsed: e, settingsPath: t, settingsLabel: n = "All Settings", onOpenSettings: r, onNavigate: a }) {
|
|
1713
1716
|
let [o, s] = d(!1), [c, l] = d({
|
|
1714
1717
|
bottom: 0,
|
|
1715
1718
|
left: 0
|
|
1716
|
-
}), g = u(null), _ = u(null), { accentColor: v, setAccentColor: y, reducedMotion: b, setReducedMotion: x, colorMode: C, setColorMode: w } =
|
|
1719
|
+
}), g = u(null), _ = u(null), { accentColor: v, setAccentColor: y, reducedMotion: b, setReducedMotion: x, colorMode: C, setColorMode: w } = G(), { toast: T } = xt(), E = !!(t || r);
|
|
1717
1720
|
W(o, i(() => s(!1), []), [_], [g]);
|
|
1718
1721
|
function D() {
|
|
1719
1722
|
if (!g.current) return;
|
|
@@ -1724,19 +1727,19 @@ function Nt({ collapsed: e, settingsPath: t, settingsLabel: n = "All Settings",
|
|
|
1724
1727
|
}), s(!o);
|
|
1725
1728
|
}
|
|
1726
1729
|
function O() {
|
|
1727
|
-
s(!1), r ? r() : t &&
|
|
1730
|
+
s(!1), r ? r() : t && Qe(t, a);
|
|
1728
1731
|
}
|
|
1729
1732
|
return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("button", {
|
|
1730
1733
|
ref: g,
|
|
1731
1734
|
onClick: D,
|
|
1732
|
-
className:
|
|
1735
|
+
className: L("font-navigation relative flex w-full items-center gap-2 rounded px-2", "cursor-pointer transition-colors duration-[100ms]", e ? "mx-auto w-[2em] justify-center" : "", o ? "bg-accent-muted text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
1733
1736
|
style: { height: "2em" },
|
|
1734
1737
|
title: e ? "Settings" : void 0,
|
|
1735
|
-
children: [/* @__PURE__ */ p(
|
|
1738
|
+
children: [/* @__PURE__ */ p(le, { className: "h-3.5 w-3.5 shrink-0" }), !e && /* @__PURE__ */ p("span", {
|
|
1736
1739
|
className: "truncate text-xs",
|
|
1737
1740
|
children: "Settings"
|
|
1738
1741
|
})]
|
|
1739
|
-
}), o &&
|
|
1742
|
+
}), o && F(/* @__PURE__ */ m("div", {
|
|
1740
1743
|
ref: _,
|
|
1741
1744
|
className: "bg-bg-tertiary border-border-strong animate-scale-in fixed z-[100] w-64 rounded-md border py-1 shadow-lg",
|
|
1742
1745
|
style: {
|
|
@@ -1752,17 +1755,17 @@ function Nt({ collapsed: e, settingsPath: t, settingsLabel: n = "All Settings",
|
|
|
1752
1755
|
{
|
|
1753
1756
|
value: "dark",
|
|
1754
1757
|
label: "Dark",
|
|
1755
|
-
Icon:
|
|
1758
|
+
Icon: M
|
|
1756
1759
|
},
|
|
1757
1760
|
{
|
|
1758
1761
|
value: "light",
|
|
1759
1762
|
label: "Light",
|
|
1760
|
-
Icon:
|
|
1763
|
+
Icon: ue
|
|
1761
1764
|
},
|
|
1762
1765
|
{
|
|
1763
1766
|
value: "system",
|
|
1764
1767
|
label: "System",
|
|
1765
|
-
Icon:
|
|
1768
|
+
Icon: j
|
|
1766
1769
|
}
|
|
1767
1770
|
].map(({ value: e, label: t, Icon: n }) => /* @__PURE__ */ m("button", {
|
|
1768
1771
|
onClick: () => w(e),
|
|
@@ -1785,7 +1788,7 @@ function Nt({ collapsed: e, settingsPath: t, settingsLabel: n = "All Settings",
|
|
|
1785
1788
|
className: "flex flex-wrap gap-1.5 px-3 pb-2",
|
|
1786
1789
|
children: ht.map((e) => /* @__PURE__ */ p("button", {
|
|
1787
1790
|
onClick: () => y(e.value),
|
|
1788
|
-
className:
|
|
1791
|
+
className: L("h-5 w-5 cursor-pointer rounded-full transition-transform duration-[100ms] hover:scale-110", v === e.value && "ring-offset-bg-tertiary scale-110 ring-2 ring-offset-1"),
|
|
1789
1792
|
style: {
|
|
1790
1793
|
backgroundColor: e.color,
|
|
1791
1794
|
...v === e.value ? { "--utility-ring-color": e.color } : {}
|
|
@@ -1811,7 +1814,7 @@ function Nt({ collapsed: e, settingsPath: t, settingsLabel: n = "All Settings",
|
|
|
1811
1814
|
E && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", { className: "border-border my-1 border-t" }), /* @__PURE__ */ m("button", {
|
|
1812
1815
|
onClick: O,
|
|
1813
1816
|
className: "text-text-secondary hover:text-text-primary hover:bg-bg-hover font-navigation flex h-7 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
|
|
1814
|
-
children: [/* @__PURE__ */ p(
|
|
1817
|
+
children: [/* @__PURE__ */ p(le, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ p("span", {
|
|
1815
1818
|
className: "flex-1 text-left",
|
|
1816
1819
|
children: n
|
|
1817
1820
|
})]
|
|
@@ -1819,14 +1822,14 @@ function Nt({ collapsed: e, settingsPath: t, settingsLabel: n = "All Settings",
|
|
|
1819
1822
|
]
|
|
1820
1823
|
}), document.body)] });
|
|
1821
1824
|
}
|
|
1822
|
-
function
|
|
1823
|
-
let { sidebarCollapsed: y, sidebarWidth: b, setSidebarWidth: x } =
|
|
1825
|
+
function Ft({ navSections: e, brand: t, accounts: n = [], initialAccountIndex: r, onAccountChange: a, onSignOut: o, signOutPath: s, signOutLabel: c, settingsPath: l, settingsLabel: f, onOpenSettings: h, currentPath: g, onNavigate: _, className: v }) {
|
|
1826
|
+
let { sidebarCollapsed: y, sidebarWidth: b, setSidebarWidth: x } = G(), [S, C] = d(/* @__PURE__ */ new Set()), T = u(null), E = u(!1), D = i((e) => {
|
|
1824
1827
|
if (y) return;
|
|
1825
1828
|
e.preventDefault(), E.current = !0, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
1826
1829
|
let t = (e) => {
|
|
1827
1830
|
if (!E.current || !T.current) return;
|
|
1828
1831
|
let t = T.current.getBoundingClientRect(), n = e.clientX - t.left;
|
|
1829
|
-
x(Math.max(
|
|
1832
|
+
x(Math.max(Dt, Math.min(n, Ot)));
|
|
1830
1833
|
}, n = () => {
|
|
1831
1834
|
E.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "", document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
|
|
1832
1835
|
};
|
|
@@ -1840,8 +1843,8 @@ function Pt({ navSections: e, brand: t, accounts: n = [], initialAccountIndex: r
|
|
|
1840
1843
|
}
|
|
1841
1844
|
return /* @__PURE__ */ m("aside", {
|
|
1842
1845
|
ref: T,
|
|
1843
|
-
className:
|
|
1844
|
-
style: { width: y ?
|
|
1846
|
+
className: L("bg-bg-secondary relative hidden shrink-0 flex-col border-r md:flex", "transition-[width] duration-[200ms] ease-out", "border-border", v),
|
|
1847
|
+
style: { width: y ? kt : b },
|
|
1845
1848
|
children: [
|
|
1846
1849
|
!y && /* @__PURE__ */ p("div", {
|
|
1847
1850
|
onMouseDown: D,
|
|
@@ -1850,7 +1853,7 @@ function Pt({ navSections: e, brand: t, accounts: n = [], initialAccountIndex: r
|
|
|
1850
1853
|
/* @__PURE__ */ p("div", {
|
|
1851
1854
|
className: "border-border flex shrink-0 items-center border-b px-2",
|
|
1852
1855
|
style: { height: "var(--topbar-height)" },
|
|
1853
|
-
children: /* @__PURE__ */ p(
|
|
1856
|
+
children: /* @__PURE__ */ p(jt, {
|
|
1854
1857
|
brand: t,
|
|
1855
1858
|
collapsed: y
|
|
1856
1859
|
})
|
|
@@ -1863,15 +1866,18 @@ function Pt({ navSections: e, brand: t, accounts: n = [], initialAccountIndex: r
|
|
|
1863
1866
|
className: "mb-4",
|
|
1864
1867
|
children: [y ? t > 0 && /* @__PURE__ */ p("hr", { className: "border-border mx-auto my-1.5 w-4/5" }) : /* @__PURE__ */ m("button", {
|
|
1865
1868
|
onClick: () => O(e.title),
|
|
1866
|
-
className: "text-2xs-f text-text-tertiary hover:text-text-secondary font-label flex w-full cursor-pointer items-center
|
|
1869
|
+
className: "text-2xs-f text-text-tertiary hover:text-text-secondary font-label flex w-full cursor-pointer items-center gap-1 px-2 text-left font-semibold tracking-wider uppercase",
|
|
1867
1870
|
style: {
|
|
1868
1871
|
paddingTop: "0.35em",
|
|
1869
1872
|
paddingBottom: "0.35em"
|
|
1870
1873
|
},
|
|
1871
|
-
children: [
|
|
1874
|
+
children: [/* @__PURE__ */ p("span", {
|
|
1875
|
+
className: "min-w-0 flex-1",
|
|
1876
|
+
children: e.title
|
|
1877
|
+
}), /* @__PURE__ */ p(w, { className: L("h-3 w-3 shrink-0 transition-transform", n && "-rotate-90") })]
|
|
1872
1878
|
}), (!n || y) && /* @__PURE__ */ p("ul", {
|
|
1873
1879
|
className: "flex flex-col gap-1",
|
|
1874
|
-
children: e.items.map((e) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ p(
|
|
1880
|
+
children: e.items.map((e) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ p(At, {
|
|
1875
1881
|
item: e,
|
|
1876
1882
|
collapsed: y,
|
|
1877
1883
|
currentPath: g,
|
|
@@ -1883,7 +1889,7 @@ function Pt({ navSections: e, brand: t, accounts: n = [], initialAccountIndex: r
|
|
|
1883
1889
|
}),
|
|
1884
1890
|
/* @__PURE__ */ m("div", {
|
|
1885
1891
|
className: "shrink-0 px-2 py-1.5",
|
|
1886
|
-
children: [/* @__PURE__ */ p(
|
|
1892
|
+
children: [/* @__PURE__ */ p(Pt, {
|
|
1887
1893
|
collapsed: y,
|
|
1888
1894
|
settingsPath: l,
|
|
1889
1895
|
settingsLabel: f,
|
|
@@ -1891,7 +1897,7 @@ function Pt({ navSections: e, brand: t, accounts: n = [], initialAccountIndex: r
|
|
|
1891
1897
|
onNavigate: _
|
|
1892
1898
|
}), n.length > 0 && /* @__PURE__ */ p("div", {
|
|
1893
1899
|
className: "border-border mt-2 border-t pt-2",
|
|
1894
|
-
children: /* @__PURE__ */ p(
|
|
1900
|
+
children: /* @__PURE__ */ p(Nt, {
|
|
1895
1901
|
collapsed: y,
|
|
1896
1902
|
accounts: n,
|
|
1897
1903
|
initialAccountIndex: r,
|
|
@@ -1908,23 +1914,23 @@ function Pt({ navSections: e, brand: t, accounts: n = [], initialAccountIndex: r
|
|
|
1908
1914
|
}
|
|
1909
1915
|
//#endregion
|
|
1910
1916
|
//#region src/components/app-shell/Breadcrumbs.tsx
|
|
1911
|
-
function
|
|
1917
|
+
function It(e) {
|
|
1912
1918
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1913
1919
|
}
|
|
1914
|
-
function
|
|
1920
|
+
function Lt({ homeLabel: e = "Dashboard", labels: t = {}, parents: n = {}, currentPath: r = "/", onNavigate: i, className: a }) {
|
|
1915
1921
|
let o = r.split("?")[0].split("/").filter(Boolean), s = [{
|
|
1916
1922
|
label: e,
|
|
1917
1923
|
path: "/"
|
|
1918
1924
|
}, ...o.map((e, r) => {
|
|
1919
1925
|
let i = o[r - 1];
|
|
1920
1926
|
return {
|
|
1921
|
-
label: t[e] || n[i] ||
|
|
1927
|
+
label: t[e] || n[i] || It(e),
|
|
1922
1928
|
path: "/" + o.slice(0, r + 1).join("/")
|
|
1923
1929
|
};
|
|
1924
1930
|
})];
|
|
1925
1931
|
return /* @__PURE__ */ p("nav", {
|
|
1926
1932
|
"aria-label": "Breadcrumb",
|
|
1927
|
-
className:
|
|
1933
|
+
className: L("font-navigation flex items-center gap-1 text-xs", a),
|
|
1928
1934
|
children: s.map((e, t) => {
|
|
1929
1935
|
let n = t === s.length - 1;
|
|
1930
1936
|
return /* @__PURE__ */ m("span", {
|
|
@@ -1934,8 +1940,8 @@ function It({ homeLabel: e = "Dashboard", labels: t = {}, parents: n = {}, curre
|
|
|
1934
1940
|
children: e.label
|
|
1935
1941
|
}) : /* @__PURE__ */ p("a", {
|
|
1936
1942
|
href: e.path,
|
|
1937
|
-
onClick: (t) =>
|
|
1938
|
-
className:
|
|
1943
|
+
onClick: (t) => z(t, e.path, i),
|
|
1944
|
+
className: L("text-text-tertiary hover:text-text-primary cursor-pointer transition-colors duration-[100ms]"),
|
|
1939
1945
|
children: e.label
|
|
1940
1946
|
})]
|
|
1941
1947
|
}, e.path);
|
|
@@ -1943,26 +1949,551 @@ function It({ homeLabel: e = "Dashboard", labels: t = {}, parents: n = {}, curre
|
|
|
1943
1949
|
});
|
|
1944
1950
|
}
|
|
1945
1951
|
//#endregion
|
|
1952
|
+
//#region src/hooks/useApplyTheme.ts
|
|
1953
|
+
function Rt() {
|
|
1954
|
+
let { setPreferredDarkTheme: e, setPreferredLightTheme: t, setColorMode: n } = G();
|
|
1955
|
+
return i((r) => {
|
|
1956
|
+
V(r) ? (t(r), n("light")) : (e(r), n("dark"));
|
|
1957
|
+
}, [
|
|
1958
|
+
e,
|
|
1959
|
+
t,
|
|
1960
|
+
n
|
|
1961
|
+
]);
|
|
1962
|
+
}
|
|
1963
|
+
//#endregion
|
|
1964
|
+
//#region src/components/ui/Button.tsx
|
|
1965
|
+
var zt = {
|
|
1966
|
+
primary: "bg-accent text-text-on-accent hover:bg-accent-hover active:bg-accent-active",
|
|
1967
|
+
secondary: "bg-bg-secondary text-text-primary border border-border hover:bg-bg-hover hover:border-border-strong",
|
|
1968
|
+
danger: "bg-red-muted text-red border border-transparent hover:bg-red/20",
|
|
1969
|
+
ghost: "text-text-secondary hover:text-text-primary hover:bg-bg-hover",
|
|
1970
|
+
icon: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover"
|
|
1971
|
+
}, Bt = {
|
|
1972
|
+
sm: "h-7 px-2.5 text-xs gap-1.5",
|
|
1973
|
+
md: "h-8 px-3 text-xs gap-2",
|
|
1974
|
+
lg: "h-9 px-4 text-sm gap-2"
|
|
1975
|
+
}, Vt = {
|
|
1976
|
+
sm: "h-7 w-7",
|
|
1977
|
+
md: "h-8 w-8",
|
|
1978
|
+
lg: "h-9 w-9"
|
|
1979
|
+
}, Ht = {
|
|
1980
|
+
sm: "h-3.5 w-3.5",
|
|
1981
|
+
md: "h-3.5 w-3.5",
|
|
1982
|
+
lg: "h-4 w-4"
|
|
1983
|
+
}, Ut = {
|
|
1984
|
+
sm: "hidden sm:inline",
|
|
1985
|
+
md: "hidden md:inline",
|
|
1986
|
+
lg: "hidden lg:inline"
|
|
1987
|
+
}, Wt = {
|
|
1988
|
+
sm: {
|
|
1989
|
+
sm: "px-1.5 sm:px-2.5",
|
|
1990
|
+
md: "px-2 sm:px-3",
|
|
1991
|
+
lg: "px-2.5 sm:px-4"
|
|
1992
|
+
},
|
|
1993
|
+
md: {
|
|
1994
|
+
sm: "px-1.5 md:px-2.5",
|
|
1995
|
+
md: "px-2 md:px-3",
|
|
1996
|
+
lg: "px-2.5 md:px-4"
|
|
1997
|
+
},
|
|
1998
|
+
lg: {
|
|
1999
|
+
sm: "px-1.5 lg:px-2.5",
|
|
2000
|
+
md: "px-2 lg:px-3",
|
|
2001
|
+
lg: "px-2.5 lg:px-4"
|
|
2002
|
+
}
|
|
2003
|
+
}, q = r(({ variant: e = "secondary", size: t = "md", loading: n, icon: r, hideLabel: i, className: a, children: o, disabled: s, ...c }, l) => {
|
|
2004
|
+
let u = e === "icon", d = i === !0 ? "sm" : i === !1 ? void 0 : i;
|
|
2005
|
+
return /* @__PURE__ */ m("button", {
|
|
2006
|
+
ref: l,
|
|
2007
|
+
disabled: s || n,
|
|
2008
|
+
className: L("inline-flex items-center justify-center rounded-md font-medium", "font-control", "transition-colors duration-[100ms] ease-out", "cursor-pointer", "disabled:cursor-not-allowed disabled:opacity-40", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2", zt[e], u ? Vt[t] : Bt[t], d && !u && Wt[d]?.[t], a),
|
|
2009
|
+
...c,
|
|
2010
|
+
children: [
|
|
2011
|
+
n && /* @__PURE__ */ p(ne, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
2012
|
+
r && !n && /* @__PURE__ */ p(r, { className: Ht[t] }),
|
|
2013
|
+
o && (d ? /* @__PURE__ */ p("span", {
|
|
2014
|
+
className: Ut[d],
|
|
2015
|
+
children: o
|
|
2016
|
+
}) : o)
|
|
2017
|
+
]
|
|
2018
|
+
});
|
|
2019
|
+
});
|
|
2020
|
+
q.displayName = "Button";
|
|
2021
|
+
//#endregion
|
|
2022
|
+
//#region src/components/ui/SectionHeader.tsx
|
|
2023
|
+
function J({ children: e, as: t = "h2", className: n, border: r = !0 }) {
|
|
2024
|
+
return /* @__PURE__ */ p(t, {
|
|
2025
|
+
className: L("text-text-primary font-heading text-xs font-semibold", r && "border-border border-b pb-2", n),
|
|
2026
|
+
children: e
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
2029
|
+
//#endregion
|
|
2030
|
+
//#region src/hooks/useDropUp.ts
|
|
2031
|
+
function Gt(e, t, n) {
|
|
2032
|
+
let [r, i] = d(!1);
|
|
2033
|
+
return c(() => {
|
|
2034
|
+
if (!e || !n.current || !t.current) return;
|
|
2035
|
+
let r = t.current.getBoundingClientRect(), a = n.current.getBoundingClientRect();
|
|
2036
|
+
i(window.innerHeight - r.bottom < a.height + 8);
|
|
2037
|
+
}, [e]), r;
|
|
2038
|
+
}
|
|
2039
|
+
//#endregion
|
|
2040
|
+
//#region src/components/ui/SelectDropdown.tsx
|
|
2041
|
+
function Y({ options: e, value: t, onChange: n, label: r, placeholder: a = "Select...", className: o, size: c = "md" }) {
|
|
2042
|
+
let [l, f] = d(!1), [h, g] = d(-1), _ = u(null), v = u(null), y = Gt(l, _, v), b = s(), x = `${b}-listbox`, C = e.find((e) => e.value === t);
|
|
2043
|
+
W(l, i(() => f(!1), []), [_]);
|
|
2044
|
+
function T() {
|
|
2045
|
+
if (!l) {
|
|
2046
|
+
let n = e.findIndex((e) => e.value === t);
|
|
2047
|
+
g(n >= 0 ? n : 0);
|
|
2048
|
+
}
|
|
2049
|
+
f(!l);
|
|
2050
|
+
}
|
|
2051
|
+
function E(r) {
|
|
2052
|
+
if (!l) {
|
|
2053
|
+
if (r.key === "ArrowDown" || r.key === "ArrowUp") {
|
|
2054
|
+
r.preventDefault();
|
|
2055
|
+
let n = e.findIndex((e) => e.value === t);
|
|
2056
|
+
g(n >= 0 ? n : 0), f(!0);
|
|
2057
|
+
}
|
|
2058
|
+
return;
|
|
2059
|
+
}
|
|
2060
|
+
switch (r.key) {
|
|
2061
|
+
case "ArrowDown":
|
|
2062
|
+
r.preventDefault(), g((t) => Math.min(t + 1, e.length - 1));
|
|
2063
|
+
break;
|
|
2064
|
+
case "ArrowUp":
|
|
2065
|
+
r.preventDefault(), g((e) => Math.max(e - 1, 0));
|
|
2066
|
+
break;
|
|
2067
|
+
case "Enter":
|
|
2068
|
+
r.preventDefault(), e[h] && (n(e[h].value), f(!1));
|
|
2069
|
+
break;
|
|
2070
|
+
case "Escape":
|
|
2071
|
+
r.preventDefault(), f(!1);
|
|
2072
|
+
break;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
return /* @__PURE__ */ m("div", {
|
|
2076
|
+
className: L("flex flex-col gap-1.5", o),
|
|
2077
|
+
ref: _,
|
|
2078
|
+
children: [r && /* @__PURE__ */ p("span", {
|
|
2079
|
+
className: "text-text-secondary font-label text-xs font-medium",
|
|
2080
|
+
children: r
|
|
2081
|
+
}), /* @__PURE__ */ m("div", {
|
|
2082
|
+
className: "relative",
|
|
2083
|
+
children: [
|
|
2084
|
+
/* @__PURE__ */ p("button", {
|
|
2085
|
+
type: "button",
|
|
2086
|
+
onClick: T,
|
|
2087
|
+
onKeyDown: E,
|
|
2088
|
+
"aria-haspopup": "listbox",
|
|
2089
|
+
"aria-expanded": l,
|
|
2090
|
+
"aria-controls": l ? x : void 0,
|
|
2091
|
+
"aria-activedescendant": l && h >= 0 ? `${b}-option-${h}` : void 0,
|
|
2092
|
+
className: L("font-control flex w-full cursor-pointer items-center rounded-md text-xs", "bg-bg-secondary border-border text-text-primary border", "hover:bg-bg-hover hover:border-border-strong", "transition-colors duration-[100ms]", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2", c === "sm" ? "h-6 px-2 pr-6" : "h-7 px-2 pr-7"),
|
|
2093
|
+
children: C ? C.label : /* @__PURE__ */ p("span", {
|
|
2094
|
+
className: "text-text-disabled",
|
|
2095
|
+
children: a
|
|
2096
|
+
})
|
|
2097
|
+
}),
|
|
2098
|
+
/* @__PURE__ */ p(w, { className: L("text-text-tertiary pointer-events-none absolute top-1/2 h-3 w-3 -translate-y-1/2 transition-transform", c === "sm" ? "right-1.5" : "right-2", l && "rotate-180") }),
|
|
2099
|
+
l && /* @__PURE__ */ p("div", {
|
|
2100
|
+
ref: v,
|
|
2101
|
+
className: L("bg-bg-tertiary border-border-strong animate-scale-in absolute right-0 left-0 z-[100] overflow-hidden rounded-md border shadow-lg", y ? "bottom-full mb-1" : "top-full mt-1"),
|
|
2102
|
+
children: /* @__PURE__ */ p("ul", {
|
|
2103
|
+
id: x,
|
|
2104
|
+
className: "max-h-48 overflow-y-auto py-1",
|
|
2105
|
+
role: "listbox",
|
|
2106
|
+
children: e.map((e, r) => /* @__PURE__ */ m("li", {
|
|
2107
|
+
id: `${b}-option-${r}`,
|
|
2108
|
+
role: "option",
|
|
2109
|
+
"aria-selected": e.value === t,
|
|
2110
|
+
onClick: () => {
|
|
2111
|
+
n(e.value), f(!1);
|
|
2112
|
+
},
|
|
2113
|
+
onMouseEnter: () => g(r),
|
|
2114
|
+
className: L("font-control flex h-7 w-full cursor-pointer items-center gap-2 px-3 text-xs", "transition-colors duration-[100ms]", r === h ? "bg-accent-muted text-accent" : e.value === t ? "text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
2115
|
+
children: [/* @__PURE__ */ p("span", {
|
|
2116
|
+
className: "flex-1 truncate",
|
|
2117
|
+
children: e.label
|
|
2118
|
+
}), e.value === t && /* @__PURE__ */ p(S, { className: "h-3 w-3 shrink-0" })]
|
|
2119
|
+
}, e.value))
|
|
2120
|
+
})
|
|
2121
|
+
})
|
|
2122
|
+
]
|
|
2123
|
+
})]
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
//#endregion
|
|
2127
|
+
//#region src/components/ui/Slider.tsx
|
|
2128
|
+
function X({ min: e, max: t, step: n = 1, value: r, onChange: i, onCommit: a, label: o, showValue: s, className: c }) {
|
|
2129
|
+
let l = (r - e) / (t - e) * 100;
|
|
2130
|
+
return /* @__PURE__ */ m("div", {
|
|
2131
|
+
className: L("flex flex-col gap-1.5", c),
|
|
2132
|
+
children: [(o || s) && /* @__PURE__ */ m("div", {
|
|
2133
|
+
className: "flex items-center justify-between",
|
|
2134
|
+
children: [o && /* @__PURE__ */ p("span", {
|
|
2135
|
+
className: "text-text-secondary font-label text-xs font-medium",
|
|
2136
|
+
children: o
|
|
2137
|
+
}), s && /* @__PURE__ */ p("span", {
|
|
2138
|
+
className: "text-text-primary font-data text-xs",
|
|
2139
|
+
children: r
|
|
2140
|
+
})]
|
|
2141
|
+
}), /* @__PURE__ */ p("input", {
|
|
2142
|
+
type: "range",
|
|
2143
|
+
min: e,
|
|
2144
|
+
max: t,
|
|
2145
|
+
step: n,
|
|
2146
|
+
value: r,
|
|
2147
|
+
onChange: (e) => i(Number(e.target.value)),
|
|
2148
|
+
onPointerUp: a ? (e) => a(Number(e.target.value)) : void 0,
|
|
2149
|
+
className: "bg-bg-tertiary [&::-webkit-slider-thumb]:bg-accent h-1.5 w-full cursor-pointer appearance-none rounded-md [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:duration-[100ms] [&::-webkit-slider-thumb]:hover:scale-110",
|
|
2150
|
+
style: { background: `linear-gradient(to right, var(--accent) ${l}%, var(--bg-tertiary) ${l}%)` }
|
|
2151
|
+
})]
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
//#endregion
|
|
2155
|
+
//#region src/components/ui/ThemePreview.tsx
|
|
2156
|
+
function Kt({ label: e, active: t, icon: n, preview: r, onClick: i, className: a }) {
|
|
2157
|
+
return /* @__PURE__ */ m("button", {
|
|
2158
|
+
type: "button",
|
|
2159
|
+
onClick: i,
|
|
2160
|
+
className: L("flex cursor-pointer flex-col items-center gap-2 rounded-md border p-3 transition-colors duration-[100ms]", t ? "border-accent bg-accent-muted" : "border-border bg-bg-secondary hover:bg-bg-hover hover:border-border-strong", a),
|
|
2161
|
+
children: [/* @__PURE__ */ p("div", {
|
|
2162
|
+
className: "border-border-strong/20 flex h-10 w-full items-center justify-center rounded border",
|
|
2163
|
+
style: { backgroundColor: r?.bg },
|
|
2164
|
+
children: /* @__PURE__ */ p("div", {
|
|
2165
|
+
className: "h-1.5 w-8 rounded-md",
|
|
2166
|
+
style: { backgroundColor: r?.fg }
|
|
2167
|
+
})
|
|
2168
|
+
}), /* @__PURE__ */ m("div", {
|
|
2169
|
+
className: "flex items-center gap-1.5",
|
|
2170
|
+
children: [n && /* @__PURE__ */ p(n, { className: "h-3 w-3" }), /* @__PURE__ */ p("span", {
|
|
2171
|
+
className: "text-xs font-medium",
|
|
2172
|
+
children: e
|
|
2173
|
+
})]
|
|
2174
|
+
})]
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
//#endregion
|
|
2178
|
+
//#region src/components/ui/Toggle.tsx
|
|
2179
|
+
function qt({ checked: e, onChange: t, disabled: n, label: r, className: i }) {
|
|
2180
|
+
return /* @__PURE__ */ m("label", {
|
|
2181
|
+
className: L("flex w-fit items-center", n ? "cursor-not-allowed opacity-40" : "cursor-pointer", i),
|
|
2182
|
+
style: { gap: 10 },
|
|
2183
|
+
children: [/* @__PURE__ */ p("button", {
|
|
2184
|
+
type: "button",
|
|
2185
|
+
role: "switch",
|
|
2186
|
+
"aria-checked": e,
|
|
2187
|
+
disabled: n,
|
|
2188
|
+
onClick: () => t(!e),
|
|
2189
|
+
className: L("relative shrink-0 rounded-full border transition-colors duration-[100ms]", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2", e ? "bg-accent border-accent" : "bg-bg-tertiary border-border", !n && "cursor-pointer"),
|
|
2190
|
+
style: {
|
|
2191
|
+
width: 36,
|
|
2192
|
+
height: 20
|
|
2193
|
+
},
|
|
2194
|
+
children: /* @__PURE__ */ p("span", {
|
|
2195
|
+
className: "bg-control-knob absolute top-1/2 rounded-full transition-[left] duration-[100ms]",
|
|
2196
|
+
style: {
|
|
2197
|
+
width: 14,
|
|
2198
|
+
height: 14,
|
|
2199
|
+
marginTop: -7,
|
|
2200
|
+
left: e ? 19 : 3,
|
|
2201
|
+
boxShadow: "0 0 1px rgba(0,0,0,0.1), 2px 0 4px rgba(0,0,0,0.35)"
|
|
2202
|
+
}
|
|
2203
|
+
})
|
|
2204
|
+
}), r && /* @__PURE__ */ p("span", {
|
|
2205
|
+
className: "text-text-secondary text-xs",
|
|
2206
|
+
children: r
|
|
2207
|
+
})]
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
//#endregion
|
|
2211
|
+
//#region src/components/app-shell/themeMenuEvents.ts
|
|
2212
|
+
var Jt = "open-theme-menu";
|
|
2213
|
+
function Yt(e = Jt) {
|
|
2214
|
+
typeof document > "u" || document.dispatchEvent(new CustomEvent(e));
|
|
2215
|
+
}
|
|
2216
|
+
//#endregion
|
|
2217
|
+
//#region src/components/app-shell/ThemeMenu.tsx
|
|
2218
|
+
var Xt = [
|
|
2219
|
+
{
|
|
2220
|
+
value: "dark",
|
|
2221
|
+
label: "Dark",
|
|
2222
|
+
Icon: M
|
|
2223
|
+
},
|
|
2224
|
+
{
|
|
2225
|
+
value: "light",
|
|
2226
|
+
label: "Light",
|
|
2227
|
+
Icon: ue
|
|
2228
|
+
},
|
|
2229
|
+
{
|
|
2230
|
+
value: "system",
|
|
2231
|
+
label: "System",
|
|
2232
|
+
Icon: j
|
|
2233
|
+
}
|
|
2234
|
+
];
|
|
2235
|
+
function Zt({ className: e, respondToOpenEvent: t = !0 }) {
|
|
2236
|
+
let [n, r] = d(!1), [a, s] = d(!1), [c, l] = d({
|
|
2237
|
+
top: 0,
|
|
2238
|
+
right: 0
|
|
2239
|
+
}), h = u(null), g = u(null), _ = G(), v = Rt(), { toast: y } = xt(), b = i(() => {
|
|
2240
|
+
r(!1), s(!1);
|
|
2241
|
+
}, []);
|
|
2242
|
+
W(n, b, [g], [h], { outsideClick: !a });
|
|
2243
|
+
let x = i(() => {
|
|
2244
|
+
if (!h.current) return;
|
|
2245
|
+
let e = h.current.getBoundingClientRect();
|
|
2246
|
+
l({
|
|
2247
|
+
top: e.bottom + 6,
|
|
2248
|
+
right: window.innerWidth - e.right
|
|
2249
|
+
});
|
|
2250
|
+
}, []);
|
|
2251
|
+
function S() {
|
|
2252
|
+
if (n) {
|
|
2253
|
+
b();
|
|
2254
|
+
return;
|
|
2255
|
+
}
|
|
2256
|
+
x(), r(!0);
|
|
2257
|
+
}
|
|
2258
|
+
o(() => {
|
|
2259
|
+
if (!t) return;
|
|
2260
|
+
let e = () => {
|
|
2261
|
+
x(), r(!0), s(!0);
|
|
2262
|
+
};
|
|
2263
|
+
return document.addEventListener(Jt, e), () => document.removeEventListener(Jt, e);
|
|
2264
|
+
}, [t, x]), o(() => {
|
|
2265
|
+
if (n) return window.addEventListener("resize", x), window.addEventListener("scroll", x, !0), () => {
|
|
2266
|
+
window.removeEventListener("resize", x), window.removeEventListener("scroll", x, !0);
|
|
2267
|
+
};
|
|
2268
|
+
}, [n, x]);
|
|
2269
|
+
let { colorMode: C, setColorMode: w, preferredDarkTheme: T, preferredLightTheme: E, accentColor: D, setAccentColor: O, fontSize: k, setFontSize: A, uiFont: ee, setUiFont: te, headingFont: ne, setHeadingFont: re, proseFont: ie, setProseFont: ae, codeFont: j, setCodeFont: M, borderRadius: se, setBorderRadius: ce, borderWidth: N, setBorderWidth: le, tracking: ue, setTracking: de, lineHeight: P, setLineHeight: fe, density: pe, setDensity: I, reducedMotion: me, setReducedMotion: he, saveThemeCustomization: ge, resetThemeCustomization: _e, hasThemeOverrides: ve, isCustomized: ye, resolvedTheme: be } = _;
|
|
2270
|
+
return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
|
|
2271
|
+
ref: h,
|
|
2272
|
+
onClick: S,
|
|
2273
|
+
"aria-label": "Theme settings",
|
|
2274
|
+
"aria-haspopup": "dialog",
|
|
2275
|
+
"aria-expanded": n,
|
|
2276
|
+
title: "Theme",
|
|
2277
|
+
className: L("flex h-7 w-7 cursor-pointer items-center justify-center rounded transition-colors duration-[100ms]", n ? "text-accent bg-accent-muted" : "text-text-tertiary hover:text-text-primary hover:bg-bg-hover", e),
|
|
2278
|
+
children: /* @__PURE__ */ p(oe, { className: "h-4 w-4" })
|
|
2279
|
+
}), n && F(/* @__PURE__ */ p("div", {
|
|
2280
|
+
ref: g,
|
|
2281
|
+
role: "dialog",
|
|
2282
|
+
"aria-label": "Theme settings",
|
|
2283
|
+
className: "bg-bg-tertiary border-border-strong animate-scale-in fixed z-[100] flex w-80 flex-col overflow-y-auto rounded-md border p-3 shadow-lg",
|
|
2284
|
+
style: {
|
|
2285
|
+
top: c.top,
|
|
2286
|
+
right: c.right,
|
|
2287
|
+
maxHeight: "80vh"
|
|
2288
|
+
},
|
|
2289
|
+
children: /* @__PURE__ */ m("div", {
|
|
2290
|
+
className: "space-y-4",
|
|
2291
|
+
children: [
|
|
2292
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p(J, {
|
|
2293
|
+
as: "h3",
|
|
2294
|
+
border: !1,
|
|
2295
|
+
className: "mb-2",
|
|
2296
|
+
children: "Mode"
|
|
2297
|
+
}), /* @__PURE__ */ p("div", {
|
|
2298
|
+
className: "bg-bg-secondary border-border flex gap-1 rounded-md border p-1.5",
|
|
2299
|
+
children: Xt.map(({ value: e, label: t, Icon: n }) => /* @__PURE__ */ m("button", {
|
|
2300
|
+
onClick: () => w(e),
|
|
2301
|
+
className: L("font-navigation flex flex-1 cursor-pointer items-center justify-center gap-1.5 rounded px-2 py-1 text-xs transition-colors duration-[100ms]", C === e ? "bg-accent-muted text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
2302
|
+
children: [/* @__PURE__ */ p(n, { className: "h-3.5 w-3.5" }), t]
|
|
2303
|
+
}, e))
|
|
2304
|
+
})] }),
|
|
2305
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p(J, {
|
|
2306
|
+
as: "h3",
|
|
2307
|
+
border: !1,
|
|
2308
|
+
className: "mb-2",
|
|
2309
|
+
children: "Dark themes"
|
|
2310
|
+
}), /* @__PURE__ */ p("div", {
|
|
2311
|
+
className: "grid grid-cols-2 gap-2",
|
|
2312
|
+
children: ft.map((e) => /* @__PURE__ */ p(Kt, {
|
|
2313
|
+
label: e.label,
|
|
2314
|
+
icon: e.icon,
|
|
2315
|
+
preview: e.preview,
|
|
2316
|
+
active: T === e.value,
|
|
2317
|
+
onClick: () => v(e.value)
|
|
2318
|
+
}, e.value))
|
|
2319
|
+
})] }),
|
|
2320
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p(J, {
|
|
2321
|
+
as: "h3",
|
|
2322
|
+
border: !1,
|
|
2323
|
+
className: "mb-2",
|
|
2324
|
+
children: "Light themes"
|
|
2325
|
+
}), /* @__PURE__ */ p("div", {
|
|
2326
|
+
className: "grid grid-cols-2 gap-2",
|
|
2327
|
+
children: dt.map((e) => /* @__PURE__ */ p(Kt, {
|
|
2328
|
+
label: e.label,
|
|
2329
|
+
icon: e.icon,
|
|
2330
|
+
preview: e.preview,
|
|
2331
|
+
active: E === e.value,
|
|
2332
|
+
onClick: () => v(e.value)
|
|
2333
|
+
}, e.value))
|
|
2334
|
+
})] }),
|
|
2335
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p(J, {
|
|
2336
|
+
as: "h3",
|
|
2337
|
+
border: !1,
|
|
2338
|
+
className: "mb-2",
|
|
2339
|
+
children: "Accent"
|
|
2340
|
+
}), /* @__PURE__ */ p("div", {
|
|
2341
|
+
className: "flex flex-wrap gap-1.5",
|
|
2342
|
+
children: ht.map((e) => /* @__PURE__ */ p("button", {
|
|
2343
|
+
onClick: () => O(e.value),
|
|
2344
|
+
className: L("h-6 w-6 cursor-pointer rounded-full transition-transform duration-[100ms] hover:scale-110", D === e.value && "ring-offset-bg-tertiary scale-110 ring-2 ring-offset-1"),
|
|
2345
|
+
style: {
|
|
2346
|
+
backgroundColor: e.color,
|
|
2347
|
+
...D === e.value ? { "--utility-ring-color": e.color } : {}
|
|
2348
|
+
},
|
|
2349
|
+
title: e.value.charAt(0).toUpperCase() + e.value.slice(1),
|
|
2350
|
+
"aria-label": e.value
|
|
2351
|
+
}, e.value))
|
|
2352
|
+
})] }),
|
|
2353
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p(J, {
|
|
2354
|
+
as: "h3",
|
|
2355
|
+
border: !1,
|
|
2356
|
+
className: "mb-2",
|
|
2357
|
+
children: "Fonts"
|
|
2358
|
+
}), /* @__PURE__ */ m("div", {
|
|
2359
|
+
className: "grid grid-cols-2 gap-2",
|
|
2360
|
+
children: [
|
|
2361
|
+
/* @__PURE__ */ p(Y, {
|
|
2362
|
+
label: "UI / Body",
|
|
2363
|
+
size: "sm",
|
|
2364
|
+
options: U,
|
|
2365
|
+
value: ee,
|
|
2366
|
+
onChange: (e) => te(e)
|
|
2367
|
+
}),
|
|
2368
|
+
/* @__PURE__ */ p(Y, {
|
|
2369
|
+
label: "Headings",
|
|
2370
|
+
size: "sm",
|
|
2371
|
+
options: U,
|
|
2372
|
+
value: ne,
|
|
2373
|
+
onChange: (e) => re(e)
|
|
2374
|
+
}),
|
|
2375
|
+
/* @__PURE__ */ p(Y, {
|
|
2376
|
+
label: "Prose",
|
|
2377
|
+
size: "sm",
|
|
2378
|
+
options: U,
|
|
2379
|
+
value: ie,
|
|
2380
|
+
onChange: (e) => ae(e)
|
|
2381
|
+
}),
|
|
2382
|
+
/* @__PURE__ */ p(Y, {
|
|
2383
|
+
label: "Code",
|
|
2384
|
+
size: "sm",
|
|
2385
|
+
options: U,
|
|
2386
|
+
value: j,
|
|
2387
|
+
onChange: (e) => M(e)
|
|
2388
|
+
})
|
|
2389
|
+
]
|
|
2390
|
+
})] }),
|
|
2391
|
+
/* @__PURE__ */ m("div", {
|
|
2392
|
+
className: "space-y-3",
|
|
2393
|
+
children: [
|
|
2394
|
+
/* @__PURE__ */ p(X, {
|
|
2395
|
+
label: "Font size",
|
|
2396
|
+
min: 11,
|
|
2397
|
+
max: 18,
|
|
2398
|
+
value: k,
|
|
2399
|
+
onChange: A,
|
|
2400
|
+
showValue: !0
|
|
2401
|
+
}),
|
|
2402
|
+
/* @__PURE__ */ p(X, {
|
|
2403
|
+
label: "Corner radius",
|
|
2404
|
+
min: 0,
|
|
2405
|
+
max: 16,
|
|
2406
|
+
value: se,
|
|
2407
|
+
onChange: ce,
|
|
2408
|
+
showValue: !0
|
|
2409
|
+
}),
|
|
2410
|
+
/* @__PURE__ */ p(X, {
|
|
2411
|
+
label: "Border width",
|
|
2412
|
+
min: 1,
|
|
2413
|
+
max: 3,
|
|
2414
|
+
value: N,
|
|
2415
|
+
onChange: le,
|
|
2416
|
+
showValue: !0
|
|
2417
|
+
}),
|
|
2418
|
+
/* @__PURE__ */ p(X, {
|
|
2419
|
+
label: "Letter spacing",
|
|
2420
|
+
min: 0,
|
|
2421
|
+
max: .3,
|
|
2422
|
+
step: .01,
|
|
2423
|
+
value: ue,
|
|
2424
|
+
onChange: de,
|
|
2425
|
+
showValue: !0
|
|
2426
|
+
}),
|
|
2427
|
+
/* @__PURE__ */ p(X, {
|
|
2428
|
+
label: "Line height",
|
|
2429
|
+
min: 1.2,
|
|
2430
|
+
max: 2,
|
|
2431
|
+
step: .05,
|
|
2432
|
+
value: P,
|
|
2433
|
+
onChange: fe,
|
|
2434
|
+
showValue: !0
|
|
2435
|
+
}),
|
|
2436
|
+
/* @__PURE__ */ p(X, {
|
|
2437
|
+
label: "Density",
|
|
2438
|
+
min: .18,
|
|
2439
|
+
max: .32,
|
|
2440
|
+
step: .01,
|
|
2441
|
+
value: pe,
|
|
2442
|
+
onChange: I,
|
|
2443
|
+
showValue: !0
|
|
2444
|
+
})
|
|
2445
|
+
]
|
|
2446
|
+
}),
|
|
2447
|
+
/* @__PURE__ */ p(qt, {
|
|
2448
|
+
label: "Reduced motion",
|
|
2449
|
+
checked: me,
|
|
2450
|
+
onChange: he
|
|
2451
|
+
}),
|
|
2452
|
+
/* @__PURE__ */ m("div", {
|
|
2453
|
+
className: "border-border flex items-center gap-2 border-t pt-3",
|
|
2454
|
+
children: [/* @__PURE__ */ p(q, {
|
|
2455
|
+
variant: "primary",
|
|
2456
|
+
size: "sm",
|
|
2457
|
+
disabled: !ye,
|
|
2458
|
+
onClick: () => {
|
|
2459
|
+
ge(), y("success", `Saved customization for ${lt.find((e) => e.value === be)?.label ?? be}`);
|
|
2460
|
+
},
|
|
2461
|
+
children: "Save for theme"
|
|
2462
|
+
}), /* @__PURE__ */ p(q, {
|
|
2463
|
+
variant: "secondary",
|
|
2464
|
+
size: "sm",
|
|
2465
|
+
disabled: !ve && !ye,
|
|
2466
|
+
onClick: () => {
|
|
2467
|
+
_e(), y("info", "Reset to theme defaults");
|
|
2468
|
+
},
|
|
2469
|
+
children: "Reset"
|
|
2470
|
+
})]
|
|
2471
|
+
})
|
|
2472
|
+
]
|
|
2473
|
+
})
|
|
2474
|
+
}), document.body)] });
|
|
2475
|
+
}
|
|
2476
|
+
//#endregion
|
|
1946
2477
|
//#region src/components/app-shell/TopBar.tsx
|
|
1947
|
-
var
|
|
2478
|
+
var Qt = [
|
|
1948
2479
|
"dark",
|
|
1949
2480
|
"light",
|
|
1950
2481
|
"system"
|
|
1951
|
-
],
|
|
1952
|
-
dark:
|
|
1953
|
-
light:
|
|
1954
|
-
system:
|
|
1955
|
-
},
|
|
2482
|
+
], $t = {
|
|
2483
|
+
dark: M,
|
|
2484
|
+
light: ue,
|
|
2485
|
+
system: j
|
|
2486
|
+
}, en = {
|
|
1956
2487
|
dark: "Dark",
|
|
1957
2488
|
light: "Light",
|
|
1958
2489
|
system: "System"
|
|
1959
2490
|
};
|
|
1960
|
-
function
|
|
1961
|
-
let { sidebarCollapsed: c, setSidebarCollapsed: l, colorMode: u, setColorMode: d } =
|
|
2491
|
+
function tn({ onMobileMenuToggle: e, breadcrumbs: t, showCommandTrigger: n = !0, commandTriggerLabel: r = "Search", commandShortcut: i = nt, currentPath: a, onNavigate: o, onCommandTrigger: s }) {
|
|
2492
|
+
let { sidebarCollapsed: c, setSidebarCollapsed: l, colorMode: u, setColorMode: d } = G();
|
|
1962
2493
|
function h() {
|
|
1963
|
-
d(
|
|
2494
|
+
d(Qt[(Qt.indexOf(u) + 1) % Qt.length]);
|
|
1964
2495
|
}
|
|
1965
|
-
let g =
|
|
2496
|
+
let g = $t[u];
|
|
1966
2497
|
return /* @__PURE__ */ m("header", {
|
|
1967
2498
|
className: "border-border bg-bg-secondary font-navigation flex h-9 shrink-0 items-center justify-between border-b px-3",
|
|
1968
2499
|
style: { height: "var(--topbar-height)" },
|
|
@@ -1973,59 +2504,63 @@ function Bt({ onMobileMenuToggle: e, breadcrumbs: t, showCommandTrigger: n = !0,
|
|
|
1973
2504
|
onClick: e,
|
|
1974
2505
|
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-7 w-7 cursor-pointer items-center justify-center rounded md:hidden",
|
|
1975
2506
|
"aria-label": "Toggle menu",
|
|
1976
|
-
children: /* @__PURE__ */ p(
|
|
2507
|
+
children: /* @__PURE__ */ p(ie, { className: "h-4 w-4" })
|
|
1977
2508
|
}),
|
|
1978
2509
|
/* @__PURE__ */ p("button", {
|
|
1979
2510
|
onClick: () => l(!c),
|
|
1980
2511
|
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover hidden h-7 w-7 cursor-pointer items-center justify-center rounded md:flex",
|
|
1981
2512
|
"aria-label": c ? "Expand sidebar" : "Collapse sidebar",
|
|
1982
|
-
children: p(c ?
|
|
2513
|
+
children: p(c ? ce : se, { className: "h-4 w-4" })
|
|
1983
2514
|
}),
|
|
1984
|
-
t !== !1 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", { className: "bg-border hidden h-4 w-px md:block" }), /* @__PURE__ */ p(
|
|
2515
|
+
t !== !1 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", { className: "bg-border hidden h-4 w-px md:block" }), /* @__PURE__ */ p(Lt, {
|
|
1985
2516
|
...t,
|
|
1986
2517
|
currentPath: a,
|
|
1987
2518
|
onNavigate: o
|
|
1988
2519
|
})] })
|
|
1989
2520
|
]
|
|
1990
|
-
}), /* @__PURE__ */ m("div", {
|
|
1991
|
-
className: "flex items-center gap-1",
|
|
1992
|
-
children: [
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2521
|
+
}), /* @__PURE__ */ m("div", {
|
|
2522
|
+
className: "flex items-center gap-1",
|
|
2523
|
+
children: [
|
|
2524
|
+
n && /* @__PURE__ */ m("button", {
|
|
2525
|
+
onClick: s ?? (() => rt()),
|
|
2526
|
+
className: "text-text-tertiary bg-bg-primary border-border hover:border-border-strong hover:text-text-secondary font-navigation hidden h-6 cursor-pointer items-center gap-2 rounded-md border px-2 transition-colors duration-[100ms] sm:flex",
|
|
2527
|
+
children: [
|
|
2528
|
+
/* @__PURE__ */ p(N, { className: "h-3 w-3" }),
|
|
2529
|
+
/* @__PURE__ */ p("span", {
|
|
2530
|
+
className: "text-2xs",
|
|
2531
|
+
children: r
|
|
2532
|
+
}),
|
|
2533
|
+
/* @__PURE__ */ p("kbd", {
|
|
2534
|
+
className: "text-2xs font-mono opacity-60",
|
|
2535
|
+
children: i.label
|
|
2536
|
+
})
|
|
2537
|
+
]
|
|
2538
|
+
}),
|
|
2539
|
+
/* @__PURE__ */ p("button", {
|
|
2540
|
+
onClick: h,
|
|
2541
|
+
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-7 w-7 cursor-pointer items-center justify-center rounded",
|
|
2542
|
+
"aria-label": `Color mode: ${en[u]}. Click to cycle.`,
|
|
2543
|
+
title: en[u],
|
|
2544
|
+
children: /* @__PURE__ */ p(g, { className: "h-4 w-4" })
|
|
2545
|
+
}),
|
|
2546
|
+
/* @__PURE__ */ p(Zt, {})
|
|
2547
|
+
]
|
|
2013
2548
|
})]
|
|
2014
2549
|
});
|
|
2015
2550
|
}
|
|
2016
2551
|
//#endregion
|
|
2017
2552
|
//#region src/components/app-shell/AppShell.tsx
|
|
2018
|
-
function
|
|
2553
|
+
function nn({ children: e, navSections: t, brand: n, accounts: r, bottomNavItems: i = [], commandItems: a, breadcrumbs: o, initialAccountIndex: s, onAccountChange: c, onSignOut: u, signOutPath: f, signOutLabel: h, settingsPath: g, settingsLabel: _, onOpenSettings: v, showCommandPalette: y = !0, showCommandTrigger: b = !0, commandTriggerLabel: x, commandShortcut: S, currentPath: C, onNavigate: w, mainClassName: T, className: E }) {
|
|
2019
2554
|
let [D, O] = d(!1), k = l(() => t.flatMap((e) => e.items), [t]), A = a ?? k;
|
|
2020
2555
|
return /* @__PURE__ */ m("div", {
|
|
2021
|
-
className:
|
|
2556
|
+
className: L("bg-bg-primary flex h-svh overflow-hidden", E),
|
|
2022
2557
|
children: [
|
|
2023
2558
|
/* @__PURE__ */ p("a", {
|
|
2024
2559
|
href: "#main-content",
|
|
2025
2560
|
className: "skip-link",
|
|
2026
2561
|
children: "Skip to content"
|
|
2027
2562
|
}),
|
|
2028
|
-
/* @__PURE__ */ p(
|
|
2563
|
+
/* @__PURE__ */ p(Ft, {
|
|
2029
2564
|
navSections: t,
|
|
2030
2565
|
brand: n,
|
|
2031
2566
|
accounts: r,
|
|
@@ -2042,7 +2577,7 @@ function Vt({ children: e, navSections: t, brand: n, accounts: r, bottomNavItems
|
|
|
2042
2577
|
}),
|
|
2043
2578
|
/* @__PURE__ */ m("div", {
|
|
2044
2579
|
className: "flex min-w-0 flex-1 flex-col",
|
|
2045
|
-
children: [/* @__PURE__ */ p(
|
|
2580
|
+
children: [/* @__PURE__ */ p(tn, {
|
|
2046
2581
|
onMobileMenuToggle: () => O(!0),
|
|
2047
2582
|
breadcrumbs: o,
|
|
2048
2583
|
showCommandTrigger: y && b,
|
|
@@ -2052,7 +2587,7 @@ function Vt({ children: e, navSections: t, brand: n, accounts: r, bottomNavItems
|
|
|
2052
2587
|
onNavigate: w
|
|
2053
2588
|
}), /* @__PURE__ */ p("main", {
|
|
2054
2589
|
id: "main-content",
|
|
2055
|
-
className:
|
|
2590
|
+
className: L("flex-1 overflow-y-auto p-4 pb-20 md:p-6 md:pb-6", T),
|
|
2056
2591
|
children: e
|
|
2057
2592
|
})]
|
|
2058
2593
|
}),
|
|
@@ -2079,9 +2614,9 @@ function Vt({ children: e, navSections: t, brand: n, accounts: r, bottomNavItems
|
|
|
2079
2614
|
}
|
|
2080
2615
|
//#endregion
|
|
2081
2616
|
//#region src/components/app-shell/AuthLayout.tsx
|
|
2082
|
-
function
|
|
2617
|
+
function rn({ children: e, className: t }) {
|
|
2083
2618
|
return /* @__PURE__ */ m("div", {
|
|
2084
|
-
className:
|
|
2619
|
+
className: L("bg-bg-primary relative flex min-h-svh items-center justify-center p-4", t),
|
|
2085
2620
|
children: [/* @__PURE__ */ p("div", {
|
|
2086
2621
|
className: "pointer-events-none absolute inset-0 opacity-30",
|
|
2087
2622
|
style: { background: "radial-gradient(ellipse at 50% 30%, var(--accent-muted) 0%, transparent 60%)" }
|
|
@@ -2090,27 +2625,27 @@ function Ht({ children: e, className: t }) {
|
|
|
2090
2625
|
}
|
|
2091
2626
|
//#endregion
|
|
2092
2627
|
//#region src/components/app-shell/BackLink.tsx
|
|
2093
|
-
function
|
|
2628
|
+
function an({ to: e, children: t, onNavigate: n, className: r }) {
|
|
2094
2629
|
return /* @__PURE__ */ m("a", {
|
|
2095
2630
|
href: e,
|
|
2096
|
-
onClick: (t) =>
|
|
2097
|
-
className:
|
|
2631
|
+
onClick: (t) => z(t, e, n),
|
|
2632
|
+
className: L("inline-flex items-center gap-1.5", "text-text-tertiary text-xs", "hover:text-text-primary", r),
|
|
2098
2633
|
children: [/* @__PURE__ */ p(v, { className: "h-3.5 w-3.5" }), t]
|
|
2099
2634
|
});
|
|
2100
2635
|
}
|
|
2101
2636
|
//#endregion
|
|
2102
2637
|
//#region src/components/ui/Checkbox.tsx
|
|
2103
|
-
function
|
|
2638
|
+
function on({ checked: e, indeterminate: t, onChange: n, label: r, disabled: i, className: a }) {
|
|
2104
2639
|
let o = e || t;
|
|
2105
2640
|
return /* @__PURE__ */ m("label", {
|
|
2106
|
-
className:
|
|
2641
|
+
className: L("flex w-fit items-center gap-2.5", i ? "cursor-not-allowed opacity-40" : "cursor-pointer", a),
|
|
2107
2642
|
children: [/* @__PURE__ */ p("button", {
|
|
2108
2643
|
role: "checkbox",
|
|
2109
2644
|
"aria-checked": t ? "mixed" : e,
|
|
2110
2645
|
disabled: i,
|
|
2111
2646
|
onClick: () => n(!e),
|
|
2112
|
-
className:
|
|
2113
|
-
children: t ? /* @__PURE__ */ p(
|
|
2647
|
+
className: L("flex h-4 w-4 shrink-0 items-center justify-center rounded border", "transition-colors duration-[100ms]", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2", o ? "bg-accent border-accent" : "bg-bg-secondary border-border", !i && "cursor-pointer"),
|
|
2648
|
+
children: t ? /* @__PURE__ */ p(ae, { className: "text-text-on-accent h-3 w-3" }) : e ? /* @__PURE__ */ p(S, { className: "text-text-on-accent h-3 w-3" }) : null
|
|
2114
2649
|
}), r && /* @__PURE__ */ p("span", {
|
|
2115
2650
|
className: "text-text-primary text-xs",
|
|
2116
2651
|
children: r
|
|
@@ -2119,10 +2654,10 @@ function Wt({ checked: e, indeterminate: t, onChange: n, label: r, disabled: i,
|
|
|
2119
2654
|
}
|
|
2120
2655
|
//#endregion
|
|
2121
2656
|
//#region src/components/ui/FilterButton.tsx
|
|
2122
|
-
var
|
|
2657
|
+
var sn = r(function({ icon: e, children: t, className: n, ...r }, i) {
|
|
2123
2658
|
return /* @__PURE__ */ m("button", {
|
|
2124
2659
|
ref: i,
|
|
2125
|
-
className:
|
|
2660
|
+
className: L("flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2.5", "border-border bg-bg-secondary text-text-secondary border", "hover:bg-bg-hover hover:border-border-strong", "text-xs", "transition-colors duration-[100ms]", n),
|
|
2126
2661
|
...r,
|
|
2127
2662
|
children: [/* @__PURE__ */ p(e, { className: "h-3.5 w-3.5 shrink-0" }), t && /* @__PURE__ */ p("span", {
|
|
2128
2663
|
className: "hidden sm:inline",
|
|
@@ -2132,12 +2667,12 @@ var Gt = r(function({ icon: e, children: t, className: n, ...r }, i) {
|
|
|
2132
2667
|
});
|
|
2133
2668
|
//#endregion
|
|
2134
2669
|
//#region src/components/tables/ColumnPicker.tsx
|
|
2135
|
-
function
|
|
2670
|
+
function cn({ columns: e, hidden: t, onToggle: n }) {
|
|
2136
2671
|
let [r, a] = d(!1), o = u(null);
|
|
2137
2672
|
return W(r, i(() => a(!1), []), [o]), /* @__PURE__ */ m("div", {
|
|
2138
2673
|
className: "relative",
|
|
2139
2674
|
ref: o,
|
|
2140
|
-
children: [/* @__PURE__ */ p(
|
|
2675
|
+
children: [/* @__PURE__ */ p(sn, {
|
|
2141
2676
|
icon: O,
|
|
2142
2677
|
onClick: () => a(!r),
|
|
2143
2678
|
children: "Columns"
|
|
@@ -2149,7 +2684,7 @@ function Kt({ columns: e, hidden: t, onToggle: n }) {
|
|
|
2149
2684
|
}), e.map((e) => /* @__PURE__ */ m("button", {
|
|
2150
2685
|
onClick: () => n(e.key),
|
|
2151
2686
|
className: "text-text-secondary hover:text-text-primary hover:bg-bg-hover flex h-7 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
|
|
2152
|
-
children: [/* @__PURE__ */ p(
|
|
2687
|
+
children: [/* @__PURE__ */ p(on, {
|
|
2153
2688
|
checked: !t.has(e.key),
|
|
2154
2689
|
onChange: () => n(e.key)
|
|
2155
2690
|
}), /* @__PURE__ */ p("span", { children: e.header })]
|
|
@@ -2159,7 +2694,7 @@ function Kt({ columns: e, hidden: t, onToggle: n }) {
|
|
|
2159
2694
|
}
|
|
2160
2695
|
//#endregion
|
|
2161
2696
|
//#region src/components/tables/Pagination.tsx
|
|
2162
|
-
function
|
|
2697
|
+
function ln({ page: e, totalPages: t, onPageChange: n }) {
|
|
2163
2698
|
if (t <= 1) return null;
|
|
2164
2699
|
let r = [];
|
|
2165
2700
|
for (let n = 1; n <= t; n++) n === 1 || n === t || n >= e - 1 && n <= e + 1 ? r.push(n) : r[r.length - 1] !== "ellipsis" && r.push("ellipsis");
|
|
@@ -2178,7 +2713,7 @@ function qt({ page: e, totalPages: t, onPageChange: n }) {
|
|
|
2178
2713
|
children: "..."
|
|
2179
2714
|
}, `e${r}`) : /* @__PURE__ */ p("button", {
|
|
2180
2715
|
onClick: () => n(t),
|
|
2181
|
-
className:
|
|
2716
|
+
className: L("flex h-7 w-7 cursor-pointer items-center justify-center rounded text-xs font-medium", "transition-colors duration-[100ms]", t === e ? "bg-accent text-text-on-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
2182
2717
|
children: t
|
|
2183
2718
|
}, t)),
|
|
2184
2719
|
/* @__PURE__ */ p("button", {
|
|
@@ -2193,7 +2728,7 @@ function qt({ page: e, totalPages: t, onPageChange: n }) {
|
|
|
2193
2728
|
}
|
|
2194
2729
|
//#endregion
|
|
2195
2730
|
//#region src/components/tables/sortRows.ts
|
|
2196
|
-
function
|
|
2731
|
+
function un(e, t, n, r) {
|
|
2197
2732
|
if (!n) return e;
|
|
2198
2733
|
let i = t.find((e) => e.key === n)?.getValue;
|
|
2199
2734
|
return i ? [...e].sort((e, t) => {
|
|
@@ -2203,8 +2738,8 @@ function Jt(e, t, n, r) {
|
|
|
2203
2738
|
}
|
|
2204
2739
|
//#endregion
|
|
2205
2740
|
//#region src/components/tables/ResourceTable.tsx
|
|
2206
|
-
function
|
|
2207
|
-
let c = s !== void 0, [u, f] = d(null), [h, g] = d("asc"), v = c ? a ?? null : u, b = c ? o ?? "asc" : h, x = l(() => c ? e :
|
|
2741
|
+
function dn({ data: e, columns: t, getRowId: n, onRowClick: r, emptyMessage: i = "No data", sortKey: a, sortDir: o, onSortChange: s }) {
|
|
2742
|
+
let c = s !== void 0, [u, f] = d(null), [h, g] = d("asc"), v = c ? a ?? null : u, b = c ? o ?? "asc" : h, x = l(() => c ? e : un(e, t, v, b), [
|
|
2208
2743
|
c,
|
|
2209
2744
|
e,
|
|
2210
2745
|
t,
|
|
@@ -2226,7 +2761,7 @@ function Yt({ data: e, columns: t, getRowId: n, onRowClick: r, emptyMessage: i =
|
|
|
2226
2761
|
children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ p("tr", {
|
|
2227
2762
|
className: "border-border bg-bg-secondary border-b",
|
|
2228
2763
|
children: t.map((e) => /* @__PURE__ */ p("th", {
|
|
2229
|
-
className:
|
|
2764
|
+
className: L("text-2xs text-text-tertiary font-label h-7 px-3 text-left font-semibold tracking-wider uppercase", e.sortable && "hover:text-text-secondary cursor-pointer select-none"),
|
|
2230
2765
|
style: { width: e.width },
|
|
2231
2766
|
onClick: e.sortable ? () => S(e.key) : void 0,
|
|
2232
2767
|
children: /* @__PURE__ */ m("span", {
|
|
@@ -2239,10 +2774,10 @@ function Yt({ data: e, columns: t, getRowId: n, onRowClick: r, emptyMessage: i =
|
|
|
2239
2774
|
className: "text-text-tertiary h-32 text-center",
|
|
2240
2775
|
children: i
|
|
2241
2776
|
}) }) : x.map((e) => /* @__PURE__ */ p("tr", {
|
|
2242
|
-
className:
|
|
2777
|
+
className: L("border-border h-8 border-b last:border-b-0", "hover:bg-bg-hover", r && "cursor-pointer"),
|
|
2243
2778
|
onClick: r ? () => r(e) : void 0,
|
|
2244
2779
|
children: t.map((t) => /* @__PURE__ */ p("td", {
|
|
2245
|
-
className:
|
|
2780
|
+
className: L("text-text-primary px-3 whitespace-nowrap", t.cellClassName),
|
|
2246
2781
|
onClick: t.interactive && r ? (e) => e.stopPropagation() : void 0,
|
|
2247
2782
|
children: t.render(e)
|
|
2248
2783
|
}, t.key))
|
|
@@ -2252,7 +2787,7 @@ function Yt({ data: e, columns: t, getRowId: n, onRowClick: r, emptyMessage: i =
|
|
|
2252
2787
|
}
|
|
2253
2788
|
//#endregion
|
|
2254
2789
|
//#region src/components/ui/Alert.tsx
|
|
2255
|
-
var
|
|
2790
|
+
var fn = {
|
|
2256
2791
|
success: {
|
|
2257
2792
|
bg: "bg-green-muted",
|
|
2258
2793
|
border: "border-green/30",
|
|
@@ -2268,24 +2803,24 @@ var Xt = {
|
|
|
2268
2803
|
error: {
|
|
2269
2804
|
bg: "bg-red-muted",
|
|
2270
2805
|
border: "border-red/30",
|
|
2271
|
-
icon:
|
|
2806
|
+
icon: fe,
|
|
2272
2807
|
iconColor: "text-red"
|
|
2273
2808
|
},
|
|
2274
2809
|
info: {
|
|
2275
2810
|
bg: "bg-blue-muted",
|
|
2276
2811
|
border: "border-blue/30",
|
|
2277
|
-
icon:
|
|
2812
|
+
icon: te,
|
|
2278
2813
|
iconColor: "text-blue"
|
|
2279
2814
|
}
|
|
2280
2815
|
};
|
|
2281
|
-
function
|
|
2816
|
+
function pn({ type: e, title: t, children: n, dismissible: r, className: i }) {
|
|
2282
2817
|
let [a, o] = d(!1);
|
|
2283
2818
|
if (a) return null;
|
|
2284
|
-
let s =
|
|
2819
|
+
let s = fn[e], c = s.icon;
|
|
2285
2820
|
return /* @__PURE__ */ m("div", {
|
|
2286
|
-
className:
|
|
2821
|
+
className: L("flex gap-2.5 rounded-md border p-3", s.bg, s.border, i),
|
|
2287
2822
|
children: [
|
|
2288
|
-
/* @__PURE__ */ p(c, { className:
|
|
2823
|
+
/* @__PURE__ */ p(c, { className: L("mt-0.5 h-4 w-4 shrink-0", s.iconColor) }),
|
|
2289
2824
|
/* @__PURE__ */ m("div", {
|
|
2290
2825
|
className: "min-w-0 flex-1",
|
|
2291
2826
|
children: [t && /* @__PURE__ */ p("p", {
|
|
@@ -2300,16 +2835,16 @@ function Zt({ type: e, title: t, children: n, dismissible: r, className: i }) {
|
|
|
2300
2835
|
onClick: () => o(!0),
|
|
2301
2836
|
className: "text-text-tertiary hover:text-text-primary flex h-5 w-5 cursor-pointer items-center justify-center rounded",
|
|
2302
2837
|
"aria-label": "Dismiss",
|
|
2303
|
-
children: /* @__PURE__ */ p(
|
|
2838
|
+
children: /* @__PURE__ */ p(P, { className: "h-3 w-3" })
|
|
2304
2839
|
})
|
|
2305
2840
|
]
|
|
2306
2841
|
});
|
|
2307
2842
|
}
|
|
2308
2843
|
//#endregion
|
|
2309
2844
|
//#region src/components/ui/AuthCard.tsx
|
|
2310
|
-
function
|
|
2845
|
+
function mn({ title: e, subtitle: t, icon: n, children: r, footer: i, className: a }) {
|
|
2311
2846
|
return /* @__PURE__ */ p("div", {
|
|
2312
|
-
className:
|
|
2847
|
+
className: L("relative z-10 w-full max-w-sm", a),
|
|
2313
2848
|
children: /* @__PURE__ */ m("div", {
|
|
2314
2849
|
className: "bg-bg-secondary border-border rounded-lg border p-8 shadow-lg",
|
|
2315
2850
|
children: [
|
|
@@ -2341,14 +2876,14 @@ function Qt({ title: e, subtitle: t, icon: n, children: r, footer: i, className:
|
|
|
2341
2876
|
}
|
|
2342
2877
|
//#endregion
|
|
2343
2878
|
//#region src/components/ui/AuthorByline.tsx
|
|
2344
|
-
function
|
|
2879
|
+
function hn({ name: e, meta: t, nameAppend: n, size: r = "sm", className: i }) {
|
|
2345
2880
|
return /* @__PURE__ */ m("div", {
|
|
2346
|
-
className:
|
|
2347
|
-
children: [/* @__PURE__ */ p(
|
|
2881
|
+
className: L("flex items-center gap-2", i),
|
|
2882
|
+
children: [/* @__PURE__ */ p(K, {
|
|
2348
2883
|
name: e,
|
|
2349
2884
|
size: "sm"
|
|
2350
2885
|
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("p", {
|
|
2351
|
-
className:
|
|
2886
|
+
className: L("text-text-primary font-label font-medium", r === "md" ? "text-xs" : "text-2xs"),
|
|
2352
2887
|
children: [e, n]
|
|
2353
2888
|
}), t && /* @__PURE__ */ p("p", {
|
|
2354
2889
|
className: "text-text-tertiary font-label text-2xs",
|
|
@@ -2358,14 +2893,14 @@ function $t({ name: e, meta: t, nameAppend: n, size: r = "sm", className: i }) {
|
|
|
2358
2893
|
}
|
|
2359
2894
|
//#endregion
|
|
2360
2895
|
//#region src/components/ui/Badge.tsx
|
|
2361
|
-
var
|
|
2896
|
+
var gn = {
|
|
2362
2897
|
green: "bg-green-muted text-green",
|
|
2363
2898
|
yellow: "bg-yellow-muted text-yellow",
|
|
2364
2899
|
red: "bg-red-muted text-red",
|
|
2365
2900
|
blue: "bg-blue-muted text-blue",
|
|
2366
2901
|
purple: "bg-purple-muted text-purple",
|
|
2367
2902
|
gray: "bg-bg-hover text-text-secondary"
|
|
2368
|
-
},
|
|
2903
|
+
}, _n = {
|
|
2369
2904
|
green: "bg-green",
|
|
2370
2905
|
yellow: "bg-yellow",
|
|
2371
2906
|
red: "bg-red",
|
|
@@ -2373,73 +2908,15 @@ var en = {
|
|
|
2373
2908
|
purple: "bg-purple",
|
|
2374
2909
|
gray: "bg-text-tertiary"
|
|
2375
2910
|
};
|
|
2376
|
-
function
|
|
2911
|
+
function vn({ color: e = "gray", dot: t, children: n, className: r }) {
|
|
2377
2912
|
return /* @__PURE__ */ m("span", {
|
|
2378
|
-
className:
|
|
2379
|
-
children: [t && /* @__PURE__ */ p("span", { className:
|
|
2913
|
+
className: L("font-label text-2xs inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 font-medium", gn[e], r),
|
|
2914
|
+
children: [t && /* @__PURE__ */ p("span", { className: L("h-1.5 w-1.5 rounded-full", _n[e]) }), n]
|
|
2380
2915
|
});
|
|
2381
2916
|
}
|
|
2382
2917
|
//#endregion
|
|
2383
|
-
//#region src/components/ui/Button.tsx
|
|
2384
|
-
var rn = {
|
|
2385
|
-
primary: "bg-accent text-text-on-accent hover:bg-accent-hover active:bg-accent-active",
|
|
2386
|
-
secondary: "bg-bg-secondary text-text-primary border border-border hover:bg-bg-hover hover:border-border-strong",
|
|
2387
|
-
danger: "bg-red-muted text-red border border-transparent hover:bg-red/20",
|
|
2388
|
-
ghost: "text-text-secondary hover:text-text-primary hover:bg-bg-hover",
|
|
2389
|
-
icon: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover"
|
|
2390
|
-
}, an = {
|
|
2391
|
-
sm: "h-7 px-2.5 text-xs gap-1.5",
|
|
2392
|
-
md: "h-8 px-3 text-xs gap-2",
|
|
2393
|
-
lg: "h-9 px-4 text-sm gap-2"
|
|
2394
|
-
}, on = {
|
|
2395
|
-
sm: "h-7 w-7",
|
|
2396
|
-
md: "h-8 w-8",
|
|
2397
|
-
lg: "h-9 w-9"
|
|
2398
|
-
}, sn = {
|
|
2399
|
-
sm: "h-3.5 w-3.5",
|
|
2400
|
-
md: "h-3.5 w-3.5",
|
|
2401
|
-
lg: "h-4 w-4"
|
|
2402
|
-
}, cn = {
|
|
2403
|
-
sm: "hidden sm:inline",
|
|
2404
|
-
md: "hidden md:inline",
|
|
2405
|
-
lg: "hidden lg:inline"
|
|
2406
|
-
}, ln = {
|
|
2407
|
-
sm: {
|
|
2408
|
-
sm: "px-1.5 sm:px-2.5",
|
|
2409
|
-
md: "px-2 sm:px-3",
|
|
2410
|
-
lg: "px-2.5 sm:px-4"
|
|
2411
|
-
},
|
|
2412
|
-
md: {
|
|
2413
|
-
sm: "px-1.5 md:px-2.5",
|
|
2414
|
-
md: "px-2 md:px-3",
|
|
2415
|
-
lg: "px-2.5 md:px-4"
|
|
2416
|
-
},
|
|
2417
|
-
lg: {
|
|
2418
|
-
sm: "px-1.5 lg:px-2.5",
|
|
2419
|
-
md: "px-2 lg:px-3",
|
|
2420
|
-
lg: "px-2.5 lg:px-4"
|
|
2421
|
-
}
|
|
2422
|
-
}, J = r(({ variant: e = "secondary", size: t = "md", loading: n, icon: r, hideLabel: i, className: a, children: o, disabled: s, ...c }, l) => {
|
|
2423
|
-
let u = e === "icon", d = i === !0 ? "sm" : i === !1 ? void 0 : i;
|
|
2424
|
-
return /* @__PURE__ */ m("button", {
|
|
2425
|
-
ref: l,
|
|
2426
|
-
disabled: s || n,
|
|
2427
|
-
className: I("inline-flex items-center justify-center rounded-md font-medium", "font-control", "transition-colors duration-[100ms] ease-out", "cursor-pointer", "disabled:cursor-not-allowed disabled:opacity-40", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2", rn[e], u ? on[t] : an[t], d && !u && ln[d]?.[t], a),
|
|
2428
|
-
...c,
|
|
2429
|
-
children: [
|
|
2430
|
-
n && /* @__PURE__ */ p(te, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
2431
|
-
r && !n && /* @__PURE__ */ p(r, { className: sn[t] }),
|
|
2432
|
-
o && (d ? /* @__PURE__ */ p("span", {
|
|
2433
|
-
className: cn[d],
|
|
2434
|
-
children: o
|
|
2435
|
-
}) : o)
|
|
2436
|
-
]
|
|
2437
|
-
});
|
|
2438
|
-
});
|
|
2439
|
-
J.displayName = "Button";
|
|
2440
|
-
//#endregion
|
|
2441
2918
|
//#region src/components/ui/CalendarGrid.tsx
|
|
2442
|
-
var
|
|
2919
|
+
var yn = [
|
|
2443
2920
|
"Mo",
|
|
2444
2921
|
"Tu",
|
|
2445
2922
|
"We",
|
|
@@ -2447,7 +2924,7 @@ var un = [
|
|
|
2447
2924
|
"Fr",
|
|
2448
2925
|
"Sa",
|
|
2449
2926
|
"Su"
|
|
2450
|
-
],
|
|
2927
|
+
], bn = [
|
|
2451
2928
|
"January",
|
|
2452
2929
|
"February",
|
|
2453
2930
|
"March",
|
|
@@ -2461,23 +2938,23 @@ var un = [
|
|
|
2461
2938
|
"November",
|
|
2462
2939
|
"December"
|
|
2463
2940
|
];
|
|
2464
|
-
function
|
|
2941
|
+
function xn(e, t) {
|
|
2465
2942
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
2466
2943
|
}
|
|
2467
|
-
function
|
|
2944
|
+
function Sn(e, t, n) {
|
|
2468
2945
|
if (!t || !n) return !1;
|
|
2469
2946
|
let r = e.getTime(), i = Math.min(t.getTime(), n.getTime()), a = Math.max(t.getTime(), n.getTime());
|
|
2470
2947
|
return r > i && r < a;
|
|
2471
2948
|
}
|
|
2472
|
-
function
|
|
2949
|
+
function Cn(e, t) {
|
|
2473
2950
|
return new Date(e, t + 1, 0).getDate();
|
|
2474
2951
|
}
|
|
2475
|
-
function
|
|
2952
|
+
function wn(e, t) {
|
|
2476
2953
|
let n = new Date(e, t, 1).getDay();
|
|
2477
2954
|
return n === 0 ? 6 : n - 1;
|
|
2478
2955
|
}
|
|
2479
|
-
function
|
|
2480
|
-
let h =
|
|
2956
|
+
function Tn({ year: e, month: t, selected: n, rangeStart: r, rangeEnd: i, hoverDate: a, onSelect: o, onMonthChange: s, onHover: c, minDate: l, maxDate: f }) {
|
|
2957
|
+
let h = Cn(e, t), g = wn(e, t), _ = /* @__PURE__ */ new Date(), v = u(null), [y, b] = d(null);
|
|
2481
2958
|
function x() {
|
|
2482
2959
|
return y !== null && y >= 1 && y <= h ? y : n && n.getFullYear() === e && n.getMonth() === t ? n.getDate() : r && r.getFullYear() === e && r.getMonth() === t ? r.getDate() : _.getFullYear() === e && _.getMonth() === t ? _.getDate() : 1;
|
|
2483
2960
|
}
|
|
@@ -2529,7 +3006,7 @@ function X({ year: e, month: t, selected: n, rangeStart: r, rangeEnd: i, hoverDa
|
|
|
2529
3006
|
className: "text-text-primary text-xs font-semibold",
|
|
2530
3007
|
"aria-live": "polite",
|
|
2531
3008
|
children: [
|
|
2532
|
-
|
|
3009
|
+
bn[t],
|
|
2533
3010
|
" ",
|
|
2534
3011
|
e
|
|
2535
3012
|
]
|
|
@@ -2544,24 +3021,24 @@ function X({ year: e, month: t, selected: n, rangeStart: r, rangeEnd: i, hoverDa
|
|
|
2544
3021
|
]
|
|
2545
3022
|
}), /* @__PURE__ */ m("div", {
|
|
2546
3023
|
className: "grid grid-cols-7 gap-0",
|
|
2547
|
-
children: [
|
|
3024
|
+
children: [yn.map((e) => /* @__PURE__ */ p("div", {
|
|
2548
3025
|
className: "text-text-tertiary text-2xs flex h-8 items-center justify-center font-medium",
|
|
2549
3026
|
children: e
|
|
2550
3027
|
}, e)), O.map((s, u) => {
|
|
2551
3028
|
if (s === null) return /* @__PURE__ */ p("div", { className: "h-8" }, `empty-${u}`);
|
|
2552
|
-
let d = new Date(e, t, s), m =
|
|
3029
|
+
let d = new Date(e, t, s), m = xn(d, _), h = n ? xn(d, n) : !1, g = r ? xn(d, r) : !1, v = i ? xn(d, i) : !1, y = Sn(d, r ?? null, i ?? a ?? null), b = l && d < l || f && d > f;
|
|
2553
3030
|
return /* @__PURE__ */ p("button", {
|
|
2554
3031
|
type: "button",
|
|
2555
3032
|
"data-day": s,
|
|
2556
3033
|
disabled: !!b,
|
|
2557
3034
|
tabIndex: s === S ? 0 : -1,
|
|
2558
|
-
"aria-label": `${
|
|
3035
|
+
"aria-label": `${bn[t]} ${s}, ${e}`,
|
|
2559
3036
|
"aria-current": m ? "date" : void 0,
|
|
2560
3037
|
onClick: () => o(d),
|
|
2561
3038
|
onKeyDown: (e) => C(e, s),
|
|
2562
3039
|
onMouseEnter: () => c?.(d),
|
|
2563
3040
|
onMouseLeave: () => c?.(null),
|
|
2564
|
-
className:
|
|
3041
|
+
className: L("flex h-8 w-full cursor-pointer items-center justify-center text-xs transition-colors duration-[100ms]", "rounded-md", b && "cursor-not-allowed opacity-30", !b && !h && !g && !v && !y && "hover:bg-bg-hover text-text-primary", m && !h && !g && !v && "text-accent font-semibold", (h || g || v) && "bg-accent text-text-on-accent font-semibold", y && !h && !g && !v && "bg-accent-muted text-accent"),
|
|
2565
3042
|
children: s
|
|
2566
3043
|
}, s);
|
|
2567
3044
|
})]
|
|
@@ -2570,9 +3047,9 @@ function X({ year: e, month: t, selected: n, rangeStart: r, rangeEnd: i, hoverDa
|
|
|
2570
3047
|
}
|
|
2571
3048
|
//#endregion
|
|
2572
3049
|
//#region src/components/ui/Card.tsx
|
|
2573
|
-
function
|
|
3050
|
+
function En({ children: e, className: t, header: n, footer: r }) {
|
|
2574
3051
|
return /* @__PURE__ */ m("div", {
|
|
2575
|
-
className:
|
|
3052
|
+
className: L("bg-bg-secondary border-border overflow-hidden rounded-md border", t),
|
|
2576
3053
|
children: [
|
|
2577
3054
|
n && /* @__PURE__ */ p("div", {
|
|
2578
3055
|
className: "border-border border-b px-3 py-2.5",
|
|
@@ -2591,7 +3068,7 @@ function hn({ children: e, className: t, header: n, footer: r }) {
|
|
|
2591
3068
|
}
|
|
2592
3069
|
//#endregion
|
|
2593
3070
|
//#region src/components/ui/Combobox.tsx
|
|
2594
|
-
function
|
|
3071
|
+
function Dn({ options: e, value: t, onChange: n, placeholder: r = "Select...", label: a, className: o }) {
|
|
2595
3072
|
let [c, l] = d(!1), [f, h] = d(""), [g, _] = d(0), v = u(null), y = u(null), b = s(), x = e.find((e) => e.value === t), C = e.filter((e) => e.label.toLowerCase().includes(f.toLowerCase()));
|
|
2596
3073
|
function T(e) {
|
|
2597
3074
|
h(e), _(0);
|
|
@@ -2617,7 +3094,7 @@ function gn({ options: e, value: t, onChange: n, placeholder: r = "Select...", l
|
|
|
2617
3094
|
l(!0), h(""), _(0), setTimeout(() => y.current?.focus(), 0);
|
|
2618
3095
|
}
|
|
2619
3096
|
return /* @__PURE__ */ m("div", {
|
|
2620
|
-
className:
|
|
3097
|
+
className: L("flex flex-col gap-1.5", o),
|
|
2621
3098
|
ref: v,
|
|
2622
3099
|
children: [a && /* @__PURE__ */ p("span", {
|
|
2623
3100
|
className: "text-text-secondary font-label text-xs font-medium",
|
|
@@ -2631,20 +3108,20 @@ function gn({ options: e, value: t, onChange: n, placeholder: r = "Select...", l
|
|
|
2631
3108
|
/* @__PURE__ */ p("button", {
|
|
2632
3109
|
type: "button",
|
|
2633
3110
|
onClick: () => c ? l(!1) : D(),
|
|
2634
|
-
className:
|
|
3111
|
+
className: L("font-control flex h-7 w-full cursor-pointer items-center rounded-md px-2 pr-7 text-xs", "bg-bg-secondary border-border text-text-primary border", "hover:bg-bg-hover hover:border-border-strong", "transition-colors duration-[100ms]", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2"),
|
|
2635
3112
|
children: x ? x.label : /* @__PURE__ */ p("span", {
|
|
2636
3113
|
className: "text-text-disabled",
|
|
2637
3114
|
children: r
|
|
2638
3115
|
})
|
|
2639
3116
|
}),
|
|
2640
|
-
/* @__PURE__ */ p(w, { className:
|
|
3117
|
+
/* @__PURE__ */ p(w, { className: L("text-text-tertiary pointer-events-none absolute top-1/2 right-2.5 h-3.5 w-3.5 -translate-y-1/2 transition-transform", c && "rotate-180") }),
|
|
2641
3118
|
c && /* @__PURE__ */ m("div", {
|
|
2642
3119
|
className: "bg-bg-tertiary border-border-strong animate-scale-in absolute top-full right-0 left-0 z-50 mt-1 overflow-hidden rounded-md border shadow-lg",
|
|
2643
3120
|
children: [/* @__PURE__ */ p("div", {
|
|
2644
3121
|
className: "border-border border-b p-1.5",
|
|
2645
3122
|
children: /* @__PURE__ */ m("div", {
|
|
2646
3123
|
className: "relative",
|
|
2647
|
-
children: [/* @__PURE__ */ p(
|
|
3124
|
+
children: [/* @__PURE__ */ p(N, { className: "text-text-tertiary absolute top-1/2 left-2 h-3 w-3 -translate-y-1/2" }), /* @__PURE__ */ p("input", {
|
|
2648
3125
|
ref: y,
|
|
2649
3126
|
type: "text",
|
|
2650
3127
|
"aria-label": "Search options",
|
|
@@ -2673,7 +3150,7 @@ function gn({ options: e, value: t, onChange: n, placeholder: r = "Select...", l
|
|
|
2673
3150
|
n(e.value), l(!1);
|
|
2674
3151
|
},
|
|
2675
3152
|
onMouseEnter: () => _(r),
|
|
2676
|
-
className:
|
|
3153
|
+
className: L("font-control flex h-7 w-full cursor-pointer items-center gap-2 px-3 text-xs", "transition-colors duration-[100ms]", r === g ? "bg-accent-muted text-accent" : e.value === t ? "text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
2677
3154
|
children: [/* @__PURE__ */ p("span", {
|
|
2678
3155
|
className: "flex-1 truncate",
|
|
2679
3156
|
children: e.label
|
|
@@ -2687,9 +3164,9 @@ function gn({ options: e, value: t, onChange: n, placeholder: r = "Select...", l
|
|
|
2687
3164
|
}
|
|
2688
3165
|
//#endregion
|
|
2689
3166
|
//#region src/components/ui/DangerZone.tsx
|
|
2690
|
-
function
|
|
3167
|
+
function On({ title: e = "Danger Zone", description: t, children: n, className: r }) {
|
|
2691
3168
|
return /* @__PURE__ */ m("div", {
|
|
2692
|
-
className:
|
|
3169
|
+
className: L("border-border mt-8 border-t pt-6", r),
|
|
2693
3170
|
children: [
|
|
2694
3171
|
/* @__PURE__ */ p("h3", {
|
|
2695
3172
|
className: "text-red mb-2 text-xs font-semibold",
|
|
@@ -2704,18 +3181,8 @@ function _n({ title: e = "Danger Zone", description: t, children: n, className:
|
|
|
2704
3181
|
});
|
|
2705
3182
|
}
|
|
2706
3183
|
//#endregion
|
|
2707
|
-
//#region src/hooks/useDropUp.ts
|
|
2708
|
-
function vn(e, t, n) {
|
|
2709
|
-
let [r, i] = d(!1);
|
|
2710
|
-
return c(() => {
|
|
2711
|
-
if (!e || !n.current || !t.current) return;
|
|
2712
|
-
let r = t.current.getBoundingClientRect(), a = n.current.getBoundingClientRect();
|
|
2713
|
-
i(window.innerHeight - r.bottom < a.height + 8);
|
|
2714
|
-
}, [e]), r;
|
|
2715
|
-
}
|
|
2716
|
-
//#endregion
|
|
2717
3184
|
//#region src/components/ui/DatePicker.tsx
|
|
2718
|
-
function
|
|
3185
|
+
function kn(e) {
|
|
2719
3186
|
return `${[
|
|
2720
3187
|
"Jan",
|
|
2721
3188
|
"Feb",
|
|
@@ -2731,8 +3198,8 @@ function yn(e) {
|
|
|
2731
3198
|
"Dec"
|
|
2732
3199
|
][e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`;
|
|
2733
3200
|
}
|
|
2734
|
-
function
|
|
2735
|
-
let [o, s] = d(!1), c = u(null), l = u(null), f =
|
|
3201
|
+
function An({ label: e, value: t, onChange: n, placeholder: r = "Select date...", format: a = kn }) {
|
|
3202
|
+
let [o, s] = d(!1), c = u(null), l = u(null), f = Gt(o, c, l), h = /* @__PURE__ */ new Date(), [g, _] = d(t?.getFullYear() ?? h.getFullYear()), [v, y] = d(t?.getMonth() ?? h.getMonth());
|
|
2736
3203
|
W(o, i(() => s(!1), []), [c]);
|
|
2737
3204
|
function b(e) {
|
|
2738
3205
|
n(e), s(!1);
|
|
@@ -2754,7 +3221,7 @@ function bn({ label: e, value: t, onChange: n, placeholder: r = "Select date..."
|
|
|
2754
3221
|
onClick: S,
|
|
2755
3222
|
"aria-haspopup": "dialog",
|
|
2756
3223
|
"aria-expanded": o,
|
|
2757
|
-
className:
|
|
3224
|
+
className: L("flex h-7 w-full cursor-pointer items-center rounded-md text-xs", "bg-bg-secondary border-border text-text-primary border", "hover:bg-bg-hover hover:border-border-strong", "transition-colors duration-[100ms]", "px-2 pr-7"),
|
|
2758
3225
|
children: t ? a(t) : /* @__PURE__ */ p("span", {
|
|
2759
3226
|
className: "text-text-disabled",
|
|
2760
3227
|
children: r
|
|
@@ -2765,8 +3232,8 @@ function bn({ label: e, value: t, onChange: n, placeholder: r = "Select date..."
|
|
|
2765
3232
|
ref: l,
|
|
2766
3233
|
role: "dialog",
|
|
2767
3234
|
"aria-label": "Choose date",
|
|
2768
|
-
className:
|
|
2769
|
-
children: /* @__PURE__ */ p(
|
|
3235
|
+
className: L("bg-bg-tertiary border-border-strong animate-scale-in absolute left-0 z-[100] rounded-md border p-3 shadow-lg", f ? "bottom-full mb-1" : "top-full mt-1"),
|
|
3236
|
+
children: /* @__PURE__ */ p(Tn, {
|
|
2770
3237
|
year: g,
|
|
2771
3238
|
month: v,
|
|
2772
3239
|
selected: t,
|
|
@@ -2782,7 +3249,7 @@ function bn({ label: e, value: t, onChange: n, placeholder: r = "Select date..."
|
|
|
2782
3249
|
}
|
|
2783
3250
|
//#endregion
|
|
2784
3251
|
//#region src/components/ui/DateRangePicker.tsx
|
|
2785
|
-
var
|
|
3252
|
+
var jn = [
|
|
2786
3253
|
"Jan",
|
|
2787
3254
|
"Feb",
|
|
2788
3255
|
"Mar",
|
|
@@ -2796,14 +3263,14 @@ var xn = [
|
|
|
2796
3263
|
"Nov",
|
|
2797
3264
|
"Dec"
|
|
2798
3265
|
];
|
|
2799
|
-
function
|
|
2800
|
-
return `${
|
|
3266
|
+
function Mn(e) {
|
|
3267
|
+
return `${jn[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`;
|
|
2801
3268
|
}
|
|
2802
|
-
function
|
|
2803
|
-
return e.start && e.end ? `${
|
|
3269
|
+
function Nn(e) {
|
|
3270
|
+
return e.start && e.end ? `${Mn(e.start)} – ${Mn(e.end)}` : e.start ? Mn(e.start) : "";
|
|
2804
3271
|
}
|
|
2805
|
-
function
|
|
2806
|
-
let [a, o] = d(!1), s = u(null), c = u(null), l =
|
|
3272
|
+
function Pn({ label: e, value: t, onChange: n, placeholder: r = "Select date range..." }) {
|
|
3273
|
+
let [a, o] = d(!1), s = u(null), c = u(null), l = Gt(a, s, c), f = /* @__PURE__ */ new Date(), [h, g] = d(t.start?.getFullYear() ?? f.getFullYear()), [_, v] = d(t.start?.getMonth() ?? f.getMonth()), [y, b] = d(null), [S, C] = d("start"), [w, T] = d(t.start), [E, D] = d(t.end);
|
|
2807
3274
|
W(a, i(() => o(!1), []), [s]);
|
|
2808
3275
|
let O = _ === 11 ? h + 1 : h, k = _ === 11 ? 0 : _ + 1;
|
|
2809
3276
|
function A() {
|
|
@@ -2815,13 +3282,13 @@ function wn({ label: e, value: t, onChange: n, placeholder: r = "Select date ran
|
|
|
2815
3282
|
end: w && e < w ? w : e
|
|
2816
3283
|
}), o(!1));
|
|
2817
3284
|
}
|
|
2818
|
-
function
|
|
3285
|
+
function te() {
|
|
2819
3286
|
_ === 0 ? (g(h - 1), v(11)) : v(_ - 1);
|
|
2820
3287
|
}
|
|
2821
|
-
function
|
|
3288
|
+
function ne() {
|
|
2822
3289
|
_ === 11 ? (g(h + 1), v(0)) : v(_ + 1);
|
|
2823
3290
|
}
|
|
2824
|
-
let
|
|
3291
|
+
let re = t.start || t.end ? Nn(t) : "";
|
|
2825
3292
|
return /* @__PURE__ */ m("div", {
|
|
2826
3293
|
className: "flex flex-col gap-1.5",
|
|
2827
3294
|
ref: s,
|
|
@@ -2836,8 +3303,8 @@ function wn({ label: e, value: t, onChange: n, placeholder: r = "Select date ran
|
|
|
2836
3303
|
onClick: A,
|
|
2837
3304
|
"aria-haspopup": "dialog",
|
|
2838
3305
|
"aria-expanded": a,
|
|
2839
|
-
className:
|
|
2840
|
-
children:
|
|
3306
|
+
className: L("flex h-7 w-full cursor-pointer items-center rounded-md text-xs", "bg-bg-secondary border-border text-text-primary border", "hover:bg-bg-hover hover:border-border-strong", "transition-colors duration-[100ms]", "px-2 pr-7"),
|
|
3307
|
+
children: re || /* @__PURE__ */ p("span", {
|
|
2841
3308
|
className: "text-text-disabled",
|
|
2842
3309
|
children: r
|
|
2843
3310
|
})
|
|
@@ -2847,13 +3314,13 @@ function wn({ label: e, value: t, onChange: n, placeholder: r = "Select date ran
|
|
|
2847
3314
|
ref: c,
|
|
2848
3315
|
role: "dialog",
|
|
2849
3316
|
"aria-label": "Choose date range",
|
|
2850
|
-
className:
|
|
3317
|
+
className: L("bg-bg-tertiary border-border-strong animate-scale-in absolute left-0 z-[100] rounded-md border p-3 shadow-lg", l ? "bottom-full mb-1" : "top-full mt-1"),
|
|
2851
3318
|
children: [/* @__PURE__ */ m("div", {
|
|
2852
3319
|
className: "mb-2 flex items-center justify-between",
|
|
2853
3320
|
children: [
|
|
2854
3321
|
/* @__PURE__ */ p("button", {
|
|
2855
3322
|
type: "button",
|
|
2856
|
-
onClick:
|
|
3323
|
+
onClick: te,
|
|
2857
3324
|
"aria-label": "Previous month",
|
|
2858
3325
|
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-6 w-6 cursor-pointer items-center justify-center rounded-md transition-colors duration-[100ms]",
|
|
2859
3326
|
children: /* @__PURE__ */ p("span", {
|
|
@@ -2868,7 +3335,7 @@ function wn({ label: e, value: t, onChange: n, placeholder: r = "Select date ran
|
|
|
2868
3335
|
}),
|
|
2869
3336
|
/* @__PURE__ */ p("button", {
|
|
2870
3337
|
type: "button",
|
|
2871
|
-
onClick:
|
|
3338
|
+
onClick: ne,
|
|
2872
3339
|
"aria-label": "Next month",
|
|
2873
3340
|
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-6 w-6 cursor-pointer items-center justify-center rounded-md transition-colors duration-[100ms]",
|
|
2874
3341
|
children: /* @__PURE__ */ p("span", {
|
|
@@ -2879,7 +3346,7 @@ function wn({ label: e, value: t, onChange: n, placeholder: r = "Select date ran
|
|
|
2879
3346
|
]
|
|
2880
3347
|
}), /* @__PURE__ */ m("div", {
|
|
2881
3348
|
className: "flex gap-4",
|
|
2882
|
-
children: [/* @__PURE__ */ p(
|
|
3349
|
+
children: [/* @__PURE__ */ p(Tn, {
|
|
2883
3350
|
year: h,
|
|
2884
3351
|
month: _,
|
|
2885
3352
|
rangeStart: w,
|
|
@@ -2890,7 +3357,7 @@ function wn({ label: e, value: t, onChange: n, placeholder: r = "Select date ran
|
|
|
2890
3357
|
g(e), v(t);
|
|
2891
3358
|
},
|
|
2892
3359
|
onHover: b
|
|
2893
|
-
}), /* @__PURE__ */ p(
|
|
3360
|
+
}), /* @__PURE__ */ p(Tn, {
|
|
2894
3361
|
year: O,
|
|
2895
3362
|
month: k,
|
|
2896
3363
|
rangeStart: w,
|
|
@@ -2910,7 +3377,7 @@ function wn({ label: e, value: t, onChange: n, placeholder: r = "Select date ran
|
|
|
2910
3377
|
}
|
|
2911
3378
|
//#endregion
|
|
2912
3379
|
//#region src/components/ui/DateTimePicker.tsx
|
|
2913
|
-
var
|
|
3380
|
+
var Fn = [
|
|
2914
3381
|
"Jan",
|
|
2915
3382
|
"Feb",
|
|
2916
3383
|
"Mar",
|
|
@@ -2924,7 +3391,7 @@ var Tn = [
|
|
|
2924
3391
|
"Nov",
|
|
2925
3392
|
"Dec"
|
|
2926
3393
|
];
|
|
2927
|
-
function
|
|
3394
|
+
function In(e) {
|
|
2928
3395
|
return e === 0 ? {
|
|
2929
3396
|
hour12: 12,
|
|
2930
3397
|
period: "AM"
|
|
@@ -2939,21 +3406,21 @@ function En(e) {
|
|
|
2939
3406
|
period: "PM"
|
|
2940
3407
|
};
|
|
2941
3408
|
}
|
|
2942
|
-
function
|
|
3409
|
+
function Ln(e, t) {
|
|
2943
3410
|
return t === "AM" ? e === 12 ? 0 : e : e === 12 ? 12 : e + 12;
|
|
2944
3411
|
}
|
|
2945
|
-
function
|
|
2946
|
-
let t =
|
|
3412
|
+
function Rn(e) {
|
|
3413
|
+
let t = Fn[e.getMonth()], n = e.getDate(), r = e.getFullYear(), { hour12: i, period: a } = In(e.getHours());
|
|
2947
3414
|
return `${t} ${n}, ${r} ${i}:${String(e.getMinutes()).padStart(2, "0")} ${a}`;
|
|
2948
3415
|
}
|
|
2949
|
-
function
|
|
3416
|
+
function zn(e) {
|
|
2950
3417
|
return String(e).padStart(2, "0");
|
|
2951
3418
|
}
|
|
2952
|
-
function
|
|
2953
|
-
let [a, o] = d(!1), s = u(null), c = u(null), l =
|
|
3419
|
+
function Bn({ label: e, value: t, onChange: n, placeholder: r = "Select date & time..." }) {
|
|
3420
|
+
let [a, o] = d(!1), s = u(null), c = u(null), l = Gt(a, s, c), f = /* @__PURE__ */ new Date(), h = t ? In(t.getHours()) : {
|
|
2954
3421
|
hour12: 12,
|
|
2955
3422
|
period: "PM"
|
|
2956
|
-
}, [g, _] = d(t?.getFullYear() ?? f.getFullYear()), [v, y] = d(t?.getMonth() ?? f.getMonth()), [b, S] = d(String(h.hour12)), [C, w] = d(t ?
|
|
3423
|
+
}, [g, _] = d(t?.getFullYear() ?? f.getFullYear()), [v, y] = d(t?.getMonth() ?? f.getMonth()), [b, S] = d(String(h.hour12)), [C, w] = d(t ? zn(t.getMinutes()) : "00"), [T, E] = d(h.period), [D, O] = d(t);
|
|
2957
3424
|
W(a, i(() => o(!1), []), [s]);
|
|
2958
3425
|
function k(e) {
|
|
2959
3426
|
O(e);
|
|
@@ -2966,14 +3433,14 @@ function An({ label: e, value: t, onChange: n, placeholder: r = "Select date & t
|
|
|
2966
3433
|
}
|
|
2967
3434
|
function ee() {
|
|
2968
3435
|
if (!D) return;
|
|
2969
|
-
let e = Math.max(1, Math.min(12, parseInt(b, 10) || 12)), t = Math.max(0, Math.min(59, parseInt(C, 10) || 0)), r =
|
|
3436
|
+
let e = Math.max(1, Math.min(12, parseInt(b, 10) || 12)), t = Math.max(0, Math.min(59, parseInt(C, 10) || 0)), r = Ln(e, T);
|
|
2970
3437
|
n(new Date(D.getFullYear(), D.getMonth(), D.getDate(), r, t)), o(!1);
|
|
2971
3438
|
}
|
|
2972
|
-
function
|
|
3439
|
+
function te() {
|
|
2973
3440
|
if (!a && t) {
|
|
2974
3441
|
_(t.getFullYear()), y(t.getMonth()), O(t);
|
|
2975
|
-
let e =
|
|
2976
|
-
S(String(e.hour12)), E(e.period), w(
|
|
3442
|
+
let e = In(t.getHours());
|
|
3443
|
+
S(String(e.hour12)), E(e.period), w(zn(t.getMinutes()));
|
|
2977
3444
|
}
|
|
2978
3445
|
o(!a);
|
|
2979
3446
|
}
|
|
@@ -2988,11 +3455,11 @@ function An({ label: e, value: t, onChange: n, placeholder: r = "Select date & t
|
|
|
2988
3455
|
children: [
|
|
2989
3456
|
/* @__PURE__ */ p("button", {
|
|
2990
3457
|
type: "button",
|
|
2991
|
-
onClick:
|
|
3458
|
+
onClick: te,
|
|
2992
3459
|
"aria-haspopup": "dialog",
|
|
2993
3460
|
"aria-expanded": a,
|
|
2994
|
-
className:
|
|
2995
|
-
children: t ?
|
|
3461
|
+
className: L("flex h-7 w-full cursor-pointer items-center rounded-md text-xs", "bg-bg-secondary border-border text-text-primary border", "hover:bg-bg-hover hover:border-border-strong", "transition-colors duration-[100ms]", "px-2 pr-7"),
|
|
3462
|
+
children: t ? Rn(t) : /* @__PURE__ */ p("span", {
|
|
2996
3463
|
className: "text-text-disabled",
|
|
2997
3464
|
children: r
|
|
2998
3465
|
})
|
|
@@ -3002,8 +3469,8 @@ function An({ label: e, value: t, onChange: n, placeholder: r = "Select date & t
|
|
|
3002
3469
|
ref: c,
|
|
3003
3470
|
role: "dialog",
|
|
3004
3471
|
"aria-label": "Choose date and time",
|
|
3005
|
-
className:
|
|
3006
|
-
children: [/* @__PURE__ */ p(
|
|
3472
|
+
className: L("bg-bg-tertiary border-border-strong animate-scale-in absolute left-0 z-[100] rounded-md border p-3 shadow-lg", l ? "bottom-full mb-1" : "top-full mt-1"),
|
|
3473
|
+
children: [/* @__PURE__ */ p(Tn, {
|
|
3007
3474
|
year: g,
|
|
3008
3475
|
month: v,
|
|
3009
3476
|
selected: D,
|
|
@@ -3053,13 +3520,13 @@ function An({ label: e, value: t, onChange: n, placeholder: r = "Select date & t
|
|
|
3053
3520
|
type: "button",
|
|
3054
3521
|
onClick: () => E("AM"),
|
|
3055
3522
|
"aria-pressed": T === "AM",
|
|
3056
|
-
className:
|
|
3523
|
+
className: L("text-2xs cursor-pointer px-2 py-0.5 font-medium transition-colors duration-[100ms]", T === "AM" ? "bg-accent text-text-on-accent" : "bg-bg-secondary text-text-secondary hover:bg-bg-hover"),
|
|
3057
3524
|
children: "AM"
|
|
3058
3525
|
}), /* @__PURE__ */ p("button", {
|
|
3059
3526
|
type: "button",
|
|
3060
3527
|
onClick: () => E("PM"),
|
|
3061
3528
|
"aria-pressed": T === "PM",
|
|
3062
|
-
className:
|
|
3529
|
+
className: L("text-2xs cursor-pointer px-2 py-0.5 font-medium transition-colors duration-[100ms]", T === "PM" ? "bg-accent text-text-on-accent" : "bg-bg-secondary text-text-secondary hover:bg-bg-hover"),
|
|
3063
3530
|
children: "PM"
|
|
3064
3531
|
})]
|
|
3065
3532
|
}),
|
|
@@ -3067,7 +3534,7 @@ function An({ label: e, value: t, onChange: n, placeholder: r = "Select date & t
|
|
|
3067
3534
|
type: "button",
|
|
3068
3535
|
onClick: ee,
|
|
3069
3536
|
disabled: !D,
|
|
3070
|
-
className:
|
|
3537
|
+
className: L("ml-auto h-6 rounded-md px-3 text-xs font-medium transition-colors duration-[100ms]", D ? "bg-accent text-text-on-accent hover:bg-accent-hover cursor-pointer" : "bg-bg-hover text-text-disabled cursor-not-allowed"),
|
|
3071
3538
|
children: "Apply"
|
|
3072
3539
|
})
|
|
3073
3540
|
]
|
|
@@ -3079,8 +3546,8 @@ function An({ label: e, value: t, onChange: n, placeholder: r = "Select date & t
|
|
|
3079
3546
|
}
|
|
3080
3547
|
//#endregion
|
|
3081
3548
|
//#region src/components/ui/DetailPanel.tsx
|
|
3082
|
-
var
|
|
3083
|
-
function
|
|
3549
|
+
var Vn = 360, Hn = 260, Un = 700;
|
|
3550
|
+
function Wn({ open: e, onClose: t, title: n, children: r, className: a, resizable: s = !0, defaultWidth: c = Vn, minWidth: l = Hn, maxWidth: f = Un }) {
|
|
3084
3551
|
let [h, g] = d(c), _ = u(!1), v = u(0), y = u(0);
|
|
3085
3552
|
o(() => {
|
|
3086
3553
|
if (!e) return;
|
|
@@ -3099,7 +3566,7 @@ function Pn({ open: e, onClose: t, title: n, children: r, className: a, resizabl
|
|
|
3099
3566
|
_.current = !1;
|
|
3100
3567
|
}, []);
|
|
3101
3568
|
return /* @__PURE__ */ p("div", {
|
|
3102
|
-
className:
|
|
3569
|
+
className: L("border-border bg-bg-secondary relative shrink-0 overflow-hidden border-l", "transition-[width] duration-[200ms] ease-out", a),
|
|
3103
3570
|
style: { width: e ? h : 0 },
|
|
3104
3571
|
children: e && /* @__PURE__ */ m("div", {
|
|
3105
3572
|
className: "animate-fade-in flex h-full flex-col",
|
|
@@ -3120,7 +3587,7 @@ function Pn({ open: e, onClose: t, title: n, children: r, className: a, resizabl
|
|
|
3120
3587
|
onClick: t,
|
|
3121
3588
|
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-6 w-6 cursor-pointer items-center justify-center rounded",
|
|
3122
3589
|
"aria-label": "Close panel",
|
|
3123
|
-
children: /* @__PURE__ */ p(
|
|
3590
|
+
children: /* @__PURE__ */ p(P, { className: "h-3.5 w-3.5" })
|
|
3124
3591
|
})]
|
|
3125
3592
|
}),
|
|
3126
3593
|
/* @__PURE__ */ p("div", {
|
|
@@ -3133,7 +3600,7 @@ function Pn({ open: e, onClose: t, title: n, children: r, className: a, resizabl
|
|
|
3133
3600
|
}
|
|
3134
3601
|
//#endregion
|
|
3135
3602
|
//#region src/components/ui/Dialog.tsx
|
|
3136
|
-
function
|
|
3603
|
+
function Gn({ open: e, onClose: t, title: n, children: r, footer: i, className: a }) {
|
|
3137
3604
|
let c = u(null), l = s();
|
|
3138
3605
|
return B(c, e), o(() => {
|
|
3139
3606
|
if (!e) return;
|
|
@@ -3143,14 +3610,14 @@ function Fn({ open: e, onClose: t, title: n, children: r, footer: i, className:
|
|
|
3143
3610
|
return document.addEventListener("keydown", n), document.body.style.overflow = "hidden", () => {
|
|
3144
3611
|
document.removeEventListener("keydown", n), document.body.style.overflow = "";
|
|
3145
3612
|
};
|
|
3146
|
-
}, [e, t]), e ?
|
|
3613
|
+
}, [e, t]), e ? F(/* @__PURE__ */ m("div", {
|
|
3147
3614
|
className: "fixed inset-0 z-50 flex items-start justify-center overflow-y-auto pt-4 md:pt-[5vh]",
|
|
3148
3615
|
children: [/* @__PURE__ */ p("div", {
|
|
3149
3616
|
className: "bg-bg-overlay fixed inset-0",
|
|
3150
3617
|
onClick: t
|
|
3151
3618
|
}), /* @__PURE__ */ m("div", {
|
|
3152
3619
|
ref: c,
|
|
3153
|
-
className:
|
|
3620
|
+
className: L("relative z-50 mx-4 mb-8 w-full max-w-[400px] p-6", "bg-bg-secondary border-border rounded-lg border", "animate-scale-in shadow-lg", a),
|
|
3154
3621
|
role: "dialog",
|
|
3155
3622
|
"aria-modal": "true",
|
|
3156
3623
|
"aria-labelledby": n ? l : void 0,
|
|
@@ -3166,7 +3633,7 @@ function Fn({ open: e, onClose: t, title: n, children: r, footer: i, className:
|
|
|
3166
3633
|
onClick: t,
|
|
3167
3634
|
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover ml-auto flex h-6 w-6 cursor-pointer items-center justify-center rounded transition-colors duration-[100ms]",
|
|
3168
3635
|
"aria-label": "Close",
|
|
3169
|
-
children: /* @__PURE__ */ p(
|
|
3636
|
+
children: /* @__PURE__ */ p(P, { className: "h-4 w-4" })
|
|
3170
3637
|
})]
|
|
3171
3638
|
}),
|
|
3172
3639
|
r,
|
|
@@ -3177,15 +3644,15 @@ function Fn({ open: e, onClose: t, title: n, children: r, footer: i, className:
|
|
|
3177
3644
|
}
|
|
3178
3645
|
//#endregion
|
|
3179
3646
|
//#region src/components/ui/DialogActions.tsx
|
|
3180
|
-
function
|
|
3647
|
+
function Kn({ onCancel: e, onConfirm: t, cancelLabel: n = "Cancel", confirmLabel: r = "Confirm", confirmVariant: i = "primary", className: a }) {
|
|
3181
3648
|
return /* @__PURE__ */ m("div", {
|
|
3182
|
-
className:
|
|
3183
|
-
children: [/* @__PURE__ */ p(
|
|
3649
|
+
className: L("flex justify-end gap-2", a),
|
|
3650
|
+
children: [/* @__PURE__ */ p(q, {
|
|
3184
3651
|
variant: "ghost",
|
|
3185
3652
|
size: "sm",
|
|
3186
3653
|
onClick: e,
|
|
3187
3654
|
children: n
|
|
3188
|
-
}), /* @__PURE__ */ p(
|
|
3655
|
+
}), /* @__PURE__ */ p(q, {
|
|
3189
3656
|
variant: i,
|
|
3190
3657
|
size: "sm",
|
|
3191
3658
|
onClick: t,
|
|
@@ -3195,9 +3662,9 @@ function In({ onCancel: e, onConfirm: t, cancelLabel: n = "Cancel", confirmLabel
|
|
|
3195
3662
|
}
|
|
3196
3663
|
//#endregion
|
|
3197
3664
|
//#region src/components/ui/DividerLabel.tsx
|
|
3198
|
-
function
|
|
3665
|
+
function qn({ children: e, className: t }) {
|
|
3199
3666
|
return /* @__PURE__ */ m("div", {
|
|
3200
|
-
className:
|
|
3667
|
+
className: L("relative my-6", t),
|
|
3201
3668
|
children: [/* @__PURE__ */ p("div", {
|
|
3202
3669
|
className: "absolute inset-0 flex items-center",
|
|
3203
3670
|
children: /* @__PURE__ */ p("div", { className: "border-border w-full border-t" })
|
|
@@ -3212,7 +3679,7 @@ function Ln({ children: e, className: t }) {
|
|
|
3212
3679
|
}
|
|
3213
3680
|
//#endregion
|
|
3214
3681
|
//#region src/components/ui/DropdownMenu.tsx
|
|
3215
|
-
function
|
|
3682
|
+
function Jn({ trigger: e, items: t, align: n = "right" }) {
|
|
3216
3683
|
let [r, a] = d(!1), [s, c] = d({
|
|
3217
3684
|
top: 0,
|
|
3218
3685
|
left: 0,
|
|
@@ -3248,7 +3715,7 @@ function Rn({ trigger: e, items: t, align: n = "right" }) {
|
|
|
3248
3715
|
ref: _,
|
|
3249
3716
|
onClick: x,
|
|
3250
3717
|
children: e
|
|
3251
|
-
}), r &&
|
|
3718
|
+
}), r && F(/* @__PURE__ */ p("div", {
|
|
3252
3719
|
ref: v,
|
|
3253
3720
|
role: "menu",
|
|
3254
3721
|
className: "bg-bg-tertiary border-border-strong animate-scale-in fixed z-[100] w-max rounded-md border py-1 shadow-lg",
|
|
@@ -3271,7 +3738,7 @@ function Rn({ trigger: e, items: t, align: n = "right" }) {
|
|
|
3271
3738
|
e.onClick(), b();
|
|
3272
3739
|
},
|
|
3273
3740
|
onMouseEnter: () => g(n),
|
|
3274
|
-
className:
|
|
3741
|
+
className: L("flex h-7 w-full cursor-pointer items-center gap-2 px-4 text-left text-xs", "transition-colors duration-[100ms]", "focus:outline-none", e.danger ? "text-red hover:bg-red-muted focus:bg-red-muted" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover focus:text-text-primary focus:bg-bg-hover"),
|
|
3275
3742
|
children: [
|
|
3276
3743
|
e.icon && /* @__PURE__ */ p("span", {
|
|
3277
3744
|
className: "flex h-3.5 w-3.5 shrink-0 items-center",
|
|
@@ -3293,9 +3760,9 @@ function Rn({ trigger: e, items: t, align: n = "right" }) {
|
|
|
3293
3760
|
}
|
|
3294
3761
|
//#endregion
|
|
3295
3762
|
//#region src/components/ui/EmptyState.tsx
|
|
3296
|
-
function
|
|
3763
|
+
function Yn({ icon: e, title: t, description: n, action: r, className: i }) {
|
|
3297
3764
|
return /* @__PURE__ */ m("div", {
|
|
3298
|
-
className:
|
|
3765
|
+
className: L("flex flex-col items-center justify-center px-4 py-12", i),
|
|
3299
3766
|
children: [
|
|
3300
3767
|
/* @__PURE__ */ p("div", {
|
|
3301
3768
|
className: "bg-bg-tertiary text-text-tertiary mb-3 flex h-10 w-10 items-center justify-center rounded-md",
|
|
@@ -3318,7 +3785,7 @@ function zn({ icon: e, title: t, description: n, action: r, className: i }) {
|
|
|
3318
3785
|
}
|
|
3319
3786
|
//#endregion
|
|
3320
3787
|
//#region src/components/ui/ErrorBoundary.tsx
|
|
3321
|
-
var
|
|
3788
|
+
var Xn = class extends e {
|
|
3322
3789
|
state = {
|
|
3323
3790
|
hasError: !1,
|
|
3324
3791
|
error: null
|
|
@@ -3344,7 +3811,7 @@ var Bn = class extends e {
|
|
|
3344
3811
|
className: "text-text-secondary mb-6 max-w-md text-xs",
|
|
3345
3812
|
children: this.state.error?.message ?? "An unexpected error occurred."
|
|
3346
3813
|
}),
|
|
3347
|
-
/* @__PURE__ */ p(
|
|
3814
|
+
/* @__PURE__ */ p(q, {
|
|
3348
3815
|
variant: "secondary",
|
|
3349
3816
|
onClick: () => {
|
|
3350
3817
|
this.setState({
|
|
@@ -3360,10 +3827,10 @@ var Bn = class extends e {
|
|
|
3360
3827
|
};
|
|
3361
3828
|
//#endregion
|
|
3362
3829
|
//#region src/components/ui/FilterDropdown.tsx
|
|
3363
|
-
function
|
|
3364
|
-
return /* @__PURE__ */ p(
|
|
3830
|
+
function Zn({ icon: e, children: t, items: n, align: r, className: i }) {
|
|
3831
|
+
return /* @__PURE__ */ p(Jn, {
|
|
3365
3832
|
align: r,
|
|
3366
|
-
trigger: /* @__PURE__ */ p(
|
|
3833
|
+
trigger: /* @__PURE__ */ p(sn, {
|
|
3367
3834
|
icon: e,
|
|
3368
3835
|
className: i,
|
|
3369
3836
|
children: t
|
|
@@ -3373,30 +3840,30 @@ function Vn({ icon: e, children: t, items: n, align: r, className: i }) {
|
|
|
3373
3840
|
}
|
|
3374
3841
|
//#endregion
|
|
3375
3842
|
//#region src/components/ui/Kbd.tsx
|
|
3376
|
-
function
|
|
3843
|
+
function Qn({ children: e, className: t }) {
|
|
3377
3844
|
return /* @__PURE__ */ p("kbd", {
|
|
3378
|
-
className:
|
|
3845
|
+
className: L("text-2xs inline-flex items-center px-1.5 py-0.5 font-mono font-medium", "bg-bg-tertiary text-text-secondary border-border rounded border", t),
|
|
3379
3846
|
children: e
|
|
3380
3847
|
});
|
|
3381
3848
|
}
|
|
3382
3849
|
//#endregion
|
|
3383
3850
|
//#region src/components/ui/LoadingSpinner.tsx
|
|
3384
|
-
var
|
|
3851
|
+
var $n = {
|
|
3385
3852
|
sm: "w-4 h-4",
|
|
3386
3853
|
md: "w-6 h-6",
|
|
3387
3854
|
lg: "w-8 h-8"
|
|
3388
3855
|
};
|
|
3389
|
-
function
|
|
3856
|
+
function er({ className: e, size: t = "md" }) {
|
|
3390
3857
|
return /* @__PURE__ */ p("div", {
|
|
3391
|
-
className:
|
|
3392
|
-
children: /* @__PURE__ */ p(
|
|
3858
|
+
className: L("flex min-h-[200px] items-center justify-center", e),
|
|
3859
|
+
children: /* @__PURE__ */ p(ne, { className: L("text-accent animate-spin", $n[t]) })
|
|
3393
3860
|
});
|
|
3394
3861
|
}
|
|
3395
3862
|
//#endregion
|
|
3396
3863
|
//#region src/components/ui/MetadataGrid.tsx
|
|
3397
|
-
function
|
|
3864
|
+
function tr({ items: e, labelWidth: n = "100px", className: r }) {
|
|
3398
3865
|
return /* @__PURE__ */ p("div", {
|
|
3399
|
-
className:
|
|
3866
|
+
className: L("gap-x-3 gap-y-2 text-xs", r),
|
|
3400
3867
|
style: {
|
|
3401
3868
|
display: "grid",
|
|
3402
3869
|
gridTemplateColumns: `${n} 1fr`
|
|
@@ -3412,11 +3879,11 @@ function Gn({ items: e, labelWidth: n = "100px", className: r }) {
|
|
|
3412
3879
|
}
|
|
3413
3880
|
//#endregion
|
|
3414
3881
|
//#region src/components/ui/MetricCard.tsx
|
|
3415
|
-
function
|
|
3882
|
+
function nr({ label: e, value: t, sub: n, bar: r, icon: i, iconColor: a, className: o }) {
|
|
3416
3883
|
return /* @__PURE__ */ m("div", {
|
|
3417
|
-
className:
|
|
3884
|
+
className: L("bg-bg-secondary border-border relative overflow-hidden rounded-md border p-3", o),
|
|
3418
3885
|
children: [
|
|
3419
|
-
i && /* @__PURE__ */ p(i, { className:
|
|
3886
|
+
i && /* @__PURE__ */ p(i, { className: L("absolute -right-9 -bottom-9 h-44 w-44 -rotate-45 opacity-[0.06]", a) }),
|
|
3420
3887
|
/* @__PURE__ */ p("p", {
|
|
3421
3888
|
className: "text-2xs-f text-text-tertiary font-label mb-1 font-medium tracking-wider uppercase",
|
|
3422
3889
|
children: e
|
|
@@ -3441,7 +3908,7 @@ function Kn({ label: e, value: t, sub: n, bar: r, icon: i, iconColor: a, classNa
|
|
|
3441
3908
|
}
|
|
3442
3909
|
//#endregion
|
|
3443
3910
|
//#region src/components/ui/OAuthButton.tsx
|
|
3444
|
-
function
|
|
3911
|
+
function rr() {
|
|
3445
3912
|
return /* @__PURE__ */ m("svg", {
|
|
3446
3913
|
className: "h-3.5 w-3.5",
|
|
3447
3914
|
viewBox: "0 0 24 24",
|
|
@@ -3466,7 +3933,7 @@ function qn() {
|
|
|
3466
3933
|
]
|
|
3467
3934
|
});
|
|
3468
3935
|
}
|
|
3469
|
-
function
|
|
3936
|
+
function ir() {
|
|
3470
3937
|
return /* @__PURE__ */ p("svg", {
|
|
3471
3938
|
className: "h-3.5 w-3.5",
|
|
3472
3939
|
viewBox: "0 0 24 24",
|
|
@@ -3475,27 +3942,27 @@ function Jn() {
|
|
|
3475
3942
|
children: /* @__PURE__ */ p("path", { d: "M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" })
|
|
3476
3943
|
});
|
|
3477
3944
|
}
|
|
3478
|
-
var
|
|
3945
|
+
var ar = {
|
|
3479
3946
|
github: "GitHub",
|
|
3480
3947
|
google: "Google"
|
|
3481
|
-
},
|
|
3482
|
-
github:
|
|
3483
|
-
google:
|
|
3948
|
+
}, or = {
|
|
3949
|
+
github: ir,
|
|
3950
|
+
google: rr
|
|
3484
3951
|
};
|
|
3485
|
-
function
|
|
3486
|
-
let r =
|
|
3487
|
-
return /* @__PURE__ */ m(
|
|
3952
|
+
function sr({ provider: e, children: t, ...n }) {
|
|
3953
|
+
let r = or[e];
|
|
3954
|
+
return /* @__PURE__ */ m(q, {
|
|
3488
3955
|
variant: "secondary",
|
|
3489
3956
|
size: "md",
|
|
3490
3957
|
...n,
|
|
3491
|
-
children: [/* @__PURE__ */ p(r, {}), t ??
|
|
3958
|
+
children: [/* @__PURE__ */ p(r, {}), t ?? ar[e]]
|
|
3492
3959
|
});
|
|
3493
3960
|
}
|
|
3494
3961
|
//#endregion
|
|
3495
3962
|
//#region src/components/ui/PageHeader.tsx
|
|
3496
|
-
function
|
|
3963
|
+
function cr({ title: e, subtitle: t, actions: n, className: r }) {
|
|
3497
3964
|
return /* @__PURE__ */ m("div", {
|
|
3498
|
-
className:
|
|
3965
|
+
className: L("flex items-center justify-between", r),
|
|
3499
3966
|
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
|
|
3500
3967
|
className: "text-text-primary font-heading text-sm font-semibold",
|
|
3501
3968
|
children: e
|
|
@@ -3510,11 +3977,11 @@ function Qn({ title: e, subtitle: t, actions: n, className: r }) {
|
|
|
3510
3977
|
}
|
|
3511
3978
|
//#endregion
|
|
3512
3979
|
//#region src/components/ui/PageSection.tsx
|
|
3513
|
-
function
|
|
3980
|
+
function lr({ title: e, description: t, actions: n, children: r, as: i = "h2", className: a, headerClassName: o, contentClassName: s }) {
|
|
3514
3981
|
return /* @__PURE__ */ m("section", {
|
|
3515
|
-
className:
|
|
3982
|
+
className: L("space-y-4", a),
|
|
3516
3983
|
children: [(e || t || n) && /* @__PURE__ */ m("div", {
|
|
3517
|
-
className:
|
|
3984
|
+
className: L("border-border flex items-end justify-between gap-3 border-b pb-2", o),
|
|
3518
3985
|
children: [/* @__PURE__ */ m("div", {
|
|
3519
3986
|
className: "min-w-0",
|
|
3520
3987
|
children: [e && /* @__PURE__ */ p(i, {
|
|
@@ -3535,95 +4002,8 @@ function $n({ title: e, description: t, actions: n, children: r, as: i = "h2", c
|
|
|
3535
4002
|
});
|
|
3536
4003
|
}
|
|
3537
4004
|
//#endregion
|
|
3538
|
-
//#region src/components/ui/SelectDropdown.tsx
|
|
3539
|
-
function er({ options: e, value: t, onChange: n, label: r, placeholder: a = "Select...", className: o, size: c = "md" }) {
|
|
3540
|
-
let [l, f] = d(!1), [h, g] = d(-1), _ = u(null), v = u(null), y = vn(l, _, v), b = s(), x = `${b}-listbox`, C = e.find((e) => e.value === t);
|
|
3541
|
-
W(l, i(() => f(!1), []), [_]);
|
|
3542
|
-
function T() {
|
|
3543
|
-
if (!l) {
|
|
3544
|
-
let n = e.findIndex((e) => e.value === t);
|
|
3545
|
-
g(n >= 0 ? n : 0);
|
|
3546
|
-
}
|
|
3547
|
-
f(!l);
|
|
3548
|
-
}
|
|
3549
|
-
function E(r) {
|
|
3550
|
-
if (!l) {
|
|
3551
|
-
if (r.key === "ArrowDown" || r.key === "ArrowUp") {
|
|
3552
|
-
r.preventDefault();
|
|
3553
|
-
let n = e.findIndex((e) => e.value === t);
|
|
3554
|
-
g(n >= 0 ? n : 0), f(!0);
|
|
3555
|
-
}
|
|
3556
|
-
return;
|
|
3557
|
-
}
|
|
3558
|
-
switch (r.key) {
|
|
3559
|
-
case "ArrowDown":
|
|
3560
|
-
r.preventDefault(), g((t) => Math.min(t + 1, e.length - 1));
|
|
3561
|
-
break;
|
|
3562
|
-
case "ArrowUp":
|
|
3563
|
-
r.preventDefault(), g((e) => Math.max(e - 1, 0));
|
|
3564
|
-
break;
|
|
3565
|
-
case "Enter":
|
|
3566
|
-
r.preventDefault(), e[h] && (n(e[h].value), f(!1));
|
|
3567
|
-
break;
|
|
3568
|
-
case "Escape":
|
|
3569
|
-
r.preventDefault(), f(!1);
|
|
3570
|
-
break;
|
|
3571
|
-
}
|
|
3572
|
-
}
|
|
3573
|
-
return /* @__PURE__ */ m("div", {
|
|
3574
|
-
className: I("flex flex-col gap-1.5", o),
|
|
3575
|
-
ref: _,
|
|
3576
|
-
children: [r && /* @__PURE__ */ p("span", {
|
|
3577
|
-
className: "text-text-secondary font-label text-xs font-medium",
|
|
3578
|
-
children: r
|
|
3579
|
-
}), /* @__PURE__ */ m("div", {
|
|
3580
|
-
className: "relative",
|
|
3581
|
-
children: [
|
|
3582
|
-
/* @__PURE__ */ p("button", {
|
|
3583
|
-
type: "button",
|
|
3584
|
-
onClick: T,
|
|
3585
|
-
onKeyDown: E,
|
|
3586
|
-
"aria-haspopup": "listbox",
|
|
3587
|
-
"aria-expanded": l,
|
|
3588
|
-
"aria-controls": l ? x : void 0,
|
|
3589
|
-
"aria-activedescendant": l && h >= 0 ? `${b}-option-${h}` : void 0,
|
|
3590
|
-
className: I("font-control flex w-full cursor-pointer items-center rounded-md text-xs", "bg-bg-secondary border-border text-text-primary border", "hover:bg-bg-hover hover:border-border-strong", "transition-colors duration-[100ms]", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2", c === "sm" ? "h-6 px-2 pr-6" : "h-7 px-2 pr-7"),
|
|
3591
|
-
children: C ? C.label : /* @__PURE__ */ p("span", {
|
|
3592
|
-
className: "text-text-disabled",
|
|
3593
|
-
children: a
|
|
3594
|
-
})
|
|
3595
|
-
}),
|
|
3596
|
-
/* @__PURE__ */ p(w, { className: I("text-text-tertiary pointer-events-none absolute top-1/2 h-3 w-3 -translate-y-1/2 transition-transform", c === "sm" ? "right-1.5" : "right-2", l && "rotate-180") }),
|
|
3597
|
-
l && /* @__PURE__ */ p("div", {
|
|
3598
|
-
ref: v,
|
|
3599
|
-
className: I("bg-bg-tertiary border-border-strong animate-scale-in absolute right-0 left-0 z-[100] overflow-hidden rounded-md border shadow-lg", y ? "bottom-full mb-1" : "top-full mt-1"),
|
|
3600
|
-
children: /* @__PURE__ */ p("ul", {
|
|
3601
|
-
id: x,
|
|
3602
|
-
className: "max-h-48 overflow-y-auto py-1",
|
|
3603
|
-
role: "listbox",
|
|
3604
|
-
children: e.map((e, r) => /* @__PURE__ */ m("li", {
|
|
3605
|
-
id: `${b}-option-${r}`,
|
|
3606
|
-
role: "option",
|
|
3607
|
-
"aria-selected": e.value === t,
|
|
3608
|
-
onClick: () => {
|
|
3609
|
-
n(e.value), f(!1);
|
|
3610
|
-
},
|
|
3611
|
-
onMouseEnter: () => g(r),
|
|
3612
|
-
className: I("font-control flex h-7 w-full cursor-pointer items-center gap-2 px-3 text-xs", "transition-colors duration-[100ms]", r === h ? "bg-accent-muted text-accent" : e.value === t ? "text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
|
|
3613
|
-
children: [/* @__PURE__ */ p("span", {
|
|
3614
|
-
className: "flex-1 truncate",
|
|
3615
|
-
children: e.label
|
|
3616
|
-
}), e.value === t && /* @__PURE__ */ p(S, { className: "h-3 w-3 shrink-0" })]
|
|
3617
|
-
}, e.value))
|
|
3618
|
-
})
|
|
3619
|
-
})
|
|
3620
|
-
]
|
|
3621
|
-
})]
|
|
3622
|
-
});
|
|
3623
|
-
}
|
|
3624
|
-
//#endregion
|
|
3625
4005
|
//#region src/components/ui/PaginationBar.tsx
|
|
3626
|
-
var
|
|
4006
|
+
var ur = [
|
|
3627
4007
|
{
|
|
3628
4008
|
value: "10",
|
|
3629
4009
|
label: "10 per page"
|
|
@@ -3637,13 +4017,13 @@ var tr = [
|
|
|
3637
4017
|
label: "50 per page"
|
|
3638
4018
|
}
|
|
3639
4019
|
];
|
|
3640
|
-
function
|
|
4020
|
+
function dr({ page: e, pageSize: t, total: n, pageSizeOptions: r = ur, onPageChange: i, onPageSizeChange: a, className: o }) {
|
|
3641
4021
|
let s = Math.ceil(n / t), c = Math.min((e - 1) * t + 1, n), l = Math.min(e * t, n);
|
|
3642
4022
|
return /* @__PURE__ */ m("div", {
|
|
3643
|
-
className:
|
|
4023
|
+
className: L("flex items-center justify-between", o),
|
|
3644
4024
|
children: [/* @__PURE__ */ m("div", {
|
|
3645
4025
|
className: "flex items-center gap-3",
|
|
3646
|
-
children: [/* @__PURE__ */ p(
|
|
4026
|
+
children: [/* @__PURE__ */ p(Y, {
|
|
3647
4027
|
size: "sm",
|
|
3648
4028
|
value: String(t),
|
|
3649
4029
|
onChange: (e) => a(Number(e)),
|
|
@@ -3659,7 +4039,7 @@ function nr({ page: e, pageSize: t, total: n, pageSizeOptions: r = tr, onPageCha
|
|
|
3659
4039
|
n
|
|
3660
4040
|
]
|
|
3661
4041
|
})]
|
|
3662
|
-
}), /* @__PURE__ */ p(
|
|
4042
|
+
}), /* @__PURE__ */ p(ln, {
|
|
3663
4043
|
page: e,
|
|
3664
4044
|
totalPages: s,
|
|
3665
4045
|
onPageChange: i
|
|
@@ -3668,7 +4048,7 @@ function nr({ page: e, pageSize: t, total: n, pageSizeOptions: r = tr, onPageCha
|
|
|
3668
4048
|
}
|
|
3669
4049
|
//#endregion
|
|
3670
4050
|
//#region src/components/ui/PasswordInput.tsx
|
|
3671
|
-
var
|
|
4051
|
+
var fr = r(({ label: e, error: t, className: n, id: r, ...i }, a) => {
|
|
3672
4052
|
let o = r || e?.toLowerCase().replace(/\s+/g, "-"), [s, c] = d(!1);
|
|
3673
4053
|
return /* @__PURE__ */ m("div", {
|
|
3674
4054
|
className: "flex flex-col gap-1.5",
|
|
@@ -3688,7 +4068,7 @@ var rr = r(({ label: e, error: t, className: n, id: r, ...i }, a) => {
|
|
|
3688
4068
|
ref: a,
|
|
3689
4069
|
id: o,
|
|
3690
4070
|
type: s ? "text" : "password",
|
|
3691
|
-
className:
|
|
4071
|
+
className: L("bg-bg-secondary text-text-primary h-7 w-full rounded-md border px-2 pr-8 text-xs", "placeholder:text-text-disabled", "transition-colors duration-[100ms]", "focus:border-accent focus:outline-none", t ? "border-red" : "border-border", n),
|
|
3692
4072
|
...i
|
|
3693
4073
|
}), /* @__PURE__ */ p("button", {
|
|
3694
4074
|
type: "button",
|
|
@@ -3700,14 +4080,14 @@ var rr = r(({ label: e, error: t, className: n, id: r, ...i }, a) => {
|
|
|
3700
4080
|
})]
|
|
3701
4081
|
});
|
|
3702
4082
|
});
|
|
3703
|
-
|
|
4083
|
+
fr.displayName = "PasswordInput";
|
|
3704
4084
|
//#endregion
|
|
3705
4085
|
//#region src/components/ui/ProfileHeader.tsx
|
|
3706
|
-
function
|
|
4086
|
+
function pr({ name: e, subtitle: t, badge: n, meta: r, action: i, className: a }) {
|
|
3707
4087
|
return /* @__PURE__ */ m("div", {
|
|
3708
|
-
className:
|
|
4088
|
+
className: L("flex items-start gap-4", a),
|
|
3709
4089
|
children: [
|
|
3710
|
-
/* @__PURE__ */ p(
|
|
4090
|
+
/* @__PURE__ */ p(K, {
|
|
3711
4091
|
name: e,
|
|
3712
4092
|
size: "lg"
|
|
3713
4093
|
}),
|
|
@@ -3751,54 +4131,46 @@ function ir({ name: e, subtitle: t, badge: n, meta: r, action: i, className: a }
|
|
|
3751
4131
|
}
|
|
3752
4132
|
//#endregion
|
|
3753
4133
|
//#region src/components/ui/ProseContent.tsx
|
|
3754
|
-
function
|
|
4134
|
+
function mr({ children: e, className: t }) {
|
|
3755
4135
|
return /* @__PURE__ */ p("div", {
|
|
3756
|
-
className:
|
|
4136
|
+
className: L("ui-prose", t),
|
|
3757
4137
|
children: e
|
|
3758
4138
|
});
|
|
3759
4139
|
}
|
|
3760
4140
|
//#endregion
|
|
3761
4141
|
//#region src/components/ui/RadioPill.tsx
|
|
3762
|
-
function
|
|
4142
|
+
function hr({ options: e, value: t, onChange: n, disabled: r, className: i, "aria-label": a }) {
|
|
3763
4143
|
return /* @__PURE__ */ p("div", {
|
|
3764
4144
|
role: "radiogroup",
|
|
3765
4145
|
"aria-label": a,
|
|
3766
|
-
className:
|
|
4146
|
+
className: L("border-border inline-flex overflow-hidden rounded-md border", r && "cursor-not-allowed opacity-40", i),
|
|
3767
4147
|
children: e.map((e) => /* @__PURE__ */ p("button", {
|
|
3768
4148
|
role: "radio",
|
|
3769
4149
|
"aria-checked": e.value === t,
|
|
3770
4150
|
disabled: r,
|
|
3771
4151
|
onClick: () => n(e.value),
|
|
3772
|
-
className:
|
|
4152
|
+
className: L("font-control px-3 py-1.5 text-xs font-medium transition-colors duration-[100ms]", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-[-2px]", !r && "cursor-pointer", e.value === t ? "bg-accent text-text-on-accent" : "bg-bg-secondary text-text-secondary hover:bg-bg-hover hover:text-text-primary"),
|
|
3773
4153
|
children: e.label
|
|
3774
4154
|
}, e.value))
|
|
3775
4155
|
});
|
|
3776
4156
|
}
|
|
3777
4157
|
//#endregion
|
|
3778
4158
|
//#region src/components/ui/SearchInput.tsx
|
|
3779
|
-
function
|
|
4159
|
+
function gr({ value: e, onChange: t, placeholder: n = "Search...", className: r }) {
|
|
3780
4160
|
return /* @__PURE__ */ m("div", {
|
|
3781
|
-
className:
|
|
3782
|
-
children: [/* @__PURE__ */ p(
|
|
4161
|
+
className: L("relative", r),
|
|
4162
|
+
children: [/* @__PURE__ */ p(N, { className: "text-text-tertiary absolute top-1/2 left-2 h-3.5 w-3.5 -translate-y-1/2" }), /* @__PURE__ */ p("input", {
|
|
3783
4163
|
type: "search",
|
|
3784
4164
|
value: e,
|
|
3785
4165
|
onChange: (e) => t(e.target.value),
|
|
3786
4166
|
placeholder: n,
|
|
3787
|
-
className:
|
|
4167
|
+
className: L("bg-bg-secondary text-text-primary h-7 w-full pr-2 pl-7 text-xs", "border-border rounded-md border", "placeholder:text-text-disabled", "transition-colors duration-[100ms]", "focus:border-accent focus:outline-none")
|
|
3788
4168
|
})]
|
|
3789
4169
|
});
|
|
3790
4170
|
}
|
|
3791
4171
|
//#endregion
|
|
3792
|
-
//#region src/components/ui/SectionHeader.tsx
|
|
3793
|
-
function cr({ children: e, as: t = "h2", className: n, border: r = !0 }) {
|
|
3794
|
-
return /* @__PURE__ */ p(t, {
|
|
3795
|
-
className: I("text-text-primary font-heading text-xs font-semibold", r && "border-border border-b pb-2", n),
|
|
3796
|
-
children: e
|
|
3797
|
-
});
|
|
3798
|
-
}
|
|
3799
|
-
//#endregion
|
|
3800
4172
|
//#region src/components/ui/Select.tsx
|
|
3801
|
-
var
|
|
4173
|
+
var _r = r(({ label: e, error: t, options: n, className: r, id: i, ...a }, o) => {
|
|
3802
4174
|
let s = i || e?.toLowerCase().replace(/\s+/g, "-");
|
|
3803
4175
|
return /* @__PURE__ */ m("div", {
|
|
3804
4176
|
className: "flex flex-col gap-1.5",
|
|
@@ -3817,7 +4189,7 @@ var lr = r(({ label: e, error: t, options: n, className: r, id: i, ...a }, o) =>
|
|
|
3817
4189
|
children: [/* @__PURE__ */ p("select", {
|
|
3818
4190
|
ref: o,
|
|
3819
4191
|
id: s,
|
|
3820
|
-
className:
|
|
4192
|
+
className: L("bg-bg-secondary text-text-primary font-control h-7 w-full px-2 pr-7 text-xs", "appearance-none rounded-md border", "transition-colors duration-[100ms]", "focus:border-accent focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-40", "cursor-pointer", t ? "border-red" : "border-border", r),
|
|
3821
4193
|
...a,
|
|
3822
4194
|
children: n.map((e) => /* @__PURE__ */ p("option", {
|
|
3823
4195
|
value: e.value,
|
|
@@ -3827,12 +4199,12 @@ var lr = r(({ label: e, error: t, options: n, className: r, id: i, ...a }, o) =>
|
|
|
3827
4199
|
})]
|
|
3828
4200
|
});
|
|
3829
4201
|
});
|
|
3830
|
-
|
|
4202
|
+
_r.displayName = "Select";
|
|
3831
4203
|
//#endregion
|
|
3832
4204
|
//#region src/components/ui/SettingRow.tsx
|
|
3833
|
-
function
|
|
4205
|
+
function vr({ label: e, description: t, action: n, className: r }) {
|
|
3834
4206
|
return /* @__PURE__ */ m("div", {
|
|
3835
|
-
className:
|
|
4207
|
+
className: L("border-border flex items-center justify-between border-b py-3", r),
|
|
3836
4208
|
children: [/* @__PURE__ */ m("div", {
|
|
3837
4209
|
className: "min-w-0 flex-1 pr-4",
|
|
3838
4210
|
children: [/* @__PURE__ */ p("p", {
|
|
@@ -3849,36 +4221,8 @@ function ur({ label: e, description: t, action: n, className: r }) {
|
|
|
3849
4221
|
});
|
|
3850
4222
|
}
|
|
3851
4223
|
//#endregion
|
|
3852
|
-
//#region src/components/ui/Slider.tsx
|
|
3853
|
-
function dr({ min: e, max: t, step: n = 1, value: r, onChange: i, onCommit: a, label: o, showValue: s, className: c }) {
|
|
3854
|
-
let l = (r - e) / (t - e) * 100;
|
|
3855
|
-
return /* @__PURE__ */ m("div", {
|
|
3856
|
-
className: I("flex flex-col gap-1.5", c),
|
|
3857
|
-
children: [(o || s) && /* @__PURE__ */ m("div", {
|
|
3858
|
-
className: "flex items-center justify-between",
|
|
3859
|
-
children: [o && /* @__PURE__ */ p("span", {
|
|
3860
|
-
className: "text-text-secondary font-label text-xs font-medium",
|
|
3861
|
-
children: o
|
|
3862
|
-
}), s && /* @__PURE__ */ p("span", {
|
|
3863
|
-
className: "text-text-primary font-data text-xs",
|
|
3864
|
-
children: r
|
|
3865
|
-
})]
|
|
3866
|
-
}), /* @__PURE__ */ p("input", {
|
|
3867
|
-
type: "range",
|
|
3868
|
-
min: e,
|
|
3869
|
-
max: t,
|
|
3870
|
-
step: n,
|
|
3871
|
-
value: r,
|
|
3872
|
-
onChange: (e) => i(Number(e.target.value)),
|
|
3873
|
-
onPointerUp: a ? (e) => a(Number(e.target.value)) : void 0,
|
|
3874
|
-
className: "bg-bg-tertiary [&::-webkit-slider-thumb]:bg-accent h-1.5 w-full cursor-pointer appearance-none rounded-md [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:duration-[100ms] [&::-webkit-slider-thumb]:hover:scale-110",
|
|
3875
|
-
style: { background: `linear-gradient(to right, var(--accent) ${l}%, var(--bg-tertiary) ${l}%)` }
|
|
3876
|
-
})]
|
|
3877
|
-
});
|
|
3878
|
-
}
|
|
3879
|
-
//#endregion
|
|
3880
4224
|
//#region src/components/ui/SideSheet.tsx
|
|
3881
|
-
function
|
|
4225
|
+
function yr({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "right", widthClassName: s = "w-[360px]", className: c, contentClassName: l }) {
|
|
3882
4226
|
let d = u(null);
|
|
3883
4227
|
return B(d, e), o(() => {
|
|
3884
4228
|
if (!e) return;
|
|
@@ -3888,7 +4232,7 @@ function fr({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "
|
|
|
3888
4232
|
return document.addEventListener("keydown", n), document.body.style.overflow = "hidden", () => {
|
|
3889
4233
|
document.removeEventListener("keydown", n), document.body.style.overflow = "";
|
|
3890
4234
|
};
|
|
3891
|
-
}, [e, t]), e ?
|
|
4235
|
+
}, [e, t]), e ? F(/* @__PURE__ */ m("div", {
|
|
3892
4236
|
className: "fixed inset-0 z-50 flex",
|
|
3893
4237
|
children: [
|
|
3894
4238
|
a === "right" && /* @__PURE__ */ p("div", {
|
|
@@ -3897,7 +4241,7 @@ function fr({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "
|
|
|
3897
4241
|
}),
|
|
3898
4242
|
/* @__PURE__ */ m("div", {
|
|
3899
4243
|
ref: d,
|
|
3900
|
-
className:
|
|
4244
|
+
className: L("bg-bg-secondary border-border flex flex-col shadow-lg", s, a === "right" ? "animate-slide-in-right border-l" : "animate-slide-in-left border-r", c),
|
|
3901
4245
|
style: { maxWidth: "calc(100vw - 2rem)" },
|
|
3902
4246
|
role: "dialog",
|
|
3903
4247
|
"aria-modal": "true",
|
|
@@ -3912,11 +4256,11 @@ function fr({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "
|
|
|
3912
4256
|
onClick: t,
|
|
3913
4257
|
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover ml-auto flex h-6 w-6 cursor-pointer items-center justify-center rounded",
|
|
3914
4258
|
"aria-label": "Close",
|
|
3915
|
-
children: /* @__PURE__ */ p(
|
|
4259
|
+
children: /* @__PURE__ */ p(P, { className: "h-3.5 w-3.5" })
|
|
3916
4260
|
})]
|
|
3917
4261
|
}),
|
|
3918
4262
|
/* @__PURE__ */ p("div", {
|
|
3919
|
-
className:
|
|
4263
|
+
className: L("flex-1 overflow-y-auto p-3", l),
|
|
3920
4264
|
children: r
|
|
3921
4265
|
}),
|
|
3922
4266
|
i && /* @__PURE__ */ p("div", {
|
|
@@ -3934,54 +4278,54 @@ function fr({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "
|
|
|
3934
4278
|
}
|
|
3935
4279
|
//#endregion
|
|
3936
4280
|
//#region src/components/ui/SplitPaneLayout.tsx
|
|
3937
|
-
function
|
|
4281
|
+
function br({ children: e, direction: t = "row", className: n }) {
|
|
3938
4282
|
return /* @__PURE__ */ p("div", {
|
|
3939
|
-
className:
|
|
4283
|
+
className: L("-m-4 md:-m-6", "flex h-[calc(100vh-var(--topbar-height)-var(--bottomnav-height))] gap-0 md:h-[calc(100vh-var(--topbar-height))]", t === "column" && "flex-col", n),
|
|
3940
4284
|
children: e
|
|
3941
4285
|
});
|
|
3942
4286
|
}
|
|
3943
|
-
function
|
|
4287
|
+
function xr({ children: e, className: t }) {
|
|
3944
4288
|
return /* @__PURE__ */ p("div", {
|
|
3945
|
-
className:
|
|
4289
|
+
className: L("flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden", t),
|
|
3946
4290
|
children: e
|
|
3947
4291
|
});
|
|
3948
4292
|
}
|
|
3949
|
-
var
|
|
4293
|
+
var Sr = Object.assign(br, { Main: xr }), Cr = {
|
|
3950
4294
|
active: "bg-green",
|
|
3951
4295
|
inactive: "bg-text-tertiary",
|
|
3952
4296
|
pending: "bg-yellow animate-pulse-subtle",
|
|
3953
4297
|
error: "bg-red"
|
|
3954
|
-
},
|
|
4298
|
+
}, wr = {
|
|
3955
4299
|
active: "text-green",
|
|
3956
4300
|
inactive: "text-text-tertiary",
|
|
3957
4301
|
pending: "text-yellow",
|
|
3958
4302
|
error: "text-red"
|
|
3959
4303
|
};
|
|
3960
|
-
function
|
|
4304
|
+
function Tr({ status: e, label: t, className: n }) {
|
|
3961
4305
|
return /* @__PURE__ */ m("span", {
|
|
3962
|
-
className:
|
|
3963
|
-
children: [/* @__PURE__ */ p("span", { className:
|
|
3964
|
-
className:
|
|
4306
|
+
className: L("inline-flex items-center gap-1.5", n),
|
|
4307
|
+
children: [/* @__PURE__ */ p("span", { className: L("h-2 w-2 rounded-full", Cr[e]) }), t && /* @__PURE__ */ p("span", {
|
|
4308
|
+
className: L("text-xs", wr[e]),
|
|
3965
4309
|
children: t
|
|
3966
4310
|
})]
|
|
3967
4311
|
});
|
|
3968
4312
|
}
|
|
3969
4313
|
//#endregion
|
|
3970
4314
|
//#region src/components/ui/StepProgress.tsx
|
|
3971
|
-
function
|
|
4315
|
+
function Er({ steps: e, currentStep: t, className: n }) {
|
|
3972
4316
|
return /* @__PURE__ */ p("div", {
|
|
3973
|
-
className:
|
|
4317
|
+
className: L("flex items-center justify-between", n),
|
|
3974
4318
|
children: e.map((n, r) => /* @__PURE__ */ m("div", {
|
|
3975
4319
|
className: "flex flex-1 items-center",
|
|
3976
4320
|
children: [/* @__PURE__ */ m("div", {
|
|
3977
4321
|
className: "flex flex-col items-center",
|
|
3978
4322
|
children: [
|
|
3979
4323
|
/* @__PURE__ */ p("div", {
|
|
3980
|
-
className:
|
|
4324
|
+
className: L("flex h-8 w-8 items-center justify-center rounded-full text-xs", r < t && "bg-accent text-text-on-accent", r === t && "border-accent text-accent border-2 font-semibold", r > t && "bg-bg-tertiary border-border text-text-tertiary border"),
|
|
3981
4325
|
children: r < t ? /* @__PURE__ */ p(S, { className: "h-4 w-4" }) : r + 1
|
|
3982
4326
|
}),
|
|
3983
4327
|
/* @__PURE__ */ p("span", {
|
|
3984
|
-
className:
|
|
4328
|
+
className: L("text-2xs mt-1.5 hidden sm:block", r === t && "text-accent", r < t && "text-text-primary", r > t && "text-text-tertiary"),
|
|
3985
4329
|
children: n.label
|
|
3986
4330
|
}),
|
|
3987
4331
|
n.description && /* @__PURE__ */ p("span", {
|
|
@@ -3989,13 +4333,13 @@ function yr({ steps: e, currentStep: t, className: n }) {
|
|
|
3989
4333
|
children: n.description
|
|
3990
4334
|
})
|
|
3991
4335
|
]
|
|
3992
|
-
}), r < e.length - 1 && /* @__PURE__ */ p("div", { className:
|
|
4336
|
+
}), r < e.length - 1 && /* @__PURE__ */ p("div", { className: L("mx-2 h-0.5 flex-1", r < t ? "bg-accent" : "bg-border") })]
|
|
3993
4337
|
}, n.label))
|
|
3994
4338
|
});
|
|
3995
4339
|
}
|
|
3996
4340
|
//#endregion
|
|
3997
4341
|
//#region src/components/ui/Tabs.tsx
|
|
3998
|
-
function
|
|
4342
|
+
function Dr({ tabs: e, defaultTab: t, value: n, onChange: r, className: i }) {
|
|
3999
4343
|
let [a, o] = d(t || e[0]?.key), c = n ?? a, l = e.find((e) => e.key === c);
|
|
4000
4344
|
function f(e) {
|
|
4001
4345
|
n === void 0 && o(e), r?.(e);
|
|
@@ -4019,7 +4363,7 @@ function br({ tabs: e, defaultTab: t, value: n, onChange: r, className: i }) {
|
|
|
4019
4363
|
"aria-controls": `${h}-panel-${e.key}`,
|
|
4020
4364
|
onClick: () => f(e.key),
|
|
4021
4365
|
onKeyDown: _,
|
|
4022
|
-
className:
|
|
4366
|
+
className: L("font-control relative cursor-pointer px-3 py-2 text-xs font-medium transition-colors duration-[100ms]", "hover:text-text-primary", e.key === c ? "text-accent" : "text-text-tertiary"),
|
|
4023
4367
|
children: [e.label, e.key === c && /* @__PURE__ */ p("div", { className: "bg-accent absolute right-0 bottom-0 left-0 h-0.5 rounded-md" })]
|
|
4024
4368
|
}, e.key))
|
|
4025
4369
|
}), /* @__PURE__ */ p("div", {
|
|
@@ -4033,7 +4377,7 @@ function br({ tabs: e, defaultTab: t, value: n, onChange: r, className: i }) {
|
|
|
4033
4377
|
}
|
|
4034
4378
|
//#endregion
|
|
4035
4379
|
//#region src/components/ui/Textarea.tsx
|
|
4036
|
-
var
|
|
4380
|
+
var Or = r(({ label: e, error: t, showCount: n, maxLength: r, value: i, className: a, id: o, ...s }, c) => {
|
|
4037
4381
|
let l = o || e?.toLowerCase().replace(/\s+/g, "-"), u = typeof i == "string" ? i.length : 0;
|
|
4038
4382
|
return /* @__PURE__ */ m("div", {
|
|
4039
4383
|
className: "flex flex-col gap-1.5",
|
|
@@ -4048,7 +4392,7 @@ var xr = r(({ label: e, error: t, showCount: n, maxLength: r, value: i, classNam
|
|
|
4048
4392
|
id: l,
|
|
4049
4393
|
value: i,
|
|
4050
4394
|
maxLength: r,
|
|
4051
|
-
className:
|
|
4395
|
+
className: L("bg-bg-secondary text-text-primary font-control min-h-[72px] w-full px-2 py-1.5 text-xs", "resize-y rounded-md border", "placeholder:text-text-disabled", "transition-colors duration-[100ms]", "focus:border-accent focus:outline-none", t ? "border-red" : "border-border", a),
|
|
4052
4396
|
...s
|
|
4053
4397
|
}),
|
|
4054
4398
|
/* @__PURE__ */ m("div", {
|
|
@@ -4068,10 +4412,10 @@ var xr = r(({ label: e, error: t, showCount: n, maxLength: r, value: i, classNam
|
|
|
4068
4412
|
]
|
|
4069
4413
|
});
|
|
4070
4414
|
});
|
|
4071
|
-
|
|
4415
|
+
Or.displayName = "Textarea";
|
|
4072
4416
|
//#endregion
|
|
4073
4417
|
//#region src/components/ui/TextInput.tsx
|
|
4074
|
-
var
|
|
4418
|
+
var kr = r(({ label: e, error: t, icon: n, className: r, id: i, readOnly: a, ...o }, s) => {
|
|
4075
4419
|
let c = i || e?.toLowerCase().replace(/\s+/g, "-");
|
|
4076
4420
|
return /* @__PURE__ */ m("div", {
|
|
4077
4421
|
className: "flex flex-col gap-1.5",
|
|
@@ -4094,25 +4438,25 @@ var Sr = r(({ label: e, error: t, icon: n, className: r, id: i, readOnly: a, ...
|
|
|
4094
4438
|
ref: s,
|
|
4095
4439
|
id: c,
|
|
4096
4440
|
readOnly: a,
|
|
4097
|
-
className:
|
|
4441
|
+
className: L("bg-bg-secondary text-text-primary font-control h-7 w-full px-2 text-xs", "rounded-md border", "placeholder:text-text-disabled", "transition-colors duration-[100ms]", "focus:border-accent focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-40", a && "bg-bg-primary text-text-secondary focus:border-border cursor-default border-dashed", n && "pl-7", t ? "border-red" : !a && "border-border", a && !t && "border-border", r),
|
|
4098
4442
|
...o
|
|
4099
4443
|
})]
|
|
4100
4444
|
})]
|
|
4101
4445
|
});
|
|
4102
4446
|
});
|
|
4103
|
-
|
|
4447
|
+
kr.displayName = "TextInput";
|
|
4104
4448
|
//#endregion
|
|
4105
4449
|
//#region src/components/ui/Timeline.tsx
|
|
4106
|
-
function
|
|
4450
|
+
function Ar({ items: e, className: t }) {
|
|
4107
4451
|
return /* @__PURE__ */ p("div", {
|
|
4108
|
-
className:
|
|
4452
|
+
className: L("space-y-0", t),
|
|
4109
4453
|
children: e.map((t, n) => /* @__PURE__ */ m("div", {
|
|
4110
4454
|
className: "flex gap-3",
|
|
4111
4455
|
children: [/* @__PURE__ */ m("div", {
|
|
4112
4456
|
className: "flex flex-col items-center",
|
|
4113
|
-
children: [/* @__PURE__ */ p("div", { className:
|
|
4457
|
+
children: [/* @__PURE__ */ p("div", { className: L(t.dot, "mt-1.5 h-2 w-2 shrink-0 rounded-full") }), n < e.length - 1 && /* @__PURE__ */ p("div", { className: "bg-border mt-1 w-px flex-1" })]
|
|
4114
4458
|
}), /* @__PURE__ */ m("div", {
|
|
4115
|
-
className:
|
|
4459
|
+
className: L("pb-4", n === e.length - 1 && "pb-0"),
|
|
4116
4460
|
children: [/* @__PURE__ */ p("p", {
|
|
4117
4461
|
className: "text-text-primary text-xs",
|
|
4118
4462
|
children: t.text
|
|
@@ -4125,47 +4469,14 @@ function Cr({ items: e, className: t }) {
|
|
|
4125
4469
|
});
|
|
4126
4470
|
}
|
|
4127
4471
|
//#endregion
|
|
4128
|
-
//#region src/components/ui/Toggle.tsx
|
|
4129
|
-
function wr({ checked: e, onChange: t, disabled: n, label: r, className: i }) {
|
|
4130
|
-
return /* @__PURE__ */ m("label", {
|
|
4131
|
-
className: I("flex w-fit items-center", n ? "cursor-not-allowed opacity-40" : "cursor-pointer", i),
|
|
4132
|
-
style: { gap: 10 },
|
|
4133
|
-
children: [/* @__PURE__ */ p("button", {
|
|
4134
|
-
type: "button",
|
|
4135
|
-
role: "switch",
|
|
4136
|
-
"aria-checked": e,
|
|
4137
|
-
disabled: n,
|
|
4138
|
-
onClick: () => t(!e),
|
|
4139
|
-
className: I("relative shrink-0 rounded-full border transition-colors duration-[100ms]", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2", e ? "bg-accent border-accent" : "bg-bg-tertiary border-border", !n && "cursor-pointer"),
|
|
4140
|
-
style: {
|
|
4141
|
-
width: 36,
|
|
4142
|
-
height: 20
|
|
4143
|
-
},
|
|
4144
|
-
children: /* @__PURE__ */ p("span", {
|
|
4145
|
-
className: "bg-control-knob absolute top-1/2 rounded-full transition-[left] duration-[100ms]",
|
|
4146
|
-
style: {
|
|
4147
|
-
width: 14,
|
|
4148
|
-
height: 14,
|
|
4149
|
-
marginTop: -7,
|
|
4150
|
-
left: e ? 19 : 3,
|
|
4151
|
-
boxShadow: "0 0 1px rgba(0,0,0,0.1), 2px 0 4px rgba(0,0,0,0.35)"
|
|
4152
|
-
}
|
|
4153
|
-
})
|
|
4154
|
-
}), r && /* @__PURE__ */ p("span", {
|
|
4155
|
-
className: "text-text-secondary text-xs",
|
|
4156
|
-
children: r
|
|
4157
|
-
})]
|
|
4158
|
-
});
|
|
4159
|
-
}
|
|
4160
|
-
//#endregion
|
|
4161
4472
|
//#region src/components/ui/Tooltip.tsx
|
|
4162
|
-
var
|
|
4473
|
+
var jr = {
|
|
4163
4474
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
4164
4475
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
4165
4476
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
4166
4477
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
4167
4478
|
};
|
|
4168
|
-
function
|
|
4479
|
+
function Mr({ content: e, placement: t = "top", children: n }) {
|
|
4169
4480
|
let [r, i] = d(!1), a = s();
|
|
4170
4481
|
return /* @__PURE__ */ m("div", {
|
|
4171
4482
|
className: "relative inline-flex",
|
|
@@ -4176,7 +4487,7 @@ function Er({ content: e, placement: t = "top", children: n }) {
|
|
|
4176
4487
|
"aria-describedby": r ? a : void 0,
|
|
4177
4488
|
children: [n, r && /* @__PURE__ */ p("div", {
|
|
4178
4489
|
id: a,
|
|
4179
|
-
className:
|
|
4490
|
+
className: L("text-2xs absolute z-50 px-2 py-1 font-medium whitespace-nowrap", "bg-bg-tertiary text-text-primary border-border rounded border shadow-md", "animate-fade-in pointer-events-none", jr[t]),
|
|
4180
4491
|
role: "tooltip",
|
|
4181
4492
|
children: e
|
|
4182
4493
|
})]
|
|
@@ -4184,46 +4495,23 @@ function Er({ content: e, placement: t = "top", children: n }) {
|
|
|
4184
4495
|
}
|
|
4185
4496
|
//#endregion
|
|
4186
4497
|
//#region src/components/ui/Toolbar.tsx
|
|
4187
|
-
function
|
|
4498
|
+
function Nr({ start: e, end: t, children: n, className: r, startClassName: i, endClassName: a }) {
|
|
4188
4499
|
return /* @__PURE__ */ m("div", {
|
|
4189
|
-
className:
|
|
4500
|
+
className: L("flex items-center justify-between gap-3", r),
|
|
4190
4501
|
children: [/* @__PURE__ */ p("div", {
|
|
4191
|
-
className:
|
|
4502
|
+
className: L("flex flex-1 items-center gap-3", i),
|
|
4192
4503
|
children: e ?? n
|
|
4193
4504
|
}), t && /* @__PURE__ */ p("div", {
|
|
4194
|
-
className:
|
|
4505
|
+
className: L("flex items-center gap-1.5", a),
|
|
4195
4506
|
children: t
|
|
4196
4507
|
})]
|
|
4197
4508
|
});
|
|
4198
4509
|
}
|
|
4199
4510
|
//#endregion
|
|
4200
|
-
//#region src/components/ui/ThemePreview.tsx
|
|
4201
|
-
function Or({ label: e, active: t, icon: n, preview: r, onClick: i, className: a }) {
|
|
4202
|
-
return /* @__PURE__ */ m("button", {
|
|
4203
|
-
type: "button",
|
|
4204
|
-
onClick: i,
|
|
4205
|
-
className: I("flex cursor-pointer flex-col items-center gap-2 rounded-md border p-3 transition-colors duration-[100ms]", t ? "border-accent bg-accent-muted" : "border-border bg-bg-secondary hover:bg-bg-hover hover:border-border-strong", a),
|
|
4206
|
-
children: [/* @__PURE__ */ p("div", {
|
|
4207
|
-
className: "border-border-strong/20 flex h-10 w-full items-center justify-center rounded border",
|
|
4208
|
-
style: { backgroundColor: r?.bg },
|
|
4209
|
-
children: /* @__PURE__ */ p("div", {
|
|
4210
|
-
className: "h-1.5 w-8 rounded-md",
|
|
4211
|
-
style: { backgroundColor: r?.fg }
|
|
4212
|
-
})
|
|
4213
|
-
}), /* @__PURE__ */ m("div", {
|
|
4214
|
-
className: "flex items-center gap-1.5",
|
|
4215
|
-
children: [n && /* @__PURE__ */ p(n, { className: "h-3 w-3" }), /* @__PURE__ */ p("span", {
|
|
4216
|
-
className: "text-xs font-medium",
|
|
4217
|
-
children: e
|
|
4218
|
-
})]
|
|
4219
|
-
})]
|
|
4220
|
-
});
|
|
4221
|
-
}
|
|
4222
|
-
//#endregion
|
|
4223
4511
|
//#region src/components/ui/UploadDropzone.tsx
|
|
4224
|
-
function
|
|
4512
|
+
function Pr({ title: e = "Drag and drop files here, or click to browse", description: t, icon: n, accept: r, multiple: i, disabled: a, onChange: o, className: s }) {
|
|
4225
4513
|
return /* @__PURE__ */ m("label", {
|
|
4226
|
-
className:
|
|
4514
|
+
className: L("border-border hover:border-border-strong block rounded-md border-2 border-dashed p-8 text-center transition-colors duration-[100ms]", a ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-bg-hover", s),
|
|
4227
4515
|
children: [
|
|
4228
4516
|
/* @__PURE__ */ p("input", {
|
|
4229
4517
|
type: "file",
|
|
@@ -4235,7 +4523,7 @@ function kr({ title: e = "Drag and drop files here, or click to browse", descrip
|
|
|
4235
4523
|
}),
|
|
4236
4524
|
/* @__PURE__ */ p("div", {
|
|
4237
4525
|
className: "text-text-tertiary mx-auto mb-3 flex h-9 w-9 items-center justify-center rounded-md bg-bg-tertiary",
|
|
4238
|
-
children: n ?? /* @__PURE__ */ p(
|
|
4526
|
+
children: n ?? /* @__PURE__ */ p(de, { className: "h-4.5 w-4.5" })
|
|
4239
4527
|
}),
|
|
4240
4528
|
/* @__PURE__ */ p("p", {
|
|
4241
4529
|
className: "text-text-secondary mb-1 text-xs",
|
|
@@ -4249,28 +4537,16 @@ function kr({ title: e = "Drag and drop files here, or click to browse", descrip
|
|
|
4249
4537
|
});
|
|
4250
4538
|
}
|
|
4251
4539
|
//#endregion
|
|
4252
|
-
//#region src/hooks/useApplyTheme.ts
|
|
4253
|
-
function Ar() {
|
|
4254
|
-
let { setPreferredDarkTheme: e, setPreferredLightTheme: t, setColorMode: n } = K();
|
|
4255
|
-
return i((r) => {
|
|
4256
|
-
V(r) ? (t(r), n("light")) : (e(r), n("dark"));
|
|
4257
|
-
}, [
|
|
4258
|
-
e,
|
|
4259
|
-
t,
|
|
4260
|
-
n
|
|
4261
|
-
]);
|
|
4262
|
-
}
|
|
4263
|
-
//#endregion
|
|
4264
4540
|
//#region src/providers/ThemeContext.ts
|
|
4265
|
-
var
|
|
4541
|
+
var Fr = n({ theme: "dark" });
|
|
4266
4542
|
//#endregion
|
|
4267
4543
|
//#region src/hooks/useTheme.ts
|
|
4268
|
-
function
|
|
4269
|
-
return a(
|
|
4544
|
+
function Ir() {
|
|
4545
|
+
return a(Fr);
|
|
4270
4546
|
}
|
|
4271
4547
|
//#endregion
|
|
4272
4548
|
//#region src/lib/formatDate.ts
|
|
4273
|
-
var
|
|
4549
|
+
var Lr = [
|
|
4274
4550
|
"Jan",
|
|
4275
4551
|
"Feb",
|
|
4276
4552
|
"Mar",
|
|
@@ -4284,21 +4560,21 @@ var Nr = [
|
|
|
4284
4560
|
"Nov",
|
|
4285
4561
|
"Dec"
|
|
4286
4562
|
];
|
|
4287
|
-
function
|
|
4563
|
+
function Rr(e) {
|
|
4288
4564
|
return (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString("en-US", {
|
|
4289
4565
|
month: "short",
|
|
4290
4566
|
day: "numeric",
|
|
4291
4567
|
year: "numeric"
|
|
4292
4568
|
});
|
|
4293
4569
|
}
|
|
4294
|
-
function
|
|
4570
|
+
function zr(e) {
|
|
4295
4571
|
return (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString("en-US", {
|
|
4296
4572
|
month: "long",
|
|
4297
4573
|
day: "numeric",
|
|
4298
4574
|
year: "numeric"
|
|
4299
4575
|
});
|
|
4300
4576
|
}
|
|
4301
|
-
function
|
|
4577
|
+
function Br(e, t = /* @__PURE__ */ new Date()) {
|
|
4302
4578
|
let n = t.getTime() - e.getTime(), r = Math.floor(n / 1e3);
|
|
4303
4579
|
if (r < 60) return "just now";
|
|
4304
4580
|
let i = Math.floor(r / 60);
|
|
@@ -4306,7 +4582,7 @@ function Ir(e, t = /* @__PURE__ */ new Date()) {
|
|
|
4306
4582
|
let a = Math.floor(i / 60);
|
|
4307
4583
|
if (a < 24) return `${a}h ago`;
|
|
4308
4584
|
if (Math.floor(a / 24) === 1) return "yesterday";
|
|
4309
|
-
let o = `${
|
|
4585
|
+
let o = `${Lr[e.getMonth()]} ${e.getDate()}`;
|
|
4310
4586
|
return e.getFullYear() === t.getFullYear() ? o : `${o}, ${e.getFullYear()}`;
|
|
4311
4587
|
}
|
|
4312
4588
|
//#endregion
|
|
@@ -4317,7 +4593,7 @@ var Z = {
|
|
|
4317
4593
|
"jetbrains-mono": "\"JetBrains Mono\", Menlo, Monaco, Consolas, monospace",
|
|
4318
4594
|
"pt-serif": "\"PT Serif\", Georgia, ui-serif, Cambria, \"Times New Roman\", Times, serif",
|
|
4319
4595
|
system: "system-ui, -apple-system, BlinkMacSystemFont, sans-serif"
|
|
4320
|
-
},
|
|
4596
|
+
}, Vr = {
|
|
4321
4597
|
purple: {
|
|
4322
4598
|
base: "#7C5CFC",
|
|
4323
4599
|
hover: "#6B4AEB",
|
|
@@ -4374,7 +4650,7 @@ var Z = {
|
|
|
4374
4650
|
muted: "rgba(99,102,241,0.15)",
|
|
4375
4651
|
subtle: "rgba(99,102,241,0.08)"
|
|
4376
4652
|
}
|
|
4377
|
-
},
|
|
4653
|
+
}, Hr = "leonardaustin-ui-settings", Ur = new Set(Object.keys(Vr)), Wr = new Set(Object.keys(H)), Q = new Set(Object.keys(Z)), Gr = new Set([
|
|
4378
4654
|
"light",
|
|
4379
4655
|
"dark",
|
|
4380
4656
|
"system"
|
|
@@ -4382,13 +4658,13 @@ var Z = {
|
|
|
4382
4658
|
function $(e, t, n, r) {
|
|
4383
4659
|
return typeof e != "number" || !isFinite(e) ? r : Math.min(n, Math.max(t, e));
|
|
4384
4660
|
}
|
|
4385
|
-
function
|
|
4661
|
+
function Kr(e) {
|
|
4386
4662
|
let t = {};
|
|
4387
|
-
if (
|
|
4663
|
+
if (Ur.has(e.accentColor) && (t.accentColor = e.accentColor), Gr.has(e.colorMode) && (t.colorMode = e.colorMode), Wr.has(e.preferredDarkTheme) && !V(e.preferredDarkTheme) && (t.preferredDarkTheme = e.preferredDarkTheme), Wr.has(e.preferredLightTheme) && V(e.preferredLightTheme) && (t.preferredLightTheme = e.preferredLightTheme), typeof e.sidebarCollapsed == "boolean" && (t.sidebarCollapsed = e.sidebarCollapsed), typeof e.reducedMotion == "boolean" && (t.reducedMotion = e.reducedMotion), typeof e.sidebarWidth == "number" && (t.sidebarWidth = $(e.sidebarWidth, 160, 400, 220)), e.themeOverrides && typeof e.themeOverrides == "object") {
|
|
4388
4664
|
let n = {};
|
|
4389
4665
|
for (let [t, r] of Object.entries(e.themeOverrides)) {
|
|
4390
|
-
if (!
|
|
4391
|
-
let e = r, i =
|
|
4666
|
+
if (!Wr.has(t) || !r || typeof r != "object") continue;
|
|
4667
|
+
let e = r, i = H[t];
|
|
4392
4668
|
n[t] = {
|
|
4393
4669
|
uiFont: Q.has(e.uiFont) ? e.uiFont : i.uiFont,
|
|
4394
4670
|
headingFont: Q.has(e.headingFont) ? e.headingFont : i.headingFont,
|
|
@@ -4410,7 +4686,7 @@ function Hr(e) {
|
|
|
4410
4686
|
}
|
|
4411
4687
|
return t;
|
|
4412
4688
|
}
|
|
4413
|
-
var
|
|
4689
|
+
var qr = {
|
|
4414
4690
|
accentColor: "purple",
|
|
4415
4691
|
sidebarCollapsed: !1,
|
|
4416
4692
|
sidebarWidth: 220,
|
|
@@ -4420,31 +4696,31 @@ var Ur = {
|
|
|
4420
4696
|
preferredLightTheme: "light",
|
|
4421
4697
|
themeOverrides: {}
|
|
4422
4698
|
};
|
|
4423
|
-
function
|
|
4424
|
-
if (typeof localStorage > "u") return
|
|
4699
|
+
function Jr(e) {
|
|
4700
|
+
if (typeof localStorage > "u") return qr;
|
|
4425
4701
|
try {
|
|
4426
4702
|
let t = localStorage.getItem(e);
|
|
4427
4703
|
if (t) return {
|
|
4428
|
-
...
|
|
4429
|
-
...
|
|
4704
|
+
...qr,
|
|
4705
|
+
...Kr(JSON.parse(t))
|
|
4430
4706
|
};
|
|
4431
4707
|
} catch (e) {
|
|
4432
4708
|
console.warn("[SettingsProvider] Failed to load settings:", e);
|
|
4433
4709
|
}
|
|
4434
|
-
return
|
|
4710
|
+
return qr;
|
|
4435
4711
|
}
|
|
4436
|
-
function
|
|
4437
|
-
let n =
|
|
4712
|
+
function Yr(e, t) {
|
|
4713
|
+
let n = H[e] ?? H.dark;
|
|
4438
4714
|
return t[e] ? {
|
|
4439
4715
|
...n,
|
|
4440
4716
|
...t[e]
|
|
4441
4717
|
} : n;
|
|
4442
4718
|
}
|
|
4443
|
-
function
|
|
4719
|
+
function Xr(e, t) {
|
|
4444
4720
|
return e.uiFont === t.uiFont && e.headingFont === t.headingFont && e.proseFont === t.proseFont && e.controlFont === t.controlFont && e.labelFont === t.labelFont && e.navigationFont === t.navigationFont && e.dataFont === t.dataFont && e.codeFont === t.codeFont && e.fontSize === t.fontSize && e.borderRadius === t.borderRadius && e.borderWidth === t.borderWidth && e.tracking === t.tracking && e.lineHeight === t.lineHeight && e.density === t.density;
|
|
4445
4721
|
}
|
|
4446
|
-
function
|
|
4447
|
-
let [n, r] = d(() =>
|
|
4722
|
+
function Zr({ children: e, storageKey: t = Hr }) {
|
|
4723
|
+
let [n, r] = d(() => Jr(t)), [a, s] = d(() => typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
4448
4724
|
o(() => {
|
|
4449
4725
|
if (typeof window > "u") return;
|
|
4450
4726
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e) => s(e.matches);
|
|
@@ -4455,9 +4731,9 @@ function qr({ children: e, storageKey: t = Rr }) {
|
|
|
4455
4731
|
n.preferredDarkTheme,
|
|
4456
4732
|
n.preferredLightTheme,
|
|
4457
4733
|
a
|
|
4458
|
-
]), [u, f] = d(() =>
|
|
4734
|
+
]), [u, f] = d(() => Yr(c, n.themeOverrides));
|
|
4459
4735
|
o(() => {
|
|
4460
|
-
f(
|
|
4736
|
+
f(Yr(c, n.themeOverrides));
|
|
4461
4737
|
}, [c]);
|
|
4462
4738
|
let m = i((e) => {
|
|
4463
4739
|
r((n) => {
|
|
@@ -4474,7 +4750,7 @@ function qr({ children: e, storageKey: t = Rr }) {
|
|
|
4474
4750
|
});
|
|
4475
4751
|
}, [t]);
|
|
4476
4752
|
o(() => {
|
|
4477
|
-
let e = document.documentElement, t =
|
|
4753
|
+
let e = document.documentElement, t = Vr[n.accentColor];
|
|
4478
4754
|
e.style.setProperty("--accent", t.base), e.style.setProperty("--accent-hover", t.hover), e.style.setProperty("--accent-active", t.active), e.style.setProperty("--accent-muted", t.muted), e.style.setProperty("--accent-subtle", t.subtle);
|
|
4479
4755
|
}, [n.accentColor]), o(() => {
|
|
4480
4756
|
document.documentElement.classList.toggle("reduced-motion", n.reducedMotion);
|
|
@@ -4482,7 +4758,7 @@ function qr({ children: e, storageKey: t = Rr }) {
|
|
|
4482
4758
|
let e = document.documentElement, t = u.borderRadius;
|
|
4483
4759
|
e.style.fontSize = `${u.fontSize / 13 * 100}%`, e.style.setProperty("--font-ui", Z[u.uiFont]), e.style.setProperty("--font-heading", Z[u.headingFont]), e.style.setProperty("--font-prose", Z[u.proseFont]), e.style.setProperty("--font-control", Z[u.controlFont]), e.style.setProperty("--font-label", Z[u.labelFont]), e.style.setProperty("--font-navigation", Z[u.navigationFont]), e.style.setProperty("--font-data", Z[u.dataFont]), e.style.setProperty("--font-code", Z[u.codeFont]), e.style.setProperty("--ui-radius", t === 0 ? "0" : `${Math.round(t * 2 / 3)}px`), e.style.setProperty("--ui-radius-md", t === 0 ? "0" : `${t}px`), e.style.setProperty("--ui-radius-lg", t === 0 ? "0" : `${Math.round(t * 4 / 3)}px`), e.style.setProperty("--ui-radius-xl", t === 0 ? "0" : `${t * 2}px`), e.style.setProperty("--ui-border-width", `${u.borderWidth}px`), e.style.setProperty("--ui-tracking", `${u.tracking}em`), e.style.setProperty("--ui-line-height", String(u.lineHeight)), e.style.setProperty("--ui-density", `${u.density}rem`);
|
|
4484
4760
|
}, [u]);
|
|
4485
|
-
let h = l(() =>
|
|
4761
|
+
let h = l(() => Yr(c, n.themeOverrides), [c, n.themeOverrides]), g = c in n.themeOverrides, _ = !Xr(u, h), v = i(() => {
|
|
4486
4762
|
m({ themeOverrides: {
|
|
4487
4763
|
...n.themeOverrides,
|
|
4488
4764
|
[c]: { ...u }
|
|
@@ -4494,7 +4770,7 @@ function qr({ children: e, storageKey: t = Rr }) {
|
|
|
4494
4770
|
u
|
|
4495
4771
|
]), y = i(() => {
|
|
4496
4772
|
let e = { ...n.themeOverrides };
|
|
4497
|
-
delete e[c], m({ themeOverrides: e }), f(
|
|
4773
|
+
delete e[c], m({ themeOverrides: e }), f(H[c] ?? H.dark);
|
|
4498
4774
|
}, [
|
|
4499
4775
|
m,
|
|
4500
4776
|
n.themeOverrides,
|
|
@@ -4599,14 +4875,14 @@ function qr({ children: e, storageKey: t = Rr }) {
|
|
|
4599
4875
|
g,
|
|
4600
4876
|
_
|
|
4601
4877
|
]);
|
|
4602
|
-
return /* @__PURE__ */ p(
|
|
4878
|
+
return /* @__PURE__ */ p(gt.Provider, {
|
|
4603
4879
|
value: b,
|
|
4604
4880
|
children: e
|
|
4605
4881
|
});
|
|
4606
4882
|
}
|
|
4607
4883
|
//#endregion
|
|
4608
4884
|
//#region src/providers/ThemeProvider.tsx
|
|
4609
|
-
var
|
|
4885
|
+
var Qr = {
|
|
4610
4886
|
dark: "",
|
|
4611
4887
|
light: "theme-light",
|
|
4612
4888
|
monokai: "theme-monokai",
|
|
@@ -4615,19 +4891,19 @@ var Jr = {
|
|
|
4615
4891
|
cyberBrutalLight: "theme-cyber-brutal-light",
|
|
4616
4892
|
hashiTheme: "theme-hashi"
|
|
4617
4893
|
};
|
|
4618
|
-
function
|
|
4619
|
-
let { resolvedTheme: t } = a(
|
|
4894
|
+
function $r({ children: e }) {
|
|
4895
|
+
let { resolvedTheme: t } = a(gt);
|
|
4620
4896
|
return o(() => {
|
|
4621
4897
|
let e = document.documentElement;
|
|
4622
|
-
Object.values(
|
|
4898
|
+
Object.values(Qr).forEach((t) => {
|
|
4623
4899
|
t && e.classList.remove(t);
|
|
4624
4900
|
});
|
|
4625
|
-
let n =
|
|
4901
|
+
let n = Qr[t];
|
|
4626
4902
|
n && e.classList.add(n);
|
|
4627
|
-
}, [t]), /* @__PURE__ */ p(
|
|
4903
|
+
}, [t]), /* @__PURE__ */ p(Fr.Provider, {
|
|
4628
4904
|
value: { theme: t },
|
|
4629
4905
|
children: e
|
|
4630
4906
|
});
|
|
4631
4907
|
}
|
|
4632
4908
|
//#endregion
|
|
4633
|
-
export {
|
|
4909
|
+
export { pn as Alert, nn as AppShell, he as AreaChart, mn as AuthCard, rn as AuthLayout, hn as AuthorByline, K as Avatar, an as BackLink, vn as Badge, _e as BarChart, $e as BottomNav, Lt as Breadcrumbs, q as Button, tt as COMMAND_PALETTE_EVENT, Tn as CalendarGrid, En as Card, on as Checkbox, cn as ColumnPicker, Dn as Combobox, ot as CommandPalette, nt as DEFAULT_COMMAND_PALETTE_SHORTCUT, On as DangerZone, An as DatePicker, Pn as DateRangePicker, Bn as DateTimePicker, Wn as DetailPanel, Gn as Dialog, Kn as DialogActions, qn as DividerLabel, He as DonutChart, Jn as DropdownMenu, Yn as EmptyState, Xn as ErrorBoundary, sn as FilterButton, Zn as FilterDropdown, Qn as Kbd, er as LoadingSpinner, tr as MetadataGrid, nr as MetricCard, ct as MobileDrawer, sr as OAuthButton, cr as PageHeader, lr as PageSection, ln as Pagination, dr as PaginationBar, fr as PasswordInput, pr as ProfileHeader, mr as ProseContent, We as RadarChart, Ke as RadialBarChart, hr as RadioPill, dn as ResourceTable, gr as SearchInput, J as SectionHeader, _r as Select, Y as SelectDropdown, vr as SettingRow, gt as SettingsContext, Zr as SettingsProvider, yr as SideSheet, Ft as Sidebar, X as Slider, qe as SparkLine, Sr as SplitPaneLayout, Tr as StatusDot, Er as StepProgress, Jt as THEME_MENU_EVENT, Dr as Tabs, kr as TextInput, Or as Textarea, Fr as ThemeContext, Zt as ThemeMenu, Kt as ThemePreview, $r as ThemeProvider, Ar as Timeline, St as ToastProvider, qt as Toggle, Nr as Toolbar, Mr as Tooltip, tn as TopBar, Pr as UploadDropzone, Xe as VerticalBarChart, ht as accentItems, L as cn, ft as darkThemes, U as fontOptions, zr as formatDateLong, Rr as formatDateShort, Br as formatRelative, z as handleAppShellNavigate, Ze as isAppShellPathActive, V as isLightTheme, dt as lightThemes, it as matchesCommandPaletteShortcut, Qe as navigateToPath, rt as openCommandPalette, Yt as openThemeMenu, un as sortRows, H as themeDefaults, lt as themeItems, Rt as useApplyTheme, W as useDismiss, B as useFocusTrap, G as useSettings, Ir as useTheme, xt as useToast };
|