@viglet/viglet-design-system 2026.3.17 → 2026.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -17
- package/dist/bento/bento-calendar.d.ts.map +1 -1
- package/dist/bento/bento-change-cell.d.ts +22 -0
- package/dist/bento/bento-change-cell.d.ts.map +1 -0
- package/dist/bento/bento-data-table.d.ts +12 -2
- package/dist/bento/bento-data-table.d.ts.map +1 -1
- package/dist/bento/bento-diff.d.ts.map +1 -1
- package/dist/bento/bento-filter-bar.d.ts.map +1 -1
- package/dist/bento/bento-identity-cell.d.ts +22 -0
- package/dist/bento/bento-identity-cell.d.ts.map +1 -0
- package/dist/bento/bento-inline-edit.d.ts.map +1 -1
- package/dist/bento/bento-list-page.d.ts +24 -5
- package/dist/bento/bento-list-page.d.ts.map +1 -1
- package/dist/bento/bento-shell.d.ts.map +1 -1
- package/dist/bento/index.d.ts +3 -1
- package/dist/bento/index.d.ts.map +1 -1
- package/dist/bento.cjs +4 -4
- package/dist/bento.es.js +1263 -1097
- package/dist/catalogue.json +111 -3
- package/dist/exports.json +8 -1
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en/bento.json.d.ts +3 -0
- package/dist/i18n/locales/pt/bento.json.d.ts +3 -0
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.es.js +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +966 -1039
- package/dist/user.context-BqsOcMaZ.cjs +1 -0
- package/dist/{user.context-TpXsFyGy.js → user.context-vCmnGlIb.js} +327 -254
- package/dist/viglet-design-system.css +1 -1
- package/package.json +1 -1
- package/dist/user.context-DDPB1fax.cjs +0 -1
package/dist/bento.es.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "./utils-Fk5jmzzb.js";
|
|
3
3
|
import { a as t, c as n, d as r, g as i, o as a, p as o, u as s } from "./badge-locale-BwsfyQJT.js";
|
|
4
|
-
import {
|
|
4
|
+
import { $ as c, B as l, C as u, D as d, E as f, F as p, G as m, H as h, I as g, K as _, L as v, O as y, Q as b, R as x, S, V as C, W as w, Z as T, b as E, c as D, g as O, h as k, i as A, j, k as M, l as N, m as P, n as F, o as ee, p as te, r as I, s as L, u as ne, v as R, w as z, x as B, y as re, z as ie } from "./user.context-vCmnGlIb.js";
|
|
5
5
|
import { r as ae, t as oe } from "./loading-provider-Dh7jdSol.js";
|
|
6
|
-
import { Children as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import { IconAdjustmentsHorizontal as
|
|
10
|
-
import { Icon as
|
|
11
|
-
import { useDefaultLayout as
|
|
12
|
-
import { Link as
|
|
13
|
-
import { createCoreRowModel as
|
|
14
|
-
import { DndContext as
|
|
15
|
-
import { SortableContext as
|
|
16
|
-
import { CSS as
|
|
6
|
+
import { Children as se, Fragment as ce, isValidElement as le, useCallback as ue, useEffect as V, useId as H, useLayoutEffect as de, useMemo as fe, useRef as U, useState as W, useSyncExternalStore as pe } from "react";
|
|
7
|
+
import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
8
|
+
import { useTranslation as J } from "react-i18next";
|
|
9
|
+
import { IconAdjustmentsHorizontal as Y, IconAlertTriangle as me, IconArrowBackUp as he, IconArrowDown as ge, IconArrowLeft as _e, IconArrowRight as X, IconArrowUp as ve, IconArrowsSort as ye, IconBuildingCommunity as be, IconBuildingSkyscraper as xe, IconChevronDown as Se, IconChevronLeft as Ce, IconChevronRight as we, IconColumns3 as Te, IconDeviceFloppy as Ee, IconDotsVertical as De, IconExternalLink as Oe, IconGripVertical as ke, IconHome as Ae, IconKeyboard as je, IconLayoutGrid as Me, IconList as Ne, IconLogout as Pe, IconPalette as Fe, IconPlus as Z, IconRobot as Ie, IconSearch as Le, IconSparkles as Re, IconTrash as ze, IconUser as Be, IconUserCircle as Ve, IconUsers as He, IconX as Ue } from "@tabler/icons-react";
|
|
10
|
+
import { Icon as We } from "@iconify/react";
|
|
11
|
+
import { useDefaultLayout as Ge } from "react-resizable-panels";
|
|
12
|
+
import { Link as Ke, useInRouterContext as qe, useLocation as Je, useNavigate as Ye } from "react-router-dom";
|
|
13
|
+
import { createCoreRowModel as Xe, createSortedRowModel as Ze, rowSortingFeature as Qe, useTable as $e } from "@tanstack/react-table";
|
|
14
|
+
import { DndContext as et, KeyboardSensor as tt, PointerSensor as nt, closestCenter as rt, useSensor as it, useSensors as at } from "@dnd-kit/core";
|
|
15
|
+
import { SortableContext as ot, arrayMove as st, rectSortingStrategy as ct, useSortable as lt } from "@dnd-kit/sortable";
|
|
16
|
+
import { CSS as ut } from "@dnd-kit/utilities";
|
|
17
17
|
//#region src/bento/bento-actions-menu.tsx
|
|
18
|
-
var
|
|
18
|
+
var dt = {
|
|
19
19
|
default: "",
|
|
20
20
|
destructive: "bento-item-danger"
|
|
21
|
-
},
|
|
22
|
-
function
|
|
23
|
-
process.env.NODE_ENV === "production" ||
|
|
21
|
+
}, ft = /* @__PURE__ */ new Set();
|
|
22
|
+
function pt(e) {
|
|
23
|
+
process.env.NODE_ENV === "production" || ft.has(e) || (ft.add(e), console.warn(`BentoActionsMenu: the action "${e}" has no id. Give it a stable name, such as "post.delete": it is rendered as data-action-id so a console verb can be matched to an agent verb, and it becomes required in the next release.`));
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
let { t: n } =
|
|
25
|
+
function mt({ actions: e, triggerLabel: t }) {
|
|
26
|
+
let { t: n } = J();
|
|
27
27
|
if (e.length === 0) return null;
|
|
28
|
-
for (let t of e) t.id ||
|
|
29
|
-
return /* @__PURE__ */
|
|
28
|
+
for (let t of e) t.id || pt(t.label);
|
|
29
|
+
return /* @__PURE__ */ q(v, { children: [/* @__PURE__ */ K(T, {
|
|
30
30
|
asChild: !0,
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ K("button", {
|
|
32
32
|
type: "button",
|
|
33
33
|
"aria-label": t ?? n("forms.formActions.moreActions", { defaultValue: "More actions" }),
|
|
34
34
|
className: "bento-tile-clickable inline-flex size-(--vg-control-form) items-center justify-center rounded-full border border-border/60 bg-card/60 text-muted-foreground backdrop-blur transition-colors duration-200 hover:text-foreground",
|
|
35
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ K(De, { size: 18 })
|
|
36
36
|
})
|
|
37
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ K(ie, {
|
|
38
38
|
align: "end",
|
|
39
39
|
sideOffset: 8,
|
|
40
40
|
className: "bento-dropdown min-w-44 p-1.5",
|
|
41
41
|
children: e.map((e) => {
|
|
42
|
-
let t = e.icon, n =
|
|
43
|
-
return /* @__PURE__ */
|
|
42
|
+
let t = e.icon, n = dt[e.tone ?? "default"];
|
|
43
|
+
return /* @__PURE__ */ q(C, {
|
|
44
44
|
"data-action-id": e.id,
|
|
45
45
|
onSelect: e.onSelect,
|
|
46
46
|
disabled: e.disabled,
|
|
47
47
|
className: `bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${n}`,
|
|
48
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ K(t, { size: 16 }), e.label]
|
|
49
49
|
}, e.id ?? e.label);
|
|
50
50
|
})
|
|
51
51
|
})] });
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region src/bento/bento-tones.ts
|
|
55
|
-
var
|
|
55
|
+
var ht = {
|
|
56
56
|
blue: "bento-tone-blue",
|
|
57
57
|
indigo: "bento-tone-indigo",
|
|
58
58
|
violet: "bento-tone-violet",
|
|
@@ -60,143 +60,194 @@ var dt = {
|
|
|
60
60
|
amber: "bento-tone-amber",
|
|
61
61
|
rose: "bento-tone-rose",
|
|
62
62
|
slate: "bento-tone-slate"
|
|
63
|
-
},
|
|
64
|
-
function
|
|
65
|
-
return `bento-chip ${
|
|
63
|
+
}, gt = Object.keys(ht);
|
|
64
|
+
function _t(e) {
|
|
65
|
+
return `bento-chip ${ht[e] ?? ht.slate}`;
|
|
66
66
|
}
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/bento/bento-count-tile.tsx
|
|
69
|
-
function
|
|
70
|
-
let o = /* @__PURE__ */
|
|
71
|
-
className: `grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
}), /* @__PURE__ */
|
|
69
|
+
function vt({ to: e, icon: t, tone: n, label: r, count: i, span: a }) {
|
|
70
|
+
let o = /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("span", {
|
|
71
|
+
className: `grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${_t(n)}`,
|
|
72
|
+
children: /* @__PURE__ */ K(t, { size: 18 })
|
|
73
|
+
}), /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("div", {
|
|
74
74
|
className: "text-3xl font-semibold tabular-nums tracking-tight",
|
|
75
75
|
children: i
|
|
76
|
-
}), /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ K("div", {
|
|
77
77
|
className: "text-[11px] uppercase tracking-wider text-muted-foreground",
|
|
78
78
|
children: r
|
|
79
79
|
})] })] }), s = `bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${a}${e ? " bento-tile-clickable" : ""}`;
|
|
80
|
-
return e ? /* @__PURE__ */
|
|
80
|
+
return e ? /* @__PURE__ */ K(Ke, {
|
|
81
81
|
to: e,
|
|
82
82
|
className: s,
|
|
83
83
|
children: o
|
|
84
|
-
}) : /* @__PURE__ */
|
|
84
|
+
}) : /* @__PURE__ */ K("div", {
|
|
85
85
|
className: s,
|
|
86
86
|
children: o
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/bento/bento-data-table.tsx
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
var yt = 6;
|
|
92
|
+
function bt(e) {
|
|
93
|
+
for (let t = e.parentElement; t && t !== document.body; t = t.parentElement) {
|
|
94
|
+
let { overflowY: e } = getComputedStyle(t);
|
|
95
|
+
if (e === "auto" || e === "scroll") return t;
|
|
96
|
+
}
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
function xt(e) {
|
|
100
|
+
if (e) {
|
|
101
|
+
let { top: t, bottom: n } = e.getBoundingClientRect();
|
|
102
|
+
return {
|
|
103
|
+
top: t,
|
|
104
|
+
bottom: n
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
top: 0,
|
|
109
|
+
bottom: window.innerHeight
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
var St = {
|
|
113
|
+
rowSortingFeature: Qe,
|
|
114
|
+
coreRowModel: Xe(),
|
|
115
|
+
sortedRowModel: Ze()
|
|
95
116
|
};
|
|
96
|
-
function
|
|
97
|
-
let { t:
|
|
98
|
-
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
-
let I =
|
|
102
|
-
|
|
103
|
-
I.current !==
|
|
104
|
-
}, [
|
|
105
|
-
let [L, ne] =
|
|
117
|
+
function Ct({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowActions: o, selectionActions: s, selectedIds: l, onSelectionChange: u, selectionScope: d, layout: f, onLayoutChange: p, onRowOpen: m, rowHeight: h = 44, height: g, empty: _, toolbar: y }) {
|
|
118
|
+
let { t: S } = J(), [C, w] = W([]), [E, D] = W({ hidden: [] }), [O, k] = W(/* @__PURE__ */ new Set()), [A, j] = W(null), [M, N] = W(d), [P, F] = W(void 0);
|
|
119
|
+
M !== d && (N(d), k(/* @__PURE__ */ new Set()), F(l), j(null));
|
|
120
|
+
let ee = fe(() => new Set(l ?? []), [l]), te = O;
|
|
121
|
+
l !== void 0 && (te = l === P ? /* @__PURE__ */ new Set() : ee);
|
|
122
|
+
let I = U(d);
|
|
123
|
+
V(() => {
|
|
124
|
+
I.current !== d && (I.current = d, u?.([]));
|
|
125
|
+
}, [d, u]);
|
|
126
|
+
let [L, ne] = W(0), [R, z] = W(0), B = g === void 0, [re, ae] = W(() => ({
|
|
127
|
+
size: typeof window > "u" ? 0 : window.innerHeight,
|
|
128
|
+
port: typeof window > "u" ? 0 : window.innerHeight
|
|
129
|
+
})), oe = U(null), se = U(null), ce = U(/* @__PURE__ */ new Map()), le = U(!1), H = (s?.length ?? 0) > 0, pe = (e) => a?.(e) ?? n(e), G = fe(() => r.map((e) => ({
|
|
106
130
|
id: e.id,
|
|
107
131
|
accessorFn: (t) => e.sortValue?.(t) ?? null,
|
|
108
132
|
enableSorting: e.sortValue !== void 0
|
|
109
|
-
})), [r]),
|
|
110
|
-
features:
|
|
133
|
+
})), [r]), Y = $e({
|
|
134
|
+
features: St,
|
|
111
135
|
data: t,
|
|
112
|
-
columns:
|
|
113
|
-
state: { sorting:
|
|
136
|
+
columns: G,
|
|
137
|
+
state: { sorting: C },
|
|
114
138
|
onSortingChange: w
|
|
115
|
-
}).getRowModel().rows.map((e) => e.original),
|
|
116
|
-
|
|
117
|
-
...
|
|
139
|
+
}).getRowModel().rows.map((e) => e.original), me = f ?? E, he = r.filter((e) => e.hideable === !1 || !me.hidden.includes(e.id)), _e = [
|
|
140
|
+
H ? "2.75rem" : null,
|
|
141
|
+
...he.map((e) => e.width ?? "minmax(8rem, 1fr)"),
|
|
118
142
|
o?.length ? "3.25rem" : null
|
|
119
|
-
].filter(Boolean).join(" "),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
143
|
+
].filter(Boolean).join(" "), X = Y.length, be = Math.min(B ? re.size : g, X * h), xe = Math.max(1, Math.floor((B ? re.port : be) / h)), Se = ue(() => {
|
|
144
|
+
let e = oe.current;
|
|
145
|
+
if (!e) return;
|
|
146
|
+
let t = e.getBoundingClientRect(), n = xt(bt(e)), r = Math.max(0, n.top - t.top);
|
|
147
|
+
z(r), ae({
|
|
148
|
+
size: Math.max(0, n.bottom - Math.max(t.top, n.top)),
|
|
149
|
+
port: n.bottom - n.top
|
|
150
|
+
});
|
|
151
|
+
}, []);
|
|
152
|
+
de(() => {
|
|
153
|
+
if (!B || !oe.current) return;
|
|
154
|
+
Se();
|
|
155
|
+
let e = bt(oe.current) ?? window;
|
|
156
|
+
return e.addEventListener("scroll", Se, { passive: !0 }), window.addEventListener("resize", Se), () => {
|
|
157
|
+
e.removeEventListener("scroll", Se), window.removeEventListener("resize", Se);
|
|
158
|
+
};
|
|
159
|
+
}, [
|
|
160
|
+
B,
|
|
161
|
+
Se,
|
|
162
|
+
X
|
|
163
|
+
]);
|
|
164
|
+
let Ce = Math.max(0, Math.floor(R / h) - yt), we = Math.min(X, Math.ceil((R + be) / h) + yt), Ee = Math.min(L, Math.max(0, X - 1));
|
|
165
|
+
V(() => {
|
|
166
|
+
le.current && (le.current = !1, ce.current.get(Ee)?.focus());
|
|
167
|
+
}, [Ee, Ce]);
|
|
168
|
+
function De(e) {
|
|
169
|
+
l === void 0 && k(e), u?.([...e]);
|
|
125
170
|
}
|
|
126
|
-
function
|
|
171
|
+
function Oe(e, t) {
|
|
127
172
|
let [r, i] = e <= t ? [e, t] : [t, e];
|
|
128
|
-
|
|
173
|
+
De(new Set(Y.slice(r, i + 1).map(n)));
|
|
129
174
|
}
|
|
130
|
-
function
|
|
131
|
-
let t = n(
|
|
132
|
-
r.has(t) ? r.delete(t) : r.add(t),
|
|
175
|
+
function ke(e) {
|
|
176
|
+
let t = n(Y[e]), r = new Set(te);
|
|
177
|
+
r.has(t) ? r.delete(t) : r.add(t), De(r), j(e);
|
|
133
178
|
}
|
|
134
|
-
function
|
|
135
|
-
let n = Math.max(0, Math.min(
|
|
136
|
-
if (t &&
|
|
137
|
-
let e =
|
|
138
|
-
|
|
179
|
+
function Ae(e, t) {
|
|
180
|
+
let n = Math.max(0, Math.min(X - 1, e));
|
|
181
|
+
if (t && H) {
|
|
182
|
+
let e = A ?? Ee;
|
|
183
|
+
j(e), Oe(e, n);
|
|
139
184
|
}
|
|
140
|
-
let r =
|
|
141
|
-
if (r) {
|
|
185
|
+
let r = oe.current, i = n * h;
|
|
186
|
+
if (r && B) {
|
|
187
|
+
let e = bt(r), t = xt(e), n = Math.max(t.top, se.current?.getBoundingClientRect().bottom ?? t.top), a = r.getBoundingClientRect().top + i, o = 0;
|
|
188
|
+
a < n ? o = a - n : a + h > t.bottom && (o = a + h - t.bottom), o !== 0 && ((e ?? window).scrollBy({
|
|
189
|
+
top: o,
|
|
190
|
+
behavior: "instant"
|
|
191
|
+
}), Se());
|
|
192
|
+
} else if (r) {
|
|
142
193
|
let e = r.scrollTop;
|
|
143
|
-
i < e ? e = i : i +
|
|
194
|
+
i < e ? e = i : i + h > e + be && (e = i + h - be), e !== r.scrollTop && (r.scrollTop = e, z(e));
|
|
144
195
|
}
|
|
145
|
-
|
|
196
|
+
le.current = !0, ne(n);
|
|
146
197
|
}
|
|
147
|
-
function
|
|
198
|
+
function je(e, t) {
|
|
148
199
|
if (e.target !== e.currentTarget) return;
|
|
149
200
|
let r = e.shiftKey;
|
|
150
201
|
switch (e.key) {
|
|
151
202
|
case "ArrowDown":
|
|
152
|
-
|
|
203
|
+
Ae(t + 1, r);
|
|
153
204
|
break;
|
|
154
205
|
case "ArrowUp":
|
|
155
|
-
|
|
206
|
+
Ae(t - 1, r);
|
|
156
207
|
break;
|
|
157
208
|
case "PageDown":
|
|
158
|
-
|
|
209
|
+
Ae(t + xe, r);
|
|
159
210
|
break;
|
|
160
211
|
case "PageUp":
|
|
161
|
-
|
|
212
|
+
Ae(t - xe, r);
|
|
162
213
|
break;
|
|
163
214
|
case "Home":
|
|
164
|
-
|
|
215
|
+
Ae(0, r);
|
|
165
216
|
break;
|
|
166
217
|
case "End":
|
|
167
|
-
|
|
218
|
+
Ae(X - 1, r);
|
|
168
219
|
break;
|
|
169
220
|
case " ":
|
|
170
|
-
if (!
|
|
171
|
-
|
|
221
|
+
if (!H) return;
|
|
222
|
+
ke(t);
|
|
172
223
|
break;
|
|
173
224
|
case "Enter":
|
|
174
|
-
if (!
|
|
175
|
-
|
|
225
|
+
if (!m) return;
|
|
226
|
+
m(Y[t]);
|
|
176
227
|
break;
|
|
177
228
|
case "Escape":
|
|
178
|
-
if (!
|
|
179
|
-
|
|
229
|
+
if (!H || te.size === 0) return;
|
|
230
|
+
De(/* @__PURE__ */ new Set()), j(null);
|
|
180
231
|
break;
|
|
181
232
|
case "a":
|
|
182
233
|
case "A":
|
|
183
|
-
if (!
|
|
184
|
-
|
|
234
|
+
if (!H || !(e.ctrlKey || e.metaKey)) return;
|
|
235
|
+
De(new Set(Y.map(n)));
|
|
185
236
|
break;
|
|
186
237
|
default: return;
|
|
187
238
|
}
|
|
188
239
|
e.preventDefault();
|
|
189
240
|
}
|
|
190
|
-
function
|
|
191
|
-
if (!e.target.closest("button, a, input, [role='checkbox']") && (ne(t),
|
|
241
|
+
function Me(e, t) {
|
|
242
|
+
if (!e.target.closest("button, a, input, [role='checkbox']") && (ne(t), H)) {
|
|
192
243
|
if (e.shiftKey) {
|
|
193
|
-
let e =
|
|
194
|
-
|
|
195
|
-
} else e.metaKey || e.ctrlKey ?
|
|
244
|
+
let e = A ?? Ee;
|
|
245
|
+
j(e), Oe(e, t);
|
|
246
|
+
} else e.metaKey || e.ctrlKey ? ke(t) : (De(/* @__PURE__ */ new Set([n(Y[t])])), j(t));
|
|
196
247
|
}
|
|
197
248
|
}
|
|
198
|
-
function
|
|
199
|
-
let t =
|
|
249
|
+
function Ne(e) {
|
|
250
|
+
let t = C.find((t) => t.id === e);
|
|
200
251
|
t ? t.desc ? w([]) : w([{
|
|
201
252
|
id: e,
|
|
202
253
|
desc: !0
|
|
@@ -205,204 +256,211 @@ function _t({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
205
256
|
desc: !1
|
|
206
257
|
}]);
|
|
207
258
|
}
|
|
208
|
-
function
|
|
209
|
-
let n = { hidden: t ? [...
|
|
210
|
-
f === void 0 &&
|
|
259
|
+
function Pe(e, t) {
|
|
260
|
+
let n = { hidden: t ? [...me.hidden, e] : me.hidden.filter((t) => t !== e) };
|
|
261
|
+
f === void 0 && D(n), p?.(n);
|
|
211
262
|
}
|
|
212
|
-
let
|
|
213
|
-
return /* @__PURE__ */
|
|
263
|
+
let Fe = r.filter((e) => e.hideable !== !1), Z = Y.filter((e) => te.has(n(e))), Ie = X > 0 && Z.length === X;
|
|
264
|
+
return /* @__PURE__ */ q("div", {
|
|
214
265
|
"data-slot": "bento-data-table",
|
|
215
|
-
className: "bento-glass overflow-
|
|
216
|
-
children: [/* @__PURE__ */
|
|
217
|
-
className: "flex min-h-12 flex-wrap items-center gap-2 border-b border-border/50 px-3 py-2",
|
|
266
|
+
className: "bento-glass overflow-clip rounded-2xl",
|
|
267
|
+
children: [/* @__PURE__ */ q("div", {
|
|
268
|
+
className: e("flex min-h-12 flex-wrap items-center gap-2 border-b border-border/50 px-3 py-2", y == null && Fe.length === 0 && Z.length === 0 && "sr-only"),
|
|
218
269
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ K("span", {
|
|
220
271
|
"aria-live": "polite",
|
|
221
|
-
className: "text-sm font-medium",
|
|
222
|
-
children:
|
|
272
|
+
className: e("text-sm font-medium", Z.length === 0 && "sr-only"),
|
|
273
|
+
children: Z.length > 0 ? S("bento.table.selected", {
|
|
223
274
|
defaultValue: "{{count}} selected",
|
|
224
|
-
count:
|
|
275
|
+
count: Z.length
|
|
225
276
|
}) : ""
|
|
226
277
|
}),
|
|
227
|
-
|
|
278
|
+
Z.length === 0 && y != null && /* @__PURE__ */ K("div", {
|
|
279
|
+
className: "flex min-w-0 flex-1 flex-wrap items-center gap-2",
|
|
280
|
+
children: y
|
|
281
|
+
}),
|
|
282
|
+
Z.length > 0 && /* @__PURE__ */ q("div", {
|
|
228
283
|
role: "toolbar",
|
|
229
|
-
"aria-label":
|
|
284
|
+
"aria-label": S("bento.table.selectionActions", { defaultValue: "Actions on the selection" }),
|
|
230
285
|
className: "flex flex-wrap items-center gap-2",
|
|
231
286
|
children: [s?.map((t) => {
|
|
232
287
|
let n = t.icon;
|
|
233
|
-
return /* @__PURE__ */
|
|
288
|
+
return /* @__PURE__ */ q(c, {
|
|
234
289
|
variant: "outline",
|
|
235
290
|
size: "sm",
|
|
236
291
|
className: e("gap-1.5", t.tone === "destructive" && "bento-item-danger"),
|
|
237
|
-
onClick: () => t.onSelect(
|
|
238
|
-
children: [/* @__PURE__ */
|
|
292
|
+
onClick: () => t.onSelect(Z),
|
|
293
|
+
children: [/* @__PURE__ */ K(n, { size: 16 }), t.label]
|
|
239
294
|
}, t.id);
|
|
240
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ K(c, {
|
|
241
296
|
variant: "ghost",
|
|
242
297
|
size: "sm",
|
|
243
|
-
onClick: () =>
|
|
244
|
-
children:
|
|
298
|
+
onClick: () => De(/* @__PURE__ */ new Set()),
|
|
299
|
+
children: S("bento.table.clearSelection", { defaultValue: "Clear selection" })
|
|
245
300
|
})]
|
|
246
301
|
}),
|
|
247
|
-
|
|
302
|
+
Fe.length > 0 && /* @__PURE__ */ q(v, { children: [/* @__PURE__ */ K(T, {
|
|
248
303
|
asChild: !0,
|
|
249
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ q(c, {
|
|
250
305
|
variant: "ghost",
|
|
251
306
|
size: "sm",
|
|
252
307
|
className: "ml-auto gap-1.5",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ K(Te, {
|
|
254
309
|
size: 16,
|
|
255
310
|
"aria-hidden": "true"
|
|
256
|
-
}),
|
|
311
|
+
}), S("bento.table.columns", { defaultValue: "Columns" })]
|
|
257
312
|
})
|
|
258
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ K(ie, {
|
|
259
314
|
align: "end",
|
|
260
315
|
className: "bento-dropdown min-w-44 p-1.5",
|
|
261
|
-
children:
|
|
262
|
-
checked: !
|
|
263
|
-
onCheckedChange: (t) =>
|
|
316
|
+
children: Fe.map((e) => /* @__PURE__ */ K(x, {
|
|
317
|
+
checked: !me.hidden.includes(e.id),
|
|
318
|
+
onCheckedChange: (t) => Pe(e.id, t !== !0),
|
|
264
319
|
onSelect: (e) => e.preventDefault(),
|
|
265
320
|
children: e.header
|
|
266
321
|
}, e.id))
|
|
267
322
|
})] })
|
|
268
323
|
]
|
|
269
|
-
}), /* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ q("div", {
|
|
270
325
|
role: "grid",
|
|
271
326
|
"aria-label": i,
|
|
272
|
-
"aria-rowcount":
|
|
273
|
-
"aria-colcount":
|
|
274
|
-
"aria-multiselectable":
|
|
275
|
-
children: [/* @__PURE__ */
|
|
327
|
+
"aria-rowcount": X + 1,
|
|
328
|
+
"aria-colcount": he.length + +!!H + +!!o?.length,
|
|
329
|
+
"aria-multiselectable": H ? "true" : void 0,
|
|
330
|
+
children: [/* @__PURE__ */ K("div", {
|
|
276
331
|
role: "rowgroup",
|
|
277
|
-
|
|
332
|
+
ref: se,
|
|
333
|
+
className: e(B && "sticky top-(--bento-shell-header,0px) z-10 bg-card/95 backdrop-blur"),
|
|
334
|
+
children: /* @__PURE__ */ q("div", {
|
|
278
335
|
role: "row",
|
|
279
336
|
"aria-rowindex": 1,
|
|
280
337
|
className: "grid items-center border-b border-border/50 px-1 text-xs font-medium text-muted-foreground",
|
|
281
338
|
style: {
|
|
282
|
-
gridTemplateColumns:
|
|
283
|
-
minHeight:
|
|
339
|
+
gridTemplateColumns: _e,
|
|
340
|
+
minHeight: h
|
|
284
341
|
},
|
|
285
342
|
children: [
|
|
286
|
-
|
|
343
|
+
H && /* @__PURE__ */ K("div", {
|
|
287
344
|
role: "columnheader",
|
|
288
345
|
className: "grid place-items-center",
|
|
289
|
-
children: /* @__PURE__ */
|
|
290
|
-
"aria-label":
|
|
291
|
-
checked:
|
|
292
|
-
onCheckedChange: () =>
|
|
346
|
+
children: /* @__PURE__ */ K(b, {
|
|
347
|
+
"aria-label": S("bento.table.selectAll", { defaultValue: "Select all rows" }),
|
|
348
|
+
checked: Ie ? !0 : Z.length > 0 && "indeterminate",
|
|
349
|
+
onCheckedChange: () => De(Ie ? /* @__PURE__ */ new Set() : new Set(Y.map(n)))
|
|
293
350
|
})
|
|
294
351
|
}),
|
|
295
|
-
|
|
296
|
-
let t =
|
|
297
|
-
return /* @__PURE__ */
|
|
352
|
+
he.map((e) => {
|
|
353
|
+
let t = C.find((t) => t.id === e.id), n = t ? t.desc ? "descending" : "ascending" : "none";
|
|
354
|
+
return /* @__PURE__ */ K("div", {
|
|
298
355
|
role: "columnheader",
|
|
299
356
|
"aria-sort": e.sortValue ? n : void 0,
|
|
300
357
|
className: "min-w-0 px-2",
|
|
301
|
-
children: e.sortValue ? /* @__PURE__ */
|
|
358
|
+
children: e.sortValue ? /* @__PURE__ */ q("button", {
|
|
302
359
|
type: "button",
|
|
303
|
-
|
|
360
|
+
"data-look": "text",
|
|
361
|
+
onClick: () => Ne(e.id),
|
|
304
362
|
className: "inline-flex max-w-full items-center gap-1 rounded-md py-1 hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",
|
|
305
363
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ K("span", {
|
|
307
365
|
className: "truncate",
|
|
308
366
|
children: e.header
|
|
309
367
|
}),
|
|
310
|
-
n === "ascending" && /* @__PURE__ */
|
|
368
|
+
n === "ascending" && /* @__PURE__ */ K(ve, {
|
|
311
369
|
size: 14,
|
|
312
370
|
"aria-hidden": "true"
|
|
313
371
|
}),
|
|
314
|
-
n === "descending" && /* @__PURE__ */
|
|
372
|
+
n === "descending" && /* @__PURE__ */ K(ge, {
|
|
315
373
|
size: 14,
|
|
316
374
|
"aria-hidden": "true"
|
|
317
375
|
}),
|
|
318
|
-
n === "none" && /* @__PURE__ */
|
|
376
|
+
n === "none" && /* @__PURE__ */ K(ye, {
|
|
319
377
|
size: 14,
|
|
320
378
|
"aria-hidden": "true",
|
|
321
379
|
className: "opacity-40"
|
|
322
380
|
})
|
|
323
381
|
]
|
|
324
|
-
}) : /* @__PURE__ */
|
|
382
|
+
}) : /* @__PURE__ */ K("span", {
|
|
325
383
|
className: "block truncate py-1",
|
|
326
384
|
children: e.header
|
|
327
385
|
})
|
|
328
386
|
}, e.id);
|
|
329
387
|
}),
|
|
330
|
-
o?.length ? /* @__PURE__ */
|
|
388
|
+
o?.length ? /* @__PURE__ */ K("div", {
|
|
331
389
|
role: "columnheader",
|
|
332
390
|
className: "px-2",
|
|
333
|
-
children: /* @__PURE__ */
|
|
391
|
+
children: /* @__PURE__ */ K("span", {
|
|
334
392
|
className: "sr-only",
|
|
335
|
-
children:
|
|
393
|
+
children: S("bento.table.actions", { defaultValue: "Actions" })
|
|
336
394
|
})
|
|
337
395
|
}) : null
|
|
338
396
|
]
|
|
339
397
|
})
|
|
340
|
-
}),
|
|
398
|
+
}), X === 0 ? /* @__PURE__ */ K("div", {
|
|
341
399
|
role: "rowgroup",
|
|
342
|
-
children: /* @__PURE__ */
|
|
400
|
+
children: /* @__PURE__ */ K("div", {
|
|
343
401
|
role: "row",
|
|
344
402
|
"aria-rowindex": 2,
|
|
345
|
-
children: /* @__PURE__ */
|
|
403
|
+
children: /* @__PURE__ */ K("div", {
|
|
346
404
|
role: "gridcell",
|
|
347
405
|
className: "px-4 py-10 text-center text-sm text-muted-foreground",
|
|
348
|
-
children:
|
|
406
|
+
children: _ ?? S("bento.table.empty", { defaultValue: "Nothing to show" })
|
|
349
407
|
})
|
|
350
408
|
})
|
|
351
|
-
}) : /* @__PURE__ */
|
|
409
|
+
}) : /* @__PURE__ */ K("div", {
|
|
352
410
|
role: "rowgroup",
|
|
353
|
-
ref:
|
|
354
|
-
onScroll: (e) =>
|
|
355
|
-
className: "relative overflow-y-auto",
|
|
356
|
-
style: { height:
|
|
357
|
-
children: /* @__PURE__ */
|
|
358
|
-
style: { height:
|
|
411
|
+
ref: oe,
|
|
412
|
+
onScroll: B ? void 0 : (e) => z(e.currentTarget.scrollTop),
|
|
413
|
+
className: e("relative", !B && "overflow-y-auto"),
|
|
414
|
+
style: B ? void 0 : { height: be },
|
|
415
|
+
children: /* @__PURE__ */ K("div", {
|
|
416
|
+
style: { height: X * h },
|
|
359
417
|
className: "relative",
|
|
360
|
-
children:
|
|
361
|
-
let i =
|
|
362
|
-
return /* @__PURE__ */
|
|
418
|
+
children: Y.slice(Ce, we).map((t, r) => {
|
|
419
|
+
let i = Ce + r, a = n(t), s = te.has(a), c = pe(t);
|
|
420
|
+
return /* @__PURE__ */ q("div", {
|
|
363
421
|
ref: (e) => {
|
|
364
|
-
e ?
|
|
422
|
+
e ? ce.current.set(i, e) : ce.current.delete(i);
|
|
365
423
|
},
|
|
366
424
|
role: "row",
|
|
367
425
|
"aria-rowindex": i + 2,
|
|
368
|
-
"aria-selected":
|
|
369
|
-
tabIndex: i ===
|
|
370
|
-
onKeyDown: (e) =>
|
|
371
|
-
onClick: (e) =>
|
|
372
|
-
onDoubleClick: () =>
|
|
426
|
+
"aria-selected": H ? s ? "true" : "false" : void 0,
|
|
427
|
+
tabIndex: i === Ee ? 0 : -1,
|
|
428
|
+
onKeyDown: (e) => je(e, i),
|
|
429
|
+
onClick: (e) => Me(e, i),
|
|
430
|
+
onDoubleClick: () => m?.(t),
|
|
373
431
|
onFocus: (e) => {
|
|
374
432
|
e.target === e.currentTarget && ne(i);
|
|
375
433
|
},
|
|
376
434
|
className: e("absolute inset-x-0 grid items-center border-b border-border/30 px-1 text-sm outline-none transition-colors", "hover:bg-muted/40 focus-visible:bg-muted/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring", s && "bg-primary/10 hover:bg-primary/15"),
|
|
377
435
|
style: {
|
|
378
|
-
top: i *
|
|
379
|
-
height:
|
|
380
|
-
gridTemplateColumns:
|
|
436
|
+
top: i * h,
|
|
437
|
+
height: h,
|
|
438
|
+
gridTemplateColumns: _e
|
|
381
439
|
},
|
|
382
440
|
children: [
|
|
383
|
-
|
|
441
|
+
H && /* @__PURE__ */ K("div", {
|
|
384
442
|
role: "gridcell",
|
|
385
443
|
className: "grid place-items-center",
|
|
386
|
-
children: /* @__PURE__ */
|
|
444
|
+
children: /* @__PURE__ */ K(b, {
|
|
387
445
|
tabIndex: -1,
|
|
388
|
-
"aria-label":
|
|
446
|
+
"aria-label": S("bento.table.selectRow", {
|
|
389
447
|
defaultValue: "Select {{row}}",
|
|
390
448
|
row: c
|
|
391
449
|
}),
|
|
392
450
|
checked: s,
|
|
393
|
-
onCheckedChange: () =>
|
|
451
|
+
onCheckedChange: () => ke(i)
|
|
394
452
|
})
|
|
395
453
|
}),
|
|
396
|
-
|
|
454
|
+
he.map((e) => /* @__PURE__ */ K("div", {
|
|
397
455
|
role: "gridcell",
|
|
398
456
|
className: "min-w-0 truncate px-2",
|
|
399
457
|
children: e.cell(t)
|
|
400
458
|
}, e.id)),
|
|
401
|
-
o?.length ? /* @__PURE__ */
|
|
459
|
+
o?.length ? /* @__PURE__ */ K("div", {
|
|
402
460
|
role: "gridcell",
|
|
403
461
|
className: "grid place-items-center",
|
|
404
|
-
children: /* @__PURE__ */
|
|
405
|
-
triggerLabel:
|
|
462
|
+
children: /* @__PURE__ */ K(mt, {
|
|
463
|
+
triggerLabel: S("bento.table.rowActions", {
|
|
406
464
|
defaultValue: "Actions for {{row}}",
|
|
407
465
|
row: c
|
|
408
466
|
}),
|
|
@@ -425,24 +483,24 @@ function _t({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
425
483
|
}
|
|
426
484
|
//#endregion
|
|
427
485
|
//#region src/bento/bento-empty-state.tsx
|
|
428
|
-
function
|
|
486
|
+
function wt({ icon: t = Re, title: n, description: r, action: i, align: a = "center", titleLevel: o = 2, className: s }) {
|
|
429
487
|
let c = a === "center", l = `h${o}`;
|
|
430
|
-
return /* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ q("div", {
|
|
431
489
|
className: e("bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8", c ? "items-center text-center" : "items-start text-left", s),
|
|
432
490
|
children: [
|
|
433
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ K("span", {
|
|
434
492
|
className: "bento-well grid h-12 w-12 place-items-center rounded-2xl",
|
|
435
|
-
children: /* @__PURE__ */
|
|
493
|
+
children: /* @__PURE__ */ K(t, { size: 24 })
|
|
436
494
|
}),
|
|
437
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ K(l, {
|
|
438
496
|
className: "m-0 text-lg font-semibold tracking-tight",
|
|
439
497
|
children: n
|
|
440
498
|
}),
|
|
441
|
-
r && /* @__PURE__ */
|
|
499
|
+
r && /* @__PURE__ */ K("p", {
|
|
442
500
|
className: e("max-w-md text-sm text-muted-foreground", c && "mx-auto"),
|
|
443
501
|
children: r
|
|
444
502
|
}),
|
|
445
|
-
i && /* @__PURE__ */
|
|
503
|
+
i && /* @__PURE__ */ K("div", {
|
|
446
504
|
className: e("mt-1", c && "mx-auto"),
|
|
447
505
|
children: i
|
|
448
506
|
})
|
|
@@ -451,31 +509,31 @@ function vt({ icon: t = Pe, title: n, description: r, action: i, align: a = "cen
|
|
|
451
509
|
}
|
|
452
510
|
//#endregion
|
|
453
511
|
//#region src/bento/bento-trail.tsx
|
|
454
|
-
var
|
|
455
|
-
function
|
|
456
|
-
let { t } =
|
|
457
|
-
return /* @__PURE__ */
|
|
512
|
+
var Tt = 4;
|
|
513
|
+
function Et({ steps: e }) {
|
|
514
|
+
let { t } = J(), n = e.length > Tt, r = (t) => n && t > 0 && t < e.length - 2;
|
|
515
|
+
return /* @__PURE__ */ K("nav", {
|
|
458
516
|
"aria-label": t("bento.trail.label", { defaultValue: "Location" }),
|
|
459
517
|
"data-slot": "bento-trail",
|
|
460
|
-
children: /* @__PURE__ */
|
|
518
|
+
children: /* @__PURE__ */ K("ol", {
|
|
461
519
|
className: "flex min-w-0 flex-wrap items-center gap-1",
|
|
462
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
520
|
+
children: e.map((e, t) => /* @__PURE__ */ q("li", {
|
|
463
521
|
className: r(t) ? "sr-only" : "inline-flex min-w-0 items-center gap-1",
|
|
464
522
|
children: [
|
|
465
|
-
t > 0 && !r(t) && /* @__PURE__ */
|
|
523
|
+
t > 0 && !r(t) && /* @__PURE__ */ K(we, {
|
|
466
524
|
size: 12,
|
|
467
525
|
"aria-hidden": !0,
|
|
468
526
|
className: "shrink-0 opacity-60"
|
|
469
527
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ K(Ke, {
|
|
471
529
|
to: e.to,
|
|
472
530
|
className: "max-w-[16ch] truncate hover:text-foreground",
|
|
473
531
|
children: e.label
|
|
474
532
|
}),
|
|
475
|
-
n && t === 0 && /* @__PURE__ */
|
|
533
|
+
n && t === 0 && /* @__PURE__ */ q("span", {
|
|
476
534
|
"aria-hidden": !0,
|
|
477
535
|
className: "inline-flex items-center gap-1",
|
|
478
|
-
children: [/* @__PURE__ */
|
|
536
|
+
children: [/* @__PURE__ */ K(we, {
|
|
479
537
|
size: 12,
|
|
480
538
|
className: "shrink-0 opacity-60"
|
|
481
539
|
}), "…"]
|
|
@@ -487,54 +545,54 @@ function bt({ steps: e }) {
|
|
|
487
545
|
}
|
|
488
546
|
//#endregion
|
|
489
547
|
//#region src/bento/bento-hero.tsx
|
|
490
|
-
function
|
|
491
|
-
return /* @__PURE__ */
|
|
548
|
+
function Dt({ to: e, children: t }) {
|
|
549
|
+
return /* @__PURE__ */ q(Ke, {
|
|
492
550
|
to: e,
|
|
493
551
|
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
494
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ K(_e, {
|
|
495
553
|
size: 14,
|
|
496
554
|
"aria-hidden": !0
|
|
497
555
|
}), t]
|
|
498
556
|
});
|
|
499
557
|
}
|
|
500
|
-
function
|
|
501
|
-
return e && e.length > 1 ? /* @__PURE__ */
|
|
558
|
+
function Ot(e, t, n) {
|
|
559
|
+
return e && e.length > 1 ? /* @__PURE__ */ K(Et, { steps: e }) : e && e.length === 1 ? /* @__PURE__ */ K(Dt, {
|
|
502
560
|
to: e[0].to,
|
|
503
561
|
children: e[0].label
|
|
504
|
-
}) : t == null ? null : /* @__PURE__ */
|
|
562
|
+
}) : t == null ? null : /* @__PURE__ */ K(Dt, {
|
|
505
563
|
to: t,
|
|
506
564
|
children: n
|
|
507
565
|
});
|
|
508
566
|
}
|
|
509
|
-
function
|
|
510
|
-
let c = e ??
|
|
511
|
-
return /* @__PURE__ */
|
|
567
|
+
function kt({ eyebrow: e, backTo: t, backLabel: n, trail: r, title: i, subtitle: a, leading: o, trailing: s }) {
|
|
568
|
+
let c = e ?? Ot(r, t, n);
|
|
569
|
+
return /* @__PURE__ */ K("header", {
|
|
512
570
|
className: "bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10",
|
|
513
|
-
children: /* @__PURE__ */
|
|
571
|
+
children: /* @__PURE__ */ q("div", {
|
|
514
572
|
className: "flex w-full items-start gap-4",
|
|
515
573
|
children: [
|
|
516
|
-
o && /* @__PURE__ */
|
|
574
|
+
o && /* @__PURE__ */ K("div", {
|
|
517
575
|
className: "shrink-0",
|
|
518
576
|
children: o
|
|
519
577
|
}),
|
|
520
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ q("div", {
|
|
521
579
|
className: "flex flex-1 flex-col gap-1",
|
|
522
580
|
children: [
|
|
523
|
-
c && /* @__PURE__ */
|
|
581
|
+
c && /* @__PURE__ */ K("span", {
|
|
524
582
|
className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
|
|
525
583
|
children: c
|
|
526
584
|
}),
|
|
527
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ K("h1", {
|
|
528
586
|
className: "text-2xl font-semibold tracking-tight md:text-3xl",
|
|
529
587
|
children: i
|
|
530
588
|
}),
|
|
531
|
-
a && /* @__PURE__ */
|
|
589
|
+
a && /* @__PURE__ */ K("p", {
|
|
532
590
|
className: "max-w-2xl text-sm text-muted-foreground",
|
|
533
591
|
children: a
|
|
534
592
|
})
|
|
535
593
|
]
|
|
536
594
|
}),
|
|
537
|
-
s && /* @__PURE__ */
|
|
595
|
+
s && /* @__PURE__ */ K("div", {
|
|
538
596
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
539
597
|
children: s
|
|
540
598
|
})
|
|
@@ -544,31 +602,31 @@ function Ct({ eyebrow: e, backTo: t, backLabel: n, trail: r, title: i, subtitle:
|
|
|
544
602
|
}
|
|
545
603
|
//#endregion
|
|
546
604
|
//#region src/bento/bento-hero-icon-picker.tsx
|
|
547
|
-
function
|
|
548
|
-
let { t: c } =
|
|
549
|
-
return s ? /* @__PURE__ */
|
|
550
|
-
className: `grid h-12 w-12 place-items-center rounded-2xl ${
|
|
551
|
-
children: e ? /* @__PURE__ */
|
|
605
|
+
function At({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title: a, description: o, readOnly: s = !1 }) {
|
|
606
|
+
let { t: c } = J(), [l, u] = W(!1);
|
|
607
|
+
return s ? /* @__PURE__ */ K("span", {
|
|
608
|
+
className: `grid h-12 w-12 place-items-center rounded-2xl ${_t(i)} text-white shadow-md`,
|
|
609
|
+
children: e ? /* @__PURE__ */ K(We, {
|
|
552
610
|
icon: e,
|
|
553
611
|
className: "size-6 text-white"
|
|
554
|
-
}) : /* @__PURE__ */
|
|
555
|
-
}) : /* @__PURE__ */
|
|
612
|
+
}) : /* @__PURE__ */ K(r, { size: 24 })
|
|
613
|
+
}) : /* @__PURE__ */ q("div", {
|
|
556
614
|
className: "group relative",
|
|
557
615
|
children: [
|
|
558
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ q("button", {
|
|
559
617
|
type: "button",
|
|
560
618
|
onClick: () => u(!0),
|
|
561
619
|
"aria-label": c("forms.iconPicker.chooseAnIcon"),
|
|
562
|
-
className: `group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${
|
|
563
|
-
children: [e ? /* @__PURE__ */
|
|
620
|
+
className: `group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${_t(i)} text-white shadow-md outline-none transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] hover:scale-105 focus-visible:ring-2 focus-visible:ring-ring active:scale-95`,
|
|
621
|
+
children: [e ? /* @__PURE__ */ K(We, {
|
|
564
622
|
icon: e,
|
|
565
623
|
className: "size-6 text-white"
|
|
566
|
-
}) : /* @__PURE__ */
|
|
624
|
+
}) : /* @__PURE__ */ K(r, { size: 24 }), /* @__PURE__ */ K("span", {
|
|
567
625
|
className: "pointer-events-none absolute inset-0 grid place-items-center bg-black/40 opacity-0 transition-opacity duration-200 group-hover/icon:opacity-100",
|
|
568
|
-
children: /* @__PURE__ */
|
|
626
|
+
children: /* @__PURE__ */ K(Fe, { className: "size-5 text-white" })
|
|
569
627
|
})]
|
|
570
628
|
}),
|
|
571
|
-
e && n && /* @__PURE__ */
|
|
629
|
+
e && n && /* @__PURE__ */ K("button", {
|
|
572
630
|
type: "button",
|
|
573
631
|
onClick: (e) => {
|
|
574
632
|
e.stopPropagation(), n();
|
|
@@ -576,9 +634,9 @@ function wt({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title:
|
|
|
576
634
|
"aria-label": c("forms.common.remove"),
|
|
577
635
|
title: c("forms.common.remove"),
|
|
578
636
|
className: "absolute -right-1.5 -top-1.5 grid h-5 w-5 cursor-pointer place-items-center rounded-full border border-border/60 bg-card/90 text-foreground opacity-0 shadow-md backdrop-blur transition-opacity duration-200 bento-clear focus-visible:opacity-100 group-hover:opacity-100",
|
|
579
|
-
children: /* @__PURE__ */
|
|
637
|
+
children: /* @__PURE__ */ K(Ue, { size: 12 })
|
|
580
638
|
}),
|
|
581
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ K(g, {
|
|
582
640
|
open: l,
|
|
583
641
|
onOpenChange: u,
|
|
584
642
|
value: e,
|
|
@@ -592,9 +650,9 @@ function wt({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title:
|
|
|
592
650
|
}
|
|
593
651
|
//#endregion
|
|
594
652
|
//#region src/bento/bento-inline-edit.tsx
|
|
595
|
-
function
|
|
596
|
-
let { t: d } =
|
|
597
|
-
!f && n !== S && (C(n), h(n)),
|
|
653
|
+
function jt({ value: n, onSave: r, multiline: i = !1, placeholder: a, className: o, ariaLabel: s, autoFocus: c = !1, readOnly: l = !1, commitOnChange: u = !1 }) {
|
|
654
|
+
let { t: d } = J(), [f, p] = W(c), [m, h] = W(n), [g, _] = W(!1), v = U(null), y = U(null), b = U(!1), x = U(!1), [S, C] = W(n);
|
|
655
|
+
!f && n !== S && (C(n), h(n)), V(() => {
|
|
598
656
|
f && v.current ? (v.current.focus(), v.current.select()) : !f && x.current && (x.current = !1, y.current?.focus());
|
|
599
657
|
}, [f]);
|
|
600
658
|
function w() {
|
|
@@ -620,86 +678,87 @@ function Tt({ value: n, onSave: r, multiline: i = !1, placeholder: a, className:
|
|
|
620
678
|
b.current = !1, _(!1), w();
|
|
621
679
|
}
|
|
622
680
|
}
|
|
623
|
-
function
|
|
681
|
+
function E() {
|
|
624
682
|
h(n), w();
|
|
625
683
|
}
|
|
626
|
-
function
|
|
684
|
+
function D(e) {
|
|
627
685
|
h(e), u && r(e);
|
|
628
686
|
}
|
|
629
|
-
let
|
|
630
|
-
if (l) return /* @__PURE__ */
|
|
687
|
+
let O = !n;
|
|
688
|
+
if (l) return /* @__PURE__ */ K("span", {
|
|
631
689
|
className: e("block w-full", o),
|
|
632
690
|
"aria-label": s,
|
|
633
|
-
children: n || /* @__PURE__ */
|
|
691
|
+
children: n || /* @__PURE__ */ K("span", {
|
|
634
692
|
className: "text-muted-foreground",
|
|
635
693
|
children: a ?? "—"
|
|
636
694
|
})
|
|
637
695
|
});
|
|
638
|
-
let
|
|
639
|
-
if (!f) return /* @__PURE__ */
|
|
696
|
+
let k = "w-full bg-transparent outline-none border-b transition-colors duration-200", A = e(k, "cursor-text rounded-sm", O ? "border-dashed border-border/70 hover:border-foreground/40" : "border-transparent hover:border-border/60 focus-visible:border-border/80"), j = e(k, "bento-editing");
|
|
697
|
+
if (!f) return /* @__PURE__ */ K("button", {
|
|
640
698
|
ref: y,
|
|
641
699
|
type: "button",
|
|
700
|
+
"data-look": "text",
|
|
642
701
|
onClick: () => p(!0),
|
|
643
|
-
className: e(
|
|
702
|
+
className: e(A, "text-left", o),
|
|
644
703
|
"aria-label": s ?? d("forms.formActions.edit"),
|
|
645
|
-
children: n || /* @__PURE__ */
|
|
704
|
+
children: n || /* @__PURE__ */ K("span", {
|
|
646
705
|
className: "text-muted-foreground",
|
|
647
706
|
children: a ?? "—"
|
|
648
707
|
})
|
|
649
708
|
});
|
|
650
|
-
function
|
|
709
|
+
function M(e) {
|
|
651
710
|
if (e.key === "Escape") {
|
|
652
|
-
e.preventDefault(),
|
|
711
|
+
e.preventDefault(), E();
|
|
653
712
|
return;
|
|
654
713
|
}
|
|
655
714
|
e.key === "Enter" && (!i || e.metaKey || e.ctrlKey) && (e.preventDefault(), T());
|
|
656
715
|
}
|
|
657
|
-
return i ? /* @__PURE__ */
|
|
716
|
+
return i ? /* @__PURE__ */ K("textarea", {
|
|
658
717
|
ref: v,
|
|
659
718
|
value: m,
|
|
660
|
-
onChange: (e) =>
|
|
719
|
+
onChange: (e) => D(e.target.value),
|
|
661
720
|
onBlur: T,
|
|
662
|
-
onKeyDown:
|
|
721
|
+
onKeyDown: M,
|
|
663
722
|
placeholder: a,
|
|
664
723
|
"aria-label": s,
|
|
665
724
|
"aria-busy": g || void 0,
|
|
666
725
|
rows: 3,
|
|
667
|
-
className: e(
|
|
668
|
-
}) : /* @__PURE__ */
|
|
726
|
+
className: e(j, "resize-none py-0.5 leading-snug", o)
|
|
727
|
+
}) : /* @__PURE__ */ K(t, {
|
|
669
728
|
ref: v,
|
|
670
729
|
value: m,
|
|
671
|
-
onChange: (e) =>
|
|
730
|
+
onChange: (e) => D(e.target.value),
|
|
672
731
|
onBlur: T,
|
|
673
|
-
onKeyDown:
|
|
732
|
+
onKeyDown: M,
|
|
674
733
|
placeholder: a,
|
|
675
734
|
"aria-label": s,
|
|
676
735
|
"aria-busy": g || void 0,
|
|
677
|
-
className: e(
|
|
736
|
+
className: e(j, "h-auto px-0 py-0 shadow-none focus-visible:ring-0", o)
|
|
678
737
|
});
|
|
679
738
|
}
|
|
680
739
|
//#endregion
|
|
681
740
|
//#region src/bento/bento-status-marker.tsx
|
|
682
|
-
var
|
|
741
|
+
var Mt = [
|
|
683
742
|
"published",
|
|
684
743
|
"draft",
|
|
685
744
|
"scheduled",
|
|
686
745
|
"changed",
|
|
687
746
|
"archived"
|
|
688
747
|
];
|
|
689
|
-
function
|
|
690
|
-
let { t: a } =
|
|
748
|
+
function Nt({ titleMissing: t, dirty: n, state: r, className: i }) {
|
|
749
|
+
let { t: a } = J();
|
|
691
750
|
if (!t && !n && !r) return null;
|
|
692
751
|
let o = "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal";
|
|
693
|
-
return t ? /* @__PURE__ */
|
|
752
|
+
return t ? /* @__PURE__ */ q("span", {
|
|
694
753
|
className: e(o, "bento-status bento-status-error", i),
|
|
695
|
-
children: [/* @__PURE__ */
|
|
696
|
-
}) : n ? /* @__PURE__ */
|
|
754
|
+
children: [/* @__PURE__ */ K(me, { className: "size-3" }), a("bento.saveBar.titleRequired", { defaultValue: "Title required" })]
|
|
755
|
+
}) : n ? /* @__PURE__ */ q("span", {
|
|
697
756
|
className: e(o, "bento-status bento-status-warn", i),
|
|
698
|
-
children: [/* @__PURE__ */
|
|
699
|
-
}) : /* @__PURE__ */
|
|
757
|
+
children: [/* @__PURE__ */ K("span", { className: "h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse" }), a("bento.saveBar.unsaved", { defaultValue: "Unsaved changes" })]
|
|
758
|
+
}) : /* @__PURE__ */ q("span", {
|
|
700
759
|
"data-state": r,
|
|
701
760
|
className: e("inline-flex items-center gap-1.5 text-xs font-normal normal-case leading-none tracking-normal", r === "archived" ? "text-muted-foreground" : "text-foreground/80", `bento-state-${r}`, i),
|
|
702
|
-
children: [/* @__PURE__ */
|
|
761
|
+
children: [/* @__PURE__ */ K("span", {
|
|
703
762
|
"aria-hidden": !0,
|
|
704
763
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bento-state-dot"
|
|
705
764
|
}), a(`bento.state.${r}`)]
|
|
@@ -707,8 +766,8 @@ function Dt({ titleMissing: t, dirty: n, state: r, className: i }) {
|
|
|
707
766
|
}
|
|
708
767
|
//#endregion
|
|
709
768
|
//#region src/bento/bento-scroll-fade.ts
|
|
710
|
-
function
|
|
711
|
-
|
|
769
|
+
function Pt(e) {
|
|
770
|
+
V(() => {
|
|
712
771
|
let t = e.current;
|
|
713
772
|
if (!t) return;
|
|
714
773
|
let n = document.documentElement, r = 0, i = () => {
|
|
@@ -725,98 +784,98 @@ function Ot(e) {
|
|
|
725
784
|
}
|
|
726
785
|
//#endregion
|
|
727
786
|
//#region src/bento/bento-entity-shell.tsx
|
|
728
|
-
function
|
|
787
|
+
function Ft(e, t) {
|
|
729
788
|
let n = {};
|
|
730
789
|
for (let r of Object.keys(e)) Object.assign(n, { [r]: t[r] });
|
|
731
790
|
return n;
|
|
732
791
|
}
|
|
733
|
-
function
|
|
734
|
-
let { t: x } =
|
|
792
|
+
function It({ entity: e, isNew: t, headlineFallback: n, eyebrow: r, listRoute: i, trail: o, icon: s, tone: c, formId: l, feature: u, hasStatus: d = !1, hideIcon: f = !1, readOnly: p = !1, autosaveOnly: m = !1, badge: h, notice: g, onUpdate: _, onDelete: v, extraActions: y, children: b }) {
|
|
793
|
+
let { t: x } = J(), S = Ye(), [C, w] = W(!1), [T, E] = W({
|
|
735
794
|
isDirty: !1,
|
|
736
795
|
isSubmitting: !1
|
|
737
|
-
}),
|
|
738
|
-
|
|
739
|
-
let
|
|
796
|
+
}), D = U(null);
|
|
797
|
+
Pt(D);
|
|
798
|
+
let O = {
|
|
740
799
|
title: e.title ?? "",
|
|
741
800
|
description: e.description ?? "",
|
|
742
801
|
icon: e.icon ?? null,
|
|
743
802
|
enabled: e.enabled ?? 1
|
|
744
|
-
}, [
|
|
745
|
-
(
|
|
803
|
+
}, [k, A] = W(O), [j, M] = W(O);
|
|
804
|
+
(O.title !== j.title || O.description !== j.description || O.icon !== j.icon || O.enabled !== j.enabled) && (M(O), A(O));
|
|
746
805
|
async function N(n) {
|
|
747
|
-
if (
|
|
806
|
+
if (A((e) => ({
|
|
748
807
|
...e,
|
|
749
808
|
...n
|
|
750
809
|
})), t || !_) return;
|
|
751
|
-
let r = n.title ??
|
|
810
|
+
let r = n.title ?? k.title;
|
|
752
811
|
try {
|
|
753
812
|
await _({
|
|
754
813
|
...e,
|
|
755
814
|
...n
|
|
756
|
-
}),
|
|
815
|
+
}), R.success(x("forms.common.updated", {
|
|
757
816
|
name: r,
|
|
758
817
|
feature: u
|
|
759
818
|
}));
|
|
760
819
|
} catch (e) {
|
|
761
|
-
console.error("Failed to update entity field", e),
|
|
820
|
+
console.error("Failed to update entity field", e), A((e) => ({
|
|
762
821
|
...e,
|
|
763
|
-
...
|
|
764
|
-
})),
|
|
765
|
-
name:
|
|
822
|
+
...Ft(n, O)
|
|
823
|
+
})), R.error(x("forms.common.notUpdated", {
|
|
824
|
+
name: O.title || r,
|
|
766
825
|
feature: u
|
|
767
826
|
}));
|
|
768
827
|
}
|
|
769
828
|
}
|
|
770
|
-
async function
|
|
829
|
+
async function P() {
|
|
771
830
|
if (v) {
|
|
772
831
|
try {
|
|
773
|
-
await v() ? (
|
|
774
|
-
name:
|
|
832
|
+
await v() ? (R.success(x("forms.common.deleted", {
|
|
833
|
+
name: k.title,
|
|
775
834
|
feature: u
|
|
776
|
-
})), S(i)) :
|
|
777
|
-
name:
|
|
835
|
+
})), S(i)) : R.error(x("forms.common.notDeleted", {
|
|
836
|
+
name: k.title,
|
|
778
837
|
feature: u
|
|
779
838
|
}));
|
|
780
839
|
} catch (e) {
|
|
781
|
-
console.error("Failed to delete entity", e),
|
|
782
|
-
name:
|
|
840
|
+
console.error("Failed to delete entity", e), R.error(x("forms.common.notDeleted", {
|
|
841
|
+
name: k.title,
|
|
783
842
|
feature: u
|
|
784
843
|
}));
|
|
785
844
|
}
|
|
786
845
|
w(!1);
|
|
787
846
|
}
|
|
788
847
|
}
|
|
789
|
-
let
|
|
848
|
+
let F = k.enabled === 1, ee = !p, te = !(m && !t), I = !k.title.trim(), L = !t && !T.isDirty, ne = I || L, z = [...y ?? [], ...v && !p ? [{
|
|
790
849
|
id: "entity.delete",
|
|
791
850
|
label: x("forms.formActions.delete"),
|
|
792
|
-
icon:
|
|
851
|
+
icon: ze,
|
|
793
852
|
tone: "destructive",
|
|
794
853
|
onSelect: () => w(!0)
|
|
795
854
|
}] : []];
|
|
796
|
-
return /* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
eyebrow: /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ q(G, { children: [
|
|
856
|
+
/* @__PURE__ */ K(kt, {
|
|
857
|
+
eyebrow: /* @__PURE__ */ q("span", {
|
|
799
858
|
className: "inline-flex items-center gap-2",
|
|
800
|
-
children: [o && o.length > 1 ? /* @__PURE__ */
|
|
859
|
+
children: [o && o.length > 1 ? /* @__PURE__ */ K(Et, { steps: o }) : /* @__PURE__ */ K(Dt, {
|
|
801
860
|
to: i,
|
|
802
861
|
children: r
|
|
803
|
-
}), !p && /* @__PURE__ */
|
|
804
|
-
titleMissing:
|
|
862
|
+
}), !p && /* @__PURE__ */ K(Nt, {
|
|
863
|
+
titleMissing: I,
|
|
805
864
|
dirty: t || T.isDirty
|
|
806
865
|
})]
|
|
807
866
|
}),
|
|
808
|
-
leading: /* @__PURE__ */
|
|
809
|
-
value:
|
|
867
|
+
leading: /* @__PURE__ */ K(At, {
|
|
868
|
+
value: k.icon,
|
|
810
869
|
onChange: (e) => N({ icon: e }),
|
|
811
870
|
onClear: () => N({ icon: null }),
|
|
812
871
|
defaultIcon: s,
|
|
813
872
|
tone: c,
|
|
814
|
-
title:
|
|
815
|
-
description:
|
|
873
|
+
title: k.title,
|
|
874
|
+
description: k.description,
|
|
816
875
|
readOnly: p || f
|
|
817
876
|
}),
|
|
818
|
-
title: /* @__PURE__ */
|
|
819
|
-
value:
|
|
877
|
+
title: /* @__PURE__ */ K(jt, {
|
|
878
|
+
value: k.title,
|
|
820
879
|
onSave: (e) => N({ title: e }),
|
|
821
880
|
placeholder: n,
|
|
822
881
|
className: "text-2xl font-semibold tracking-tight md:text-3xl",
|
|
@@ -825,8 +884,8 @@ function At({ entity: e, isNew: t, headlineFallback: n, eyebrow: r, listRoute: i
|
|
|
825
884
|
commitOnChange: t,
|
|
826
885
|
readOnly: p
|
|
827
886
|
}),
|
|
828
|
-
subtitle: /* @__PURE__ */
|
|
829
|
-
value:
|
|
887
|
+
subtitle: /* @__PURE__ */ K(jt, {
|
|
888
|
+
value: k.description,
|
|
830
889
|
onSave: (e) => N({ description: e }),
|
|
831
890
|
multiline: !0,
|
|
832
891
|
placeholder: x("forms.common.description"),
|
|
@@ -835,78 +894,78 @@ function At({ entity: e, isNew: t, headlineFallback: n, eyebrow: r, listRoute: i
|
|
|
835
894
|
commitOnChange: t,
|
|
836
895
|
readOnly: p
|
|
837
896
|
}),
|
|
838
|
-
trailing: /* @__PURE__ */
|
|
839
|
-
|
|
897
|
+
trailing: /* @__PURE__ */ q(G, { children: [
|
|
898
|
+
ee && /* @__PURE__ */ q("div", {
|
|
840
899
|
className: "bento-fade-out flex shrink-0 items-center gap-2",
|
|
841
|
-
children: [
|
|
900
|
+
children: [te && /* @__PURE__ */ q(a, {
|
|
842
901
|
type: "submit",
|
|
843
902
|
form: l,
|
|
844
903
|
size: "sm",
|
|
845
904
|
loading: T.isSubmitting,
|
|
846
|
-
"aria-disabled":
|
|
847
|
-
children: [/* @__PURE__ */
|
|
848
|
-
}), /* @__PURE__ */
|
|
905
|
+
"aria-disabled": ne ? "true" : void 0,
|
|
906
|
+
children: [/* @__PURE__ */ K(Ee, { className: "size-4" }), x("forms.formActions.saveChanges")]
|
|
907
|
+
}), /* @__PURE__ */ q(a, {
|
|
849
908
|
type: "button",
|
|
850
909
|
size: "sm",
|
|
851
910
|
variant: "outline",
|
|
852
911
|
onClick: () => S(i),
|
|
853
|
-
children: [/* @__PURE__ */
|
|
912
|
+
children: [/* @__PURE__ */ K(Ue, { className: "size-4" }), x("forms.formActions.cancel")]
|
|
854
913
|
})]
|
|
855
914
|
}),
|
|
856
915
|
h,
|
|
857
|
-
d && (p ? /* @__PURE__ */
|
|
858
|
-
className: `flex items-center gap-1.5 rounded-full border px-2.5
|
|
859
|
-
children: [/* @__PURE__ */
|
|
860
|
-
}) : /* @__PURE__ */
|
|
916
|
+
d && (p ? /* @__PURE__ */ q("span", {
|
|
917
|
+
className: `flex h-(--vg-control-dense) items-center gap-1.5 rounded-full border px-2.5 text-[10px] uppercase tracking-wider ${F ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
|
|
918
|
+
children: [/* @__PURE__ */ K("span", { className: `h-1.5 w-1.5 rounded-full ${F ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), F ? x("common.active", { defaultValue: "Active" }) : x("common.idle", { defaultValue: "Idle" })]
|
|
919
|
+
}) : /* @__PURE__ */ q("button", {
|
|
861
920
|
type: "button",
|
|
862
|
-
onClick: () => N({ enabled: +!
|
|
921
|
+
onClick: () => N({ enabled: +!F }),
|
|
863
922
|
"aria-label": x("forms.common.enabled"),
|
|
864
|
-
title: x(
|
|
865
|
-
className: `bento-tile-clickable flex items-center gap-1.5 rounded-full border px-2.5
|
|
866
|
-
children: [/* @__PURE__ */
|
|
923
|
+
title: x(F ? "common.activeToggleHint" : "common.idleToggleHint"),
|
|
924
|
+
className: `bento-tile-clickable flex h-(--vg-control-dense) items-center gap-1.5 rounded-full border px-2.5 text-[10px] uppercase tracking-wider transition-colors duration-200 ${F ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground hover:bg-muted/80"}`,
|
|
925
|
+
children: [/* @__PURE__ */ K("span", { className: `h-1.5 w-1.5 rounded-full ${F ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), F ? x("common.active", { defaultValue: "Active" }) : x("common.idle", { defaultValue: "Idle" })]
|
|
867
926
|
})),
|
|
868
|
-
!t &&
|
|
927
|
+
!t && z.length > 0 && /* @__PURE__ */ K(mt, { actions: z })
|
|
869
928
|
] })
|
|
870
929
|
}),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
ref:
|
|
930
|
+
/* @__PURE__ */ K("div", {
|
|
931
|
+
ref: D,
|
|
873
932
|
"aria-hidden": !0,
|
|
874
933
|
className: "h-px"
|
|
875
934
|
}),
|
|
876
935
|
g,
|
|
877
|
-
!t && v && /* @__PURE__ */
|
|
936
|
+
!t && v && /* @__PURE__ */ K(ae, {
|
|
878
937
|
feature: u,
|
|
879
|
-
name:
|
|
880
|
-
onDelete:
|
|
938
|
+
name: k.title,
|
|
939
|
+
onDelete: P,
|
|
881
940
|
open: C,
|
|
882
941
|
setOpen: w,
|
|
883
|
-
trigger: /* @__PURE__ */
|
|
942
|
+
trigger: /* @__PURE__ */ K("span", {
|
|
884
943
|
className: "hidden",
|
|
885
944
|
"aria-hidden": !0
|
|
886
945
|
})
|
|
887
946
|
}),
|
|
888
947
|
b({
|
|
889
|
-
staged:
|
|
890
|
-
onStateChange:
|
|
948
|
+
staged: k,
|
|
949
|
+
onStateChange: E
|
|
891
950
|
})
|
|
892
951
|
] });
|
|
893
952
|
}
|
|
894
953
|
//#endregion
|
|
895
954
|
//#region src/bento/bento-change-mark.tsx
|
|
896
|
-
var
|
|
955
|
+
var Lt = {
|
|
897
956
|
added: "bento-status bento-status-on",
|
|
898
957
|
removed: "bento-status bento-status-error",
|
|
899
958
|
changed: "bento-status bento-status-warn",
|
|
900
959
|
unchanged: !1
|
|
901
960
|
};
|
|
902
|
-
function
|
|
903
|
-
let { t: i } =
|
|
961
|
+
function Rt({ state: t, compact: n = !1, className: r }) {
|
|
962
|
+
let { t: i } = J(), a = {
|
|
904
963
|
added: i("bento.diff.added", { defaultValue: "Added" }),
|
|
905
964
|
removed: i("bento.diff.removed", { defaultValue: "Removed" }),
|
|
906
965
|
changed: i("bento.diff.changed", { defaultValue: "Changed" }),
|
|
907
966
|
unchanged: i("bento.diff.unchanged", { defaultValue: "Unchanged" })
|
|
908
|
-
}[t], o = e("rounded-full border px-1.5 leading-4", n && "font-mono",
|
|
909
|
-
if (!n) return /* @__PURE__ */
|
|
967
|
+
}[t], o = e("rounded-full border px-1.5 leading-4", n && "font-mono", Lt[t], r);
|
|
968
|
+
if (!n) return /* @__PURE__ */ K("span", {
|
|
910
969
|
"data-slot": "bento-change-mark",
|
|
911
970
|
"data-state": t,
|
|
912
971
|
className: o,
|
|
@@ -918,15 +977,15 @@ function Mt({ state: t, compact: n = !1, className: r }) {
|
|
|
918
977
|
changed: i("bento.diff.changedLetter", { defaultValue: "M" }),
|
|
919
978
|
unchanged: i("bento.diff.unchangedLetter", { defaultValue: "·" })
|
|
920
979
|
}[t];
|
|
921
|
-
return /* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ q("span", {
|
|
922
981
|
"data-slot": "bento-change-mark",
|
|
923
982
|
"data-state": t,
|
|
924
983
|
title: a,
|
|
925
984
|
className: o,
|
|
926
|
-
children: [/* @__PURE__ */
|
|
985
|
+
children: [/* @__PURE__ */ K("span", {
|
|
927
986
|
"aria-hidden": "true",
|
|
928
987
|
children: s
|
|
929
|
-
}), /* @__PURE__ */
|
|
988
|
+
}), /* @__PURE__ */ K("span", {
|
|
930
989
|
className: "sr-only",
|
|
931
990
|
children: a
|
|
932
991
|
})]
|
|
@@ -934,7 +993,7 @@ function Mt({ state: t, compact: n = !1, className: r }) {
|
|
|
934
993
|
}
|
|
935
994
|
//#endregion
|
|
936
995
|
//#region src/bento/bento-diff.tsx
|
|
937
|
-
function
|
|
996
|
+
function zt(e, t, n = !0) {
|
|
938
997
|
let r = e.length, i = t.length;
|
|
939
998
|
if (r * i > 4e5) return null;
|
|
940
999
|
let a = Array.from({ length: r + 1 }, () => new Uint32Array(i + 1));
|
|
@@ -951,16 +1010,16 @@ function Nt(e, t, n = !0) {
|
|
|
951
1010
|
for (; l < i;) s("add", t[l++]);
|
|
952
1011
|
return o;
|
|
953
1012
|
}
|
|
954
|
-
var
|
|
955
|
-
function
|
|
1013
|
+
var Bt = (e) => e.split(/(\s+)/).filter((e) => e !== "");
|
|
1014
|
+
function Vt(e) {
|
|
956
1015
|
if (typeof DOMParser > "u") return e.split(/<\/(?:p|h[1-6]|li|blockquote|pre|div)>/i).map((e) => e.replace(/<[^>]*>/g, "").replace(/\s+/g, " ").trim()).filter(Boolean);
|
|
957
1016
|
let t = new DOMParser().parseFromString(e, "text/html"), n = [...t.body.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, blockquote, pre")].filter((e) => !e.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote, pre")).map((e) => (e.textContent ?? "").replace(/\s+/g, " ").trim()).filter(Boolean), r = (t.body.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
958
1017
|
return n.length > 0 ? n : r ? [r] : [];
|
|
959
1018
|
}
|
|
960
|
-
var
|
|
961
|
-
function
|
|
962
|
-
let { t: o } =
|
|
963
|
-
let r = t?.[e.id], i = n?.[e.id], a = e.kind ?? "text", o = a === "rich" ?
|
|
1019
|
+
var Q = (e) => e == null ? "" : String(e);
|
|
1020
|
+
function Ht({ before: t, after: n, fields: r, showUnchanged: i = !1, layout: a = "inline" }) {
|
|
1021
|
+
let { t: o } = J(), [s, c] = W(i), l = r.map((e) => {
|
|
1022
|
+
let r = t?.[e.id], i = n?.[e.id], a = e.kind ?? "text", o = a === "rich" ? Vt(Q(r)).join("\n") === Vt(Q(i)).join("\n") : a === "value" ? JSON.stringify(r ?? null) === JSON.stringify(i ?? null) : Q(r) === Q(i), s = "changed";
|
|
964
1023
|
return t === null || (r == null || r === "") && !o ? s = "added" : n === null || (i == null || i === "") && !o ? s = "removed" : o && (s = "unchanged"), {
|
|
965
1024
|
field: e,
|
|
966
1025
|
a: r,
|
|
@@ -969,37 +1028,38 @@ function It({ before: t, after: n, fields: r, showUnchanged: i = !1, layout: a =
|
|
|
969
1028
|
state: s
|
|
970
1029
|
};
|
|
971
1030
|
}), u = l.filter((e) => e.state !== "unchanged"), d = l.filter((e) => e.state === "unchanged");
|
|
972
|
-
return /* @__PURE__ */
|
|
1031
|
+
return /* @__PURE__ */ q("div", {
|
|
973
1032
|
"data-slot": "bento-diff",
|
|
974
1033
|
className: "flex flex-col gap-3",
|
|
975
1034
|
children: [
|
|
976
|
-
(t === null || n === null) && /* @__PURE__ */
|
|
1035
|
+
(t === null || n === null) && /* @__PURE__ */ K("p", {
|
|
977
1036
|
className: "m-0 text-sm font-medium",
|
|
978
1037
|
children: t === null ? o("bento.diff.created", { defaultValue: "Created in this version" }) : o("bento.diff.deleted", { defaultValue: "Deleted in this version" })
|
|
979
1038
|
}),
|
|
980
|
-
u.length === 0 && /* @__PURE__ */
|
|
1039
|
+
u.length === 0 && /* @__PURE__ */ K("p", {
|
|
981
1040
|
className: "m-0 text-sm text-muted-foreground",
|
|
982
1041
|
children: o("bento.diff.noChanges", { defaultValue: "No field changed" })
|
|
983
1042
|
}),
|
|
984
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ K("dl", {
|
|
985
1044
|
className: "m-0 flex flex-col gap-3",
|
|
986
|
-
children: u.map((e) => /* @__PURE__ */
|
|
1045
|
+
children: u.map((e) => /* @__PURE__ */ K(Ut, {
|
|
987
1046
|
label: e.field.label,
|
|
988
1047
|
state: e.state,
|
|
989
|
-
children: /* @__PURE__ */
|
|
1048
|
+
children: /* @__PURE__ */ K(Wt, {
|
|
990
1049
|
row: e,
|
|
991
1050
|
layout: a
|
|
992
1051
|
})
|
|
993
1052
|
}, e.field.id))
|
|
994
1053
|
}),
|
|
995
|
-
d.length > 0 && /* @__PURE__ */
|
|
1054
|
+
d.length > 0 && /* @__PURE__ */ q("div", {
|
|
996
1055
|
className: "flex flex-col gap-3",
|
|
997
|
-
children: [/* @__PURE__ */
|
|
1056
|
+
children: [/* @__PURE__ */ q("button", {
|
|
998
1057
|
type: "button",
|
|
1058
|
+
"data-look": "text",
|
|
999
1059
|
"aria-expanded": s ? "true" : "false",
|
|
1000
1060
|
onClick: () => c(!s),
|
|
1001
1061
|
className: "inline-flex items-center gap-1 self-start rounded-md text-sm text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",
|
|
1002
|
-
children: [/* @__PURE__ */
|
|
1062
|
+
children: [/* @__PURE__ */ K(we, {
|
|
1003
1063
|
size: 14,
|
|
1004
1064
|
"aria-hidden": "true",
|
|
1005
1065
|
className: e("transition-transform", s && "rotate-90")
|
|
@@ -1007,14 +1067,14 @@ function It({ before: t, after: n, fields: r, showUnchanged: i = !1, layout: a =
|
|
|
1007
1067
|
defaultValue: "{{count}} unchanged",
|
|
1008
1068
|
count: d.length
|
|
1009
1069
|
})]
|
|
1010
|
-
}), s && /* @__PURE__ */
|
|
1070
|
+
}), s && /* @__PURE__ */ K("dl", {
|
|
1011
1071
|
className: "m-0 flex flex-col gap-3",
|
|
1012
|
-
children: d.map((t) => /* @__PURE__ */
|
|
1072
|
+
children: d.map((t) => /* @__PURE__ */ K(Ut, {
|
|
1013
1073
|
label: t.field.label,
|
|
1014
1074
|
state: "unchanged",
|
|
1015
|
-
children: /* @__PURE__ */
|
|
1075
|
+
children: /* @__PURE__ */ K("p", {
|
|
1016
1076
|
className: e("m-0 whitespace-pre-wrap text-sm text-muted-foreground", t.kind === "lines" && "font-mono text-xs"),
|
|
1017
|
-
children: t.kind === "rich" ?
|
|
1077
|
+
children: t.kind === "rich" ? Vt(Q(t.b)).join("\n\n") : t.field.format ? t.field.format(t.b) : Q(t.b)
|
|
1018
1078
|
})
|
|
1019
1079
|
}, t.field.id))
|
|
1020
1080
|
})]
|
|
@@ -1022,41 +1082,41 @@ function It({ before: t, after: n, fields: r, showUnchanged: i = !1, layout: a =
|
|
|
1022
1082
|
]
|
|
1023
1083
|
});
|
|
1024
1084
|
}
|
|
1025
|
-
function
|
|
1026
|
-
return /* @__PURE__ */
|
|
1085
|
+
function Ut({ label: e, state: t, children: n }) {
|
|
1086
|
+
return /* @__PURE__ */ q("div", {
|
|
1027
1087
|
className: "rounded-xl border border-border/60 bg-card/40 p-3",
|
|
1028
|
-
children: [/* @__PURE__ */
|
|
1088
|
+
children: [/* @__PURE__ */ q("dt", {
|
|
1029
1089
|
className: "mb-1.5 flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
1030
|
-
children: [/* @__PURE__ */
|
|
1031
|
-
}), /* @__PURE__ */
|
|
1090
|
+
children: [/* @__PURE__ */ K("span", { children: e }), /* @__PURE__ */ K(Rt, { state: t })]
|
|
1091
|
+
}), /* @__PURE__ */ K("dd", {
|
|
1032
1092
|
className: "m-0",
|
|
1033
1093
|
children: n
|
|
1034
1094
|
})]
|
|
1035
1095
|
});
|
|
1036
1096
|
}
|
|
1037
|
-
function
|
|
1038
|
-
let { t: n } =
|
|
1039
|
-
if (o === "lines") return /* @__PURE__ */
|
|
1097
|
+
function Wt({ row: e, layout: t }) {
|
|
1098
|
+
let { t: n } = J(), { field: r, a: i, b: a, kind: o, state: s } = e;
|
|
1099
|
+
if (o === "lines") return /* @__PURE__ */ K(Xt, {
|
|
1040
1100
|
label: r.label,
|
|
1041
|
-
before:
|
|
1042
|
-
after:
|
|
1101
|
+
before: Q(i),
|
|
1102
|
+
after: Q(a),
|
|
1043
1103
|
layout: t
|
|
1044
1104
|
});
|
|
1045
1105
|
if (o === "value") {
|
|
1046
|
-
let e = (e) => r.format ? r.format(e) :
|
|
1047
|
-
return /* @__PURE__ */
|
|
1106
|
+
let e = (e) => r.format ? r.format(e) : Q(e);
|
|
1107
|
+
return /* @__PURE__ */ q("p", {
|
|
1048
1108
|
className: "m-0 flex flex-wrap items-center gap-2 text-sm",
|
|
1049
1109
|
children: [
|
|
1050
|
-
s !== "added" && /* @__PURE__ */
|
|
1051
|
-
s === "changed" && /* @__PURE__ */
|
|
1110
|
+
s !== "added" && /* @__PURE__ */ K(ln, { children: e(i) }),
|
|
1111
|
+
s === "changed" && /* @__PURE__ */ K("span", {
|
|
1052
1112
|
"aria-hidden": "true",
|
|
1053
1113
|
children: "→"
|
|
1054
1114
|
}),
|
|
1055
|
-
s !== "removed" && /* @__PURE__ */
|
|
1115
|
+
s !== "removed" && /* @__PURE__ */ K(cn, { children: e(a) })
|
|
1056
1116
|
]
|
|
1057
1117
|
});
|
|
1058
1118
|
}
|
|
1059
|
-
let c = o === "rich" ?
|
|
1119
|
+
let c = o === "rich" ? Vt(Q(i)) : [Q(i)].filter(Boolean), l = o === "rich" ? Vt(Q(a)) : [Q(a)].filter(Boolean), u = zt(c, l, !1) ?? [...c.map((e) => ({
|
|
1060
1120
|
op: "remove",
|
|
1061
1121
|
text: e
|
|
1062
1122
|
})), ...l.map((e) => ({
|
|
@@ -1066,35 +1126,35 @@ function Rt({ row: e, layout: t }) {
|
|
|
1066
1126
|
for (let e = 0; e < u.length; e++) {
|
|
1067
1127
|
let t = u[e], n = u[e + 1];
|
|
1068
1128
|
if (t.op === "remove" && n?.op === "add") {
|
|
1069
|
-
let r =
|
|
1070
|
-
d.push(/* @__PURE__ */
|
|
1129
|
+
let r = zt(Bt(t.text), Bt(n.text));
|
|
1130
|
+
d.push(/* @__PURE__ */ K("p", {
|
|
1071
1131
|
className: "m-0 whitespace-pre-wrap text-sm leading-relaxed",
|
|
1072
|
-
children: r ? r.map((e, t) => e.op === "same" ? /* @__PURE__ */
|
|
1073
|
-
/* @__PURE__ */
|
|
1132
|
+
children: r ? r.map((e, t) => e.op === "same" ? /* @__PURE__ */ K("span", { children: e.text }, t) : e.op === "add" ? /* @__PURE__ */ K(cn, { children: e.text }, t) : /* @__PURE__ */ K(ln, { children: e.text }, t)) : [
|
|
1133
|
+
/* @__PURE__ */ K(ln, { children: t.text }, "r"),
|
|
1074
1134
|
" ",
|
|
1075
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ K(cn, { children: n.text }, "a")
|
|
1076
1136
|
]
|
|
1077
1137
|
}, e)), e++;
|
|
1078
|
-
} else d.push(/* @__PURE__ */
|
|
1138
|
+
} else d.push(/* @__PURE__ */ K("p", {
|
|
1079
1139
|
className: "m-0 whitespace-pre-wrap text-sm leading-relaxed",
|
|
1080
|
-
children: t.op === "same" ? t.text : t.op === "add" ? /* @__PURE__ */
|
|
1140
|
+
children: t.op === "same" ? t.text : t.op === "add" ? /* @__PURE__ */ K(cn, { children: t.text }) : /* @__PURE__ */ K(ln, { children: t.text })
|
|
1081
1141
|
}, e));
|
|
1082
1142
|
}
|
|
1083
|
-
return d.length === 0 ? /* @__PURE__ */
|
|
1143
|
+
return d.length === 0 ? /* @__PURE__ */ K("p", {
|
|
1084
1144
|
className: "m-0 text-sm text-muted-foreground",
|
|
1085
1145
|
children: n("bento.diff.empty", { defaultValue: "Empty" })
|
|
1086
|
-
}) : /* @__PURE__ */
|
|
1146
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1087
1147
|
className: "flex flex-col gap-2",
|
|
1088
1148
|
children: d
|
|
1089
1149
|
});
|
|
1090
1150
|
}
|
|
1091
|
-
var
|
|
1092
|
-
function
|
|
1093
|
-
let n =
|
|
1151
|
+
var Gt = 3, Kt = (e) => e === "" ? [] : e.replace(/\r?\n$/, "").split(/\r?\n/);
|
|
1152
|
+
function qt(e, t) {
|
|
1153
|
+
let n = Kt(e), r = Kt(t), i = 0;
|
|
1094
1154
|
for (; i < n.length && i < r.length && n[i] === r[i];) i++;
|
|
1095
1155
|
let a = 0;
|
|
1096
1156
|
for (; a < n.length - i && a < r.length - i && n[n.length - 1 - a] === r[r.length - 1 - a];) a++;
|
|
1097
|
-
let o =
|
|
1157
|
+
let o = zt(n.slice(i, n.length - a), r.slice(i, r.length - a), !1);
|
|
1098
1158
|
if (o === null) return null;
|
|
1099
1159
|
let s = [], c = 0, l = 0, u = (e) => s.push({
|
|
1100
1160
|
op: "same",
|
|
@@ -1105,7 +1165,7 @@ function Vt(e, t) {
|
|
|
1105
1165
|
n.slice(0, i).forEach(u);
|
|
1106
1166
|
let d = [], f = [], p = () => {
|
|
1107
1167
|
for (let e = 0; e < Math.min(d.length, f.length); e++) {
|
|
1108
|
-
let t =
|
|
1168
|
+
let t = zt(Bt(d[e].text), Bt(f[e].text));
|
|
1109
1169
|
t && (d[e].parts = t.filter((e) => e.op !== "add"), f[e].parts = t.filter((e) => e.op !== "remove"));
|
|
1110
1170
|
}
|
|
1111
1171
|
s.push(...d, ...f), d = [], f = [];
|
|
@@ -1121,7 +1181,7 @@ function Vt(e, t) {
|
|
|
1121
1181
|
}) : (p(), u(e.text));
|
|
1122
1182
|
return p(), n.slice(n.length - a).forEach(u), s;
|
|
1123
1183
|
}
|
|
1124
|
-
function
|
|
1184
|
+
function Jt(e) {
|
|
1125
1185
|
let t = [], n = 0;
|
|
1126
1186
|
for (; n < e.length;) {
|
|
1127
1187
|
if (e[n].op === "same") {
|
|
@@ -1140,10 +1200,10 @@ function Ht(e) {
|
|
|
1140
1200
|
}
|
|
1141
1201
|
return t;
|
|
1142
1202
|
}
|
|
1143
|
-
function
|
|
1203
|
+
function Yt(e, t, n) {
|
|
1144
1204
|
let r = Array(e.length).fill(!1);
|
|
1145
1205
|
e.forEach((n, i) => {
|
|
1146
|
-
if (t(n)) for (let t = Math.max(0, i -
|
|
1206
|
+
if (t(n)) for (let t = Math.max(0, i - Gt); t <= Math.min(e.length - 1, i + Gt); t++) r[t] = !0;
|
|
1147
1207
|
});
|
|
1148
1208
|
let i = [], a = 0;
|
|
1149
1209
|
for (; a < e.length;) {
|
|
@@ -1161,13 +1221,13 @@ function Ut(e, t, n) {
|
|
|
1161
1221
|
}
|
|
1162
1222
|
return i;
|
|
1163
1223
|
}
|
|
1164
|
-
function
|
|
1165
|
-
let { t: a } =
|
|
1166
|
-
if (c === null) return /* @__PURE__ */
|
|
1224
|
+
function Xt({ label: t, before: n, after: r, layout: i }) {
|
|
1225
|
+
let { t: a } = J(), [o, s] = W(/* @__PURE__ */ new Set()), c = qt(n, r);
|
|
1226
|
+
if (c === null) return /* @__PURE__ */ K("p", {
|
|
1167
1227
|
className: "m-0 text-sm text-muted-foreground",
|
|
1168
1228
|
children: a("bento.diff.tooLarge", { defaultValue: "Too many lines changed to compare them here" })
|
|
1169
1229
|
});
|
|
1170
|
-
if (c.length === 0) return /* @__PURE__ */
|
|
1230
|
+
if (c.length === 0) return /* @__PURE__ */ K("p", {
|
|
1171
1231
|
className: "m-0 text-sm text-muted-foreground",
|
|
1172
1232
|
children: a("bento.diff.empty", { defaultValue: "Empty" })
|
|
1173
1233
|
});
|
|
@@ -1177,15 +1237,16 @@ function Wt({ label: t, before: n, after: r, layout: i }) {
|
|
|
1177
1237
|
};
|
|
1178
1238
|
function u(t, n, r) {
|
|
1179
1239
|
let i = o.has(t.key);
|
|
1180
|
-
return [/* @__PURE__ */
|
|
1240
|
+
return [/* @__PURE__ */ K("tr", { children: /* @__PURE__ */ K("td", {
|
|
1181
1241
|
colSpan: n,
|
|
1182
1242
|
className: "bg-muted/40 px-2",
|
|
1183
|
-
children: /* @__PURE__ */
|
|
1243
|
+
children: /* @__PURE__ */ q("button", {
|
|
1184
1244
|
type: "button",
|
|
1245
|
+
"data-look": "text",
|
|
1185
1246
|
"aria-expanded": i ? "true" : "false",
|
|
1186
1247
|
onClick: () => l(t.key),
|
|
1187
1248
|
className: "inline-flex items-center gap-1 rounded-md font-sans text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",
|
|
1188
|
-
children: [/* @__PURE__ */
|
|
1249
|
+
children: [/* @__PURE__ */ K(we, {
|
|
1189
1250
|
size: 12,
|
|
1190
1251
|
"aria-hidden": "true",
|
|
1191
1252
|
className: e("transition-transform", i && "rotate-90")
|
|
@@ -1196,141 +1257,210 @@ function Wt({ label: t, before: n, after: r, layout: i }) {
|
|
|
1196
1257
|
})
|
|
1197
1258
|
}) }, `fold-${t.key}`), ...i ? t.items.map(r) : []];
|
|
1198
1259
|
}
|
|
1199
|
-
let d = (t) => /* @__PURE__ */
|
|
1260
|
+
let d = (t) => /* @__PURE__ */ K("table", {
|
|
1200
1261
|
"data-layout": "inline",
|
|
1201
1262
|
className: e("min-w-full border-collapse font-mono text-mono leading-5", t),
|
|
1202
|
-
children: /* @__PURE__ */
|
|
1203
|
-
let t = (e) => /* @__PURE__ */
|
|
1263
|
+
children: /* @__PURE__ */ K("tbody", { children: Yt(c, (e) => e.op !== "same", Zt).map((e) => {
|
|
1264
|
+
let t = (e) => /* @__PURE__ */ K(rn, { row: e }, Zt(e));
|
|
1204
1265
|
return e.fold ? u(e, 4, t) : e.items.map(t);
|
|
1205
1266
|
}) })
|
|
1206
1267
|
});
|
|
1207
|
-
return /* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ K("section", {
|
|
1208
1269
|
"aria-label": t,
|
|
1209
1270
|
tabIndex: 0,
|
|
1210
1271
|
className: "@container/diff overflow-x-auto rounded-md border border-border/60 focus-visible:outline-2 focus-visible:outline-ring",
|
|
1211
|
-
children: i === "split" ? /* @__PURE__ */
|
|
1272
|
+
children: i === "split" ? /* @__PURE__ */ q(G, { children: [d("@3xl/diff:hidden"), ((t) => /* @__PURE__ */ q("table", {
|
|
1212
1273
|
"data-layout": "split",
|
|
1213
1274
|
className: e("w-full table-fixed border-collapse font-mono text-mono leading-5", t),
|
|
1214
|
-
children: [/* @__PURE__ */
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1218
|
-
/* @__PURE__ */
|
|
1219
|
-
/* @__PURE__ */
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
] }), /* @__PURE__ */
|
|
1222
|
-
let t = (e) => /* @__PURE__ */
|
|
1275
|
+
children: [/* @__PURE__ */ q("colgroup", { children: [
|
|
1276
|
+
/* @__PURE__ */ K("col", { className: "w-14" }),
|
|
1277
|
+
/* @__PURE__ */ K("col", { className: "w-5" }),
|
|
1278
|
+
/* @__PURE__ */ K("col", {}),
|
|
1279
|
+
/* @__PURE__ */ K("col", { className: "w-14" }),
|
|
1280
|
+
/* @__PURE__ */ K("col", { className: "w-5" }),
|
|
1281
|
+
/* @__PURE__ */ K("col", {})
|
|
1282
|
+
] }), /* @__PURE__ */ K("tbody", { children: Yt(Jt(c), (e) => e.left?.op !== "same", Qt).map((e) => {
|
|
1283
|
+
let t = (e) => /* @__PURE__ */ K(an, { pair: e }, Qt(e));
|
|
1223
1284
|
return e.fold ? u(e, 6, t) : e.items.map(t);
|
|
1224
1285
|
}) })]
|
|
1225
1286
|
}))("hidden @3xl/diff:table")] }) : d()
|
|
1226
1287
|
});
|
|
1227
1288
|
}
|
|
1228
|
-
var
|
|
1229
|
-
function
|
|
1230
|
-
return e.parts ? e.parts.map((e, t) => e.op === "add" ? /* @__PURE__ */
|
|
1289
|
+
var Zt = (e) => `${e.old ?? ""}:${e.new ?? ""}`, Qt = (e) => `${e.left?.old ?? ""}:${e.right?.new ?? ""}`, $t = (t) => e(t.op === "add" && "bento-status bento-status-on", t.op === "remove" && "bento-status bento-status-error");
|
|
1290
|
+
function en(e) {
|
|
1291
|
+
return e.parts ? e.parts.map((e, t) => e.op === "add" ? /* @__PURE__ */ K(cn, { children: e.text }, t) : e.op === "remove" ? /* @__PURE__ */ K(ln, { children: e.text }, t) : /* @__PURE__ */ K("span", { children: e.text }, t)) : e.op === "same" ? e.text : /* @__PURE__ */ K(sn, {
|
|
1231
1292
|
op: e.op,
|
|
1232
1293
|
children: e.text
|
|
1233
1294
|
});
|
|
1234
1295
|
}
|
|
1235
|
-
var
|
|
1296
|
+
var tn = {
|
|
1236
1297
|
same: " ",
|
|
1237
1298
|
add: "+",
|
|
1238
1299
|
remove: "−"
|
|
1239
|
-
},
|
|
1240
|
-
function
|
|
1241
|
-
let n =
|
|
1242
|
-
return /* @__PURE__ */
|
|
1300
|
+
}, nn = "select-none px-2 text-right align-top text-muted-foreground tabular-nums";
|
|
1301
|
+
function rn({ row: t }) {
|
|
1302
|
+
let n = $t(t);
|
|
1303
|
+
return /* @__PURE__ */ q("tr", {
|
|
1243
1304
|
"data-op": t.op,
|
|
1244
1305
|
children: [
|
|
1245
|
-
/* @__PURE__ */
|
|
1246
|
-
className: e("w-px",
|
|
1306
|
+
/* @__PURE__ */ K("td", {
|
|
1307
|
+
className: e("w-px", nn, n),
|
|
1247
1308
|
children: t.old
|
|
1248
1309
|
}),
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
className: e("w-px",
|
|
1310
|
+
/* @__PURE__ */ K("td", {
|
|
1311
|
+
className: e("w-px", nn, n),
|
|
1251
1312
|
children: t.new
|
|
1252
1313
|
}),
|
|
1253
|
-
/* @__PURE__ */
|
|
1314
|
+
/* @__PURE__ */ K("td", {
|
|
1254
1315
|
"aria-hidden": "true",
|
|
1255
1316
|
className: e("w-px select-none pr-1", n),
|
|
1256
|
-
children:
|
|
1317
|
+
children: tn[t.op]
|
|
1257
1318
|
}),
|
|
1258
|
-
/* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ K("td", {
|
|
1259
1320
|
className: e("whitespace-pre pr-3", !t.parts && n),
|
|
1260
|
-
children:
|
|
1321
|
+
children: en(t)
|
|
1261
1322
|
})
|
|
1262
1323
|
]
|
|
1263
1324
|
});
|
|
1264
1325
|
}
|
|
1265
|
-
function
|
|
1266
|
-
return /* @__PURE__ */
|
|
1326
|
+
function an({ pair: e }) {
|
|
1327
|
+
return /* @__PURE__ */ q("tr", {
|
|
1267
1328
|
"data-op": e.left?.op === "same" ? "same" : "change",
|
|
1268
|
-
children: [/* @__PURE__ */
|
|
1329
|
+
children: [/* @__PURE__ */ K(on, {
|
|
1269
1330
|
row: e.left,
|
|
1270
1331
|
number: e.left?.old
|
|
1271
|
-
}), /* @__PURE__ */
|
|
1332
|
+
}), /* @__PURE__ */ K(on, {
|
|
1272
1333
|
row: e.right,
|
|
1273
1334
|
number: e.right?.new,
|
|
1274
1335
|
right: !0
|
|
1275
1336
|
})]
|
|
1276
1337
|
});
|
|
1277
1338
|
}
|
|
1278
|
-
function
|
|
1279
|
-
if (t === null) return /* @__PURE__ */
|
|
1339
|
+
function on({ row: t, number: n, right: r = !1 }) {
|
|
1340
|
+
if (t === null) return /* @__PURE__ */ K("td", {
|
|
1280
1341
|
colSpan: 3,
|
|
1281
1342
|
"data-empty": "",
|
|
1282
1343
|
className: e("[background-image:repeating-linear-gradient(-45deg,var(--color-border)_0_1px,transparent_0_6px)]", r && "border-l border-border/60")
|
|
1283
1344
|
});
|
|
1284
|
-
let i =
|
|
1285
|
-
return /* @__PURE__ */
|
|
1286
|
-
/* @__PURE__ */
|
|
1287
|
-
className: e(
|
|
1345
|
+
let i = $t(t);
|
|
1346
|
+
return /* @__PURE__ */ q(G, { children: [
|
|
1347
|
+
/* @__PURE__ */ K("td", {
|
|
1348
|
+
className: e(nn, i, r && "border-l border-border/60"),
|
|
1288
1349
|
children: n
|
|
1289
1350
|
}),
|
|
1290
|
-
/* @__PURE__ */
|
|
1351
|
+
/* @__PURE__ */ K("td", {
|
|
1291
1352
|
"aria-hidden": "true",
|
|
1292
1353
|
className: e("select-none align-top", i),
|
|
1293
|
-
children:
|
|
1354
|
+
children: tn[t.op]
|
|
1294
1355
|
}),
|
|
1295
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ K("td", {
|
|
1296
1357
|
className: e("whitespace-pre-wrap pr-3 [overflow-wrap:anywhere]", !t.parts && i),
|
|
1297
|
-
children:
|
|
1358
|
+
children: en(t)
|
|
1298
1359
|
})
|
|
1299
1360
|
] });
|
|
1300
1361
|
}
|
|
1301
|
-
function
|
|
1302
|
-
let { t: n } =
|
|
1303
|
-
return /* @__PURE__ */
|
|
1362
|
+
function sn({ op: e, children: t }) {
|
|
1363
|
+
let { t: n } = J();
|
|
1364
|
+
return /* @__PURE__ */ q(e === "add" ? "ins" : "del", {
|
|
1304
1365
|
className: "no-underline",
|
|
1305
|
-
children: [/* @__PURE__ */
|
|
1366
|
+
children: [/* @__PURE__ */ q("span", {
|
|
1306
1367
|
className: "sr-only",
|
|
1307
1368
|
children: [e === "add" ? n("bento.diff.addedStart", { defaultValue: "added:" }) : n("bento.diff.removedStart", { defaultValue: "removed:" }), " "]
|
|
1308
1369
|
}), t]
|
|
1309
1370
|
});
|
|
1310
1371
|
}
|
|
1311
|
-
function
|
|
1312
|
-
let { t } =
|
|
1313
|
-
return /* @__PURE__ */
|
|
1372
|
+
function cn({ children: e }) {
|
|
1373
|
+
let { t } = J();
|
|
1374
|
+
return /* @__PURE__ */ q("ins", {
|
|
1314
1375
|
className: "bento-status bento-status-on rounded-sm px-0.5 underline decoration-2 underline-offset-2",
|
|
1315
|
-
children: [/* @__PURE__ */
|
|
1376
|
+
children: [/* @__PURE__ */ q("span", {
|
|
1316
1377
|
className: "sr-only",
|
|
1317
1378
|
children: [t("bento.diff.addedStart", { defaultValue: "added:" }), " "]
|
|
1318
1379
|
}), e]
|
|
1319
1380
|
});
|
|
1320
1381
|
}
|
|
1321
|
-
function
|
|
1322
|
-
let { t } =
|
|
1323
|
-
return /* @__PURE__ */
|
|
1382
|
+
function ln({ children: e }) {
|
|
1383
|
+
let { t } = J();
|
|
1384
|
+
return /* @__PURE__ */ q("del", {
|
|
1324
1385
|
className: "bento-status bento-status-error rounded-sm px-0.5 line-through decoration-2",
|
|
1325
|
-
children: [/* @__PURE__ */
|
|
1386
|
+
children: [/* @__PURE__ */ q("span", {
|
|
1326
1387
|
className: "sr-only",
|
|
1327
1388
|
children: [t("bento.diff.removedStart", { defaultValue: "removed:" }), " "]
|
|
1328
1389
|
}), e]
|
|
1329
1390
|
});
|
|
1330
1391
|
}
|
|
1331
1392
|
//#endregion
|
|
1393
|
+
//#region src/bento/bento-change-cell.tsx
|
|
1394
|
+
var un = 6e4, dn = 60 * un, fn = 24 * dn, pn = 30 * fn;
|
|
1395
|
+
function mn(e, t, n) {
|
|
1396
|
+
let r = e.getTime() - t, i = Math.abs(r);
|
|
1397
|
+
return i < un ? n.format(0, "second") : i < dn ? n.format(Math.round(r / un), "minute") : i < fn ? n.format(Math.round(r / dn), "hour") : n.format(Math.round(r / fn), "day");
|
|
1398
|
+
}
|
|
1399
|
+
function hn({ at: t, actor: n, agent: r = !1, now: i, className: a }) {
|
|
1400
|
+
let { t: o, i18n: s } = J(), c = new Date(t), l = !Number.isNaN(c.getTime()), [u] = W(() => Date.now()), d = i === void 0 ? u : new Date(i).getTime(), f = s?.resolvedLanguage ?? s?.language, p = String(t), m = String(t);
|
|
1401
|
+
return l && (m = new Intl.DateTimeFormat(f, {
|
|
1402
|
+
dateStyle: "long",
|
|
1403
|
+
timeStyle: "short"
|
|
1404
|
+
}).format(c), p = Math.abs(c.getTime() - d) < pn ? mn(c, d, new Intl.RelativeTimeFormat(f, { numeric: "auto" })) : new Intl.DateTimeFormat(f, { dateStyle: "medium" }).format(c)), /* @__PURE__ */ q("span", {
|
|
1405
|
+
"data-slot": "bento-change-cell",
|
|
1406
|
+
className: e("flex min-w-0 flex-col", a),
|
|
1407
|
+
children: [/* @__PURE__ */ q("time", {
|
|
1408
|
+
dateTime: l ? c.toISOString() : void 0,
|
|
1409
|
+
title: m,
|
|
1410
|
+
className: "truncate text-foreground",
|
|
1411
|
+
children: [/* @__PURE__ */ K("span", {
|
|
1412
|
+
"aria-hidden": "true",
|
|
1413
|
+
children: p
|
|
1414
|
+
}), /* @__PURE__ */ K("span", {
|
|
1415
|
+
className: "sr-only",
|
|
1416
|
+
children: m
|
|
1417
|
+
})]
|
|
1418
|
+
}), n != null && /* @__PURE__ */ q("span", {
|
|
1419
|
+
className: "flex min-w-0 items-center gap-1 text-xs text-muted-foreground",
|
|
1420
|
+
children: [r && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(Ie, {
|
|
1421
|
+
size: 12,
|
|
1422
|
+
"aria-hidden": "true",
|
|
1423
|
+
className: "shrink-0"
|
|
1424
|
+
}), /* @__PURE__ */ K("span", {
|
|
1425
|
+
className: "sr-only",
|
|
1426
|
+
children: o("bento.versions.agent", { defaultValue: "Agent" })
|
|
1427
|
+
})] }), /* @__PURE__ */ K("span", {
|
|
1428
|
+
className: "truncate",
|
|
1429
|
+
children: n
|
|
1430
|
+
})]
|
|
1431
|
+
})]
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
//#endregion
|
|
1435
|
+
//#region src/bento/bento-identity-cell.tsx
|
|
1436
|
+
function gn(e) {
|
|
1437
|
+
let t = 0;
|
|
1438
|
+
for (let n of e) t = t * 31 + (n.codePointAt(0) ?? 0) >>> 0;
|
|
1439
|
+
return gt[t % gt.length];
|
|
1440
|
+
}
|
|
1441
|
+
function _n({ name: t, detail: n, tone: r, className: i }) {
|
|
1442
|
+
return /* @__PURE__ */ q("span", {
|
|
1443
|
+
"data-slot": "bento-identity-cell",
|
|
1444
|
+
className: e("flex min-w-0 items-center gap-2.5", i),
|
|
1445
|
+
children: [/* @__PURE__ */ K("span", {
|
|
1446
|
+
"aria-hidden": "true",
|
|
1447
|
+
className: e(_t(r ?? gn(t)), "grid size-8 shrink-0 place-items-center rounded-lg text-xs font-semibold text-white"),
|
|
1448
|
+
children: D({ name: t })
|
|
1449
|
+
}), /* @__PURE__ */ q("span", {
|
|
1450
|
+
className: "flex min-w-0 flex-col",
|
|
1451
|
+
children: [/* @__PURE__ */ K("span", {
|
|
1452
|
+
className: "truncate font-medium text-foreground",
|
|
1453
|
+
children: t
|
|
1454
|
+
}), n != null && /* @__PURE__ */ K("span", {
|
|
1455
|
+
className: "truncate text-xs text-muted-foreground",
|
|
1456
|
+
children: n
|
|
1457
|
+
})]
|
|
1458
|
+
})]
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1461
|
+
//#endregion
|
|
1332
1462
|
//#region src/bento/bento-split-page.tsx
|
|
1333
|
-
var
|
|
1463
|
+
var vn = ["primary", "secondary"], yn = {
|
|
1334
1464
|
getItem: (e) => {
|
|
1335
1465
|
try {
|
|
1336
1466
|
return window.localStorage.getItem(e);
|
|
@@ -1343,69 +1473,69 @@ var rn = ["primary", "secondary"], an = {
|
|
|
1343
1473
|
window.localStorage.setItem(e, t);
|
|
1344
1474
|
} catch {}
|
|
1345
1475
|
}
|
|
1346
|
-
},
|
|
1476
|
+
}, bn = {
|
|
1347
1477
|
getItem: () => null,
|
|
1348
1478
|
setItem: () => {}
|
|
1349
1479
|
};
|
|
1350
|
-
function
|
|
1351
|
-
let { t: c } =
|
|
1480
|
+
function xn({ primary: t, secondary: n, primaryLabel: r, secondaryLabel: i, storageKey: a, defaultRatio: o = 50, className: s }) {
|
|
1481
|
+
let { t: c } = J(), l = re(), u = Ge({
|
|
1352
1482
|
id: a ?? "bento-split-page",
|
|
1353
|
-
panelIds:
|
|
1354
|
-
storage: a ?
|
|
1483
|
+
panelIds: vn,
|
|
1484
|
+
storage: a ? yn : bn
|
|
1355
1485
|
});
|
|
1356
|
-
return
|
|
1486
|
+
return l ? /* @__PURE__ */ q(te, {
|
|
1357
1487
|
"data-slot": "bento-split-page",
|
|
1358
1488
|
defaultValue: "primary",
|
|
1359
1489
|
className: e("flex flex-col gap-3", s),
|
|
1360
1490
|
children: [
|
|
1361
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ q(k, {
|
|
1362
1492
|
"aria-label": c("bento.split.switch", { defaultValue: "Show" }),
|
|
1363
1493
|
className: "self-start",
|
|
1364
|
-
children: [/* @__PURE__ */
|
|
1494
|
+
children: [/* @__PURE__ */ K(O, {
|
|
1365
1495
|
value: "primary",
|
|
1366
1496
|
children: r
|
|
1367
|
-
}), /* @__PURE__ */
|
|
1497
|
+
}), /* @__PURE__ */ K(O, {
|
|
1368
1498
|
value: "secondary",
|
|
1369
1499
|
children: i
|
|
1370
1500
|
})]
|
|
1371
1501
|
}),
|
|
1372
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ K(P, {
|
|
1373
1503
|
value: "primary",
|
|
1374
1504
|
forceMount: !0,
|
|
1375
1505
|
className: "data-[state=inactive]:hidden",
|
|
1376
1506
|
children: t
|
|
1377
1507
|
}),
|
|
1378
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ K(P, {
|
|
1379
1509
|
value: "secondary",
|
|
1380
1510
|
forceMount: !0,
|
|
1381
1511
|
className: "data-[state=inactive]:hidden",
|
|
1382
1512
|
children: n
|
|
1383
1513
|
})
|
|
1384
1514
|
]
|
|
1385
|
-
}) : /* @__PURE__ */
|
|
1515
|
+
}) : /* @__PURE__ */ K("div", {
|
|
1386
1516
|
"data-slot": "bento-split-page",
|
|
1387
1517
|
className: e("h-[var(--bento-split-height,calc(100dvh-12rem))] min-h-80", s),
|
|
1388
|
-
children: /* @__PURE__ */
|
|
1518
|
+
children: /* @__PURE__ */ q(y, {
|
|
1389
1519
|
orientation: "horizontal",
|
|
1390
|
-
defaultLayout:
|
|
1391
|
-
onLayoutChanged:
|
|
1520
|
+
defaultLayout: u.defaultLayout,
|
|
1521
|
+
onLayoutChanged: u.onLayoutChanged,
|
|
1392
1522
|
children: [
|
|
1393
|
-
/* @__PURE__ */
|
|
1523
|
+
/* @__PURE__ */ K(d, {
|
|
1394
1524
|
id: "primary",
|
|
1395
1525
|
defaultSize: `${o}`,
|
|
1396
1526
|
minSize: "25",
|
|
1397
|
-
children: /* @__PURE__ */
|
|
1527
|
+
children: /* @__PURE__ */ K("section", {
|
|
1398
1528
|
"aria-label": r,
|
|
1399
1529
|
className: "h-full overflow-y-auto pr-3",
|
|
1400
1530
|
children: t
|
|
1401
1531
|
})
|
|
1402
1532
|
}),
|
|
1403
|
-
/* @__PURE__ */
|
|
1404
|
-
/* @__PURE__ */
|
|
1533
|
+
/* @__PURE__ */ K(f, { withHandle: !0 }),
|
|
1534
|
+
/* @__PURE__ */ K(d, {
|
|
1405
1535
|
id: "secondary",
|
|
1406
1536
|
defaultSize: `${100 - o}`,
|
|
1407
1537
|
minSize: "25",
|
|
1408
|
-
children: /* @__PURE__ */
|
|
1538
|
+
children: /* @__PURE__ */ K("section", {
|
|
1409
1539
|
"aria-label": i,
|
|
1410
1540
|
className: "h-full overflow-y-auto pl-3",
|
|
1411
1541
|
children: n
|
|
@@ -1417,22 +1547,22 @@ function sn({ primary: t, secondary: n, primaryLabel: r, secondaryLabel: i, stor
|
|
|
1417
1547
|
}
|
|
1418
1548
|
//#endregion
|
|
1419
1549
|
//#region src/bento/bento-calendar.tsx
|
|
1420
|
-
var
|
|
1550
|
+
var $ = ({ y: e, m: t, d: n }) => `${e}-${String(t).padStart(2, "0")}-${String(n).padStart(2, "0")}`, Sn = ({ y: e, m: t, d: n }) => Date.UTC(e, t - 1, n), Cn = (e) => {
|
|
1421
1551
|
let t = new Date(e);
|
|
1422
1552
|
return {
|
|
1423
1553
|
y: t.getUTCFullYear(),
|
|
1424
1554
|
m: t.getUTCMonth() + 1,
|
|
1425
1555
|
d: t.getUTCDate()
|
|
1426
1556
|
};
|
|
1427
|
-
},
|
|
1557
|
+
}, wn = (e, t) => Cn(Sn(e) + t * 864e5), Tn = (e, t) => {
|
|
1428
1558
|
let n = new Date(Date.UTC(e.y, e.m - 1 + t, 1)), r = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth() + 1, 0)).getUTCDate();
|
|
1429
1559
|
return {
|
|
1430
1560
|
y: n.getUTCFullYear(),
|
|
1431
1561
|
m: n.getUTCMonth() + 1,
|
|
1432
1562
|
d: Math.min(e.d, r)
|
|
1433
1563
|
};
|
|
1434
|
-
},
|
|
1435
|
-
function
|
|
1564
|
+
}, En = (e) => new Date(Sn(e)).getUTCDay();
|
|
1565
|
+
function Dn(e, t) {
|
|
1436
1566
|
let n = new Intl.DateTimeFormat("en-US", {
|
|
1437
1567
|
timeZone: t,
|
|
1438
1568
|
year: "numeric",
|
|
@@ -1452,46 +1582,46 @@ function dn(e, t) {
|
|
|
1452
1582
|
s: r("second")
|
|
1453
1583
|
};
|
|
1454
1584
|
}
|
|
1455
|
-
function
|
|
1585
|
+
function On(e, t, n, r, i, a) {
|
|
1456
1586
|
let o = Date.UTC(e.y, e.m - 1, e.d, t, n, r), s = (e) => {
|
|
1457
|
-
let t =
|
|
1587
|
+
let t = Dn(e, a);
|
|
1458
1588
|
return Date.UTC(t.y, t.m - 1, t.d, t.h, t.mi, t.s) - Math.floor(e / 1e3) * 1e3;
|
|
1459
1589
|
}, c = o - s(o), l = s(c);
|
|
1460
1590
|
return o - l !== c && (c = o - l), new Date(c + i);
|
|
1461
1591
|
}
|
|
1462
|
-
var
|
|
1592
|
+
var kn = {
|
|
1463
1593
|
on: "bento-status bento-status-on",
|
|
1464
1594
|
warn: "bento-status bento-status-warn",
|
|
1465
1595
|
error: "bento-status bento-status-error"
|
|
1466
1596
|
};
|
|
1467
|
-
function
|
|
1468
|
-
let { t: p, i18n: m } =
|
|
1469
|
-
let t =
|
|
1597
|
+
function An({ entries: t, view: n, defaultView: r = "month", onViewChange: i, defaultDate: a, timeZone: o = Intl.DateTimeFormat().resolvedOptions().timeZone, weekStartsOn: s = 0, onEntryMove: c, onEntrySelect: l, onRangeChange: u, label: d, className: f }) {
|
|
1598
|
+
let { t: p, i18n: m } = J(), h = m?.resolvedLanguage ?? m?.language, g = (e) => {
|
|
1599
|
+
let t = Dn(new Date(e).getTime(), o);
|
|
1470
1600
|
return {
|
|
1471
1601
|
y: t.y,
|
|
1472
1602
|
m: t.m,
|
|
1473
1603
|
d: t.d
|
|
1474
1604
|
};
|
|
1475
|
-
}, [_, v] =
|
|
1605
|
+
}, [_, v] = W(r), y = n ?? _, [b, x] = W(() => g(a ?? Date.now())), [S, C] = W(null), [w, T] = W(null), [E, D] = W(""), O = U(/* @__PURE__ */ new Map()), k = U(!1), A = H(), [j] = W(() => $(g(Date.now()))), M = (e) => wn(e, -((En(e) - s + 7) % 7)), N = M(y === "month" ? {
|
|
1476
1606
|
...b,
|
|
1477
1607
|
d: 1
|
|
1478
|
-
} : b),
|
|
1608
|
+
} : b), P = y === "month" ? Math.ceil((Sn(Tn({
|
|
1479
1609
|
...b,
|
|
1480
1610
|
d: 1
|
|
1481
|
-
}, 1)) -
|
|
1482
|
-
|
|
1611
|
+
}, 1)) - Sn(N)) / 6048e5) : 1, F = Array.from({ length: P }, (e, t) => Array.from({ length: 7 }, (e, n) => wn(N, t * 7 + n))), ee = wn(N, P * 7), te = `${$(N)}/${$(ee)}`;
|
|
1612
|
+
V(() => {
|
|
1483
1613
|
u?.({
|
|
1484
|
-
start:
|
|
1485
|
-
end:
|
|
1614
|
+
start: On(N, 0, 0, 0, 0, o),
|
|
1615
|
+
end: On(ee, 0, 0, 0, 0, o)
|
|
1486
1616
|
});
|
|
1487
|
-
}, [
|
|
1488
|
-
|
|
1617
|
+
}, [te, o]), V(() => {
|
|
1618
|
+
k.current && (k.current = !1, O.current.get($(b))?.focus());
|
|
1489
1619
|
});
|
|
1490
1620
|
let I = /* @__PURE__ */ new Map();
|
|
1491
1621
|
for (let e of t) {
|
|
1492
1622
|
let t = new Date(e.start).getTime();
|
|
1493
1623
|
if (Number.isNaN(t)) continue;
|
|
1494
|
-
let n =
|
|
1624
|
+
let n = $(g(t)), r = I.get(n) ?? [];
|
|
1495
1625
|
r.push({
|
|
1496
1626
|
entry: e,
|
|
1497
1627
|
time: t
|
|
@@ -1501,63 +1631,63 @@ function mn({ entries: t, view: n, defaultView: r = "month", onViewChange: i, de
|
|
|
1501
1631
|
let L = (e) => new Intl.DateTimeFormat(h, {
|
|
1502
1632
|
...e,
|
|
1503
1633
|
timeZone: "UTC"
|
|
1504
|
-
}), ne = (e) => L({ dateStyle: "full" }).format(
|
|
1634
|
+
}), ne = (e) => L({ dateStyle: "full" }).format(Sn(e)), R = (e) => new Intl.DateTimeFormat(h, {
|
|
1505
1635
|
timeStyle: "short",
|
|
1506
1636
|
timeZone: o
|
|
1507
|
-
}).format(e),
|
|
1637
|
+
}).format(e), z = y === "month" ? L({
|
|
1508
1638
|
month: "long",
|
|
1509
1639
|
year: "numeric"
|
|
1510
|
-
}).format(
|
|
1640
|
+
}).format(Sn({
|
|
1511
1641
|
...b,
|
|
1512
1642
|
d: 1
|
|
1513
|
-
})) : `${L({ dateStyle: "medium" }).format(
|
|
1514
|
-
function
|
|
1515
|
-
|
|
1643
|
+
})) : `${L({ dateStyle: "medium" }).format(Sn(N))} – ${L({ dateStyle: "medium" }).format(Sn(wn(ee, -1)))}`;
|
|
1644
|
+
function B(e) {
|
|
1645
|
+
k.current = !0, x(e);
|
|
1516
1646
|
}
|
|
1517
|
-
function
|
|
1647
|
+
function re(e) {
|
|
1518
1648
|
n === void 0 && v(e), i?.(e);
|
|
1519
1649
|
}
|
|
1520
|
-
let
|
|
1521
|
-
function
|
|
1650
|
+
let ie = (e) => y === "month" ? Tn(b, e) : wn(b, 7 * e);
|
|
1651
|
+
function ae(e, n) {
|
|
1522
1652
|
let r = t.find((t) => t.id === e);
|
|
1523
1653
|
if (!r || !c) return;
|
|
1524
|
-
let i = new Date(r.start).getTime(), a =
|
|
1525
|
-
|
|
1654
|
+
let i = new Date(r.start).getTime(), a = Dn(i, o);
|
|
1655
|
+
$(a) !== $(n) && c(e, On(n, a.h, a.mi, a.s, i % 1e3, o)), D(p("bento.calendar.moved", {
|
|
1526
1656
|
defaultValue: "Moved {{label}} to {{day}}.",
|
|
1527
1657
|
label: r.label,
|
|
1528
1658
|
day: ne(n)
|
|
1529
1659
|
}));
|
|
1530
1660
|
}
|
|
1531
|
-
function
|
|
1661
|
+
function oe(e, n) {
|
|
1532
1662
|
let r = {
|
|
1533
|
-
ArrowLeft: () =>
|
|
1534
|
-
ArrowRight: () =>
|
|
1535
|
-
ArrowUp: () =>
|
|
1536
|
-
ArrowDown: () =>
|
|
1537
|
-
Home: () =>
|
|
1538
|
-
End: () =>
|
|
1539
|
-
PageUp: () =>
|
|
1540
|
-
PageDown: () =>
|
|
1663
|
+
ArrowLeft: () => wn(n, -1),
|
|
1664
|
+
ArrowRight: () => wn(n, 1),
|
|
1665
|
+
ArrowUp: () => wn(n, -7),
|
|
1666
|
+
ArrowDown: () => wn(n, 7),
|
|
1667
|
+
Home: () => M(n),
|
|
1668
|
+
End: () => wn(M(n), 6),
|
|
1669
|
+
PageUp: () => ie(-1),
|
|
1670
|
+
PageDown: () => ie(1)
|
|
1541
1671
|
}[e.key];
|
|
1542
1672
|
if (r) {
|
|
1543
|
-
e.preventDefault(),
|
|
1673
|
+
e.preventDefault(), B(r());
|
|
1544
1674
|
return;
|
|
1545
1675
|
}
|
|
1546
|
-
if (S && (e.key === "Enter" || e.key === " ")) e.preventDefault(),
|
|
1676
|
+
if (S && (e.key === "Enter" || e.key === " ")) e.preventDefault(), ae(S, n), C(null);
|
|
1547
1677
|
else if (S && e.key === "Escape") {
|
|
1548
1678
|
e.preventDefault();
|
|
1549
1679
|
let n = t.find((e) => e.id === S);
|
|
1550
|
-
C(null),
|
|
1680
|
+
C(null), D(p("bento.calendar.cancelled", {
|
|
1551
1681
|
defaultValue: "Put {{label}} back.",
|
|
1552
1682
|
label: n?.label ?? ""
|
|
1553
1683
|
}));
|
|
1554
1684
|
} else e.key === "Enter" && (e.preventDefault(), e.currentTarget.querySelector("button")?.focus());
|
|
1555
1685
|
}
|
|
1556
|
-
function
|
|
1686
|
+
function se(e, t) {
|
|
1557
1687
|
let n = e.currentTarget.closest("td"), r = n ? [...n.querySelectorAll("button")] : [], i = r.indexOf(e.currentTarget), a = c && (e.key === " " || e.key === "Enter" && !l);
|
|
1558
1688
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") r[i + (e.key === "ArrowDown" ? 1 : -1)]?.focus();
|
|
1559
1689
|
else if (e.key === "Escape") n?.focus();
|
|
1560
|
-
else if (a) C(t.id),
|
|
1690
|
+
else if (a) C(t.id), D(p("bento.calendar.picked", {
|
|
1561
1691
|
defaultValue: "Picked up {{label}}. Choose a day and press Enter.",
|
|
1562
1692
|
label: t.label
|
|
1563
1693
|
})), n?.focus();
|
|
@@ -1565,86 +1695,86 @@ function mn({ entries: t, view: n, defaultView: r = "month", onViewChange: i, de
|
|
|
1565
1695
|
else return;
|
|
1566
1696
|
e.preventDefault(), e.stopPropagation();
|
|
1567
1697
|
}
|
|
1568
|
-
function
|
|
1698
|
+
function ce(e, t) {
|
|
1569
1699
|
let n = w ?? e.dataTransfer.getData("text/plain");
|
|
1570
|
-
T(null), n && (e.preventDefault(),
|
|
1700
|
+
T(null), n && (e.preventDefault(), ae(n, t));
|
|
1571
1701
|
}
|
|
1572
|
-
let
|
|
1573
|
-
return /* @__PURE__ */
|
|
1702
|
+
let le = c ? A : void 0;
|
|
1703
|
+
return /* @__PURE__ */ q("div", {
|
|
1574
1704
|
"data-slot": "bento-calendar",
|
|
1575
1705
|
className: e("flex flex-col gap-3", f),
|
|
1576
1706
|
children: [
|
|
1577
|
-
/* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ q("div", {
|
|
1578
1708
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
1579
|
-
children: [/* @__PURE__ */
|
|
1709
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1580
1710
|
className: "flex items-center gap-1",
|
|
1581
1711
|
children: [
|
|
1582
|
-
/* @__PURE__ */
|
|
1712
|
+
/* @__PURE__ */ K(jn, {
|
|
1583
1713
|
label: p("bento.calendar.previous", { defaultValue: "Previous" }),
|
|
1584
|
-
onClick: () => x(
|
|
1585
|
-
children: /* @__PURE__ */
|
|
1714
|
+
onClick: () => x(ie(-1)),
|
|
1715
|
+
children: /* @__PURE__ */ K(Ce, {
|
|
1586
1716
|
size: 16,
|
|
1587
1717
|
"aria-hidden": "true"
|
|
1588
1718
|
})
|
|
1589
1719
|
}),
|
|
1590
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ K(jn, {
|
|
1591
1721
|
label: p("bento.calendar.next", { defaultValue: "Next" }),
|
|
1592
|
-
onClick: () => x(
|
|
1593
|
-
children: /* @__PURE__ */
|
|
1722
|
+
onClick: () => x(ie(1)),
|
|
1723
|
+
children: /* @__PURE__ */ K(we, {
|
|
1594
1724
|
size: 16,
|
|
1595
1725
|
"aria-hidden": "true"
|
|
1596
1726
|
})
|
|
1597
1727
|
}),
|
|
1598
|
-
/* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ K("button", {
|
|
1599
1729
|
type: "button",
|
|
1600
1730
|
onClick: () => x(g(Date.now())),
|
|
1601
|
-
className: "rounded-md border border-border px-
|
|
1731
|
+
className: "inline-flex h-(--vg-control-dense) items-center rounded-md border border-border px-3 text-sm hover:bg-muted/50 focus-visible:outline-2 focus-visible:outline-ring",
|
|
1602
1732
|
children: p("bento.calendar.today", { defaultValue: "Today" })
|
|
1603
1733
|
}),
|
|
1604
|
-
/* @__PURE__ */
|
|
1734
|
+
/* @__PURE__ */ K("h2", {
|
|
1605
1735
|
className: "m-0 ml-2 text-base font-semibold",
|
|
1606
1736
|
"aria-live": "polite",
|
|
1607
|
-
children:
|
|
1737
|
+
children: z
|
|
1608
1738
|
})
|
|
1609
1739
|
]
|
|
1610
|
-
}), /* @__PURE__ */
|
|
1740
|
+
}), /* @__PURE__ */ K("div", {
|
|
1611
1741
|
role: "group",
|
|
1612
1742
|
"aria-label": p("bento.calendar.views", { defaultValue: "View" }),
|
|
1613
|
-
className: "flex
|
|
1614
|
-
children: ["month", "week"].map((t) => /* @__PURE__ */
|
|
1743
|
+
className: "flex gap-1",
|
|
1744
|
+
children: ["month", "week"].map((t) => /* @__PURE__ */ K("button", {
|
|
1615
1745
|
type: "button",
|
|
1616
1746
|
"aria-pressed": y === t ? "true" : "false",
|
|
1617
|
-
onClick: () =>
|
|
1618
|
-
className: e("rounded-
|
|
1747
|
+
onClick: () => re(t),
|
|
1748
|
+
className: e("inline-flex h-(--vg-control-dense) items-center rounded-md border border-border px-3 text-sm focus-visible:outline-2 focus-visible:outline-ring", y === t ? "bg-primary text-primary-foreground" : "hover:bg-muted/50"),
|
|
1619
1749
|
children: t === "month" ? p("bento.calendar.month", { defaultValue: "Month" }) : p("bento.calendar.week", { defaultValue: "Week" })
|
|
1620
1750
|
}, t))
|
|
1621
1751
|
})]
|
|
1622
1752
|
}),
|
|
1623
|
-
/* @__PURE__ */
|
|
1753
|
+
/* @__PURE__ */ K("span", {
|
|
1624
1754
|
role: "status",
|
|
1625
1755
|
"aria-live": "polite",
|
|
1626
1756
|
className: "sr-only",
|
|
1627
|
-
children:
|
|
1757
|
+
children: E
|
|
1628
1758
|
}),
|
|
1629
|
-
|
|
1630
|
-
id:
|
|
1759
|
+
le && /* @__PURE__ */ K("span", {
|
|
1760
|
+
id: le,
|
|
1631
1761
|
className: "sr-only",
|
|
1632
1762
|
children: p("bento.calendar.moveHint", { defaultValue: "Space picks this up to move it: the arrow keys choose a day, Enter drops it and Escape cancels." })
|
|
1633
1763
|
}),
|
|
1634
|
-
/* @__PURE__ */
|
|
1764
|
+
/* @__PURE__ */ q("table", {
|
|
1635
1765
|
role: "grid",
|
|
1636
|
-
"aria-label": d ??
|
|
1766
|
+
"aria-label": d ?? z,
|
|
1637
1767
|
className: "w-full table-fixed border-collapse text-sm",
|
|
1638
|
-
children: [/* @__PURE__ */
|
|
1768
|
+
children: [/* @__PURE__ */ K("thead", { children: /* @__PURE__ */ K("tr", { children: F[0].map((e) => /* @__PURE__ */ K("th", {
|
|
1639
1769
|
scope: "col",
|
|
1640
|
-
abbr: L({ weekday: "long" }).format(
|
|
1770
|
+
abbr: L({ weekday: "long" }).format(Sn(e)),
|
|
1641
1771
|
className: "pb-1 text-xs font-medium text-muted-foreground",
|
|
1642
|
-
children: L({ weekday: "short" }).format(
|
|
1643
|
-
},
|
|
1644
|
-
let n =
|
|
1645
|
-
return /* @__PURE__ */
|
|
1772
|
+
children: L({ weekday: "short" }).format(Sn(e))
|
|
1773
|
+
}, $(e))) }) }), /* @__PURE__ */ K("tbody", { children: F.map((t) => /* @__PURE__ */ K("tr", { children: t.map((t) => {
|
|
1774
|
+
let n = $(t), r = I.get(n) ?? [], i = n === $(b), a = y === "month" && t.m !== b.m, o = r.length;
|
|
1775
|
+
return /* @__PURE__ */ q("td", {
|
|
1646
1776
|
ref: (e) => {
|
|
1647
|
-
e ?
|
|
1777
|
+
e ? O.current.set(n, e) : O.current.delete(n);
|
|
1648
1778
|
},
|
|
1649
1779
|
role: "gridcell",
|
|
1650
1780
|
tabIndex: i ? 0 : -1,
|
|
@@ -1652,74 +1782,75 @@ function mn({ entries: t, view: n, defaultView: r = "month", onViewChange: i, de
|
|
|
1652
1782
|
defaultValue: "{{count}} scheduled",
|
|
1653
1783
|
count: o
|
|
1654
1784
|
})}` : ne(t),
|
|
1655
|
-
"aria-current": n ===
|
|
1785
|
+
"aria-current": n === j ? "date" : void 0,
|
|
1656
1786
|
"data-day": n,
|
|
1657
|
-
onKeyDown: (e) =>
|
|
1787
|
+
onKeyDown: (e) => oe(e, t),
|
|
1658
1788
|
onFocus: () => {
|
|
1659
1789
|
i || x(t);
|
|
1660
1790
|
},
|
|
1661
1791
|
onDragOver: (e) => {
|
|
1662
1792
|
w && e.preventDefault();
|
|
1663
1793
|
},
|
|
1664
|
-
onDrop: (e) =>
|
|
1794
|
+
onDrop: (e) => ce(e, t),
|
|
1665
1795
|
className: e("border border-border/60 p-1 align-top outline-none", y === "month" ? "h-24" : "h-48", "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring", S && i && "bg-primary/10"),
|
|
1666
|
-
children: [/* @__PURE__ */
|
|
1796
|
+
children: [/* @__PURE__ */ K("span", {
|
|
1667
1797
|
"aria-hidden": "true",
|
|
1668
|
-
className: e("mb-1 inline-grid size-6 place-items-center rounded-full text-xs", n ===
|
|
1798
|
+
className: e("mb-1 inline-grid size-6 place-items-center rounded-full text-xs", n === j && "bg-primary font-semibold text-primary-foreground", n !== j && a && "text-muted-foreground"),
|
|
1669
1799
|
children: t.d
|
|
1670
|
-
}), /* @__PURE__ */
|
|
1800
|
+
}), /* @__PURE__ */ K("ul", {
|
|
1671
1801
|
className: "m-0 flex list-none flex-col gap-0.5 p-0",
|
|
1672
|
-
children: r.map(({ entry: t, time: n }) => /* @__PURE__ */
|
|
1802
|
+
children: r.map(({ entry: t, time: n }) => /* @__PURE__ */ K("li", { children: /* @__PURE__ */ q("button", {
|
|
1673
1803
|
type: "button",
|
|
1804
|
+
"data-look": "text",
|
|
1674
1805
|
tabIndex: -1,
|
|
1675
1806
|
draggable: c ? !0 : void 0,
|
|
1676
|
-
"aria-describedby":
|
|
1807
|
+
"aria-describedby": le,
|
|
1677
1808
|
"aria-pressed": c ? S === t.id ? "true" : "false" : void 0,
|
|
1678
1809
|
"data-entry": t.id,
|
|
1679
|
-
onKeyDown: (e) =>
|
|
1810
|
+
onKeyDown: (e) => se(e, t),
|
|
1680
1811
|
onClick: () => l?.(t.id),
|
|
1681
1812
|
onDragStart: (e) => {
|
|
1682
1813
|
e.dataTransfer.setData("text/plain", t.id), e.dataTransfer.effectAllowed = "move", T(t.id);
|
|
1683
1814
|
},
|
|
1684
1815
|
onDragEnd: () => T(null),
|
|
1685
|
-
className: e("flex w-full min-w-0 items-baseline gap-1 rounded-md px-1 py-0.5 text-left text-xs focus-visible:outline-2 focus-visible:outline-ring", t.tone ?
|
|
1686
|
-
children: [/* @__PURE__ */
|
|
1816
|
+
className: e("flex w-full min-w-0 items-baseline gap-1 rounded-md px-1 py-0.5 text-left text-xs focus-visible:outline-2 focus-visible:outline-ring", t.tone ? kn[t.tone] : "bg-muted", S === t.id && "outline-2 outline-dashed outline-primary"),
|
|
1817
|
+
children: [/* @__PURE__ */ K("time", {
|
|
1687
1818
|
dateTime: new Date(n).toISOString(),
|
|
1688
1819
|
className: "flex-none tabular-nums",
|
|
1689
|
-
children:
|
|
1690
|
-
}), /* @__PURE__ */
|
|
1820
|
+
children: R(n)
|
|
1821
|
+
}), /* @__PURE__ */ K("span", {
|
|
1691
1822
|
className: "truncate",
|
|
1692
1823
|
children: t.label
|
|
1693
1824
|
})]
|
|
1694
1825
|
}) }, t.id))
|
|
1695
1826
|
})]
|
|
1696
1827
|
}, n);
|
|
1697
|
-
}) },
|
|
1828
|
+
}) }, $(t[0]))) })]
|
|
1698
1829
|
})
|
|
1699
1830
|
]
|
|
1700
1831
|
});
|
|
1701
1832
|
}
|
|
1702
|
-
function
|
|
1703
|
-
return /* @__PURE__ */
|
|
1833
|
+
function jn({ label: e, onClick: t, children: n }) {
|
|
1834
|
+
return /* @__PURE__ */ K("button", {
|
|
1704
1835
|
type: "button",
|
|
1705
1836
|
"aria-label": e,
|
|
1706
1837
|
onClick: t,
|
|
1707
|
-
className: "grid size-
|
|
1838
|
+
className: "grid size-(--vg-control-dense) place-items-center rounded-md border border-border hover:bg-muted/50 focus-visible:outline-2 focus-visible:outline-ring",
|
|
1708
1839
|
children: n
|
|
1709
1840
|
});
|
|
1710
1841
|
}
|
|
1711
1842
|
//#endregion
|
|
1712
1843
|
//#region src/bento/bento-layout.ts
|
|
1713
|
-
var
|
|
1844
|
+
var Mn = {
|
|
1714
1845
|
LARGE: "col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2",
|
|
1715
1846
|
MEDIUM: "col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1",
|
|
1716
1847
|
SMALL: "col-span-1 row-span-1"
|
|
1717
|
-
},
|
|
1848
|
+
}, Nn = {
|
|
1718
1849
|
SMALL: "MEDIUM",
|
|
1719
1850
|
MEDIUM: "LARGE",
|
|
1720
1851
|
LARGE: "SMALL"
|
|
1721
1852
|
};
|
|
1722
|
-
function
|
|
1853
|
+
function Pn(e, t, n) {
|
|
1723
1854
|
if (!n || n.length === 0) return e.map((e) => ({
|
|
1724
1855
|
item: e,
|
|
1725
1856
|
key: t(e),
|
|
@@ -1740,7 +1871,7 @@ function vn(e, t, n) {
|
|
|
1740
1871
|
emphasis: i.get(t) ?? "MEDIUM"
|
|
1741
1872
|
}));
|
|
1742
1873
|
}
|
|
1743
|
-
function
|
|
1874
|
+
function Fn(e) {
|
|
1744
1875
|
return e.map((e, t) => ({
|
|
1745
1876
|
itemId: e.key,
|
|
1746
1877
|
emphasis: e.emphasis,
|
|
@@ -1749,40 +1880,40 @@ function yn(e) {
|
|
|
1749
1880
|
}
|
|
1750
1881
|
//#endregion
|
|
1751
1882
|
//#region src/bento/bento-entity-tile.tsx
|
|
1752
|
-
function
|
|
1753
|
-
let { t: f } =
|
|
1754
|
-
return /* @__PURE__ */
|
|
1883
|
+
function In({ to: e, emphasis: t, featured: n, defaultIcon: r, icon: i, title: a, description: o, meta: s, state: c, enabled: l, hasStatus: u = !1, viewTransitionName: d }) {
|
|
1884
|
+
let { t: f } = J(), p = t ?? (n ? "LARGE" : "MEDIUM"), m = p === "LARGE", h = p === "SMALL", g = Mn[p], _ = l === 1, v = m ? "p-6 md:p-7" : h ? "p-4" : "p-5", y = m ? "h-14 w-14" : h ? "h-8 w-8" : "h-9 w-9", b = m ? 28 : h ? 16 : 18, x = m ? "text-xl md:text-2xl" : h ? "text-sm" : "text-base md:text-lg";
|
|
1885
|
+
return /* @__PURE__ */ q(Ke, {
|
|
1755
1886
|
to: e,
|
|
1756
1887
|
className: `bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${m ? "gap-5" : "gap-4"} overflow-hidden ${v} ${g}`,
|
|
1757
1888
|
style: d ? { viewTransitionName: d } : void 0,
|
|
1758
|
-
children: [/* @__PURE__ */
|
|
1889
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1759
1890
|
className: "relative z-1 flex items-center justify-between",
|
|
1760
|
-
children: [/* @__PURE__ */
|
|
1891
|
+
children: [/* @__PURE__ */ K("span", {
|
|
1761
1892
|
className: `bento-well grid place-items-center rounded-2xl ${y}`,
|
|
1762
|
-
children: i ? /* @__PURE__ */
|
|
1893
|
+
children: i ? /* @__PURE__ */ K(We, {
|
|
1763
1894
|
icon: i,
|
|
1764
1895
|
className: m ? "size-7" : "size-4.5"
|
|
1765
|
-
}) : /* @__PURE__ */
|
|
1766
|
-
}), u && /* @__PURE__ */
|
|
1896
|
+
}) : /* @__PURE__ */ K(r, { size: b })
|
|
1897
|
+
}), u && /* @__PURE__ */ q("span", {
|
|
1767
1898
|
className: `flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${_ ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
|
|
1768
|
-
children: [/* @__PURE__ */
|
|
1899
|
+
children: [/* @__PURE__ */ K("span", { className: `h-1.5 w-1.5 rounded-full ${_ ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), _ ? f("common.active", { defaultValue: "Active" }) : f("common.idle", { defaultValue: "Idle" })]
|
|
1769
1900
|
})]
|
|
1770
|
-
}), /* @__PURE__ */
|
|
1901
|
+
}), /* @__PURE__ */ q("div", {
|
|
1771
1902
|
className: "relative z-1",
|
|
1772
1903
|
children: [
|
|
1773
|
-
/* @__PURE__ */
|
|
1904
|
+
/* @__PURE__ */ K("div", {
|
|
1774
1905
|
className: `font-semibold tracking-tight ${x}`,
|
|
1775
1906
|
children: a
|
|
1776
1907
|
}),
|
|
1777
|
-
!h && s && /* @__PURE__ */
|
|
1908
|
+
!h && s && /* @__PURE__ */ K("div", {
|
|
1778
1909
|
className: "mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",
|
|
1779
1910
|
children: s
|
|
1780
1911
|
}),
|
|
1781
|
-
!h && o && /* @__PURE__ */
|
|
1912
|
+
!h && o && /* @__PURE__ */ K("p", {
|
|
1782
1913
|
className: "mt-2 text-sm text-muted-foreground",
|
|
1783
1914
|
children: o
|
|
1784
1915
|
}),
|
|
1785
|
-
c && /* @__PURE__ */
|
|
1916
|
+
c && /* @__PURE__ */ K(Nt, {
|
|
1786
1917
|
state: c,
|
|
1787
1918
|
className: "mt-3"
|
|
1788
1919
|
})
|
|
@@ -1792,99 +1923,99 @@ function bn({ to: e, emphasis: t, featured: n, defaultIcon: r, icon: i, title: a
|
|
|
1792
1923
|
}
|
|
1793
1924
|
//#endregion
|
|
1794
1925
|
//#region src/bento/bento-filter-bar.tsx
|
|
1795
|
-
var
|
|
1926
|
+
var Ln = {
|
|
1796
1927
|
query: "",
|
|
1797
1928
|
facets: {}
|
|
1798
|
-
},
|
|
1799
|
-
function
|
|
1929
|
+
}, Rn = (e) => typeof e == "object" && !!e && !Array.isArray(e), zn = (e) => Array.isArray(e) ? e : [];
|
|
1930
|
+
function Bn(e, t, n) {
|
|
1800
1931
|
let r = { ...e.facets };
|
|
1801
|
-
return n === void 0 || Array.isArray(n) && n.length === 0 ||
|
|
1932
|
+
return n === void 0 || Array.isArray(n) && n.length === 0 || Rn(n) && !n.from && !n.to ? delete r[t] : r[t] = n, {
|
|
1802
1933
|
...e,
|
|
1803
1934
|
facets: r
|
|
1804
1935
|
};
|
|
1805
1936
|
}
|
|
1806
|
-
function
|
|
1807
|
-
let { t: s } =
|
|
1937
|
+
function Vn({ value: e, onChange: n, facets: r, queryLabel: i, queryDelay: a = 300, views: o }) {
|
|
1938
|
+
let { t: s } = J(), [l, u] = W({
|
|
1808
1939
|
source: e.query,
|
|
1809
1940
|
text: e.query
|
|
1810
|
-
}), [
|
|
1811
|
-
|
|
1941
|
+
}), [d, f] = W(null);
|
|
1942
|
+
l.source !== e.query && u({
|
|
1812
1943
|
source: e.query,
|
|
1813
|
-
text: e.query ===
|
|
1814
|
-
}),
|
|
1815
|
-
if (
|
|
1944
|
+
text: e.query === d ? l.text : e.query
|
|
1945
|
+
}), V(() => {
|
|
1946
|
+
if (l.text === e.query) return;
|
|
1816
1947
|
let t = setTimeout(() => {
|
|
1817
|
-
|
|
1948
|
+
f(l.text), n({
|
|
1818
1949
|
...e,
|
|
1819
|
-
query:
|
|
1950
|
+
query: l.text
|
|
1820
1951
|
});
|
|
1821
1952
|
}, a);
|
|
1822
1953
|
return () => clearTimeout(t);
|
|
1823
1954
|
}, [
|
|
1824
|
-
|
|
1955
|
+
l.text,
|
|
1825
1956
|
e,
|
|
1826
1957
|
n,
|
|
1827
1958
|
a
|
|
1828
1959
|
]);
|
|
1829
|
-
let
|
|
1960
|
+
let p = [];
|
|
1830
1961
|
for (let t of r) {
|
|
1831
1962
|
let n = e.facets[t.id];
|
|
1832
|
-
if (t.kind === "choice") for (let r of
|
|
1963
|
+
if (t.kind === "choice") for (let r of zn(n)) {
|
|
1833
1964
|
let i = t.options.find((e) => e.value === r);
|
|
1834
|
-
|
|
1965
|
+
p.push({
|
|
1835
1966
|
key: `${t.id}:${r}`,
|
|
1836
1967
|
text: `${t.label}: ${i?.label ?? r}`,
|
|
1837
|
-
remove: () =>
|
|
1968
|
+
remove: () => Bn(e, t.id, zn(n).filter((e) => e !== r))
|
|
1838
1969
|
});
|
|
1839
1970
|
}
|
|
1840
|
-
else
|
|
1971
|
+
else Rn(n) && (n.from || n.to) && p.push({
|
|
1841
1972
|
key: t.id,
|
|
1842
1973
|
text: `${t.label}: ${n.from ?? "…"} – ${n.to ?? "…"}`,
|
|
1843
|
-
remove: () =>
|
|
1974
|
+
remove: () => Bn(e, t.id, void 0)
|
|
1844
1975
|
});
|
|
1845
1976
|
}
|
|
1846
|
-
let
|
|
1847
|
-
return /* @__PURE__ */
|
|
1977
|
+
let m = p.length > 0 || e.query !== "", h = i ?? s("bento.filters.search", { defaultValue: "Search" });
|
|
1978
|
+
return /* @__PURE__ */ q("div", {
|
|
1848
1979
|
role: "search",
|
|
1849
1980
|
"aria-label": s("bento.filters.label", { defaultValue: "Filters" }),
|
|
1850
1981
|
"data-slot": "bento-filter-bar",
|
|
1851
|
-
className: "flex flex-col gap-2",
|
|
1852
|
-
children: [/* @__PURE__ */
|
|
1982
|
+
className: "flex min-w-0 flex-1 flex-col gap-2",
|
|
1983
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1853
1984
|
className: "flex flex-wrap items-center gap-2",
|
|
1854
1985
|
children: [
|
|
1855
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ q("div", {
|
|
1856
1987
|
className: "relative min-w-48 flex-1",
|
|
1857
|
-
children: [/* @__PURE__ */
|
|
1988
|
+
children: [/* @__PURE__ */ K(Le, {
|
|
1858
1989
|
size: 16,
|
|
1859
1990
|
"aria-hidden": "true",
|
|
1860
1991
|
className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
1861
|
-
}), /* @__PURE__ */
|
|
1992
|
+
}), /* @__PURE__ */ K(t, {
|
|
1862
1993
|
type: "search",
|
|
1863
|
-
value:
|
|
1864
|
-
placeholder:
|
|
1865
|
-
"aria-label":
|
|
1866
|
-
onChange: (e) =>
|
|
1867
|
-
...
|
|
1994
|
+
value: l.text,
|
|
1995
|
+
placeholder: h,
|
|
1996
|
+
"aria-label": h,
|
|
1997
|
+
onChange: (e) => u({
|
|
1998
|
+
...l,
|
|
1868
1999
|
text: e.target.value
|
|
1869
2000
|
}),
|
|
1870
2001
|
className: "pl-9"
|
|
1871
2002
|
})]
|
|
1872
2003
|
}),
|
|
1873
|
-
r.map((t) => t.kind === "choice" ? /* @__PURE__ */
|
|
2004
|
+
r.map((t) => t.kind === "choice" ? /* @__PURE__ */ K(Un, {
|
|
1874
2005
|
facet: t,
|
|
1875
2006
|
value: e,
|
|
1876
2007
|
onChange: n
|
|
1877
|
-
}, t.id) : /* @__PURE__ */
|
|
2008
|
+
}, t.id) : /* @__PURE__ */ K(Wn, {
|
|
1878
2009
|
facet: t,
|
|
1879
2010
|
value: e,
|
|
1880
2011
|
onChange: n
|
|
1881
2012
|
}, t.id)),
|
|
1882
2013
|
o
|
|
1883
2014
|
]
|
|
1884
|
-
}),
|
|
2015
|
+
}), m && /* @__PURE__ */ q("ul", {
|
|
1885
2016
|
className: "m-0 flex list-none flex-wrap items-center gap-1.5 p-0",
|
|
1886
2017
|
"aria-label": s("bento.filters.active", { defaultValue: "Active filters" }),
|
|
1887
|
-
children: [
|
|
2018
|
+
children: [p.map((e) => /* @__PURE__ */ K("li", { children: /* @__PURE__ */ q("button", {
|
|
1888
2019
|
type: "button",
|
|
1889
2020
|
"aria-label": s("bento.filters.remove", {
|
|
1890
2021
|
defaultValue: "Remove filter {{filter}}",
|
|
@@ -1892,120 +2023,120 @@ function Tn({ value: e, onChange: n, facets: r, queryLabel: i, queryDelay: a = 3
|
|
|
1892
2023
|
}),
|
|
1893
2024
|
onClick: () => n(e.remove()),
|
|
1894
2025
|
className: "bento-clear inline-flex items-center gap-1 rounded-full border border-border/60 bg-card/60 py-0.5 pl-2.5 pr-1.5 text-xs",
|
|
1895
|
-
children: [e.text, /* @__PURE__ */
|
|
2026
|
+
children: [e.text, /* @__PURE__ */ K(Ue, {
|
|
1896
2027
|
size: 12,
|
|
1897
2028
|
"aria-hidden": "true"
|
|
1898
2029
|
})]
|
|
1899
|
-
}) }, e.key)), /* @__PURE__ */
|
|
2030
|
+
}) }, e.key)), /* @__PURE__ */ K("li", { children: /* @__PURE__ */ K(c, {
|
|
1900
2031
|
variant: "ghost",
|
|
1901
2032
|
size: "sm",
|
|
1902
2033
|
className: "h-6 px-2 text-xs",
|
|
1903
2034
|
onClick: () => {
|
|
1904
|
-
|
|
2035
|
+
u({
|
|
1905
2036
|
source: "",
|
|
1906
2037
|
text: ""
|
|
1907
|
-
}), n(
|
|
2038
|
+
}), n(Ln);
|
|
1908
2039
|
},
|
|
1909
2040
|
children: s("bento.filters.clearAll", { defaultValue: "Clear all" })
|
|
1910
2041
|
}) })]
|
|
1911
2042
|
})]
|
|
1912
2043
|
});
|
|
1913
2044
|
}
|
|
1914
|
-
function
|
|
1915
|
-
return /* @__PURE__ */
|
|
2045
|
+
function Hn({ label: e, count: t, ...n }) {
|
|
2046
|
+
return /* @__PURE__ */ q(c, {
|
|
1916
2047
|
variant: "outline",
|
|
1917
2048
|
size: "sm",
|
|
1918
2049
|
className: "gap-1.5",
|
|
1919
2050
|
...n,
|
|
1920
2051
|
children: [
|
|
1921
2052
|
e,
|
|
1922
|
-
t > 0 && /* @__PURE__ */
|
|
2053
|
+
t > 0 && /* @__PURE__ */ K("span", {
|
|
1923
2054
|
className: "rounded-full bg-primary px-1.5 text-[0.6875rem] leading-4 text-primary-foreground",
|
|
1924
2055
|
children: t
|
|
1925
2056
|
}),
|
|
1926
|
-
/* @__PURE__ */
|
|
2057
|
+
/* @__PURE__ */ K(Se, {
|
|
1927
2058
|
size: 14,
|
|
1928
2059
|
"aria-hidden": "true"
|
|
1929
2060
|
})
|
|
1930
2061
|
]
|
|
1931
2062
|
});
|
|
1932
2063
|
}
|
|
1933
|
-
function
|
|
1934
|
-
let r =
|
|
1935
|
-
return /* @__PURE__ */
|
|
2064
|
+
function Un({ facet: e, value: t, onChange: n }) {
|
|
2065
|
+
let r = zn(t.facets[e.id]);
|
|
2066
|
+
return /* @__PURE__ */ q(v, { children: [/* @__PURE__ */ K(T, {
|
|
1936
2067
|
asChild: !0,
|
|
1937
|
-
children: /* @__PURE__ */
|
|
2068
|
+
children: /* @__PURE__ */ K(Hn, {
|
|
1938
2069
|
label: e.label,
|
|
1939
2070
|
count: r.length
|
|
1940
2071
|
})
|
|
1941
|
-
}), /* @__PURE__ */
|
|
2072
|
+
}), /* @__PURE__ */ K(ie, {
|
|
1942
2073
|
align: "start",
|
|
1943
2074
|
className: "bento-dropdown min-w-44 p-1.5",
|
|
1944
|
-
children: e.multiple ? e.options.map((i) => /* @__PURE__ */
|
|
2075
|
+
children: e.multiple ? e.options.map((i) => /* @__PURE__ */ K(x, {
|
|
1945
2076
|
checked: r.includes(i.value),
|
|
1946
|
-
onCheckedChange: (a) => n(
|
|
2077
|
+
onCheckedChange: (a) => n(Bn(t, e.id, a === !0 ? [...r, i.value] : r.filter((e) => e !== i.value))),
|
|
1947
2078
|
onSelect: (e) => e.preventDefault(),
|
|
1948
2079
|
children: i.label
|
|
1949
|
-
}, i.value)) : /* @__PURE__ */
|
|
2080
|
+
}, i.value)) : /* @__PURE__ */ K(w, {
|
|
1950
2081
|
value: r[0] ?? "",
|
|
1951
|
-
onValueChange: (i) => n(
|
|
1952
|
-
children: e.options.map((e) => /* @__PURE__ */
|
|
2082
|
+
onValueChange: (i) => n(Bn(t, e.id, i === r[0] ? [] : [i])),
|
|
2083
|
+
children: e.options.map((e) => /* @__PURE__ */ K(m, {
|
|
1953
2084
|
value: e.value,
|
|
1954
2085
|
children: e.label
|
|
1955
2086
|
}, e.value))
|
|
1956
2087
|
})
|
|
1957
2088
|
})] });
|
|
1958
2089
|
}
|
|
1959
|
-
function
|
|
1960
|
-
let { t: i } =
|
|
1961
|
-
return /* @__PURE__ */
|
|
2090
|
+
function Wn({ facet: e, value: n, onChange: r }) {
|
|
2091
|
+
let { t: i } = J(), a = n.facets[e.id], o = Rn(a) ? a : {}, [s, l] = W(!1), [u, d] = W(o.from ?? ""), [f, m] = W(o.to ?? ""), h = H(), g = H();
|
|
2092
|
+
return /* @__PURE__ */ q(M, {
|
|
1962
2093
|
open: s,
|
|
1963
2094
|
onOpenChange: (e) => {
|
|
1964
|
-
e && (d(o.from ?? ""),
|
|
2095
|
+
e && (d(o.from ?? ""), m(o.to ?? "")), l(e);
|
|
1965
2096
|
},
|
|
1966
|
-
children: [/* @__PURE__ */
|
|
2097
|
+
children: [/* @__PURE__ */ K(p, {
|
|
1967
2098
|
asChild: !0,
|
|
1968
|
-
children: /* @__PURE__ */
|
|
2099
|
+
children: /* @__PURE__ */ K(Hn, {
|
|
1969
2100
|
label: e.label,
|
|
1970
2101
|
count: o.from || o.to ? 1 : 0
|
|
1971
2102
|
})
|
|
1972
|
-
}), /* @__PURE__ */
|
|
2103
|
+
}), /* @__PURE__ */ K(j, {
|
|
1973
2104
|
align: "start",
|
|
1974
2105
|
className: "bento-dropdown w-64 p-3",
|
|
1975
|
-
children: /* @__PURE__ */
|
|
2106
|
+
children: /* @__PURE__ */ q("form", {
|
|
1976
2107
|
className: "flex flex-col gap-2",
|
|
1977
2108
|
onSubmit: (t) => {
|
|
1978
|
-
t.preventDefault(), r(
|
|
1979
|
-
from:
|
|
2109
|
+
t.preventDefault(), r(Bn(n, e.id, {
|
|
2110
|
+
from: u || void 0,
|
|
1980
2111
|
to: f || void 0
|
|
1981
|
-
})),
|
|
2112
|
+
})), l(!1);
|
|
1982
2113
|
},
|
|
1983
2114
|
children: [
|
|
1984
|
-
/* @__PURE__ */
|
|
1985
|
-
htmlFor:
|
|
2115
|
+
/* @__PURE__ */ K("label", {
|
|
2116
|
+
htmlFor: h,
|
|
1986
2117
|
className: "text-xs text-muted-foreground",
|
|
1987
2118
|
children: i("bento.filters.from", { defaultValue: "From" })
|
|
1988
2119
|
}),
|
|
1989
|
-
/* @__PURE__ */
|
|
1990
|
-
id:
|
|
2120
|
+
/* @__PURE__ */ K(t, {
|
|
2121
|
+
id: h,
|
|
1991
2122
|
type: "date",
|
|
1992
|
-
value:
|
|
2123
|
+
value: u,
|
|
1993
2124
|
max: f || void 0,
|
|
1994
2125
|
onChange: (e) => d(e.target.value)
|
|
1995
2126
|
}),
|
|
1996
|
-
/* @__PURE__ */
|
|
1997
|
-
htmlFor:
|
|
2127
|
+
/* @__PURE__ */ K("label", {
|
|
2128
|
+
htmlFor: g,
|
|
1998
2129
|
className: "text-xs text-muted-foreground",
|
|
1999
2130
|
children: i("bento.filters.to", { defaultValue: "To" })
|
|
2000
2131
|
}),
|
|
2001
|
-
/* @__PURE__ */
|
|
2002
|
-
id:
|
|
2132
|
+
/* @__PURE__ */ K(t, {
|
|
2133
|
+
id: g,
|
|
2003
2134
|
type: "date",
|
|
2004
2135
|
value: f,
|
|
2005
|
-
min:
|
|
2006
|
-
onChange: (e) =>
|
|
2136
|
+
min: u || void 0,
|
|
2137
|
+
onChange: (e) => m(e.target.value)
|
|
2007
2138
|
}),
|
|
2008
|
-
/* @__PURE__ */
|
|
2139
|
+
/* @__PURE__ */ K(c, {
|
|
2009
2140
|
type: "submit",
|
|
2010
2141
|
size: "sm",
|
|
2011
2142
|
className: "mt-1",
|
|
@@ -2018,128 +2149,152 @@ function On({ facet: e, value: n, onChange: r }) {
|
|
|
2018
2149
|
}
|
|
2019
2150
|
//#endregion
|
|
2020
2151
|
//#region src/bento/bento-list-page.tsx
|
|
2021
|
-
var
|
|
2022
|
-
function
|
|
2023
|
-
let { t:
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2152
|
+
var Gn = Ct, Kn = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
|
|
2153
|
+
function qn({ items: t, error: n, tryAgainUrl: r, listId: i, eyebrow: a, backTo: o, backLabel: s, trail: l, heroIcon: u, title: d, subtitle: f, toolbar: p, headerAction: m, newRoute: h, newLabel: g, newSubtitle: _, hideNew: v = !1, itemKey: y, columns: b, rowActions: x, onRowOpen: S, getRowLabel: C, columnLayout: w, onColumnLayoutChange: T, renderTile: E, defaultView: D = "list", view: O, onViewChange: k, emptyTitle: A, emptyDescription: j, layout: M }) {
|
|
2154
|
+
let { t: P } = J(), [F, ee] = W(!1), [te, I] = W(D), L = p ?? m, R = E !== void 0 && b !== void 0, z = E ? "grid" : "list";
|
|
2155
|
+
R && (z = O ?? te);
|
|
2156
|
+
let B = R ? /* @__PURE__ */ q(N, {
|
|
2157
|
+
type: "single",
|
|
2158
|
+
size: "sm",
|
|
2159
|
+
variant: "outline",
|
|
2160
|
+
value: z,
|
|
2161
|
+
onValueChange: (e) => {
|
|
2162
|
+
(e === "grid" || e === "list") && (O === void 0 && I(e), k?.(e));
|
|
2163
|
+
},
|
|
2164
|
+
"aria-label": P("bento.layout.view", { defaultValue: "View" }),
|
|
2165
|
+
className: "ml-auto",
|
|
2166
|
+
children: [/* @__PURE__ */ K(ne, {
|
|
2167
|
+
value: "grid",
|
|
2168
|
+
"aria-label": P("bento.layout.grid", { defaultValue: "Grid" }),
|
|
2169
|
+
children: /* @__PURE__ */ K(Me, {
|
|
2170
|
+
size: 16,
|
|
2171
|
+
"aria-hidden": "true"
|
|
2172
|
+
})
|
|
2173
|
+
}), /* @__PURE__ */ K(ne, {
|
|
2174
|
+
value: "list",
|
|
2175
|
+
"aria-label": P("bento.layout.list", { defaultValue: "List" }),
|
|
2176
|
+
children: /* @__PURE__ */ K(Ne, {
|
|
2177
|
+
size: 16,
|
|
2178
|
+
"aria-hidden": "true"
|
|
2179
|
+
})
|
|
2180
|
+
})]
|
|
2181
|
+
}) : null, re = L != null || B != null ? /* @__PURE__ */ q(G, { children: [L, B] }) : void 0, ie = fe(() => Pn(t ?? [], y, M?.data?.entries), [
|
|
2182
|
+
t,
|
|
2183
|
+
y,
|
|
2184
|
+
M?.data?.entries
|
|
2185
|
+
]), ae = u ? /* @__PURE__ */ K("span", {
|
|
2028
2186
|
className: "bento-well grid h-12 w-12 place-items-center rounded-2xl",
|
|
2029
|
-
children: /* @__PURE__ */
|
|
2187
|
+
children: /* @__PURE__ */ K(u, { size: 24 })
|
|
2030
2188
|
}) : void 0;
|
|
2031
|
-
if (!
|
|
2032
|
-
checkIsNotUndefined:
|
|
2033
|
-
error:
|
|
2034
|
-
tryAgainUrl:
|
|
2035
|
-
children: [
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
children: [/* @__PURE__ */ G(je, { size: 16 }), p]
|
|
2050
|
-
})
|
|
2189
|
+
if (z === "list" || !E) return /* @__PURE__ */ q(oe, {
|
|
2190
|
+
checkIsNotUndefined: t,
|
|
2191
|
+
error: n ?? null,
|
|
2192
|
+
tryAgainUrl: r,
|
|
2193
|
+
children: [/* @__PURE__ */ K(kt, {
|
|
2194
|
+
eyebrow: a,
|
|
2195
|
+
backTo: o,
|
|
2196
|
+
backLabel: s,
|
|
2197
|
+
trail: l,
|
|
2198
|
+
leading: ae,
|
|
2199
|
+
title: d,
|
|
2200
|
+
subtitle: f,
|
|
2201
|
+
trailing: v ? void 0 : /* @__PURE__ */ K(c, {
|
|
2202
|
+
asChild: !0,
|
|
2203
|
+
className: "gap-2",
|
|
2204
|
+
children: /* @__PURE__ */ q(Ke, {
|
|
2205
|
+
to: h,
|
|
2206
|
+
children: [/* @__PURE__ */ K(Z, { size: 16 }), g]
|
|
2051
2207
|
})
|
|
2052
|
-
}),
|
|
2053
|
-
d && /* @__PURE__ */ G("div", {
|
|
2054
|
-
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
2055
|
-
children: d
|
|
2056
|
-
}),
|
|
2057
|
-
e?.length === 0 ? /* @__PURE__ */ G(vt, {
|
|
2058
|
-
icon: Pe,
|
|
2059
|
-
title: T,
|
|
2060
|
-
description: ee
|
|
2061
|
-
}) : /* @__PURE__ */ G(kn, {
|
|
2062
|
-
rows: e ?? [],
|
|
2063
|
-
getRowId: g,
|
|
2064
|
-
columns: _ ?? [],
|
|
2065
|
-
label: l,
|
|
2066
|
-
getRowLabel: b,
|
|
2067
|
-
rowActions: v,
|
|
2068
|
-
onRowOpen: y,
|
|
2069
|
-
layout: x,
|
|
2070
|
-
onLayoutChange: S
|
|
2071
2208
|
})
|
|
2072
|
-
|
|
2209
|
+
}), t?.length === 0 ? /* @__PURE__ */ q(G, { children: [re != null && /* @__PURE__ */ K("div", {
|
|
2210
|
+
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
2211
|
+
children: re
|
|
2212
|
+
}), /* @__PURE__ */ K(wt, {
|
|
2213
|
+
icon: Re,
|
|
2214
|
+
title: A,
|
|
2215
|
+
description: j
|
|
2216
|
+
})] }) : /* @__PURE__ */ K(Gn, {
|
|
2217
|
+
rows: t ?? [],
|
|
2218
|
+
getRowId: y,
|
|
2219
|
+
columns: b ?? [],
|
|
2220
|
+
label: d,
|
|
2221
|
+
getRowLabel: C,
|
|
2222
|
+
rowActions: x,
|
|
2223
|
+
onRowOpen: S,
|
|
2224
|
+
layout: w,
|
|
2225
|
+
onLayoutChange: T,
|
|
2226
|
+
toolbar: re
|
|
2227
|
+
})]
|
|
2073
2228
|
});
|
|
2074
|
-
let
|
|
2075
|
-
return /* @__PURE__ */
|
|
2076
|
-
checkIsNotUndefined:
|
|
2077
|
-
error:
|
|
2078
|
-
tryAgainUrl:
|
|
2229
|
+
let se = !!i && !!M && (t?.length ?? 0) > 0;
|
|
2230
|
+
return /* @__PURE__ */ q(oe, {
|
|
2231
|
+
checkIsNotUndefined: t,
|
|
2232
|
+
error: n ?? null,
|
|
2233
|
+
tryAgainUrl: r,
|
|
2079
2234
|
children: [
|
|
2080
|
-
/* @__PURE__ */
|
|
2081
|
-
eyebrow:
|
|
2082
|
-
backTo:
|
|
2083
|
-
backLabel:
|
|
2084
|
-
trail:
|
|
2085
|
-
leading:
|
|
2086
|
-
title:
|
|
2087
|
-
subtitle:
|
|
2235
|
+
/* @__PURE__ */ K(kt, {
|
|
2236
|
+
eyebrow: a,
|
|
2237
|
+
backTo: o,
|
|
2238
|
+
backLabel: s,
|
|
2239
|
+
trail: l,
|
|
2240
|
+
leading: ae,
|
|
2241
|
+
title: d,
|
|
2242
|
+
subtitle: f
|
|
2088
2243
|
}),
|
|
2089
|
-
(
|
|
2244
|
+
(re != null || se && !F) && /* @__PURE__ */ q("div", {
|
|
2090
2245
|
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
2091
|
-
children: [
|
|
2246
|
+
children: [re, se && !F && /* @__PURE__ */ q(c, {
|
|
2092
2247
|
variant: "outline",
|
|
2093
2248
|
size: "sm",
|
|
2094
|
-
onClick: () =>
|
|
2095
|
-
className: "
|
|
2096
|
-
children: [/* @__PURE__ */
|
|
2249
|
+
onClick: () => ee(!0),
|
|
2250
|
+
className: e("gap-2", B == null && "ml-auto"),
|
|
2251
|
+
children: [/* @__PURE__ */ K(Y, { size: 16 }), P("bento.layout.customize", { defaultValue: "Customize layout" })]
|
|
2097
2252
|
})]
|
|
2098
2253
|
}),
|
|
2099
|
-
|
|
2100
|
-
layout:
|
|
2101
|
-
resolved:
|
|
2102
|
-
canEditGlobal:
|
|
2103
|
-
isCustomized:
|
|
2104
|
-
renderTile:
|
|
2105
|
-
hideNew:
|
|
2106
|
-
newRoute:
|
|
2107
|
-
newLabel:
|
|
2108
|
-
newSubtitle:
|
|
2109
|
-
onClose: () =>
|
|
2110
|
-
}) : /* @__PURE__ */
|
|
2111
|
-
resolved:
|
|
2112
|
-
renderTile:
|
|
2113
|
-
hideNew:
|
|
2114
|
-
newRoute:
|
|
2115
|
-
newLabel:
|
|
2116
|
-
newSubtitle:
|
|
2117
|
-
isEmpty:
|
|
2118
|
-
emptyTitle:
|
|
2119
|
-
emptyDescription:
|
|
2254
|
+
F && i && M ? /* @__PURE__ */ K(Xn, {
|
|
2255
|
+
layout: M,
|
|
2256
|
+
resolved: ie,
|
|
2257
|
+
canEditGlobal: M?.data?.canEditGlobal ?? !1,
|
|
2258
|
+
isCustomized: M?.data?.source === "USER",
|
|
2259
|
+
renderTile: E,
|
|
2260
|
+
hideNew: v,
|
|
2261
|
+
newRoute: h,
|
|
2262
|
+
newLabel: g,
|
|
2263
|
+
newSubtitle: _,
|
|
2264
|
+
onClose: () => ee(!1)
|
|
2265
|
+
}) : /* @__PURE__ */ K(Yn, {
|
|
2266
|
+
resolved: ie,
|
|
2267
|
+
renderTile: E,
|
|
2268
|
+
hideNew: v,
|
|
2269
|
+
newRoute: h,
|
|
2270
|
+
newLabel: g,
|
|
2271
|
+
newSubtitle: _,
|
|
2272
|
+
isEmpty: t?.length === 0,
|
|
2273
|
+
emptyTitle: A,
|
|
2274
|
+
emptyDescription: j
|
|
2120
2275
|
})
|
|
2121
2276
|
]
|
|
2122
2277
|
});
|
|
2123
2278
|
}
|
|
2124
|
-
function
|
|
2125
|
-
return /* @__PURE__ */
|
|
2279
|
+
function Jn({ items: e, error: t, tryAgainUrl: n, newRoute: r, newLabel: i, newSubtitle: a, hideNew: o = !1, itemKey: s, renderTile: c, emptyTitle: l, emptyDescription: u }) {
|
|
2280
|
+
return /* @__PURE__ */ K(oe, {
|
|
2126
2281
|
checkIsNotUndefined: e,
|
|
2127
2282
|
error: t ?? null,
|
|
2128
2283
|
tryAgainUrl: n,
|
|
2129
|
-
children: /* @__PURE__ */
|
|
2284
|
+
children: /* @__PURE__ */ q("div", {
|
|
2130
2285
|
"data-slot": "bento-list-tiles",
|
|
2131
|
-
className:
|
|
2286
|
+
className: Kn,
|
|
2132
2287
|
children: [
|
|
2133
|
-
!o && r && i ? /* @__PURE__ */
|
|
2288
|
+
!o && r && i ? /* @__PURE__ */ K(er, {
|
|
2134
2289
|
route: r,
|
|
2135
2290
|
label: i,
|
|
2136
2291
|
subtitle: a
|
|
2137
2292
|
}) : null,
|
|
2138
|
-
(e ?? []).map((e) => /* @__PURE__ */
|
|
2293
|
+
(e ?? []).map((e) => /* @__PURE__ */ K("span", {
|
|
2139
2294
|
className: "contents",
|
|
2140
2295
|
children: c(e)
|
|
2141
2296
|
}, s(e))),
|
|
2142
|
-
e?.length === 0 && /* @__PURE__ */
|
|
2297
|
+
e?.length === 0 && /* @__PURE__ */ K(tr, {
|
|
2143
2298
|
title: l,
|
|
2144
2299
|
description: u
|
|
2145
2300
|
})
|
|
@@ -2147,114 +2302,114 @@ function Mn({ items: e, error: t, tryAgainUrl: n, newRoute: r, newLabel: i, newS
|
|
|
2147
2302
|
})
|
|
2148
2303
|
});
|
|
2149
2304
|
}
|
|
2150
|
-
function
|
|
2305
|
+
function Yn({ resolved: t, renderTile: n, hideNew: r, newRoute: i, newLabel: a, newSubtitle: o, isEmpty: s, emptyTitle: c, emptyDescription: l }) {
|
|
2151
2306
|
let u = t.some((e) => e.emphasis === "SMALL");
|
|
2152
|
-
return /* @__PURE__ */
|
|
2307
|
+
return /* @__PURE__ */ q("div", {
|
|
2153
2308
|
"data-slot": "bento-list-tiles",
|
|
2154
|
-
className: e(
|
|
2309
|
+
className: e(Kn, u && "grid-flow-dense"),
|
|
2155
2310
|
children: [
|
|
2156
|
-
!r && /* @__PURE__ */
|
|
2311
|
+
!r && /* @__PURE__ */ K(er, {
|
|
2157
2312
|
route: i,
|
|
2158
2313
|
label: a,
|
|
2159
2314
|
subtitle: o
|
|
2160
2315
|
}),
|
|
2161
|
-
t.map(({ item: e, key: t, emphasis: r }) => /* @__PURE__ */
|
|
2316
|
+
t.map(({ item: e, key: t, emphasis: r }) => /* @__PURE__ */ K("span", {
|
|
2162
2317
|
className: "contents",
|
|
2163
2318
|
children: n(e, r)
|
|
2164
2319
|
}, t)),
|
|
2165
|
-
s && /* @__PURE__ */
|
|
2320
|
+
s && /* @__PURE__ */ K(tr, {
|
|
2166
2321
|
title: c,
|
|
2167
2322
|
description: l
|
|
2168
2323
|
})
|
|
2169
2324
|
]
|
|
2170
2325
|
});
|
|
2171
2326
|
}
|
|
2172
|
-
function
|
|
2173
|
-
let { t:
|
|
2327
|
+
function Xn({ layout: t, resolved: n, canEditGlobal: r, isCustomized: i, renderTile: a, hideNew: o, newRoute: s, newLabel: l, newSubtitle: u, onClose: d }) {
|
|
2328
|
+
let { t: f } = J(), [p, m] = W(n), [h, g] = W(null), _ = (t.saving ?? !1) || h !== null, v = (e) => _ && h === e ? { loading: !0 } : { "aria-disabled": _ || void 0 }, [y, b] = W(!1), x = (e, t) => async () => {
|
|
2174
2329
|
if (t) {
|
|
2175
|
-
|
|
2330
|
+
g(e), b(!1);
|
|
2176
2331
|
try {
|
|
2177
|
-
await t(),
|
|
2332
|
+
await t(), d();
|
|
2178
2333
|
} catch (e) {
|
|
2179
|
-
console.error("Failed to save the bento layout", e),
|
|
2334
|
+
console.error("Failed to save the bento layout", e), b(!0);
|
|
2180
2335
|
} finally {
|
|
2181
|
-
|
|
2336
|
+
g(null);
|
|
2182
2337
|
}
|
|
2183
2338
|
}
|
|
2184
|
-
},
|
|
2185
|
-
function
|
|
2339
|
+
}, S = at(it(nt, { activationConstraint: { distance: 8 } }), it(tt));
|
|
2340
|
+
function C(e) {
|
|
2186
2341
|
let { active: t, over: n } = e;
|
|
2187
|
-
n && t.id !== n.id &&
|
|
2342
|
+
n && t.id !== n.id && m((e) => {
|
|
2188
2343
|
let r = e.findIndex((e) => e.key === t.id), i = e.findIndex((e) => e.key === n.id);
|
|
2189
|
-
return r < 0 || i < 0 ? e :
|
|
2344
|
+
return r < 0 || i < 0 ? e : st(e, r, i);
|
|
2190
2345
|
});
|
|
2191
2346
|
}
|
|
2192
2347
|
function w(e, t) {
|
|
2193
|
-
|
|
2348
|
+
m((n) => n.map((n) => n.key === e ? {
|
|
2194
2349
|
...n,
|
|
2195
2350
|
emphasis: t
|
|
2196
2351
|
} : n));
|
|
2197
2352
|
}
|
|
2198
|
-
let T =
|
|
2199
|
-
return /* @__PURE__ */
|
|
2353
|
+
let T = fe(() => Fn(p), [p]), E = p.some((e) => e.emphasis === "SMALL");
|
|
2354
|
+
return /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ q("div", {
|
|
2200
2355
|
className: "mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md",
|
|
2201
2356
|
children: [
|
|
2202
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ K("span", {
|
|
2203
2358
|
className: "mr-auto text-sm text-muted-foreground",
|
|
2204
|
-
children:
|
|
2359
|
+
children: f("bento.layout.editHint", { defaultValue: "Drag tiles to reorder · tap the size button to resize" })
|
|
2205
2360
|
}),
|
|
2206
|
-
i && t.onReset && /* @__PURE__ */
|
|
2361
|
+
i && t.onReset && /* @__PURE__ */ q(c, {
|
|
2207
2362
|
variant: "ghost",
|
|
2208
2363
|
size: "sm",
|
|
2209
2364
|
className: "gap-2",
|
|
2210
|
-
...
|
|
2211
|
-
onClick:
|
|
2212
|
-
children: [
|
|
2365
|
+
...v("reset"),
|
|
2366
|
+
onClick: x("reset", t.onReset),
|
|
2367
|
+
children: [h !== "reset" && /* @__PURE__ */ K(he, { size: 16 }), f("bento.layout.reset", { defaultValue: "Reset to default" })]
|
|
2213
2368
|
}),
|
|
2214
|
-
r && t.onSaveGlobal && /* @__PURE__ */
|
|
2369
|
+
r && t.onSaveGlobal && /* @__PURE__ */ q(c, {
|
|
2215
2370
|
variant: "outline",
|
|
2216
2371
|
size: "sm",
|
|
2217
2372
|
className: "gap-2",
|
|
2218
|
-
...
|
|
2219
|
-
onClick:
|
|
2220
|
-
children: [
|
|
2373
|
+
...v("global"),
|
|
2374
|
+
onClick: x("global", () => t.onSaveGlobal?.(T)),
|
|
2375
|
+
children: [h !== "global" && /* @__PURE__ */ K(He, { size: 16 }), f("bento.layout.saveGlobal", { defaultValue: "Set as default for everyone" })]
|
|
2221
2376
|
}),
|
|
2222
|
-
/* @__PURE__ */
|
|
2377
|
+
/* @__PURE__ */ q(c, {
|
|
2223
2378
|
variant: "ghost",
|
|
2224
2379
|
size: "sm",
|
|
2225
2380
|
className: "gap-2",
|
|
2226
|
-
...
|
|
2227
|
-
onClick:
|
|
2228
|
-
children: [/* @__PURE__ */
|
|
2381
|
+
...v("cancel"),
|
|
2382
|
+
onClick: d,
|
|
2383
|
+
children: [/* @__PURE__ */ K(Ue, { size: 16 }), f("common.cancel", { defaultValue: "Cancel" })]
|
|
2229
2384
|
}),
|
|
2230
|
-
/* @__PURE__ */
|
|
2385
|
+
/* @__PURE__ */ q(c, {
|
|
2231
2386
|
size: "sm",
|
|
2232
2387
|
className: "gap-2",
|
|
2233
|
-
...
|
|
2234
|
-
onClick:
|
|
2235
|
-
children: [
|
|
2388
|
+
...v("save"),
|
|
2389
|
+
onClick: x("save", () => t.onSave(T)),
|
|
2390
|
+
children: [h !== "save" && /* @__PURE__ */ K(Ee, { size: 16 }), f("bento.layout.save", { defaultValue: "Save layout" })]
|
|
2236
2391
|
}),
|
|
2237
|
-
|
|
2392
|
+
y && /* @__PURE__ */ K("p", {
|
|
2238
2393
|
role: "alert",
|
|
2239
2394
|
className: "w-full text-sm text-destructive",
|
|
2240
|
-
children:
|
|
2395
|
+
children: f("bento.layout.saveFailed", { defaultValue: "The layout could not be saved. Nothing has changed — try again." })
|
|
2241
2396
|
})
|
|
2242
2397
|
]
|
|
2243
|
-
}), /* @__PURE__ */
|
|
2244
|
-
sensors:
|
|
2245
|
-
collisionDetection:
|
|
2246
|
-
onDragEnd:
|
|
2247
|
-
children: /* @__PURE__ */
|
|
2248
|
-
items:
|
|
2249
|
-
strategy:
|
|
2250
|
-
children: /* @__PURE__ */
|
|
2398
|
+
}), /* @__PURE__ */ K(et, {
|
|
2399
|
+
sensors: S,
|
|
2400
|
+
collisionDetection: rt,
|
|
2401
|
+
onDragEnd: C,
|
|
2402
|
+
children: /* @__PURE__ */ K(ot, {
|
|
2403
|
+
items: p.map((e) => e.key),
|
|
2404
|
+
strategy: ct,
|
|
2405
|
+
children: /* @__PURE__ */ q("div", {
|
|
2251
2406
|
"data-slot": "bento-list-tiles",
|
|
2252
|
-
className: e(
|
|
2253
|
-
children: [!o && /* @__PURE__ */
|
|
2407
|
+
className: e(Kn, E && "grid-flow-dense"),
|
|
2408
|
+
children: [!o && /* @__PURE__ */ K(er, {
|
|
2254
2409
|
route: s,
|
|
2255
|
-
label:
|
|
2256
|
-
subtitle:
|
|
2257
|
-
}),
|
|
2410
|
+
label: l,
|
|
2411
|
+
subtitle: u
|
|
2412
|
+
}), p.map(({ item: e, key: t, emphasis: n }) => /* @__PURE__ */ K($n, {
|
|
2258
2413
|
id: t,
|
|
2259
2414
|
emphasis: n,
|
|
2260
2415
|
onSetEmphasis: (e) => w(t, e),
|
|
@@ -2264,11 +2419,11 @@ function Pn({ layout: t, resolved: n, canEditGlobal: r, isCustomized: i, renderT
|
|
|
2264
2419
|
})
|
|
2265
2420
|
})] });
|
|
2266
2421
|
}
|
|
2267
|
-
var
|
|
2422
|
+
var Zn = [
|
|
2268
2423
|
"SMALL",
|
|
2269
2424
|
"MEDIUM",
|
|
2270
2425
|
"LARGE"
|
|
2271
|
-
],
|
|
2426
|
+
], Qn = {
|
|
2272
2427
|
SMALL: {
|
|
2273
2428
|
key: "bento.layout.size.small",
|
|
2274
2429
|
def: "Small"
|
|
@@ -2282,29 +2437,29 @@ var Fn = [
|
|
|
2282
2437
|
def: "Large"
|
|
2283
2438
|
}
|
|
2284
2439
|
};
|
|
2285
|
-
function
|
|
2286
|
-
let { t: a } =
|
|
2287
|
-
transform:
|
|
2440
|
+
function $n({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
|
|
2441
|
+
let { t: a } = J(), { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } = lt({ id: t }), f = {
|
|
2442
|
+
transform: ut.Translate.toString(l),
|
|
2288
2443
|
transition: u,
|
|
2289
2444
|
opacity: d ? .6 : 1,
|
|
2290
2445
|
zIndex: d ? 50 : void 0
|
|
2291
2446
|
};
|
|
2292
|
-
return /* @__PURE__ */
|
|
2447
|
+
return /* @__PURE__ */ q("div", {
|
|
2293
2448
|
ref: c,
|
|
2294
2449
|
style: f,
|
|
2295
|
-
className: e("relative h-full",
|
|
2296
|
-
children: [/* @__PURE__ */
|
|
2450
|
+
className: e("relative h-full", Mn[n]),
|
|
2451
|
+
children: [/* @__PURE__ */ K("div", {
|
|
2297
2452
|
className: "pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full",
|
|
2298
2453
|
children: i
|
|
2299
|
-
}), /* @__PURE__ */
|
|
2454
|
+
}), /* @__PURE__ */ q("div", {
|
|
2300
2455
|
className: "absolute right-2 top-2 z-10 flex items-center gap-1",
|
|
2301
|
-
children: [/* @__PURE__ */
|
|
2456
|
+
children: [/* @__PURE__ */ K("div", {
|
|
2302
2457
|
role: "group",
|
|
2303
2458
|
"aria-label": a("bento.layout.sizeGroup", { defaultValue: "Tile size" }),
|
|
2304
2459
|
className: "flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur",
|
|
2305
|
-
children:
|
|
2306
|
-
let i = t === n, o = a(
|
|
2307
|
-
return /* @__PURE__ */
|
|
2460
|
+
children: Zn.map((t) => {
|
|
2461
|
+
let i = t === n, o = a(Qn[t].key, { defaultValue: Qn[t].def });
|
|
2462
|
+
return /* @__PURE__ */ K("button", {
|
|
2308
2463
|
type: "button",
|
|
2309
2464
|
onClick: () => r(t),
|
|
2310
2465
|
"aria-pressed": i,
|
|
@@ -2314,13 +2469,13 @@ function Ln({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
|
|
|
2314
2469
|
children: o.charAt(0)
|
|
2315
2470
|
}, t);
|
|
2316
2471
|
})
|
|
2317
|
-
}), /* @__PURE__ */
|
|
2472
|
+
}), /* @__PURE__ */ K("button", {
|
|
2318
2473
|
type: "button",
|
|
2319
2474
|
...o,
|
|
2320
2475
|
...s,
|
|
2321
2476
|
"aria-label": a("bento.layout.dragToReorder", { defaultValue: "Drag to reorder" }),
|
|
2322
2477
|
className: "grid size-(--vg-control-dense) cursor-grab place-items-center rounded-full border border-border/60 bg-background/80 shadow-sm backdrop-blur hover:bg-background active:cursor-grabbing",
|
|
2323
|
-
children: /* @__PURE__ */
|
|
2478
|
+
children: /* @__PURE__ */ K(ke, {
|
|
2324
2479
|
size: 14,
|
|
2325
2480
|
className: "text-muted-foreground"
|
|
2326
2481
|
})
|
|
@@ -2328,32 +2483,32 @@ function Ln({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
|
|
|
2328
2483
|
})]
|
|
2329
2484
|
});
|
|
2330
2485
|
}
|
|
2331
|
-
function
|
|
2332
|
-
let { t: r } =
|
|
2333
|
-
return /* @__PURE__ */
|
|
2486
|
+
function er({ route: e, label: t, subtitle: n }) {
|
|
2487
|
+
let { t: r } = J();
|
|
2488
|
+
return /* @__PURE__ */ q(Ke, {
|
|
2334
2489
|
to: e,
|
|
2335
2490
|
className: "bento-tile bento-tile-clickable col-span-2 row-span-1 flex flex-col gap-3 rounded-3xl border-2 border-dashed border-border/60 bg-card/30 p-5 backdrop-blur-md bento-new-tile hover:bg-card/50 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1",
|
|
2336
|
-
children: [/* @__PURE__ */
|
|
2491
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2337
2492
|
className: "flex items-center gap-3",
|
|
2338
|
-
children: [/* @__PURE__ */
|
|
2493
|
+
children: [/* @__PURE__ */ K("span", {
|
|
2339
2494
|
className: "bento-well grid h-10 w-10 place-items-center rounded-2xl",
|
|
2340
|
-
children: /* @__PURE__ */
|
|
2341
|
-
}), /* @__PURE__ */
|
|
2495
|
+
children: /* @__PURE__ */ K(Z, { size: 20 })
|
|
2496
|
+
}), /* @__PURE__ */ K("span", {
|
|
2342
2497
|
className: "text-[11px] uppercase tracking-wider text-muted-foreground",
|
|
2343
2498
|
children: r("forms.formActions.new", { defaultValue: "New" })
|
|
2344
2499
|
})]
|
|
2345
|
-
}), /* @__PURE__ */
|
|
2500
|
+
}), /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("div", {
|
|
2346
2501
|
className: "text-base font-semibold tracking-tight md:text-lg",
|
|
2347
2502
|
children: t
|
|
2348
|
-
}), n && /* @__PURE__ */
|
|
2503
|
+
}), n && /* @__PURE__ */ K("p", {
|
|
2349
2504
|
className: "mt-1 text-sm text-muted-foreground",
|
|
2350
2505
|
children: n
|
|
2351
2506
|
})] })]
|
|
2352
2507
|
});
|
|
2353
2508
|
}
|
|
2354
|
-
function
|
|
2355
|
-
return /* @__PURE__ */
|
|
2356
|
-
icon:
|
|
2509
|
+
function tr({ title: e, description: t }) {
|
|
2510
|
+
return /* @__PURE__ */ K(wt, {
|
|
2511
|
+
icon: Re,
|
|
2357
2512
|
title: e,
|
|
2358
2513
|
description: t,
|
|
2359
2514
|
align: "start",
|
|
@@ -2362,97 +2517,97 @@ function zn({ title: e, description: t }) {
|
|
|
2362
2517
|
}
|
|
2363
2518
|
//#endregion
|
|
2364
2519
|
//#region src/bento/bento-save-bar.tsx
|
|
2365
|
-
function
|
|
2366
|
-
let { t: l } =
|
|
2367
|
-
return /* @__PURE__ */
|
|
2520
|
+
function nr({ title: e, badges: t, actions: n, onCancel: r, loading: i, disabled: o, dirty: s, titleMissing: c }) {
|
|
2521
|
+
let { t: l } = J();
|
|
2522
|
+
return /* @__PURE__ */ q("div", {
|
|
2368
2523
|
className: "bento-frost flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl",
|
|
2369
|
-
children: [/* @__PURE__ */
|
|
2524
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2370
2525
|
className: "flex min-w-0 items-center gap-3",
|
|
2371
2526
|
children: [
|
|
2372
|
-
e && /* @__PURE__ */
|
|
2527
|
+
e && /* @__PURE__ */ K("p", {
|
|
2373
2528
|
className: "truncate text-base font-semibold tracking-tight md:text-lg",
|
|
2374
2529
|
children: e
|
|
2375
2530
|
}),
|
|
2376
|
-
/* @__PURE__ */
|
|
2531
|
+
/* @__PURE__ */ K(Nt, {
|
|
2377
2532
|
titleMissing: c,
|
|
2378
2533
|
dirty: s
|
|
2379
2534
|
}),
|
|
2380
|
-
t && /* @__PURE__ */
|
|
2535
|
+
t && /* @__PURE__ */ K("div", {
|
|
2381
2536
|
className: "flex shrink-0 items-center gap-1.5",
|
|
2382
2537
|
children: t
|
|
2383
2538
|
})
|
|
2384
2539
|
]
|
|
2385
|
-
}), /* @__PURE__ */
|
|
2540
|
+
}), /* @__PURE__ */ K("div", {
|
|
2386
2541
|
className: "flex shrink-0 gap-2",
|
|
2387
|
-
children: n ?? /* @__PURE__ */
|
|
2542
|
+
children: n ?? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ q(a, {
|
|
2388
2543
|
type: "submit",
|
|
2389
2544
|
size: "sm",
|
|
2390
2545
|
loading: i,
|
|
2391
2546
|
"aria-disabled": o ? "true" : void 0,
|
|
2392
|
-
children: [/* @__PURE__ */
|
|
2393
|
-
}), r && /* @__PURE__ */
|
|
2547
|
+
children: [/* @__PURE__ */ K(Ee, { className: "size-4" }), l("forms.formActions.saveChanges")]
|
|
2548
|
+
}), r && /* @__PURE__ */ q(a, {
|
|
2394
2549
|
type: "button",
|
|
2395
2550
|
variant: "outline",
|
|
2396
2551
|
size: "sm",
|
|
2397
2552
|
onClick: r,
|
|
2398
|
-
children: [/* @__PURE__ */
|
|
2553
|
+
children: [/* @__PURE__ */ K(Ue, { className: "size-4" }), l("forms.formActions.cancel")]
|
|
2399
2554
|
})] })
|
|
2400
2555
|
})]
|
|
2401
2556
|
});
|
|
2402
2557
|
}
|
|
2403
|
-
function
|
|
2404
|
-
return /* @__PURE__ */
|
|
2558
|
+
function rr({ children: e }) {
|
|
2559
|
+
return /* @__PURE__ */ K("span", {
|
|
2405
2560
|
className: "rounded-full border border-border/60 bg-card/50 px-2 py-0.5 text-[10px] uppercase tracking-wider text-muted-foreground backdrop-blur",
|
|
2406
2561
|
children: e
|
|
2407
2562
|
});
|
|
2408
2563
|
}
|
|
2409
|
-
|
|
2564
|
+
nr.Badge = rr;
|
|
2410
2565
|
//#endregion
|
|
2411
2566
|
//#region src/bento/bento-scroll-save-bar.tsx
|
|
2412
|
-
function
|
|
2413
|
-
let t =
|
|
2414
|
-
return
|
|
2415
|
-
/* @__PURE__ */
|
|
2567
|
+
function ir(e) {
|
|
2568
|
+
let t = U(null);
|
|
2569
|
+
return Pt(t), /* @__PURE__ */ q(G, { children: [
|
|
2570
|
+
/* @__PURE__ */ K("div", {
|
|
2416
2571
|
ref: t,
|
|
2417
2572
|
"aria-hidden": !0,
|
|
2418
2573
|
className: "h-px"
|
|
2419
2574
|
}),
|
|
2420
|
-
/* @__PURE__ */
|
|
2575
|
+
/* @__PURE__ */ K("div", {
|
|
2421
2576
|
"aria-hidden": !0,
|
|
2422
2577
|
className: "bento-save-bar-spacer"
|
|
2423
2578
|
}),
|
|
2424
|
-
/* @__PURE__ */
|
|
2579
|
+
/* @__PURE__ */ K("div", {
|
|
2425
2580
|
className: "bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8",
|
|
2426
|
-
children: /* @__PURE__ */
|
|
2581
|
+
children: /* @__PURE__ */ K(nr, { ...e })
|
|
2427
2582
|
})
|
|
2428
2583
|
] });
|
|
2429
2584
|
}
|
|
2430
2585
|
//#endregion
|
|
2431
2586
|
//#region src/bento/bento-form-hero.tsx
|
|
2432
|
-
function
|
|
2433
|
-
let { t: _ } =
|
|
2434
|
-
return /* @__PURE__ */
|
|
2587
|
+
function ar({ eyebrow: e, backTo: t, backLabel: n, trail: r, leading: i, title: o, subtitle: s, trailing: c, onCancel: l, actions: u, loading: d, dirty: f, titleMissing: p, saveDisabled: m, stickyTitle: h, stickyBadges: g }) {
|
|
2588
|
+
let { t: _ } = J(), v = m ?? (!!p || !f), y = Ot(r, t, n) ?? e;
|
|
2589
|
+
return /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(kt, {
|
|
2435
2590
|
eyebrow: y,
|
|
2436
2591
|
leading: i,
|
|
2437
2592
|
title: o,
|
|
2438
2593
|
subtitle: s,
|
|
2439
|
-
trailing: /* @__PURE__ */
|
|
2594
|
+
trailing: /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("div", {
|
|
2440
2595
|
className: "bento-fade-out flex shrink-0 items-center gap-2",
|
|
2441
|
-
children: u ?? /* @__PURE__ */
|
|
2596
|
+
children: u ?? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ q(a, {
|
|
2442
2597
|
type: "submit",
|
|
2443
2598
|
size: "sm",
|
|
2444
2599
|
loading: d,
|
|
2445
2600
|
"aria-disabled": v ? "true" : void 0,
|
|
2446
|
-
children: [/* @__PURE__ */
|
|
2447
|
-
}), /* @__PURE__ */
|
|
2601
|
+
children: [/* @__PURE__ */ K(Ee, { className: "size-4" }), _("forms.formActions.saveChanges")]
|
|
2602
|
+
}), /* @__PURE__ */ q(a, {
|
|
2448
2603
|
type: "button",
|
|
2449
2604
|
variant: "outline",
|
|
2450
2605
|
size: "sm",
|
|
2451
2606
|
onClick: l,
|
|
2452
|
-
children: [/* @__PURE__ */
|
|
2607
|
+
children: [/* @__PURE__ */ K(Ue, { className: "size-4" }), _("forms.formActions.cancel")]
|
|
2453
2608
|
})] })
|
|
2454
2609
|
}), c] })
|
|
2455
|
-
}), /* @__PURE__ */
|
|
2610
|
+
}), /* @__PURE__ */ K(ir, {
|
|
2456
2611
|
title: h,
|
|
2457
2612
|
badges: g,
|
|
2458
2613
|
actions: u,
|
|
@@ -2465,32 +2620,32 @@ function Un({ eyebrow: e, backTo: t, backLabel: n, trail: r, leading: i, title:
|
|
|
2465
2620
|
}
|
|
2466
2621
|
//#endregion
|
|
2467
2622
|
//#region src/bento/bento-form-section.tsx
|
|
2468
|
-
var
|
|
2469
|
-
function
|
|
2470
|
-
return /* @__PURE__ */
|
|
2471
|
-
className: e(
|
|
2472
|
-
children: [/* @__PURE__ */
|
|
2623
|
+
var or = "bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6";
|
|
2624
|
+
function sr({ icon: t, title: n, description: r, children: i, trailing: a, as: o = "h2", className: s }) {
|
|
2625
|
+
return /* @__PURE__ */ q("section", {
|
|
2626
|
+
className: e(or, s),
|
|
2627
|
+
children: [/* @__PURE__ */ q("header", {
|
|
2473
2628
|
className: "flex items-start justify-between gap-3",
|
|
2474
|
-
children: [/* @__PURE__ */
|
|
2629
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2475
2630
|
className: "flex items-center gap-3",
|
|
2476
|
-
children: [/* @__PURE__ */
|
|
2631
|
+
children: [/* @__PURE__ */ K("span", {
|
|
2477
2632
|
className: "bento-well grid h-10 w-10 place-items-center rounded-2xl",
|
|
2478
|
-
children: /* @__PURE__ */
|
|
2479
|
-
}), /* @__PURE__ */
|
|
2633
|
+
children: /* @__PURE__ */ K(t, { size: 20 })
|
|
2634
|
+
}), /* @__PURE__ */ q("div", {
|
|
2480
2635
|
className: "flex flex-col gap-0.5",
|
|
2481
|
-
children: [/* @__PURE__ */
|
|
2636
|
+
children: [/* @__PURE__ */ K(o, {
|
|
2482
2637
|
className: "text-base font-semibold tracking-tight md:text-lg",
|
|
2483
2638
|
children: n
|
|
2484
|
-
}), r && /* @__PURE__ */
|
|
2639
|
+
}), r && /* @__PURE__ */ K("p", {
|
|
2485
2640
|
className: "text-sm text-muted-foreground",
|
|
2486
2641
|
children: r
|
|
2487
2642
|
})]
|
|
2488
2643
|
})]
|
|
2489
|
-
}), a && /* @__PURE__ */
|
|
2644
|
+
}), a && /* @__PURE__ */ K("div", {
|
|
2490
2645
|
className: "shrink-0",
|
|
2491
2646
|
children: a
|
|
2492
2647
|
})]
|
|
2493
|
-
}), /* @__PURE__ */
|
|
2648
|
+
}), /* @__PURE__ */ K("div", {
|
|
2494
2649
|
className: "flex flex-col gap-5",
|
|
2495
2650
|
children: i
|
|
2496
2651
|
})]
|
|
@@ -2498,10 +2653,10 @@ function Gn({ icon: t, title: n, description: r, children: i, trailing: a, as: o
|
|
|
2498
2653
|
}
|
|
2499
2654
|
//#endregion
|
|
2500
2655
|
//#region src/bento/bento-panel.tsx
|
|
2501
|
-
function
|
|
2502
|
-
return /* @__PURE__ */
|
|
2656
|
+
function cr({ children: t, className: n, contentClassName: r }) {
|
|
2657
|
+
return /* @__PURE__ */ K("div", {
|
|
2503
2658
|
className: e("bento-glass rounded-2xl shadow-md", n),
|
|
2504
|
-
children: /* @__PURE__ */
|
|
2659
|
+
children: /* @__PURE__ */ K("div", {
|
|
2505
2660
|
className: r,
|
|
2506
2661
|
children: t
|
|
2507
2662
|
})
|
|
@@ -2509,16 +2664,16 @@ function Kn({ children: t, className: n, contentClassName: r }) {
|
|
|
2509
2664
|
}
|
|
2510
2665
|
//#endregion
|
|
2511
2666
|
//#region src/bento/bento-back-to-top.tsx
|
|
2512
|
-
var
|
|
2513
|
-
function
|
|
2667
|
+
var lr = 480;
|
|
2668
|
+
function ur(e) {
|
|
2514
2669
|
return window.addEventListener("scroll", e, { passive: !0 }), () => window.removeEventListener("scroll", e);
|
|
2515
2670
|
}
|
|
2516
|
-
function
|
|
2517
|
-
return window.scrollY >
|
|
2671
|
+
function dr() {
|
|
2672
|
+
return window.scrollY > lr;
|
|
2518
2673
|
}
|
|
2519
|
-
function
|
|
2520
|
-
let { t } =
|
|
2521
|
-
return /* @__PURE__ */
|
|
2674
|
+
function fr({ inline: e = !1 } = {}) {
|
|
2675
|
+
let { t } = J(), n = ee(), r = e || n, i = pe(ur, dr, () => !1);
|
|
2676
|
+
return /* @__PURE__ */ K("button", {
|
|
2522
2677
|
type: "button",
|
|
2523
2678
|
"aria-label": t("bento.backToTop", { defaultValue: "Back to top" }),
|
|
2524
2679
|
tabIndex: i ? 0 : -1,
|
|
@@ -2527,28 +2682,28 @@ function Xn({ inline: e = !1 } = {}) {
|
|
|
2527
2682
|
behavior: "smooth"
|
|
2528
2683
|
}),
|
|
2529
2684
|
className: `${r ? "relative" : "fixed bottom-6 right-6 z-40"} grid h-11 w-11 place-items-center rounded-full border border-border/60 bg-card/80 text-foreground shadow-lg backdrop-blur-xl transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] hover:-translate-y-0.5 hover:shadow-xl active:scale-95 ${i ? "pointer-events-auto translate-y-0 scale-100 opacity-100" : "pointer-events-none translate-y-4 scale-90 opacity-0"}`,
|
|
2530
|
-
children: /* @__PURE__ */
|
|
2685
|
+
children: /* @__PURE__ */ K(ve, { size: 18 })
|
|
2531
2686
|
});
|
|
2532
2687
|
}
|
|
2533
2688
|
//#endregion
|
|
2534
2689
|
//#region src/bento/bento-nav.ts
|
|
2535
|
-
function
|
|
2690
|
+
function pr(e) {
|
|
2536
2691
|
return e.bentoRoute ?? e.fallbackRoute;
|
|
2537
2692
|
}
|
|
2538
2693
|
//#endregion
|
|
2539
2694
|
//#region src/bento/bento-command-palette.tsx
|
|
2540
|
-
function
|
|
2541
|
-
return e ? /* @__PURE__ */
|
|
2695
|
+
function mr({ label: e, children: t }) {
|
|
2696
|
+
return e ? /* @__PURE__ */ q("div", {
|
|
2542
2697
|
role: "group",
|
|
2543
2698
|
"aria-label": e,
|
|
2544
|
-
children: [/* @__PURE__ */
|
|
2699
|
+
children: [/* @__PURE__ */ K("p", {
|
|
2545
2700
|
className: "px-3 pt-2 pb-1 text-xs font-medium text-muted-foreground",
|
|
2546
2701
|
children: e
|
|
2547
2702
|
}), t]
|
|
2548
|
-
}) : /* @__PURE__ */ G
|
|
2703
|
+
}) : /* @__PURE__ */ K(G, { children: t });
|
|
2549
2704
|
}
|
|
2550
|
-
function
|
|
2551
|
-
return /* @__PURE__ */
|
|
2705
|
+
function hr({ index: e, active: t, icon: n, label: r, description: i, trailing: a, onActivate: o, onChoose: s }) {
|
|
2706
|
+
return /* @__PURE__ */ q("button", {
|
|
2552
2707
|
type: "button",
|
|
2553
2708
|
id: `bento-palette-opt-${e}`,
|
|
2554
2709
|
"data-index": e,
|
|
@@ -2558,18 +2713,18 @@ function $n({ index: e, active: t, icon: n, label: r, description: i, trailing:
|
|
|
2558
2713
|
onClick: s,
|
|
2559
2714
|
className: `flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${t ? "bg-accent text-accent-foreground" : "text-foreground"}`,
|
|
2560
2715
|
children: [
|
|
2561
|
-
n && /* @__PURE__ */
|
|
2716
|
+
n && /* @__PURE__ */ K(n, {
|
|
2562
2717
|
size: 18,
|
|
2563
2718
|
className: "shrink-0 text-muted-foreground"
|
|
2564
2719
|
}),
|
|
2565
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ q("span", {
|
|
2566
2721
|
className: "flex-1 truncate",
|
|
2567
|
-
children: [r, i && /* @__PURE__ */
|
|
2722
|
+
children: [r, i && /* @__PURE__ */ K("span", {
|
|
2568
2723
|
className: "ml-2 text-muted-foreground",
|
|
2569
2724
|
children: i
|
|
2570
2725
|
})]
|
|
2571
2726
|
}),
|
|
2572
|
-
a ?? (t && /* @__PURE__ */
|
|
2727
|
+
a ?? (t && /* @__PURE__ */ K(X, {
|
|
2573
2728
|
"aria-hidden": !0,
|
|
2574
2729
|
size: 15,
|
|
2575
2730
|
className: "shrink-0 text-muted-foreground"
|
|
@@ -2577,8 +2732,8 @@ function $n({ index: e, active: t, icon: n, label: r, description: i, trailing:
|
|
|
2577
2732
|
]
|
|
2578
2733
|
});
|
|
2579
2734
|
}
|
|
2580
|
-
function
|
|
2581
|
-
let { t: l } =
|
|
2735
|
+
function gr({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c }) {
|
|
2736
|
+
let { t: l } = J(), u = Ye(), [d, f] = W(""), [p, m] = W(0), h = U(null), g = fe(() => {
|
|
2582
2737
|
let e = d.trim().toLowerCase(), t = a.map((e) => ({
|
|
2583
2738
|
item: e,
|
|
2584
2739
|
label: l(e.titleKey),
|
|
@@ -2592,26 +2747,26 @@ function er({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c })
|
|
|
2592
2747
|
a,
|
|
2593
2748
|
d,
|
|
2594
2749
|
l
|
|
2595
|
-
]), _ =
|
|
2750
|
+
]), _ = fe(() => [...g.map((e) => ({
|
|
2596
2751
|
kind: "nav",
|
|
2597
2752
|
entry: e
|
|
2598
2753
|
})), ...(o?.items ?? []).map((e) => ({
|
|
2599
2754
|
kind: "supplied",
|
|
2600
2755
|
item: e
|
|
2601
|
-
}))], [g, o]), v =
|
|
2602
|
-
|
|
2756
|
+
}))], [g, o]), v = U(c);
|
|
2757
|
+
V(() => {
|
|
2603
2758
|
v.current = c;
|
|
2604
|
-
}),
|
|
2759
|
+
}), V(() => {
|
|
2605
2760
|
v.current?.(d);
|
|
2606
2761
|
}, [d]);
|
|
2607
|
-
let [y, b] =
|
|
2762
|
+
let [y, b] = W(e);
|
|
2608
2763
|
e !== y && (b(e), e && (f(""), m(0)));
|
|
2609
2764
|
let x = _.length === 0 ? 0 : _.length - 1;
|
|
2610
|
-
p > x && m(x),
|
|
2765
|
+
p > x && m(x), V(() => {
|
|
2611
2766
|
(h.current?.querySelector(`[data-index="${p}"]`))?.scrollIntoView({ block: "nearest" });
|
|
2612
2767
|
}, [p]);
|
|
2613
2768
|
function S(e) {
|
|
2614
|
-
t(!1), e.kind === "nav" ? u(
|
|
2769
|
+
t(!1), e.kind === "nav" ? u(pr(e.entry.item)) : o?.onSelect(e.item);
|
|
2615
2770
|
}
|
|
2616
2771
|
function C(e) {
|
|
2617
2772
|
if (e.key === "ArrowDown") e.preventDefault(), m((e) => _.length === 0 ? 0 : (e + 1) % _.length);
|
|
@@ -2622,28 +2777,28 @@ function er({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c })
|
|
|
2622
2777
|
t && S(t);
|
|
2623
2778
|
}
|
|
2624
2779
|
}
|
|
2625
|
-
return /* @__PURE__ */
|
|
2780
|
+
return /* @__PURE__ */ K(n, {
|
|
2626
2781
|
open: e,
|
|
2627
2782
|
onOpenChange: t,
|
|
2628
|
-
children: /* @__PURE__ */
|
|
2783
|
+
children: /* @__PURE__ */ q(s, {
|
|
2629
2784
|
showCloseButton: !1,
|
|
2630
2785
|
className: "top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0",
|
|
2631
2786
|
onKeyDown: C,
|
|
2632
2787
|
children: [
|
|
2633
|
-
/* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ K(i, {
|
|
2634
2789
|
className: "sr-only",
|
|
2635
2790
|
children: l("bento.palette.title", { defaultValue: "Command palette" })
|
|
2636
2791
|
}),
|
|
2637
|
-
/* @__PURE__ */
|
|
2792
|
+
/* @__PURE__ */ K(r, {
|
|
2638
2793
|
className: "sr-only",
|
|
2639
2794
|
children: l("bento.palette.description", { defaultValue: "Search and jump to any area" })
|
|
2640
2795
|
}),
|
|
2641
|
-
/* @__PURE__ */
|
|
2796
|
+
/* @__PURE__ */ q("div", {
|
|
2642
2797
|
className: "flex items-center gap-3 border-b border-border/60 px-4",
|
|
2643
|
-
children: [/* @__PURE__ */
|
|
2798
|
+
children: [/* @__PURE__ */ K(Le, {
|
|
2644
2799
|
size: 18,
|
|
2645
2800
|
className: "shrink-0 text-muted-foreground"
|
|
2646
|
-
}), /* @__PURE__ */
|
|
2801
|
+
}), /* @__PURE__ */ K("input", {
|
|
2647
2802
|
autoFocus: !0,
|
|
2648
2803
|
type: "text",
|
|
2649
2804
|
role: "combobox",
|
|
@@ -2656,41 +2811,41 @@ function er({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c })
|
|
|
2656
2811
|
className: "h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
|
2657
2812
|
})]
|
|
2658
2813
|
}),
|
|
2659
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ q("div", {
|
|
2660
2815
|
ref: h,
|
|
2661
2816
|
id: "bento-palette-list",
|
|
2662
2817
|
role: "listbox",
|
|
2663
2818
|
"aria-label": l("bento.palette.title", { defaultValue: "Command palette" }),
|
|
2664
2819
|
className: "max-h-80 overflow-y-auto p-2",
|
|
2665
2820
|
children: [
|
|
2666
|
-
_.length === 0 && !o?.pending && /* @__PURE__ */
|
|
2821
|
+
_.length === 0 && !o?.pending && /* @__PURE__ */ K("p", {
|
|
2667
2822
|
className: "px-3 py-6 text-center text-sm text-muted-foreground",
|
|
2668
2823
|
children: l("bento.palette.noResults", { defaultValue: "No matches" })
|
|
2669
2824
|
}),
|
|
2670
|
-
/* @__PURE__ */
|
|
2825
|
+
/* @__PURE__ */ K(mr, {
|
|
2671
2826
|
label: o && g.length > 0 ? l("bento.palette.areas", { defaultValue: "Areas" }) : void 0,
|
|
2672
|
-
children: g.map(({ item: e, label: t }, n) => /* @__PURE__ */
|
|
2827
|
+
children: g.map(({ item: e, label: t }, n) => /* @__PURE__ */ K(hr, {
|
|
2673
2828
|
index: n,
|
|
2674
2829
|
active: n === p,
|
|
2675
2830
|
icon: e.icon,
|
|
2676
2831
|
label: t,
|
|
2677
2832
|
onActivate: () => m(n),
|
|
2678
2833
|
onChoose: () => S(_[n]),
|
|
2679
|
-
trailing: e.bentoRoute ? void 0 : /* @__PURE__ */
|
|
2834
|
+
trailing: e.bentoRoute ? void 0 : /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(Oe, {
|
|
2680
2835
|
"aria-hidden": !0,
|
|
2681
2836
|
size: 15,
|
|
2682
2837
|
className: "shrink-0 text-muted-foreground/70"
|
|
2683
|
-
}), /* @__PURE__ */
|
|
2838
|
+
}), /* @__PURE__ */ K("span", {
|
|
2684
2839
|
className: "sr-only",
|
|
2685
2840
|
children: l("bento.palette.opensConsole", { defaultValue: "Opens in console" })
|
|
2686
2841
|
})] })
|
|
2687
2842
|
}, e.id))
|
|
2688
2843
|
}),
|
|
2689
|
-
o && /* @__PURE__ */
|
|
2844
|
+
o && /* @__PURE__ */ q(mr, {
|
|
2690
2845
|
label: o.label,
|
|
2691
2846
|
children: [o.items.map((e, t) => {
|
|
2692
2847
|
let n = g.length + t;
|
|
2693
|
-
return /* @__PURE__ */
|
|
2848
|
+
return /* @__PURE__ */ K(hr, {
|
|
2694
2849
|
index: n,
|
|
2695
2850
|
active: n === p,
|
|
2696
2851
|
icon: e.icon,
|
|
@@ -2699,7 +2854,7 @@ function er({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c })
|
|
|
2699
2854
|
onActivate: () => m(n),
|
|
2700
2855
|
onChoose: () => S(_[n])
|
|
2701
2856
|
}, e.id);
|
|
2702
|
-
}), o.pending && /* @__PURE__ */
|
|
2857
|
+
}), o.pending && /* @__PURE__ */ K("p", {
|
|
2703
2858
|
className: "px-3 py-2.5 text-sm text-muted-foreground",
|
|
2704
2859
|
children: l("bento.palette.searching", { defaultValue: "Searching…" })
|
|
2705
2860
|
})]
|
|
@@ -2712,22 +2867,32 @@ function er({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c })
|
|
|
2712
2867
|
}
|
|
2713
2868
|
//#endregion
|
|
2714
2869
|
//#region src/bento/bento-shell.tsx
|
|
2715
|
-
function
|
|
2716
|
-
let { t: c } =
|
|
2870
|
+
function _r({ rail: t, headerStart: n, headerEnd: r, column: i = "default", dock: a, backToTop: o = !0, children: s }) {
|
|
2871
|
+
let { t: c } = J(), l = qe(), u = H(), d = U(null), f = U(null), p = i === "full", m = n != null || r != null, h = re(), g = null;
|
|
2717
2872
|
a != null && (g = h ? m ? "header" : "corner" : t == null ? "corner" : "rail");
|
|
2718
|
-
let _ = o || g === "corner", v = (
|
|
2873
|
+
let _ = o || g === "corner", v = U(null), y = U(null);
|
|
2874
|
+
V(() => {
|
|
2875
|
+
let e = v.current, t = y.current;
|
|
2876
|
+
if (!e || !t || p || typeof ResizeObserver > "u") return;
|
|
2877
|
+
let n = new ResizeObserver(() => e.style.setProperty("--bento-shell-header", `${t.offsetHeight}px`));
|
|
2878
|
+
return n.observe(t), () => {
|
|
2879
|
+
n.disconnect(), e.style.removeProperty("--bento-shell-header");
|
|
2880
|
+
};
|
|
2881
|
+
}, [p, m]);
|
|
2882
|
+
let b = (e) => /* @__PURE__ */ K(I.Provider, {
|
|
2719
2883
|
value: !0,
|
|
2720
|
-
children: /* @__PURE__ */
|
|
2884
|
+
children: /* @__PURE__ */ K(A.Provider, {
|
|
2721
2885
|
value: e,
|
|
2722
2886
|
children: a
|
|
2723
2887
|
})
|
|
2724
2888
|
});
|
|
2725
|
-
return /* @__PURE__ */
|
|
2889
|
+
return /* @__PURE__ */ q("div", {
|
|
2890
|
+
ref: v,
|
|
2726
2891
|
"data-slot": "bento-shell",
|
|
2727
2892
|
className: e("relative w-full bg-background text-foreground", t != null && "bento-rail-gutter", p ? "flex h-svh flex-col overflow-hidden" : "min-h-svh"),
|
|
2728
2893
|
style: g === "rail" ? { "--bento-rail-foot": "4.5rem" } : void 0,
|
|
2729
2894
|
children: [
|
|
2730
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ K("a", {
|
|
2731
2896
|
href: `#${u}`,
|
|
2732
2897
|
onClick: (e) => {
|
|
2733
2898
|
e.preventDefault(), d.current?.focus();
|
|
@@ -2735,37 +2900,38 @@ function tr({ rail: t, headerStart: n, headerEnd: r, column: i = "default", dock
|
|
|
2735
2900
|
className: "sr-only rounded-full border border-border/60 bg-card px-4 py-2 text-sm shadow-lg focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[60]",
|
|
2736
2901
|
children: c("bento.shell.skip", { defaultValue: "Skip to content" })
|
|
2737
2902
|
}),
|
|
2738
|
-
/* @__PURE__ */
|
|
2903
|
+
/* @__PURE__ */ K("span", {
|
|
2739
2904
|
ref: f,
|
|
2740
2905
|
role: "status",
|
|
2741
2906
|
"aria-live": "polite",
|
|
2742
2907
|
className: "sr-only"
|
|
2743
2908
|
}),
|
|
2744
|
-
l && /* @__PURE__ */
|
|
2909
|
+
l && /* @__PURE__ */ K(vr, {
|
|
2745
2910
|
main: d,
|
|
2746
2911
|
announcer: f
|
|
2747
2912
|
}),
|
|
2748
2913
|
t,
|
|
2749
|
-
g === "rail" && /* @__PURE__ */
|
|
2914
|
+
g === "rail" && /* @__PURE__ */ K("div", {
|
|
2750
2915
|
"data-slot": "bento-shell-dock",
|
|
2751
2916
|
className: "pointer-events-none fixed bottom-4 left-[18px] z-50 flex flex-col items-start",
|
|
2752
|
-
children:
|
|
2917
|
+
children: b("rail")
|
|
2753
2918
|
}),
|
|
2754
|
-
m && /* @__PURE__ */
|
|
2919
|
+
m && /* @__PURE__ */ q("header", {
|
|
2920
|
+
ref: y,
|
|
2755
2921
|
className: "bento-shell-header bento-shell-bar sticky top-0 z-30 flex shrink-0 items-center justify-between gap-3 border-b border-border/40 bg-background/55 py-3 backdrop-blur-xl backdrop-saturate-150",
|
|
2756
|
-
children: [/* @__PURE__ */
|
|
2922
|
+
children: [/* @__PURE__ */ K("div", {
|
|
2757
2923
|
className: "flex min-w-0 items-center gap-3",
|
|
2758
2924
|
children: n
|
|
2759
|
-
}), /* @__PURE__ */
|
|
2925
|
+
}), /* @__PURE__ */ q("div", {
|
|
2760
2926
|
className: "flex items-center gap-2",
|
|
2761
|
-
children: [r, g === "header" && /* @__PURE__ */
|
|
2927
|
+
children: [r, g === "header" && /* @__PURE__ */ K("div", {
|
|
2762
2928
|
"data-slot": "bento-shell-dock",
|
|
2763
2929
|
className: "relative flex",
|
|
2764
|
-
children:
|
|
2930
|
+
children: b("header")
|
|
2765
2931
|
})]
|
|
2766
2932
|
})]
|
|
2767
2933
|
}),
|
|
2768
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ K("main", {
|
|
2769
2935
|
ref: d,
|
|
2770
2936
|
id: u,
|
|
2771
2937
|
tabIndex: -1,
|
|
@@ -2774,20 +2940,20 @@ function tr({ rail: t, headerStart: n, headerEnd: r, column: i = "default", dock
|
|
|
2774
2940
|
className: "bento-shell-main",
|
|
2775
2941
|
children: s
|
|
2776
2942
|
}),
|
|
2777
|
-
_ && /* @__PURE__ */
|
|
2943
|
+
_ && /* @__PURE__ */ K("div", {
|
|
2778
2944
|
"data-slot": "bento-shell-corner",
|
|
2779
2945
|
className: "pointer-events-none fixed bottom-5 right-5 z-50 flex flex-col items-end gap-3",
|
|
2780
|
-
children: /* @__PURE__ */
|
|
2946
|
+
children: /* @__PURE__ */ q(I.Provider, {
|
|
2781
2947
|
value: !0,
|
|
2782
|
-
children: [o && /* @__PURE__ */
|
|
2948
|
+
children: [o && /* @__PURE__ */ K(fr, {}), g === "corner" && b("corner")]
|
|
2783
2949
|
})
|
|
2784
2950
|
})
|
|
2785
2951
|
]
|
|
2786
2952
|
});
|
|
2787
2953
|
}
|
|
2788
|
-
function
|
|
2789
|
-
let { pathname: n } =
|
|
2790
|
-
return
|
|
2954
|
+
function vr({ main: e, announcer: t }) {
|
|
2955
|
+
let { pathname: n } = Je(), r = U(n);
|
|
2956
|
+
return V(() => {
|
|
2791
2957
|
if (r.current === n) return;
|
|
2792
2958
|
r.current = n;
|
|
2793
2959
|
let i = 0, a, o = () => {
|
|
@@ -2807,7 +2973,7 @@ function nr({ main: e, announcer: t }) {
|
|
|
2807
2973
|
}
|
|
2808
2974
|
//#endregion
|
|
2809
2975
|
//#region src/bento/bento-shell-shortcuts.ts
|
|
2810
|
-
var
|
|
2976
|
+
var yr = Object.freeze([
|
|
2811
2977
|
{
|
|
2812
2978
|
action: "palette",
|
|
2813
2979
|
key: "k",
|
|
@@ -2822,14 +2988,14 @@ var rr = Object.freeze([
|
|
|
2822
2988
|
key: "?"
|
|
2823
2989
|
}
|
|
2824
2990
|
]);
|
|
2825
|
-
function
|
|
2991
|
+
function br() {
|
|
2826
2992
|
return typeof navigator > "u" ? !1 : /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || "");
|
|
2827
2993
|
}
|
|
2828
|
-
function
|
|
2994
|
+
function xr(e, t) {
|
|
2829
2995
|
let n = e.key.length === 1 ? e.key.toUpperCase() : e.key;
|
|
2830
2996
|
return e.mod ? [t ? "⌘" : "Ctrl", n] : [n];
|
|
2831
2997
|
}
|
|
2832
|
-
function
|
|
2998
|
+
function Sr(e) {
|
|
2833
2999
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2834
3000
|
if ([
|
|
2835
3001
|
"INPUT",
|
|
@@ -2839,24 +3005,24 @@ function or(e) {
|
|
|
2839
3005
|
let t = e.closest("[contenteditable]");
|
|
2840
3006
|
return t !== null && t.getAttribute("contenteditable") !== "false";
|
|
2841
3007
|
}
|
|
2842
|
-
function
|
|
3008
|
+
function Cr(e, t) {
|
|
2843
3009
|
if (e.defaultPrevented || e.isComposing || e.repeat) return;
|
|
2844
3010
|
let n = e.key.toLowerCase();
|
|
2845
|
-
return
|
|
3011
|
+
return yr.find((r) => n === r.key ? r.mod ? (t ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey) && !e.altKey && !e.shiftKey : e.metaKey || Sr(e.target) ? !1 : e.ctrlKey === e.altKey : !1);
|
|
2846
3012
|
}
|
|
2847
|
-
function
|
|
2848
|
-
let r =
|
|
3013
|
+
function wr({ onPalette: e, onShortcuts: t, isMac: n = br() }) {
|
|
3014
|
+
let r = U({
|
|
2849
3015
|
onPalette: e,
|
|
2850
3016
|
onShortcuts: t
|
|
2851
3017
|
});
|
|
2852
|
-
|
|
3018
|
+
V(() => {
|
|
2853
3019
|
r.current = {
|
|
2854
3020
|
onPalette: e,
|
|
2855
3021
|
onShortcuts: t
|
|
2856
3022
|
};
|
|
2857
|
-
}),
|
|
3023
|
+
}), V(() => {
|
|
2858
3024
|
function e(e) {
|
|
2859
|
-
let t =
|
|
3025
|
+
let t = Cr(e, n), i = t?.action === "palette" ? r.current.onPalette : t && r.current.onShortcuts;
|
|
2860
3026
|
i && (e.preventDefault(), i());
|
|
2861
3027
|
}
|
|
2862
3028
|
return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
|
|
@@ -2864,42 +3030,42 @@ function cr({ onPalette: e, onShortcuts: t, isMac: n = ir() }) {
|
|
|
2864
3030
|
}
|
|
2865
3031
|
//#endregion
|
|
2866
3032
|
//#region src/bento/bento-palette-trigger.tsx
|
|
2867
|
-
function
|
|
2868
|
-
let { t: i } =
|
|
2869
|
-
return /* @__PURE__ */
|
|
3033
|
+
function Tr({ onClick: t, isMac: n = br(), className: r }) {
|
|
3034
|
+
let { t: i } = J(), a = yr.filter((e) => e.action === "palette"), o = a.find((e) => e.mod);
|
|
3035
|
+
return /* @__PURE__ */ q("button", {
|
|
2870
3036
|
type: "button",
|
|
2871
3037
|
onClick: t,
|
|
2872
3038
|
"aria-keyshortcuts": a.map((e) => e.mod ? `${n ? "Meta" : "Control"}+${e.key.toUpperCase()}` : e.key).join(" "),
|
|
2873
3039
|
className: e("bento-tile bento-tile-clickable inline-flex items-center gap-2 rounded-full border border-border/60 bg-card/60 py-1.5 pl-3 pr-2 text-sm text-muted-foreground backdrop-blur hover:text-foreground", r),
|
|
2874
3040
|
children: [
|
|
2875
|
-
/* @__PURE__ */
|
|
3041
|
+
/* @__PURE__ */ K(Le, {
|
|
2876
3042
|
"aria-hidden": !0,
|
|
2877
3043
|
size: 16
|
|
2878
3044
|
}),
|
|
2879
|
-
/* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ K("span", {
|
|
2880
3046
|
className: "sr-only sm:not-sr-only",
|
|
2881
3047
|
children: i("bento.palette.search", { defaultValue: "Search" })
|
|
2882
3048
|
}),
|
|
2883
|
-
o && /* @__PURE__ */
|
|
3049
|
+
o && /* @__PURE__ */ K("kbd", {
|
|
2884
3050
|
"aria-hidden": !0,
|
|
2885
3051
|
className: "hidden rounded-sm border border-border/60 bg-muted px-1.5 py-0.5 text-[10px] font-medium tracking-wide sm:inline",
|
|
2886
|
-
children:
|
|
3052
|
+
children: xr(o, n).join(n ? "" : " ")
|
|
2887
3053
|
})
|
|
2888
3054
|
]
|
|
2889
3055
|
});
|
|
2890
3056
|
}
|
|
2891
3057
|
//#endregion
|
|
2892
3058
|
//#region src/bento/bento-shortcuts-dialog.tsx
|
|
2893
|
-
function
|
|
2894
|
-
let { t: c } =
|
|
3059
|
+
function Er({ open: e, onOpenChange: t, isMac: a = br() }) {
|
|
3060
|
+
let { t: c } = J(), l = {
|
|
2895
3061
|
palette: c("bento.palette.open", { defaultValue: "Open command palette" }),
|
|
2896
3062
|
shortcuts: c("bento.shortcuts.openGuide", { defaultValue: "Show keyboard shortcuts" })
|
|
2897
|
-
}, u = [...new Set(
|
|
3063
|
+
}, u = [...new Set(yr.map((e) => e.action))], d = [{
|
|
2898
3064
|
heading: c("bento.shortcuts.global", { defaultValue: "Global" }),
|
|
2899
3065
|
rows: u.map((e) => ({
|
|
2900
3066
|
id: e,
|
|
2901
3067
|
label: l[e],
|
|
2902
|
-
combos:
|
|
3068
|
+
combos: yr.filter((t) => t.action === e).map((e) => xr(e, a))
|
|
2903
3069
|
}))
|
|
2904
3070
|
}, {
|
|
2905
3071
|
heading: c("bento.shortcuts.palette", { defaultValue: "Command palette" }),
|
|
@@ -2921,36 +3087,36 @@ function ur({ open: e, onOpenChange: t, isMac: a = ir() }) {
|
|
|
2921
3087
|
}
|
|
2922
3088
|
]
|
|
2923
3089
|
}];
|
|
2924
|
-
return /* @__PURE__ */
|
|
3090
|
+
return /* @__PURE__ */ K(n, {
|
|
2925
3091
|
open: e,
|
|
2926
3092
|
onOpenChange: t,
|
|
2927
|
-
children: /* @__PURE__ */
|
|
3093
|
+
children: /* @__PURE__ */ q(s, {
|
|
2928
3094
|
className: "max-w-md",
|
|
2929
|
-
children: [/* @__PURE__ */
|
|
3095
|
+
children: [/* @__PURE__ */ q(o, { children: [/* @__PURE__ */ q(i, {
|
|
2930
3096
|
className: "flex items-center gap-2",
|
|
2931
|
-
children: [/* @__PURE__ */
|
|
3097
|
+
children: [/* @__PURE__ */ K(je, {
|
|
2932
3098
|
size: 20,
|
|
2933
3099
|
className: "bento-accent-icon"
|
|
2934
3100
|
}), c("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
|
|
2935
|
-
}), /* @__PURE__ */
|
|
3101
|
+
}), /* @__PURE__ */ K(r, { children: c("bento.shortcuts.description", { defaultValue: "Move around without leaving the keyboard." }) })] }), /* @__PURE__ */ K("div", {
|
|
2936
3102
|
className: "flex flex-col gap-5",
|
|
2937
|
-
children: d.map((e) => /* @__PURE__ */
|
|
3103
|
+
children: d.map((e) => /* @__PURE__ */ q("section", { children: [/* @__PURE__ */ K("h3", {
|
|
2938
3104
|
className: "mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
|
|
2939
3105
|
children: e.heading
|
|
2940
|
-
}), /* @__PURE__ */
|
|
3106
|
+
}), /* @__PURE__ */ K("ul", {
|
|
2941
3107
|
className: "flex flex-col gap-1.5",
|
|
2942
|
-
children: e.rows.map((e) => /* @__PURE__ */
|
|
3108
|
+
children: e.rows.map((e) => /* @__PURE__ */ q("li", {
|
|
2943
3109
|
"data-shortcut": e.id,
|
|
2944
3110
|
className: "flex items-center justify-between gap-4",
|
|
2945
|
-
children: [/* @__PURE__ */
|
|
3111
|
+
children: [/* @__PURE__ */ K("span", {
|
|
2946
3112
|
className: "text-sm text-foreground",
|
|
2947
3113
|
children: e.label
|
|
2948
|
-
}), /* @__PURE__ */
|
|
3114
|
+
}), /* @__PURE__ */ K("span", {
|
|
2949
3115
|
className: "flex shrink-0 items-center gap-1",
|
|
2950
|
-
children: e.combos.map((e, t) => /* @__PURE__ */
|
|
3116
|
+
children: e.combos.map((e, t) => /* @__PURE__ */ q(ce, { children: [t > 0 && /* @__PURE__ */ K("span", {
|
|
2951
3117
|
className: "px-0.5 text-[11px] text-muted-foreground",
|
|
2952
3118
|
children: c("bento.shortcuts.or", { defaultValue: "or" })
|
|
2953
|
-
}), e.map((e) => /* @__PURE__ */
|
|
3119
|
+
}), e.map((e) => /* @__PURE__ */ K("kbd", {
|
|
2954
3120
|
className: "inline-flex min-w-6 items-center justify-center rounded-md border border-border/60 bg-muted px-1.5 py-0.5 text-[11px] font-medium tracking-wide",
|
|
2955
3121
|
children: e
|
|
2956
3122
|
}, e))] }, e.join("+")))
|
|
@@ -2963,171 +3129,171 @@ function ur({ open: e, onOpenChange: t, isMac: a = ir() }) {
|
|
|
2963
3129
|
}
|
|
2964
3130
|
//#endregion
|
|
2965
3131
|
//#region src/bento/bento-nav-rail.tsx
|
|
2966
|
-
var
|
|
2967
|
-
function
|
|
3132
|
+
var Dr = Me;
|
|
3133
|
+
function Or(e, t) {
|
|
2968
3134
|
return e === t || e.startsWith(`${t}/`);
|
|
2969
3135
|
}
|
|
2970
|
-
function
|
|
2971
|
-
return t.section.areaRoute &&
|
|
3136
|
+
function kr(e, t) {
|
|
3137
|
+
return t.section.areaRoute && Or(e, t.section.areaRoute) ? !0 : t.items.some((t) => t.bentoRoute && Or(e, t.bentoRoute));
|
|
2972
3138
|
}
|
|
2973
|
-
function
|
|
3139
|
+
function Ar(e) {
|
|
2974
3140
|
return e.items.reduce((e, t) => e + (t.count && t.count > 0 ? t.count : 0), 0);
|
|
2975
3141
|
}
|
|
2976
|
-
function
|
|
2977
|
-
let { t: i } =
|
|
2978
|
-
return /* @__PURE__ */
|
|
3142
|
+
function jr({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
|
|
3143
|
+
let { t: i } = J(), { pathname: a } = Je(), o = fe(() => e.filter((e) => !!e.section.areaRoute), [e]), s = a === t || (n?.includes(a) ?? !1);
|
|
3144
|
+
return /* @__PURE__ */ K(S, {
|
|
2979
3145
|
delayDuration: 200,
|
|
2980
|
-
children: /* @__PURE__ */
|
|
3146
|
+
children: /* @__PURE__ */ q("nav", {
|
|
2981
3147
|
"aria-label": i("bento.nav.label", { defaultValue: "Primary" }),
|
|
2982
3148
|
className: "fixed inset-y-0 left-0 z-40 hidden w-20 flex-col items-center gap-1 overflow-y-auto overflow-x-hidden border-r border-border/40 bg-background/55 pt-20 pb-[calc(1rem+var(--bento-rail-foot,0px))] backdrop-blur-xl backdrop-saturate-150 md:flex",
|
|
2983
3149
|
children: [
|
|
2984
|
-
/* @__PURE__ */
|
|
3150
|
+
/* @__PURE__ */ K(Mr, {
|
|
2985
3151
|
to: t,
|
|
2986
|
-
icon:
|
|
3152
|
+
icon: Ae,
|
|
2987
3153
|
label: r ?? i("home.title", { defaultValue: "Home" }),
|
|
2988
3154
|
shown: !0,
|
|
2989
3155
|
active: s
|
|
2990
3156
|
}),
|
|
2991
|
-
o.length > 0 && /* @__PURE__ */
|
|
3157
|
+
o.length > 0 && /* @__PURE__ */ K("span", {
|
|
2992
3158
|
"aria-hidden": !0,
|
|
2993
3159
|
className: "my-1 h-px w-6 bg-border/60"
|
|
2994
3160
|
}),
|
|
2995
|
-
o.map((e) => /* @__PURE__ */
|
|
3161
|
+
o.map((e) => /* @__PURE__ */ K(Mr, {
|
|
2996
3162
|
to: e.section.areaRoute,
|
|
2997
|
-
icon: e.section.icon ??
|
|
3163
|
+
icon: e.section.icon ?? Dr,
|
|
2998
3164
|
label: e.section.labelKey ? i(e.section.labelKey) : e.section.id,
|
|
2999
3165
|
shown: !!e.section.labelKey,
|
|
3000
|
-
count:
|
|
3001
|
-
active:
|
|
3166
|
+
count: Ar(e),
|
|
3167
|
+
active: kr(a, e)
|
|
3002
3168
|
}, e.section.id))
|
|
3003
3169
|
]
|
|
3004
3170
|
})
|
|
3005
3171
|
});
|
|
3006
3172
|
}
|
|
3007
|
-
function
|
|
3008
|
-
let { t: o } =
|
|
3173
|
+
function Mr({ to: e, icon: t, label: n, shown: r, count: i = 0, active: a }) {
|
|
3174
|
+
let { t: o } = J(), s = i > 0 ? o("bento.nav.count", {
|
|
3009
3175
|
count: i,
|
|
3010
3176
|
defaultValue: "{{count}} waiting"
|
|
3011
|
-
}) : null, c = /* @__PURE__ */
|
|
3177
|
+
}) : null, c = /* @__PURE__ */ q(Ke, {
|
|
3012
3178
|
to: e,
|
|
3013
3179
|
"aria-label": s ? `${n}, ${s}` : n,
|
|
3014
3180
|
"aria-current": a ? "page" : void 0,
|
|
3015
3181
|
className: `group flex w-full shrink-0 flex-col items-center gap-1 px-1 py-0.5 ${a ? "text-primary" : "text-muted-foreground hover:text-foreground"}`,
|
|
3016
|
-
children: [/* @__PURE__ */
|
|
3182
|
+
children: [/* @__PURE__ */ q("span", {
|
|
3017
3183
|
className: `bento-tile-clickable relative grid h-11 w-11 place-items-center rounded-2xl border transition-colors duration-200 ${a ? "bento-rail-active" : "border-transparent group-hover:border-border/60 group-hover:bg-card/60"}`,
|
|
3018
|
-
children: [/* @__PURE__ */
|
|
3184
|
+
children: [/* @__PURE__ */ K(t, { size: 20 }), i > 0 && /* @__PURE__ */ K("span", {
|
|
3019
3185
|
"aria-hidden": !0,
|
|
3020
3186
|
"data-slot": "bento-rail-count",
|
|
3021
3187
|
className: "absolute -right-1 -top-1 min-w-4 rounded-full bg-primary px-1 text-center text-[0.6875rem] leading-4 text-primary-foreground",
|
|
3022
3188
|
children: i > 99 ? "99+" : i
|
|
3023
3189
|
})]
|
|
3024
|
-
}), r && /* @__PURE__ */
|
|
3190
|
+
}), r && /* @__PURE__ */ K("span", {
|
|
3025
3191
|
"aria-hidden": !0,
|
|
3026
3192
|
title: n,
|
|
3027
3193
|
className: "w-full truncate text-center text-[0.6875rem] leading-4",
|
|
3028
3194
|
children: n
|
|
3029
3195
|
})]
|
|
3030
3196
|
});
|
|
3031
|
-
return r ? c : /* @__PURE__ */
|
|
3197
|
+
return r ? c : /* @__PURE__ */ q(E, { children: [/* @__PURE__ */ K(u, {
|
|
3032
3198
|
asChild: !0,
|
|
3033
3199
|
children: c
|
|
3034
|
-
}), /* @__PURE__ */
|
|
3200
|
+
}), /* @__PURE__ */ K(B, {
|
|
3035
3201
|
side: "right",
|
|
3036
3202
|
children: n
|
|
3037
3203
|
})] });
|
|
3038
3204
|
}
|
|
3039
3205
|
//#endregion
|
|
3040
3206
|
//#region src/bento/bento-user-menu.tsx
|
|
3041
|
-
function
|
|
3042
|
-
let { user: o, status: s } =
|
|
3043
|
-
return s === "loading" ? /* @__PURE__ */
|
|
3207
|
+
function Nr({ accountRoute: e, logoutUrl: t, organizationsRoute: n, tenantAdminRoute: r, onOpenShortcuts: i, onReplayTour: a }) {
|
|
3208
|
+
let { user: o, status: s } = F(), { t: c } = J(), u = Ye(), d = `${o.firstName ?? ""} ${o.lastName ?? ""}`.trim() || o.username || "";
|
|
3209
|
+
return s === "loading" ? /* @__PURE__ */ K("div", {
|
|
3044
3210
|
className: "h-9 w-9 rounded-full bg-muted/40",
|
|
3045
3211
|
"aria-hidden": !0
|
|
3046
|
-
}) : /* @__PURE__ */
|
|
3212
|
+
}) : /* @__PURE__ */ q(v, { children: [/* @__PURE__ */ K(T, {
|
|
3047
3213
|
asChild: !0,
|
|
3048
|
-
children: /* @__PURE__ */
|
|
3214
|
+
children: /* @__PURE__ */ K("button", {
|
|
3049
3215
|
type: "button",
|
|
3050
|
-
title:
|
|
3216
|
+
title: d || o.username,
|
|
3051
3217
|
className: "bento-tile-clickable cursor-pointer rounded-full p-0.5 ring-1 ring-border/60 outline-none transition-shadow duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] bento-ring hover:ring-2 focus-visible:ring-2 focus-visible:ring-ring",
|
|
3052
|
-
children: /* @__PURE__ */
|
|
3218
|
+
children: /* @__PURE__ */ K(L, {
|
|
3053
3219
|
givenName: o.firstName,
|
|
3054
3220
|
familyName: o.lastName,
|
|
3055
|
-
name:
|
|
3221
|
+
name: d || o.username,
|
|
3056
3222
|
src: o.avatarUrl || void 0,
|
|
3057
3223
|
alt: o.username
|
|
3058
3224
|
})
|
|
3059
3225
|
})
|
|
3060
|
-
}), /* @__PURE__ */
|
|
3226
|
+
}), /* @__PURE__ */ q(ie, {
|
|
3061
3227
|
align: "end",
|
|
3062
3228
|
sideOffset: 10,
|
|
3063
3229
|
className: "bento-dropdown min-w-64 p-2",
|
|
3064
3230
|
children: [
|
|
3065
|
-
/* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ K(h, {
|
|
3066
3232
|
className: "p-0 font-normal",
|
|
3067
|
-
children: /* @__PURE__ */
|
|
3233
|
+
children: /* @__PURE__ */ q("div", {
|
|
3068
3234
|
className: "flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm",
|
|
3069
|
-
children: [/* @__PURE__ */
|
|
3235
|
+
children: [/* @__PURE__ */ K("span", {
|
|
3070
3236
|
className: "rounded-full p-0.5 ring-1 ring-border/60",
|
|
3071
|
-
children: /* @__PURE__ */
|
|
3237
|
+
children: /* @__PURE__ */ K(L, {
|
|
3072
3238
|
givenName: o.firstName,
|
|
3073
3239
|
familyName: o.lastName,
|
|
3074
|
-
name:
|
|
3240
|
+
name: d || o.username,
|
|
3075
3241
|
src: o.avatarUrl || void 0,
|
|
3076
3242
|
alt: o.username
|
|
3077
3243
|
})
|
|
3078
|
-
}), /* @__PURE__ */
|
|
3244
|
+
}), /* @__PURE__ */ q("div", {
|
|
3079
3245
|
className: "grid flex-1 text-left text-sm leading-tight",
|
|
3080
|
-
children: [
|
|
3246
|
+
children: [d && /* @__PURE__ */ K("span", {
|
|
3081
3247
|
className: "truncate font-medium",
|
|
3082
|
-
children:
|
|
3083
|
-
}), o.email && /* @__PURE__ */
|
|
3248
|
+
children: d
|
|
3249
|
+
}), o.email && /* @__PURE__ */ K("span", {
|
|
3084
3250
|
className: "truncate text-xs text-muted-foreground",
|
|
3085
3251
|
children: o.email
|
|
3086
3252
|
})]
|
|
3087
3253
|
})]
|
|
3088
3254
|
})
|
|
3089
3255
|
}),
|
|
3090
|
-
/* @__PURE__ */
|
|
3091
|
-
/* @__PURE__ */
|
|
3092
|
-
/* @__PURE__ */
|
|
3093
|
-
onSelect: () =>
|
|
3256
|
+
/* @__PURE__ */ K(_, { className: "my-1.5 bg-border/50" }),
|
|
3257
|
+
/* @__PURE__ */ q(l, { children: [
|
|
3258
|
+
/* @__PURE__ */ q(C, {
|
|
3259
|
+
onSelect: () => u(e),
|
|
3094
3260
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
3095
|
-
children: [/* @__PURE__ */
|
|
3261
|
+
children: [/* @__PURE__ */ K(Ve, { size: 18 }), c("nav.account")]
|
|
3096
3262
|
}),
|
|
3097
|
-
n && /* @__PURE__ */
|
|
3098
|
-
onSelect: () =>
|
|
3263
|
+
n && /* @__PURE__ */ q(C, {
|
|
3264
|
+
onSelect: () => u(n),
|
|
3099
3265
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
3100
|
-
children: [/* @__PURE__ */
|
|
3266
|
+
children: [/* @__PURE__ */ K(be, { size: 18 }), c("nav.organizations", { defaultValue: "Organizations" })]
|
|
3101
3267
|
}),
|
|
3102
|
-
r && /* @__PURE__ */
|
|
3103
|
-
onSelect: () =>
|
|
3268
|
+
r && /* @__PURE__ */ q(C, {
|
|
3269
|
+
onSelect: () => u(r),
|
|
3104
3270
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
3105
|
-
children: [/* @__PURE__ */
|
|
3271
|
+
children: [/* @__PURE__ */ K(xe, { size: 18 }), c("nav.tenantAdmin", { defaultValue: "Tenant administration" })]
|
|
3106
3272
|
})
|
|
3107
3273
|
] }),
|
|
3108
|
-
(i || a) && /* @__PURE__ */
|
|
3274
|
+
(i || a) && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(_, { className: "my-1.5 bg-border/50" }), /* @__PURE__ */ q(l, { children: [a && /* @__PURE__ */ q(C, {
|
|
3109
3275
|
onSelect: () => a(),
|
|
3110
3276
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
3111
|
-
children: [/* @__PURE__ */
|
|
3112
|
-
}), i && /* @__PURE__ */
|
|
3277
|
+
children: [/* @__PURE__ */ K(Re, { size: 18 }), c("bento.tour.replay", { defaultValue: "Take the tour" })]
|
|
3278
|
+
}), i && /* @__PURE__ */ q(C, {
|
|
3113
3279
|
onSelect: () => i(),
|
|
3114
3280
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
3115
|
-
children: [/* @__PURE__ */
|
|
3281
|
+
children: [/* @__PURE__ */ K(je, { size: 18 }), c("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
|
|
3116
3282
|
})] })] }),
|
|
3117
|
-
/* @__PURE__ */
|
|
3118
|
-
/* @__PURE__ */
|
|
3283
|
+
/* @__PURE__ */ K(_, { className: "my-1.5 bg-border/50" }),
|
|
3284
|
+
/* @__PURE__ */ q(C, {
|
|
3119
3285
|
onSelect: () => {
|
|
3120
3286
|
globalThis.location.href = t;
|
|
3121
3287
|
},
|
|
3122
3288
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger",
|
|
3123
|
-
children: [/* @__PURE__ */
|
|
3289
|
+
children: [/* @__PURE__ */ K(Pe, { size: 18 }), c("nav.logOut")]
|
|
3124
3290
|
})
|
|
3125
3291
|
]
|
|
3126
3292
|
})] });
|
|
3127
3293
|
}
|
|
3128
3294
|
//#endregion
|
|
3129
3295
|
//#region src/bento/bento-section-chrome.tsx
|
|
3130
|
-
var
|
|
3296
|
+
var Pr = {
|
|
3131
3297
|
blue: "blue",
|
|
3132
3298
|
violet: "violet",
|
|
3133
3299
|
emerald: "emerald",
|
|
@@ -3137,62 +3303,62 @@ var vr = {
|
|
|
3137
3303
|
cyan: "blue",
|
|
3138
3304
|
orange: "amber"
|
|
3139
3305
|
};
|
|
3140
|
-
function
|
|
3306
|
+
function Fr({ variant: t = "blue", className: n, children: r }) {
|
|
3141
3307
|
let i;
|
|
3142
|
-
|
|
3143
|
-
if (!
|
|
3308
|
+
se.forEach(r, (e) => {
|
|
3309
|
+
if (!le(e)) return;
|
|
3144
3310
|
let { type: t } = e;
|
|
3145
|
-
(t ===
|
|
3311
|
+
(t === z.Header || t === z.StaticHeader) && (i ??= e.props);
|
|
3146
3312
|
});
|
|
3147
|
-
let a =
|
|
3148
|
-
if (!
|
|
3313
|
+
let a = se.map(r, (e) => {
|
|
3314
|
+
if (!le(e)) return e;
|
|
3149
3315
|
let { type: t } = e;
|
|
3150
|
-
return t ===
|
|
3316
|
+
return t === z.Header || t === z.StaticHeader ? null : t === z.Content ? e.props.children : e;
|
|
3151
3317
|
});
|
|
3152
|
-
return i ? /* @__PURE__ */
|
|
3318
|
+
return i ? /* @__PURE__ */ K(sr, {
|
|
3153
3319
|
icon: i.icon,
|
|
3154
|
-
tone:
|
|
3320
|
+
tone: Pr[t] ?? "blue",
|
|
3155
3321
|
title: i.title,
|
|
3156
3322
|
description: i.description,
|
|
3157
3323
|
className: n,
|
|
3158
3324
|
children: a
|
|
3159
|
-
}) : /* @__PURE__ */
|
|
3160
|
-
className: e(
|
|
3325
|
+
}) : /* @__PURE__ */ K("section", {
|
|
3326
|
+
className: e(or, n),
|
|
3161
3327
|
children: a
|
|
3162
3328
|
});
|
|
3163
3329
|
}
|
|
3164
|
-
|
|
3330
|
+
Fr.Header = z.Header, Fr.StaticHeader = z.StaticHeader, Fr.Content = z.Content;
|
|
3165
3331
|
//#endregion
|
|
3166
3332
|
//#region src/bento/bento-section.tsx
|
|
3167
|
-
var
|
|
3168
|
-
function
|
|
3169
|
-
let o = /* @__PURE__ */
|
|
3333
|
+
var Ir = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
|
|
3334
|
+
function Lr({ eyebrow: e, title: t, description: n, titleHref: r, children: i, gridClassName: a = Ir }) {
|
|
3335
|
+
let o = /* @__PURE__ */ K("h2", {
|
|
3170
3336
|
className: "text-xl font-semibold tracking-tight md:text-2xl",
|
|
3171
3337
|
children: t
|
|
3172
3338
|
});
|
|
3173
|
-
return /* @__PURE__ */
|
|
3339
|
+
return /* @__PURE__ */ q("section", {
|
|
3174
3340
|
className: "mb-8 md:mb-10",
|
|
3175
|
-
children: [/* @__PURE__ */
|
|
3341
|
+
children: [/* @__PURE__ */ q("header", {
|
|
3176
3342
|
className: "bento-shell-header mb-4 flex flex-col gap-0.5",
|
|
3177
3343
|
children: [
|
|
3178
|
-
e && /* @__PURE__ */
|
|
3344
|
+
e && /* @__PURE__ */ K("span", {
|
|
3179
3345
|
className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
|
|
3180
3346
|
children: e
|
|
3181
3347
|
}),
|
|
3182
|
-
r ? /* @__PURE__ */
|
|
3348
|
+
r ? /* @__PURE__ */ q(Ke, {
|
|
3183
3349
|
to: r,
|
|
3184
3350
|
className: "group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary",
|
|
3185
|
-
children: [o, /* @__PURE__ */
|
|
3351
|
+
children: [o, /* @__PURE__ */ K(we, {
|
|
3186
3352
|
size: 20,
|
|
3187
3353
|
className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
|
|
3188
3354
|
})]
|
|
3189
3355
|
}) : o,
|
|
3190
|
-
n && /* @__PURE__ */
|
|
3356
|
+
n && /* @__PURE__ */ K("p", {
|
|
3191
3357
|
className: "max-w-2xl text-sm text-muted-foreground",
|
|
3192
3358
|
children: n
|
|
3193
3359
|
})
|
|
3194
3360
|
]
|
|
3195
|
-
}), /* @__PURE__ */
|
|
3361
|
+
}), /* @__PURE__ */ K("div", {
|
|
3196
3362
|
className: a,
|
|
3197
3363
|
children: i
|
|
3198
3364
|
})]
|
|
@@ -3200,66 +3366,66 @@ function xr({ eyebrow: e, title: t, description: n, titleHref: r, children: i, g
|
|
|
3200
3366
|
}
|
|
3201
3367
|
//#endregion
|
|
3202
3368
|
//#region src/bento/bento-tile.tsx
|
|
3203
|
-
function
|
|
3204
|
-
let f = !r && !!(t || n), p = u ? "h-14 w-14 rounded-2xl" : "h-9 w-9 rounded-2xl", m = u ? 28 : 18, h = u ? "text-xl font-semibold tracking-tight md:text-2xl" : "text-base font-semibold tracking-tight md:text-lg", g = /* @__PURE__ */
|
|
3205
|
-
u && /* @__PURE__ */
|
|
3369
|
+
function Rr({ to: t, onClick: n, disabled: r = !1, disabledHint: i, icon: a, tone: o, eyebrow: s, title: c, span: l, featured: u = !1, children: d }) {
|
|
3370
|
+
let f = !r && !!(t || n), p = u ? "h-14 w-14 rounded-2xl" : "h-9 w-9 rounded-2xl", m = u ? 28 : 18, h = u ? "text-xl font-semibold tracking-tight md:text-2xl" : "text-base font-semibold tracking-tight md:text-lg", g = /* @__PURE__ */ q(G, { children: [
|
|
3371
|
+
u && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("div", {
|
|
3206
3372
|
"aria-hidden": !0,
|
|
3207
|
-
className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${
|
|
3208
|
-
}), /* @__PURE__ */
|
|
3373
|
+
className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${_t(o)} opacity-40 blur-2xl dark:opacity-50`
|
|
3374
|
+
}), /* @__PURE__ */ K("div", {
|
|
3209
3375
|
"aria-hidden": !0,
|
|
3210
|
-
className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${
|
|
3376
|
+
className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${_t(o)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`
|
|
3211
3377
|
})] }),
|
|
3212
|
-
/* @__PURE__ */
|
|
3378
|
+
/* @__PURE__ */ q("div", {
|
|
3213
3379
|
className: "relative z-1 flex items-center justify-between",
|
|
3214
|
-
children: [/* @__PURE__ */
|
|
3215
|
-
className: `grid place-items-center ${
|
|
3216
|
-
children: /* @__PURE__ */
|
|
3217
|
-
}), f && /* @__PURE__ */
|
|
3380
|
+
children: [/* @__PURE__ */ K("span", {
|
|
3381
|
+
className: `grid place-items-center ${_t(o)} text-white shadow-md ${p}`,
|
|
3382
|
+
children: /* @__PURE__ */ K(a, { size: m })
|
|
3383
|
+
}), f && /* @__PURE__ */ K(we, {
|
|
3218
3384
|
size: u ? 18 : 16,
|
|
3219
3385
|
className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
|
|
3220
3386
|
})]
|
|
3221
3387
|
}),
|
|
3222
|
-
/* @__PURE__ */
|
|
3388
|
+
/* @__PURE__ */ q("div", {
|
|
3223
3389
|
className: "relative z-1",
|
|
3224
3390
|
children: [
|
|
3225
|
-
/* @__PURE__ */
|
|
3391
|
+
/* @__PURE__ */ K("div", {
|
|
3226
3392
|
className: "text-[11px] uppercase tracking-wider text-muted-foreground",
|
|
3227
3393
|
children: s
|
|
3228
3394
|
}),
|
|
3229
|
-
/* @__PURE__ */
|
|
3395
|
+
/* @__PURE__ */ K("div", {
|
|
3230
3396
|
className: `mt-0.5 ${h}`,
|
|
3231
3397
|
children: c
|
|
3232
3398
|
}),
|
|
3233
|
-
d && /* @__PURE__ */
|
|
3399
|
+
d && /* @__PURE__ */ K("div", {
|
|
3234
3400
|
className: "mt-2",
|
|
3235
3401
|
children: d
|
|
3236
3402
|
})
|
|
3237
3403
|
]
|
|
3238
3404
|
})
|
|
3239
3405
|
] }), _ = `bento-tile bento-glass group relative flex flex-col ${u ? "gap-5" : "gap-4"} overflow-hidden text-left ${u ? "p-6 md:p-7" : "p-5"} ${l}${f ? " bento-tile-clickable" : ""}${r ? " cursor-not-allowed opacity-60" : ""}`;
|
|
3240
|
-
return r ? /* @__PURE__ */
|
|
3406
|
+
return r ? /* @__PURE__ */ K("div", {
|
|
3241
3407
|
className: _,
|
|
3242
3408
|
"aria-disabled": "true",
|
|
3243
3409
|
title: i,
|
|
3244
3410
|
children: g
|
|
3245
|
-
}) : t ? /* @__PURE__ */
|
|
3411
|
+
}) : t ? /* @__PURE__ */ K(Ke, {
|
|
3246
3412
|
to: t,
|
|
3247
3413
|
className: _,
|
|
3248
3414
|
children: g
|
|
3249
|
-
}) : n ? /* @__PURE__ */
|
|
3415
|
+
}) : n ? /* @__PURE__ */ K("button", {
|
|
3250
3416
|
type: "button",
|
|
3251
3417
|
onClick: n,
|
|
3252
3418
|
className: e("w-full", _),
|
|
3253
3419
|
children: g
|
|
3254
|
-
}) : /* @__PURE__ */
|
|
3420
|
+
}) : /* @__PURE__ */ K("div", {
|
|
3255
3421
|
className: _,
|
|
3256
3422
|
children: g
|
|
3257
3423
|
});
|
|
3258
3424
|
}
|
|
3259
3425
|
//#endregion
|
|
3260
3426
|
//#region src/bento/bento-version-rail.tsx
|
|
3261
|
-
function
|
|
3262
|
-
let { t: a, i18n: o } =
|
|
3427
|
+
function zr({ versions: t, selected: n, onSelect: r, label: i }) {
|
|
3428
|
+
let { t: a, i18n: o } = J(), [s, c] = W(0), [l, u] = W([]), d = U(/* @__PURE__ */ new Map()), f = (e) => [...e].sort((e, n) => t.findIndex((e) => e.id === n) - t.findIndex((t) => t.id === e));
|
|
3263
3429
|
function p(e) {
|
|
3264
3430
|
if (n.includes(e)) {
|
|
3265
3431
|
u(l.filter((t) => t !== e)), r(n.filter((t) => t !== e));
|
|
@@ -3307,15 +3473,15 @@ function Cr({ versions: t, selected: n, onSelect: r, label: i }) {
|
|
|
3307
3473
|
}).format(t)
|
|
3308
3474
|
};
|
|
3309
3475
|
};
|
|
3310
|
-
return /* @__PURE__ */
|
|
3476
|
+
return /* @__PURE__ */ K("ul", {
|
|
3311
3477
|
role: "listbox",
|
|
3312
3478
|
"aria-label": i ?? a("bento.versions.label", { defaultValue: "Versions" }),
|
|
3313
3479
|
"aria-multiselectable": "true",
|
|
3314
3480
|
"data-slot": "bento-version-rail",
|
|
3315
3481
|
className: "m-0 flex list-none flex-col gap-1 p-0",
|
|
3316
3482
|
children: t.map((r, i) => {
|
|
3317
|
-
let o = n.includes(r.id), l = g(r.at), u = r.actor === "agent" ?
|
|
3318
|
-
return /* @__PURE__ */
|
|
3483
|
+
let o = n.includes(r.id), l = g(r.at), u = r.actor === "agent" ? Ie : Be, f = o ? "text-foreground/80" : "text-muted-foreground";
|
|
3484
|
+
return /* @__PURE__ */ q("li", {
|
|
3319
3485
|
ref: (e) => {
|
|
3320
3486
|
e ? d.current.set(i, e) : d.current.delete(i);
|
|
3321
3487
|
},
|
|
@@ -3328,26 +3494,26 @@ function Cr({ versions: t, selected: n, onSelect: r, label: i }) {
|
|
|
3328
3494
|
},
|
|
3329
3495
|
className: e("flex cursor-pointer flex-col gap-0.5 rounded-xl border px-3 py-2 text-sm outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-ring", o ? "border-primary/50 bg-primary/10" : "border-transparent hover:bg-muted/50"),
|
|
3330
3496
|
children: [
|
|
3331
|
-
/* @__PURE__ */
|
|
3497
|
+
/* @__PURE__ */ q("span", {
|
|
3332
3498
|
className: "flex items-center gap-1.5 font-medium",
|
|
3333
3499
|
children: [
|
|
3334
|
-
/* @__PURE__ */
|
|
3500
|
+
/* @__PURE__ */ K(u, {
|
|
3335
3501
|
size: 14,
|
|
3336
3502
|
"aria-hidden": "true"
|
|
3337
3503
|
}),
|
|
3338
3504
|
r.author,
|
|
3339
|
-
/* @__PURE__ */
|
|
3505
|
+
/* @__PURE__ */ K("span", {
|
|
3340
3506
|
className: e("text-xs font-normal", f),
|
|
3341
3507
|
children: r.actor === "agent" ? a("bento.versions.agent", { defaultValue: "Agent" }) : a("bento.versions.human", { defaultValue: "Person" })
|
|
3342
3508
|
})
|
|
3343
3509
|
]
|
|
3344
3510
|
}),
|
|
3345
|
-
/* @__PURE__ */
|
|
3511
|
+
/* @__PURE__ */ K("time", {
|
|
3346
3512
|
dateTime: l.iso,
|
|
3347
3513
|
className: e("text-xs", f),
|
|
3348
3514
|
children: l.text
|
|
3349
3515
|
}),
|
|
3350
|
-
r.summary && /* @__PURE__ */
|
|
3516
|
+
r.summary && /* @__PURE__ */ K("span", {
|
|
3351
3517
|
className: "text-xs",
|
|
3352
3518
|
children: r.summary
|
|
3353
3519
|
})
|
|
@@ -3357,4 +3523,4 @@ function Cr({ versions: t, selected: n, onSelect: r, label: i }) {
|
|
|
3357
3523
|
});
|
|
3358
3524
|
}
|
|
3359
3525
|
//#endregion
|
|
3360
|
-
export {
|
|
3526
|
+
export { Fr as AdaptiveSectionCard, Nn as BENTO_EMPHASIS_NEXT, Mn as BENTO_EMPHASIS_SPAN, Mt as BENTO_RECORD_STATES, yr as BENTO_SHELL_SHORTCUTS, gt as BENTO_TONES, ht as BENTO_TONE_CLASS, mt as BentoActionsMenu, Dt as BentoBackLink, fr as BentoBackToTop, An as BentoCalendar, hn as BentoChangeCell, Rt as BentoChangeMark, gr as BentoCommandPalette, vt as BentoCountTile, Ct as BentoDataTable, Ht as BentoDiff, wt as BentoEmptyState, It as BentoEntityShell, In as BentoEntityTile, Vn as BentoFilterBar, ar as BentoFormHero, sr as BentoFormSection, kt as BentoHero, At as BentoHeroIconPicker, _n as BentoIdentityCell, jt as BentoInlineEdit, qn as BentoListPage, jr as BentoNavRail, Tr as BentoPaletteTrigger, cr as BentoPanel, nr as BentoSaveBar, ir as BentoScrollSaveBar, Lr as BentoSection, _r as BentoShell, Er as BentoShortcutsDialog, xn as BentoSplitPage, Nt as BentoStatusMarker, Rr as BentoTile, Jn as BentoTileGrid, Et as BentoTrail, Nr as BentoUserMenu, zr as BentoVersionRail, Ln as EMPTY_FILTERS, _t as bentoChipClass, pr as bentoNavTarget, Pn as resolveBentoLayout, Fn as toBentoLayoutEntries, Pt as useBentoScrollFade, wr as useBentoShellShortcuts };
|