@leonardaustin/ui 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/tables/Table.d.ts +35 -0
- package/dist/components/tables/Table.d.ts.map +1 -0
- package/dist/components/ui/Calendar.d.ts +11 -1
- package/dist/components/ui/Calendar.d.ts.map +1 -1
- package/dist/components/ui/Grid.d.ts +17 -0
- package/dist/components/ui/Grid.d.ts.map +1 -0
- package/dist/components/ui/GridItem.d.ts +11 -0
- package/dist/components/ui/GridItem.d.ts.map +1 -0
- package/dist/components/ui/Inline.d.ts +20 -0
- package/dist/components/ui/Inline.d.ts.map +1 -0
- package/dist/components/ui/MetadataGrid.d.ts +8 -1
- package/dist/components/ui/MetadataGrid.d.ts.map +1 -1
- package/dist/components/ui/Stack.d.ts +13 -0
- package/dist/components/ui/Stack.d.ts.map +1 -0
- package/dist/components/ui/calendar/TimeGrid.d.ts.map +1 -1
- package/dist/components/ui/calendar/context.d.ts +1 -0
- package/dist/components/ui/calendar/context.d.ts.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +864 -605
- package/dist/lib/calendar.d.ts +35 -0
- package/dist/lib/calendar.d.ts.map +1 -1
- package/dist/lib/layout.d.ts +18 -0
- package/dist/lib/layout.d.ts.map +1 -0
- package/dist/styles.css +225 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,19 +3,19 @@ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
|
3
3
|
import { Accessibility as y, AlertTriangle as b, ArrowDown as x, ArrowLeft as S, ArrowUp as C, BookOpen as w, Calendar as T, Check as E, CheckCircle2 as D, ChevronDown as O, ChevronLeft as k, ChevronRight as A, ChevronsUpDown as j, Columns3 as M, Eye as N, EyeOff as P, Inbox as F, Info as I, Loader2 as L, LogOut as R, Menu as ee, Minus as te, Monitor as ne, Moon as re, Palette as z, PanelLeft as ie, PanelLeftDashed as ae, Search as B, Settings as oe, Sun as se, UploadCloud as ce, X as V, XCircle as le, Zap as ue } from "lucide-react";
|
|
4
4
|
import { createPortal as H } from "react-dom";
|
|
5
5
|
//#region src/lib/cn.ts
|
|
6
|
-
function
|
|
6
|
+
function U(e) {
|
|
7
7
|
if (typeof e == "string" || typeof e == "number" || typeof e == "bigint") return String(e);
|
|
8
8
|
if (!e || typeof e != "object") return "";
|
|
9
9
|
let t = "";
|
|
10
10
|
if (Array.isArray(e)) for (let n of e) {
|
|
11
11
|
if (!n) continue;
|
|
12
|
-
let e =
|
|
12
|
+
let e = U(n);
|
|
13
13
|
e && (t = t ? `${t} ${e}` : e);
|
|
14
14
|
}
|
|
15
15
|
else for (let n in e) e[n] && (t = t ? `${t} ${n}` : n);
|
|
16
16
|
return t;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
18
|
+
var de = new Set([
|
|
19
19
|
"block",
|
|
20
20
|
"contents",
|
|
21
21
|
"flex",
|
|
@@ -120,7 +120,7 @@ var U = new Set([
|
|
|
120
120
|
"border-solid"
|
|
121
121
|
]);
|
|
122
122
|
function G(...e) {
|
|
123
|
-
return be(
|
|
123
|
+
return be(U(e));
|
|
124
124
|
}
|
|
125
125
|
function be(e) {
|
|
126
126
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
@@ -168,7 +168,7 @@ function we(e) {
|
|
|
168
168
|
if (n) return [...ge[n]];
|
|
169
169
|
let r = De(e);
|
|
170
170
|
if (r) return [..._e[r]];
|
|
171
|
-
if (
|
|
171
|
+
if (de.has(e)) return ["display"];
|
|
172
172
|
if (e === "absolute" || e === "fixed" || e === "relative" || e === "static" || e === "sticky") return ["position"];
|
|
173
173
|
if (e === "visible" || e === "invisible" || e === "collapse") return ["visibility"];
|
|
174
174
|
if (e === "border-collapse") return ["border-collapse"];
|
|
@@ -2947,7 +2947,7 @@ function On({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
2947
2947
|
window.removeEventListener("resize", x), window.removeEventListener("scroll", x, !0);
|
|
2948
2948
|
};
|
|
2949
2949
|
}, [n, x]);
|
|
2950
|
-
let { colorMode: C, setColorMode: w, preferredDarkTheme: T, preferredLightTheme: E, accentColor: D, setAccentColor: O, fontSize: k, setFontSize: A, uiFont: j, setUiFont: M, headingFont: N, setHeadingFont: P, proseFont: F, setProseFont: I, codeFont: L, setCodeFont: R, borderRadius: ee, setBorderRadius: te, borderWidth: ne, setBorderWidth: re, tracking: ie, setTracking: ae, lineHeight: B, setLineHeight: oe, density: se, setDensity: ce, reducedMotion: V, setReducedMotion: le, saveThemeCustomization: ue, resetThemeCustomization:
|
|
2950
|
+
let { colorMode: C, setColorMode: w, preferredDarkTheme: T, preferredLightTheme: E, accentColor: D, setAccentColor: O, fontSize: k, setFontSize: A, uiFont: j, setUiFont: M, headingFont: N, setHeadingFont: P, proseFont: F, setProseFont: I, codeFont: L, setCodeFont: R, borderRadius: ee, setBorderRadius: te, borderWidth: ne, setBorderWidth: re, tracking: ie, setTracking: ae, lineHeight: B, setLineHeight: oe, density: se, setDensity: ce, reducedMotion: V, setReducedMotion: le, saveThemeCustomization: ue, resetThemeCustomization: U, hasThemeOverrides: de, isCustomized: W, resolvedTheme: fe } = f;
|
|
2951
2951
|
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
|
|
2952
2952
|
ref: u,
|
|
2953
2953
|
onClick: S,
|
|
@@ -3143,9 +3143,9 @@ function On({ className: e, respondToOpenEvent: t = !0 }) {
|
|
|
3143
3143
|
}), /* @__PURE__ */ _(fn, {
|
|
3144
3144
|
variant: "secondary",
|
|
3145
3145
|
size: "sm",
|
|
3146
|
-
disabled: !
|
|
3146
|
+
disabled: !de && !W,
|
|
3147
3147
|
onClick: () => {
|
|
3148
|
-
|
|
3148
|
+
U(), y("info", "Reset to theme defaults");
|
|
3149
3149
|
},
|
|
3150
3150
|
children: "Reset"
|
|
3151
3151
|
})]
|
|
@@ -4361,18 +4361,54 @@ function Xr(e) {
|
|
|
4361
4361
|
}
|
|
4362
4362
|
};
|
|
4363
4363
|
}
|
|
4364
|
+
function Zr(e, t, n, r, i = !0) {
|
|
4365
|
+
let a = Math.max(5, t), o = (e) => Array.from({ length: Math.ceil((e.max - e.min) / a) }, (t, n) => e.min + n * a);
|
|
4366
|
+
if (!i) return {
|
|
4367
|
+
reference: void 0,
|
|
4368
|
+
axes: e.map(({ day: e, bounds: t }) => ({
|
|
4369
|
+
day: e,
|
|
4370
|
+
bounds: t,
|
|
4371
|
+
minutes: o(t),
|
|
4372
|
+
matchesReference: !1
|
|
4373
|
+
}))
|
|
4374
|
+
};
|
|
4375
|
+
let s = Xr(n.timeZone), c = /* @__PURE__ */ new Map(), l = e.map(({ day: e, bounds: t }) => {
|
|
4376
|
+
let i = s.toDateKey(e), a = c.get(i);
|
|
4377
|
+
if (a) return a;
|
|
4378
|
+
let l = o(t), u = l.map((t) => s.dateAtMinutes(e, t)), d = u.map((e) => Or(e, n)), f = Dr(n.locale ?? "en-GB", {
|
|
4379
|
+
timeZone: n.timeZone,
|
|
4380
|
+
timeZoneName: "short"
|
|
4381
|
+
}), p = new Set(u.map((e) => f.formatToParts(e).find((e) => e.type === "timeZoneName")?.value)), m = t.max - t.min === r.max - r.min && p.size === 1, h = {
|
|
4382
|
+
day: e,
|
|
4383
|
+
bounds: t,
|
|
4384
|
+
minutes: l,
|
|
4385
|
+
signature: JSON.stringify([t.max - t.min, d]),
|
|
4386
|
+
regular: m
|
|
4387
|
+
};
|
|
4388
|
+
return c.set(i, h), h;
|
|
4389
|
+
}), u = /* @__PURE__ */ new Map(), d = [...c.values()].filter((e) => e.regular);
|
|
4390
|
+
for (let e of d) u.set(e.signature, (u.get(e.signature) ?? 0) + 1);
|
|
4391
|
+
let f = d.reduce((e, t) => !e || u.get(t.signature) > u.get(e.signature) || u.get(t.signature) === u.get(e.signature) && t.day < e.day ? t : e, void 0);
|
|
4392
|
+
return {
|
|
4393
|
+
reference: f,
|
|
4394
|
+
axes: l.map((e) => ({
|
|
4395
|
+
...e,
|
|
4396
|
+
matchesReference: !!f && e.signature === f.signature
|
|
4397
|
+
}))
|
|
4398
|
+
};
|
|
4399
|
+
}
|
|
4364
4400
|
//#endregion
|
|
4365
4401
|
//#region src/components/ui/calendar/context.ts
|
|
4366
|
-
var
|
|
4367
|
-
function
|
|
4368
|
-
let e = c(
|
|
4402
|
+
var Qr = r(null);
|
|
4403
|
+
function $r() {
|
|
4404
|
+
let e = c(Qr);
|
|
4369
4405
|
if (!e) throw Error("Calendar views must render inside <Calendar>");
|
|
4370
4406
|
return e;
|
|
4371
4407
|
}
|
|
4372
4408
|
//#endregion
|
|
4373
4409
|
//#region src/components/ui/calendar/AgendaView.tsx
|
|
4374
|
-
function
|
|
4375
|
-
let i =
|
|
4410
|
+
function ei({ days: e, events: t, availability: n, label: r }) {
|
|
4411
|
+
let i = $r(), { daySegment: a, eventsOnDay: o, getFormatter: s, isAllDayLike: c, isSameDay: l, toDateKey: u } = i.dates, d = s(i.locale, {
|
|
4376
4412
|
weekday: "long",
|
|
4377
4413
|
day: "numeric",
|
|
4378
4414
|
month: "long"
|
|
@@ -4413,10 +4449,10 @@ function $r({ days: e, events: t, availability: n, label: r }) {
|
|
|
4413
4449
|
children: i.labels.noEvents
|
|
4414
4450
|
}) : /* @__PURE__ */ _("ul", {
|
|
4415
4451
|
className: "divide-border divide-y border-border border-b",
|
|
4416
|
-
children: r.map((e) => /* @__PURE__ */ _("li", { children: e.type === "event" ? /* @__PURE__ */ _(
|
|
4452
|
+
children: r.map((e) => /* @__PURE__ */ _("li", { children: e.type === "event" ? /* @__PURE__ */ _(ti, {
|
|
4417
4453
|
event: e.value,
|
|
4418
4454
|
resources: f(e.value.resourceId)
|
|
4419
|
-
}) : /* @__PURE__ */ _(
|
|
4455
|
+
}) : /* @__PURE__ */ _(ni, {
|
|
4420
4456
|
block: e.value,
|
|
4421
4457
|
resources: f(e.value.resourceId)
|
|
4422
4458
|
}) }, `${e.type}:${e.value.id}`))
|
|
@@ -4425,8 +4461,8 @@ function $r({ days: e, events: t, availability: n, label: r }) {
|
|
|
4425
4461
|
})
|
|
4426
4462
|
});
|
|
4427
4463
|
}
|
|
4428
|
-
function
|
|
4429
|
-
let n =
|
|
4464
|
+
function ti({ event: e, resources: t }) {
|
|
4465
|
+
let n = $r(), { isAllDayLike: r } = n.dates, i = n.statusLabel(e), a = r(e) ? n.labels.allDay : kr(e.start, e.end, n);
|
|
4430
4466
|
return /* @__PURE__ */ v("div", {
|
|
4431
4467
|
role: "button",
|
|
4432
4468
|
tabIndex: 0,
|
|
@@ -4473,8 +4509,8 @@ function ei({ event: e, resources: t }) {
|
|
|
4473
4509
|
]
|
|
4474
4510
|
});
|
|
4475
4511
|
}
|
|
4476
|
-
function
|
|
4477
|
-
let n =
|
|
4512
|
+
function ni({ block: e, resources: t }) {
|
|
4513
|
+
let n = $r(), r = e.kind ?? "available", i = r === "available" ? n.labels.available : n.labels.unavailable, a = n.hasBlockClick;
|
|
4478
4514
|
return /* @__PURE__ */ v("div", {
|
|
4479
4515
|
role: a ? "button" : void 0,
|
|
4480
4516
|
tabIndex: a ? 0 : void 0,
|
|
@@ -4506,12 +4542,12 @@ function ti({ block: e, resources: t }) {
|
|
|
4506
4542
|
}
|
|
4507
4543
|
//#endregion
|
|
4508
4544
|
//#region src/components/ui/calendar/MonthView.tsx
|
|
4509
|
-
var
|
|
4510
|
-
function
|
|
4545
|
+
var ri = 96, ii = 224;
|
|
4546
|
+
function ai(e) {
|
|
4511
4547
|
return `${e.type}:${e.value.id}`;
|
|
4512
4548
|
}
|
|
4513
|
-
function
|
|
4514
|
-
let i =
|
|
4549
|
+
function oi({ date: e, events: t, availability: n, label: r }) {
|
|
4550
|
+
let i = $r(), { addDays: a, daySegment: o, differenceInDays: c, eventsOnDay: u, formatLongDate: d, fromDateKey: g, getFormatter: y, getMonthWeeks: b, isAllDayLike: x, isSameDay: S, shiftRangeDays: C, toDateKey: w } = i.dates, T = p(() => b(e, i.weekStartsOn), [
|
|
4515
4551
|
e,
|
|
4516
4552
|
i.weekStartsOn,
|
|
4517
4553
|
b
|
|
@@ -4565,8 +4601,8 @@ function ai({ date: e, events: t, availability: n, label: r }) {
|
|
|
4565
4601
|
u,
|
|
4566
4602
|
o,
|
|
4567
4603
|
w
|
|
4568
|
-
]), ue = y(i.locale, { weekday: "short" }),
|
|
4569
|
-
function
|
|
4604
|
+
]), ue = y(i.locale, { weekday: "short" }), U = i.monthMaxEvents ?? (ne ? Math.max(1, Math.floor((Math.max(ne / T.length, ri) - 28) / 20)) : 3);
|
|
4605
|
+
function de(e) {
|
|
4570
4606
|
let t = w(e);
|
|
4571
4607
|
k(t), requestAnimationFrame(() => {
|
|
4572
4608
|
E.current?.querySelector(`[data-cal-date="${t}"]`)?.focus();
|
|
@@ -4583,11 +4619,11 @@ function ai({ date: e, events: t, availability: n, label: r }) {
|
|
|
4583
4619
|
if (e.key in n) {
|
|
4584
4620
|
e.preventDefault();
|
|
4585
4621
|
let r = a(t, n[e.key]);
|
|
4586
|
-
B.some((e) => S(e, r)) &&
|
|
4622
|
+
B.some((e) => S(e, r)) && de(r);
|
|
4587
4623
|
} else if (e.key === "Home" || e.key === "End") {
|
|
4588
4624
|
e.preventDefault();
|
|
4589
4625
|
let n = (i.dates.weekday(t) - i.weekStartsOn + 7) % 7;
|
|
4590
|
-
|
|
4626
|
+
de(a(t, e.key === "Home" ? -n : 6 - n));
|
|
4591
4627
|
} else (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i.openDay(t));
|
|
4592
4628
|
}
|
|
4593
4629
|
function fe(e) {
|
|
@@ -4619,7 +4655,7 @@ function ai({ date: e, events: t, availability: n, label: r }) {
|
|
|
4619
4655
|
if (!t || e.pointerId !== t.pointerId) return;
|
|
4620
4656
|
if (!t.started) {
|
|
4621
4657
|
if (Math.hypot(e.clientX - t.startX, e.clientY - t.startY) < 4) return;
|
|
4622
|
-
t.started = !0, L(
|
|
4658
|
+
t.started = !0, L(ai(t.item));
|
|
4623
4659
|
}
|
|
4624
4660
|
let n = document.elementFromPoint(e.clientX, e.clientY)?.closest("[data-cal-date]"), r = n && E.current?.contains(n) ? n.dataset.calDate ?? null : null;
|
|
4625
4661
|
t.overKey = r ?? void 0, F(r);
|
|
@@ -4672,7 +4708,7 @@ function ai({ date: e, events: t, availability: n, label: r }) {
|
|
|
4672
4708
|
}, "pointer");
|
|
4673
4709
|
}
|
|
4674
4710
|
let ye = (e, t) => {
|
|
4675
|
-
let n =
|
|
4711
|
+
let n = ai(e), r = e.value.placeholder ? {
|
|
4676
4712
|
"aria-hidden": !0,
|
|
4677
4713
|
"data-placeholder": !0
|
|
4678
4714
|
} : {
|
|
@@ -4743,7 +4779,7 @@ function ai({ date: e, events: t, availability: n, label: r }) {
|
|
|
4743
4779
|
role: "row",
|
|
4744
4780
|
className: "grid min-h-24 flex-1 grid-cols-7",
|
|
4745
4781
|
children: e.map((e) => {
|
|
4746
|
-
let t = w(e), n = le.get(t), r = n?.items ?? [], a = Math.max(1,
|
|
4782
|
+
let t = w(e), n = le.get(t), r = n?.items ?? [], a = Math.max(1, U), o = r.length > a, s = o ? r.slice(0, a - 1) : r, c = t === oe, l = i.dates.parts(e).month !== ae, u = i.hasAvailability && i.shadeOutsideAvailability && !n?.hasAvailable;
|
|
4747
4783
|
return /* @__PURE__ */ v("div", {
|
|
4748
4784
|
role: "gridcell",
|
|
4749
4785
|
tabIndex: t === ce ? 0 : -1,
|
|
@@ -4777,7 +4813,7 @@ function ai({ date: e, events: t, availability: n, label: r }) {
|
|
|
4777
4813
|
onClick: (e) => {
|
|
4778
4814
|
let n = e.currentTarget.closest("[data-cal-date]")?.getBoundingClientRect();
|
|
4779
4815
|
if (n) {
|
|
4780
|
-
let e = Math.max(n.width,
|
|
4816
|
+
let e = Math.max(n.width, ii);
|
|
4781
4817
|
N({
|
|
4782
4818
|
top: Math.max(8, n.top),
|
|
4783
4819
|
left: Math.max(8, Math.min(n.left, window.innerWidth - e - 8)),
|
|
@@ -4820,8 +4856,8 @@ function ai({ date: e, events: t, availability: n, label: r }) {
|
|
|
4820
4856
|
}
|
|
4821
4857
|
//#endregion
|
|
4822
4858
|
//#region src/components/ui/calendar/items.tsx
|
|
4823
|
-
function
|
|
4824
|
-
let u =
|
|
4859
|
+
function si({ event: e, style: t, resizeEdge: n, compact: r, dense: i, continuesBefore: a, continuesAfter: o, dragging: s, onKeyDown: c, onClick: l }) {
|
|
4860
|
+
let u = $r(), d = u.canEditEvent(e), f = e.allDay ? u.labels.allDay : kr(e.start, e.end, u), { display: p } = u, m = p.status ? u.statusLabel(e) : void 0, h = [p.time && f, m].filter(Boolean).join(" · "), y = !!e.placeholder, b = u.renderEvent?.(e, {
|
|
4825
4861
|
view: u.view,
|
|
4826
4862
|
compact: r,
|
|
4827
4863
|
timeLabel: f,
|
|
@@ -4852,7 +4888,7 @@ function oi({ event: e, style: t, resizeEdge: n, compact: r, dense: i, continues
|
|
|
4852
4888
|
}), h && /* @__PURE__ */ _("span", {
|
|
4853
4889
|
className: "ui-cal-meta font-mono",
|
|
4854
4890
|
children: h
|
|
4855
|
-
})] }) : /* @__PURE__ */ _(
|
|
4891
|
+
})] }) : /* @__PURE__ */ _(ci, {
|
|
4856
4892
|
event: e,
|
|
4857
4893
|
compact: r,
|
|
4858
4894
|
timeLabel: p.time ? f : void 0,
|
|
@@ -4867,7 +4903,7 @@ function oi({ event: e, style: t, resizeEdge: n, compact: r, dense: i, continues
|
|
|
4867
4903
|
})]
|
|
4868
4904
|
});
|
|
4869
4905
|
}
|
|
4870
|
-
function
|
|
4906
|
+
function ci({ event: e, compact: t, timeLabel: n, statusLabel: r, description: i, badge: a }) {
|
|
4871
4907
|
return t ? /* @__PURE__ */ v("div", {
|
|
4872
4908
|
className: "flex min-w-0 items-center gap-1",
|
|
4873
4909
|
children: [/* @__PURE__ */ v("span", {
|
|
@@ -4905,8 +4941,8 @@ function si({ event: e, compact: t, timeLabel: n, statusLabel: r, description: i
|
|
|
4905
4941
|
})
|
|
4906
4942
|
] });
|
|
4907
4943
|
}
|
|
4908
|
-
function
|
|
4909
|
-
let s =
|
|
4944
|
+
function li({ block: e, style: t, resizeEdge: n, continuesAfter: r, dragging: i, onKeyDown: a, onClick: o }) {
|
|
4945
|
+
let s = $r(), c = s.editLayer === "availability", l = c && s.canEditBlock(e), u = e.kind ?? "available", d = e.label ?? (u === "available" ? s.labels.available : s.labels.unavailable), f = c && !e.placeholder && (l || s.hasBlockClick);
|
|
4910
4946
|
return u === "available" && !c && !s.display.availableBlocks ? null : /* @__PURE__ */ v("div", {
|
|
4911
4947
|
role: f ? "button" : void 0,
|
|
4912
4948
|
tabIndex: f ? 0 : void 0,
|
|
@@ -4942,8 +4978,8 @@ function ci({ block: e, style: t, resizeEdge: n, continuesAfter: r, dragging: i,
|
|
|
4942
4978
|
]
|
|
4943
4979
|
});
|
|
4944
4980
|
}
|
|
4945
|
-
function
|
|
4946
|
-
let r =
|
|
4981
|
+
function ui({ draft: e, invalid: t, style: n }) {
|
|
4982
|
+
let r = $r(), i = e.target === "event" ? e.event.title : e.target === "availability" ? e.availability.label ?? r.labels.available : void 0;
|
|
4947
4983
|
return /* @__PURE__ */ v("div", {
|
|
4948
4984
|
className: "ui-cal-ghost",
|
|
4949
4985
|
"data-invalid": t ? !0 : void 0,
|
|
@@ -4967,8 +5003,8 @@ function li({ draft: e, invalid: t, style: n }) {
|
|
|
4967
5003
|
}
|
|
4968
5004
|
//#endregion
|
|
4969
5005
|
//#region src/components/ui/calendar/useGridInteraction.ts
|
|
4970
|
-
var
|
|
4971
|
-
function
|
|
5006
|
+
var di = 4, fi = 10, pi = 36;
|
|
5007
|
+
function mi(e, t, n, r, i) {
|
|
4972
5008
|
let a = zr(e.value.resourceId).length > 0, o = {
|
|
4973
5009
|
action: t,
|
|
4974
5010
|
start: n.start,
|
|
@@ -4987,11 +5023,11 @@ function pi(e, t, n, r, i) {
|
|
|
4987
5023
|
...o
|
|
4988
5024
|
};
|
|
4989
5025
|
}
|
|
4990
|
-
function
|
|
5026
|
+
function hi(e, t) {
|
|
4991
5027
|
return t.target === "selection" ? !1 : Jr(e.value, t) && (t.resourceId === void 0 || t.resourceId === t.previousResourceId);
|
|
4992
5028
|
}
|
|
4993
|
-
function
|
|
4994
|
-
let s =
|
|
5029
|
+
function gi({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, blocks: a, initialColumn: o }) {
|
|
5030
|
+
let s = $r(), { addMinutes: c, computeNudgeRange: u, dateAtMinutes: d, differenceInDays: p, shiftRangeDays: g } = s.dates, [_, v] = h(null), [y, b] = h(null), x = m(null), S = m({
|
|
4995
5031
|
ctx: s,
|
|
4996
5032
|
columns: t,
|
|
4997
5033
|
axis: e,
|
|
@@ -5057,12 +5093,12 @@ function hi({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5057
5093
|
if (!r) return;
|
|
5058
5094
|
e.hover = r.index;
|
|
5059
5095
|
let a = n[r.index], c = i(e.item.value, a.day, T(r.el, e.lastX, e.lastY), e.grabOffset, o, t.dayBounds(a.day));
|
|
5060
|
-
l =
|
|
5096
|
+
l = mi(e.item, "move", c, s.resourceId, a.resourceId);
|
|
5061
5097
|
} else if (e.kind === "resize" && e.item) {
|
|
5062
5098
|
let t = w(e.origin);
|
|
5063
5099
|
if (!t) return;
|
|
5064
5100
|
let n = a(e.item.value, s.day, T(t, e.lastX, e.lastY), o, c);
|
|
5065
|
-
l =
|
|
5101
|
+
l = mi(e.item, "resize", {
|
|
5066
5102
|
start: e.item.value.start,
|
|
5067
5103
|
end: n
|
|
5068
5104
|
}, s.resourceId, s.resourceId);
|
|
@@ -5077,7 +5113,7 @@ function hi({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5077
5113
|
let t = r.current;
|
|
5078
5114
|
if (!t || !e.started) return;
|
|
5079
5115
|
let n = t.getBoundingClientRect(), i = 0, a = 0;
|
|
5080
|
-
if (e.lastY < n.top +
|
|
5116
|
+
if (e.lastY < n.top + pi ? a = -1 : e.lastY > n.bottom - pi && (a = 1), e.lastX < n.left + pi ? i = -1 : e.lastX > n.right - pi && (i = 1), !i && !a) {
|
|
5081
5117
|
e.frame = void 0;
|
|
5082
5118
|
return;
|
|
5083
5119
|
}
|
|
@@ -5090,7 +5126,7 @@ function hi({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5090
5126
|
if (a && (x.current = null, a.cleanup(), a.frame && cancelAnimationFrame(a.frame), v(null), e)) {
|
|
5091
5127
|
if (a.started) {
|
|
5092
5128
|
let e = a.current;
|
|
5093
|
-
if (!e || a.item &&
|
|
5129
|
+
if (!e || a.item && hi(a.item, e.draft)) return;
|
|
5094
5130
|
t.commit(e.draft, "pointer");
|
|
5095
5131
|
return;
|
|
5096
5132
|
}
|
|
@@ -5152,11 +5188,11 @@ function hi({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5152
5188
|
let n = Math.hypot(e.clientX - t.startX, e.clientY - t.startY);
|
|
5153
5189
|
if (!t.started) {
|
|
5154
5190
|
if (t.pointerType === "touch") {
|
|
5155
|
-
n >
|
|
5191
|
+
n > fi && (t.moved = !0);
|
|
5156
5192
|
return;
|
|
5157
5193
|
}
|
|
5158
|
-
if (t.kind === "click" || n <
|
|
5159
|
-
n >=
|
|
5194
|
+
if (t.kind === "click" || n < di) {
|
|
5195
|
+
n >= di && (t.moved = !0);
|
|
5160
5196
|
return;
|
|
5161
5197
|
}
|
|
5162
5198
|
t.started = !0, r.current?.setPointerCapture?.(t.pointerId);
|
|
@@ -5215,17 +5251,17 @@ function hi({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5215
5251
|
if (n.shiftKey) {
|
|
5216
5252
|
let t = c(d.end, e);
|
|
5217
5253
|
if (t.getTime() - d.start.getTime() < C * 6e4) return;
|
|
5218
|
-
v =
|
|
5254
|
+
v = mi(f, "resize", {
|
|
5219
5255
|
start: d.start,
|
|
5220
5256
|
end: t
|
|
5221
5257
|
}, _.resourceId, _.resourceId);
|
|
5222
|
-
} else v =
|
|
5258
|
+
} else v = mi(f, "move", u(d, e, s.dayBounds(d.start)), _.resourceId, _.resourceId);
|
|
5223
5259
|
} else if (h.includes(n.key) && !n.shiftKey) {
|
|
5224
5260
|
let e = t[l + (n.key === h[0] ? -1 : 1)];
|
|
5225
5261
|
if (!e) return;
|
|
5226
|
-
v =
|
|
5262
|
+
v = mi(f, "move", g(d, p(e.day, _.day)), _.resourceId, e.resourceId);
|
|
5227
5263
|
}
|
|
5228
|
-
v && (n.preventDefault(), !
|
|
5264
|
+
v && (n.preventDefault(), !hi(f, v) && s.commit(v, "keyboard") && j(o));
|
|
5229
5265
|
}
|
|
5230
5266
|
function N(e) {
|
|
5231
5267
|
if (e.target !== e.currentTarget || y) return;
|
|
@@ -5355,12 +5391,12 @@ function hi({ axis: e, columns: t, pxPerMinute: n, scrollRef: r, events: i, bloc
|
|
|
5355
5391
|
}
|
|
5356
5392
|
//#endregion
|
|
5357
5393
|
//#region src/components/ui/calendar/TimeGrid.tsx
|
|
5358
|
-
var
|
|
5359
|
-
function
|
|
5394
|
+
var _i = 22, vi = 3, yi = 18, bi = 36;
|
|
5395
|
+
function xi(e) {
|
|
5360
5396
|
let t = e.querySelector(".ui-cal-head")?.offsetHeight ?? 0;
|
|
5361
5397
|
return (e.clientHeight - t) / 2;
|
|
5362
5398
|
}
|
|
5363
|
-
function
|
|
5399
|
+
function Si(e, t, n, r, i) {
|
|
5364
5400
|
let a = i(e.start, e.end, t);
|
|
5365
5401
|
return a ? a.endMinute <= n && a.startMinute < n ? "before" : a.startMinute >= r ? "after" : {
|
|
5366
5402
|
item: e,
|
|
@@ -5370,8 +5406,8 @@ function xi(e, t, n, r, i) {
|
|
|
5370
5406
|
continuesAfter: a.continuesAfter || a.endMinute > r
|
|
5371
5407
|
} : null;
|
|
5372
5408
|
}
|
|
5373
|
-
function
|
|
5374
|
-
let i =
|
|
5409
|
+
function Ci({ days: e, events: t, availability: n, label: r }) {
|
|
5410
|
+
let i = $r(), { daySegment: a, formatLongDate: o, getFormatter: s, isAllDayLike: c, isSameDay: d, minutesOfDay: g, toDateKey: y } = i.dates, { bounds: b, resources: x, hourHeight: S } = i, C = S / 60, w = m(null), T = u(), [E, D] = h(!1), O = p(() => e.flatMap((e) => x.length ? x.map((t) => ({
|
|
5375
5411
|
key: `${y(e)}|${t.id}`,
|
|
5376
5412
|
day: e,
|
|
5377
5413
|
bounds: i.dates.dayBounds(e, i.bounds),
|
|
@@ -5386,7 +5422,7 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5386
5422
|
y,
|
|
5387
5423
|
i.dates,
|
|
5388
5424
|
i.bounds
|
|
5389
|
-
]), k = p(() => new Map(t.map((e) => [e.id, e])), [t]), A = p(() => new Map(n.map((e) => [e.id, e])), [n]), j = O.findIndex((e) => d(e.day, i.now)), M =
|
|
5425
|
+
]), k = p(() => new Map(t.map((e) => [e.id, e])), [t]), A = p(() => new Map(n.map((e) => [e.id, e])), [n]), j = O.findIndex((e) => d(e.day, i.now)), M = gi({
|
|
5390
5426
|
axis: "y",
|
|
5391
5427
|
columns: O,
|
|
5392
5428
|
pxPerMinute: C,
|
|
@@ -5395,12 +5431,12 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5395
5431
|
blocks: A,
|
|
5396
5432
|
initialColumn: Math.max(0, j)
|
|
5397
5433
|
}), { drag: N, cursor: P } = M, F = i.editLayer === "availability", I = p(() => {
|
|
5398
|
-
let e = t.filter((e) => !c(e)), r =
|
|
5434
|
+
let e = t.filter((e) => !c(e)), r = yi / C;
|
|
5399
5435
|
return O.map((t) => {
|
|
5400
5436
|
let o = t.bounds ?? i.bounds, s = 0, c = 0, l = [];
|
|
5401
5437
|
for (let n of e) {
|
|
5402
5438
|
if (!Br(n.resourceId, t.resourceId, { emptyMatchesAll: !1 })) continue;
|
|
5403
|
-
let e =
|
|
5439
|
+
let e = Si(n, t.day, o.min, o.max, a);
|
|
5404
5440
|
e === "before" ? s++ : e === "after" ? c++ : e && l.push(e);
|
|
5405
5441
|
}
|
|
5406
5442
|
let u = Lr(l.map((e) => ({
|
|
@@ -5410,7 +5446,7 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5410
5446
|
})), r), d = [];
|
|
5411
5447
|
for (let e of n) {
|
|
5412
5448
|
if (!Br(e.resourceId, t.resourceId, { emptyMatchesAll: !0 })) continue;
|
|
5413
|
-
let n =
|
|
5449
|
+
let n = Si(e, t.day, o.min, o.max, a);
|
|
5414
5450
|
n && typeof n == "object" && d.push(n);
|
|
5415
5451
|
}
|
|
5416
5452
|
let f = F ? Lr(d.map((e) => ({
|
|
@@ -5470,12 +5506,12 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5470
5506
|
O,
|
|
5471
5507
|
a,
|
|
5472
5508
|
c
|
|
5473
|
-
]), R = E ? L.count : Math.min(L.count,
|
|
5509
|
+
]), R = E ? L.count : Math.min(L.count, vi), ee = L.runs.filter((e) => (L.lanes.get(e.id) ?? 0) >= R).length, te = m(C), ne = m(null);
|
|
5474
5510
|
l(() => {
|
|
5475
5511
|
let e = w.current;
|
|
5476
5512
|
if (!e) return;
|
|
5477
5513
|
let t = () => {
|
|
5478
|
-
ne.current = (e.scrollTop +
|
|
5514
|
+
ne.current = (e.scrollTop + xi(e)) / te.current;
|
|
5479
5515
|
};
|
|
5480
5516
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
5481
5517
|
}, []), f(() => {
|
|
@@ -5483,7 +5519,7 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5483
5519
|
if (!e || te.current === C) return;
|
|
5484
5520
|
te.current = C;
|
|
5485
5521
|
let t = ne.current;
|
|
5486
|
-
t !== null && (e.scrollTop = Math.max(0, t * C -
|
|
5522
|
+
t !== null && (e.scrollTop = Math.max(0, t * C - xi(e)));
|
|
5487
5523
|
}, [C]);
|
|
5488
5524
|
let re = m(null), z = i.scrollToMinute, { dates: ie, timeZone: ae, now: B } = i, oe = i.scrollAlign;
|
|
5489
5525
|
l(() => {
|
|
@@ -5491,7 +5527,7 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5491
5527
|
if (!t || re.current === i.view) return;
|
|
5492
5528
|
re.current = i.view;
|
|
5493
5529
|
let n = e.find((e) => d(e, B)) ?? e[0], r = ae ? ie.minutesOfDay(ie.wallDateAtMinutes(n, z ?? 480)) : z ?? 480, a = ie.dayBounds(n, b), o = t.querySelector(".ui-cal-head"), s = () => {
|
|
5494
|
-
let e = oe === "center" ?
|
|
5530
|
+
let e = oe === "center" ? xi(t) : 8;
|
|
5495
5531
|
t.scrollTop = Math.max(0, (r - a.min) * C - e);
|
|
5496
5532
|
};
|
|
5497
5533
|
if (s(), typeof ResizeObserver > "u") return;
|
|
@@ -5526,35 +5562,56 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5526
5562
|
ae,
|
|
5527
5563
|
B
|
|
5528
5564
|
]);
|
|
5529
|
-
let se = e.length > 1, ce = x.length > 0, V = i.timeZone
|
|
5565
|
+
let se = e.length > 1, ce = x.length > 0, V = !!i.timeZone && i.sharedTimeAxis, le = p(() => Zr(O.map((e) => ({
|
|
5566
|
+
day: e.day,
|
|
5567
|
+
bounds: e.bounds ?? i.bounds
|
|
5568
|
+
})), i.slotLabelInterval, {
|
|
5569
|
+
timeZone: i.timeZone,
|
|
5570
|
+
locale: i.locale,
|
|
5571
|
+
hour12: i.hour12
|
|
5572
|
+
}, i.bounds, V), [
|
|
5573
|
+
O,
|
|
5574
|
+
i.slotLabelInterval,
|
|
5575
|
+
i.timeZone,
|
|
5576
|
+
i.locale,
|
|
5577
|
+
i.hour12,
|
|
5578
|
+
i.bounds,
|
|
5579
|
+
V
|
|
5580
|
+
]), ue = le.reference, H = le.axes.map((e) => !!i.timeZone && (!V || !e.matchesReference)), U = ue ? s(i.locale, { timeZoneName: "short" }).formatToParts(i.dates.dateAtMinutes(ue.day, ue.bounds.min)).find((e) => e.type === "timeZoneName")?.value : void 0, de = H.some(Boolean) ? Math.max(ce ? i.resourceMinWidth : 0, 180) : ce ? i.resourceMinWidth : 44, W = Math.max(...O.map((e) => (e.bounds?.max ?? b.max) - (e.bounds?.min ?? b.min))) * C, fe = {
|
|
5530
5581
|
"--cal-hour": `${S}px`,
|
|
5531
5582
|
"--cal-offset": `${-(b.min % 60 * C)}px`,
|
|
5532
|
-
height:
|
|
5533
|
-
},
|
|
5534
|
-
for (let e = Math.ceil(
|
|
5535
|
-
let
|
|
5583
|
+
height: W
|
|
5584
|
+
}, pe = ue?.bounds ?? b, me = [], he = Math.max(5, i.slotLabelInterval);
|
|
5585
|
+
for (let e = Math.ceil(pe.min / he) * he; e < pe.max; e += he) e > pe.min && me.push(e);
|
|
5586
|
+
let ge = s(i.locale, { weekday: "short" }), _e = g(i.now), ve = i.nowIndicator, ye = N?.draft, be = ye && (ye.target === "selection" ? ye.resourceId : ye.resourceIds), xe = "";
|
|
5536
5587
|
if (P) {
|
|
5537
5588
|
let e = O[P.column];
|
|
5538
5589
|
if (e) {
|
|
5539
5590
|
let t = e.resourceId ? i.resourceById.get(e.resourceId) : void 0;
|
|
5540
|
-
|
|
5591
|
+
xe = `${o(e.day, i.locale)}, ${i.timeZone ? Or(i.dates.dateAtMinutes(e.day, P.start), i) : gr(P.start)} to ${i.timeZone ? Or(i.dates.dateAtMinutes(e.day, P.end), i) : gr(P.end)}${t ? `, ${t.title}` : ""}`;
|
|
5541
5592
|
}
|
|
5542
5593
|
}
|
|
5543
5594
|
return /* @__PURE__ */ _("div", {
|
|
5544
5595
|
ref: w,
|
|
5545
5596
|
"data-cal-drag": N?.draft.action,
|
|
5546
5597
|
className: "ui-cal-scroll relative min-h-0 flex-1 overflow-auto",
|
|
5598
|
+
style: i.timeZone && !ue ? { "--cal-gutter": "0px" } : void 0,
|
|
5547
5599
|
children: /* @__PURE__ */ v("div", {
|
|
5548
5600
|
className: "flex min-h-full flex-col",
|
|
5549
|
-
style: { minWidth: `calc(var(--cal-gutter) + ${O.length *
|
|
5601
|
+
style: { minWidth: `calc(var(--cal-gutter) + ${O.length * de}px)` },
|
|
5550
5602
|
children: [/* @__PURE__ */ v("div", {
|
|
5551
5603
|
className: "ui-cal-head border-border border-b",
|
|
5552
5604
|
children: [
|
|
5553
5605
|
se && /* @__PURE__ */ v("div", {
|
|
5554
5606
|
className: "flex",
|
|
5555
|
-
children: [/* @__PURE__ */ _("div", {
|
|
5607
|
+
children: [/* @__PURE__ */ _("div", {
|
|
5608
|
+
className: U ? "ui-cal-corner text-text-tertiary flex items-center justify-center text-2xs" : "ui-cal-corner",
|
|
5609
|
+
title: U ? i.timeZone : void 0,
|
|
5610
|
+
"aria-label": U ? i.timeZone : void 0,
|
|
5611
|
+
children: U
|
|
5612
|
+
}), e.map((e) => /* @__PURE__ */ _(wi, {
|
|
5556
5613
|
day: e,
|
|
5557
|
-
weekday:
|
|
5614
|
+
weekday: ge.format(e),
|
|
5558
5615
|
isToday: d(e, i.now),
|
|
5559
5616
|
grow: ce ? x.length : 1,
|
|
5560
5617
|
onOpen: () => i.openDay(e),
|
|
@@ -5563,7 +5620,12 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5563
5620
|
}),
|
|
5564
5621
|
ce && /* @__PURE__ */ v("div", {
|
|
5565
5622
|
className: "flex",
|
|
5566
|
-
children: [/* @__PURE__ */ _("div", {
|
|
5623
|
+
children: [/* @__PURE__ */ _("div", {
|
|
5624
|
+
className: U && !se ? "ui-cal-corner text-text-tertiary flex items-center justify-center text-2xs" : "ui-cal-corner",
|
|
5625
|
+
title: !se && U ? i.timeZone : void 0,
|
|
5626
|
+
"aria-label": !se && U ? i.timeZone : void 0,
|
|
5627
|
+
children: se ? void 0 : U
|
|
5628
|
+
}), O.map((e, t) => /* @__PURE__ */ _(Ti, {
|
|
5567
5629
|
resource: i.resourceById.get(e.resourceId ?? ""),
|
|
5568
5630
|
sub: t % x.length !== 0
|
|
5569
5631
|
}, e.key))]
|
|
@@ -5572,7 +5634,7 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5572
5634
|
className: "border-border flex border-t",
|
|
5573
5635
|
children: [/* @__PURE__ */ v("div", {
|
|
5574
5636
|
className: "ui-cal-corner text-text-tertiary flex flex-col items-end justify-center gap-0.5 pr-2 text-2xs",
|
|
5575
|
-
children: [/* @__PURE__ */ _("span", { children: i.labels.allDay }), L.count >
|
|
5637
|
+
children: [/* @__PURE__ */ _("span", { children: i.labels.allDay }), L.count > vi && /* @__PURE__ */ _("button", {
|
|
5576
5638
|
type: "button",
|
|
5577
5639
|
className: "text-accent cursor-pointer hover:underline",
|
|
5578
5640
|
"aria-expanded": E,
|
|
@@ -5581,19 +5643,19 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5581
5643
|
})]
|
|
5582
5644
|
}), /* @__PURE__ */ _("div", {
|
|
5583
5645
|
className: "relative flex-1",
|
|
5584
|
-
style: { height: R *
|
|
5646
|
+
style: { height: R * _i + 4 },
|
|
5585
5647
|
children: L.runs.map((e) => {
|
|
5586
5648
|
let t = L.lanes.get(e.id) ?? 0;
|
|
5587
5649
|
if (t >= R) return null;
|
|
5588
5650
|
let n = O[e.start], r = O[e.end - 1];
|
|
5589
|
-
return /* @__PURE__ */ _(
|
|
5651
|
+
return /* @__PURE__ */ _(si, {
|
|
5590
5652
|
event: e.event,
|
|
5591
5653
|
compact: !0,
|
|
5592
5654
|
continuesBefore: !!n && a(e.event.start, e.event.end, n.day)?.continuesBefore,
|
|
5593
5655
|
continuesAfter: !!r && a(e.event.start, e.event.end, r.day)?.continuesAfter,
|
|
5594
5656
|
style: {
|
|
5595
|
-
top: t *
|
|
5596
|
-
height:
|
|
5657
|
+
top: t * _i + 2,
|
|
5658
|
+
height: _i - 3,
|
|
5597
5659
|
left: `calc(${e.start / O.length * 100}% + 2px)`,
|
|
5598
5660
|
width: `calc(${(e.end - e.start) / O.length * 100}% - 4px)`,
|
|
5599
5661
|
justifyContent: "center"
|
|
@@ -5609,15 +5671,30 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5609
5671
|
]
|
|
5610
5672
|
}), /* @__PURE__ */ v("div", {
|
|
5611
5673
|
className: "flex flex-1",
|
|
5612
|
-
children: [/* @__PURE__ */
|
|
5674
|
+
children: [/* @__PURE__ */ v("div", {
|
|
5613
5675
|
className: "ui-cal-gutter relative",
|
|
5614
|
-
style: { height:
|
|
5676
|
+
style: { height: W },
|
|
5615
5677
|
"aria-hidden": "true",
|
|
5616
|
-
children:
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5678
|
+
children: [
|
|
5679
|
+
U && !se && !ce && /* @__PURE__ */ _("span", {
|
|
5680
|
+
className: "text-text-tertiary absolute top-0 right-2 text-2xs",
|
|
5681
|
+
"aria-hidden": "true",
|
|
5682
|
+
children: U
|
|
5683
|
+
}),
|
|
5684
|
+
ue && me.map((e) => {
|
|
5685
|
+
let t = i.dates.parts(i.dates.dateAtMinutes(ue.day, e));
|
|
5686
|
+
return /* @__PURE__ */ _("span", {
|
|
5687
|
+
className: "text-text-tertiary font-mono absolute right-2 -translate-y-1/2 text-2xs",
|
|
5688
|
+
style: { top: (e - ue.bounds.min) * C },
|
|
5689
|
+
children: Ar(t.hour * 60 + t.minute, i)
|
|
5690
|
+
}, e);
|
|
5691
|
+
}),
|
|
5692
|
+
!i.timeZone && me.map((e) => /* @__PURE__ */ _("span", {
|
|
5693
|
+
className: "text-text-tertiary font-mono absolute right-2 -translate-y-1/2 text-2xs",
|
|
5694
|
+
style: { top: (e - b.min) * C },
|
|
5695
|
+
children: Ar(e, i)
|
|
5696
|
+
}, e))
|
|
5697
|
+
]
|
|
5621
5698
|
}), /* @__PURE__ */ v("div", {
|
|
5622
5699
|
role: "group",
|
|
5623
5700
|
"aria-roledescription": "time grid",
|
|
@@ -5625,7 +5702,7 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5625
5702
|
"aria-describedby": T,
|
|
5626
5703
|
tabIndex: 0,
|
|
5627
5704
|
className: "ui-cal-lines ui-cal-surface relative flex flex-1 select-none focus-visible:outline-none",
|
|
5628
|
-
style:
|
|
5705
|
+
style: fe,
|
|
5629
5706
|
onPointerDown: M.onPointerDown,
|
|
5630
5707
|
onFocus: M.onGridFocus,
|
|
5631
5708
|
onBlur: M.onGridBlur,
|
|
@@ -5639,21 +5716,21 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5639
5716
|
/* @__PURE__ */ _("span", {
|
|
5640
5717
|
className: "sr-only",
|
|
5641
5718
|
"aria-live": "polite",
|
|
5642
|
-
children:
|
|
5719
|
+
children: xe
|
|
5643
5720
|
}),
|
|
5644
5721
|
O.map((e, t) => {
|
|
5645
|
-
let n = I[t], r = e.bounds ?? i.bounds, o =
|
|
5722
|
+
let n = I[t], r = e.bounds ?? i.bounds, o = H[t] ? 72 : 0, s = H[t] ? le.axes[t].minutes : [], c = d(e.day, i.now), l = ce && t % x.length !== 0;
|
|
5646
5723
|
return /* @__PURE__ */ v("div", {
|
|
5647
5724
|
"data-cal-col": t,
|
|
5648
|
-
"data-today":
|
|
5649
|
-
"data-subcol":
|
|
5725
|
+
"data-today": c || void 0,
|
|
5726
|
+
"data-subcol": l || void 0,
|
|
5650
5727
|
className: "ui-cal-col flex-1",
|
|
5651
5728
|
style: {
|
|
5652
|
-
minWidth:
|
|
5729
|
+
minWidth: de,
|
|
5653
5730
|
height: (r.max - r.min) * C
|
|
5654
5731
|
},
|
|
5655
5732
|
children: [
|
|
5656
|
-
|
|
5733
|
+
s.map((t) => /* @__PURE__ */ _("span", {
|
|
5657
5734
|
className: "ui-cal-zone-label",
|
|
5658
5735
|
style: { top: (t - r.min) * C },
|
|
5659
5736
|
"aria-hidden": "true",
|
|
@@ -5671,7 +5748,7 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5671
5748
|
}, `o${e}`)),
|
|
5672
5749
|
n.blocks.map((e) => {
|
|
5673
5750
|
let a = n.blockLayout?.get(e.item.id);
|
|
5674
|
-
return /* @__PURE__ */ _(
|
|
5751
|
+
return /* @__PURE__ */ _(li, {
|
|
5675
5752
|
block: e.item,
|
|
5676
5753
|
resizeEdge: "bottom",
|
|
5677
5754
|
continuesAfter: e.continuesAfter,
|
|
@@ -5679,8 +5756,8 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5679
5756
|
style: {
|
|
5680
5757
|
top: (e.start - r.min) * C,
|
|
5681
5758
|
height: Math.max((e.end - e.start) * C, 4),
|
|
5682
|
-
left: a ? `calc(${a.column / a.columns * 100}% + ${
|
|
5683
|
-
width: a ? `calc(${a.span / a.columns * 100}% - ${
|
|
5759
|
+
left: a ? `calc(${a.column / a.columns * 100}% + ${o * (1 - a.column / a.columns) + 1}px)` : o,
|
|
5760
|
+
width: a ? `calc(${a.span / a.columns * 100}% - ${o * a.span / a.columns + 4}px)` : o ? `calc(100% - ${o}px)` : "100%"
|
|
5684
5761
|
},
|
|
5685
5762
|
onKeyDown: (n) => M.onItemKeyDown(n, "availability", e.item.id, t),
|
|
5686
5763
|
onClick: (t) => {
|
|
@@ -5689,13 +5766,13 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5689
5766
|
}, e.item.id);
|
|
5690
5767
|
}),
|
|
5691
5768
|
/* @__PURE__ */ _("div", {
|
|
5692
|
-
style:
|
|
5769
|
+
style: o ? { left: o } : void 0,
|
|
5693
5770
|
className: G("absolute inset-0", F && "ui-cal-muted-layer"),
|
|
5694
5771
|
children: n.placed.map((e) => {
|
|
5695
|
-
let a = n.layout.get(e.item.id), o = Math.max((e.end - e.start) * C,
|
|
5696
|
-
return /* @__PURE__ */ _(
|
|
5772
|
+
let a = n.layout.get(e.item.id), o = Math.max((e.end - e.start) * C, yi);
|
|
5773
|
+
return /* @__PURE__ */ _(si, {
|
|
5697
5774
|
event: e.item,
|
|
5698
|
-
compact: o <
|
|
5775
|
+
compact: o < bi,
|
|
5699
5776
|
resizeEdge: "bottom",
|
|
5700
5777
|
continuesBefore: e.continuesBefore,
|
|
5701
5778
|
continuesAfter: e.continuesAfter,
|
|
@@ -5725,21 +5802,21 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5725
5802
|
"data-cal-ignore": !0,
|
|
5726
5803
|
children: i.labels.later(n.later)
|
|
5727
5804
|
}),
|
|
5728
|
-
|
|
5805
|
+
c && ve && _e >= r.min && _e <= r.max && /* @__PURE__ */ _("div", {
|
|
5729
5806
|
className: "ui-cal-now",
|
|
5730
5807
|
"data-axis": "y",
|
|
5731
|
-
"data-dot": !
|
|
5732
|
-
style: { top: (
|
|
5808
|
+
"data-dot": !l || void 0,
|
|
5809
|
+
style: { top: (_e - r.min) * C }
|
|
5733
5810
|
}),
|
|
5734
|
-
|
|
5735
|
-
let t =
|
|
5736
|
-
return !t || typeof t != "object" ? null : /* @__PURE__ */ _(
|
|
5737
|
-
draft:
|
|
5811
|
+
ye && Br(be, e.resourceId, { emptyMatchesAll: !0 }) && (() => {
|
|
5812
|
+
let t = Si(ye, e.day, r.min, r.max, a);
|
|
5813
|
+
return !t || typeof t != "object" ? null : /* @__PURE__ */ _(ui, {
|
|
5814
|
+
draft: ye,
|
|
5738
5815
|
invalid: N?.invalid,
|
|
5739
5816
|
style: {
|
|
5740
5817
|
top: (t.start - r.min) * C + 1,
|
|
5741
|
-
height: Math.max((t.end - t.start) * C - 2,
|
|
5742
|
-
left:
|
|
5818
|
+
height: Math.max((t.end - t.start) * C - 2, yi),
|
|
5819
|
+
left: o + 1,
|
|
5743
5820
|
right: 4
|
|
5744
5821
|
}
|
|
5745
5822
|
});
|
|
@@ -5748,7 +5825,7 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5748
5825
|
"data-cal-cursor": !0,
|
|
5749
5826
|
className: "ui-cal-cursor",
|
|
5750
5827
|
style: {
|
|
5751
|
-
left:
|
|
5828
|
+
left: o,
|
|
5752
5829
|
right: 0,
|
|
5753
5830
|
top: (P.start - r.min) * C,
|
|
5754
5831
|
height: (P.end - P.start) * C
|
|
@@ -5763,8 +5840,8 @@ function Si({ days: e, events: t, availability: n, label: r }) {
|
|
|
5763
5840
|
})
|
|
5764
5841
|
});
|
|
5765
5842
|
}
|
|
5766
|
-
function
|
|
5767
|
-
let o =
|
|
5843
|
+
function wi({ day: e, weekday: t, isToday: n, grow: r, bordered: i, onOpen: a }) {
|
|
5844
|
+
let o = $r();
|
|
5768
5845
|
return /* @__PURE__ */ _("div", {
|
|
5769
5846
|
className: G("flex min-w-0 items-center justify-center py-1.5", i && "border-border border-l"),
|
|
5770
5847
|
style: { flex: `${r} 1 0` },
|
|
@@ -5784,8 +5861,8 @@ function Ci({ day: e, weekday: t, isToday: n, grow: r, bordered: i, onOpen: a })
|
|
|
5784
5861
|
})
|
|
5785
5862
|
});
|
|
5786
5863
|
}
|
|
5787
|
-
function
|
|
5788
|
-
let n =
|
|
5864
|
+
function Ti({ resource: e, sub: t }) {
|
|
5865
|
+
let n = $r();
|
|
5789
5866
|
return /* @__PURE__ */ v("div", {
|
|
5790
5867
|
className: G("border-border flex min-w-0 flex-1 items-center gap-1.5 border-l px-2 py-1.5", t && "ui-cal-subhead"),
|
|
5791
5868
|
style: { minWidth: n.resourceMinWidth },
|
|
@@ -5807,8 +5884,8 @@ function wi({ resource: e, sub: t }) {
|
|
|
5807
5884
|
}
|
|
5808
5885
|
//#endregion
|
|
5809
5886
|
//#region src/components/ui/calendar/TimelineView.tsx
|
|
5810
|
-
var
|
|
5811
|
-
function
|
|
5887
|
+
var Ei = 34, Di = 4, Oi = 28;
|
|
5888
|
+
function ki(e, t, n, r, i) {
|
|
5812
5889
|
let a = i(e.start, e.end, t);
|
|
5813
5890
|
return !a || a.endMinute <= n || a.startMinute >= r ? null : {
|
|
5814
5891
|
item: e,
|
|
@@ -5818,8 +5895,8 @@ function Oi(e, t, n, r, i) {
|
|
|
5818
5895
|
continuesAfter: a.continuesAfter || a.endMinute > r
|
|
5819
5896
|
};
|
|
5820
5897
|
}
|
|
5821
|
-
function
|
|
5822
|
-
let i =
|
|
5898
|
+
function Ai({ day: e, events: t, availability: n, label: r }) {
|
|
5899
|
+
let i = $r(), { daySegment: a, isSameDay: o, minutesOfDay: s } = i.dates, c = i.dayBounds(e), d = m(null), f = i.resources.length === 0 && t.length === 0 && n.length === 0, [g, y] = h(0);
|
|
5823
5900
|
l(() => {
|
|
5824
5901
|
let e = d.current;
|
|
5825
5902
|
if (!e || typeof ResizeObserver > "u") return;
|
|
@@ -5850,7 +5927,7 @@ function ki({ day: e, events: t, availability: n, label: r }) {
|
|
|
5850
5927
|
D,
|
|
5851
5928
|
T,
|
|
5852
5929
|
e
|
|
5853
|
-
]), j =
|
|
5930
|
+
]), j = gi({
|
|
5854
5931
|
axis: "x",
|
|
5855
5932
|
columns: k,
|
|
5856
5933
|
pxPerMinute: S,
|
|
@@ -5859,13 +5936,13 @@ function ki({ day: e, events: t, availability: n, label: r }) {
|
|
|
5859
5936
|
blocks: p(() => new Map(n.map((e) => [e.id, e])), [n]),
|
|
5860
5937
|
initialColumn: 0
|
|
5861
5938
|
}), { drag: M, cursor: N } = j, P = i.editLayer === "availability", F = p(() => {
|
|
5862
|
-
let r =
|
|
5939
|
+
let r = Oi / S;
|
|
5863
5940
|
return k.map((o) => {
|
|
5864
|
-
let s = t.filter((e) => Br(e.resourceId, o.resourceId, { emptyMatchesAll: !1 })).map((t) =>
|
|
5941
|
+
let s = t.filter((e) => Br(e.resourceId, o.resourceId, { emptyMatchesAll: !1 })).map((t) => ki(t, e, c.min, c.max, a)).filter((e) => e !== null), l = Rr(s.map((e) => ({
|
|
5865
5942
|
id: e.item.id,
|
|
5866
5943
|
start: e.start,
|
|
5867
5944
|
end: Math.max(e.end, e.start + r)
|
|
5868
|
-
}))), u = n.filter((e) => Br(e.resourceId, o.resourceId, { emptyMatchesAll: !0 })).map((t) =>
|
|
5945
|
+
}))), u = n.filter((e) => Br(e.resourceId, o.resourceId, { emptyMatchesAll: !0 })).map((t) => ki(t, e, c.min, c.max, a)).filter((e) => e !== null), d = P ? Rr(u.map((e) => ({
|
|
5869
5946
|
id: e.item.id,
|
|
5870
5947
|
start: e.start,
|
|
5871
5948
|
end: Math.max(e.end, e.start + r)
|
|
@@ -5986,7 +6063,7 @@ function ki({ day: e, events: t, availability: n, label: r }) {
|
|
|
5986
6063
|
}), !n && t.resources.map((t) => {
|
|
5987
6064
|
let n = se++, r = F[n], o = k[n];
|
|
5988
6065
|
if (!r || !o) return null;
|
|
5989
|
-
let s = r.laneCount *
|
|
6066
|
+
let s = r.laneCount * Ei + Di * 2;
|
|
5990
6067
|
return /* @__PURE__ */ v("div", {
|
|
5991
6068
|
className: "border-border flex border-b",
|
|
5992
6069
|
children: [/* @__PURE__ */ v("div", {
|
|
@@ -6026,7 +6103,7 @@ function ki({ day: e, events: t, availability: n, label: r }) {
|
|
|
6026
6103
|
}, `o${e}`)),
|
|
6027
6104
|
r.blocks.map((e) => {
|
|
6028
6105
|
let t = r.blockLanes?.lanes.get(e.item.id);
|
|
6029
|
-
return /* @__PURE__ */ _(
|
|
6106
|
+
return /* @__PURE__ */ _(li, {
|
|
6030
6107
|
block: e.item,
|
|
6031
6108
|
resizeEdge: "right",
|
|
6032
6109
|
continuesAfter: e.continuesAfter,
|
|
@@ -6034,8 +6111,8 @@ function ki({ day: e, events: t, availability: n, label: r }) {
|
|
|
6034
6111
|
style: {
|
|
6035
6112
|
left: (e.start - c.min) * S,
|
|
6036
6113
|
width: Math.max((e.end - e.start) * S, 4),
|
|
6037
|
-
top: t === void 0 ? 0 :
|
|
6038
|
-
height: t === void 0 ? "100%" :
|
|
6114
|
+
top: t === void 0 ? 0 : Di + t * Ei,
|
|
6115
|
+
height: t === void 0 ? "100%" : Ei - 3
|
|
6039
6116
|
},
|
|
6040
6117
|
onKeyDown: (t) => j.onItemKeyDown(t, "availability", e.item.id, n),
|
|
6041
6118
|
onClick: (t) => {
|
|
@@ -6047,7 +6124,7 @@ function ki({ day: e, events: t, availability: n, label: r }) {
|
|
|
6047
6124
|
className: G("absolute inset-0", P && "ui-cal-muted-layer"),
|
|
6048
6125
|
children: r.placed.map((e) => {
|
|
6049
6126
|
let t = r.lanes.lanes.get(e.item.id) ?? 0;
|
|
6050
|
-
return /* @__PURE__ */ _(
|
|
6127
|
+
return /* @__PURE__ */ _(si, {
|
|
6051
6128
|
event: e.item,
|
|
6052
6129
|
compact: !1,
|
|
6053
6130
|
dense: !0,
|
|
@@ -6057,9 +6134,9 @@ function ki({ day: e, events: t, availability: n, label: r }) {
|
|
|
6057
6134
|
dragging: M?.itemId === e.item.id,
|
|
6058
6135
|
style: {
|
|
6059
6136
|
left: (e.start - c.min) * S + 1,
|
|
6060
|
-
width: Math.max((e.end - e.start) * S,
|
|
6061
|
-
top:
|
|
6062
|
-
height:
|
|
6137
|
+
width: Math.max((e.end - e.start) * S, Oi) - 2,
|
|
6138
|
+
top: Di + t * Ei,
|
|
6139
|
+
height: Ei - 3,
|
|
6063
6140
|
justifyContent: "center"
|
|
6064
6141
|
},
|
|
6065
6142
|
onKeyDown: (t) => j.onItemKeyDown(t, "event", e.item.id, n),
|
|
@@ -6075,15 +6152,15 @@ function ki({ day: e, events: t, availability: n, label: r }) {
|
|
|
6075
6152
|
style: { left: (ne - c.min) * S }
|
|
6076
6153
|
}),
|
|
6077
6154
|
z && Br(ie, o.resourceId, { emptyMatchesAll: !0 }) && (() => {
|
|
6078
|
-
let t =
|
|
6079
|
-
return t ? /* @__PURE__ */ _(
|
|
6155
|
+
let t = ki(z, e, c.min, c.max, a);
|
|
6156
|
+
return t ? /* @__PURE__ */ _(ui, {
|
|
6080
6157
|
draft: z,
|
|
6081
6158
|
invalid: M?.invalid,
|
|
6082
6159
|
style: {
|
|
6083
6160
|
left: (t.start - c.min) * S + 1,
|
|
6084
|
-
width: Math.max((t.end - t.start) * S - 2,
|
|
6085
|
-
top:
|
|
6086
|
-
bottom:
|
|
6161
|
+
width: Math.max((t.end - t.start) * S - 2, Oi),
|
|
6162
|
+
top: Di,
|
|
6163
|
+
bottom: Di
|
|
6087
6164
|
}
|
|
6088
6165
|
}) : null;
|
|
6089
6166
|
})(),
|
|
@@ -6109,7 +6186,7 @@ function ki({ day: e, events: t, availability: n, label: r }) {
|
|
|
6109
6186
|
}
|
|
6110
6187
|
//#endregion
|
|
6111
6188
|
//#region src/components/ui/calendar/types.ts
|
|
6112
|
-
var
|
|
6189
|
+
var ji = {
|
|
6113
6190
|
today: "Today",
|
|
6114
6191
|
previous: "Previous",
|
|
6115
6192
|
next: "Next",
|
|
@@ -6146,7 +6223,7 @@ var Ai = {
|
|
|
6146
6223
|
};
|
|
6147
6224
|
//#endregion
|
|
6148
6225
|
//#region src/components/ui/RadioPill.tsx
|
|
6149
|
-
function
|
|
6226
|
+
function Mi({ options: e, value: t, onChange: n, disabled: r, className: i, "aria-label": a }) {
|
|
6150
6227
|
return /* @__PURE__ */ _("div", {
|
|
6151
6228
|
role: "radiogroup",
|
|
6152
6229
|
"aria-label": a,
|
|
@@ -6163,25 +6240,25 @@ function ji({ options: e, value: t, onChange: n, disabled: r, className: i, "ari
|
|
|
6163
6240
|
}
|
|
6164
6241
|
//#endregion
|
|
6165
6242
|
//#region src/components/ui/Calendar.tsx
|
|
6166
|
-
var
|
|
6243
|
+
var Ni = [
|
|
6167
6244
|
"day",
|
|
6168
6245
|
"threeDay",
|
|
6169
6246
|
"week",
|
|
6170
6247
|
"month",
|
|
6171
6248
|
"agenda"
|
|
6172
6249
|
];
|
|
6173
|
-
function
|
|
6250
|
+
function Pi() {
|
|
6174
6251
|
return /* @__PURE__ */ new Date();
|
|
6175
6252
|
}
|
|
6176
|
-
function
|
|
6177
|
-
let [t, n] = h(
|
|
6253
|
+
function Fi(e) {
|
|
6254
|
+
let [t, n] = h(Pi);
|
|
6178
6255
|
return l(() => {
|
|
6179
6256
|
if (e) return;
|
|
6180
|
-
let t = setInterval(() => n(
|
|
6257
|
+
let t = setInterval(() => n(Pi()), 3e4);
|
|
6181
6258
|
return () => clearInterval(t);
|
|
6182
6259
|
}, [e]), e ?? t;
|
|
6183
6260
|
}
|
|
6184
|
-
function
|
|
6261
|
+
function Ii(e) {
|
|
6185
6262
|
let [t, n] = h(null);
|
|
6186
6263
|
return l(() => {
|
|
6187
6264
|
let t = e.current;
|
|
@@ -6192,38 +6269,38 @@ function Fi(e) {
|
|
|
6192
6269
|
return r.observe(t), () => r.disconnect();
|
|
6193
6270
|
}, [e]), t;
|
|
6194
6271
|
}
|
|
6195
|
-
var
|
|
6196
|
-
function
|
|
6272
|
+
var Li = /* @__PURE__ */ new Set();
|
|
6273
|
+
function Ri(e) {
|
|
6197
6274
|
let t = !1;
|
|
6198
6275
|
try {
|
|
6199
6276
|
t = process.env.NODE_ENV !== "production";
|
|
6200
6277
|
} catch {}
|
|
6201
|
-
!t ||
|
|
6278
|
+
!t || Li.has(e) || (Li.add(e), console.warn(`[Calendar] ${e}`));
|
|
6202
6279
|
}
|
|
6203
|
-
function
|
|
6280
|
+
function zi(e, t, n) {
|
|
6204
6281
|
try {
|
|
6205
6282
|
return hr(t);
|
|
6206
6283
|
} catch {
|
|
6207
|
-
return
|
|
6284
|
+
return Ri(`Invalid ${e} "${t}", expected HH:mm; using the default.`), n;
|
|
6208
6285
|
}
|
|
6209
6286
|
}
|
|
6210
|
-
function
|
|
6211
|
-
let
|
|
6212
|
-
r === void 0 &&
|
|
6213
|
-
},
|
|
6214
|
-
s === void 0 &&
|
|
6215
|
-
},
|
|
6216
|
-
...
|
|
6217
|
-
...
|
|
6287
|
+
function Bi({ events: e = [], availability: t, resources: n = [], view: r, defaultView: i = "week", onViewChange: a, views: o = Ni, date: s, defaultDate: c, onDateChange: d, onRangeChange: g, weekStartsOn: y = 1, workWeekDays: b, agendaDays: x = 7, slotMinTime: S = "07:00", slotMaxTime: C = "20:00", slotDuration: w = 15, slotLabelInterval: T = 60, sharedTimeAxis: E = !1, hourHeight: D = 48, timelineHourWidth: O = 96, resourceMinWidth: j = 120, scrollToTime: M, scrollAlign: N = "start", now: P, nowIndicator: F = !0, editLayer: I = "events", readOnly: R = !1, selectable: ee, clickCreateDuration: te = 30, shadeOutsideAvailability: ne = !0, onCreate: re, onEventClick: z, onEventChange: ie, onAvailabilityClick: ae, onAvailabilityChange: B, validate: oe, onInvalidChange: se, onDateClick: ce, renderEvent: V, monthMaxEvents: le, agendaShowAvailability: ue = !0, display: H, narrowView: U = "day", narrowWidth: de = 640, locale: W = "en-GB", timeZone: fe, hour12: pe = !1, labels: me, toolbar: he = !0, toolbarActions: ge, loading: _e = !1, className: ve, "aria-label": ye }) {
|
|
6288
|
+
let be = p(() => Xr(fe), [fe]), { addDays: xe, formatLongDate: Se, formatRangeTitle: Ce, getVisibleDays: we, minutesOfDay: Te, shiftDate: Ee } = be, De = m(null), Oe = u(), ke = Fi(P), Ae = Ii(De), [je, Me] = h(i), [Ne, Pe] = h(() => c ?? Pi()), Fe = r ?? je, K = s ?? Ne, Ie = (e) => {
|
|
6289
|
+
r === void 0 && Me(e), a?.(e);
|
|
6290
|
+
}, Le = (e) => {
|
|
6291
|
+
s === void 0 && Pe(e), d?.(e);
|
|
6292
|
+
}, q = Ae !== null && Ae < de && U !== !1 && xr(Fe) && Fe !== "day" && U ? U : Fe, Re = p(() => ({
|
|
6293
|
+
...ji,
|
|
6294
|
+
...me,
|
|
6218
6295
|
views: {
|
|
6219
|
-
...
|
|
6220
|
-
...
|
|
6296
|
+
...ji.views,
|
|
6297
|
+
...me?.views
|
|
6221
6298
|
},
|
|
6222
6299
|
status: {
|
|
6223
|
-
...
|
|
6224
|
-
...
|
|
6300
|
+
...ji.status,
|
|
6301
|
+
...me?.status
|
|
6225
6302
|
}
|
|
6226
|
-
}), [
|
|
6303
|
+
}), [me]), ze = p(() => ({
|
|
6227
6304
|
weekStartsOn: y,
|
|
6228
6305
|
workWeekDays: b,
|
|
6229
6306
|
agendaDays: x
|
|
@@ -6231,127 +6308,128 @@ function zi({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6231
6308
|
y,
|
|
6232
6309
|
b,
|
|
6233
6310
|
x
|
|
6234
|
-
]),
|
|
6235
|
-
|
|
6311
|
+
]), J = K.getTime(), Be = p(() => we(q, new Date(J), ze), [
|
|
6312
|
+
q,
|
|
6313
|
+
J,
|
|
6236
6314
|
ze,
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
]), Be = J[0], Ve = be(J[J.length - 1], 1), He = Be.getTime(), Ue = Ve.getTime(), We = m(g);
|
|
6315
|
+
we
|
|
6316
|
+
]), Ve = Be[0], He = xe(Be[Be.length - 1], 1), Ue = Ve.getTime(), We = He.getTime(), Ge = m(g);
|
|
6240
6317
|
f(() => {
|
|
6241
|
-
|
|
6318
|
+
Ge.current = g;
|
|
6242
6319
|
}), l(() => {
|
|
6243
|
-
|
|
6244
|
-
start: new Date(
|
|
6245
|
-
end: new Date(
|
|
6246
|
-
view:
|
|
6320
|
+
Ge.current?.({
|
|
6321
|
+
start: new Date(Ue),
|
|
6322
|
+
end: new Date(We),
|
|
6323
|
+
view: q
|
|
6247
6324
|
});
|
|
6248
6325
|
}, [
|
|
6249
|
-
He,
|
|
6250
6326
|
Ue,
|
|
6251
|
-
|
|
6327
|
+
We,
|
|
6328
|
+
q
|
|
6252
6329
|
]);
|
|
6253
|
-
let
|
|
6330
|
+
let Ke = p(() => e.filter((e) => Nr(e.start.getTime(), Math.max(e.end.getTime(), e.start.getTime() + 1), Ue, We)), [
|
|
6254
6331
|
e,
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
]),
|
|
6332
|
+
Ue,
|
|
6333
|
+
We
|
|
6334
|
+
]), qe = p(() => (t ?? []).filter((e) => Nr(e.start.getTime(), e.end.getTime(), Ue, We)), [
|
|
6258
6335
|
t,
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
]),
|
|
6262
|
-
|
|
6263
|
-
let
|
|
6264
|
-
min:
|
|
6265
|
-
max:
|
|
6336
|
+
Ue,
|
|
6337
|
+
We
|
|
6338
|
+
]), Je = zi("slotMinTime", S, 0), Ye = zi("slotMaxTime", C, 1440);
|
|
6339
|
+
Ye <= Je && Ri(`slotMaxTime "${C}" must be after slotMinTime "${S}"; showing the whole day.`);
|
|
6340
|
+
let Xe = p(() => Ye > Je ? {
|
|
6341
|
+
min: Je,
|
|
6342
|
+
max: Ye
|
|
6266
6343
|
} : {
|
|
6267
6344
|
min: 0,
|
|
6268
6345
|
max: 1440
|
|
6269
|
-
}, [
|
|
6270
|
-
if (
|
|
6346
|
+
}, [Je, Ye]), Y = Math.max(1, Math.round(w)), Ze;
|
|
6347
|
+
if (M) Ze = zi("scrollToTime", M, Xe.min);
|
|
6271
6348
|
else {
|
|
6272
|
-
let e =
|
|
6273
|
-
e.length && (
|
|
6349
|
+
let e = qe.filter((e) => (e.kind ?? "available") === "available").map((e) => fe ? be.parts(e.start).hour * 60 + be.parts(e.start).minute : Te(e.start)).filter((e) => e >= Xe.min && e < Xe.max);
|
|
6350
|
+
e.length && (Ze = Math.min(...e));
|
|
6274
6351
|
}
|
|
6275
|
-
let
|
|
6276
|
-
...
|
|
6277
|
-
locale:
|
|
6278
|
-
}),
|
|
6279
|
-
locale:
|
|
6280
|
-
hour12:
|
|
6281
|
-
timeZone:
|
|
6282
|
-
},
|
|
6283
|
-
let t = zr(e).map((e) =>
|
|
6352
|
+
let Qe = p(() => new Map(n.map((e) => [e.id, e])), [n]), $e = Ce(q, K, {
|
|
6353
|
+
...ze,
|
|
6354
|
+
locale: W
|
|
6355
|
+
}), et = {
|
|
6356
|
+
locale: W,
|
|
6357
|
+
hour12: pe,
|
|
6358
|
+
timeZone: fe
|
|
6359
|
+
}, tt = (e) => Qe.get(zr(e)[0] ?? ""), nt = (e) => {
|
|
6360
|
+
let t = zr(e).map((e) => Qe.get(e)?.title).filter(Boolean);
|
|
6284
6361
|
return t.length ? `, ${t.join(", ")}` : "";
|
|
6285
|
-
},
|
|
6286
|
-
let t =
|
|
6362
|
+
}, rt = (e) => e.status && e.status !== "confirmed" ? Re.status[e.status] : void 0, it = (e) => {
|
|
6363
|
+
let t = oe?.(e);
|
|
6287
6364
|
return typeof t == "string" && t ? t : void 0;
|
|
6288
|
-
},
|
|
6289
|
-
view:
|
|
6290
|
-
dates:
|
|
6291
|
-
timeZone:
|
|
6292
|
-
dayBounds: (e) =>
|
|
6293
|
-
locale:
|
|
6294
|
-
hour12:
|
|
6365
|
+
}, X = {
|
|
6366
|
+
view: q,
|
|
6367
|
+
dates: be,
|
|
6368
|
+
timeZone: fe,
|
|
6369
|
+
dayBounds: (e) => be.dayBounds(e, Xe),
|
|
6370
|
+
locale: W,
|
|
6371
|
+
hour12: pe,
|
|
6295
6372
|
weekStartsOn: y,
|
|
6296
|
-
now:
|
|
6297
|
-
nowIndicator:
|
|
6298
|
-
labels:
|
|
6299
|
-
itemHelpId:
|
|
6373
|
+
now: ke,
|
|
6374
|
+
nowIndicator: F,
|
|
6375
|
+
labels: Re,
|
|
6376
|
+
itemHelpId: Oe,
|
|
6300
6377
|
resources: n,
|
|
6301
|
-
resourceById:
|
|
6302
|
-
step:
|
|
6303
|
-
bounds:
|
|
6304
|
-
hourHeight:
|
|
6378
|
+
resourceById: Qe,
|
|
6379
|
+
step: Y,
|
|
6380
|
+
bounds: Xe,
|
|
6381
|
+
hourHeight: D,
|
|
6305
6382
|
slotLabelInterval: T,
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6383
|
+
sharedTimeAxis: E,
|
|
6384
|
+
timelineHourWidth: O,
|
|
6385
|
+
resourceMinWidth: j,
|
|
6386
|
+
editLayer: I,
|
|
6387
|
+
selectable: !R && !!re && (ee ?? !0),
|
|
6388
|
+
clickCreateDuration: te,
|
|
6311
6389
|
hasAvailability: t !== void 0,
|
|
6312
|
-
shadeOutsideAvailability:
|
|
6313
|
-
monthMaxEvents:
|
|
6314
|
-
agendaShowAvailability:
|
|
6390
|
+
shadeOutsideAvailability: ne,
|
|
6391
|
+
monthMaxEvents: le,
|
|
6392
|
+
agendaShowAvailability: ue,
|
|
6315
6393
|
display: {
|
|
6316
|
-
time:
|
|
6317
|
-
description:
|
|
6318
|
-
status:
|
|
6319
|
-
badge:
|
|
6320
|
-
blockLabels:
|
|
6321
|
-
availableBlocks:
|
|
6394
|
+
time: H?.time ?? !0,
|
|
6395
|
+
description: H?.description ?? !0,
|
|
6396
|
+
status: H?.status ?? !0,
|
|
6397
|
+
badge: H?.badge ?? !0,
|
|
6398
|
+
blockLabels: H?.blockLabels ?? !0,
|
|
6399
|
+
availableBlocks: H?.availableBlocks ?? !0
|
|
6322
6400
|
},
|
|
6323
|
-
scrollToMinute:
|
|
6324
|
-
scrollAlign:
|
|
6325
|
-
canEditEvent: (e) => !e.placeholder && !
|
|
6326
|
-
canEditBlock: (e) => !e.placeholder && !
|
|
6327
|
-
eventColor: (e) => e.color ??
|
|
6328
|
-
blockColor: (e) => e.color ??
|
|
6329
|
-
statusLabel:
|
|
6401
|
+
scrollToMinute: Ze,
|
|
6402
|
+
scrollAlign: N,
|
|
6403
|
+
canEditEvent: (e) => !e.placeholder && !R && !!ie && I === "events" && (e.editable ?? e.status !== "cancelled"),
|
|
6404
|
+
canEditBlock: (e) => !e.placeholder && !R && !!B && I === "availability" && e.editable !== !1,
|
|
6405
|
+
eventColor: (e) => e.color ?? tt(e.resourceId)?.color ?? "accent",
|
|
6406
|
+
blockColor: (e) => e.color ?? tt(e.resourceId)?.color ?? ((e.kind ?? "available") === "available" ? "green" : "gray"),
|
|
6407
|
+
statusLabel: rt,
|
|
6330
6408
|
describeEvent: (e) => {
|
|
6331
|
-
let t = e.allDay ? `${
|
|
6409
|
+
let t = e.allDay ? `${Se(e.start, W)}, ${Re.allDay}` : `${Se(e.start, W)}, ${kr(e.start, e.end, et)}`, n = rt(e);
|
|
6332
6410
|
return [
|
|
6333
6411
|
e.title,
|
|
6334
6412
|
t,
|
|
6335
6413
|
n,
|
|
6336
6414
|
e.badge,
|
|
6337
6415
|
e.description
|
|
6338
|
-
].filter(Boolean).join(", ").concat(
|
|
6416
|
+
].filter(Boolean).join(", ").concat(nt(e.resourceId));
|
|
6339
6417
|
},
|
|
6340
6418
|
describeBlock: (e) => [
|
|
6341
|
-
(e.kind ?? "available") === "available" ?
|
|
6419
|
+
(e.kind ?? "available") === "available" ? Re.available : Re.unavailable,
|
|
6342
6420
|
e.label,
|
|
6343
|
-
`${
|
|
6344
|
-
].filter(Boolean).join(", ").concat(
|
|
6345
|
-
renderEvent:
|
|
6346
|
-
hasEventClick: !!
|
|
6347
|
-
hasBlockClick: !!
|
|
6348
|
-
clickEvent: (e) =>
|
|
6349
|
-
clickBlock: (e) =>
|
|
6350
|
-
check:
|
|
6421
|
+
`${Se(e.start, W)}, ${kr(e.start, e.end, et)}`
|
|
6422
|
+
].filter(Boolean).join(", ").concat(nt(e.resourceId)),
|
|
6423
|
+
renderEvent: V,
|
|
6424
|
+
hasEventClick: !!z,
|
|
6425
|
+
hasBlockClick: !!ae,
|
|
6426
|
+
clickEvent: (e) => z?.(e),
|
|
6427
|
+
clickBlock: (e) => ae?.(e),
|
|
6428
|
+
check: it,
|
|
6351
6429
|
commit: (e, t) => {
|
|
6352
|
-
let n =
|
|
6353
|
-
if (n) return
|
|
6354
|
-
if (e.target === "selection")
|
|
6430
|
+
let n = it(e);
|
|
6431
|
+
if (n) return se?.(e, n), !1;
|
|
6432
|
+
if (e.target === "selection") re?.({
|
|
6355
6433
|
start: e.start,
|
|
6356
6434
|
end: e.end,
|
|
6357
6435
|
allDay: e.allDay,
|
|
@@ -6363,72 +6441,78 @@ function zi({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6363
6441
|
...e,
|
|
6364
6442
|
source: t
|
|
6365
6443
|
};
|
|
6366
|
-
delete n.target, e.target === "event" ?
|
|
6444
|
+
delete n.target, e.target === "event" ? ie?.(n) : B?.(n);
|
|
6367
6445
|
}
|
|
6368
6446
|
return !0;
|
|
6369
6447
|
},
|
|
6370
6448
|
openDay: (e) => {
|
|
6371
|
-
if (
|
|
6372
|
-
|
|
6449
|
+
if (ce) {
|
|
6450
|
+
ce(e);
|
|
6373
6451
|
return;
|
|
6374
6452
|
}
|
|
6375
|
-
|
|
6453
|
+
Le(e), q !== "day" && q !== "timeline" && Ie("day");
|
|
6376
6454
|
}
|
|
6377
|
-
},
|
|
6455
|
+
}, at = o.map((e) => ({
|
|
6378
6456
|
value: e,
|
|
6379
|
-
label:
|
|
6380
|
-
})),
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6457
|
+
label: Re.views[e]
|
|
6458
|
+
})), ot = ye ?? $e, st = JSON.stringify([
|
|
6459
|
+
fe,
|
|
6460
|
+
Be.map((e) => e.getTime()),
|
|
6461
|
+
Xe.min,
|
|
6462
|
+
Xe.max,
|
|
6463
|
+
Y,
|
|
6386
6464
|
n.map((e) => e.id)
|
|
6387
|
-
]),
|
|
6388
|
-
return
|
|
6389
|
-
date:
|
|
6390
|
-
events:
|
|
6391
|
-
availability:
|
|
6392
|
-
label:
|
|
6393
|
-
},
|
|
6394
|
-
days:
|
|
6395
|
-
events:
|
|
6396
|
-
availability:
|
|
6397
|
-
label:
|
|
6398
|
-
},
|
|
6399
|
-
day:
|
|
6400
|
-
events:
|
|
6401
|
-
availability:
|
|
6402
|
-
label:
|
|
6403
|
-
},
|
|
6404
|
-
days:
|
|
6405
|
-
events:
|
|
6406
|
-
availability:
|
|
6407
|
-
label:
|
|
6408
|
-
},
|
|
6409
|
-
value:
|
|
6465
|
+
]), ct;
|
|
6466
|
+
return ct = q === "month" ? /* @__PURE__ */ _(oi, {
|
|
6467
|
+
date: K,
|
|
6468
|
+
events: Ke,
|
|
6469
|
+
availability: qe,
|
|
6470
|
+
label: ot
|
|
6471
|
+
}, fe) : q === "agenda" ? /* @__PURE__ */ _(ei, {
|
|
6472
|
+
days: Be,
|
|
6473
|
+
events: Ke.filter((e) => !e.placeholder),
|
|
6474
|
+
availability: qe.filter((e) => !e.placeholder),
|
|
6475
|
+
label: ot
|
|
6476
|
+
}, fe) : q === "timeline" ? /* @__PURE__ */ _(Ai, {
|
|
6477
|
+
day: Be[0],
|
|
6478
|
+
events: Ke,
|
|
6479
|
+
availability: qe,
|
|
6480
|
+
label: ot
|
|
6481
|
+
}, st) : /* @__PURE__ */ _(Ci, {
|
|
6482
|
+
days: Be,
|
|
6483
|
+
events: Ke,
|
|
6484
|
+
availability: qe,
|
|
6485
|
+
label: ot
|
|
6486
|
+
}, st), /* @__PURE__ */ _(Qr.Provider, {
|
|
6487
|
+
value: X,
|
|
6410
6488
|
children: /* @__PURE__ */ v("div", {
|
|
6411
|
-
ref:
|
|
6412
|
-
"data-time-zone":
|
|
6489
|
+
ref: De,
|
|
6490
|
+
"data-time-zone": fe,
|
|
6491
|
+
"data-shared-axis": E && fe && [
|
|
6492
|
+
"day",
|
|
6493
|
+
"threeDay",
|
|
6494
|
+
"workWeek",
|
|
6495
|
+
"week"
|
|
6496
|
+
].includes(q) ? !0 : void 0,
|
|
6413
6497
|
role: "region",
|
|
6414
|
-
"aria-label":
|
|
6415
|
-
"aria-busy":
|
|
6416
|
-
className: G("ui-cal relative flex h-full min-h-0 flex-col overflow-hidden",
|
|
6498
|
+
"aria-label": ye ?? $e,
|
|
6499
|
+
"aria-busy": _e || void 0,
|
|
6500
|
+
className: G("ui-cal relative flex h-full min-h-0 flex-col overflow-hidden", ve),
|
|
6417
6501
|
children: [
|
|
6418
6502
|
/* @__PURE__ */ _("span", {
|
|
6419
|
-
id:
|
|
6503
|
+
id: Oe,
|
|
6420
6504
|
className: "sr-only",
|
|
6421
|
-
children:
|
|
6505
|
+
children: Re.itemHelp
|
|
6422
6506
|
}),
|
|
6423
|
-
|
|
6507
|
+
he && /* @__PURE__ */ v("div", {
|
|
6424
6508
|
className: "ui-cal-noprint border-border flex flex-wrap items-center justify-between gap-2 border-b px-3 py-2",
|
|
6425
6509
|
children: [/* @__PURE__ */ v("div", {
|
|
6426
6510
|
className: "flex min-w-0 items-center gap-2",
|
|
6427
6511
|
children: [
|
|
6428
6512
|
/* @__PURE__ */ _(fn, {
|
|
6429
6513
|
size: "sm",
|
|
6430
|
-
onClick: () =>
|
|
6431
|
-
children:
|
|
6514
|
+
onClick: () => Le(ke),
|
|
6515
|
+
children: Re.today
|
|
6432
6516
|
}),
|
|
6433
6517
|
/* @__PURE__ */ v("div", {
|
|
6434
6518
|
className: "flex items-center",
|
|
@@ -6436,45 +6520,45 @@ function zi({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6436
6520
|
variant: "icon",
|
|
6437
6521
|
size: "sm",
|
|
6438
6522
|
icon: k,
|
|
6439
|
-
"aria-label":
|
|
6440
|
-
onClick: () =>
|
|
6523
|
+
"aria-label": Re.previous,
|
|
6524
|
+
onClick: () => Le(Ee(q, K, -1, ze))
|
|
6441
6525
|
}), /* @__PURE__ */ _(fn, {
|
|
6442
6526
|
variant: "icon",
|
|
6443
6527
|
size: "sm",
|
|
6444
6528
|
icon: A,
|
|
6445
|
-
"aria-label":
|
|
6446
|
-
onClick: () =>
|
|
6529
|
+
"aria-label": Re.next,
|
|
6530
|
+
onClick: () => Le(Ee(q, K, 1, ze))
|
|
6447
6531
|
})]
|
|
6448
6532
|
}),
|
|
6449
6533
|
/* @__PURE__ */ _("h2", {
|
|
6450
6534
|
className: "text-text-primary truncate text-sm font-semibold",
|
|
6451
6535
|
"aria-live": "polite",
|
|
6452
|
-
children:
|
|
6536
|
+
children: $e
|
|
6453
6537
|
})
|
|
6454
6538
|
]
|
|
6455
6539
|
}), /* @__PURE__ */ v("div", {
|
|
6456
6540
|
className: "flex items-center gap-1.5",
|
|
6457
|
-
children: [
|
|
6458
|
-
"aria-label":
|
|
6459
|
-
options:
|
|
6460
|
-
value:
|
|
6461
|
-
onChange:
|
|
6541
|
+
children: [ge, o.length > 1 && (Ae === null || Ae >= o.length * 80 + 420 ? /* @__PURE__ */ _(Mi, {
|
|
6542
|
+
"aria-label": Re.view,
|
|
6543
|
+
options: at,
|
|
6544
|
+
value: Fe,
|
|
6545
|
+
onChange: Ie
|
|
6462
6546
|
}) : /* @__PURE__ */ _(xn, {
|
|
6463
6547
|
className: "w-28",
|
|
6464
6548
|
size: "sm",
|
|
6465
|
-
options:
|
|
6466
|
-
value:
|
|
6467
|
-
onChange: (e) =>
|
|
6549
|
+
options: at,
|
|
6550
|
+
value: Fe,
|
|
6551
|
+
onChange: (e) => Ie(e)
|
|
6468
6552
|
}))]
|
|
6469
6553
|
})]
|
|
6470
6554
|
}),
|
|
6471
|
-
|
|
6472
|
-
|
|
6555
|
+
ct,
|
|
6556
|
+
_e && /* @__PURE__ */ v("div", {
|
|
6473
6557
|
className: "ui-cal-loading",
|
|
6474
6558
|
role: "status",
|
|
6475
6559
|
children: [/* @__PURE__ */ _(L, { className: "text-accent h-6 w-6 animate-spin" }), /* @__PURE__ */ _("span", {
|
|
6476
6560
|
className: "sr-only",
|
|
6477
|
-
children:
|
|
6561
|
+
children: Re.loading
|
|
6478
6562
|
})]
|
|
6479
6563
|
})
|
|
6480
6564
|
]
|
|
@@ -6483,7 +6567,7 @@ function zi({ events: e = [], availability: t, resources: n = [], view: r, defau
|
|
|
6483
6567
|
}
|
|
6484
6568
|
//#endregion
|
|
6485
6569
|
//#region src/components/ui/CalendarGrid.tsx
|
|
6486
|
-
var
|
|
6570
|
+
var Vi = [
|
|
6487
6571
|
"Mo",
|
|
6488
6572
|
"Tu",
|
|
6489
6573
|
"We",
|
|
@@ -6491,7 +6575,7 @@ var Bi = [
|
|
|
6491
6575
|
"Fr",
|
|
6492
6576
|
"Sa",
|
|
6493
6577
|
"Su"
|
|
6494
|
-
],
|
|
6578
|
+
], Hi = [
|
|
6495
6579
|
"January",
|
|
6496
6580
|
"February",
|
|
6497
6581
|
"March",
|
|
@@ -6505,24 +6589,24 @@ var Bi = [
|
|
|
6505
6589
|
"November",
|
|
6506
6590
|
"December"
|
|
6507
6591
|
];
|
|
6508
|
-
function
|
|
6592
|
+
function Ui(e, t, n) {
|
|
6509
6593
|
let r = Z(e, n), i = Z(t, n);
|
|
6510
6594
|
return r.year === i.year && r.month === i.month && r.day === i.day;
|
|
6511
6595
|
}
|
|
6512
|
-
function
|
|
6596
|
+
function Wi(e, t, n) {
|
|
6513
6597
|
if (!t || !n) return !1;
|
|
6514
6598
|
let r = e.getTime(), i = Math.min(t.getTime(), n.getTime()), a = Math.max(t.getTime(), n.getTime());
|
|
6515
6599
|
return r > i && r < a;
|
|
6516
6600
|
}
|
|
6517
|
-
function
|
|
6601
|
+
function Gi(e, t) {
|
|
6518
6602
|
return new Date(e, t + 1, 0).getDate();
|
|
6519
6603
|
}
|
|
6520
|
-
function
|
|
6604
|
+
function Ki(e, t) {
|
|
6521
6605
|
let n = new Date(e, t, 1).getDay();
|
|
6522
6606
|
return n === 0 ? 6 : n - 1;
|
|
6523
6607
|
}
|
|
6524
|
-
function
|
|
6525
|
-
let f =
|
|
6608
|
+
function qi({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeEnd: a, hoverDate: o, onSelect: s, onMonthChange: c, onHover: l, minDate: u, maxDate: d }) {
|
|
6609
|
+
let f = Gi(e, t), p = Ki(e, t), g = /* @__PURE__ */ new Date(), y = m(null), [b, x] = h(null);
|
|
6526
6610
|
function S() {
|
|
6527
6611
|
return b !== null && b >= 1 && b <= f ? b : r && Z(r, n).year === e && Z(r, n).month - 1 === t ? Z(r, n).day : i && Z(i, n).year === e && Z(i, n).month - 1 === t ? Z(i, n).day : Z(g, n).year === e && Z(g, n).month - 1 === t ? Z(g, n).day : 1;
|
|
6528
6612
|
}
|
|
@@ -6574,7 +6658,7 @@ function Ki({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeE
|
|
|
6574
6658
|
className: "text-text-primary text-xs font-semibold",
|
|
6575
6659
|
"aria-live": "polite",
|
|
6576
6660
|
children: [
|
|
6577
|
-
|
|
6661
|
+
Hi[t],
|
|
6578
6662
|
" ",
|
|
6579
6663
|
e
|
|
6580
6664
|
]
|
|
@@ -6589,7 +6673,7 @@ function Ki({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeE
|
|
|
6589
6673
|
]
|
|
6590
6674
|
}), /* @__PURE__ */ v("div", {
|
|
6591
6675
|
className: "grid grid-cols-7 gap-0",
|
|
6592
|
-
children: [
|
|
6676
|
+
children: [Vi.map((e) => /* @__PURE__ */ _("div", {
|
|
6593
6677
|
className: "text-text-tertiary text-2xs flex h-8 items-center justify-center font-medium",
|
|
6594
6678
|
children: e
|
|
6595
6679
|
}, e)), D.map((c, f) => {
|
|
@@ -6602,13 +6686,13 @@ function Ki({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeE
|
|
|
6602
6686
|
minute: 0,
|
|
6603
6687
|
second: 0,
|
|
6604
6688
|
millisecond: 0
|
|
6605
|
-
}, n), m =
|
|
6689
|
+
}, n), m = Ui(p, g, n), h = r ? Ui(p, r, n) : !1, v = i ? Ui(p, i, n) : !1, y = a ? Ui(p, a, n) : !1, b = Wi(p, i ?? null, a ?? o ?? null), x = u && p < u || d && p > d;
|
|
6606
6690
|
return /* @__PURE__ */ _("button", {
|
|
6607
6691
|
type: "button",
|
|
6608
6692
|
"data-day": c,
|
|
6609
6693
|
disabled: !!x,
|
|
6610
6694
|
tabIndex: c === C ? 0 : -1,
|
|
6611
|
-
"aria-label": `${
|
|
6695
|
+
"aria-label": `${Hi[t]} ${c}, ${e}`,
|
|
6612
6696
|
"aria-current": m ? "date" : void 0,
|
|
6613
6697
|
onClick: () => s(p),
|
|
6614
6698
|
onKeyDown: (e) => w(e, c),
|
|
@@ -6623,7 +6707,7 @@ function Ki({ year: e, month: t, timeZone: n, selected: r, rangeStart: i, rangeE
|
|
|
6623
6707
|
}
|
|
6624
6708
|
//#endregion
|
|
6625
6709
|
//#region src/components/ui/Card.tsx
|
|
6626
|
-
function
|
|
6710
|
+
function Ji({ children: e, className: t, header: n, footer: r, as: i = "div", flush: a = !1, bodyClassName: o, ...s }) {
|
|
6627
6711
|
let c = an();
|
|
6628
6712
|
return /* @__PURE__ */ v(i, {
|
|
6629
6713
|
...s,
|
|
@@ -6648,16 +6732,16 @@ function qi({ children: e, className: t, header: n, footer: r, as: i = "div", fl
|
|
|
6648
6732
|
}
|
|
6649
6733
|
//#endregion
|
|
6650
6734
|
//#region src/lib/codeInput.ts
|
|
6651
|
-
function
|
|
6735
|
+
function Yi(e, t) {
|
|
6652
6736
|
let n = e.replace(/\D/g, "").slice(0, t);
|
|
6653
6737
|
return Array.from({ length: t }, (e, t) => n[t] ?? "");
|
|
6654
6738
|
}
|
|
6655
|
-
function
|
|
6739
|
+
function Xi(e, t, n) {
|
|
6656
6740
|
if (!t || e.length <= t.length) return e;
|
|
6657
6741
|
let r = e.length - t.length, i = n ?? e.length;
|
|
6658
6742
|
return i - r >= 0 ? e.slice(i - r, i) : e.slice(-r);
|
|
6659
6743
|
}
|
|
6660
|
-
function
|
|
6744
|
+
function Zi(e, t, n) {
|
|
6661
6745
|
let r = e.length, i = n.match(RegExp(`(?<!\\d)\\d{${r}}(?!\\d)`));
|
|
6662
6746
|
if (i) return {
|
|
6663
6747
|
slots: i[0].split(""),
|
|
@@ -6677,7 +6761,7 @@ function Xi(e, t, n) {
|
|
|
6677
6761
|
focus: Math.min(t + a.length, r - 1)
|
|
6678
6762
|
};
|
|
6679
6763
|
}
|
|
6680
|
-
function
|
|
6764
|
+
function Qi(e, t, n, r) {
|
|
6681
6765
|
if (n === "") {
|
|
6682
6766
|
let n = [...e];
|
|
6683
6767
|
return n[t] = "", {
|
|
@@ -6685,9 +6769,9 @@ function Zi(e, t, n, r) {
|
|
|
6685
6769
|
focus: t
|
|
6686
6770
|
};
|
|
6687
6771
|
}
|
|
6688
|
-
return
|
|
6772
|
+
return Zi(e, t, Xi(n, e[t], r));
|
|
6689
6773
|
}
|
|
6690
|
-
function
|
|
6774
|
+
function $i(e, t) {
|
|
6691
6775
|
let n = e[t] ? t : t - 1;
|
|
6692
6776
|
if (n < 0) return null;
|
|
6693
6777
|
let r = [...e];
|
|
@@ -6698,15 +6782,15 @@ function Qi(e, t) {
|
|
|
6698
6782
|
}
|
|
6699
6783
|
//#endregion
|
|
6700
6784
|
//#region src/components/ui/CodeInput.tsx
|
|
6701
|
-
function
|
|
6702
|
-
let f = m([]), p = u(), g = a || !!i, [y, b] = h(() =>
|
|
6785
|
+
function ea({ value: e, onChange: t, onComplete: n, length: r = 6, error: i, invalid: a, disabled: o, autoFocus: s, name: c, "aria-label": l = "Verification code", className: d }) {
|
|
6786
|
+
let f = m([]), p = u(), g = a || !!i, [y, b] = h(() => Yi(e, r)), [x, S] = h({
|
|
6703
6787
|
value: e,
|
|
6704
6788
|
length: r
|
|
6705
6789
|
});
|
|
6706
6790
|
(x.value !== e || x.length !== r) && (S({
|
|
6707
6791
|
value: e,
|
|
6708
6792
|
length: r
|
|
6709
|
-
}), (y.length !== r || y.join("") !== e) && b(
|
|
6793
|
+
}), (y.length !== r || y.join("") !== e) && b(Yi(e, r)));
|
|
6710
6794
|
function C(e) {
|
|
6711
6795
|
let t = f.current[Math.max(0, Math.min(e, r - 1))];
|
|
6712
6796
|
t?.focus(), t?.select();
|
|
@@ -6718,7 +6802,7 @@ function $i({ value: e, onChange: t, onComplete: n, length: r = 6, error: i, inv
|
|
|
6718
6802
|
t(r), e.slots.every(Boolean) && n?.(r), C(e.focus);
|
|
6719
6803
|
}
|
|
6720
6804
|
function T(e, t) {
|
|
6721
|
-
t.key === "Backspace" ? (t.preventDefault(), w(
|
|
6805
|
+
t.key === "Backspace" ? (t.preventDefault(), w($i(y, e))) : t.key === "ArrowLeft" ? (t.preventDefault(), C(e - 1)) : t.key === "ArrowRight" && (t.preventDefault(), C(e + 1));
|
|
6722
6806
|
}
|
|
6723
6807
|
return /* @__PURE__ */ v("div", {
|
|
6724
6808
|
className: G("flex flex-col gap-1.5", d),
|
|
@@ -6741,10 +6825,10 @@ function $i({ value: e, onChange: t, onComplete: n, length: r = 6, error: i, inv
|
|
|
6741
6825
|
"aria-describedby": i ? p : void 0,
|
|
6742
6826
|
value: e,
|
|
6743
6827
|
onFocus: (e) => e.target.select(),
|
|
6744
|
-
onChange: (e) => w(
|
|
6828
|
+
onChange: (e) => w(Qi(y, t, e.target.value, e.target.selectionStart)),
|
|
6745
6829
|
onKeyDown: (e) => T(t, e),
|
|
6746
6830
|
onPaste: (e) => {
|
|
6747
|
-
e.preventDefault(), w(
|
|
6831
|
+
e.preventDefault(), w(Zi(y, t, e.clipboardData.getData("text")));
|
|
6748
6832
|
},
|
|
6749
6833
|
className: G("bg-bg-secondary text-text-primary h-10 w-10 rounded-md border text-center font-mono text-sm", "transition-colors duration-[100ms]", "focus:border-accent focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-40", g ? "border-red" : "border-border")
|
|
6750
6834
|
}, t))
|
|
@@ -6766,8 +6850,8 @@ function $i({ value: e, onChange: t, onComplete: n, length: r = 6, error: i, inv
|
|
|
6766
6850
|
}
|
|
6767
6851
|
//#endregion
|
|
6768
6852
|
//#region src/components/ui/Combobox.tsx
|
|
6769
|
-
function
|
|
6770
|
-
let N = an(c), [P, F] = h(!1), [I, L] = h(""), [R, ee] = h(0), [te, ne] = h(() => e.find((e) => e.value === t)), re = m(null), z = m(null), ie = m(null), ae = u(), oe = l ?? `${ae}-search`, se = `${ae}-label`, ce = `${ae}-selected`, V = `${ae}-listbox`, le = b ?? I, ue = e.find((e) => e.value === t) ?? (C?.value === t ? C : void 0) ?? (te?.value === t ? te : void 0), H = S ? e.filter((e) => e.label.toLowerCase().includes(le.toLowerCase())) : e,
|
|
6853
|
+
function ta({ options: e, value: t, onChange: n, onOptionChange: r, placeholder: i = "Select...", label: a, className: o, controlSize: c, id: l, name: d, disabled: f, "aria-label": p, "aria-describedby": g, "aria-invalid": y, query: b, onQueryChange: x, filterOptions: S = !0, selectedOption: C, renderOption: w, loading: T = !1, loadingMessage: D = "Loading results…", error: k, onRetry: A, emptyMessage: j = "No results", footer: M }) {
|
|
6854
|
+
let N = an(c), [P, F] = h(!1), [I, L] = h(""), [R, ee] = h(0), [te, ne] = h(() => e.find((e) => e.value === t)), re = m(null), z = m(null), ie = m(null), ae = u(), oe = l ?? `${ae}-search`, se = `${ae}-label`, ce = `${ae}-selected`, V = `${ae}-listbox`, le = b ?? I, ue = e.find((e) => e.value === t) ?? (C?.value === t ? C : void 0) ?? (te?.value === t ? te : void 0), H = S ? e.filter((e) => e.label.toLowerCase().includes(le.toLowerCase())) : e, U = Math.min(R, Math.max(H.length - 1, 0)), de = H[U], W = P && !f;
|
|
6771
6855
|
function fe(e) {
|
|
6772
6856
|
b === void 0 && L(e), x?.(e), ee(0);
|
|
6773
6857
|
}
|
|
@@ -6782,10 +6866,10 @@ function ea({ options: e, value: t, onChange: n, onOptionChange: r, placeholder:
|
|
|
6782
6866
|
"End"
|
|
6783
6867
|
].includes(e.key)) {
|
|
6784
6868
|
e.preventDefault();
|
|
6785
|
-
let t = e.key === "ArrowUp" || e.key === "End" ? -1 : 1, n = e.key === "Home" ? 0 : e.key === "End" ? H.length - 1 :
|
|
6869
|
+
let t = e.key === "ArrowUp" || e.key === "End" ? -1 : 1, n = e.key === "Home" ? 0 : e.key === "End" ? H.length - 1 : U + t;
|
|
6786
6870
|
for (; n >= 0 && n < H.length && H[n].disabled;) n += t;
|
|
6787
6871
|
n >= 0 && n < H.length && ee(n);
|
|
6788
|
-
} else e.key === "Enter" ? (e.preventDefault(),
|
|
6872
|
+
} else e.key === "Enter" ? (e.preventDefault(), de && pe(de)) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), F(!1), z.current?.focus());
|
|
6789
6873
|
}
|
|
6790
6874
|
jt(W, s(() => F(!1), []), [re]);
|
|
6791
6875
|
function he() {
|
|
@@ -6861,7 +6945,7 @@ function ea({ options: e, value: t, onChange: n, onOptionChange: r, placeholder:
|
|
|
6861
6945
|
"aria-label": p ?? (a ? `Search ${a}` : "Search options"),
|
|
6862
6946
|
"aria-expanded": "true",
|
|
6863
6947
|
"aria-controls": V,
|
|
6864
|
-
"aria-activedescendant":
|
|
6948
|
+
"aria-activedescendant": de && !de.disabled ? `${V}-${U}` : void 0,
|
|
6865
6949
|
"aria-autocomplete": "list",
|
|
6866
6950
|
"aria-describedby": g,
|
|
6867
6951
|
"aria-invalid": y,
|
|
@@ -6903,7 +6987,7 @@ function ea({ options: e, value: t, onChange: n, onOptionChange: r, placeholder:
|
|
|
6903
6987
|
onMouseEnter: () => {
|
|
6904
6988
|
e.disabled || ee(n);
|
|
6905
6989
|
},
|
|
6906
|
-
className: G("font-control flex w-full items-center gap-2 px-3 py-1.5 text-xs", "transition-colors duration-[100ms]", e.disabled ? "text-text-disabled cursor-not-allowed" : "cursor-pointer", !e.disabled && (n ===
|
|
6990
|
+
className: G("font-control flex w-full items-center gap-2 px-3 py-1.5 text-xs", "transition-colors duration-[100ms]", e.disabled ? "text-text-disabled cursor-not-allowed" : "cursor-pointer", !e.disabled && (n === U ? "bg-accent-muted text-accent" : e.value === t ? "text-accent" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover")),
|
|
6907
6991
|
children: [/* @__PURE__ */ _("span", {
|
|
6908
6992
|
className: "flex-1",
|
|
6909
6993
|
children: w ? w(e) : e.label
|
|
@@ -6931,7 +7015,7 @@ function ea({ options: e, value: t, onChange: n, onOptionChange: r, placeholder:
|
|
|
6931
7015
|
}
|
|
6932
7016
|
//#endregion
|
|
6933
7017
|
//#region src/components/ui/DangerZone.tsx
|
|
6934
|
-
function
|
|
7018
|
+
function na({ title: e = "Danger Zone", description: t, children: n, className: r }) {
|
|
6935
7019
|
return /* @__PURE__ */ v("div", {
|
|
6936
7020
|
className: G("border-border mt-8 border-t pt-6", r),
|
|
6937
7021
|
children: [
|
|
@@ -6949,7 +7033,7 @@ function ta({ title: e = "Danger Zone", description: t, children: n, className:
|
|
|
6949
7033
|
}
|
|
6950
7034
|
//#endregion
|
|
6951
7035
|
//#region src/components/ui/DatePicker.tsx
|
|
6952
|
-
function
|
|
7036
|
+
function ra(e) {
|
|
6953
7037
|
return `${[
|
|
6954
7038
|
"Jan",
|
|
6955
7039
|
"Feb",
|
|
@@ -6965,7 +7049,7 @@ function na(e) {
|
|
|
6965
7049
|
"Dec"
|
|
6966
7050
|
][e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`;
|
|
6967
7051
|
}
|
|
6968
|
-
function
|
|
7052
|
+
function ia({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, placeholder: a = "Select date...", format: o }) {
|
|
6969
7053
|
let c = an(e), [l, u] = h(!1), d = m(null), f = m(null), p = bn(l, d, f), g = Z(r ?? /* @__PURE__ */ new Date(), n), [y, b] = h(g.year), [x, S] = h(g.month - 1);
|
|
6970
7054
|
jt(l, s(() => u(!1), []), [d]);
|
|
6971
7055
|
function C(e) {
|
|
@@ -6995,7 +7079,7 @@ function ra({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
6995
7079
|
day: "numeric",
|
|
6996
7080
|
month: "short",
|
|
6997
7081
|
year: "numeric"
|
|
6998
|
-
}).format(r) :
|
|
7082
|
+
}).format(r) : ra(r) : /* @__PURE__ */ _("span", {
|
|
6999
7083
|
className: "text-text-disabled",
|
|
7000
7084
|
children: a
|
|
7001
7085
|
})
|
|
@@ -7006,7 +7090,7 @@ function ra({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7006
7090
|
role: "dialog",
|
|
7007
7091
|
"aria-label": "Choose date",
|
|
7008
7092
|
className: G("bg-bg-tertiary border-border-strong animate-scale-in absolute left-0 z-[100] rounded-md border p-3 shadow-lg", p ? "bottom-full mb-1" : "top-full mt-1"),
|
|
7009
|
-
children: /* @__PURE__ */ _(
|
|
7093
|
+
children: /* @__PURE__ */ _(qi, {
|
|
7010
7094
|
timeZone: n,
|
|
7011
7095
|
year: y,
|
|
7012
7096
|
month: x,
|
|
@@ -7023,7 +7107,7 @@ function ra({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7023
7107
|
}
|
|
7024
7108
|
//#endregion
|
|
7025
7109
|
//#region src/components/ui/DateRangePicker.tsx
|
|
7026
|
-
var
|
|
7110
|
+
var aa = [
|
|
7027
7111
|
"Jan",
|
|
7028
7112
|
"Feb",
|
|
7029
7113
|
"Mar",
|
|
@@ -7037,13 +7121,13 @@ var ia = [
|
|
|
7037
7121
|
"Nov",
|
|
7038
7122
|
"Dec"
|
|
7039
7123
|
];
|
|
7040
|
-
function aa(e) {
|
|
7041
|
-
return `${ia[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`;
|
|
7042
|
-
}
|
|
7043
7124
|
function oa(e) {
|
|
7044
|
-
return
|
|
7125
|
+
return `${aa[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`;
|
|
7126
|
+
}
|
|
7127
|
+
function sa(e) {
|
|
7128
|
+
return e.start && e.end ? `${oa(e.start)} – ${oa(e.end)}` : e.start ? oa(e.start) : "";
|
|
7045
7129
|
}
|
|
7046
|
-
function
|
|
7130
|
+
function ca({ controlSize: e, label: t, value: n, onChange: r, placeholder: i = "Select date range..." }) {
|
|
7047
7131
|
let a = an(e), [o, c] = h(!1), l = m(null), u = m(null), d = bn(o, l, u), f = /* @__PURE__ */ new Date(), [p, g] = h(n.start?.getFullYear() ?? f.getFullYear()), [y, b] = h(n.start?.getMonth() ?? f.getMonth()), [x, S] = h(null), [C, w] = h("start"), [E, D] = h(n.start), [O, k] = h(n.end);
|
|
7048
7132
|
jt(o, s(() => c(!1), []), [l]);
|
|
7049
7133
|
let A = y === 11 ? p + 1 : p, j = y === 11 ? 0 : y + 1;
|
|
@@ -7062,7 +7146,7 @@ function sa({ controlSize: e, label: t, value: n, onChange: r, placeholder: i =
|
|
|
7062
7146
|
function F() {
|
|
7063
7147
|
y === 11 ? (g(p + 1), b(0)) : b(y + 1);
|
|
7064
7148
|
}
|
|
7065
|
-
let I = n.start || n.end ?
|
|
7149
|
+
let I = n.start || n.end ? sa(n) : "";
|
|
7066
7150
|
return /* @__PURE__ */ v("div", {
|
|
7067
7151
|
className: "flex flex-col gap-1.5",
|
|
7068
7152
|
ref: l,
|
|
@@ -7121,7 +7205,7 @@ function sa({ controlSize: e, label: t, value: n, onChange: r, placeholder: i =
|
|
|
7121
7205
|
]
|
|
7122
7206
|
}), /* @__PURE__ */ v("div", {
|
|
7123
7207
|
className: "flex gap-4",
|
|
7124
|
-
children: [/* @__PURE__ */ _(
|
|
7208
|
+
children: [/* @__PURE__ */ _(qi, {
|
|
7125
7209
|
year: p,
|
|
7126
7210
|
month: y,
|
|
7127
7211
|
rangeStart: E,
|
|
@@ -7132,7 +7216,7 @@ function sa({ controlSize: e, label: t, value: n, onChange: r, placeholder: i =
|
|
|
7132
7216
|
g(e), b(t);
|
|
7133
7217
|
},
|
|
7134
7218
|
onHover: S
|
|
7135
|
-
}), /* @__PURE__ */ _(
|
|
7219
|
+
}), /* @__PURE__ */ _(qi, {
|
|
7136
7220
|
year: A,
|
|
7137
7221
|
month: j,
|
|
7138
7222
|
rangeStart: E,
|
|
@@ -7152,7 +7236,7 @@ function sa({ controlSize: e, label: t, value: n, onChange: r, placeholder: i =
|
|
|
7152
7236
|
}
|
|
7153
7237
|
//#endregion
|
|
7154
7238
|
//#region src/components/ui/DateTimePicker.tsx
|
|
7155
|
-
var
|
|
7239
|
+
var la = [
|
|
7156
7240
|
"Jan",
|
|
7157
7241
|
"Feb",
|
|
7158
7242
|
"Mar",
|
|
@@ -7166,7 +7250,7 @@ var ca = [
|
|
|
7166
7250
|
"Nov",
|
|
7167
7251
|
"Dec"
|
|
7168
7252
|
];
|
|
7169
|
-
function
|
|
7253
|
+
function ua(e) {
|
|
7170
7254
|
return e === 0 ? {
|
|
7171
7255
|
hour12: 12,
|
|
7172
7256
|
period: "AM"
|
|
@@ -7181,10 +7265,10 @@ function la(e) {
|
|
|
7181
7265
|
period: "PM"
|
|
7182
7266
|
};
|
|
7183
7267
|
}
|
|
7184
|
-
function
|
|
7268
|
+
function da(e, t) {
|
|
7185
7269
|
return t === "AM" ? e === 12 ? 0 : e : e === 12 ? 12 : e + 12;
|
|
7186
7270
|
}
|
|
7187
|
-
function
|
|
7271
|
+
function fa(e, t) {
|
|
7188
7272
|
if (t) return new Intl.DateTimeFormat("en-GB", {
|
|
7189
7273
|
timeZone: t,
|
|
7190
7274
|
day: "numeric",
|
|
@@ -7195,20 +7279,20 @@ function da(e, t) {
|
|
|
7195
7279
|
timeZoneName: "short",
|
|
7196
7280
|
hourCycle: "h23"
|
|
7197
7281
|
}).format(e);
|
|
7198
|
-
let n =
|
|
7282
|
+
let n = la[e.getMonth()], r = e.getDate(), i = e.getFullYear(), { hour12: a, period: o } = ua(e.getHours());
|
|
7199
7283
|
return `${n} ${r}, ${i} ${a}:${String(e.getMinutes()).padStart(2, "0")} ${o}`;
|
|
7200
7284
|
}
|
|
7201
|
-
function
|
|
7285
|
+
function pa(e) {
|
|
7202
7286
|
return String(e).padStart(2, "0");
|
|
7203
7287
|
}
|
|
7204
|
-
function
|
|
7205
|
-
return /* @__PURE__ */ _(
|
|
7288
|
+
function ma(e) {
|
|
7289
|
+
return /* @__PURE__ */ _(ha, { ...e }, e.timeZone ?? "browser-local");
|
|
7206
7290
|
}
|
|
7207
|
-
function
|
|
7208
|
-
let o = an(e), [c, l] = h(!1), [d, f] = h(null), [p, g] = h(!1), [y, b] = h("reject"), x = u(), S = m(null), C = m(null), w = bn(c, S, C), E = Z(r ?? /* @__PURE__ */ new Date(), n), D = r ?
|
|
7291
|
+
function ha({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, placeholder: a = "Select date & time..." }) {
|
|
7292
|
+
let o = an(e), [c, l] = h(!1), [d, f] = h(null), [p, g] = h(!1), [y, b] = h("reject"), x = u(), S = m(null), C = m(null), w = bn(c, S, C), E = Z(r ?? /* @__PURE__ */ new Date(), n), D = r ? ua(Z(r, n).hour) : {
|
|
7209
7293
|
hour12: 12,
|
|
7210
7294
|
period: "PM"
|
|
7211
|
-
}, [O, k] = h(E.year), [A, j] = h(E.month - 1), [M, N] = h(String(D.hour12)), [P, F] = h(r ?
|
|
7295
|
+
}, [O, k] = h(E.year), [A, j] = h(E.month - 1), [M, N] = h(String(D.hour12)), [P, F] = h(r ? pa(Z(r, n).minute) : "00"), [I, L] = h(D.period), [R, ee] = h(r);
|
|
7212
7296
|
jt(c, s(() => l(!1), []), [S]);
|
|
7213
7297
|
function te(e) {
|
|
7214
7298
|
ee(e);
|
|
@@ -7221,7 +7305,7 @@ function ma({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7221
7305
|
}
|
|
7222
7306
|
function re() {
|
|
7223
7307
|
if (!R) return;
|
|
7224
|
-
let e = Math.max(1, Math.min(12, parseInt(M, 10) || 12)), t = Math.max(0, Math.min(59, parseInt(P, 10) || 0)), a =
|
|
7308
|
+
let e = Math.max(1, Math.min(12, parseInt(M, 10) || 12)), t = Math.max(0, Math.min(59, parseInt(P, 10) || 0)), a = da(e, I), o = {
|
|
7225
7309
|
...Z(R, n),
|
|
7226
7310
|
hour: a,
|
|
7227
7311
|
minute: t,
|
|
@@ -7248,8 +7332,8 @@ function ma({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7248
7332
|
function z() {
|
|
7249
7333
|
if (!c && r) {
|
|
7250
7334
|
k(Z(r, n).year), j(Z(r, n).month - 1), ee(r);
|
|
7251
|
-
let e =
|
|
7252
|
-
N(String(e.hour12)), L(e.period), F(
|
|
7335
|
+
let e = ua(Z(r, n).hour);
|
|
7336
|
+
N(String(e.hour12)), L(e.period), F(pa(Z(r, n).minute));
|
|
7253
7337
|
}
|
|
7254
7338
|
f(null);
|
|
7255
7339
|
let e = !1;
|
|
@@ -7276,7 +7360,7 @@ function ma({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7276
7360
|
"aria-haspopup": "dialog",
|
|
7277
7361
|
"aria-expanded": c,
|
|
7278
7362
|
className: G("ui-sized-control 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"),
|
|
7279
|
-
children: r ?
|
|
7363
|
+
children: r ? fa(r, n) : /* @__PURE__ */ _("span", {
|
|
7280
7364
|
className: "text-text-disabled",
|
|
7281
7365
|
children: a
|
|
7282
7366
|
})
|
|
@@ -7288,7 +7372,7 @@ function ma({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7288
7372
|
"aria-label": "Choose date and time",
|
|
7289
7373
|
className: G("bg-bg-tertiary border-border-strong animate-scale-in absolute left-0 z-[100] rounded-md border p-3 shadow-lg", w ? "bottom-full mb-1" : "top-full mt-1"),
|
|
7290
7374
|
children: [
|
|
7291
|
-
/* @__PURE__ */ _(
|
|
7375
|
+
/* @__PURE__ */ _(qi, {
|
|
7292
7376
|
timeZone: n,
|
|
7293
7377
|
year: O,
|
|
7294
7378
|
month: A,
|
|
@@ -7401,8 +7485,8 @@ function ma({ controlSize: e, label: t, timeZone: n, value: r, onChange: i, plac
|
|
|
7401
7485
|
}
|
|
7402
7486
|
//#endregion
|
|
7403
7487
|
//#region src/components/ui/DetailPanel.tsx
|
|
7404
|
-
var
|
|
7405
|
-
function
|
|
7488
|
+
var ga = 360, _a = 260, va = 700;
|
|
7489
|
+
function ya({ open: e, onClose: t, title: n, children: r, className: i, resizable: a = !0, defaultWidth: o = ga, minWidth: c = _a, maxWidth: u = va }) {
|
|
7406
7490
|
let [d, f] = h(o), p = m(!1), g = m(0), y = m(0);
|
|
7407
7491
|
l(() => {
|
|
7408
7492
|
if (!e) return;
|
|
@@ -7453,37 +7537,37 @@ function va({ open: e, onClose: t, title: n, children: r, className: i, resizabl
|
|
|
7453
7537
|
})
|
|
7454
7538
|
});
|
|
7455
7539
|
}
|
|
7456
|
-
function
|
|
7540
|
+
function ba(e, t) {
|
|
7457
7541
|
let n = /^\s*(\d*\.?\d+)(px|rem)\s*$/.exec(e);
|
|
7458
7542
|
if (!n) return 8;
|
|
7459
7543
|
let r = Number(n[1]), i = n[2] === "rem" ? r * t : r;
|
|
7460
7544
|
return Number.isFinite(i) && i >= 0 ? i * 2 : 8;
|
|
7461
7545
|
}
|
|
7462
|
-
function
|
|
7546
|
+
function xa(e, t, [n, r], [i, a], [o, s], c) {
|
|
7463
7547
|
let [l, u] = r - n <= s - o - c * 2 ? [n, r] : [i, a], d = t + (o + c - l), f = t + (s - c - u);
|
|
7464
7548
|
return f < d && (f = d), d = Math.min(d, 0), f = Math.max(f, 0), Math.min(f, Math.max(d, e));
|
|
7465
7549
|
}
|
|
7466
|
-
function
|
|
7550
|
+
function Sa(e, t, n, r, i, a) {
|
|
7467
7551
|
return {
|
|
7468
|
-
x:
|
|
7469
|
-
y:
|
|
7552
|
+
x: xa(e.x, t.x, [n.left, n.right], [r.left, r.right], [i.left, i.right], a),
|
|
7553
|
+
y: xa(e.y, t.y, [n.top, n.bottom], [r.top, r.bottom], [i.top, i.bottom], a)
|
|
7470
7554
|
};
|
|
7471
7555
|
}
|
|
7472
|
-
function
|
|
7556
|
+
function Ca({ x: e, y: t }) {
|
|
7473
7557
|
return e === 0 && t === 0 ? "" : `${e}px ${t}px`;
|
|
7474
7558
|
}
|
|
7475
7559
|
//#endregion
|
|
7476
7560
|
//#region src/components/ui/Dialog.tsx
|
|
7477
|
-
var
|
|
7561
|
+
var wa = {
|
|
7478
7562
|
sm: "max-w-[400px]",
|
|
7479
7563
|
md: "max-w-[576px]",
|
|
7480
7564
|
lg: "max-w-[768px]",
|
|
7481
7565
|
xl: "max-w-[1024px]"
|
|
7482
|
-
},
|
|
7566
|
+
}, Ta = "(min-width: 48rem)", Ea = "a[href], button, input, select, textarea, label, summary, [contenteditable]:not([contenteditable=\"false\"]), [role=\"button\"], [role=\"link\"], [tabindex]:not([tabindex=\"-1\"])", Da = {
|
|
7483
7567
|
x: 0,
|
|
7484
7568
|
y: 0
|
|
7485
7569
|
};
|
|
7486
|
-
function
|
|
7570
|
+
function Oa(e) {
|
|
7487
7571
|
let t = e.getBoundingClientRect();
|
|
7488
7572
|
return {
|
|
7489
7573
|
left: t.left,
|
|
@@ -7492,19 +7576,19 @@ function Da(e) {
|
|
|
7492
7576
|
bottom: t.top + e.clientHeight
|
|
7493
7577
|
};
|
|
7494
7578
|
}
|
|
7495
|
-
var
|
|
7579
|
+
var ka = {
|
|
7496
7580
|
top: "bottom",
|
|
7497
7581
|
bottom: "top",
|
|
7498
7582
|
left: "right",
|
|
7499
7583
|
right: "left"
|
|
7500
7584
|
};
|
|
7501
|
-
function
|
|
7585
|
+
function Aa(e, t) {
|
|
7502
7586
|
return {
|
|
7503
7587
|
x: e.x + t.x,
|
|
7504
7588
|
y: e.y + t.y
|
|
7505
7589
|
};
|
|
7506
7590
|
}
|
|
7507
|
-
function
|
|
7591
|
+
function ja(e, t) {
|
|
7508
7592
|
let n = t.getBoundingClientRect();
|
|
7509
7593
|
return {
|
|
7510
7594
|
left: n.left + e.offsetLeft - t.scrollLeft,
|
|
@@ -7513,65 +7597,65 @@ function Aa(e, t) {
|
|
|
7513
7597
|
height: e.offsetHeight
|
|
7514
7598
|
};
|
|
7515
7599
|
}
|
|
7516
|
-
function
|
|
7600
|
+
function Ma(e, t) {
|
|
7517
7601
|
if (!(e instanceof HTMLElement) || !e.isConnected) return null;
|
|
7518
7602
|
let n = e.ownerDocument;
|
|
7519
7603
|
return e === n.body || e === n.documentElement || t.contains(e) ? null : e.getClientRects().length > 0 ? e : null;
|
|
7520
7604
|
}
|
|
7521
|
-
function Ma(e) {
|
|
7522
|
-
return e.ownerDocument.defaultView?.matchMedia(wa).matches ?? !1;
|
|
7523
|
-
}
|
|
7524
7605
|
function Na(e) {
|
|
7606
|
+
return e.ownerDocument.defaultView?.matchMedia(Ta).matches ?? !1;
|
|
7607
|
+
}
|
|
7608
|
+
function Pa(e) {
|
|
7525
7609
|
let t = e.ownerDocument.defaultView;
|
|
7526
|
-
return t ?
|
|
7610
|
+
return t ? ba(t.getComputedStyle(e).getPropertyValue("--spacing"), parseFloat(t.getComputedStyle(e.ownerDocument.documentElement).fontSize)) : 8;
|
|
7527
7611
|
}
|
|
7528
|
-
function
|
|
7529
|
-
let s = m(
|
|
7612
|
+
function Fa({ open: e, draggable: t, remember: n, placement: r, anchorRef: i }, a, o) {
|
|
7613
|
+
let s = m(Da), c = m(Da), l = m(8), u = m(null), d = m(null), p = m(!1), h = e && t;
|
|
7530
7614
|
f(() => {
|
|
7531
7615
|
let f = a.current, m = h ? o.current : null, g = f?.parentElement, _ = f?.ownerDocument.defaultView, v = r !== "center";
|
|
7532
7616
|
(!n || !t) && (d.current = null);
|
|
7533
7617
|
let y = n && m !== null;
|
|
7534
7618
|
if (!e || !f || !g || !_ || !m && !v) return;
|
|
7535
|
-
let b = v ?
|
|
7536
|
-
f.style.translate =
|
|
7619
|
+
let b = v ? Ma(f.ownerDocument.activeElement, f) : null, x = () => v ? Ma(i?.current, f) ?? Ma(b, f) : null, S = () => Aa(c.current, m ? s.current : Da), C = () => {
|
|
7620
|
+
f.style.translate = Ca(S());
|
|
7537
7621
|
}, w = () => {
|
|
7538
|
-
let e =
|
|
7622
|
+
let e = ja(f, g);
|
|
7539
7623
|
if (p.current && d.current) {
|
|
7540
7624
|
c.current = {
|
|
7541
7625
|
x: d.current.left - e.left,
|
|
7542
7626
|
y: d.current.top - e.top
|
|
7543
|
-
}, s.current =
|
|
7627
|
+
}, s.current = Da, f.dataset.placement = "remembered", f.style.transformOrigin = "";
|
|
7544
7628
|
return;
|
|
7545
7629
|
}
|
|
7546
|
-
let t =
|
|
7630
|
+
let t = Na(f) ? x() : null, n = v && t ? yn(r, t.getBoundingClientRect(), {
|
|
7547
7631
|
size: {
|
|
7548
7632
|
width: e.width,
|
|
7549
7633
|
height: e.height
|
|
7550
7634
|
},
|
|
7551
|
-
bounds:
|
|
7635
|
+
bounds: Oa(g),
|
|
7552
7636
|
margin: l.current,
|
|
7553
7637
|
gap: l.current
|
|
7554
7638
|
}) : null;
|
|
7555
7639
|
c.current = n ? {
|
|
7556
7640
|
x: n.left - e.left,
|
|
7557
7641
|
y: n.top - e.top
|
|
7558
|
-
} :
|
|
7642
|
+
} : Da, f.dataset.placement = n?.side ?? "center", f.style.transformOrigin = n ? ka[n.side] : "";
|
|
7559
7643
|
}, T = () => {
|
|
7560
7644
|
let e = s.current;
|
|
7561
7645
|
if (!m || !p.current && e.x === 0 && e.y === 0) return;
|
|
7562
|
-
let t = S(), n =
|
|
7646
|
+
let t = S(), n = Sa(t, t, f.getBoundingClientRect(), m.getBoundingClientRect(), Oa(g), l.current);
|
|
7563
7647
|
if (s.current = {
|
|
7564
7648
|
x: n.x - c.current.x,
|
|
7565
7649
|
y: n.y - c.current.y
|
|
7566
7650
|
}, C(), p.current) {
|
|
7567
|
-
let e =
|
|
7651
|
+
let e = ja(f, g);
|
|
7568
7652
|
d.current = {
|
|
7569
7653
|
left: e.left + n.x,
|
|
7570
7654
|
top: e.top + n.y
|
|
7571
7655
|
};
|
|
7572
7656
|
}
|
|
7573
7657
|
}, E = () => {
|
|
7574
|
-
l.current =
|
|
7658
|
+
l.current = Pa(f), Na(f) || (u.current = null, s.current = Da, p.current = !1, d.current = null), u.current || w(), C(), T();
|
|
7575
7659
|
}, D = 0, O = () => {
|
|
7576
7660
|
D ||= _.requestAnimationFrame(() => {
|
|
7577
7661
|
D = 0, E();
|
|
@@ -7583,7 +7667,7 @@ function Pa({ open: e, draggable: t, remember: n, placement: r, anchorRef: i },
|
|
|
7583
7667
|
capture: !0,
|
|
7584
7668
|
passive: !0
|
|
7585
7669
|
}), f.addEventListener("animationend", k), A?.observe(f), () => {
|
|
7586
|
-
_.cancelAnimationFrame(D), _.removeEventListener("resize", O), _.removeEventListener("scroll", O, { capture: !0 }), f.removeEventListener("animationend", k), A?.disconnect(), u.current = null, c.current =
|
|
7670
|
+
_.cancelAnimationFrame(D), _.removeEventListener("resize", O), _.removeEventListener("scroll", O, { capture: !0 }), f.removeEventListener("animationend", k), A?.disconnect(), u.current = null, c.current = Da, s.current = Da, p.current = !1, f.style.translate = "", f.style.transformOrigin = "", delete f.dataset.placement;
|
|
7587
7671
|
};
|
|
7588
7672
|
}, [
|
|
7589
7673
|
e,
|
|
@@ -7598,40 +7682,40 @@ function Pa({ open: e, draggable: t, remember: n, placement: r, anchorRef: i },
|
|
|
7598
7682
|
let g = (e) => {
|
|
7599
7683
|
let t = a.current, n = e.currentTarget, r = t?.parentElement;
|
|
7600
7684
|
if (!t || !r || e.button !== 0 || !e.isPrimary) return;
|
|
7601
|
-
let i = e.target.closest(
|
|
7602
|
-
i && n.contains(i) || !
|
|
7685
|
+
let i = e.target.closest(Ea);
|
|
7686
|
+
i && n.contains(i) || !Na(t) || (e.preventDefault(), n.setPointerCapture(e.pointerId), u.current = {
|
|
7603
7687
|
pointerId: e.pointerId,
|
|
7604
7688
|
startX: e.clientX,
|
|
7605
7689
|
startY: e.clientY,
|
|
7606
|
-
origin:
|
|
7690
|
+
origin: Aa(c.current, s.current),
|
|
7607
7691
|
dialog: t.getBoundingClientRect(),
|
|
7608
7692
|
handle: n.getBoundingClientRect(),
|
|
7609
|
-
bounds:
|
|
7693
|
+
bounds: Oa(r),
|
|
7610
7694
|
margin: l.current,
|
|
7611
7695
|
moved: !1
|
|
7612
7696
|
});
|
|
7613
7697
|
}, _ = (e) => {
|
|
7614
7698
|
let t = u.current, n = a.current;
|
|
7615
7699
|
if (!t || t.pointerId !== e.pointerId || !n) return;
|
|
7616
|
-
let r =
|
|
7700
|
+
let r = Sa({
|
|
7617
7701
|
x: t.origin.x + e.clientX - t.startX,
|
|
7618
7702
|
y: t.origin.y + e.clientY - t.startY
|
|
7619
7703
|
}, t.origin, t.dialog, t.handle, t.bounds, t.margin);
|
|
7620
7704
|
t.moved ||= r.x !== t.origin.x || r.y !== t.origin.y, s.current = {
|
|
7621
7705
|
x: r.x - c.current.x,
|
|
7622
7706
|
y: r.y - c.current.y
|
|
7623
|
-
}, n.style.translate =
|
|
7707
|
+
}, n.style.translate = Ca(r);
|
|
7624
7708
|
}, v = (e) => {
|
|
7625
7709
|
let t = u.current;
|
|
7626
7710
|
if (t?.pointerId !== e.pointerId) return;
|
|
7627
7711
|
u.current = null;
|
|
7628
7712
|
let r = a.current, i = r?.parentElement;
|
|
7629
7713
|
if (!n || !t.moved || !r || !i) return;
|
|
7630
|
-
let o =
|
|
7714
|
+
let o = Aa(c.current, s.current), l = ja(r, i);
|
|
7631
7715
|
d.current = {
|
|
7632
7716
|
left: l.left + o.x,
|
|
7633
7717
|
top: l.top + o.y
|
|
7634
|
-
}, c.current = o, s.current =
|
|
7718
|
+
}, c.current = o, s.current = Da, p.current = !0, r.dataset.placement = "remembered", r.style.transformOrigin = "";
|
|
7635
7719
|
};
|
|
7636
7720
|
if (h) return {
|
|
7637
7721
|
onPointerDown: g,
|
|
@@ -7641,13 +7725,13 @@ function Pa({ open: e, draggable: t, remember: n, placement: r, anchorRef: i },
|
|
|
7641
7725
|
onLostPointerCapture: v
|
|
7642
7726
|
};
|
|
7643
7727
|
}
|
|
7644
|
-
function
|
|
7728
|
+
function Ia({ open: e, onClose: t, title: n, children: r, footer: i, className: a, size: o = "sm", draggable: s = !1, rememberPosition: c = !1, placement: d = "center", anchorRef: f, role: p = "dialog", description: h, "aria-label": g, "aria-describedby": y, initialFocusRef: b, returnFocusRef: x, busy: S = !1, closeOnEscape: C = !0, closeOnOverlayClick: w = !0, hideCloseButton: T = !1 }) {
|
|
7645
7729
|
let E = an(), D = m(null), O = m(null), k = u(), A = u();
|
|
7646
7730
|
ft(D, e, {
|
|
7647
7731
|
initialFocusRef: b,
|
|
7648
7732
|
returnFocusRef: x
|
|
7649
7733
|
});
|
|
7650
|
-
let j =
|
|
7734
|
+
let j = Fa({
|
|
7651
7735
|
open: e,
|
|
7652
7736
|
draggable: s,
|
|
7653
7737
|
remember: c,
|
|
@@ -7679,7 +7763,7 @@ function Fa({ open: e, onClose: t, title: n, children: r, footer: i, className:
|
|
|
7679
7763
|
"aria-hidden": "true"
|
|
7680
7764
|
}), /* @__PURE__ */ v("div", {
|
|
7681
7765
|
ref: D,
|
|
7682
|
-
className: G(`relative z-50 mx-1 mb-8 flex w-full ${
|
|
7766
|
+
className: G(`relative z-50 mx-1 mb-8 flex w-full ${wa[o]} flex-col`, "bg-bg-secondary border-border rounded-lg border", "animate-scale-in shadow-lg", a),
|
|
7683
7767
|
role: p,
|
|
7684
7768
|
tabIndex: -1,
|
|
7685
7769
|
"aria-busy": S || void 0,
|
|
@@ -7729,7 +7813,7 @@ function Fa({ open: e, onClose: t, title: n, children: r, footer: i, className:
|
|
|
7729
7813
|
}
|
|
7730
7814
|
//#endregion
|
|
7731
7815
|
//#region src/components/ui/DialogActions.tsx
|
|
7732
|
-
function
|
|
7816
|
+
function La({ onCancel: e, onConfirm: t, cancelLabel: n = "Cancel", confirmLabel: r = "Confirm", confirmVariant: i = "primary", className: a, busy: o = !1, busyLabel: s = "Working…", cancelRef: c, confirmRef: l, confirmDisabled: u = !1 }) {
|
|
7733
7817
|
return /* @__PURE__ */ v("div", {
|
|
7734
7818
|
className: G("flex justify-end gap-2", a),
|
|
7735
7819
|
"aria-busy": o || void 0,
|
|
@@ -7758,7 +7842,7 @@ function Ia({ onCancel: e, onConfirm: t, cancelLabel: n = "Cancel", confirmLabel
|
|
|
7758
7842
|
}
|
|
7759
7843
|
//#endregion
|
|
7760
7844
|
//#region src/components/ui/DividerLabel.tsx
|
|
7761
|
-
function
|
|
7845
|
+
function Ra({ children: e, className: t }) {
|
|
7762
7846
|
return /* @__PURE__ */ v("div", {
|
|
7763
7847
|
className: G("my-6 flex items-center gap-3", t),
|
|
7764
7848
|
children: [
|
|
@@ -7773,7 +7857,7 @@ function La({ children: e, className: t }) {
|
|
|
7773
7857
|
}
|
|
7774
7858
|
//#endregion
|
|
7775
7859
|
//#region src/components/ui/DropdownMenu.tsx
|
|
7776
|
-
function
|
|
7860
|
+
function za({ trigger: e, items: t, align: n = "right" }) {
|
|
7777
7861
|
let [r, i] = h(!1), [a, o] = h({
|
|
7778
7862
|
top: 0,
|
|
7779
7863
|
left: 0,
|
|
@@ -7854,7 +7938,7 @@ function Ra({ trigger: e, items: t, align: n = "right" }) {
|
|
|
7854
7938
|
}
|
|
7855
7939
|
//#endregion
|
|
7856
7940
|
//#region src/components/ui/EmptyState.tsx
|
|
7857
|
-
function
|
|
7941
|
+
function Ba({ icon: e, title: t, description: n, action: r, className: i }) {
|
|
7858
7942
|
return /* @__PURE__ */ v("div", {
|
|
7859
7943
|
className: G("flex flex-col items-center justify-center px-4 py-12", i),
|
|
7860
7944
|
children: [
|
|
@@ -7879,7 +7963,7 @@ function za({ icon: e, title: t, description: n, action: r, className: i }) {
|
|
|
7879
7963
|
}
|
|
7880
7964
|
//#endregion
|
|
7881
7965
|
//#region src/components/ui/ErrorBoundary.tsx
|
|
7882
|
-
var
|
|
7966
|
+
var Va = class extends e {
|
|
7883
7967
|
state = {
|
|
7884
7968
|
hasError: !1,
|
|
7885
7969
|
error: null
|
|
@@ -7921,8 +8005,8 @@ var Ba = class extends e {
|
|
|
7921
8005
|
};
|
|
7922
8006
|
//#endregion
|
|
7923
8007
|
//#region src/components/ui/FilterDropdown.tsx
|
|
7924
|
-
function
|
|
7925
|
-
return /* @__PURE__ */ _(
|
|
8008
|
+
function Ha({ icon: e, children: t, items: n, align: r, className: i }) {
|
|
8009
|
+
return /* @__PURE__ */ _(za, {
|
|
7926
8010
|
align: r,
|
|
7927
8011
|
trigger: /* @__PURE__ */ _(Bn, {
|
|
7928
8012
|
icon: e,
|
|
@@ -7934,7 +8018,7 @@ function Va({ icon: e, children: t, items: n, align: r, className: i }) {
|
|
|
7934
8018
|
}
|
|
7935
8019
|
//#endregion
|
|
7936
8020
|
//#region src/components/ui/Kbd.tsx
|
|
7937
|
-
function
|
|
8021
|
+
function Ua({ children: e, className: t }) {
|
|
7938
8022
|
return /* @__PURE__ */ _("kbd", {
|
|
7939
8023
|
className: G("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),
|
|
7940
8024
|
children: e
|
|
@@ -7942,22 +8026,63 @@ function Ha({ children: e, className: t }) {
|
|
|
7942
8026
|
}
|
|
7943
8027
|
//#endregion
|
|
7944
8028
|
//#region src/components/ui/LoadingSpinner.tsx
|
|
7945
|
-
var
|
|
8029
|
+
var Wa = {
|
|
7946
8030
|
sm: "w-4 h-4",
|
|
7947
8031
|
md: "w-6 h-6",
|
|
7948
8032
|
lg: "w-8 h-8"
|
|
7949
8033
|
};
|
|
7950
|
-
function
|
|
8034
|
+
function Ga({ className: e, size: t = "md" }) {
|
|
7951
8035
|
return /* @__PURE__ */ _("div", {
|
|
7952
8036
|
className: G("flex min-h-[200px] items-center justify-center", e),
|
|
7953
|
-
children: /* @__PURE__ */ _(L, { className: G("text-accent animate-spin",
|
|
8037
|
+
children: /* @__PURE__ */ _(L, { className: G("text-accent animate-spin", Wa[t]) })
|
|
7954
8038
|
});
|
|
7955
8039
|
}
|
|
7956
8040
|
//#endregion
|
|
8041
|
+
//#region src/lib/layout.ts
|
|
8042
|
+
function Ka(e, t, n, r) {
|
|
8043
|
+
let i = typeof t == "object" ? t : { base: t }, a = { [`--ui-${e}-base`]: n(i.base ?? r) };
|
|
8044
|
+
for (let t of [
|
|
8045
|
+
"sm",
|
|
8046
|
+
"md",
|
|
8047
|
+
"lg",
|
|
8048
|
+
"xl"
|
|
8049
|
+
]) a[`--ui-${e}-${t}`] = i[t] === void 0 ? "initial" : n(i[t]);
|
|
8050
|
+
return a;
|
|
8051
|
+
}
|
|
8052
|
+
function qa(e) {
|
|
8053
|
+
return typeof e == "number" ? `repeat(${e}, minmax(0, 1fr))` : e;
|
|
8054
|
+
}
|
|
8055
|
+
function Ja(e = 0, t, n) {
|
|
8056
|
+
return {
|
|
8057
|
+
"--ui-gap": `calc(var(--spacing) * ${e})`,
|
|
8058
|
+
"--ui-gap-x": t === void 0 ? "initial" : `calc(var(--spacing) * ${t})`,
|
|
8059
|
+
"--ui-gap-y": n === void 0 ? "initial" : `calc(var(--spacing) * ${n})`
|
|
8060
|
+
};
|
|
8061
|
+
}
|
|
8062
|
+
function Ya(e) {
|
|
8063
|
+
return e === "start" || e === "end" ? `flex-${e}` : e;
|
|
8064
|
+
}
|
|
8065
|
+
function Xa(e) {
|
|
8066
|
+
return e === "between" || e === "around" || e === "evenly" ? `space-${e}` : Ya(e);
|
|
8067
|
+
}
|
|
8068
|
+
//#endregion
|
|
7957
8069
|
//#region src/components/ui/MetadataGrid.tsx
|
|
7958
|
-
function
|
|
7959
|
-
return /* @__PURE__ */ _("
|
|
7960
|
-
className: G("
|
|
8070
|
+
function Za({ items: e, labelWidth: n = "100px", layout: r = "inline", columns: i = 1, gap: a = 3, className: o }) {
|
|
8071
|
+
return r === "stacked" ? /* @__PURE__ */ _("dl", {
|
|
8072
|
+
className: G("ui-grid text-xs", o),
|
|
8073
|
+
style: {
|
|
8074
|
+
...Ka("columns", i, qa, 1),
|
|
8075
|
+
...Ja(a)
|
|
8076
|
+
},
|
|
8077
|
+
children: e.map((e) => /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("dt", {
|
|
8078
|
+
className: "text-text-tertiary font-label",
|
|
8079
|
+
children: e.label
|
|
8080
|
+
}), /* @__PURE__ */ _("dd", {
|
|
8081
|
+
className: G((typeof e.value == "string" || typeof e.value == "number") && "text-text-primary font-data"),
|
|
8082
|
+
children: e.value
|
|
8083
|
+
})] }, e.label))
|
|
8084
|
+
}) : /* @__PURE__ */ _("div", {
|
|
8085
|
+
className: G("gap-x-3 gap-y-2 text-xs", o),
|
|
7961
8086
|
style: {
|
|
7962
8087
|
display: "grid",
|
|
7963
8088
|
gridTemplateColumns: `${n} 1fr`
|
|
@@ -7973,7 +8098,7 @@ function Ga({ items: e, labelWidth: n = "100px", className: r }) {
|
|
|
7973
8098
|
}
|
|
7974
8099
|
//#endregion
|
|
7975
8100
|
//#region src/components/ui/MetricCard.tsx
|
|
7976
|
-
function
|
|
8101
|
+
function Qa({ label: e, value: t, sub: n, trend: r, bar: i, icon: a, iconColor: o, className: s }) {
|
|
7977
8102
|
let c = r?.tone === "positive" ? "text-green" : r?.tone === "negative" ? "text-red" : "text-text-tertiary";
|
|
7978
8103
|
return /* @__PURE__ */ v("div", {
|
|
7979
8104
|
className: G("bg-bg-secondary border-border relative overflow-hidden rounded-md border p-3", s),
|
|
@@ -8013,7 +8138,7 @@ function Ka({ label: e, value: t, sub: n, trend: r, bar: i, icon: a, iconColor:
|
|
|
8013
8138
|
}
|
|
8014
8139
|
//#endregion
|
|
8015
8140
|
//#region src/components/ui/OAuthButton.tsx
|
|
8016
|
-
function
|
|
8141
|
+
function $a() {
|
|
8017
8142
|
return /* @__PURE__ */ v("svg", {
|
|
8018
8143
|
className: "h-3.5 w-3.5",
|
|
8019
8144
|
viewBox: "0 0 24 24",
|
|
@@ -8038,7 +8163,7 @@ function qa() {
|
|
|
8038
8163
|
]
|
|
8039
8164
|
});
|
|
8040
8165
|
}
|
|
8041
|
-
function
|
|
8166
|
+
function eo() {
|
|
8042
8167
|
return /* @__PURE__ */ _("svg", {
|
|
8043
8168
|
className: "h-3.5 w-3.5",
|
|
8044
8169
|
viewBox: "0 0 24 24",
|
|
@@ -8047,25 +8172,25 @@ function Ja() {
|
|
|
8047
8172
|
children: /* @__PURE__ */ _("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" })
|
|
8048
8173
|
});
|
|
8049
8174
|
}
|
|
8050
|
-
var
|
|
8175
|
+
var to = {
|
|
8051
8176
|
github: "GitHub",
|
|
8052
8177
|
google: "Google"
|
|
8053
|
-
},
|
|
8054
|
-
github:
|
|
8055
|
-
google:
|
|
8178
|
+
}, no = {
|
|
8179
|
+
github: eo,
|
|
8180
|
+
google: $a
|
|
8056
8181
|
};
|
|
8057
|
-
function
|
|
8058
|
-
let r =
|
|
8182
|
+
function ro({ provider: e, children: t, ...n }) {
|
|
8183
|
+
let r = no[e];
|
|
8059
8184
|
return /* @__PURE__ */ v(fn, {
|
|
8060
8185
|
variant: "secondary",
|
|
8061
8186
|
size: "md",
|
|
8062
8187
|
...n,
|
|
8063
|
-
children: [/* @__PURE__ */ _(r, {}), t ??
|
|
8188
|
+
children: [/* @__PURE__ */ _(r, {}), t ?? to[e]]
|
|
8064
8189
|
});
|
|
8065
8190
|
}
|
|
8066
8191
|
//#endregion
|
|
8067
8192
|
//#region src/components/ui/PageHeader.tsx
|
|
8068
|
-
function
|
|
8193
|
+
function io({ title: e, subtitle: t, actions: n, className: r, eyebrow: i, headingLevel: a = 1, wrap: o = !1 }) {
|
|
8069
8194
|
let s = `h${a}`;
|
|
8070
8195
|
return /* @__PURE__ */ v("div", {
|
|
8071
8196
|
className: G("flex items-center justify-between gap-3", o && "flex-wrap", r),
|
|
@@ -8093,7 +8218,7 @@ function Qa({ title: e, subtitle: t, actions: n, className: r, eyebrow: i, headi
|
|
|
8093
8218
|
}
|
|
8094
8219
|
//#endregion
|
|
8095
8220
|
//#region src/components/ui/PageSection.tsx
|
|
8096
|
-
function
|
|
8221
|
+
function ao({ title: e, description: t, actions: n, children: r, as: i = "h2", className: a, headerClassName: o, contentClassName: s }) {
|
|
8097
8222
|
return /* @__PURE__ */ v("section", {
|
|
8098
8223
|
className: G("space-y-4", a),
|
|
8099
8224
|
children: [(e || t || n) && /* @__PURE__ */ v("div", {
|
|
@@ -8119,7 +8244,7 @@ function $a({ title: e, description: t, actions: n, children: r, as: i = "h2", c
|
|
|
8119
8244
|
}
|
|
8120
8245
|
//#endregion
|
|
8121
8246
|
//#region src/components/ui/PaginationBar.tsx
|
|
8122
|
-
var
|
|
8247
|
+
var oo = [
|
|
8123
8248
|
{
|
|
8124
8249
|
value: "10",
|
|
8125
8250
|
label: "10 per page"
|
|
@@ -8133,7 +8258,7 @@ var eo = [
|
|
|
8133
8258
|
label: "50 per page"
|
|
8134
8259
|
}
|
|
8135
8260
|
];
|
|
8136
|
-
function
|
|
8261
|
+
function so({ page: e, pageSize: t, total: n, pageSizeOptions: r = oo, onPageChange: i, onPageSizeChange: a, className: o }) {
|
|
8137
8262
|
let s = Math.ceil(n / t), c = Math.min((e - 1) * t + 1, n), l = Math.min(e * t, n);
|
|
8138
8263
|
return /* @__PURE__ */ v("div", {
|
|
8139
8264
|
className: G("flex items-center justify-between", o),
|
|
@@ -8164,7 +8289,7 @@ function to({ page: e, pageSize: t, total: n, pageSizeOptions: r = eo, onPageCha
|
|
|
8164
8289
|
}
|
|
8165
8290
|
//#endregion
|
|
8166
8291
|
//#region src/components/ui/useFieldControl.ts
|
|
8167
|
-
function
|
|
8292
|
+
function co({ id: e, error: t, hint: n, describedBy: r, invalid: i, required: a }) {
|
|
8168
8293
|
let o = u(), s = c(Ln), l = e ?? s?.id ?? o, d = t ? `${l}-error` : void 0, f = n ? `${l}-hint` : void 0;
|
|
8169
8294
|
return {
|
|
8170
8295
|
inputId: l,
|
|
@@ -8177,8 +8302,8 @@ function no({ id: e, error: t, hint: n, describedBy: r, invalid: i, required: a
|
|
|
8177
8302
|
}
|
|
8178
8303
|
//#endregion
|
|
8179
8304
|
//#region src/components/ui/PasswordInput.tsx
|
|
8180
|
-
var
|
|
8181
|
-
let d =
|
|
8305
|
+
var lo = a(({ label: e, error: t, className: n, id: r, hint: i, controlSize: a, required: o, "aria-describedby": s, "aria-invalid": c, ...l }, u) => {
|
|
8306
|
+
let d = co({
|
|
8182
8307
|
id: r,
|
|
8183
8308
|
error: t,
|
|
8184
8309
|
hint: i,
|
|
@@ -8230,8 +8355,8 @@ var ro = a(({ label: e, error: t, className: n, id: r, hint: i, controlSize: a,
|
|
|
8230
8355
|
]
|
|
8231
8356
|
});
|
|
8232
8357
|
});
|
|
8233
|
-
|
|
8234
|
-
var
|
|
8358
|
+
lo.displayName = "PasswordInput";
|
|
8359
|
+
var uo = Object.freeze([
|
|
8235
8360
|
{
|
|
8236
8361
|
label: "At least 8 characters",
|
|
8237
8362
|
test: (e) => e.length >= 8
|
|
@@ -8249,12 +8374,12 @@ var io = Object.freeze([
|
|
|
8249
8374
|
test: (e) => /\d/.test(e)
|
|
8250
8375
|
}
|
|
8251
8376
|
]);
|
|
8252
|
-
function
|
|
8377
|
+
function fo(e, t = uo) {
|
|
8253
8378
|
return t.every((t) => t.test(e));
|
|
8254
8379
|
}
|
|
8255
8380
|
//#endregion
|
|
8256
8381
|
//#region src/components/ui/PasswordRequirements.tsx
|
|
8257
|
-
function
|
|
8382
|
+
function po({ password: e, requirements: t = uo, showWhenEmpty: n = !1, className: r }) {
|
|
8258
8383
|
return !n && e.length === 0 ? null : /* @__PURE__ */ _("ul", {
|
|
8259
8384
|
"aria-label": "Password requirements",
|
|
8260
8385
|
className: G("space-y-1", r),
|
|
@@ -8281,7 +8406,7 @@ function oo({ password: e, requirements: t = io, showWhenEmpty: n = !1, classNam
|
|
|
8281
8406
|
}
|
|
8282
8407
|
//#endregion
|
|
8283
8408
|
//#region src/components/ui/ProfileHeader.tsx
|
|
8284
|
-
function
|
|
8409
|
+
function mo({ name: e, subtitle: t, badge: n, meta: r, action: i, className: a }) {
|
|
8285
8410
|
return /* @__PURE__ */ v("div", {
|
|
8286
8411
|
className: G("flex items-start gap-4", a),
|
|
8287
8412
|
children: [
|
|
@@ -8329,7 +8454,7 @@ function so({ name: e, subtitle: t, badge: n, meta: r, action: i, className: a }
|
|
|
8329
8454
|
}
|
|
8330
8455
|
//#endregion
|
|
8331
8456
|
//#region src/components/ui/ProseContent.tsx
|
|
8332
|
-
function
|
|
8457
|
+
function ho({ children: e, className: t }) {
|
|
8333
8458
|
return /* @__PURE__ */ _("div", {
|
|
8334
8459
|
className: G("ui-prose", t),
|
|
8335
8460
|
children: e
|
|
@@ -8337,21 +8462,21 @@ function co({ children: e, className: t }) {
|
|
|
8337
8462
|
}
|
|
8338
8463
|
//#endregion
|
|
8339
8464
|
//#region src/lib/qrCode.ts
|
|
8340
|
-
var
|
|
8465
|
+
var go = class extends RangeError {
|
|
8341
8466
|
constructor() {
|
|
8342
8467
|
super("Text is too long to encode as a QR code"), this.name = "QrCapacityError";
|
|
8343
8468
|
}
|
|
8344
|
-
},
|
|
8469
|
+
}, _o = {
|
|
8345
8470
|
L: 0,
|
|
8346
8471
|
M: 1,
|
|
8347
8472
|
Q: 2,
|
|
8348
8473
|
H: 3
|
|
8349
|
-
},
|
|
8474
|
+
}, vo = {
|
|
8350
8475
|
L: 1,
|
|
8351
8476
|
M: 0,
|
|
8352
8477
|
Q: 3,
|
|
8353
8478
|
H: 2
|
|
8354
|
-
},
|
|
8479
|
+
}, yo = [
|
|
8355
8480
|
[
|
|
8356
8481
|
-1,
|
|
8357
8482
|
7,
|
|
@@ -8524,7 +8649,7 @@ var lo = class extends RangeError {
|
|
|
8524
8649
|
30,
|
|
8525
8650
|
30
|
|
8526
8651
|
]
|
|
8527
|
-
],
|
|
8652
|
+
], bo = [
|
|
8528
8653
|
[
|
|
8529
8654
|
-1,
|
|
8530
8655
|
1,
|
|
@@ -8698,7 +8823,7 @@ var lo = class extends RangeError {
|
|
|
8698
8823
|
81
|
|
8699
8824
|
]
|
|
8700
8825
|
];
|
|
8701
|
-
function
|
|
8826
|
+
function xo(e) {
|
|
8702
8827
|
let t = (16 * e + 128) * e + 64;
|
|
8703
8828
|
if (e >= 2) {
|
|
8704
8829
|
let n = Math.floor(e / 7) + 2;
|
|
@@ -8706,43 +8831,43 @@ function ho(e) {
|
|
|
8706
8831
|
}
|
|
8707
8832
|
return t;
|
|
8708
8833
|
}
|
|
8709
|
-
function
|
|
8710
|
-
let n =
|
|
8711
|
-
return Math.floor(
|
|
8834
|
+
function So(e, t) {
|
|
8835
|
+
let n = _o[t];
|
|
8836
|
+
return Math.floor(xo(e) / 8) - yo[n][e] * bo[n][e];
|
|
8712
8837
|
}
|
|
8713
|
-
function
|
|
8838
|
+
function Co(e) {
|
|
8714
8839
|
if (e === 1) return [];
|
|
8715
8840
|
let t = Math.floor(e / 7) + 2, n = Math.floor((e * 8 + t * 3 + 5) / (t * 4 - 4)) * 2, r = [6];
|
|
8716
8841
|
for (let i = e * 4 + 17 - 7; r.length < t; i -= n) r.splice(1, 0, i);
|
|
8717
8842
|
return r;
|
|
8718
8843
|
}
|
|
8719
|
-
function
|
|
8844
|
+
function wo(e, t) {
|
|
8720
8845
|
let n = 0;
|
|
8721
8846
|
for (let r = 7; r >= 0; r--) n = n << 1 ^ (n >>> 7) * 285, n ^= (t >>> r & 1) * e;
|
|
8722
8847
|
return n;
|
|
8723
8848
|
}
|
|
8724
|
-
function
|
|
8849
|
+
function To(e) {
|
|
8725
8850
|
let t = Array(e).fill(0);
|
|
8726
8851
|
t[e - 1] = 1;
|
|
8727
8852
|
let n = 1;
|
|
8728
8853
|
for (let r = 0; r < e; r++) {
|
|
8729
|
-
for (let e = 0; e < t.length; e++) t[e] =
|
|
8730
|
-
n =
|
|
8854
|
+
for (let e = 0; e < t.length; e++) t[e] = wo(t[e], n), e + 1 < t.length && (t[e] ^= t[e + 1]);
|
|
8855
|
+
n = wo(n, 2);
|
|
8731
8856
|
}
|
|
8732
8857
|
return t;
|
|
8733
8858
|
}
|
|
8734
|
-
function
|
|
8859
|
+
function Eo(e, t) {
|
|
8735
8860
|
let n = Array(t.length).fill(0);
|
|
8736
8861
|
for (let r of e) {
|
|
8737
8862
|
let e = r ^ n.shift();
|
|
8738
8863
|
n.push(0), t.forEach((t, r) => {
|
|
8739
|
-
n[r] ^=
|
|
8864
|
+
n[r] ^= wo(t, e);
|
|
8740
8865
|
});
|
|
8741
8866
|
}
|
|
8742
8867
|
return n;
|
|
8743
8868
|
}
|
|
8744
|
-
function
|
|
8745
|
-
let r =
|
|
8869
|
+
function Do(e, t, n) {
|
|
8870
|
+
let r = So(t, n) * 8, i = [], a = (e, t) => {
|
|
8746
8871
|
for (let n = t - 1; n >= 0; n--) i.push(e >>> n & 1);
|
|
8747
8872
|
};
|
|
8748
8873
|
a(4, 4), a(e.length, t <= 9 ? 8 : 16);
|
|
@@ -8753,12 +8878,12 @@ function xo(e, t, n) {
|
|
|
8753
8878
|
for (let e = 0; e < i.length; e += 8) o.push(i.slice(e, e + 8).reduce((e, t) => e << 1 | t));
|
|
8754
8879
|
return o;
|
|
8755
8880
|
}
|
|
8756
|
-
function
|
|
8757
|
-
let r =
|
|
8881
|
+
function Oo(e, t, n) {
|
|
8882
|
+
let r = _o[n], i = bo[r][t], a = yo[r][t], o = Math.floor(xo(t) / 8), s = i - o % i, c = Math.floor(o / i), l = To(a), u = [];
|
|
8758
8883
|
for (let t = 0, n = 0; t < i; t++) {
|
|
8759
8884
|
let r = c - a + (t < s ? 0 : 1), i = e.slice(n, n + r);
|
|
8760
8885
|
n += r;
|
|
8761
|
-
let o =
|
|
8886
|
+
let o = Eo(i, l);
|
|
8762
8887
|
t < s && i.push(0), u.push(i.concat(o));
|
|
8763
8888
|
}
|
|
8764
8889
|
let d = [];
|
|
@@ -8767,7 +8892,7 @@ function So(e, t, n) {
|
|
|
8767
8892
|
});
|
|
8768
8893
|
return d;
|
|
8769
8894
|
}
|
|
8770
|
-
var
|
|
8895
|
+
var ko = class {
|
|
8771
8896
|
size;
|
|
8772
8897
|
modules;
|
|
8773
8898
|
isFunction;
|
|
@@ -8778,7 +8903,7 @@ var Co = class {
|
|
|
8778
8903
|
this.modules[t][e] = n, this.isFunction[t][e] = !0;
|
|
8779
8904
|
}
|
|
8780
8905
|
};
|
|
8781
|
-
function
|
|
8906
|
+
function Ao(e, t) {
|
|
8782
8907
|
let { size: n } = e;
|
|
8783
8908
|
for (let t = 0; t < n; t++) e.setFunction(6, t, t % 2 == 0), e.setFunction(t, 6, t % 2 == 0);
|
|
8784
8909
|
for (let [t, r] of [
|
|
@@ -8791,15 +8916,15 @@ function wo(e, t) {
|
|
|
8791
8916
|
let c = Math.max(Math.abs(a), Math.abs(i));
|
|
8792
8917
|
e.setFunction(o, s, c !== 2 && c !== 4);
|
|
8793
8918
|
}
|
|
8794
|
-
let r =
|
|
8919
|
+
let r = Co(t), i = r.length - 1;
|
|
8795
8920
|
r.forEach((t, n) => {
|
|
8796
8921
|
r.forEach((r, a) => {
|
|
8797
8922
|
if (!(n === 0 && a === 0 || n === 0 && a === i || n === i && a === 0)) for (let n = -2; n <= 2; n++) for (let i = -2; i <= 2; i++) e.setFunction(t + i, r + n, Math.max(Math.abs(i), Math.abs(n)) !== 1);
|
|
8798
8923
|
});
|
|
8799
|
-
}),
|
|
8924
|
+
}), jo(e, "M", 0), Mo(e, t);
|
|
8800
8925
|
}
|
|
8801
|
-
function
|
|
8802
|
-
let r =
|
|
8926
|
+
function jo(e, t, n) {
|
|
8927
|
+
let r = vo[t] << 3 | n, i = r;
|
|
8803
8928
|
for (let e = 0; e < 10; e++) i = i << 1 ^ (i >>> 9) * 1335;
|
|
8804
8929
|
let a = (r << 10 | i) ^ 21522, o = (e) => (a >>> e & 1) != 0, { size: s } = e;
|
|
8805
8930
|
for (let t = 0; t <= 5; t++) e.setFunction(8, t, o(t));
|
|
@@ -8809,7 +8934,7 @@ function To(e, t, n) {
|
|
|
8809
8934
|
for (let t = 8; t < 15; t++) e.setFunction(8, s - 15 + t, o(t));
|
|
8810
8935
|
e.setFunction(8, s - 8, !0);
|
|
8811
8936
|
}
|
|
8812
|
-
function
|
|
8937
|
+
function Mo(e, t) {
|
|
8813
8938
|
if (t < 7) return;
|
|
8814
8939
|
let n = t;
|
|
8815
8940
|
for (let e = 0; e < 12; e++) n = n << 1 ^ (n >>> 11) * 7973;
|
|
@@ -8819,7 +8944,7 @@ function Eo(e, t) {
|
|
|
8819
8944
|
e.setFunction(i, a, n), e.setFunction(a, i, n);
|
|
8820
8945
|
}
|
|
8821
8946
|
}
|
|
8822
|
-
function
|
|
8947
|
+
function No(e, t) {
|
|
8823
8948
|
let { size: n } = e, r = 0;
|
|
8824
8949
|
for (let i = n - 1; i >= 1; i -= 2) {
|
|
8825
8950
|
i === 6 && (i = 5);
|
|
@@ -8833,7 +8958,7 @@ function Do(e, t) {
|
|
|
8833
8958
|
}
|
|
8834
8959
|
}
|
|
8835
8960
|
}
|
|
8836
|
-
var
|
|
8961
|
+
var Po = [
|
|
8837
8962
|
(e, t) => (e + t) % 2 == 0,
|
|
8838
8963
|
(e, t) => t % 2 == 0,
|
|
8839
8964
|
(e) => e % 3 == 0,
|
|
@@ -8843,10 +8968,10 @@ var Oo = [
|
|
|
8843
8968
|
(e, t) => (e * t % 2 + e * t % 3) % 2 == 0,
|
|
8844
8969
|
(e, t) => ((e + t) % 2 + e * t % 3) % 2 == 0
|
|
8845
8970
|
];
|
|
8846
|
-
function
|
|
8847
|
-
for (let n = 0; n < e.size; n++) for (let r = 0; r < e.size; r++) !e.isFunction[n][r] &&
|
|
8971
|
+
function Fo(e, t) {
|
|
8972
|
+
for (let n = 0; n < e.size; n++) for (let r = 0; r < e.size; r++) !e.isFunction[n][r] && Po[t](r, n) && (e.modules[n][r] = !e.modules[n][r]);
|
|
8848
8973
|
}
|
|
8849
|
-
var
|
|
8974
|
+
var Io = [[
|
|
8850
8975
|
!0,
|
|
8851
8976
|
!1,
|
|
8852
8977
|
!0,
|
|
@@ -8871,12 +8996,12 @@ var Ao = [[
|
|
|
8871
8996
|
!1,
|
|
8872
8997
|
!0
|
|
8873
8998
|
]];
|
|
8874
|
-
function
|
|
8999
|
+
function Lo(e) {
|
|
8875
9000
|
let t = e.length, n = (t, n, r) => r ? e[t][n] : e[n][t], r = 0;
|
|
8876
9001
|
for (let e of [!1, !0]) for (let i = 0; i < t; i++) {
|
|
8877
9002
|
let a = 1;
|
|
8878
9003
|
for (let o = 1; o <= t; o++) o < t && n(o, i, e) === n(o - 1, i, e) ? a++ : (a >= 5 && (r += 3 + (a - 5)), a = 1);
|
|
8879
|
-
for (let a = 0; a + 11 <= t; a++) for (let t of
|
|
9004
|
+
for (let a = 0; a + 11 <= t; a++) for (let t of Io) t.every((t, r) => n(a + r, i, e) === t) && (r += 40);
|
|
8880
9005
|
}
|
|
8881
9006
|
for (let n = 0; n < t - 1; n++) for (let i = 0; i < t - 1; i++) {
|
|
8882
9007
|
let t = e[n][i];
|
|
@@ -8885,20 +9010,20 @@ function jo(e) {
|
|
|
8885
9010
|
let i = e.reduce((e, t) => e + t.filter(Boolean).length, 0) * 100 / (t * t);
|
|
8886
9011
|
return r += Math.floor(Math.abs(i - 50) / 5) * 10, r;
|
|
8887
9012
|
}
|
|
8888
|
-
function
|
|
8889
|
-
if (!Object.hasOwn(
|
|
9013
|
+
function Ro(e, t = "M") {
|
|
9014
|
+
if (!Object.hasOwn(_o, t)) throw RangeError(`Invalid QR error correction level "${t}"; expected L, M, Q or H`);
|
|
8890
9015
|
let n = new TextEncoder().encode(e), r = 1;
|
|
8891
|
-
for (; r <= 40 && !(4 + (r <= 9 ? 8 : 16) + n.length * 8 <=
|
|
8892
|
-
if (r > 40) throw new
|
|
8893
|
-
let i =
|
|
8894
|
-
|
|
9016
|
+
for (; r <= 40 && !(4 + (r <= 9 ? 8 : 16) + n.length * 8 <= So(r, t) * 8); r++);
|
|
9017
|
+
if (r > 40) throw new go();
|
|
9018
|
+
let i = Oo(Do(n, r, t), r, t), a = new ko(r * 4 + 17);
|
|
9019
|
+
Ao(a, r), No(a, i);
|
|
8895
9020
|
let o = 0, s = Infinity;
|
|
8896
9021
|
for (let e = 0; e < 8; e++) {
|
|
8897
|
-
|
|
8898
|
-
let n =
|
|
8899
|
-
n < s && (s = n, o = e),
|
|
9022
|
+
Fo(a, e), jo(a, t, e);
|
|
9023
|
+
let n = Lo(a.modules);
|
|
9024
|
+
n < s && (s = n, o = e), Fo(a, e);
|
|
8900
9025
|
}
|
|
8901
|
-
return
|
|
9026
|
+
return Fo(a, o), jo(a, t, o), {
|
|
8902
9027
|
size: a.size,
|
|
8903
9028
|
version: r,
|
|
8904
9029
|
modules: a.modules
|
|
@@ -8906,13 +9031,13 @@ function Mo(e, t = "M") {
|
|
|
8906
9031
|
}
|
|
8907
9032
|
//#endregion
|
|
8908
9033
|
//#region src/components/ui/QrCode.tsx
|
|
8909
|
-
function
|
|
9034
|
+
function zo({ value: e, errorCorrection: t = "M", size: n = 160, margin: r = 4, "aria-label": i = "QR code", fallback: a = null, className: o }) {
|
|
8910
9035
|
let s = p(() => {
|
|
8911
9036
|
if (!e) return null;
|
|
8912
9037
|
try {
|
|
8913
|
-
return
|
|
9038
|
+
return Ro(e, t);
|
|
8914
9039
|
} catch (e) {
|
|
8915
|
-
if (e instanceof
|
|
9040
|
+
if (e instanceof go) return "too-long";
|
|
8916
9041
|
throw e;
|
|
8917
9042
|
}
|
|
8918
9043
|
}, [e, t]);
|
|
@@ -8946,7 +9071,7 @@ function No({ value: e, errorCorrection: t = "M", size: n = 160, margin: r = 4,
|
|
|
8946
9071
|
}
|
|
8947
9072
|
//#endregion
|
|
8948
9073
|
//#region src/components/ui/SearchInput.tsx
|
|
8949
|
-
function
|
|
9074
|
+
function Bo({ value: e, onChange: t, placeholder: n = "Search...", className: r }) {
|
|
8950
9075
|
return /* @__PURE__ */ v("div", {
|
|
8951
9076
|
className: G("relative", r),
|
|
8952
9077
|
children: [/* @__PURE__ */ _(B, { className: "text-text-tertiary absolute top-1/2 left-2 h-3.5 w-3.5 -translate-y-1/2" }), /* @__PURE__ */ _("input", {
|
|
@@ -8960,8 +9085,8 @@ function Po({ value: e, onChange: t, placeholder: n = "Search...", className: r
|
|
|
8960
9085
|
}
|
|
8961
9086
|
//#endregion
|
|
8962
9087
|
//#region src/components/ui/Select.tsx
|
|
8963
|
-
var
|
|
8964
|
-
let f =
|
|
9088
|
+
var Vo = a(({ label: e, error: t, options: n, className: r, id: i, hint: a, controlSize: o, required: s, "aria-describedby": c, "aria-invalid": l, ...u }, d) => {
|
|
9089
|
+
let f = co({
|
|
8965
9090
|
id: i,
|
|
8966
9091
|
error: t,
|
|
8967
9092
|
hint: a,
|
|
@@ -9009,10 +9134,10 @@ var Fo = a(({ label: e, error: t, options: n, className: r, id: i, hint: a, cont
|
|
|
9009
9134
|
]
|
|
9010
9135
|
});
|
|
9011
9136
|
});
|
|
9012
|
-
|
|
9137
|
+
Vo.displayName = "Select";
|
|
9013
9138
|
//#endregion
|
|
9014
9139
|
//#region src/components/ui/SettingRow.tsx
|
|
9015
|
-
function
|
|
9140
|
+
function Ho({ label: e, description: t, action: n, className: r }) {
|
|
9016
9141
|
return /* @__PURE__ */ v("div", {
|
|
9017
9142
|
className: G("border-border flex items-center justify-between border-b py-3", r),
|
|
9018
9143
|
children: [/* @__PURE__ */ v("div", {
|
|
@@ -9032,7 +9157,7 @@ function Io({ label: e, description: t, action: n, className: r }) {
|
|
|
9032
9157
|
}
|
|
9033
9158
|
//#endregion
|
|
9034
9159
|
//#region src/components/ui/SideSheet.tsx
|
|
9035
|
-
function
|
|
9160
|
+
function Uo({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "right", widthClassName: o = "w-[360px]", className: s, contentClassName: c }) {
|
|
9036
9161
|
let u = an(), d = m(null);
|
|
9037
9162
|
return ft(d, e), l(() => {
|
|
9038
9163
|
if (!e) return;
|
|
@@ -9086,41 +9211,41 @@ function Lo({ open: e, onClose: t, title: n, children: r, footer: i, side: a = "
|
|
|
9086
9211
|
}
|
|
9087
9212
|
//#endregion
|
|
9088
9213
|
//#region src/components/ui/SplitPaneLayout.tsx
|
|
9089
|
-
function
|
|
9214
|
+
function Wo({ children: e, direction: t = "row", className: n }) {
|
|
9090
9215
|
return /* @__PURE__ */ _("div", {
|
|
9091
9216
|
className: G("-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),
|
|
9092
9217
|
children: e
|
|
9093
9218
|
});
|
|
9094
9219
|
}
|
|
9095
|
-
function
|
|
9220
|
+
function Go({ children: e, className: t }) {
|
|
9096
9221
|
return /* @__PURE__ */ _("div", {
|
|
9097
9222
|
className: G("flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden", t),
|
|
9098
9223
|
children: e
|
|
9099
9224
|
});
|
|
9100
9225
|
}
|
|
9101
|
-
var
|
|
9226
|
+
var Ko = Object.assign(Wo, { Main: Go }), qo = {
|
|
9102
9227
|
active: "bg-green",
|
|
9103
9228
|
inactive: "bg-text-tertiary",
|
|
9104
9229
|
pending: "bg-yellow animate-pulse-subtle",
|
|
9105
9230
|
error: "bg-red"
|
|
9106
|
-
},
|
|
9231
|
+
}, Jo = {
|
|
9107
9232
|
active: "text-green",
|
|
9108
9233
|
inactive: "text-text-tertiary",
|
|
9109
9234
|
pending: "text-yellow",
|
|
9110
9235
|
error: "text-red"
|
|
9111
9236
|
};
|
|
9112
|
-
function
|
|
9237
|
+
function Yo({ status: e, label: t, className: n }) {
|
|
9113
9238
|
return /* @__PURE__ */ v("span", {
|
|
9114
9239
|
className: G("inline-flex items-center gap-1.5", n),
|
|
9115
|
-
children: [/* @__PURE__ */ _("span", { className: G("h-2 w-2 rounded-full",
|
|
9116
|
-
className: G("text-xs",
|
|
9240
|
+
children: [/* @__PURE__ */ _("span", { className: G("h-2 w-2 rounded-full", qo[e]) }), t && /* @__PURE__ */ _("span", {
|
|
9241
|
+
className: G("text-xs", Jo[e]),
|
|
9117
9242
|
children: t
|
|
9118
9243
|
})]
|
|
9119
9244
|
});
|
|
9120
9245
|
}
|
|
9121
9246
|
//#endregion
|
|
9122
9247
|
//#region src/components/ui/StepProgress.tsx
|
|
9123
|
-
function
|
|
9248
|
+
function Xo({ steps: e, currentStep: t, className: n }) {
|
|
9124
9249
|
return /* @__PURE__ */ _("div", {
|
|
9125
9250
|
className: G("flex items-center justify-between", n),
|
|
9126
9251
|
children: e.map((n, r) => /* @__PURE__ */ v("div", {
|
|
@@ -9147,7 +9272,7 @@ function Wo({ steps: e, currentStep: t, className: n }) {
|
|
|
9147
9272
|
}
|
|
9148
9273
|
//#endregion
|
|
9149
9274
|
//#region src/components/ui/Tabs.tsx
|
|
9150
|
-
function
|
|
9275
|
+
function Zo({ tabs: e, defaultTab: t, value: n, onChange: r, className: i }) {
|
|
9151
9276
|
let [a, o] = h(t || e[0]?.key), s = n ?? a, c = e.some((e) => e.key === s) ? s : e[0]?.key, l = e.find((e) => e.key === c);
|
|
9152
9277
|
function d(e) {
|
|
9153
9278
|
n === void 0 && o(e), r?.(e);
|
|
@@ -9186,8 +9311,8 @@ function Go({ tabs: e, defaultTab: t, value: n, onChange: r, className: i }) {
|
|
|
9186
9311
|
}
|
|
9187
9312
|
//#endregion
|
|
9188
9313
|
//#region src/components/ui/Textarea.tsx
|
|
9189
|
-
var
|
|
9190
|
-
let m =
|
|
9314
|
+
var Qo = a(({ label: e, error: t, showCount: n, maxLength: r, value: i, className: a, id: o, hint: s, controlSize: c, required: l, "aria-describedby": u, "aria-invalid": d, ...f }, p) => {
|
|
9315
|
+
let m = co({
|
|
9191
9316
|
id: o,
|
|
9192
9317
|
error: t,
|
|
9193
9318
|
hint: s,
|
|
@@ -9238,11 +9363,11 @@ var Ko = a(({ label: e, error: t, showCount: n, maxLength: r, value: i, classNam
|
|
|
9238
9363
|
]
|
|
9239
9364
|
});
|
|
9240
9365
|
});
|
|
9241
|
-
|
|
9366
|
+
Qo.displayName = "Textarea";
|
|
9242
9367
|
//#endregion
|
|
9243
9368
|
//#region src/components/ui/TextInput.tsx
|
|
9244
|
-
var
|
|
9245
|
-
let p =
|
|
9369
|
+
var $o = a(({ label: e, error: t, icon: n, className: r, id: i, readOnly: a, hint: o, controlSize: s, required: c, "aria-describedby": l, "aria-invalid": u, ...d }, f) => {
|
|
9370
|
+
let p = co({
|
|
9246
9371
|
id: i,
|
|
9247
9372
|
error: t,
|
|
9248
9373
|
hint: o,
|
|
@@ -9291,10 +9416,10 @@ var qo = a(({ label: e, error: t, icon: n, className: r, id: i, readOnly: a, hin
|
|
|
9291
9416
|
]
|
|
9292
9417
|
});
|
|
9293
9418
|
});
|
|
9294
|
-
|
|
9419
|
+
$o.displayName = "TextInput";
|
|
9295
9420
|
//#endregion
|
|
9296
9421
|
//#region src/components/ui/Timeline.tsx
|
|
9297
|
-
function
|
|
9422
|
+
function es({ items: e, className: t }) {
|
|
9298
9423
|
return /* @__PURE__ */ _("div", {
|
|
9299
9424
|
className: G("space-y-0", t),
|
|
9300
9425
|
children: e.map((t, n) => /* @__PURE__ */ v("div", {
|
|
@@ -9317,16 +9442,16 @@ function Jo({ items: e, className: t }) {
|
|
|
9317
9442
|
}
|
|
9318
9443
|
//#endregion
|
|
9319
9444
|
//#region src/components/ui/Tooltip.tsx
|
|
9320
|
-
var
|
|
9445
|
+
var ts = {
|
|
9321
9446
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
9322
9447
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
9323
9448
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
9324
9449
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
9325
9450
|
};
|
|
9326
|
-
function
|
|
9451
|
+
function ns(e, t) {
|
|
9327
9452
|
return e ? `${e} ${t}` : t;
|
|
9328
9453
|
}
|
|
9329
|
-
function
|
|
9454
|
+
function rs({ content: e, placement: t = "top", children: r }) {
|
|
9330
9455
|
let [i, a] = h(!1), s = u();
|
|
9331
9456
|
return /* @__PURE__ */ v("div", {
|
|
9332
9457
|
className: "relative inline-flex",
|
|
@@ -9334,9 +9459,9 @@ function Zo({ content: e, placement: t = "top", children: r }) {
|
|
|
9334
9459
|
onMouseLeave: () => a(!1),
|
|
9335
9460
|
onFocus: () => a(!0),
|
|
9336
9461
|
onBlur: () => a(!1),
|
|
9337
|
-
children: [o(r) ? n(r, { "aria-describedby":
|
|
9462
|
+
children: [o(r) ? n(r, { "aria-describedby": ns(r.props["aria-describedby"], s) }) : r, i && /* @__PURE__ */ _("div", {
|
|
9338
9463
|
id: s,
|
|
9339
|
-
className: G("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",
|
|
9464
|
+
className: G("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", ts[t]),
|
|
9340
9465
|
role: "tooltip",
|
|
9341
9466
|
children: e
|
|
9342
9467
|
})]
|
|
@@ -9344,7 +9469,7 @@ function Zo({ content: e, placement: t = "top", children: r }) {
|
|
|
9344
9469
|
}
|
|
9345
9470
|
//#endregion
|
|
9346
9471
|
//#region src/components/ui/Toolbar.tsx
|
|
9347
|
-
function
|
|
9472
|
+
function is({ start: e, end: t, children: n, className: r, startClassName: i, endClassName: a }) {
|
|
9348
9473
|
return /* @__PURE__ */ v("div", {
|
|
9349
9474
|
className: G("flex items-center justify-between gap-3", r),
|
|
9350
9475
|
children: [/* @__PURE__ */ _("div", {
|
|
@@ -9358,7 +9483,7 @@ function Qo({ start: e, end: t, children: n, className: r, startClassName: i, en
|
|
|
9358
9483
|
}
|
|
9359
9484
|
//#endregion
|
|
9360
9485
|
//#region src/components/ui/UploadDropzone.tsx
|
|
9361
|
-
var
|
|
9486
|
+
var as = a(function({ title: e = "Drag and drop files here, or click to browse", description: t, icon: n, multiple: r, disabled: i, onChange: a, onFilesChange: o, className: s, id: c, "aria-describedby": l, ...f }, p) {
|
|
9362
9487
|
let h = m(null);
|
|
9363
9488
|
d(p, () => h.current, []);
|
|
9364
9489
|
let g = u(), y = `${c ?? g}-description`;
|
|
@@ -9405,15 +9530,15 @@ var $o = a(function({ title: e = "Drag and drop files here, or click to browse",
|
|
|
9405
9530
|
})
|
|
9406
9531
|
]
|
|
9407
9532
|
});
|
|
9408
|
-
}),
|
|
9533
|
+
}), os = r({ theme: "dark" });
|
|
9409
9534
|
//#endregion
|
|
9410
9535
|
//#region src/hooks/useTheme.ts
|
|
9411
|
-
function
|
|
9412
|
-
return c(
|
|
9536
|
+
function ss() {
|
|
9537
|
+
return c(os);
|
|
9413
9538
|
}
|
|
9414
9539
|
//#endregion
|
|
9415
9540
|
//#region src/lib/formatDate.ts
|
|
9416
|
-
var
|
|
9541
|
+
var cs = [
|
|
9417
9542
|
"Jan",
|
|
9418
9543
|
"Feb",
|
|
9419
9544
|
"Mar",
|
|
@@ -9427,21 +9552,21 @@ var ns = [
|
|
|
9427
9552
|
"Nov",
|
|
9428
9553
|
"Dec"
|
|
9429
9554
|
];
|
|
9430
|
-
function
|
|
9555
|
+
function ls(e) {
|
|
9431
9556
|
return (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString("en-US", {
|
|
9432
9557
|
month: "short",
|
|
9433
9558
|
day: "numeric",
|
|
9434
9559
|
year: "numeric"
|
|
9435
9560
|
});
|
|
9436
9561
|
}
|
|
9437
|
-
function
|
|
9562
|
+
function us(e) {
|
|
9438
9563
|
return (/* @__PURE__ */ new Date(e + "T00:00:00")).toLocaleDateString("en-US", {
|
|
9439
9564
|
month: "long",
|
|
9440
9565
|
day: "numeric",
|
|
9441
9566
|
year: "numeric"
|
|
9442
9567
|
});
|
|
9443
9568
|
}
|
|
9444
|
-
function
|
|
9569
|
+
function ds(e, t = /* @__PURE__ */ new Date()) {
|
|
9445
9570
|
let n = t.getTime() - e.getTime(), r = Math.floor(n / 1e3);
|
|
9446
9571
|
if (r < 60) return "just now";
|
|
9447
9572
|
let i = Math.floor(r / 60);
|
|
@@ -9449,18 +9574,18 @@ function as(e, t = /* @__PURE__ */ new Date()) {
|
|
|
9449
9574
|
let a = Math.floor(i / 60);
|
|
9450
9575
|
if (a < 24) return `${a}h ago`;
|
|
9451
9576
|
if (Math.floor(a / 24) === 1) return "yesterday";
|
|
9452
|
-
let o = `${
|
|
9577
|
+
let o = `${cs[e.getMonth()]} ${e.getDate()}`;
|
|
9453
9578
|
return e.getFullYear() === t.getFullYear() ? o : `${o}, ${e.getFullYear()}`;
|
|
9454
9579
|
}
|
|
9455
9580
|
//#endregion
|
|
9456
9581
|
//#region src/providers/SettingsProvider.tsx
|
|
9457
|
-
var
|
|
9582
|
+
var fs = {
|
|
9458
9583
|
"archivo-expanded": "\"Archivo\", \"Arial Black\", \"Avenir Next Condensed\", \"HelveticaNeue-CondensedBold\", system-ui, sans-serif",
|
|
9459
9584
|
inter: "\"Inter\", system-ui, -apple-system, BlinkMacSystemFont, sans-serif",
|
|
9460
9585
|
"jetbrains-mono": "\"JetBrains Mono\", Menlo, Monaco, Consolas, monospace",
|
|
9461
9586
|
"pt-serif": "\"PT Serif\", Georgia, ui-serif, Cambria, \"Times New Roman\", Times, serif",
|
|
9462
9587
|
system: "system-ui, -apple-system, BlinkMacSystemFont, sans-serif"
|
|
9463
|
-
},
|
|
9588
|
+
}, ps = {
|
|
9464
9589
|
purple: {
|
|
9465
9590
|
base: "#7C5CFC",
|
|
9466
9591
|
hover: "#6B4AEB",
|
|
@@ -9517,43 +9642,43 @@ var os = {
|
|
|
9517
9642
|
muted: "rgba(99,102,241,0.15)",
|
|
9518
9643
|
subtle: "rgba(99,102,241,0.08)"
|
|
9519
9644
|
}
|
|
9520
|
-
},
|
|
9645
|
+
}, ms = "leonardaustin-ui-settings", hs = new Set(Object.keys(ps)), gs = new Set(Object.keys(Ot)), _s = new Set(Object.keys(fs)), vs = new Set([
|
|
9521
9646
|
"light",
|
|
9522
9647
|
"dark",
|
|
9523
9648
|
"system"
|
|
9524
9649
|
]);
|
|
9525
|
-
function
|
|
9650
|
+
function ys(e, t, n, r) {
|
|
9526
9651
|
return typeof e != "number" || !isFinite(e) ? r : Math.min(n, Math.max(t, e));
|
|
9527
9652
|
}
|
|
9528
|
-
function
|
|
9653
|
+
function bs(e) {
|
|
9529
9654
|
let t = {};
|
|
9530
|
-
if (
|
|
9655
|
+
if (hs.has(e.accentColor) && (t.accentColor = e.accentColor), vs.has(e.colorMode) && (t.colorMode = e.colorMode), gs.has(e.preferredDarkTheme) && !Ct(e.preferredDarkTheme) && (t.preferredDarkTheme = e.preferredDarkTheme), gs.has(e.preferredLightTheme) && Ct(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 = ys(e.sidebarWidth, 160, 400, 220)), e.themeOverrides && typeof e.themeOverrides == "object") {
|
|
9531
9656
|
let n = {};
|
|
9532
9657
|
for (let [t, r] of Object.entries(e.themeOverrides)) {
|
|
9533
|
-
if (!
|
|
9658
|
+
if (!gs.has(t) || !r || typeof r != "object") continue;
|
|
9534
9659
|
let e = r, i = Ot[t];
|
|
9535
9660
|
n[t] = {
|
|
9536
|
-
uiFont:
|
|
9537
|
-
headingFont:
|
|
9538
|
-
proseFont:
|
|
9539
|
-
controlFont:
|
|
9540
|
-
labelFont:
|
|
9541
|
-
navigationFont:
|
|
9542
|
-
dataFont:
|
|
9543
|
-
codeFont:
|
|
9544
|
-
fontSize:
|
|
9545
|
-
borderRadius:
|
|
9546
|
-
borderWidth:
|
|
9547
|
-
tracking:
|
|
9548
|
-
lineHeight:
|
|
9549
|
-
density:
|
|
9661
|
+
uiFont: _s.has(e.uiFont) ? e.uiFont : i.uiFont,
|
|
9662
|
+
headingFont: _s.has(e.headingFont) ? e.headingFont : i.headingFont,
|
|
9663
|
+
proseFont: _s.has(e.proseFont) ? e.proseFont : i.proseFont,
|
|
9664
|
+
controlFont: _s.has(e.controlFont) ? e.controlFont : i.controlFont,
|
|
9665
|
+
labelFont: _s.has(e.labelFont) ? e.labelFont : i.labelFont,
|
|
9666
|
+
navigationFont: _s.has(e.navigationFont) ? e.navigationFont : i.navigationFont,
|
|
9667
|
+
dataFont: _s.has(e.dataFont) ? e.dataFont : i.dataFont,
|
|
9668
|
+
codeFont: _s.has(e.codeFont) ? e.codeFont : i.codeFont,
|
|
9669
|
+
fontSize: ys(e.fontSize, 11, 18, i.fontSize),
|
|
9670
|
+
borderRadius: ys(e.borderRadius, 0, 16, i.borderRadius),
|
|
9671
|
+
borderWidth: ys(e.borderWidth, 1, 3, i.borderWidth),
|
|
9672
|
+
tracking: ys(e.tracking, 0, .3, i.tracking),
|
|
9673
|
+
lineHeight: ys(e.lineHeight, 1.2, 2, i.lineHeight),
|
|
9674
|
+
density: ys(e.density, .18, .32, i.density)
|
|
9550
9675
|
};
|
|
9551
9676
|
}
|
|
9552
9677
|
t.themeOverrides = n;
|
|
9553
9678
|
}
|
|
9554
9679
|
return t;
|
|
9555
9680
|
}
|
|
9556
|
-
var
|
|
9681
|
+
var xs = {
|
|
9557
9682
|
accentColor: "purple",
|
|
9558
9683
|
sidebarCollapsed: !1,
|
|
9559
9684
|
sidebarWidth: 220,
|
|
@@ -9563,35 +9688,35 @@ var hs = {
|
|
|
9563
9688
|
preferredLightTheme: "light",
|
|
9564
9689
|
themeOverrides: {}
|
|
9565
9690
|
};
|
|
9566
|
-
function
|
|
9691
|
+
function Ss(e, t) {
|
|
9567
9692
|
let n = {
|
|
9568
|
-
...
|
|
9569
|
-
...
|
|
9693
|
+
...xs,
|
|
9694
|
+
...bs(t ?? {})
|
|
9570
9695
|
};
|
|
9571
9696
|
if (typeof localStorage > "u") return n;
|
|
9572
9697
|
try {
|
|
9573
9698
|
let t = localStorage.getItem(e);
|
|
9574
9699
|
if (t) return {
|
|
9575
9700
|
...n,
|
|
9576
|
-
...
|
|
9701
|
+
...bs(JSON.parse(t))
|
|
9577
9702
|
};
|
|
9578
9703
|
} catch (e) {
|
|
9579
9704
|
console.warn("[SettingsProvider] Failed to load settings:", e);
|
|
9580
9705
|
}
|
|
9581
9706
|
return n;
|
|
9582
9707
|
}
|
|
9583
|
-
function
|
|
9708
|
+
function Cs(e, t) {
|
|
9584
9709
|
let n = Ot[e] ?? Ot.dark;
|
|
9585
9710
|
return t[e] ? {
|
|
9586
9711
|
...n,
|
|
9587
9712
|
...t[e]
|
|
9588
9713
|
} : n;
|
|
9589
9714
|
}
|
|
9590
|
-
function
|
|
9715
|
+
function ws(e, t) {
|
|
9591
9716
|
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;
|
|
9592
9717
|
}
|
|
9593
|
-
function
|
|
9594
|
-
let [i, a] = h(() =>
|
|
9718
|
+
function Ts({ children: e, storageKey: t = ms, initialSettings: n, forcedTheme: r }) {
|
|
9719
|
+
let [i, a] = h(() => Ss(t, n)), [o, c] = h(() => typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
9595
9720
|
l(() => {
|
|
9596
9721
|
if (typeof window > "u") return;
|
|
9597
9722
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e) => c(e.matches);
|
|
@@ -9603,9 +9728,9 @@ function ys({ children: e, storageKey: t = cs, initialSettings: n, forcedTheme:
|
|
|
9603
9728
|
i.preferredDarkTheme,
|
|
9604
9729
|
i.preferredLightTheme,
|
|
9605
9730
|
o
|
|
9606
|
-
]), [d, f] = h(() =>
|
|
9731
|
+
]), [d, f] = h(() => Cs(u, i.themeOverrides));
|
|
9607
9732
|
l(() => {
|
|
9608
|
-
f(
|
|
9733
|
+
f(Cs(u, i.themeOverrides));
|
|
9609
9734
|
}, [u]);
|
|
9610
9735
|
let m = s((e) => {
|
|
9611
9736
|
a((n) => {
|
|
@@ -9622,15 +9747,15 @@ function ys({ children: e, storageKey: t = cs, initialSettings: n, forcedTheme:
|
|
|
9622
9747
|
});
|
|
9623
9748
|
}, [t]);
|
|
9624
9749
|
l(() => {
|
|
9625
|
-
let e = document.documentElement, t =
|
|
9750
|
+
let e = document.documentElement, t = ps[i.accentColor];
|
|
9626
9751
|
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);
|
|
9627
9752
|
}, [i.accentColor]), l(() => {
|
|
9628
9753
|
document.documentElement.classList.toggle("reduced-motion", i.reducedMotion);
|
|
9629
9754
|
}, [i.reducedMotion]), l(() => {
|
|
9630
9755
|
let e = document.documentElement, t = d.borderRadius;
|
|
9631
|
-
e.style.fontSize = `${d.fontSize / 13 * 100}%`, e.style.setProperty("--font-ui",
|
|
9756
|
+
e.style.fontSize = `${d.fontSize / 13 * 100}%`, e.style.setProperty("--font-ui", fs[d.uiFont]), e.style.setProperty("--font-heading", fs[d.headingFont]), e.style.setProperty("--font-prose", fs[d.proseFont]), e.style.setProperty("--font-control", fs[d.controlFont]), e.style.setProperty("--font-label", fs[d.labelFont]), e.style.setProperty("--font-navigation", fs[d.navigationFont]), e.style.setProperty("--font-data", fs[d.dataFont]), e.style.setProperty("--font-code", fs[d.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", `${d.borderWidth}px`), e.style.setProperty("--ui-tracking", `${d.tracking}em`), e.style.setProperty("--ui-line-height", String(d.lineHeight)), e.style.setProperty("--ui-density", `${d.density}rem`);
|
|
9632
9757
|
}, [d]);
|
|
9633
|
-
let g = p(() =>
|
|
9758
|
+
let g = p(() => Cs(u, i.themeOverrides), [u, i.themeOverrides]), v = u in i.themeOverrides, y = !ws(d, g), b = s(() => {
|
|
9634
9759
|
m({ themeOverrides: {
|
|
9635
9760
|
...i.themeOverrides,
|
|
9636
9761
|
[u]: { ...d }
|
|
@@ -9754,7 +9879,7 @@ function ys({ children: e, storageKey: t = cs, initialSettings: n, forcedTheme:
|
|
|
9754
9879
|
}
|
|
9755
9880
|
//#endregion
|
|
9756
9881
|
//#region src/providers/ThemeProvider.tsx
|
|
9757
|
-
var
|
|
9882
|
+
var Es = {
|
|
9758
9883
|
dark: "",
|
|
9759
9884
|
light: "theme-light",
|
|
9760
9885
|
lightInverted: "theme-light-inverted",
|
|
@@ -9764,23 +9889,23 @@ var bs = {
|
|
|
9764
9889
|
cyberBrutalLight: "theme-cyber-brutal-light",
|
|
9765
9890
|
hashiTheme: "theme-hashi"
|
|
9766
9891
|
};
|
|
9767
|
-
function
|
|
9892
|
+
function Ds({ children: e }) {
|
|
9768
9893
|
let { resolvedTheme: t } = c(Mt);
|
|
9769
9894
|
return l(() => {
|
|
9770
9895
|
let e = document.documentElement;
|
|
9771
|
-
Object.values(
|
|
9896
|
+
Object.values(Es).forEach((t) => {
|
|
9772
9897
|
t && e.classList.remove(t);
|
|
9773
9898
|
});
|
|
9774
|
-
let n =
|
|
9899
|
+
let n = Es[t];
|
|
9775
9900
|
n && e.classList.add(n);
|
|
9776
|
-
}, [t]), /* @__PURE__ */ _(
|
|
9901
|
+
}, [t]), /* @__PURE__ */ _(os.Provider, {
|
|
9777
9902
|
value: { theme: t },
|
|
9778
9903
|
children: e
|
|
9779
9904
|
});
|
|
9780
9905
|
}
|
|
9781
9906
|
//#endregion
|
|
9782
9907
|
//#region src/components/ui/FormField.tsx
|
|
9783
|
-
function
|
|
9908
|
+
function Os({ id: e, label: t, hint: n, error: r, required: i, optionalLabel: a, children: o, className: s, ...c }) {
|
|
9784
9909
|
let l = u(), d = e ?? l, f = n ? `${d}-hint` : void 0, p = r ? `${d}-error` : void 0, m = {
|
|
9785
9910
|
id: d,
|
|
9786
9911
|
"aria-describedby": Rn(f, p),
|
|
@@ -9825,13 +9950,13 @@ function Ss({ id: e, label: t, hint: n, error: r, required: i, optionalLabel: a,
|
|
|
9825
9950
|
})
|
|
9826
9951
|
});
|
|
9827
9952
|
}
|
|
9828
|
-
function
|
|
9953
|
+
function ks({ className: e, ...t }) {
|
|
9829
9954
|
return /* @__PURE__ */ _("p", {
|
|
9830
9955
|
...t,
|
|
9831
9956
|
className: G("text-text-secondary text-xs", e)
|
|
9832
9957
|
});
|
|
9833
9958
|
}
|
|
9834
|
-
function
|
|
9959
|
+
function As({ className: e, ...t }) {
|
|
9835
9960
|
return /* @__PURE__ */ _("p", {
|
|
9836
9961
|
...t,
|
|
9837
9962
|
className: G("text-red text-xs", e)
|
|
@@ -9839,7 +9964,7 @@ function ws({ className: e, ...t }) {
|
|
|
9839
9964
|
}
|
|
9840
9965
|
//#endregion
|
|
9841
9966
|
//#region src/components/ui/Fieldset.tsx
|
|
9842
|
-
function
|
|
9967
|
+
function js({ id: e, legend: t, hint: n, error: r, children: i, className: a, "aria-describedby": o, ...s }) {
|
|
9843
9968
|
let c = u(), l = e ?? c, d = n ? `${l}-hint` : void 0, f = r ? `${l}-error` : void 0, p = Rn(o, d, f);
|
|
9844
9969
|
return /* @__PURE__ */ v("fieldset", {
|
|
9845
9970
|
...s,
|
|
@@ -9873,7 +9998,7 @@ function Ts({ id: e, legend: t, hint: n, error: r, children: i, className: a, "a
|
|
|
9873
9998
|
}
|
|
9874
9999
|
//#endregion
|
|
9875
10000
|
//#region src/components/ui/Radio.tsx
|
|
9876
|
-
var
|
|
10001
|
+
var Ms = a(({ label: e, description: t, controlSize: n, className: r, id: i, "aria-describedby": a, "aria-invalid": o, ...s }, l) => {
|
|
9877
10002
|
let d = u(), f = an(n), p = c(Ln), m = i ?? p?.id ?? d, h = t ? `${m}-description` : void 0;
|
|
9878
10003
|
return /* @__PURE__ */ v("label", {
|
|
9879
10004
|
className: G("ui-choice flex items-start gap-2.5", r),
|
|
@@ -9896,14 +10021,14 @@ var Es = a(({ label: e, description: t, controlSize: n, className: r, id: i, "ar
|
|
|
9896
10021
|
})]
|
|
9897
10022
|
});
|
|
9898
10023
|
});
|
|
9899
|
-
|
|
9900
|
-
function
|
|
10024
|
+
Ms.displayName = "Radio";
|
|
10025
|
+
function Ns({ name: e, id: t, options: n, value: r, onChange: i, required: a, disabled: o, controlSize: s, ...c }) {
|
|
9901
10026
|
let l = u(), d = t ?? l;
|
|
9902
|
-
return /* @__PURE__ */ _(
|
|
10027
|
+
return /* @__PURE__ */ _(js, {
|
|
9903
10028
|
...c,
|
|
9904
10029
|
id: d,
|
|
9905
10030
|
disabled: o,
|
|
9906
|
-
children: n.map((t, n) => /* @__PURE__ */ _(
|
|
10031
|
+
children: n.map((t, n) => /* @__PURE__ */ _(Ms, {
|
|
9907
10032
|
id: `${d}-${n}`,
|
|
9908
10033
|
name: e ?? d,
|
|
9909
10034
|
value: t.value,
|
|
@@ -9917,17 +10042,17 @@ function Ds({ name: e, id: t, options: n, value: r, onChange: i, required: a, di
|
|
|
9917
10042
|
}, t.value))
|
|
9918
10043
|
});
|
|
9919
10044
|
}
|
|
9920
|
-
var
|
|
10045
|
+
var Ps = Object.assign(Ms, { Group: Ns }), Fs = {
|
|
9921
10046
|
pending: "Pending",
|
|
9922
10047
|
uploading: "Uploading",
|
|
9923
10048
|
processing: "Processing",
|
|
9924
10049
|
ready: "Ready",
|
|
9925
10050
|
error: "Upload failed"
|
|
9926
10051
|
};
|
|
9927
|
-
function
|
|
10052
|
+
function Is(e) {
|
|
9928
10053
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
9929
10054
|
}
|
|
9930
|
-
function
|
|
10055
|
+
function Ls({ name: e, size: t, status: n = "ready", statusLabel: r, error: i, onRetry: a, onRemove: o, onDownload: s, downloadHref: c, actionsDisabled: l, className: u, ...d }) {
|
|
9931
10056
|
return /* @__PURE__ */ v("li", {
|
|
9932
10057
|
...d,
|
|
9933
10058
|
className: G("ui-attachment-item border-border flex items-center justify-between gap-3 rounded-md border p-3", u),
|
|
@@ -9940,7 +10065,7 @@ function js({ name: e, size: t, status: n = "ready", statusLabel: r, error: i, o
|
|
|
9940
10065
|
}),
|
|
9941
10066
|
t !== void 0 && /* @__PURE__ */ _("p", {
|
|
9942
10067
|
className: "text-text-tertiary text-2xs",
|
|
9943
|
-
children:
|
|
10068
|
+
children: Is(t)
|
|
9944
10069
|
}),
|
|
9945
10070
|
/* @__PURE__ */ v("div", {
|
|
9946
10071
|
role: "status",
|
|
@@ -9949,7 +10074,7 @@ function js({ name: e, size: t, status: n = "ready", statusLabel: r, error: i, o
|
|
|
9949
10074
|
children: [
|
|
9950
10075
|
e,
|
|
9951
10076
|
": ",
|
|
9952
|
-
i ?? r ??
|
|
10077
|
+
i ?? r ?? Fs[n]
|
|
9953
10078
|
]
|
|
9954
10079
|
})
|
|
9955
10080
|
]
|
|
@@ -9991,7 +10116,7 @@ function js({ name: e, size: t, status: n = "ready", statusLabel: r, error: i, o
|
|
|
9991
10116
|
})]
|
|
9992
10117
|
});
|
|
9993
10118
|
}
|
|
9994
|
-
function
|
|
10119
|
+
function Rs({ children: e, className: t, "aria-label": n = "Attachments", ...r }) {
|
|
9995
10120
|
return /* @__PURE__ */ _("ul", {
|
|
9996
10121
|
...r,
|
|
9997
10122
|
"aria-label": n,
|
|
@@ -10001,7 +10126,7 @@ function Ms({ children: e, className: t, "aria-label": n = "Attachments", ...r }
|
|
|
10001
10126
|
}
|
|
10002
10127
|
//#endregion
|
|
10003
10128
|
//#region src/lib/dateParts.ts
|
|
10004
|
-
function
|
|
10129
|
+
function zs(e, { required: t = !1, minYear: n = 1900, maxYear: r = 2100 } = {}) {
|
|
10005
10130
|
let i = [
|
|
10006
10131
|
e.day,
|
|
10007
10132
|
e.month,
|
|
@@ -10031,10 +10156,10 @@ function Ns(e, { required: t = !1, minYear: n = 1900, maxYear: r = 2100 } = {})
|
|
|
10031
10156
|
}
|
|
10032
10157
|
//#endregion
|
|
10033
10158
|
//#region src/components/ui/DatePartsInput.tsx
|
|
10034
|
-
function
|
|
10159
|
+
function Bs({ value: e, onChange: t, label: n, hint: r, error: i, id: a, name: o, disabled: s, required: c, className: d, inputProps: f, minYear: p = 1900, maxYear: g = 2100 }) {
|
|
10035
10160
|
let y = u(), b = m({}), [x, S] = h(!1);
|
|
10036
10161
|
if (!Number.isInteger(p) || !Number.isInteger(g) || p < 1 || g > 9999 || p > g) throw RangeError("DatePartsInput requires year bounds between 1 and 9999, with minYear <= maxYear");
|
|
10037
|
-
let C =
|
|
10162
|
+
let C = zs(e, {
|
|
10038
10163
|
required: c,
|
|
10039
10164
|
minYear: p,
|
|
10040
10165
|
maxYear: g
|
|
@@ -10083,7 +10208,7 @@ function Ps({ value: e, onChange: t, label: n, hint: r, error: i, id: a, name: o
|
|
|
10083
10208
|
"year"
|
|
10084
10209
|
].map((n) => /* @__PURE__ */ v("div", {
|
|
10085
10210
|
className: "ui-date-part",
|
|
10086
|
-
children: [/* @__PURE__ */ _(
|
|
10211
|
+
children: [/* @__PURE__ */ _($o, {
|
|
10087
10212
|
inputMode: "numeric",
|
|
10088
10213
|
"data-1p-ignore": "true",
|
|
10089
10214
|
...f?.[n],
|
|
@@ -10150,7 +10275,7 @@ function Ps({ value: e, onChange: t, label: n, hint: r, error: i, id: a, name: o
|
|
|
10150
10275
|
}
|
|
10151
10276
|
//#endregion
|
|
10152
10277
|
//#region src/components/ui/Skeleton.tsx
|
|
10153
|
-
function
|
|
10278
|
+
function Vs({ className: e, width: t, height: n, style: r, ...i }) {
|
|
10154
10279
|
return /* @__PURE__ */ _("div", {
|
|
10155
10280
|
...i,
|
|
10156
10281
|
"aria-hidden": "true",
|
|
@@ -10164,7 +10289,7 @@ function Fs({ className: e, width: t, height: n, style: r, ...i }) {
|
|
|
10164
10289
|
}
|
|
10165
10290
|
//#endregion
|
|
10166
10291
|
//#region src/components/ui/NavTabs.tsx
|
|
10167
|
-
function
|
|
10292
|
+
function Hs({ items: e, activeKey: t, renderLink: n, className: r, "aria-label": i = "Sections", ...a }) {
|
|
10168
10293
|
return /* @__PURE__ */ _("nav", {
|
|
10169
10294
|
...a,
|
|
10170
10295
|
"aria-label": i,
|
|
@@ -10188,7 +10313,7 @@ function Is({ items: e, activeKey: t, renderLink: n, className: r, "aria-label":
|
|
|
10188
10313
|
}
|
|
10189
10314
|
//#endregion
|
|
10190
10315
|
//#region src/components/ui/CharacterCount.tsx
|
|
10191
|
-
function
|
|
10316
|
+
function Us({ value: e, maxLength: t, announcementDelay: n = 1e3, className: r, ...i }) {
|
|
10192
10317
|
let a = t - e.length, o = Math.abs(a), s = `${o} ${o === 1 ? "character" : "characters"} ${a < 0 ? "over the limit" : "remaining"}`, [c, u] = h(s);
|
|
10193
10318
|
return l(() => {
|
|
10194
10319
|
let e = setTimeout(() => u(s), n);
|
|
@@ -10210,7 +10335,7 @@ function Ls({ value: e, maxLength: t, announcementDelay: n = 1e3, className: r,
|
|
|
10210
10335
|
}
|
|
10211
10336
|
//#endregion
|
|
10212
10337
|
//#region src/providers/ControlSizeProvider.tsx
|
|
10213
|
-
function
|
|
10338
|
+
function Ws({ size: e, children: t }) {
|
|
10214
10339
|
return /* @__PURE__ */ _(rn.Provider, {
|
|
10215
10340
|
value: e,
|
|
10216
10341
|
children: t
|
|
@@ -10218,7 +10343,7 @@ function Rs({ size: e, children: t }) {
|
|
|
10218
10343
|
}
|
|
10219
10344
|
//#endregion
|
|
10220
10345
|
//#region src/components/ui/ProgressBar.tsx
|
|
10221
|
-
var
|
|
10346
|
+
var Gs = a(function({ label: e, value: t, min: n = 0, max: r = 100, color: i = "accent", striped: a = !1, animated: o = !1, id: s, className: c, ...l }, d) {
|
|
10222
10347
|
let f = u(), p = s ?? f;
|
|
10223
10348
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) throw RangeError("ProgressBar requires a finite max greater than min");
|
|
10224
10349
|
if (t !== void 0 && !Number.isFinite(t)) throw RangeError("ProgressBar value must be finite");
|
|
@@ -10255,4 +10380,138 @@ var zs = a(function({ label: e, value: t, min: n = 0, max: r = 100, color: i = "
|
|
|
10255
10380
|
});
|
|
10256
10381
|
});
|
|
10257
10382
|
//#endregion
|
|
10258
|
-
|
|
10383
|
+
//#region src/components/ui/Stack.tsx
|
|
10384
|
+
function Ks({ as: e, gap: t = 0, align: n = "stretch", justify: r = "start", className: a, style: o, ...s }) {
|
|
10385
|
+
return i(e ?? "div", {
|
|
10386
|
+
...s,
|
|
10387
|
+
className: G("ui-stack", a),
|
|
10388
|
+
style: {
|
|
10389
|
+
...Ja(t),
|
|
10390
|
+
"--ui-align": Ya(n),
|
|
10391
|
+
"--ui-justify": Xa(r),
|
|
10392
|
+
...o
|
|
10393
|
+
}
|
|
10394
|
+
});
|
|
10395
|
+
}
|
|
10396
|
+
//#endregion
|
|
10397
|
+
//#region src/components/ui/Inline.tsx
|
|
10398
|
+
function qs({ as: e, gap: t = 0, gapX: n, gapY: r, align: a = "stretch", justify: o = "start", wrap: s = !1, inline: c = !1, stackBelow: l, className: u, style: d, ...f }) {
|
|
10399
|
+
return i(e ?? "div", {
|
|
10400
|
+
...f,
|
|
10401
|
+
className: G("ui-inline", u),
|
|
10402
|
+
style: {
|
|
10403
|
+
...Ja(t, n, r),
|
|
10404
|
+
"--ui-align": Ya(a),
|
|
10405
|
+
"--ui-justify": Xa(o),
|
|
10406
|
+
"--ui-wrap": s ? "wrap" : "nowrap",
|
|
10407
|
+
"--ui-display": c ? "inline-flex" : "flex",
|
|
10408
|
+
...Ka("direction", l ? {
|
|
10409
|
+
base: "column",
|
|
10410
|
+
[l]: "row"
|
|
10411
|
+
} : "row", (e) => e, "row"),
|
|
10412
|
+
...d
|
|
10413
|
+
}
|
|
10414
|
+
});
|
|
10415
|
+
}
|
|
10416
|
+
//#endregion
|
|
10417
|
+
//#region src/components/ui/Grid.tsx
|
|
10418
|
+
function Js({ as: e, columns: t = 1, gap: n = 0, gapX: r, gapY: a, align: o = "stretch", justify: s = "stretch", className: c, style: l, ...u }) {
|
|
10419
|
+
return i(e ?? "div", {
|
|
10420
|
+
...u,
|
|
10421
|
+
className: G("ui-grid", c),
|
|
10422
|
+
style: {
|
|
10423
|
+
...Ja(n, r, a),
|
|
10424
|
+
...Ka("columns", t, qa, 1),
|
|
10425
|
+
"--ui-align": o,
|
|
10426
|
+
"--ui-justify": s,
|
|
10427
|
+
...l
|
|
10428
|
+
}
|
|
10429
|
+
});
|
|
10430
|
+
}
|
|
10431
|
+
//#endregion
|
|
10432
|
+
//#region src/components/ui/GridItem.tsx
|
|
10433
|
+
function Ys({ as: e, span: t = 1, className: n, style: r, ...a }) {
|
|
10434
|
+
return i(e ?? "div", {
|
|
10435
|
+
...a,
|
|
10436
|
+
className: G("ui-grid-item", n),
|
|
10437
|
+
style: {
|
|
10438
|
+
...Ka("span", t, (e) => `span ${e} / span ${e}`, 1),
|
|
10439
|
+
...r
|
|
10440
|
+
}
|
|
10441
|
+
});
|
|
10442
|
+
}
|
|
10443
|
+
//#endregion
|
|
10444
|
+
//#region src/components/tables/Table.tsx
|
|
10445
|
+
function Xs({ caption: e, captionHidden: t = !1, stickyHeader: n = !1, maxHeight: r, wrapperClassName: i, wrapperProps: a, className: o, children: s, ...c }) {
|
|
10446
|
+
return /* @__PURE__ */ _("div", {
|
|
10447
|
+
...a,
|
|
10448
|
+
className: G("ui-table-wrap", a?.className, i),
|
|
10449
|
+
style: {
|
|
10450
|
+
maxHeight: r,
|
|
10451
|
+
...r ? { overflow: "auto" } : {},
|
|
10452
|
+
...a?.style
|
|
10453
|
+
},
|
|
10454
|
+
children: /* @__PURE__ */ v("table", {
|
|
10455
|
+
...c,
|
|
10456
|
+
className: G("ui-table", n && "ui-table-sticky", o),
|
|
10457
|
+
children: [e != null && /* @__PURE__ */ _("caption", {
|
|
10458
|
+
className: G(t && "sr-only"),
|
|
10459
|
+
children: e
|
|
10460
|
+
}), s]
|
|
10461
|
+
})
|
|
10462
|
+
});
|
|
10463
|
+
}
|
|
10464
|
+
function Zs({ className: e, ...t }) {
|
|
10465
|
+
return /* @__PURE__ */ _("thead", {
|
|
10466
|
+
...t,
|
|
10467
|
+
className: G("ui-table-head", e)
|
|
10468
|
+
});
|
|
10469
|
+
}
|
|
10470
|
+
function Qs({ className: e, ...t }) {
|
|
10471
|
+
return /* @__PURE__ */ _("tbody", {
|
|
10472
|
+
...t,
|
|
10473
|
+
className: G("ui-table-body", e)
|
|
10474
|
+
});
|
|
10475
|
+
}
|
|
10476
|
+
function $s({ selected: e, interactive: t = !1, className: n, ...r }) {
|
|
10477
|
+
return /* @__PURE__ */ _("tr", {
|
|
10478
|
+
...r,
|
|
10479
|
+
"aria-selected": e ?? r["aria-selected"],
|
|
10480
|
+
className: G("ui-table-row", t && "ui-table-interactive", n)
|
|
10481
|
+
});
|
|
10482
|
+
}
|
|
10483
|
+
function ec({ numeric: e = !1, align: t, sort: n, scope: r = "col", className: i, style: a, ...o }) {
|
|
10484
|
+
return /* @__PURE__ */ _("th", {
|
|
10485
|
+
...o,
|
|
10486
|
+
scope: r,
|
|
10487
|
+
"aria-sort": n ?? o["aria-sort"],
|
|
10488
|
+
className: G("ui-table-header-cell", e && "ui-table-numeric", i),
|
|
10489
|
+
style: {
|
|
10490
|
+
...t ? { textAlign: t } : {},
|
|
10491
|
+
...a
|
|
10492
|
+
}
|
|
10493
|
+
});
|
|
10494
|
+
}
|
|
10495
|
+
function tc({ numeric: e = !1, align: t, nowrap: n = !1, className: r, style: i, ...a }) {
|
|
10496
|
+
return /* @__PURE__ */ _("td", {
|
|
10497
|
+
...a,
|
|
10498
|
+
className: G("ui-table-cell", e && "ui-table-numeric", n && "ui-table-nowrap", r),
|
|
10499
|
+
style: {
|
|
10500
|
+
...t ? { textAlign: t } : {},
|
|
10501
|
+
...i
|
|
10502
|
+
}
|
|
10503
|
+
});
|
|
10504
|
+
}
|
|
10505
|
+
function nc({ colSpan: e, children: t, className: n, ...r }) {
|
|
10506
|
+
return /* @__PURE__ */ _("tr", {
|
|
10507
|
+
...r,
|
|
10508
|
+
className: G("ui-table-empty-row", n),
|
|
10509
|
+
children: /* @__PURE__ */ _("td", {
|
|
10510
|
+
colSpan: e,
|
|
10511
|
+
className: "ui-table-empty-cell",
|
|
10512
|
+
children: t
|
|
10513
|
+
})
|
|
10514
|
+
});
|
|
10515
|
+
}
|
|
10516
|
+
//#endregion
|
|
10517
|
+
export { qn as Alert, Pn as AppShell, He as AreaChart, Ls as AttachmentItem, Rs as AttachmentList, Jn as AuthCard, Fn as AuthLayout, Yn as AuthorByline, Lt as Avatar, In as BackLink, Qn as Badge, Ge as BarChart, ut as BottomNav, tn as Breadcrumbs, fn as Button, pt as COMMAND_PALETTE_EVENT, Bi as Calendar, qi as CalendarGrid, Ji as Card, Us as CharacterCount, zn as Checkbox, ea as CodeInput, Hn as ColumnPicker, ta as Combobox, vt as CommandPalette, Ws as ControlSizeProvider, ji as DEFAULT_CALENDAR_LABELS, mt as DEFAULT_COMMAND_PALETTE_SHORTCUT, na as DangerZone, Bs as DatePartsInput, ia as DatePicker, ca as DateRangePicker, ma as DateTimePicker, ya as DetailPanel, Ia as Dialog, La as DialogActions, Ra as DividerLabel, qe as DonutChart, za as DropdownMenu, Ba as EmptyState, Va as ErrorBoundary, As as FieldError, ks as FieldHint, js as Fieldset, Bn as FilterButton, Ha as FilterDropdown, Os as FormField, Js as Grid, Ys as GridItem, qs as Inline, Ua as Kbd, Ga as LoadingSpinner, Za as MetadataGrid, Qa as MetricCard, bt as MobileDrawer, Hs as NavTabs, ro as OAuthButton, io as PageHeader, ao as PageSection, Un as Pagination, so as PaginationBar, lo as PasswordInput, po as PasswordRequirements, mo as ProfileHeader, Gs as ProgressBar, ho as ProseContent, go as QrCapacityError, zo as QrCode, Je as RadarChart, Ye as RadialBarChart, Ps as Radio, Mi as RadioPill, Gn as ResourceTable, Bo as SearchInput, pn as SectionHeader, Vo as Select, xn as SelectDropdown, Ho as SettingRow, Mt as SettingsContext, Ts as SettingsProvider, Uo as SideSheet, $t as Sidebar, Vs as Skeleton, Sn as Slider, Xe as SparkLine, Ko as SplitPaneLayout, Ks as Stack, rt as StackedBarChart, Yo as StatusDot, Xo as StepProgress, Tn as THEME_MENU_EVENT, Xs as Table, Qs as TableBody, tc as TableCell, nc as TableEmptyRow, Zs as TableHead, ec as TableHeaderCell, $s as TableRow, Zo as Tabs, $o as TextInput, Qo as Textarea, os as ThemeContext, On as ThemeMenu, Cn as ThemePreview, Ds as ThemeProvider, es as Timeline, Bt as ToastProvider, wn as Toggle, is as Toolbar, rs as Tooltip, Mn as TopBar, as as UploadDropzone, ot as VerticalBarChart, At as accentItems, Q as addDays, or as addMinutes, sr as addMonths, tr as calendarDateFromParts, Z as calendarDateParts, G as cn, Xr as createCalendarDateMath, Tt as darkThemes, mr as dateAtMinutes, uo as defaultPasswordRequirements, dr as differenceInDays, Ro as encodeQrCode, Ur as expandAvailabilityRules, kt as fontOptions, us as formatDateLong, ls as formatDateShort, Mr as formatRangeTitle, ds as formatRelative, Or as formatTime, gr as formatTimeOfDay, kr as formatTimeRange, vr as fromDateKey, Hr as getActiveResourceIds, wr as getViewRange, Sr as getVisibleDays, ct as handleAppShellNavigate, Yr as isAllDayLike, st as isAppShellPathActive, Ct as isLightTheme, ur as isSameDay, xr as isTimeGridView, Lr as layoutOverlaps, wt as lightThemes, gt as matchesCommandPaletteShortcut, fo as meetsPasswordRequirements, fr as minutesOfDay, lt as navigateToPath, ht as openCommandPalette, En as openThemeMenu, hr as parseTime, Nr as rangesOverlap, Tr as shiftDate, br as snapDate, yr as snapMinutes, Wn as sortRows, ar as startOfDay, lr as startOfMonth, cr as startOfWeek, Ot as themeDefaults, xt as themeItems, _r as toDateKey, nn as useApplyTheme, an as useControlSize, jt as useDismiss, ft as useFocusTrap, Nt as useSettings, ss as useTheme, zt as useToast };
|