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