@viglet/viglet-design-system 2026.3.14 → 2026.3.16
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 +44 -8
- package/dist/bento/bento-data-table.d.ts +1 -1
- package/dist/bento/bento-data-table.d.ts.map +1 -1
- 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 +783 -655
- package/dist/catalogue.json +103 -19
- package/dist/components/ui/viglet-assistant.d.ts +7 -1
- package/dist/components/ui/viglet-assistant.d.ts.map +1 -1
- package/dist/exports.json +4 -1
- package/dist/i18n/index.d.ts +10 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en/assistant.json.d.ts +2 -1
- package/dist/i18n/locales/en/bento.json.d.ts +6 -2
- package/dist/i18n/locales/pt/assistant.json.d.ts +2 -1
- package/dist/i18n/locales/pt/bento.json.d.ts +6 -2
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.es.js +16 -6
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +1045 -1018
- 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 +4 -1
- package/dist/user.context-gQvBxcwr.cjs +0 -1
package/dist/bento.es.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
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
|
|
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 I, s as L, u as R, v as te, w as ne, y as re } from "./user.context-DUs2lT6D.js";
|
|
5
|
+
import { r as ie, t as ae } from "./loading-provider-D-_5G-08.js";
|
|
6
|
+
import { Children as oe, Fragment as z, isValidElement as se, useEffect as B, useId as ce, useMemo as le, useRef as V, useState as H, useSyncExternalStore as U } from "react";
|
|
7
7
|
import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
8
8
|
import { useTranslation as q } from "react-i18next";
|
|
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
|
|
9
|
+
import { IconAdjustmentsHorizontal as ue, IconAlertTriangle as de, IconArrowBackUp as J, IconArrowDown as fe, IconArrowLeft as pe, IconArrowRight as me, IconArrowUp as he, IconArrowsSort as ge, IconBuildingCommunity as _e, IconBuildingSkyscraper as ve, IconChevronDown as ye, IconChevronLeft as be, IconChevronRight as xe, IconColumns3 as Se, IconDeviceFloppy as Ce, 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
|
|
25
|
+
function dt({ actions: e, triggerLabel: t }) {
|
|
26
26
|
let { t: n } = q();
|
|
27
27
|
if (e.length === 0) return null;
|
|
28
|
-
for (let t of e) t.id ||
|
|
29
|
-
return /* @__PURE__ */ K(
|
|
28
|
+
for (let t of e) t.id || ut(t.label);
|
|
29
|
+
return /* @__PURE__ */ K(_, { children: [/* @__PURE__ */ G(F, {
|
|
30
30
|
asChild: !0,
|
|
31
31
|
children: /* @__PURE__ */ G("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__ */ G(
|
|
35
|
+
children: /* @__PURE__ */ G(we, { size: 18 })
|
|
36
36
|
})
|
|
37
|
-
}), /* @__PURE__ */ G(
|
|
37
|
+
}), /* @__PURE__ */ G(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__ */ K(
|
|
42
|
+
let t = e.icon, n = ct[e.tone ?? "default"];
|
|
43
|
+
return /* @__PURE__ */ K(h, {
|
|
44
44
|
"data-action-id": e.id,
|
|
45
45
|
onSelect: e.onSelect,
|
|
46
46
|
disabled: e.disabled,
|
|
@@ -52,7 +52,7 @@ function ut({ actions: e, triggerLabel: t }) {
|
|
|
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,13 +60,13 @@ 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
|
|
69
|
+
function mt({ to: e, icon: t, tone: n, label: r, count: i, span: a }) {
|
|
70
70
|
let o = /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("span", {
|
|
71
71
|
className: `grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${Y(n)}`,
|
|
72
72
|
children: /* @__PURE__ */ G(t, { size: 18 })
|
|
@@ -77,7 +77,7 @@ function pt({ to: e, icon: t, tone: n, label: r, count: i, span: a }) {
|
|
|
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__ */ G(
|
|
80
|
+
return e ? /* @__PURE__ */ G(Ue, {
|
|
81
81
|
to: e,
|
|
82
82
|
className: s,
|
|
83
83
|
children: o
|
|
@@ -88,128 +88,128 @@ function pt({ to: e, icon: t, tone: n, label: r, count: i, span: a }) {
|
|
|
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 } = q(), [S,
|
|
98
|
-
j !== u && (M(u),
|
|
99
|
-
let
|
|
100
|
-
c !== void 0 && (
|
|
101
|
-
let
|
|
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 } = q(), [S, w] = H([]), [T, E] = H({ hidden: [] }), [D, O] = H(/* @__PURE__ */ new Set()), [k, A] = H(null), [j, M] = H(u), [N, P] = H(void 0);
|
|
98
|
+
j !== u && (M(u), O(/* @__PURE__ */ new Set()), P(c), A(null));
|
|
99
|
+
let ee = le(() => new Set(c ?? []), [c]), I = D;
|
|
100
|
+
c !== void 0 && (I = c === N ? /* @__PURE__ */ new Set() : ee);
|
|
101
|
+
let L = V(u);
|
|
102
102
|
B(() => {
|
|
103
|
-
|
|
103
|
+
L.current !== u && (L.current = u, l?.([]));
|
|
104
104
|
}, [u, l]);
|
|
105
|
-
let [
|
|
105
|
+
let [R, te] = H(0), [ne, re] = H(0), ie = V(null), ae = V(/* @__PURE__ */ new Map()), oe = V(!1), z = (s?.length ?? 0) > 0, se = (e) => a?.(e) ?? n(e), ce = le(() => 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]), U = Xe({
|
|
110
|
+
features: gt,
|
|
111
111
|
data: t,
|
|
112
112
|
columns: ce,
|
|
113
113
|
state: { sorting: S },
|
|
114
|
-
onSortingChange:
|
|
115
|
-
}).getRowModel().rows.map((e) => e.original),
|
|
114
|
+
onSortingChange: w
|
|
115
|
+
}).getRowModel().rows.map((e) => e.original), W = f ?? T, ue = r.filter((e) => e.hideable === !1 || !W.hidden.includes(e.id)), de = [
|
|
116
116
|
z ? "2.75rem" : null,
|
|
117
117
|
...ue.map((e) => e.width ?? "minmax(8rem, 1fr)"),
|
|
118
118
|
o?.length ? "3.25rem" : null
|
|
119
|
-
].filter(Boolean).join(" "), J =
|
|
119
|
+
].filter(Boolean).join(" "), J = U.length, pe = Math.min(y, J * g), me = Math.max(1, Math.floor(pe / g)), _e = Math.max(0, Math.floor(ne / g) - ht), ve = Math.min(J, Math.ceil((ne + pe) / g) + ht), ye = Math.min(R, Math.max(0, J - 1));
|
|
120
120
|
B(() => {
|
|
121
|
-
oe.current && (oe.current = !1, ae.current.get(
|
|
122
|
-
}, [
|
|
123
|
-
function
|
|
124
|
-
c === void 0 &&
|
|
121
|
+
oe.current && (oe.current = !1, ae.current.get(ye)?.focus());
|
|
122
|
+
}, [ye, _e]);
|
|
123
|
+
function be(e) {
|
|
124
|
+
c === void 0 && O(e), l?.([...e]);
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function xe(e, t) {
|
|
127
127
|
let [r, i] = e <= t ? [e, t] : [t, e];
|
|
128
|
-
|
|
128
|
+
be(new Set(U.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 Ce(e) {
|
|
131
|
+
let t = n(U[e]), r = new Set(I);
|
|
132
|
+
r.has(t) ? r.delete(t) : r.add(t), be(r), A(e);
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function we(e, t) {
|
|
135
135
|
let n = Math.max(0, Math.min(J - 1, e));
|
|
136
136
|
if (t && z) {
|
|
137
|
-
let e =
|
|
138
|
-
A(e),
|
|
137
|
+
let e = k ?? ye;
|
|
138
|
+
A(e), xe(e, n);
|
|
139
139
|
}
|
|
140
|
-
let r = ie.current, i = n *
|
|
140
|
+
let r = ie.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 + pe && (e = i + g - pe), e !== r.scrollTop && (r.scrollTop = e, re(e));
|
|
144
144
|
}
|
|
145
|
-
oe.current = !0,
|
|
145
|
+
oe.current = !0, te(n);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Te(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
|
+
we(t + 1, r);
|
|
153
153
|
break;
|
|
154
154
|
case "ArrowUp":
|
|
155
|
-
|
|
155
|
+
we(t - 1, r);
|
|
156
156
|
break;
|
|
157
157
|
case "PageDown":
|
|
158
|
-
|
|
158
|
+
we(t + me, r);
|
|
159
159
|
break;
|
|
160
160
|
case "PageUp":
|
|
161
|
-
|
|
161
|
+
we(t - me, r);
|
|
162
162
|
break;
|
|
163
163
|
case "Home":
|
|
164
|
-
|
|
164
|
+
we(0, r);
|
|
165
165
|
break;
|
|
166
166
|
case "End":
|
|
167
|
-
|
|
167
|
+
we(J - 1, r);
|
|
168
168
|
break;
|
|
169
169
|
case " ":
|
|
170
170
|
if (!z) return;
|
|
171
|
-
|
|
171
|
+
Ce(t);
|
|
172
172
|
break;
|
|
173
173
|
case "Enter":
|
|
174
|
-
if (!
|
|
175
|
-
|
|
174
|
+
if (!h) return;
|
|
175
|
+
h(U[t]);
|
|
176
176
|
break;
|
|
177
177
|
case "Escape":
|
|
178
|
-
if (!z ||
|
|
179
|
-
|
|
178
|
+
if (!z || I.size === 0) return;
|
|
179
|
+
be(/* @__PURE__ */ new Set()), A(null);
|
|
180
180
|
break;
|
|
181
181
|
case "a":
|
|
182
182
|
case "A":
|
|
183
183
|
if (!z || !(e.ctrlKey || e.metaKey)) return;
|
|
184
|
-
|
|
184
|
+
be(new Set(U.map(n)));
|
|
185
185
|
break;
|
|
186
186
|
default: return;
|
|
187
187
|
}
|
|
188
188
|
e.preventDefault();
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
if (!e.target.closest("button, a, input, [role='checkbox']") && (
|
|
190
|
+
function Ee(e, t) {
|
|
191
|
+
if (!e.target.closest("button, a, input, [role='checkbox']") && (te(t), z)) {
|
|
192
192
|
if (e.shiftKey) {
|
|
193
|
-
let e =
|
|
194
|
-
A(e),
|
|
195
|
-
} else e.metaKey || e.ctrlKey ?
|
|
193
|
+
let e = k ?? ye;
|
|
194
|
+
A(e), xe(e, t);
|
|
195
|
+
} else e.metaKey || e.ctrlKey ? Ce(t) : (be(/* @__PURE__ */ new Set([n(U[t])])), A(t));
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function De(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
|
-
function
|
|
209
|
-
let n = { hidden: t ? [...
|
|
210
|
-
|
|
208
|
+
function Oe(e, t) {
|
|
209
|
+
let n = { hidden: t ? [...W.hidden, e] : W.hidden.filter((t) => t !== e) };
|
|
210
|
+
f === void 0 && E(n), p?.(n);
|
|
211
211
|
}
|
|
212
|
-
let
|
|
212
|
+
let ke = U.filter((e) => I.has(n(e))), Ae = J > 0 && ke.length === J, je = r.filter((e) => e.hideable !== !1);
|
|
213
213
|
return /* @__PURE__ */ K("div", {
|
|
214
214
|
"data-slot": "bento-data-table",
|
|
215
215
|
className: "bento-glass overflow-hidden rounded-2xl",
|
|
@@ -219,48 +219,48 @@ function gt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
219
219
|
/* @__PURE__ */ G("span", {
|
|
220
220
|
"aria-live": "polite",
|
|
221
221
|
className: "text-sm font-medium",
|
|
222
|
-
children:
|
|
222
|
+
children: ke.length > 0 ? x("bento.table.selected", {
|
|
223
223
|
defaultValue: "{{count}} selected",
|
|
224
|
-
count:
|
|
224
|
+
count: ke.length
|
|
225
225
|
}) : ""
|
|
226
226
|
}),
|
|
227
|
-
|
|
227
|
+
ke.length > 0 && /* @__PURE__ */ K("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__ */ K(
|
|
233
|
+
return /* @__PURE__ */ K(C, {
|
|
234
234
|
variant: "outline",
|
|
235
235
|
size: "sm",
|
|
236
236
|
className: e("gap-1.5", t.tone === "destructive" && "bento-item-danger"),
|
|
237
|
-
onClick: () => t.onSelect(
|
|
237
|
+
onClick: () => t.onSelect(ke),
|
|
238
238
|
children: [/* @__PURE__ */ G(n, { size: 16 }), t.label]
|
|
239
239
|
}, t.id);
|
|
240
|
-
}), /* @__PURE__ */ G(
|
|
240
|
+
}), /* @__PURE__ */ G(C, {
|
|
241
241
|
variant: "ghost",
|
|
242
242
|
size: "sm",
|
|
243
|
-
onClick: () =>
|
|
243
|
+
onClick: () => be(/* @__PURE__ */ new Set()),
|
|
244
244
|
children: x("bento.table.clearSelection", { defaultValue: "Clear selection" })
|
|
245
245
|
})]
|
|
246
246
|
}),
|
|
247
|
-
|
|
247
|
+
je.length > 0 && /* @__PURE__ */ K(_, { children: [/* @__PURE__ */ G(F, {
|
|
248
248
|
asChild: !0,
|
|
249
|
-
children: /* @__PURE__ */ K(
|
|
249
|
+
children: /* @__PURE__ */ K(C, {
|
|
250
250
|
variant: "ghost",
|
|
251
251
|
size: "sm",
|
|
252
252
|
className: "ml-auto gap-1.5",
|
|
253
|
-
children: [/* @__PURE__ */ G(
|
|
253
|
+
children: [/* @__PURE__ */ G(Se, {
|
|
254
254
|
size: 16,
|
|
255
255
|
"aria-hidden": "true"
|
|
256
256
|
}), x("bento.table.columns", { defaultValue: "Columns" })]
|
|
257
257
|
})
|
|
258
|
-
}), /* @__PURE__ */ G(
|
|
258
|
+
}), /* @__PURE__ */ G(d, {
|
|
259
259
|
align: "end",
|
|
260
260
|
className: "bento-dropdown min-w-44 p-1.5",
|
|
261
|
-
children:
|
|
262
|
-
checked: !
|
|
263
|
-
onCheckedChange: (t) =>
|
|
261
|
+
children: je.map((e) => /* @__PURE__ */ G(v, {
|
|
262
|
+
checked: !W.hidden.includes(e.id),
|
|
263
|
+
onCheckedChange: (t) => Oe(e.id, t !== !0),
|
|
264
264
|
onSelect: (e) => e.preventDefault(),
|
|
265
265
|
children: e.header
|
|
266
266
|
}, e.id))
|
|
@@ -280,7 +280,7 @@ function gt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
280
280
|
className: "grid items-center border-b border-border/50 px-1 text-xs font-medium text-muted-foreground",
|
|
281
281
|
style: {
|
|
282
282
|
gridTemplateColumns: de,
|
|
283
|
-
minHeight:
|
|
283
|
+
minHeight: g
|
|
284
284
|
},
|
|
285
285
|
children: [
|
|
286
286
|
z && /* @__PURE__ */ G("div", {
|
|
@@ -288,8 +288,8 @@ function gt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
288
288
|
className: "grid place-items-center",
|
|
289
289
|
children: /* @__PURE__ */ G(m, {
|
|
290
290
|
"aria-label": x("bento.table.selectAll", { defaultValue: "Select all rows" }),
|
|
291
|
-
checked:
|
|
292
|
-
onCheckedChange: () =>
|
|
291
|
+
checked: Ae ? !0 : ke.length > 0 && "indeterminate",
|
|
292
|
+
onCheckedChange: () => be(Ae ? /* @__PURE__ */ new Set() : new Set(U.map(n)))
|
|
293
293
|
})
|
|
294
294
|
}),
|
|
295
295
|
ue.map((e) => {
|
|
@@ -300,14 +300,14 @@ function gt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
300
300
|
className: "min-w-0 px-2",
|
|
301
301
|
children: e.sortValue ? /* @__PURE__ */ K("button", {
|
|
302
302
|
type: "button",
|
|
303
|
-
onClick: () =>
|
|
303
|
+
onClick: () => De(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
306
|
/* @__PURE__ */ G("span", {
|
|
307
307
|
className: "truncate",
|
|
308
308
|
children: e.header
|
|
309
309
|
}),
|
|
310
|
-
n === "ascending" && /* @__PURE__ */ G(
|
|
310
|
+
n === "ascending" && /* @__PURE__ */ G(he, {
|
|
311
311
|
size: 14,
|
|
312
312
|
"aria-hidden": "true"
|
|
313
313
|
}),
|
|
@@ -315,7 +315,7 @@ function gt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
315
315
|
size: 14,
|
|
316
316
|
"aria-hidden": "true"
|
|
317
317
|
}),
|
|
318
|
-
n === "none" && /* @__PURE__ */ G(
|
|
318
|
+
n === "none" && /* @__PURE__ */ G(ge, {
|
|
319
319
|
size: 14,
|
|
320
320
|
"aria-hidden": "true",
|
|
321
321
|
className: "opacity-40"
|
|
@@ -353,12 +353,12 @@ function gt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
353
353
|
ref: ie,
|
|
354
354
|
onScroll: (e) => re(e.currentTarget.scrollTop),
|
|
355
355
|
className: "relative overflow-y-auto",
|
|
356
|
-
style: { height:
|
|
356
|
+
style: { height: pe },
|
|
357
357
|
children: /* @__PURE__ */ G("div", {
|
|
358
|
-
style: { height: J *
|
|
358
|
+
style: { height: J * g },
|
|
359
359
|
className: "relative",
|
|
360
|
-
children:
|
|
361
|
-
let i =
|
|
360
|
+
children: U.slice(_e, ve).map((t, r) => {
|
|
361
|
+
let i = _e + r, a = n(t), s = I.has(a), c = se(t);
|
|
362
362
|
return /* @__PURE__ */ K("div", {
|
|
363
363
|
ref: (e) => {
|
|
364
364
|
e ? ae.current.set(i, e) : ae.current.delete(i);
|
|
@@ -366,17 +366,17 @@ function gt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
366
366
|
role: "row",
|
|
367
367
|
"aria-rowindex": i + 2,
|
|
368
368
|
"aria-selected": z ? s ? "true" : "false" : void 0,
|
|
369
|
-
tabIndex: i ===
|
|
370
|
-
onKeyDown: (e) =>
|
|
371
|
-
onClick: (e) =>
|
|
372
|
-
onDoubleClick: () =>
|
|
369
|
+
tabIndex: i === ye ? 0 : -1,
|
|
370
|
+
onKeyDown: (e) => Te(e, i),
|
|
371
|
+
onClick: (e) => Ee(e, i),
|
|
372
|
+
onDoubleClick: () => h?.(t),
|
|
373
373
|
onFocus: (e) => {
|
|
374
|
-
e.target === e.currentTarget &&
|
|
374
|
+
e.target === e.currentTarget && te(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:
|
|
378
|
+
top: i * g,
|
|
379
|
+
height: g,
|
|
380
380
|
gridTemplateColumns: de
|
|
381
381
|
},
|
|
382
382
|
children: [
|
|
@@ -390,7 +390,7 @@ function gt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
390
390
|
row: c
|
|
391
391
|
}),
|
|
392
392
|
checked: s,
|
|
393
|
-
onCheckedChange: () =>
|
|
393
|
+
onCheckedChange: () => Ce(i)
|
|
394
394
|
})
|
|
395
395
|
}),
|
|
396
396
|
ue.map((e) => /* @__PURE__ */ G("div", {
|
|
@@ -401,7 +401,7 @@ function gt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowAct
|
|
|
401
401
|
o?.length ? /* @__PURE__ */ G("div", {
|
|
402
402
|
role: "gridcell",
|
|
403
403
|
className: "grid place-items-center",
|
|
404
|
-
children: /* @__PURE__ */ G(
|
|
404
|
+
children: /* @__PURE__ */ G(dt, {
|
|
405
405
|
triggerLabel: x("bento.table.rowActions", {
|
|
406
406
|
defaultValue: "Actions for {{row}}",
|
|
407
407
|
row: c
|
|
@@ -425,7 +425,7 @@ 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
430
|
return /* @__PURE__ */ K("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),
|
|
@@ -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 } = q(), n = e.length > yt, r = (t) => n && t > 0 && t < e.length - 2;
|
|
457
|
+
return /* @__PURE__ */ G("nav", {
|
|
458
|
+
"aria-label": t("bento.trail.label", { defaultValue: "Location" }),
|
|
459
|
+
"data-slot": "bento-trail",
|
|
460
|
+
children: /* @__PURE__ */ G("ol", {
|
|
461
|
+
className: "flex min-w-0 flex-wrap items-center gap-1",
|
|
462
|
+
children: e.map((e, t) => /* @__PURE__ */ K("li", {
|
|
463
|
+
className: r(t) ? "sr-only" : "inline-flex min-w-0 items-center gap-1",
|
|
464
|
+
children: [
|
|
465
|
+
t > 0 && !r(t) && /* @__PURE__ */ G(xe, {
|
|
466
|
+
size: 12,
|
|
467
|
+
"aria-hidden": !0,
|
|
468
|
+
className: "shrink-0 opacity-60"
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ G(Ue, {
|
|
471
|
+
to: e.to,
|
|
472
|
+
className: "max-w-[16ch] truncate hover:text-foreground",
|
|
473
|
+
children: e.label
|
|
474
|
+
}),
|
|
475
|
+
n && t === 0 && /* @__PURE__ */ K("span", {
|
|
476
|
+
"aria-hidden": !0,
|
|
477
|
+
className: "inline-flex items-center gap-1",
|
|
478
|
+
children: [/* @__PURE__ */ G(xe, {
|
|
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__ */ K(
|
|
490
|
+
function xt({ to: e, children: t }) {
|
|
491
|
+
return /* @__PURE__ */ K(Ue, {
|
|
456
492
|
to: e,
|
|
457
493
|
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
458
|
-
children: [/* @__PURE__ */ G(
|
|
494
|
+
children: [/* @__PURE__ */ G(pe, {
|
|
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__ */ G(bt, { steps: e }) : e && e.length === 1 ? /* @__PURE__ */ G(xt, {
|
|
502
|
+
to: e[0].to,
|
|
503
|
+
children: e[0].label
|
|
504
|
+
}) : t == null ? null : /* @__PURE__ */ G(xt, {
|
|
466
505
|
to: t,
|
|
467
506
|
children: n
|
|
468
|
-
})
|
|
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);
|
|
469
511
|
return /* @__PURE__ */ G("header", {
|
|
470
512
|
className: "bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10",
|
|
471
513
|
children: /* @__PURE__ */ K("div", {
|
|
472
514
|
className: "flex w-full items-start gap-4",
|
|
473
515
|
children: [
|
|
474
|
-
|
|
516
|
+
o && /* @__PURE__ */ G("div", {
|
|
475
517
|
className: "shrink-0",
|
|
476
|
-
children:
|
|
518
|
+
children: o
|
|
477
519
|
}),
|
|
478
520
|
/* @__PURE__ */ K("div", {
|
|
479
521
|
className: "flex flex-1 flex-col gap-1",
|
|
480
522
|
children: [
|
|
481
|
-
|
|
523
|
+
c && /* @__PURE__ */ G("span", {
|
|
482
524
|
className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
|
|
483
|
-
children:
|
|
525
|
+
children: c
|
|
484
526
|
}),
|
|
485
527
|
/* @__PURE__ */ G("h1", {
|
|
486
528
|
className: "text-3xl font-semibold tracking-tight md:text-4xl",
|
|
487
|
-
children:
|
|
529
|
+
children: i
|
|
488
530
|
}),
|
|
489
|
-
|
|
531
|
+
a && /* @__PURE__ */ G("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__ */ G("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,11 +544,11 @@ 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:
|
|
547
|
+
function wt({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title: a, description: o, readOnly: s = !1 }) {
|
|
548
|
+
let { t: c } = q(), [l, u] = H(!1);
|
|
507
549
|
return s ? /* @__PURE__ */ G("span", {
|
|
508
550
|
className: `grid h-12 w-12 place-items-center rounded-2xl ${Y(i)} text-white shadow-md`,
|
|
509
|
-
children: e ? /* @__PURE__ */ G(
|
|
551
|
+
children: e ? /* @__PURE__ */ G(Ve, {
|
|
510
552
|
icon: e,
|
|
511
553
|
className: "size-6 text-white"
|
|
512
554
|
}) : /* @__PURE__ */ G(r, { size: 24 })
|
|
@@ -515,15 +557,15 @@ function bt({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title:
|
|
|
515
557
|
children: [
|
|
516
558
|
/* @__PURE__ */ K("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__ */ G(
|
|
563
|
+
children: [e ? /* @__PURE__ */ G(Ve, {
|
|
522
564
|
icon: e,
|
|
523
565
|
className: "size-6 text-white"
|
|
524
566
|
}) : /* @__PURE__ */ G(r, { size: 24 }), /* @__PURE__ */ G("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__ */ G(
|
|
568
|
+
children: /* @__PURE__ */ G(je, { className: "size-5 text-white" })
|
|
527
569
|
})]
|
|
528
570
|
}),
|
|
529
571
|
e && n && /* @__PURE__ */ G("button", {
|
|
@@ -531,14 +573,14 @@ function bt({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title:
|
|
|
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__ */ G(
|
|
579
|
+
children: /* @__PURE__ */ G(Be, { size: 12 })
|
|
538
580
|
}),
|
|
539
|
-
/* @__PURE__ */ G(
|
|
540
|
-
open:
|
|
541
|
-
onOpenChange:
|
|
581
|
+
/* @__PURE__ */ G(g, {
|
|
582
|
+
open: l,
|
|
583
|
+
onOpenChange: u,
|
|
542
584
|
value: e,
|
|
543
585
|
onSelect: t,
|
|
544
586
|
onClear: n,
|
|
@@ -550,8 +592,8 @@ 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 } = q(), [f, p] =
|
|
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 } = q(), [f, p] = H(c), [m, h] = H(n), [g, _] = H(!1), v = V(null), y = V(null), b = V(!1), x = V(!1), [S, C] = H(n);
|
|
555
597
|
!f && n !== S && (C(n), h(n)), B(() => {
|
|
556
598
|
f && v.current ? (v.current.focus(), v.current.select()) : !f && x.current && (x.current = !1, y.current?.focus());
|
|
557
599
|
}, [f]);
|
|
@@ -637,13 +679,13 @@ 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
|
|
682
|
+
function Et({ titleMissing: t, dirty: n, className: r }) {
|
|
641
683
|
let { t: i } = q();
|
|
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
686
|
return t ? /* @__PURE__ */ K("span", {
|
|
645
687
|
className: e(a, "bento-status bento-status-error", r),
|
|
646
|
-
children: [/* @__PURE__ */ G(
|
|
688
|
+
children: [/* @__PURE__ */ G(de, { className: "size-3" }), i("bento.saveBar.titleRequired", { defaultValue: "Title required" })]
|
|
647
689
|
}) : /* @__PURE__ */ K("span", {
|
|
648
690
|
className: e(a, "bento-status bento-status-warn", r),
|
|
649
691
|
children: [/* @__PURE__ */ G("span", { className: "h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse" }), i("bento.saveBar.unsaved", { defaultValue: "Unsaved changes" })]
|
|
@@ -651,7 +693,7 @@ function St({ titleMissing: t, dirty: n, className: r }) {
|
|
|
651
693
|
}
|
|
652
694
|
//#endregion
|
|
653
695
|
//#region src/bento/bento-scroll-fade.ts
|
|
654
|
-
function
|
|
696
|
+
function Dt(e) {
|
|
655
697
|
B(() => {
|
|
656
698
|
let t = e.current;
|
|
657
699
|
if (!t) return;
|
|
@@ -669,147 +711,147 @@ 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 } = q(), S = Ke(), [C, w] = H(!1), [T, E] = H({
|
|
679
721
|
isDirty: !1,
|
|
680
722
|
isSubmitting: !1
|
|
681
|
-
}), D =
|
|
682
|
-
|
|
723
|
+
}), D = V(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] = H(O), [j, M] = H(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, I = !p, L = !(m && !t), R = !k.title.trim(), te = !t && !T.isDirty, ne = R || te, re = [...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
782
|
return /* @__PURE__ */ K(W, { children: [
|
|
741
|
-
/* @__PURE__ */ G(
|
|
783
|
+
/* @__PURE__ */ G(Ct, {
|
|
742
784
|
eyebrow: /* @__PURE__ */ K("span", {
|
|
743
785
|
className: "inline-flex items-center gap-2",
|
|
744
|
-
children: [/* @__PURE__ */ G(
|
|
786
|
+
children: [o && o.length > 1 ? /* @__PURE__ */ G(bt, { steps: o }) : /* @__PURE__ */ G(xt, {
|
|
745
787
|
to: i,
|
|
746
788
|
children: r
|
|
747
|
-
}), !
|
|
748
|
-
titleMissing:
|
|
749
|
-
dirty: t ||
|
|
789
|
+
}), !p && /* @__PURE__ */ G(Et, {
|
|
790
|
+
titleMissing: R,
|
|
791
|
+
dirty: t || T.isDirty
|
|
750
792
|
})]
|
|
751
793
|
}),
|
|
752
|
-
leading: /* @__PURE__ */ G(
|
|
794
|
+
leading: /* @__PURE__ */ G(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__ */ G(
|
|
804
|
+
title: /* @__PURE__ */ G(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__ */ G(
|
|
814
|
+
subtitle: /* @__PURE__ */ G(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
824
|
trailing: /* @__PURE__ */ K(W, { children: [
|
|
783
|
-
|
|
825
|
+
I && /* @__PURE__ */ K("div", {
|
|
784
826
|
className: "bento-fade-out flex shrink-0 items-center gap-2",
|
|
785
|
-
children: [
|
|
827
|
+
children: [L && /* @__PURE__ */ K(a, {
|
|
786
828
|
type: "submit",
|
|
787
|
-
form:
|
|
829
|
+
form: l,
|
|
788
830
|
size: "sm",
|
|
789
|
-
loading:
|
|
790
|
-
"aria-disabled":
|
|
791
|
-
children: [/* @__PURE__ */ G(
|
|
831
|
+
loading: T.isSubmitting,
|
|
832
|
+
"aria-disabled": ne ? "true" : void 0,
|
|
833
|
+
children: [/* @__PURE__ */ G(Ce, { className: "size-4" }), x("forms.formActions.saveChanges")]
|
|
792
834
|
}), /* @__PURE__ */ K(a, {
|
|
793
835
|
type: "button",
|
|
794
836
|
size: "sm",
|
|
795
837
|
variant: "outline",
|
|
796
|
-
onClick: () =>
|
|
797
|
-
children: [/* @__PURE__ */ G(
|
|
838
|
+
onClick: () => S(i),
|
|
839
|
+
children: [/* @__PURE__ */ G(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__ */ G("span", { className: `h-1.5 w-1.5 rounded-full ${
|
|
842
|
+
h,
|
|
843
|
+
d && (p ? /* @__PURE__ */ K("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__ */ G("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" })]
|
|
804
846
|
}) : /* @__PURE__ */ K("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__ */ G("span", { className: `h-1.5 w-1.5 rounded-full ${
|
|
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__ */ G("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 && re.length > 0 && /* @__PURE__ */ G(dt, { actions: re })
|
|
813
855
|
] })
|
|
814
856
|
}),
|
|
815
857
|
/* @__PURE__ */ G("div", {
|
|
@@ -817,19 +859,19 @@ function Tt({ entity: e, isNew: t, headlineFallback: n, eyebrow: r, listRoute: i
|
|
|
817
859
|
"aria-hidden": !0,
|
|
818
860
|
className: "h-px"
|
|
819
861
|
}),
|
|
820
|
-
|
|
821
|
-
!t &&
|
|
822
|
-
feature:
|
|
862
|
+
g,
|
|
863
|
+
!t && v && /* @__PURE__ */ G(ie, {
|
|
864
|
+
feature: u,
|
|
823
865
|
name: k.title,
|
|
824
866
|
onDelete: ee,
|
|
825
|
-
open:
|
|
826
|
-
setOpen:
|
|
867
|
+
open: C,
|
|
868
|
+
setOpen: w,
|
|
827
869
|
trigger: /* @__PURE__ */ G("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,19 +879,19 @@ 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
|
|
888
|
+
function jt({ state: t, compact: n = !1, className: r }) {
|
|
847
889
|
let { t: i } = q(), 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",
|
|
894
|
+
}[t], o = e("rounded-full border px-1.5 leading-4", n && "font-mono", At[t], r);
|
|
853
895
|
if (!n) return /* @__PURE__ */ G("span", {
|
|
854
896
|
"data-slot": "bento-change-mark",
|
|
855
897
|
"data-state": t,
|
|
@@ -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 } = q(), [s, c] =
|
|
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 } = q(), [s, c] = H(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,
|
|
@@ -927,10 +969,10 @@ function jt({ before: t, after: n, fields: r, showUnchanged: i = !1, layout: a =
|
|
|
927
969
|
}),
|
|
928
970
|
/* @__PURE__ */ G("dl", {
|
|
929
971
|
className: "m-0 flex flex-col gap-3",
|
|
930
|
-
children: u.map((e) => /* @__PURE__ */ G(
|
|
972
|
+
children: u.map((e) => /* @__PURE__ */ G(It, {
|
|
931
973
|
label: e.field.label,
|
|
932
974
|
state: e.state,
|
|
933
|
-
children: /* @__PURE__ */ G(
|
|
975
|
+
children: /* @__PURE__ */ G(Lt, {
|
|
934
976
|
row: e,
|
|
935
977
|
layout: a
|
|
936
978
|
})
|
|
@@ -943,7 +985,7 @@ function jt({ before: t, after: n, fields: r, showUnchanged: i = !1, layout: a =
|
|
|
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__ */ G(
|
|
988
|
+
children: [/* @__PURE__ */ G(xe, {
|
|
947
989
|
size: 14,
|
|
948
990
|
"aria-hidden": "true",
|
|
949
991
|
className: e("transition-transform", s && "rotate-90")
|
|
@@ -953,12 +995,12 @@ function jt({ before: t, after: n, fields: r, showUnchanged: i = !1, layout: a =
|
|
|
953
995
|
})]
|
|
954
996
|
}), s && /* @__PURE__ */ G("dl", {
|
|
955
997
|
className: "m-0 flex flex-col gap-3",
|
|
956
|
-
children: d.map((t) => /* @__PURE__ */ G(
|
|
998
|
+
children: d.map((t) => /* @__PURE__ */ G(It, {
|
|
957
999
|
label: t.field.label,
|
|
958
1000
|
state: "unchanged",
|
|
959
1001
|
children: /* @__PURE__ */ G("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
|
|
1011
|
+
function It({ label: e, state: t, children: n }) {
|
|
970
1012
|
return /* @__PURE__ */ K("div", {
|
|
971
1013
|
className: "rounded-xl border border-border/60 bg-card/40 p-3",
|
|
972
1014
|
children: [/* @__PURE__ */ K("dt", {
|
|
973
1015
|
className: "mb-1.5 flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
974
|
-
children: [/* @__PURE__ */ G("span", { children: e }), /* @__PURE__ */ G(
|
|
1016
|
+
children: [/* @__PURE__ */ G("span", { children: e }), /* @__PURE__ */ G(jt, { state: t })]
|
|
975
1017
|
}), /* @__PURE__ */ G("dd", {
|
|
976
1018
|
className: "m-0",
|
|
977
1019
|
children: n
|
|
978
1020
|
})]
|
|
979
1021
|
});
|
|
980
1022
|
}
|
|
981
|
-
function
|
|
1023
|
+
function Lt({ row: e, layout: t }) {
|
|
982
1024
|
let { t: n } = q(), { field: r, a: i, b: a, kind: o, state: s } = e;
|
|
983
|
-
if (o === "lines") return /* @__PURE__ */ G(
|
|
1025
|
+
if (o === "lines") return /* @__PURE__ */ G(Ut, {
|
|
984
1026
|
label: r.label,
|
|
985
1027
|
before: X(i),
|
|
986
1028
|
after: X(a),
|
|
@@ -991,16 +1033,16 @@ function Nt({ row: e, layout: t }) {
|
|
|
991
1033
|
return /* @__PURE__ */ K("p", {
|
|
992
1034
|
className: "m-0 flex flex-wrap items-center gap-2 text-sm",
|
|
993
1035
|
children: [
|
|
994
|
-
s !== "added" && /* @__PURE__ */ G(
|
|
1036
|
+
s !== "added" && /* @__PURE__ */ G(tn, { children: e(i) }),
|
|
995
1037
|
s === "changed" && /* @__PURE__ */ G("span", {
|
|
996
1038
|
"aria-hidden": "true",
|
|
997
1039
|
children: "→"
|
|
998
1040
|
}),
|
|
999
|
-
s !== "removed" && /* @__PURE__ */ G(
|
|
1041
|
+
s !== "removed" && /* @__PURE__ */ G(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,18 +1052,18 @@ 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 =
|
|
1055
|
+
let r = Mt(Nt(t.text), Nt(n.text));
|
|
1014
1056
|
d.push(/* @__PURE__ */ G("p", {
|
|
1015
1057
|
className: "m-0 whitespace-pre-wrap text-sm leading-relaxed",
|
|
1016
|
-
children: r ? r.map((e, t) => e.op === "same" ? /* @__PURE__ */ G("span", { children: e.text }, t) : e.op === "add" ? /* @__PURE__ */ G(
|
|
1017
|
-
/* @__PURE__ */ G(
|
|
1058
|
+
children: r ? r.map((e, t) => e.op === "same" ? /* @__PURE__ */ G("span", { children: e.text }, t) : e.op === "add" ? /* @__PURE__ */ G(en, { children: e.text }, t) : /* @__PURE__ */ G(tn, { children: e.text }, t)) : [
|
|
1059
|
+
/* @__PURE__ */ G(tn, { children: t.text }, "r"),
|
|
1018
1060
|
" ",
|
|
1019
|
-
/* @__PURE__ */ G(
|
|
1061
|
+
/* @__PURE__ */ G(en, { children: n.text }, "a")
|
|
1020
1062
|
]
|
|
1021
1063
|
}, e)), e++;
|
|
1022
1064
|
} else d.push(/* @__PURE__ */ G("p", {
|
|
1023
1065
|
className: "m-0 whitespace-pre-wrap text-sm leading-relaxed",
|
|
1024
|
-
children: t.op === "same" ? t.text : t.op === "add" ? /* @__PURE__ */ G(
|
|
1066
|
+
children: t.op === "same" ? t.text : t.op === "add" ? /* @__PURE__ */ G(en, { children: t.text }) : /* @__PURE__ */ G(tn, { children: t.text })
|
|
1025
1067
|
}, e));
|
|
1026
1068
|
}
|
|
1027
1069
|
return d.length === 0 ? /* @__PURE__ */ G("p", {
|
|
@@ -1032,13 +1074,13 @@ function Nt({ row: e, layout: t }) {
|
|
|
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,8 +1147,8 @@ function Rt(e, t, n) {
|
|
|
1105
1147
|
}
|
|
1106
1148
|
return i;
|
|
1107
1149
|
}
|
|
1108
|
-
function
|
|
1109
|
-
let { t: a } = q(), [o, s] =
|
|
1150
|
+
function Ut({ label: t, before: n, after: r, layout: i }) {
|
|
1151
|
+
let { t: a } = q(), [o, s] = H(/* @__PURE__ */ new Set()), c = Bt(n, r);
|
|
1110
1152
|
if (c === null) return /* @__PURE__ */ G("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" })
|
|
@@ -1129,7 +1171,7 @@ function zt({ label: t, before: n, after: r, layout: i }) {
|
|
|
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__ */ G(
|
|
1174
|
+
children: [/* @__PURE__ */ G(xe, {
|
|
1133
1175
|
size: 12,
|
|
1134
1176
|
"aria-hidden": "true",
|
|
1135
1177
|
className: e("transition-transform", i && "rotate-90")
|
|
@@ -1143,8 +1185,8 @@ function zt({ label: t, before: n, after: r, layout: i }) {
|
|
|
1143
1185
|
let d = (t) => /* @__PURE__ */ G("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__ */ G("tbody", { children:
|
|
1147
|
-
let t = (e) => /* @__PURE__ */ G(
|
|
1188
|
+
children: /* @__PURE__ */ G("tbody", { children: Ht(c, (e) => e.op !== "same", Wt).map((e) => {
|
|
1189
|
+
let t = (e) => /* @__PURE__ */ G(Xt, { row: e }, Wt(e));
|
|
1148
1190
|
return e.fold ? u(e, 4, t) : e.items.map(t);
|
|
1149
1191
|
}) })
|
|
1150
1192
|
});
|
|
@@ -1162,87 +1204,87 @@ function zt({ label: t, before: n, after: r, layout: i }) {
|
|
|
1162
1204
|
/* @__PURE__ */ G("col", { className: "w-14" }),
|
|
1163
1205
|
/* @__PURE__ */ G("col", { className: "w-5" }),
|
|
1164
1206
|
/* @__PURE__ */ G("col", {})
|
|
1165
|
-
] }), /* @__PURE__ */ G("tbody", { children:
|
|
1166
|
-
let t = (e) => /* @__PURE__ */ G(
|
|
1207
|
+
] }), /* @__PURE__ */ G("tbody", { children: Ht(Vt(c), (e) => e.left?.op !== "same", Gt).map((e) => {
|
|
1208
|
+
let t = (e) => /* @__PURE__ */ G(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__ */ G(
|
|
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__ */ G(en, { children: e.text }, t) : e.op === "remove" ? /* @__PURE__ */ G(tn, { children: e.text }, t) : /* @__PURE__ */ G("span", { children: e.text }, t)) : e.op === "same" ? e.text : /* @__PURE__ */ G($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 =
|
|
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);
|
|
1186
1228
|
return /* @__PURE__ */ K("tr", {
|
|
1187
1229
|
"data-op": t.op,
|
|
1188
1230
|
children: [
|
|
1189
1231
|
/* @__PURE__ */ G("td", {
|
|
1190
|
-
className: e("w-px",
|
|
1232
|
+
className: e("w-px", Yt, n),
|
|
1191
1233
|
children: t.old
|
|
1192
1234
|
}),
|
|
1193
1235
|
/* @__PURE__ */ G("td", {
|
|
1194
|
-
className: e("w-px",
|
|
1236
|
+
className: e("w-px", Yt, n),
|
|
1195
1237
|
children: t.new
|
|
1196
1238
|
}),
|
|
1197
1239
|
/* @__PURE__ */ G("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
1244
|
/* @__PURE__ */ G("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
|
|
1251
|
+
function Zt({ pair: e }) {
|
|
1210
1252
|
return /* @__PURE__ */ K("tr", {
|
|
1211
1253
|
"data-op": e.left?.op === "same" ? "same" : "change",
|
|
1212
|
-
children: [/* @__PURE__ */ G(
|
|
1254
|
+
children: [/* @__PURE__ */ G(Qt, {
|
|
1213
1255
|
row: e.left,
|
|
1214
1256
|
number: e.left?.old
|
|
1215
|
-
}), /* @__PURE__ */ G(
|
|
1257
|
+
}), /* @__PURE__ */ G(Qt, {
|
|
1216
1258
|
row: e.right,
|
|
1217
1259
|
number: e.right?.new,
|
|
1218
1260
|
right: !0
|
|
1219
1261
|
})]
|
|
1220
1262
|
});
|
|
1221
1263
|
}
|
|
1222
|
-
function
|
|
1264
|
+
function Qt({ row: t, number: n, right: r = !1 }) {
|
|
1223
1265
|
if (t === null) return /* @__PURE__ */ G("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 =
|
|
1270
|
+
let i = Kt(t);
|
|
1229
1271
|
return /* @__PURE__ */ K(W, { children: [
|
|
1230
1272
|
/* @__PURE__ */ G("td", {
|
|
1231
|
-
className: e(
|
|
1273
|
+
className: e(Yt, i, r && "border-l border-border/60"),
|
|
1232
1274
|
children: n
|
|
1233
1275
|
}),
|
|
1234
1276
|
/* @__PURE__ */ G("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
1281
|
/* @__PURE__ */ G("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
|
|
1287
|
+
function $t({ op: e, children: t }) {
|
|
1246
1288
|
let { t: n } = q();
|
|
1247
1289
|
return /* @__PURE__ */ K(e === "add" ? "ins" : "del", {
|
|
1248
1290
|
className: "no-underline",
|
|
@@ -1252,7 +1294,7 @@ function Yt({ op: e, children: t }) {
|
|
|
1252
1294
|
}), t]
|
|
1253
1295
|
});
|
|
1254
1296
|
}
|
|
1255
|
-
function
|
|
1297
|
+
function en({ children: e }) {
|
|
1256
1298
|
let { t } = q();
|
|
1257
1299
|
return /* @__PURE__ */ K("ins", {
|
|
1258
1300
|
className: "bento-status bento-status-on rounded-sm px-0.5 underline decoration-2 underline-offset-2",
|
|
@@ -1262,7 +1304,7 @@ function Xt({ children: e }) {
|
|
|
1262
1304
|
}), e]
|
|
1263
1305
|
});
|
|
1264
1306
|
}
|
|
1265
|
-
function
|
|
1307
|
+
function tn({ children: e }) {
|
|
1266
1308
|
let { t } = q();
|
|
1267
1309
|
return /* @__PURE__ */ K("del", {
|
|
1268
1310
|
className: "bento-status bento-status-error rounded-sm px-0.5 line-through decoration-2",
|
|
@@ -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,39 +1329,39 @@ 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 } = q(),
|
|
1336
|
+
function on({ primary: t, secondary: n, primaryLabel: r, secondaryLabel: i, storageKey: a, defaultRatio: o = 50, className: s }) {
|
|
1337
|
+
let { t: c } = q(), 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__ */ K(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__ */ K(
|
|
1347
|
+
/* @__PURE__ */ K(E, {
|
|
1306
1348
|
"aria-label": c("bento.split.switch", { defaultValue: "Show" }),
|
|
1307
1349
|
className: "self-start",
|
|
1308
|
-
children: [/* @__PURE__ */ G(
|
|
1350
|
+
children: [/* @__PURE__ */ G(D, {
|
|
1309
1351
|
value: "primary",
|
|
1310
1352
|
children: r
|
|
1311
|
-
}), /* @__PURE__ */ G(
|
|
1353
|
+
}), /* @__PURE__ */ G(D, {
|
|
1312
1354
|
value: "secondary",
|
|
1313
1355
|
children: i
|
|
1314
1356
|
})]
|
|
1315
1357
|
}),
|
|
1316
|
-
/* @__PURE__ */ G(
|
|
1358
|
+
/* @__PURE__ */ G(R, {
|
|
1317
1359
|
value: "primary",
|
|
1318
1360
|
forceMount: !0,
|
|
1319
1361
|
className: "data-[state=inactive]:hidden",
|
|
1320
1362
|
children: t
|
|
1321
1363
|
}),
|
|
1322
|
-
/* @__PURE__ */ G(
|
|
1364
|
+
/* @__PURE__ */ G(R, {
|
|
1323
1365
|
value: "secondary",
|
|
1324
1366
|
forceMount: !0,
|
|
1325
1367
|
className: "data-[state=inactive]:hidden",
|
|
@@ -1329,12 +1371,12 @@ function tn({ primary: t, secondary: n, primaryLabel: r, secondaryLabel: i, stor
|
|
|
1329
1371
|
}) : /* @__PURE__ */ G("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__ */ K(
|
|
1374
|
+
children: /* @__PURE__ */ K(ne, {
|
|
1333
1375
|
orientation: "horizontal",
|
|
1334
|
-
defaultLayout:
|
|
1335
|
-
onLayoutChanged:
|
|
1376
|
+
defaultLayout: d.defaultLayout,
|
|
1377
|
+
onLayoutChanged: d.onLayoutChanged,
|
|
1336
1378
|
children: [
|
|
1337
|
-
/* @__PURE__ */ G(
|
|
1379
|
+
/* @__PURE__ */ G(l, {
|
|
1338
1380
|
id: "primary",
|
|
1339
1381
|
defaultSize: `${o}`,
|
|
1340
1382
|
minSize: "25",
|
|
@@ -1344,8 +1386,8 @@ function tn({ primary: t, secondary: n, primaryLabel: r, secondaryLabel: i, stor
|
|
|
1344
1386
|
children: t
|
|
1345
1387
|
})
|
|
1346
1388
|
}),
|
|
1347
|
-
/* @__PURE__ */ G(
|
|
1348
|
-
/* @__PURE__ */ G(
|
|
1389
|
+
/* @__PURE__ */ G(b, { withHandle: !0 }),
|
|
1390
|
+
/* @__PURE__ */ G(l, {
|
|
1349
1391
|
id: "secondary",
|
|
1350
1392
|
defaultSize: `${100 - o}`,
|
|
1351
1393
|
minSize: "25",
|
|
@@ -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
|
|
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 }) {
|
|
1412
1454
|
let { t: p, i18n: m } = q(), h = m?.resolvedLanguage ?? m?.language, g = (e) => {
|
|
1413
|
-
let t =
|
|
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] = H(r), y = n ?? _, [b, x] = H(() => g(a ?? Date.now())), [S, C] = H(null), [w, T] = H(null), [E, D] = H(""), O = V(/* @__PURE__ */ new Map()), k = V(!1), A = ce(), [j] = H(() => 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,
|
|
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), I = `${Z(N)}/${Z(F)}`;
|
|
1426
1468
|
B(() => {
|
|
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
|
+
}, [I, o]), B(() => {
|
|
1432
1474
|
k.current && (k.current = !1, O.current.get(Z(b))?.focus());
|
|
1433
1475
|
});
|
|
1434
|
-
let
|
|
1476
|
+
let L = /* @__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 = L.get(n) ?? [];
|
|
1439
1481
|
r.push({
|
|
1440
1482
|
entry: e,
|
|
1441
1483
|
time: t
|
|
1442
|
-
}),
|
|
1484
|
+
}), L.set(n, r);
|
|
1443
1485
|
}
|
|
1444
|
-
for (let e of
|
|
1445
|
-
let
|
|
1486
|
+
for (let e of L.values()) e.sort((e, t) => e.time - t.time);
|
|
1487
|
+
let R = (e) => new Intl.DateTimeFormat(h, {
|
|
1446
1488
|
...e,
|
|
1447
1489
|
timeZone: "UTC"
|
|
1448
|
-
}),
|
|
1490
|
+
}), te = (e) => R({ dateStyle: "full" }).format(Q(e)), ne = (e) => new Intl.DateTimeFormat(h, {
|
|
1449
1491
|
timeStyle: "short",
|
|
1450
1492
|
timeZone: o
|
|
1451
|
-
}).format(e), re = y === "month" ?
|
|
1493
|
+
}).format(e), re = y === "month" ? R({
|
|
1452
1494
|
month: "long",
|
|
1453
1495
|
year: "numeric"
|
|
1454
1496
|
}).format(Q({
|
|
1455
1497
|
...b,
|
|
1456
1498
|
d: 1
|
|
1457
|
-
})) : `${
|
|
1499
|
+
})) : `${R({ dateStyle: "medium" }).format(Q(N))} – ${R({ dateStyle: "medium" }).format(Q($(F, -1)))}`;
|
|
1458
1500
|
function ie(e) {
|
|
1459
1501
|
k.current = !0, x(e);
|
|
1460
1502
|
}
|
|
1461
1503
|
function ae(e) {
|
|
1462
1504
|
n === void 0 && v(e), i?.(e);
|
|
1463
1505
|
}
|
|
1464
|
-
let oe = (e) => y === "month" ?
|
|
1506
|
+
let oe = (e) => y === "month" ? cn(b, e) : $(b, 7 * e);
|
|
1465
1507
|
function z(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: te(n)
|
|
1473
1515
|
}));
|
|
1474
1516
|
}
|
|
1475
|
-
function
|
|
1517
|
+
function se(e, n) {
|
|
1476
1518
|
let r = {
|
|
1477
1519
|
ArrowLeft: () => $(n, -1),
|
|
1478
1520
|
ArrowRight: () => $(n, 1),
|
|
@@ -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 le(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,11 +1551,11 @@ 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 U(e, t) {
|
|
1513
1555
|
let n = w ?? e.dataTransfer.getData("text/plain");
|
|
1514
1556
|
T(null), n && (e.preventDefault(), z(n, t));
|
|
1515
1557
|
}
|
|
1516
|
-
let
|
|
1558
|
+
let W = c ? A : void 0;
|
|
1517
1559
|
return /* @__PURE__ */ K("div", {
|
|
1518
1560
|
"data-slot": "bento-calendar",
|
|
1519
1561
|
className: e("flex flex-col gap-3", f),
|
|
@@ -1523,18 +1565,18 @@ function ln({ entries: t, view: n, defaultView: r = "month", onViewChange: i, de
|
|
|
1523
1565
|
children: [/* @__PURE__ */ K("div", {
|
|
1524
1566
|
className: "flex items-center gap-1",
|
|
1525
1567
|
children: [
|
|
1526
|
-
/* @__PURE__ */ G(
|
|
1568
|
+
/* @__PURE__ */ G(mn, {
|
|
1527
1569
|
label: p("bento.calendar.previous", { defaultValue: "Previous" }),
|
|
1528
1570
|
onClick: () => x(oe(-1)),
|
|
1529
|
-
children: /* @__PURE__ */ G(
|
|
1571
|
+
children: /* @__PURE__ */ G(be, {
|
|
1530
1572
|
size: 16,
|
|
1531
1573
|
"aria-hidden": "true"
|
|
1532
1574
|
})
|
|
1533
1575
|
}),
|
|
1534
|
-
/* @__PURE__ */ G(
|
|
1576
|
+
/* @__PURE__ */ G(mn, {
|
|
1535
1577
|
label: p("bento.calendar.next", { defaultValue: "Next" }),
|
|
1536
1578
|
onClick: () => x(oe(1)),
|
|
1537
|
-
children: /* @__PURE__ */ G(
|
|
1579
|
+
children: /* @__PURE__ */ G(xe, {
|
|
1538
1580
|
size: 16,
|
|
1539
1581
|
"aria-hidden": "true"
|
|
1540
1582
|
})
|
|
@@ -1570,8 +1612,8 @@ function ln({ entries: t, view: n, defaultView: r = "month", onViewChange: i, de
|
|
|
1570
1612
|
className: "sr-only",
|
|
1571
1613
|
children: E
|
|
1572
1614
|
}),
|
|
1573
|
-
|
|
1574
|
-
id:
|
|
1615
|
+
W && /* @__PURE__ */ G("span", {
|
|
1616
|
+
id: W,
|
|
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
|
}),
|
|
@@ -1579,33 +1621,33 @@ function ln({ entries: t, view: n, defaultView: r = "month", onViewChange: i, de
|
|
|
1579
1621
|
role: "grid",
|
|
1580
1622
|
"aria-label": d ?? re,
|
|
1581
1623
|
className: "w-full table-fixed border-collapse text-sm",
|
|
1582
|
-
children: [/* @__PURE__ */ G("thead", { children: /* @__PURE__ */ G("tr", { children:
|
|
1624
|
+
children: [/* @__PURE__ */ G("thead", { children: /* @__PURE__ */ G("tr", { children: ee[0].map((e) => /* @__PURE__ */ G("th", {
|
|
1583
1625
|
scope: "col",
|
|
1584
|
-
abbr:
|
|
1626
|
+
abbr: R({ weekday: "long" }).format(Q(e)),
|
|
1585
1627
|
className: "pb-1 text-xs font-medium text-muted-foreground",
|
|
1586
|
-
children:
|
|
1587
|
-
}, Z(e))) }) }), /* @__PURE__ */ G("tbody", { children:
|
|
1588
|
-
let n = Z(t), r =
|
|
1628
|
+
children: R({ weekday: "short" }).format(Q(e))
|
|
1629
|
+
}, Z(e))) }) }), /* @__PURE__ */ G("tbody", { children: ee.map((t) => /* @__PURE__ */ G("tr", { children: t.map((t) => {
|
|
1630
|
+
let n = Z(t), r = L.get(n) ?? [], i = n === Z(b), a = y === "month" && t.m !== b.m, o = r.length;
|
|
1589
1631
|
return /* @__PURE__ */ K("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 ? `${te(t)}, ${p("bento.calendar.entries", {
|
|
1596
1638
|
defaultValue: "{{count}} scheduled",
|
|
1597
1639
|
count: o
|
|
1598
|
-
})}` :
|
|
1640
|
+
})}` : te(t),
|
|
1599
1641
|
"aria-current": n === j ? "date" : void 0,
|
|
1600
1642
|
"data-day": n,
|
|
1601
|
-
onKeyDown: (e) =>
|
|
1643
|
+
onKeyDown: (e) => se(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) => U(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
1652
|
children: [/* @__PURE__ */ G("span", {
|
|
1611
1653
|
"aria-hidden": "true",
|
|
@@ -1617,16 +1659,16 @@ function ln({ entries: t, view: n, defaultView: r = "month", onViewChange: i, de
|
|
|
1617
1659
|
type: "button",
|
|
1618
1660
|
tabIndex: -1,
|
|
1619
1661
|
draggable: c ? !0 : void 0,
|
|
1620
|
-
"aria-describedby":
|
|
1662
|
+
"aria-describedby": W,
|
|
1621
1663
|
"aria-pressed": c ? S === t.id ? "true" : "false" : void 0,
|
|
1622
1664
|
"data-entry": t.id,
|
|
1623
|
-
onKeyDown: (e) =>
|
|
1665
|
+
onKeyDown: (e) => le(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 ?
|
|
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"),
|
|
1630
1672
|
children: [/* @__PURE__ */ G("time", {
|
|
1631
1673
|
dateTime: new Date(n).toISOString(),
|
|
1632
1674
|
className: "flex-none tabular-nums",
|
|
@@ -1643,7 +1685,7 @@ function ln({ entries: t, view: n, defaultView: r = "month", onViewChange: i, de
|
|
|
1643
1685
|
]
|
|
1644
1686
|
});
|
|
1645
1687
|
}
|
|
1646
|
-
function
|
|
1688
|
+
function mn({ label: e, onClick: t, children: n }) {
|
|
1647
1689
|
return /* @__PURE__ */ G("button", {
|
|
1648
1690
|
type: "button",
|
|
1649
1691
|
"aria-label": e,
|
|
@@ -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,9 +1735,9 @@ function mn(e) {
|
|
|
1693
1735
|
}
|
|
1694
1736
|
//#endregion
|
|
1695
1737
|
//#region src/bento/bento-entity-tile.tsx
|
|
1696
|
-
function
|
|
1697
|
-
let { t: f } = q(), p = Y(a), m = t ?? (n ? "LARGE" : "MEDIUM"), h = m === "LARGE", g = m === "SMALL", _ =
|
|
1698
|
-
return /* @__PURE__ */ K(
|
|
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 } = q(), 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__ */ K(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,
|
|
@@ -1711,7 +1753,7 @@ function hn({ to: e, emphasis: t, featured: n, defaultIcon: r, icon: i, tone: a
|
|
|
1711
1753
|
className: "relative z-1 flex items-center justify-between",
|
|
1712
1754
|
children: [/* @__PURE__ */ G("span", {
|
|
1713
1755
|
className: `grid place-items-center rounded-2xl ${p} text-white shadow-md ${b}`,
|
|
1714
|
-
children: i ? /* @__PURE__ */ G(
|
|
1756
|
+
children: i ? /* @__PURE__ */ G(Ve, {
|
|
1715
1757
|
icon: i,
|
|
1716
1758
|
className: h ? "size-7 text-white" : "size-4.5 text-white"
|
|
1717
1759
|
}) : /* @__PURE__ */ G(r, { size: x })
|
|
@@ -1742,22 +1784,22 @@ 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 } = q(), [c, l] =
|
|
1798
|
+
function wn({ value: e, onChange: n, facets: r, queryLabel: i, queryDelay: a = 300, views: o }) {
|
|
1799
|
+
let { t: s } = q(), [c, l] = H({
|
|
1758
1800
|
source: e.query,
|
|
1759
1801
|
text: e.query
|
|
1760
|
-
}), [u, d] =
|
|
1802
|
+
}), [u, d] = H(null);
|
|
1761
1803
|
c.source !== e.query && l({
|
|
1762
1804
|
source: e.query,
|
|
1763
1805
|
text: e.query === u ? c.text : e.query
|
|
@@ -1779,18 +1821,18 @@ 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" });
|
|
@@ -1804,7 +1846,7 @@ function bn({ value: e, onChange: n, facets: r, queryLabel: i, queryDelay: a = 3
|
|
|
1804
1846
|
children: [
|
|
1805
1847
|
/* @__PURE__ */ K("div", {
|
|
1806
1848
|
className: "relative min-w-48 flex-1",
|
|
1807
|
-
children: [/* @__PURE__ */ G(
|
|
1849
|
+
children: [/* @__PURE__ */ G(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"
|
|
@@ -1820,11 +1862,11 @@ 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__ */ G(
|
|
1865
|
+
r.map((t) => t.kind === "choice" ? /* @__PURE__ */ G(En, {
|
|
1824
1866
|
facet: t,
|
|
1825
1867
|
value: e,
|
|
1826
1868
|
onChange: n
|
|
1827
|
-
}, t.id) : /* @__PURE__ */ G(
|
|
1869
|
+
}, t.id) : /* @__PURE__ */ G(Dn, {
|
|
1828
1870
|
facet: t,
|
|
1829
1871
|
value: e,
|
|
1830
1872
|
onChange: n
|
|
@@ -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__ */ G(
|
|
1887
|
+
children: [e.text, /* @__PURE__ */ G(Be, {
|
|
1846
1888
|
size: 12,
|
|
1847
1889
|
"aria-hidden": "true"
|
|
1848
1890
|
})]
|
|
1849
|
-
}) }, e.key)), /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(
|
|
1891
|
+
}) }, e.key)), /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(C, {
|
|
1850
1892
|
variant: "ghost",
|
|
1851
1893
|
size: "sm",
|
|
1852
1894
|
className: "h-6 px-2 text-xs",
|
|
@@ -1854,15 +1896,15 @@ 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__ */ K(
|
|
1906
|
+
function Tn({ label: e, count: t, ...n }) {
|
|
1907
|
+
return /* @__PURE__ */ K(C, {
|
|
1866
1908
|
variant: "outline",
|
|
1867
1909
|
size: "sm",
|
|
1868
1910
|
className: "gap-1.5",
|
|
@@ -1873,59 +1915,59 @@ function xn({ label: e, count: t, ...n }) {
|
|
|
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__ */ G(
|
|
1918
|
+
/* @__PURE__ */ G(ye, {
|
|
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__ */ K(
|
|
1925
|
+
function En({ facet: e, value: t, onChange: n }) {
|
|
1926
|
+
let r = Sn(t.facets[e.id]);
|
|
1927
|
+
return /* @__PURE__ */ K(_, { children: [/* @__PURE__ */ G(F, {
|
|
1886
1928
|
asChild: !0,
|
|
1887
|
-
children: /* @__PURE__ */ G(
|
|
1929
|
+
children: /* @__PURE__ */ G(Tn, {
|
|
1888
1930
|
label: e.label,
|
|
1889
1931
|
count: r.length
|
|
1890
1932
|
})
|
|
1891
|
-
}), /* @__PURE__ */ G(
|
|
1933
|
+
}), /* @__PURE__ */ G(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__ */ G(
|
|
1936
|
+
children: e.multiple ? e.options.map((i) => /* @__PURE__ */ G(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__ */ G(
|
|
1941
|
+
}, i.value)) : /* @__PURE__ */ G(c, {
|
|
1900
1942
|
value: r[0] ?? "",
|
|
1901
|
-
onValueChange: (i) => n(
|
|
1902
|
-
children: e.options.map((e) => /* @__PURE__ */ G(
|
|
1943
|
+
onValueChange: (i) => n(Cn(t, e.id, i === r[0] ? [] : [i])),
|
|
1944
|
+
children: e.options.map((e) => /* @__PURE__ */ G(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 } = q(), a = n.facets[e.id], o =
|
|
1911
|
-
return /* @__PURE__ */ K(
|
|
1951
|
+
function Dn({ facet: e, value: n, onChange: r }) {
|
|
1952
|
+
let { t: i } = q(), a = n.facets[e.id], o = xn(a) ? a : {}, [s, c] = H(!1), [l, d] = H(o.from ?? ""), [f, p] = H(o.to ?? ""), m = ce(), h = ce();
|
|
1953
|
+
return /* @__PURE__ */ K(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__ */ G(
|
|
1958
|
+
children: [/* @__PURE__ */ G(j, {
|
|
1917
1959
|
asChild: !0,
|
|
1918
|
-
children: /* @__PURE__ */ G(
|
|
1960
|
+
children: /* @__PURE__ */ G(Tn, {
|
|
1919
1961
|
label: e.label,
|
|
1920
1962
|
count: o.from || o.to ? 1 : 0
|
|
1921
1963
|
})
|
|
1922
|
-
}), /* @__PURE__ */ G(
|
|
1964
|
+
}), /* @__PURE__ */ G(u, {
|
|
1923
1965
|
align: "start",
|
|
1924
1966
|
className: "bento-dropdown w-64 p-3",
|
|
1925
1967
|
children: /* @__PURE__ */ K("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);
|
|
@@ -1955,7 +1997,7 @@ function Cn({ facet: e, value: n, onChange: r }) {
|
|
|
1955
1997
|
min: l || void 0,
|
|
1956
1998
|
onChange: (e) => p(e.target.value)
|
|
1957
1999
|
}),
|
|
1958
|
-
/* @__PURE__ */ G(
|
|
2000
|
+
/* @__PURE__ */ G(C, {
|
|
1959
2001
|
type: "submit",
|
|
1960
2002
|
size: "sm",
|
|
1961
2003
|
className: "mt-1",
|
|
@@ -1968,76 +2010,122 @@ 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 } = q(), A = Y(d), [j, M] = H(!1), N = le(() => _n(e ?? [], _, O?.data?.entries), [
|
|
1974
2016
|
e,
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
]),
|
|
1978
|
-
|
|
2017
|
+
_,
|
|
2018
|
+
O?.data?.entries
|
|
2019
|
+
]), P = c ? /* @__PURE__ */ G("span", {
|
|
2020
|
+
className: `grid h-12 w-12 place-items-center rounded-2xl ${A} text-white shadow-md`,
|
|
2021
|
+
children: /* @__PURE__ */ G(c, { size: 24 })
|
|
2022
|
+
}) : void 0;
|
|
2023
|
+
if (!T) return /* @__PURE__ */ K(ae, {
|
|
1979
2024
|
checkIsNotUndefined: e,
|
|
1980
2025
|
error: t ?? null,
|
|
1981
2026
|
tryAgainUrl: n,
|
|
1982
2027
|
children: [
|
|
1983
|
-
/* @__PURE__ */ G(
|
|
2028
|
+
/* @__PURE__ */ G(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__ */ G(C, {
|
|
2037
|
+
asChild: !0,
|
|
2038
|
+
className: "gap-2",
|
|
2039
|
+
children: /* @__PURE__ */ K(Ue, {
|
|
2040
|
+
to: p,
|
|
2041
|
+
children: [/* @__PURE__ */ G(Me, { size: 16 }), m]
|
|
2042
|
+
})
|
|
2043
|
+
})
|
|
2044
|
+
}),
|
|
2045
|
+
f && /* @__PURE__ */ G("div", {
|
|
2046
|
+
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
2047
|
+
children: f
|
|
1993
2048
|
}),
|
|
1994
|
-
|
|
2049
|
+
e?.length === 0 ? /* @__PURE__ */ G(vt, {
|
|
2050
|
+
icon: Fe,
|
|
2051
|
+
title: E,
|
|
2052
|
+
description: D
|
|
2053
|
+
}) : /* @__PURE__ */ G(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__ */ K(ae, {
|
|
2068
|
+
checkIsNotUndefined: e,
|
|
2069
|
+
error: t ?? null,
|
|
2070
|
+
tryAgainUrl: n,
|
|
2071
|
+
children: [
|
|
2072
|
+
/* @__PURE__ */ G(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__ */ K("div", {
|
|
1995
2082
|
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
1996
|
-
children: [
|
|
2083
|
+
children: [f, ee && !j && /* @__PURE__ */ K(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__ */ G(
|
|
2088
|
+
children: [/* @__PURE__ */ G(ue, { 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__ */ G(
|
|
2017
|
-
resolved:
|
|
2018
|
-
renderTile:
|
|
2019
|
-
chip:
|
|
2020
|
-
hideNew:
|
|
2021
|
-
newRoute:
|
|
2022
|
-
newLabel:
|
|
2023
|
-
newSubtitle:
|
|
2091
|
+
j && r && O ? /* @__PURE__ */ G(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__ */ G(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__ */ G(
|
|
2120
|
+
return /* @__PURE__ */ G(ae, {
|
|
2034
2121
|
checkIsNotUndefined: e,
|
|
2035
2122
|
error: t ?? null,
|
|
2036
2123
|
tryAgainUrl: n,
|
|
2037
2124
|
children: /* @__PURE__ */ K("div", {
|
|
2038
|
-
|
|
2125
|
+
"data-slot": "bento-list-tiles",
|
|
2126
|
+
className: kn,
|
|
2039
2127
|
children: [
|
|
2040
|
-
!s && i && a ? /* @__PURE__ */ G(
|
|
2128
|
+
!s && i && a ? /* @__PURE__ */ G(Ln, {
|
|
2041
2129
|
route: i,
|
|
2042
2130
|
label: a,
|
|
2043
2131
|
subtitle: o,
|
|
@@ -2047,7 +2135,7 @@ function En({ items: e, error: t, tryAgainUrl: n, tone: r = "indigo", newRoute:
|
|
|
2047
2135
|
className: "contents",
|
|
2048
2136
|
children: l(e)
|
|
2049
2137
|
}, c(e))),
|
|
2050
|
-
e?.length === 0 && /* @__PURE__ */ G(
|
|
2138
|
+
e?.length === 0 && /* @__PURE__ */ G(Rn, {
|
|
2051
2139
|
title: u,
|
|
2052
2140
|
description: d
|
|
2053
2141
|
})
|
|
@@ -2055,12 +2143,13 @@ 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
2148
|
return /* @__PURE__ */ K("div", {
|
|
2061
|
-
|
|
2149
|
+
"data-slot": "bento-list-tiles",
|
|
2150
|
+
className: e(kn, d && "grid-flow-dense"),
|
|
2062
2151
|
children: [
|
|
2063
|
-
!i && /* @__PURE__ */ G(
|
|
2152
|
+
!i && /* @__PURE__ */ G(Ln, {
|
|
2064
2153
|
route: a,
|
|
2065
2154
|
label: o,
|
|
2066
2155
|
subtitle: s,
|
|
@@ -2070,15 +2159,15 @@ function Dn({ resolved: t, renderTile: n, chip: r, hideNew: i, newRoute: a, newL
|
|
|
2070
2159
|
className: "contents",
|
|
2071
2160
|
children: n(e, r)
|
|
2072
2161
|
}, t)),
|
|
2073
|
-
c && /* @__PURE__ */ G(
|
|
2162
|
+
c && /* @__PURE__ */ G(Rn, {
|
|
2074
2163
|
title: l,
|
|
2075
2164
|
description: u
|
|
2076
2165
|
})
|
|
2077
2166
|
]
|
|
2078
2167
|
});
|
|
2079
2168
|
}
|
|
2080
|
-
function
|
|
2081
|
-
let { t: f } = q(), [p, m] =
|
|
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 } = q(), [p, m] = H(n), [h, g] = H(null), _ = (t.saving ?? !1) || h !== null, v = (e) => _ && h === e ? { loading: !0 } : { "aria-disabled": _ || void 0 }, [y, b] = H(!1), x = (e, t) => async () => {
|
|
2082
2171
|
if (t) {
|
|
2083
2172
|
g(e), b(!1);
|
|
2084
2173
|
try {
|
|
@@ -2089,21 +2178,21 @@ 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
|
|
2195
|
+
let E = le(() => vn(p), [p]), D = p.some((e) => e.emphasis === "SMALL");
|
|
2107
2196
|
return /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("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: [
|
|
@@ -2111,36 +2200,36 @@ function On({ layout: t, resolved: n, canEditGlobal: r, isCustomized: i, renderT
|
|
|
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__ */ K(
|
|
2203
|
+
i && t.onReset && /* @__PURE__ */ K(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__ */ G(
|
|
2209
|
+
children: [h !== "reset" && /* @__PURE__ */ G(J, { size: 16 }), f("bento.layout.reset", { defaultValue: "Reset to default" })]
|
|
2121
2210
|
}),
|
|
2122
|
-
r && t.onSaveGlobal && /* @__PURE__ */ K(
|
|
2211
|
+
r && t.onSaveGlobal && /* @__PURE__ */ K(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__ */ G(
|
|
2216
|
+
onClick: x("global", () => t.onSaveGlobal?.(E)),
|
|
2217
|
+
children: [h !== "global" && /* @__PURE__ */ G(ze, { size: 16 }), f("bento.layout.saveGlobal", { defaultValue: "Set as default for everyone" })]
|
|
2129
2218
|
}),
|
|
2130
|
-
/* @__PURE__ */ K(
|
|
2219
|
+
/* @__PURE__ */ K(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__ */ G(
|
|
2225
|
+
children: [/* @__PURE__ */ G(Be, { size: 16 }), f("common.cancel", { defaultValue: "Cancel" })]
|
|
2137
2226
|
}),
|
|
2138
|
-
/* @__PURE__ */ K(
|
|
2227
|
+
/* @__PURE__ */ K(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__ */ G(
|
|
2231
|
+
onClick: x("save", () => t.onSave(E)),
|
|
2232
|
+
children: [h !== "save" && /* @__PURE__ */ G(Ce, { size: 16 }), f("bento.layout.save", { defaultValue: "Save layout" })]
|
|
2144
2233
|
}),
|
|
2145
2234
|
y && /* @__PURE__ */ G("p", {
|
|
2146
2235
|
role: "alert",
|
|
@@ -2148,35 +2237,36 @@ function On({ layout: t, resolved: n, canEditGlobal: r, isCustomized: i, renderT
|
|
|
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__ */ G(
|
|
2240
|
+
}), /* @__PURE__ */ G(Ze, {
|
|
2152
2241
|
sensors: S,
|
|
2153
|
-
collisionDetection:
|
|
2154
|
-
onDragEnd:
|
|
2155
|
-
children: /* @__PURE__ */ G(
|
|
2242
|
+
collisionDetection: et,
|
|
2243
|
+
onDragEnd: w,
|
|
2244
|
+
children: /* @__PURE__ */ G(rt, {
|
|
2156
2245
|
items: p.map((e) => e.key),
|
|
2157
|
-
strategy:
|
|
2246
|
+
strategy: at,
|
|
2158
2247
|
children: /* @__PURE__ */ K("div", {
|
|
2159
|
-
|
|
2160
|
-
|
|
2248
|
+
"data-slot": "bento-list-tiles",
|
|
2249
|
+
className: e(kn, D && "grid-flow-dense"),
|
|
2250
|
+
children: [!s && /* @__PURE__ */ G(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__ */ G(
|
|
2255
|
+
}), p.map(({ item: e, key: t, emphasis: n }) => /* @__PURE__ */ G(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,9 +2280,9 @@ var kn = [
|
|
|
2190
2280
|
def: "Large"
|
|
2191
2281
|
}
|
|
2192
2282
|
};
|
|
2193
|
-
function
|
|
2194
|
-
let { t: a } = q(), { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } =
|
|
2195
|
-
transform:
|
|
2283
|
+
function In({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
|
|
2284
|
+
let { t: a } = q(), { 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
|
|
@@ -2200,7 +2290,7 @@ function jn({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
|
|
|
2200
2290
|
return /* @__PURE__ */ K("div", {
|
|
2201
2291
|
ref: c,
|
|
2202
2292
|
style: f,
|
|
2203
|
-
className: e("relative h-full",
|
|
2293
|
+
className: e("relative h-full", hn[n]),
|
|
2204
2294
|
children: [/* @__PURE__ */ G("div", {
|
|
2205
2295
|
className: "pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full",
|
|
2206
2296
|
children: i
|
|
@@ -2210,8 +2300,8 @@ function jn({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
|
|
|
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(
|
|
2303
|
+
children: Pn.map((t) => {
|
|
2304
|
+
let i = t === n, o = a(Fn[t].key, { defaultValue: Fn[t].def });
|
|
2215
2305
|
return /* @__PURE__ */ G("button", {
|
|
2216
2306
|
type: "button",
|
|
2217
2307
|
onClick: () => r(t),
|
|
@@ -2228,7 +2318,7 @@ function jn({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
|
|
|
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__ */ G(
|
|
2321
|
+
children: /* @__PURE__ */ G(Ee, {
|
|
2232
2322
|
size: 14,
|
|
2233
2323
|
className: "text-muted-foreground"
|
|
2234
2324
|
})
|
|
@@ -2236,16 +2326,16 @@ function jn({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
|
|
|
2236
2326
|
})]
|
|
2237
2327
|
});
|
|
2238
2328
|
}
|
|
2239
|
-
function
|
|
2329
|
+
function Ln({ route: e, label: t, subtitle: n, chip: r }) {
|
|
2240
2330
|
let { t: i } = q();
|
|
2241
|
-
return /* @__PURE__ */ K(
|
|
2331
|
+
return /* @__PURE__ */ K(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
2334
|
children: [/* @__PURE__ */ K("div", {
|
|
2245
2335
|
className: "flex items-center gap-3",
|
|
2246
2336
|
children: [/* @__PURE__ */ G("span", {
|
|
2247
2337
|
className: `bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,
|
|
2248
|
-
children: /* @__PURE__ */ G(
|
|
2338
|
+
children: /* @__PURE__ */ G(Me, { size: 20 })
|
|
2249
2339
|
}), /* @__PURE__ */ G("span", {
|
|
2250
2340
|
className: "text-[11px] uppercase tracking-wider text-muted-foreground",
|
|
2251
2341
|
children: i("forms.formActions.new", { defaultValue: "New" })
|
|
@@ -2262,9 +2352,9 @@ function Mn({ route: e, label: t, subtitle: n, chip: r }) {
|
|
|
2262
2352
|
})] })]
|
|
2263
2353
|
});
|
|
2264
2354
|
}
|
|
2265
|
-
function
|
|
2266
|
-
return /* @__PURE__ */ G(
|
|
2267
|
-
icon:
|
|
2355
|
+
function Rn({ title: e, description: t }) {
|
|
2356
|
+
return /* @__PURE__ */ G(vt, {
|
|
2357
|
+
icon: Fe,
|
|
2268
2358
|
title: e,
|
|
2269
2359
|
description: t,
|
|
2270
2360
|
align: "start",
|
|
@@ -2273,7 +2363,7 @@ function Nn({ title: e, description: t }) {
|
|
|
2273
2363
|
}
|
|
2274
2364
|
//#endregion
|
|
2275
2365
|
//#region src/bento/bento-save-bar.tsx
|
|
2276
|
-
function
|
|
2366
|
+
function zn({ title: e, badges: t, actions: n, onCancel: r, loading: i, disabled: o, dirty: s, titleMissing: c }) {
|
|
2277
2367
|
let { t: l } = q();
|
|
2278
2368
|
return /* @__PURE__ */ K("div", {
|
|
2279
2369
|
className: "bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl",
|
|
@@ -2284,7 +2374,7 @@ function Pn({ title: e, badges: t, actions: n, onCancel: r, loading: i, disabled
|
|
|
2284
2374
|
className: "truncate text-base font-semibold tracking-tight md:text-lg",
|
|
2285
2375
|
children: e
|
|
2286
2376
|
}),
|
|
2287
|
-
/* @__PURE__ */ G(
|
|
2377
|
+
/* @__PURE__ */ G(Et, {
|
|
2288
2378
|
titleMissing: c,
|
|
2289
2379
|
dirty: s
|
|
2290
2380
|
}),
|
|
@@ -2300,29 +2390,29 @@ function Pn({ title: e, badges: t, actions: n, onCancel: r, loading: i, disabled
|
|
|
2300
2390
|
size: "sm",
|
|
2301
2391
|
loading: i,
|
|
2302
2392
|
"aria-disabled": o ? "true" : void 0,
|
|
2303
|
-
children: [/* @__PURE__ */ G(
|
|
2393
|
+
children: [/* @__PURE__ */ G(Ce, { className: "size-4" }), l("forms.formActions.saveChanges")]
|
|
2304
2394
|
}), r && /* @__PURE__ */ K(a, {
|
|
2305
2395
|
type: "button",
|
|
2306
2396
|
variant: "outline",
|
|
2307
2397
|
size: "sm",
|
|
2308
2398
|
onClick: r,
|
|
2309
|
-
children: [/* @__PURE__ */ G(
|
|
2399
|
+
children: [/* @__PURE__ */ G(Be, { className: "size-4" }), l("forms.formActions.cancel")]
|
|
2310
2400
|
})] })
|
|
2311
2401
|
})]
|
|
2312
2402
|
});
|
|
2313
2403
|
}
|
|
2314
|
-
function
|
|
2404
|
+
function Bn({ children: e }) {
|
|
2315
2405
|
return /* @__PURE__ */ G("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
|
|
2413
|
+
function Vn(e) {
|
|
2414
|
+
let t = V(null);
|
|
2415
|
+
return Dt(t), /* @__PURE__ */ K(W, { children: [
|
|
2326
2416
|
/* @__PURE__ */ G("div", {
|
|
2327
2417
|
ref: t,
|
|
2328
2418
|
"aria-hidden": !0,
|
|
@@ -2334,55 +2424,52 @@ function In(e) {
|
|
|
2334
2424
|
}),
|
|
2335
2425
|
/* @__PURE__ */ G("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__ */ G(
|
|
2427
|
+
children: /* @__PURE__ */ G(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__ */ K(W, { children: [/* @__PURE__ */ G(
|
|
2346
|
-
eyebrow:
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
leading: r,
|
|
2351
|
-
title: i,
|
|
2352
|
-
subtitle: o,
|
|
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: _ } = q(), v = m ?? (!!p || !f), y = St(r, t, n) ?? e;
|
|
2435
|
+
return /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(Ct, {
|
|
2436
|
+
eyebrow: y,
|
|
2437
|
+
leading: i,
|
|
2438
|
+
title: o,
|
|
2439
|
+
subtitle: s,
|
|
2353
2440
|
trailing: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
|
|
2354
2441
|
className: "bento-fade-out flex shrink-0 items-center gap-2",
|
|
2355
|
-
children:
|
|
2442
|
+
children: u ?? /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K(a, {
|
|
2356
2443
|
type: "submit",
|
|
2357
2444
|
size: "sm",
|
|
2358
|
-
loading:
|
|
2359
|
-
"aria-disabled":
|
|
2360
|
-
children: [/* @__PURE__ */ G(
|
|
2445
|
+
loading: d,
|
|
2446
|
+
"aria-disabled": v ? "true" : void 0,
|
|
2447
|
+
children: [/* @__PURE__ */ G(Ce, { className: "size-4" }), _("forms.formActions.saveChanges")]
|
|
2361
2448
|
}), /* @__PURE__ */ K(a, {
|
|
2362
2449
|
type: "button",
|
|
2363
2450
|
variant: "outline",
|
|
2364
2451
|
size: "sm",
|
|
2365
|
-
onClick:
|
|
2366
|
-
children: [/* @__PURE__ */ G(
|
|
2452
|
+
onClick: l,
|
|
2453
|
+
children: [/* @__PURE__ */ G(Be, { className: "size-4" }), _("forms.formActions.cancel")]
|
|
2367
2454
|
})] })
|
|
2368
|
-
}),
|
|
2369
|
-
}), /* @__PURE__ */ G(
|
|
2370
|
-
title:
|
|
2371
|
-
badges:
|
|
2372
|
-
actions:
|
|
2373
|
-
onCancel:
|
|
2374
|
-
loading:
|
|
2375
|
-
disabled:
|
|
2376
|
-
dirty:
|
|
2377
|
-
titleMissing:
|
|
2455
|
+
}), c] })
|
|
2456
|
+
}), /* @__PURE__ */ G(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
|
|
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 }) {
|
|
2384
2471
|
return /* @__PURE__ */ K("section", {
|
|
2385
|
-
className: e(
|
|
2472
|
+
className: e(Un, c),
|
|
2386
2473
|
children: [/* @__PURE__ */ K("header", {
|
|
2387
2474
|
className: "flex items-start justify-between gap-3",
|
|
2388
2475
|
children: [/* @__PURE__ */ K("div", {
|
|
@@ -2412,7 +2499,7 @@ 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
|
|
2502
|
+
function Gn({ children: t, className: n, contentClassName: r }) {
|
|
2416
2503
|
return /* @__PURE__ */ G("div", {
|
|
2417
2504
|
className: e("bento-glass rounded-2xl shadow-md", n),
|
|
2418
2505
|
children: /* @__PURE__ */ G("div", {
|
|
@@ -2423,15 +2510,15 @@ 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 } = q(), n =
|
|
2520
|
+
function Yn({ inline: e = !1 } = {}) {
|
|
2521
|
+
let { t } = q(), n = ee(), r = e || n, i = U(qn, Jn, () => !1);
|
|
2435
2522
|
return /* @__PURE__ */ G("button", {
|
|
2436
2523
|
type: "button",
|
|
2437
2524
|
"aria-label": t("bento.backToTop", { defaultValue: "Back to top" }),
|
|
@@ -2441,17 +2528,17 @@ 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__ */ G(
|
|
2531
|
+
children: /* @__PURE__ */ G(he, { 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
|
|
2541
|
+
function Zn({ label: e, children: t }) {
|
|
2455
2542
|
return e ? /* @__PURE__ */ K("div", {
|
|
2456
2543
|
role: "group",
|
|
2457
2544
|
"aria-label": e,
|
|
@@ -2461,7 +2548,7 @@ function Kn({ label: e, children: t }) {
|
|
|
2461
2548
|
}), t]
|
|
2462
2549
|
}) : /* @__PURE__ */ G(W, { children: t });
|
|
2463
2550
|
}
|
|
2464
|
-
function
|
|
2551
|
+
function Qn({ index: e, active: t, icon: n, label: r, description: i, trailing: a, onActivate: o, onChoose: s }) {
|
|
2465
2552
|
return /* @__PURE__ */ K("button", {
|
|
2466
2553
|
type: "button",
|
|
2467
2554
|
id: `bento-palette-opt-${e}`,
|
|
@@ -2483,7 +2570,7 @@ function qn({ index: e, active: t, icon: n, label: r, description: i, trailing:
|
|
|
2483
2570
|
children: i
|
|
2484
2571
|
})]
|
|
2485
2572
|
}),
|
|
2486
|
-
a ?? (t && /* @__PURE__ */ G(
|
|
2573
|
+
a ?? (t && /* @__PURE__ */ G(me, {
|
|
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 } = q(), u =
|
|
2581
|
+
function $n({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c }) {
|
|
2582
|
+
let { t: l } = q(), u = Ke(), [d, f] = H(""), [p, m] = H(0), h = V(null), g = le(() => {
|
|
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
|
+
]), _ = le(() => [...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 =
|
|
2602
|
+
}))], [g, o]), v = V(c);
|
|
2516
2603
|
B(() => {
|
|
2517
2604
|
v.current = c;
|
|
2518
2605
|
}), B(() => {
|
|
2519
2606
|
v.current?.(d);
|
|
2520
2607
|
}, [d]);
|
|
2521
|
-
let [y, b] =
|
|
2608
|
+
let [y, b] = H(e);
|
|
2522
2609
|
e !== y && (b(e), e && (f(""), m(0)));
|
|
2523
2610
|
let x = _.length === 0 ? 0 : _.length - 1;
|
|
2524
2611
|
p > x && m(x), B(() => {
|
|
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);
|
|
@@ -2554,7 +2641,7 @@ function Jn({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c })
|
|
|
2554
2641
|
}),
|
|
2555
2642
|
/* @__PURE__ */ K("div", {
|
|
2556
2643
|
className: "flex items-center gap-3 border-b border-border/60 px-4",
|
|
2557
|
-
children: [/* @__PURE__ */ G(
|
|
2644
|
+
children: [/* @__PURE__ */ G(Pe, {
|
|
2558
2645
|
size: 18,
|
|
2559
2646
|
className: "shrink-0 text-muted-foreground"
|
|
2560
2647
|
}), /* @__PURE__ */ G("input", {
|
|
@@ -2581,16 +2668,16 @@ function Jn({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c })
|
|
|
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__ */ G(
|
|
2671
|
+
/* @__PURE__ */ G(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__ */ G(
|
|
2673
|
+
children: g.map(({ item: e, label: t }, n) => /* @__PURE__ */ G(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__ */ K(W, { children: [/* @__PURE__ */ G(
|
|
2680
|
+
trailing: e.bentoRoute ? void 0 : /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(Te, {
|
|
2594
2681
|
"aria-hidden": !0,
|
|
2595
2682
|
size: 15,
|
|
2596
2683
|
className: "shrink-0 text-muted-foreground/70"
|
|
@@ -2600,11 +2687,11 @@ function Jn({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c })
|
|
|
2600
2687
|
})] })
|
|
2601
2688
|
}, e.id))
|
|
2602
2689
|
}),
|
|
2603
|
-
o && /* @__PURE__ */ K(
|
|
2690
|
+
o && /* @__PURE__ */ K(Zn, {
|
|
2604
2691
|
label: o.label,
|
|
2605
2692
|
children: [o.items.map((e, t) => {
|
|
2606
2693
|
let n = g.length + t;
|
|
2607
|
-
return /* @__PURE__ */ G(
|
|
2694
|
+
return /* @__PURE__ */ G(Qn, {
|
|
2608
2695
|
index: n,
|
|
2609
2696
|
active: n === p,
|
|
2610
2697
|
icon: e.icon,
|
|
@@ -2626,11 +2713,20 @@ 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 } = q(), l =
|
|
2716
|
+
function er({ rail: t, headerStart: n, headerEnd: r, column: i = "default", dock: a, backToTop: o = !0, children: s }) {
|
|
2717
|
+
let { t: c } = q(), l = We(), u = ce(), d = V(null), f = V(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__ */ G(I.Provider, {
|
|
2720
|
+
value: !0,
|
|
2721
|
+
children: /* @__PURE__ */ G(A.Provider, {
|
|
2722
|
+
value: e,
|
|
2723
|
+
children: a
|
|
2724
|
+
})
|
|
2725
|
+
});
|
|
2631
2726
|
return /* @__PURE__ */ K("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
2731
|
/* @__PURE__ */ G("a", {
|
|
2636
2732
|
href: `#${u}`,
|
|
@@ -2646,19 +2742,28 @@ function Yn({ rail: t, headerStart: n, headerEnd: r, column: i = "default", dock
|
|
|
2646
2742
|
"aria-live": "polite",
|
|
2647
2743
|
className: "sr-only"
|
|
2648
2744
|
}),
|
|
2649
|
-
l && /* @__PURE__ */ G(
|
|
2745
|
+
l && /* @__PURE__ */ G(tr, {
|
|
2650
2746
|
main: d,
|
|
2651
2747
|
announcer: f
|
|
2652
2748
|
}),
|
|
2653
2749
|
t,
|
|
2750
|
+
g === "rail" && /* @__PURE__ */ G("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
|
+
}),
|
|
2654
2755
|
m && /* @__PURE__ */ K("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
2757
|
children: [/* @__PURE__ */ G("div", {
|
|
2657
2758
|
className: "flex min-w-0 items-center gap-3",
|
|
2658
2759
|
children: n
|
|
2659
|
-
}), /* @__PURE__ */
|
|
2760
|
+
}), /* @__PURE__ */ K("div", {
|
|
2660
2761
|
className: "flex items-center gap-2",
|
|
2661
|
-
children: r
|
|
2762
|
+
children: [r, g === "header" && /* @__PURE__ */ G("div", {
|
|
2763
|
+
"data-slot": "bento-shell-dock",
|
|
2764
|
+
className: "relative flex",
|
|
2765
|
+
children: v("header")
|
|
2766
|
+
})]
|
|
2662
2767
|
})]
|
|
2663
2768
|
}),
|
|
2664
2769
|
/* @__PURE__ */ G("main", {
|
|
@@ -2670,19 +2775,19 @@ 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__ */ G("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__ */ K(
|
|
2781
|
+
children: /* @__PURE__ */ K(I.Provider, {
|
|
2677
2782
|
value: !0,
|
|
2678
|
-
children: [o && /* @__PURE__ */ G(
|
|
2783
|
+
children: [o && /* @__PURE__ */ G(Yn, {}), g === "corner" && v("corner")]
|
|
2679
2784
|
})
|
|
2680
2785
|
})
|
|
2681
2786
|
]
|
|
2682
2787
|
});
|
|
2683
2788
|
}
|
|
2684
|
-
function
|
|
2685
|
-
let { pathname: n } =
|
|
2789
|
+
function tr({ main: e, announcer: t }) {
|
|
2790
|
+
let { pathname: n } = Ge(), r = V(n);
|
|
2686
2791
|
return B(() => {
|
|
2687
2792
|
if (r.current === n) return;
|
|
2688
2793
|
r.current = n;
|
|
@@ -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,13 +2840,13 @@ 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 = V({
|
|
2745
2850
|
onPalette: e,
|
|
2746
2851
|
onShortcuts: t
|
|
2747
2852
|
});
|
|
@@ -2752,7 +2857,7 @@ function nr({ onPalette: e, onShortcuts: t, isMac: n = Qn() }) {
|
|
|
2752
2857
|
};
|
|
2753
2858
|
}), B(() => {
|
|
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,15 +2865,15 @@ 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 } = q(), a =
|
|
2868
|
+
function cr({ onClick: t, isMac: n = rr(), className: r }) {
|
|
2869
|
+
let { t: i } = q(), a = nr.filter((e) => e.action === "palette"), o = a.find((e) => e.mod);
|
|
2765
2870
|
return /* @__PURE__ */ K("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__ */ G(
|
|
2876
|
+
/* @__PURE__ */ G(Pe, {
|
|
2772
2877
|
"aria-hidden": !0,
|
|
2773
2878
|
size: 16
|
|
2774
2879
|
}),
|
|
@@ -2779,23 +2884,23 @@ function rr({ onClick: t, isMac: n = Qn(), className: r }) {
|
|
|
2779
2884
|
o && /* @__PURE__ */ G("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
|
|
2894
|
+
function lr({ open: e, onOpenChange: t, isMac: a = rr() }) {
|
|
2790
2895
|
let { t: c } = q(), 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" }),
|
|
@@ -2824,7 +2929,7 @@ function ir({ open: e, onOpenChange: t, isMac: a = Qn() }) {
|
|
|
2824
2929
|
className: "max-w-md",
|
|
2825
2930
|
children: [/* @__PURE__ */ K(o, { children: [/* @__PURE__ */ K(i, {
|
|
2826
2931
|
className: "flex items-center gap-2",
|
|
2827
|
-
children: [/* @__PURE__ */ G(
|
|
2932
|
+
children: [/* @__PURE__ */ G(Oe, {
|
|
2828
2933
|
size: 20,
|
|
2829
2934
|
className: "bento-accent-icon"
|
|
2830
2935
|
}), c("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
|
|
@@ -2843,7 +2948,7 @@ function ir({ open: e, onOpenChange: t, isMac: a = Qn() }) {
|
|
|
2843
2948
|
children: e.label
|
|
2844
2949
|
}), /* @__PURE__ */ G("span", {
|
|
2845
2950
|
className: "flex shrink-0 items-center gap-1",
|
|
2846
|
-
children: e.combos.map((e, t) => /* @__PURE__ */ K(
|
|
2951
|
+
children: e.combos.map((e, t) => /* @__PURE__ */ K(z, { children: [t > 0 && /* @__PURE__ */ G("span", {
|
|
2847
2952
|
className: "px-0.5 text-[11px] text-muted-foreground",
|
|
2848
2953
|
children: c("bento.shortcuts.or", { defaultValue: "or" })
|
|
2849
2954
|
}), e.map((e) => /* @__PURE__ */ G("kbd", {
|
|
@@ -2859,100 +2964,123 @@ 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));
|
|
2973
|
+
}
|
|
2974
|
+
function pr(e) {
|
|
2975
|
+
return e.items.reduce((e, t) => e + (t.count && t.count > 0 ? t.count : 0), 0);
|
|
2868
2976
|
}
|
|
2869
|
-
function
|
|
2870
|
-
let { t: i } = q(), { pathname: a } =
|
|
2871
|
-
return /* @__PURE__ */ G(
|
|
2977
|
+
function mr({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
|
|
2978
|
+
let { t: i } = q(), { pathname: a } = Ge(), o = le(() => e.filter((e) => !!e.section.areaRoute), [e]), s = a === t || (n?.includes(a) ?? !1);
|
|
2979
|
+
return /* @__PURE__ */ G(te, {
|
|
2872
2980
|
delayDuration: 200,
|
|
2873
2981
|
children: /* @__PURE__ */ K("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__ */ G(
|
|
2985
|
+
/* @__PURE__ */ G(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
2992
|
o.length > 0 && /* @__PURE__ */ G("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__ */ G(
|
|
2996
|
+
o.map((e) => /* @__PURE__ */ G(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 } = q(), s = i > 0 ? o("bento.nav.count", {
|
|
3010
|
+
count: i,
|
|
3011
|
+
defaultValue: "{{count}} waiting"
|
|
3012
|
+
}) : null, c = /* @__PURE__ */ K(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__ */ K("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__ */ G(t, { size: 20 }), i > 0 && /* @__PURE__ */ G("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__ */ G("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__ */ K(O, { children: [/* @__PURE__ */ G(re, {
|
|
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__ */ G(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 } =
|
|
3042
|
+
function gr({ accountRoute: e, logoutUrl: t, organizationsRoute: n, tenantAdminRoute: r, onOpenShortcuts: i, onReplayTour: a }) {
|
|
3043
|
+
let { user: o, status: s } = P(), { t: c } = q(), l = Ke(), u = `${o.firstName ?? ""} ${o.lastName ?? ""}`.trim() || o.username || "";
|
|
2916
3044
|
return s === "loading" ? /* @__PURE__ */ G("div", {
|
|
2917
3045
|
className: "h-9 w-9 rounded-full bg-muted/40",
|
|
2918
3046
|
"aria-hidden": !0
|
|
2919
|
-
}) : /* @__PURE__ */ K(
|
|
3047
|
+
}) : /* @__PURE__ */ K(_, { children: [/* @__PURE__ */ G(F, {
|
|
2920
3048
|
asChild: !0,
|
|
2921
3049
|
children: /* @__PURE__ */ G("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__ */ G(
|
|
3053
|
+
children: /* @__PURE__ */ G(L, {
|
|
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__ */ K(
|
|
3061
|
+
}), /* @__PURE__ */ K(d, {
|
|
2934
3062
|
align: "end",
|
|
2935
3063
|
sideOffset: 10,
|
|
2936
3064
|
className: "bento-dropdown min-w-64 p-2",
|
|
2937
3065
|
children: [
|
|
2938
|
-
/* @__PURE__ */ G(
|
|
3066
|
+
/* @__PURE__ */ G(y, {
|
|
2939
3067
|
className: "p-0 font-normal",
|
|
2940
3068
|
children: /* @__PURE__ */ K("div", {
|
|
2941
3069
|
className: "flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm",
|
|
2942
3070
|
children: [/* @__PURE__ */ G("span", {
|
|
2943
3071
|
className: "rounded-full p-0.5 ring-1 ring-border/60",
|
|
2944
|
-
children: /* @__PURE__ */ G(
|
|
3072
|
+
children: /* @__PURE__ */ G(L, {
|
|
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
3079
|
}), /* @__PURE__ */ K("div", {
|
|
2952
3080
|
className: "grid flex-1 text-left text-sm leading-tight",
|
|
2953
|
-
children: [
|
|
3081
|
+
children: [u && /* @__PURE__ */ G("span", {
|
|
2954
3082
|
className: "truncate font-medium",
|
|
2955
|
-
children:
|
|
3083
|
+
children: u
|
|
2956
3084
|
}), o.email && /* @__PURE__ */ G("span", {
|
|
2957
3085
|
className: "truncate text-xs text-muted-foreground",
|
|
2958
3086
|
children: o.email
|
|
@@ -2960,47 +3088,47 @@ function ur({ accountRoute: e, logoutUrl: t, organizationsRoute: n, tenantAdminR
|
|
|
2960
3088
|
})]
|
|
2961
3089
|
})
|
|
2962
3090
|
}),
|
|
2963
|
-
/* @__PURE__ */ G(
|
|
2964
|
-
/* @__PURE__ */ K(
|
|
2965
|
-
/* @__PURE__ */ K(
|
|
2966
|
-
onSelect: () =>
|
|
3091
|
+
/* @__PURE__ */ G(f, { className: "my-1.5 bg-border/50" }),
|
|
3092
|
+
/* @__PURE__ */ K(p, { children: [
|
|
3093
|
+
/* @__PURE__ */ K(h, {
|
|
3094
|
+
onSelect: () => l(e),
|
|
2967
3095
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
2968
|
-
children: [/* @__PURE__ */ G(
|
|
3096
|
+
children: [/* @__PURE__ */ G(Re, { size: 18 }), c("nav.account")]
|
|
2969
3097
|
}),
|
|
2970
|
-
n && /* @__PURE__ */ K(
|
|
2971
|
-
onSelect: () =>
|
|
3098
|
+
n && /* @__PURE__ */ K(h, {
|
|
3099
|
+
onSelect: () => l(n),
|
|
2972
3100
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
2973
|
-
children: [/* @__PURE__ */ G(
|
|
3101
|
+
children: [/* @__PURE__ */ G(_e, { size: 18 }), c("nav.organizations", { defaultValue: "Organizations" })]
|
|
2974
3102
|
}),
|
|
2975
|
-
r && /* @__PURE__ */ K(
|
|
2976
|
-
onSelect: () =>
|
|
3103
|
+
r && /* @__PURE__ */ K(h, {
|
|
3104
|
+
onSelect: () => l(r),
|
|
2977
3105
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
2978
|
-
children: [/* @__PURE__ */ G(
|
|
3106
|
+
children: [/* @__PURE__ */ G(ve, { size: 18 }), c("nav.tenantAdmin", { defaultValue: "Tenant administration" })]
|
|
2979
3107
|
})
|
|
2980
3108
|
] }),
|
|
2981
|
-
(i || a) && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(
|
|
3109
|
+
(i || a) && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(f, { className: "my-1.5 bg-border/50" }), /* @__PURE__ */ K(p, { children: [a && /* @__PURE__ */ K(h, {
|
|
2982
3110
|
onSelect: () => a(),
|
|
2983
3111
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
2984
|
-
children: [/* @__PURE__ */ G(
|
|
2985
|
-
}), i && /* @__PURE__ */ K(
|
|
3112
|
+
children: [/* @__PURE__ */ G(Fe, { size: 18 }), c("bento.tour.replay", { defaultValue: "Take the tour" })]
|
|
3113
|
+
}), i && /* @__PURE__ */ K(h, {
|
|
2986
3114
|
onSelect: () => i(),
|
|
2987
3115
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
2988
|
-
children: [/* @__PURE__ */ G(
|
|
3116
|
+
children: [/* @__PURE__ */ G(Oe, { size: 18 }), c("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
|
|
2989
3117
|
})] })] }),
|
|
2990
|
-
/* @__PURE__ */ G(
|
|
2991
|
-
/* @__PURE__ */ K(
|
|
3118
|
+
/* @__PURE__ */ G(f, { className: "my-1.5 bg-border/50" }),
|
|
3119
|
+
/* @__PURE__ */ K(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__ */ G(
|
|
3124
|
+
children: [/* @__PURE__ */ G(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,35 +3138,35 @@ 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
|
+
oe.forEach(r, (e) => {
|
|
3144
|
+
if (!se(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 = oe.map(r, (e) => {
|
|
3149
|
+
if (!se(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__ */ G(
|
|
3153
|
+
return i ? /* @__PURE__ */ G(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
3160
|
}) : /* @__PURE__ */ G("section", {
|
|
3033
|
-
className: e(
|
|
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
|
|
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 }) {
|
|
3042
3170
|
let o = /* @__PURE__ */ G("h2", {
|
|
3043
3171
|
className: "text-xl font-semibold tracking-tight md:text-2xl",
|
|
3044
3172
|
children: t
|
|
@@ -3052,10 +3180,10 @@ function mr({ eyebrow: e, title: t, description: n, titleHref: r, children: i, g
|
|
|
3052
3180
|
className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
|
|
3053
3181
|
children: e
|
|
3054
3182
|
}),
|
|
3055
|
-
r ? /* @__PURE__ */ K(
|
|
3183
|
+
r ? /* @__PURE__ */ K(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__ */ G(
|
|
3186
|
+
children: [o, /* @__PURE__ */ G(xe, {
|
|
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
|
})]
|
|
@@ -3073,7 +3201,7 @@ 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
|
|
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 }) {
|
|
3077
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__ */ K(W, { children: [
|
|
3078
3206
|
u && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
|
|
3079
3207
|
"aria-hidden": !0,
|
|
@@ -3087,7 +3215,7 @@ function hr({ to: t, onClick: n, disabled: r = !1, disabledHint: i, icon: a, ton
|
|
|
3087
3215
|
children: [/* @__PURE__ */ G("span", {
|
|
3088
3216
|
className: `grid place-items-center ${Y(o)} text-white shadow-md ${p}`,
|
|
3089
3217
|
children: /* @__PURE__ */ G(a, { size: m })
|
|
3090
|
-
}), f && /* @__PURE__ */ G(
|
|
3218
|
+
}), f && /* @__PURE__ */ G(xe, {
|
|
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
|
})]
|
|
@@ -3115,7 +3243,7 @@ function hr({ to: t, onClick: n, disabled: r = !1, disabledHint: i, icon: a, ton
|
|
|
3115
3243
|
"aria-disabled": "true",
|
|
3116
3244
|
title: i,
|
|
3117
3245
|
children: g
|
|
3118
|
-
}) : t ? /* @__PURE__ */ G(
|
|
3246
|
+
}) : t ? /* @__PURE__ */ G(Ue, {
|
|
3119
3247
|
to: t,
|
|
3120
3248
|
className: _,
|
|
3121
3249
|
children: g
|
|
@@ -3131,8 +3259,8 @@ function hr({ to: t, onClick: n, disabled: r = !1, disabledHint: i, icon: a, ton
|
|
|
3131
3259
|
}
|
|
3132
3260
|
//#endregion
|
|
3133
3261
|
//#region src/bento/bento-version-rail.tsx
|
|
3134
|
-
function
|
|
3135
|
-
let { t: a, i18n: o } = q(), [s, c] =
|
|
3262
|
+
function Sr({ versions: t, selected: n, onSelect: r, label: i }) {
|
|
3263
|
+
let { t: a, i18n: o } = q(), [s, c] = H(0), [l, u] = H([]), d = V(/* @__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));
|
|
@@ -3187,7 +3315,7 @@ function gr({ versions: t, selected: n, onSelect: r, label: i }) {
|
|
|
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" ?
|
|
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";
|
|
3191
3319
|
return /* @__PURE__ */ K("li", {
|
|
3192
3320
|
ref: (e) => {
|
|
3193
3321
|
e ? d.current.set(i, e) : d.current.delete(i);
|
|
@@ -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 };
|