@viglet/viglet-design-system 2026.3.9 → 2026.3.11
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 +528 -44
- package/consumers.json +186 -0
- package/dist/badge-locale-CJkHDlPg.cjs +1 -0
- package/dist/badge-locale-DxDp8Q3S.js +397 -0
- package/dist/bento/bento-actions-menu.d.ts +8 -0
- package/dist/bento/bento-actions-menu.d.ts.map +1 -1
- package/dist/bento/bento-back-to-top.d.ts +9 -1
- package/dist/bento/bento-back-to-top.d.ts.map +1 -1
- package/dist/bento/bento-command-palette.d.ts +56 -9
- package/dist/bento/bento-command-palette.d.ts.map +1 -1
- package/dist/bento/bento-data-table.d.ts +81 -0
- package/dist/bento/bento-data-table.d.ts.map +1 -0
- package/dist/bento/bento-diff.d.ts +41 -0
- package/dist/bento/bento-diff.d.ts.map +1 -0
- package/dist/bento/bento-empty-state.d.ts +8 -1
- package/dist/bento/bento-empty-state.d.ts.map +1 -1
- package/dist/bento/bento-entity-shell.d.ts.map +1 -1
- package/dist/bento/bento-filter-bar.d.ts +60 -0
- package/dist/bento/bento-filter-bar.d.ts.map +1 -0
- package/dist/bento/bento-form-section.d.ts +14 -1
- package/dist/bento/bento-form-section.d.ts.map +1 -1
- package/dist/bento/bento-inline-edit.d.ts.map +1 -1
- package/dist/bento/bento-nav-rail.d.ts +13 -13
- package/dist/bento/bento-nav-rail.d.ts.map +1 -1
- package/dist/bento/bento-nav.d.ts +10 -2
- package/dist/bento/bento-nav.d.ts.map +1 -1
- package/dist/bento/bento-palette-trigger.d.ts +18 -0
- package/dist/bento/bento-palette-trigger.d.ts.map +1 -0
- package/dist/bento/bento-section-chrome.d.ts +19 -39
- package/dist/bento/bento-section-chrome.d.ts.map +1 -1
- package/dist/bento/bento-shell-shortcuts.d.ts +67 -0
- package/dist/bento/bento-shell-shortcuts.d.ts.map +1 -0
- package/dist/bento/bento-shell.d.ts +53 -0
- package/dist/bento/bento-shell.d.ts.map +1 -0
- package/dist/bento/bento-shortcuts-dialog.d.ts +9 -7
- package/dist/bento/bento-shortcuts-dialog.d.ts.map +1 -1
- package/dist/bento/bento-status-marker.d.ts +5 -2
- package/dist/bento/bento-status-marker.d.ts.map +1 -1
- package/dist/bento/bento-tile.d.ts.map +1 -1
- package/dist/bento/bento-user-menu.d.ts +9 -8
- package/dist/bento/bento-user-menu.d.ts.map +1 -1
- package/dist/bento/bento-version-rail.d.ts +31 -0
- package/dist/bento/bento-version-rail.d.ts.map +1 -0
- package/dist/bento/index.d.ts +15 -6
- package/dist/bento/index.d.ts.map +1 -1
- package/dist/bento.cjs +5 -1
- package/dist/bento.css +70 -4
- package/dist/bento.es.js +1778 -701
- package/dist/catalogue.json +5283 -0
- package/dist/components/app-footer.d.ts +7 -0
- package/dist/components/app-footer.d.ts.map +1 -1
- package/dist/components/app-switcher.d.ts.map +1 -1
- package/dist/components/backend-status.d.ts +19 -11
- package/dist/components/backend-status.d.ts.map +1 -1
- package/dist/components/badge-colorful.d.ts +13 -0
- package/dist/components/badge-colorful.d.ts.map +1 -1
- package/dist/components/badge-locale.d.ts +7 -0
- package/dist/components/badge-locale.d.ts.map +1 -1
- package/dist/components/error-boundary.d.ts +15 -13
- package/dist/components/error-boundary.d.ts.map +1 -1
- package/dist/components/language-select.d.ts +8 -0
- package/dist/components/language-select.d.ts.map +1 -1
- package/dist/components/login/login.d.ts +27 -0
- package/dist/components/login/login.d.ts.map +1 -1
- package/dist/components/mode-toggle.d.ts +9 -0
- package/dist/components/mode-toggle.d.ts.map +1 -1
- package/dist/components/nav-secondary.d.ts +7 -0
- package/dist/components/nav-secondary.d.ts.map +1 -1
- package/dist/components/router/dialog.delete.d.ts +8 -0
- package/dist/components/router/dialog.delete.d.ts.map +1 -1
- package/dist/components/router/gradient-button-link.d.ts +6 -0
- package/dist/components/router/gradient-button-link.d.ts.map +1 -1
- package/dist/components/router/index.d.ts +0 -11
- package/dist/components/router/index.d.ts.map +1 -1
- package/dist/components/router/loading-provider.d.ts +4 -0
- package/dist/components/router/loading-provider.d.ts.map +1 -1
- package/dist/components/startup-first/startup-first.d.ts +29 -0
- package/dist/components/startup-first/startup-first.d.ts.map +1 -1
- package/dist/components/ui/accordion.d.ts +17 -0
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/avatar.d.ts +14 -0
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts +6 -0
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +25 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +15 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts +27 -0
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +36 -0
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +35 -0
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +53 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/floating-formulas-bg.d.ts +8 -0
- package/dist/components/ui/floating-formulas-bg.d.ts.map +1 -1
- package/dist/components/ui/form-actions.d.ts +7 -0
- package/dist/components/ui/form-actions.d.ts.map +1 -1
- package/dist/components/ui/form-item-two-columns.d.ts +7 -0
- package/dist/components/ui/form-item-two-columns.d.ts.map +1 -1
- package/dist/components/ui/form.d.ts +25 -0
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/glass-card.d.ts +18 -14
- package/dist/components/ui/glass-card.d.ts.map +1 -1
- package/dist/components/ui/gradient-button.d.ts +15 -1
- package/dist/components/ui/gradient-button.d.ts.map +1 -1
- package/dist/components/ui/gradient-switch.d.ts +6 -0
- package/dist/components/ui/gradient-switch.d.ts.map +1 -1
- package/dist/components/ui/hover-card.d.ts +14 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/icon-picker-dialog.d.ts.map +1 -1
- package/dist/components/ui/index.d.ts +6 -4
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/input.d.ts +6 -0
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +41 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/pagination.d.ts +25 -0
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/popover.d.ts +24 -0
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/pulse-ring.d.ts +9 -11
- package/dist/components/ui/pulse-ring.d.ts.map +1 -1
- package/dist/components/ui/resizable.d.ts +11 -0
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/section-card.d.ts +9 -0
- package/dist/components/ui/section-card.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts +36 -0
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts +29 -0
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts +83 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/sonner.d.ts +16 -0
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/stepper.d.ts +8 -0
- package/dist/components/ui/stepper.d.ts.map +1 -1
- package/dist/components/ui/sticky-save-bar.d.ts +7 -0
- package/dist/components/ui/sticky-save-bar.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/table.d.ts +31 -0
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts +16 -0
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +7 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle.d.ts +4 -0
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip.d.ts +18 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/user-avatar.d.ts +2 -1
- package/dist/components/ui/user-avatar.d.ts.map +1 -1
- package/dist/components/ui/viglet-assistant.d.ts +103 -0
- package/dist/components/ui/viglet-assistant.d.ts.map +1 -0
- package/dist/components/ui/viglet-avatar.d.ts +44 -0
- package/dist/components/ui/viglet-avatar.d.ts.map +1 -0
- package/dist/contexts/breadcrumb.context.d.ts +7 -0
- package/dist/contexts/breadcrumb.context.d.ts.map +1 -1
- package/dist/contexts/user.context.d.ts +8 -0
- package/dist/contexts/user.context.d.ts.map +1 -1
- package/dist/exports.json +359 -30
- package/dist/floating-formulas-bg.cjs +1 -1
- package/dist/floating-formulas-bg.es.js +56 -55
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/use-assistant-notifications.d.ts +15 -0
- package/dist/hooks/use-assistant-notifications.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +168 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en/assistant.json.d.ts +25 -0
- package/dist/i18n/locales/en/bento.json.d.ts +48 -2
- package/dist/i18n/locales/en/common.json.d.ts +6 -1
- package/dist/i18n/locales/en/language.json.d.ts +8 -0
- package/dist/i18n/locales/pt/assistant.json.d.ts +25 -0
- package/dist/i18n/locales/pt/bento.json.d.ts +48 -2
- package/dist/i18n/locales/pt/common.json.d.ts +6 -1
- package/dist/i18n/locales/pt/language.json.d.ts +8 -0
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.es.js +572 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +2280 -733
- package/dist/lib/busy.d.ts +26 -0
- package/dist/lib/busy.d.ts.map +1 -0
- package/dist/lib/corner-slot.d.ts +15 -0
- package/dist/lib/corner-slot.d.ts.map +1 -0
- package/dist/{loading-provider-BWWhhfEn.js → loading-provider-ClDkFPuv.js} +84 -81
- package/dist/loading-provider-DGuCfsl9.cjs +1 -0
- package/dist/preset.css +7 -10
- package/dist/router.cjs +1 -1
- package/dist/router.es.js +2 -776
- package/dist/user.context-Cr3GAQ_r.js +762 -0
- package/dist/user.context-hbdvmXOn.cjs +1 -0
- package/dist/utils-Fk5jmzzb.js +41 -0
- package/dist/utils-Oagwe_oa.cjs +1 -0
- package/dist/viglet-design-system.css +1 -1
- package/dist/vite/boot-loader.d.ts +33 -2
- package/dist/vite/boot-loader.d.ts.map +1 -1
- package/dist/vite.cjs +16 -5
- package/dist/vite.es.js +27 -14
- package/docs/BENTO-AUTHORING.md +81 -11
- package/docs/reference/grounds.dc.html +9 -9
- package/package.json +16 -4
- package/scripts/consumer-entries.mjs +209 -0
- package/scripts/lib/contrast.mjs +301 -0
- package/scripts/mcp.mjs +300 -0
- package/scripts/page-lint.mjs +428 -0
- package/scripts/page-reference.mjs +54 -10
- package/dist/badge-locale-CoEEv7s5.js +0 -581
- package/dist/badge-locale-hQyWhAKe.cjs +0 -7
- package/dist/breadcrumb.context-KQut7j8U.js +0 -917
- package/dist/breadcrumb.context-Vwc3lAlf.cjs +0 -1
- package/dist/components/router/blank-slate.d.ts +0 -21
- package/dist/components/router/blank-slate.d.ts.map +0 -1
- package/dist/components/router/grid.list.d.ts +0 -39
- package/dist/components/router/grid.list.d.ts.map +0 -1
- package/dist/components/router/internal.sidebar.d.ts +0 -61
- package/dist/components/router/internal.sidebar.d.ts.map +0 -1
- package/dist/components/router/nav-main.d.ts +0 -25
- package/dist/components/router/nav-main.d.ts.map +0 -1
- package/dist/components/router/nav-user.d.ts +0 -24
- package/dist/components/router/nav-user.d.ts.map +0 -1
- package/dist/components/router/page-content.d.ts +0 -12
- package/dist/components/router/page-content.d.ts.map +0 -1
- package/dist/components/router/page-header.d.ts +0 -23
- package/dist/components/router/page-header.d.ts.map +0 -1
- package/dist/components/router/page.d.ts +0 -22
- package/dist/components/router/page.d.ts.map +0 -1
- package/dist/components/router/sticky.page.header.d.ts +0 -85
- package/dist/components/router/sticky.page.header.d.ts.map +0 -1
- package/dist/components/router/sub.page.d.ts +0 -50
- package/dist/components/router/sub.page.d.ts.map +0 -1
- package/dist/components/router/sub.page.header.d.ts +0 -37
- package/dist/components/router/sub.page.header.d.ts.map +0 -1
- package/dist/i18n-DD3rQOWi.js +0 -426
- package/dist/i18n-DrBq-qJJ.cjs +0 -1
- package/dist/lib/react-markers.d.ts +0 -17
- package/dist/lib/react-markers.d.ts.map +0 -1
- package/dist/loading-provider-CmeMqLGk.cjs +0 -1
- package/dist/user.context-B9vIBzY5.cjs +0 -1
- package/dist/user.context-D1PxP4D4.js +0 -512
package/dist/bento.es.js
CHANGED
|
@@ -1,49 +1,57 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import { i as T,
|
|
5
|
-
import {
|
|
6
|
-
import { Fragment as F,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
2
|
+
import { t as e } from "./utils-Fk5jmzzb.js";
|
|
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-DxDp8Q3S.js";
|
|
4
|
+
import { A as c, C as l, D as u, E as d, L as f, M as p, O as m, R as h, S as g, T as _, _ as v, a as y, c as b, d as x, f as S, h as C, i as w, j as T, l as E, n as D, p as O, r as k, u as A, w as j, x as M, z as N } from "./user.context-Cr3GAQ_r.js";
|
|
5
|
+
import { r as ee, t as te } from "./loading-provider-ClDkFPuv.js";
|
|
6
|
+
import { Children as P, Fragment as ne, isValidElement as re, useEffect as F, useId as I, useMemo as L, useRef as R, useState as z, useSyncExternalStore as ie } from "react";
|
|
7
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
8
|
+
import { useTranslation as U } from "react-i18next";
|
|
9
|
+
import { IconAdjustmentsHorizontal as ae, IconAlertTriangle as oe, IconArrowBackUp as W, IconArrowDown as se, IconArrowLeft as ce, IconArrowRight as le, IconArrowUp as ue, IconArrowsSort as de, IconBuildingCommunity as fe, IconBuildingSkyscraper as G, IconChevronDown as pe, IconChevronRight as K, IconColumns3 as me, IconDeviceFloppy as he, IconDotsVertical as q, IconExternalLink as J, IconGripVertical as ge, IconHome as _e, IconKeyboard as Y, IconLayoutGrid as ve, IconLogout as ye, IconPalette as be, IconPlus as xe, IconRobot as X, IconSearch as Se, IconSparkles as Ce, IconTrash as we, IconUser as Te, IconUserCircle as Ee, IconUsers as De, IconX as Oe } from "@tabler/icons-react";
|
|
10
|
+
import { Icon as ke } from "@iconify/react";
|
|
11
|
+
import { Link as Z, useInRouterContext as Ae, useLocation as je, useNavigate as Me } from "react-router-dom";
|
|
12
|
+
import { createCoreRowModel as Ne, createSortedRowModel as Pe, rowSortingFeature as Fe, useTable as Ie } from "@tanstack/react-table";
|
|
13
|
+
import { DndContext as Le, KeyboardSensor as Re, PointerSensor as ze, closestCenter as Be, useSensor as Ve, useSensors as He } from "@dnd-kit/core";
|
|
14
|
+
import { SortableContext as Ue, arrayMove as We, rectSortingStrategy as Ge, useSortable as Ke } from "@dnd-kit/sortable";
|
|
15
|
+
import { CSS as qe } from "@dnd-kit/utilities";
|
|
14
16
|
//#region src/bento/bento-actions-menu.tsx
|
|
15
|
-
var
|
|
17
|
+
var Je = {
|
|
16
18
|
default: "",
|
|
17
19
|
destructive: "bento-item-danger"
|
|
18
|
-
};
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
}, Ye = /* @__PURE__ */ new Set();
|
|
21
|
+
function Xe(e) {
|
|
22
|
+
process.env.NODE_ENV === "production" || Ye.has(e) || (Ye.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.`));
|
|
23
|
+
}
|
|
24
|
+
function Ze({ actions: e, triggerLabel: t }) {
|
|
25
|
+
let { t: n } = U();
|
|
26
|
+
if (e.length === 0) return null;
|
|
27
|
+
for (let t of e) t.id || Xe(t.label);
|
|
28
|
+
return /* @__PURE__ */ H(l, { children: [/* @__PURE__ */ V(f, {
|
|
22
29
|
asChild: !0,
|
|
23
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ V("button", {
|
|
24
31
|
type: "button",
|
|
25
|
-
"aria-label": t ??
|
|
32
|
+
"aria-label": t ?? n("forms.formActions.moreActions", { defaultValue: "More actions" }),
|
|
26
33
|
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",
|
|
27
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ V(q, { size: 18 })
|
|
28
35
|
})
|
|
29
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ V(_, {
|
|
30
37
|
align: "end",
|
|
31
38
|
sideOffset: 8,
|
|
32
39
|
className: "bento-dropdown min-w-44 p-1.5",
|
|
33
40
|
children: e.map((e) => {
|
|
34
|
-
let t = e.icon, n =
|
|
35
|
-
return /* @__PURE__ */
|
|
41
|
+
let t = e.icon, n = Je[e.tone ?? "default"];
|
|
42
|
+
return /* @__PURE__ */ H(u, {
|
|
43
|
+
"data-action-id": e.id,
|
|
36
44
|
onSelect: e.onSelect,
|
|
37
45
|
disabled: e.disabled,
|
|
38
46
|
className: `bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${n}`,
|
|
39
|
-
children: [/* @__PURE__ */
|
|
40
|
-
}, e.label);
|
|
47
|
+
children: [/* @__PURE__ */ V(t, { size: 16 }), e.label]
|
|
48
|
+
}, e.id ?? e.label);
|
|
41
49
|
})
|
|
42
50
|
})] });
|
|
43
51
|
}
|
|
44
52
|
//#endregion
|
|
45
53
|
//#region src/bento/bento-tones.ts
|
|
46
|
-
var
|
|
54
|
+
var Qe = {
|
|
47
55
|
blue: "bento-tone-blue",
|
|
48
56
|
indigo: "bento-tone-indigo",
|
|
49
57
|
violet: "bento-tone-violet",
|
|
@@ -51,102 +59,437 @@ var Y = {
|
|
|
51
59
|
amber: "bento-tone-amber",
|
|
52
60
|
rose: "bento-tone-rose",
|
|
53
61
|
slate: "bento-tone-slate"
|
|
54
|
-
},
|
|
55
|
-
function
|
|
56
|
-
return `bento-chip ${
|
|
62
|
+
}, $e = Object.keys(Qe);
|
|
63
|
+
function Q(e) {
|
|
64
|
+
return `bento-chip ${Qe[e] ?? Qe.slate}`;
|
|
57
65
|
}
|
|
58
66
|
//#endregion
|
|
59
67
|
//#region src/bento/bento-count-tile.tsx
|
|
60
|
-
function
|
|
61
|
-
let o = /* @__PURE__ */
|
|
62
|
-
className: `grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
}), /* @__PURE__ */
|
|
68
|
+
function et({ to: e, icon: t, tone: n, label: r, count: i, span: a }) {
|
|
69
|
+
let o = /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("span", {
|
|
70
|
+
className: `grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${Q(n)}`,
|
|
71
|
+
children: /* @__PURE__ */ V(t, { size: 18 })
|
|
72
|
+
}), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("div", {
|
|
65
73
|
className: "text-3xl font-semibold tabular-nums tracking-tight",
|
|
66
74
|
children: i
|
|
67
|
-
}), /* @__PURE__ */
|
|
75
|
+
}), /* @__PURE__ */ V("div", {
|
|
68
76
|
className: "text-[11px] uppercase tracking-wider text-muted-foreground",
|
|
69
77
|
children: r
|
|
70
78
|
})] })] }), s = `bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${a}${e ? " bento-tile-clickable" : ""}`;
|
|
71
|
-
return e ? /* @__PURE__ */
|
|
79
|
+
return e ? /* @__PURE__ */ V(Z, {
|
|
72
80
|
to: e,
|
|
73
81
|
className: s,
|
|
74
82
|
children: o
|
|
75
|
-
}) : /* @__PURE__ */
|
|
83
|
+
}) : /* @__PURE__ */ V("div", {
|
|
76
84
|
className: s,
|
|
77
85
|
children: o
|
|
78
86
|
});
|
|
79
87
|
}
|
|
80
88
|
//#endregion
|
|
89
|
+
//#region src/bento/bento-data-table.tsx
|
|
90
|
+
var tt = 6, nt = {
|
|
91
|
+
rowSortingFeature: Fe,
|
|
92
|
+
coreRowModel: Ne(),
|
|
93
|
+
sortedRowModel: Pe()
|
|
94
|
+
};
|
|
95
|
+
function rt({ rows: t, getRowId: n, columns: r, label: i, getRowLabel: a, rowActions: o, selectionActions: s, onSelectionChange: c, selectionScope: u, layout: d, onLayoutChange: p, onRowOpen: m, rowHeight: g = 44, height: v = 480, empty: y }) {
|
|
96
|
+
let { t: b } = U(), [x, S] = z([]), [C, w] = z({ hidden: [] }), [T, E] = z(/* @__PURE__ */ new Set()), [D, O] = z(null), [k, A] = z(u);
|
|
97
|
+
k !== u && (A(u), E(/* @__PURE__ */ new Set()), O(null));
|
|
98
|
+
let M = R(u);
|
|
99
|
+
F(() => {
|
|
100
|
+
M.current !== u && (M.current = u, c?.([]));
|
|
101
|
+
}, [u, c]);
|
|
102
|
+
let [ee, te] = z(0), [P, ne] = z(0), re = R(null), I = R(/* @__PURE__ */ new Map()), ie = R(!1), B = (s?.length ?? 0) > 0, ae = (e) => a?.(e) ?? n(e), oe = L(() => r.map((e) => ({
|
|
103
|
+
id: e.id,
|
|
104
|
+
accessorFn: (t) => e.sortValue?.(t) ?? null,
|
|
105
|
+
enableSorting: e.sortValue !== void 0
|
|
106
|
+
})), [r]), W = Ie({
|
|
107
|
+
features: nt,
|
|
108
|
+
data: t,
|
|
109
|
+
columns: oe,
|
|
110
|
+
state: { sorting: x },
|
|
111
|
+
onSortingChange: S
|
|
112
|
+
}).getRowModel().rows.map((e) => e.original), ce = d ?? C, le = r.filter((e) => e.hideable === !1 || !ce.hidden.includes(e.id)), fe = [
|
|
113
|
+
B ? "2.75rem" : null,
|
|
114
|
+
...le.map((e) => e.width ?? "minmax(8rem, 1fr)"),
|
|
115
|
+
o?.length ? "3.25rem" : null
|
|
116
|
+
].filter(Boolean).join(" "), G = W.length, pe = Math.max(1, Math.floor(v / g)), K = Math.max(0, Math.floor(P / g) - tt), he = Math.min(G, Math.ceil((P + v) / g) + tt), q = Math.min(ee, Math.max(0, G - 1));
|
|
117
|
+
F(() => {
|
|
118
|
+
ie.current && (ie.current = !1, I.current.get(q)?.focus());
|
|
119
|
+
}, [q, K]);
|
|
120
|
+
function J(e) {
|
|
121
|
+
E(e), c?.([...e]);
|
|
122
|
+
}
|
|
123
|
+
function ge(e, t) {
|
|
124
|
+
let [r, i] = e <= t ? [e, t] : [t, e];
|
|
125
|
+
J(new Set(W.slice(r, i + 1).map(n)));
|
|
126
|
+
}
|
|
127
|
+
function _e(e) {
|
|
128
|
+
let t = n(W[e]), r = new Set(T);
|
|
129
|
+
r.has(t) ? r.delete(t) : r.add(t), J(r), O(e);
|
|
130
|
+
}
|
|
131
|
+
function Y(e, t) {
|
|
132
|
+
let n = Math.max(0, Math.min(G - 1, e));
|
|
133
|
+
if (t && B) {
|
|
134
|
+
let e = D ?? q;
|
|
135
|
+
O(e), ge(e, n);
|
|
136
|
+
}
|
|
137
|
+
let r = re.current, i = n * g;
|
|
138
|
+
if (r) {
|
|
139
|
+
let e = r.scrollTop;
|
|
140
|
+
i < e ? e = i : i + g > e + v && (e = i + g - v), e !== r.scrollTop && (r.scrollTop = e, ne(e));
|
|
141
|
+
}
|
|
142
|
+
ie.current = !0, te(n);
|
|
143
|
+
}
|
|
144
|
+
function ve(e, t) {
|
|
145
|
+
if (e.target !== e.currentTarget) return;
|
|
146
|
+
let r = e.shiftKey;
|
|
147
|
+
switch (e.key) {
|
|
148
|
+
case "ArrowDown":
|
|
149
|
+
Y(t + 1, r);
|
|
150
|
+
break;
|
|
151
|
+
case "ArrowUp":
|
|
152
|
+
Y(t - 1, r);
|
|
153
|
+
break;
|
|
154
|
+
case "PageDown":
|
|
155
|
+
Y(t + pe, r);
|
|
156
|
+
break;
|
|
157
|
+
case "PageUp":
|
|
158
|
+
Y(t - pe, r);
|
|
159
|
+
break;
|
|
160
|
+
case "Home":
|
|
161
|
+
Y(0, r);
|
|
162
|
+
break;
|
|
163
|
+
case "End":
|
|
164
|
+
Y(G - 1, r);
|
|
165
|
+
break;
|
|
166
|
+
case " ":
|
|
167
|
+
if (!B) return;
|
|
168
|
+
_e(t);
|
|
169
|
+
break;
|
|
170
|
+
case "Enter":
|
|
171
|
+
if (!m) return;
|
|
172
|
+
m(W[t]);
|
|
173
|
+
break;
|
|
174
|
+
case "Escape":
|
|
175
|
+
if (!B || T.size === 0) return;
|
|
176
|
+
J(/* @__PURE__ */ new Set()), O(null);
|
|
177
|
+
break;
|
|
178
|
+
case "a":
|
|
179
|
+
case "A":
|
|
180
|
+
if (!B || !(e.ctrlKey || e.metaKey)) return;
|
|
181
|
+
J(new Set(W.map(n)));
|
|
182
|
+
break;
|
|
183
|
+
default: return;
|
|
184
|
+
}
|
|
185
|
+
e.preventDefault();
|
|
186
|
+
}
|
|
187
|
+
function ye(e, t) {
|
|
188
|
+
if (!e.target.closest("button, a, input, [role='checkbox']") && (te(t), B)) {
|
|
189
|
+
if (e.shiftKey) {
|
|
190
|
+
let e = D ?? q;
|
|
191
|
+
O(e), ge(e, t);
|
|
192
|
+
} else e.metaKey || e.ctrlKey ? _e(t) : (J(/* @__PURE__ */ new Set([n(W[t])])), O(t));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function be(e) {
|
|
196
|
+
let t = x.find((t) => t.id === e);
|
|
197
|
+
t ? t.desc ? S([]) : S([{
|
|
198
|
+
id: e,
|
|
199
|
+
desc: !0
|
|
200
|
+
}]) : S([{
|
|
201
|
+
id: e,
|
|
202
|
+
desc: !1
|
|
203
|
+
}]);
|
|
204
|
+
}
|
|
205
|
+
function xe(e, t) {
|
|
206
|
+
let n = { hidden: t ? [...ce.hidden, e] : ce.hidden.filter((t) => t !== e) };
|
|
207
|
+
d === void 0 && w(n), p?.(n);
|
|
208
|
+
}
|
|
209
|
+
let X = W.filter((e) => T.has(n(e))), Se = G > 0 && X.length === G, Ce = r.filter((e) => e.hideable !== !1);
|
|
210
|
+
return /* @__PURE__ */ H("div", {
|
|
211
|
+
"data-slot": "bento-data-table",
|
|
212
|
+
className: "bento-glass overflow-hidden rounded-2xl",
|
|
213
|
+
children: [/* @__PURE__ */ H("div", {
|
|
214
|
+
className: "flex min-h-12 flex-wrap items-center gap-2 border-b border-border/50 px-3 py-2",
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ V("span", {
|
|
217
|
+
"aria-live": "polite",
|
|
218
|
+
className: "text-sm font-medium",
|
|
219
|
+
children: X.length > 0 ? b("bento.table.selected", {
|
|
220
|
+
defaultValue: "{{count}} selected",
|
|
221
|
+
count: X.length
|
|
222
|
+
}) : ""
|
|
223
|
+
}),
|
|
224
|
+
X.length > 0 && /* @__PURE__ */ H("div", {
|
|
225
|
+
role: "toolbar",
|
|
226
|
+
"aria-label": b("bento.table.selectionActions", { defaultValue: "Actions on the selection" }),
|
|
227
|
+
className: "flex flex-wrap items-center gap-2",
|
|
228
|
+
children: [s?.map((t) => {
|
|
229
|
+
let n = t.icon;
|
|
230
|
+
return /* @__PURE__ */ H(N, {
|
|
231
|
+
variant: "outline",
|
|
232
|
+
size: "sm",
|
|
233
|
+
className: e("gap-1.5", t.tone === "destructive" && "bento-item-danger"),
|
|
234
|
+
onClick: () => t.onSelect(X),
|
|
235
|
+
children: [/* @__PURE__ */ V(n, { size: 16 }), t.label]
|
|
236
|
+
}, t.id);
|
|
237
|
+
}), /* @__PURE__ */ V(N, {
|
|
238
|
+
variant: "ghost",
|
|
239
|
+
size: "sm",
|
|
240
|
+
onClick: () => J(/* @__PURE__ */ new Set()),
|
|
241
|
+
children: b("bento.table.clearSelection", { defaultValue: "Clear selection" })
|
|
242
|
+
})]
|
|
243
|
+
}),
|
|
244
|
+
Ce.length > 0 && /* @__PURE__ */ H(l, { children: [/* @__PURE__ */ V(f, {
|
|
245
|
+
asChild: !0,
|
|
246
|
+
children: /* @__PURE__ */ H(N, {
|
|
247
|
+
variant: "ghost",
|
|
248
|
+
size: "sm",
|
|
249
|
+
className: "ml-auto gap-1.5",
|
|
250
|
+
children: [/* @__PURE__ */ V(me, {
|
|
251
|
+
size: 16,
|
|
252
|
+
"aria-hidden": "true"
|
|
253
|
+
}), b("bento.table.columns", { defaultValue: "Columns" })]
|
|
254
|
+
})
|
|
255
|
+
}), /* @__PURE__ */ V(_, {
|
|
256
|
+
align: "end",
|
|
257
|
+
className: "bento-dropdown min-w-44 p-1.5",
|
|
258
|
+
children: Ce.map((e) => /* @__PURE__ */ V(j, {
|
|
259
|
+
checked: !ce.hidden.includes(e.id),
|
|
260
|
+
onCheckedChange: (t) => xe(e.id, t !== !0),
|
|
261
|
+
onSelect: (e) => e.preventDefault(),
|
|
262
|
+
children: e.header
|
|
263
|
+
}, e.id))
|
|
264
|
+
})] })
|
|
265
|
+
]
|
|
266
|
+
}), /* @__PURE__ */ H("div", {
|
|
267
|
+
role: "grid",
|
|
268
|
+
"aria-label": i,
|
|
269
|
+
"aria-rowcount": G + 1,
|
|
270
|
+
"aria-colcount": le.length + +!!B + +!!o?.length,
|
|
271
|
+
"aria-multiselectable": B ? "true" : void 0,
|
|
272
|
+
children: [/* @__PURE__ */ V("div", {
|
|
273
|
+
role: "rowgroup",
|
|
274
|
+
children: /* @__PURE__ */ H("div", {
|
|
275
|
+
role: "row",
|
|
276
|
+
"aria-rowindex": 1,
|
|
277
|
+
className: "grid items-center border-b border-border/50 px-1 text-xs font-medium text-muted-foreground",
|
|
278
|
+
style: {
|
|
279
|
+
gridTemplateColumns: fe,
|
|
280
|
+
minHeight: g
|
|
281
|
+
},
|
|
282
|
+
children: [
|
|
283
|
+
B && /* @__PURE__ */ V("div", {
|
|
284
|
+
role: "columnheader",
|
|
285
|
+
className: "grid place-items-center",
|
|
286
|
+
children: /* @__PURE__ */ V(h, {
|
|
287
|
+
"aria-label": b("bento.table.selectAll", { defaultValue: "Select all rows" }),
|
|
288
|
+
checked: Se ? !0 : X.length > 0 && "indeterminate",
|
|
289
|
+
onCheckedChange: () => J(Se ? /* @__PURE__ */ new Set() : new Set(W.map(n)))
|
|
290
|
+
})
|
|
291
|
+
}),
|
|
292
|
+
le.map((e) => {
|
|
293
|
+
let t = x.find((t) => t.id === e.id), n = t ? t.desc ? "descending" : "ascending" : "none";
|
|
294
|
+
return /* @__PURE__ */ V("div", {
|
|
295
|
+
role: "columnheader",
|
|
296
|
+
"aria-sort": e.sortValue ? n : void 0,
|
|
297
|
+
className: "min-w-0 px-2",
|
|
298
|
+
children: e.sortValue ? /* @__PURE__ */ H("button", {
|
|
299
|
+
type: "button",
|
|
300
|
+
onClick: () => be(e.id),
|
|
301
|
+
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",
|
|
302
|
+
children: [
|
|
303
|
+
/* @__PURE__ */ V("span", {
|
|
304
|
+
className: "truncate",
|
|
305
|
+
children: e.header
|
|
306
|
+
}),
|
|
307
|
+
n === "ascending" && /* @__PURE__ */ V(ue, {
|
|
308
|
+
size: 14,
|
|
309
|
+
"aria-hidden": "true"
|
|
310
|
+
}),
|
|
311
|
+
n === "descending" && /* @__PURE__ */ V(se, {
|
|
312
|
+
size: 14,
|
|
313
|
+
"aria-hidden": "true"
|
|
314
|
+
}),
|
|
315
|
+
n === "none" && /* @__PURE__ */ V(de, {
|
|
316
|
+
size: 14,
|
|
317
|
+
"aria-hidden": "true",
|
|
318
|
+
className: "opacity-40"
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
}) : /* @__PURE__ */ V("span", {
|
|
322
|
+
className: "block truncate py-1",
|
|
323
|
+
children: e.header
|
|
324
|
+
})
|
|
325
|
+
}, e.id);
|
|
326
|
+
}),
|
|
327
|
+
o?.length ? /* @__PURE__ */ V("div", {
|
|
328
|
+
role: "columnheader",
|
|
329
|
+
className: "px-2",
|
|
330
|
+
children: /* @__PURE__ */ V("span", {
|
|
331
|
+
className: "sr-only",
|
|
332
|
+
children: b("bento.table.actions", { defaultValue: "Actions" })
|
|
333
|
+
})
|
|
334
|
+
}) : null
|
|
335
|
+
]
|
|
336
|
+
})
|
|
337
|
+
}), G === 0 ? /* @__PURE__ */ V("div", {
|
|
338
|
+
role: "rowgroup",
|
|
339
|
+
children: /* @__PURE__ */ V("div", {
|
|
340
|
+
role: "row",
|
|
341
|
+
"aria-rowindex": 2,
|
|
342
|
+
children: /* @__PURE__ */ V("div", {
|
|
343
|
+
role: "gridcell",
|
|
344
|
+
className: "px-4 py-10 text-center text-sm text-muted-foreground",
|
|
345
|
+
children: y ?? b("bento.table.empty", { defaultValue: "Nothing to show" })
|
|
346
|
+
})
|
|
347
|
+
})
|
|
348
|
+
}) : /* @__PURE__ */ V("div", {
|
|
349
|
+
role: "rowgroup",
|
|
350
|
+
ref: re,
|
|
351
|
+
onScroll: (e) => ne(e.currentTarget.scrollTop),
|
|
352
|
+
className: "relative overflow-y-auto",
|
|
353
|
+
style: { height: v },
|
|
354
|
+
children: /* @__PURE__ */ V("div", {
|
|
355
|
+
style: { height: G * g },
|
|
356
|
+
className: "relative",
|
|
357
|
+
children: W.slice(K, he).map((t, r) => {
|
|
358
|
+
let i = K + r, a = n(t), s = T.has(a), c = ae(t);
|
|
359
|
+
return /* @__PURE__ */ H("div", {
|
|
360
|
+
ref: (e) => {
|
|
361
|
+
e ? I.current.set(i, e) : I.current.delete(i);
|
|
362
|
+
},
|
|
363
|
+
role: "row",
|
|
364
|
+
"aria-rowindex": i + 2,
|
|
365
|
+
"aria-selected": B ? s ? "true" : "false" : void 0,
|
|
366
|
+
tabIndex: i === q ? 0 : -1,
|
|
367
|
+
onKeyDown: (e) => ve(e, i),
|
|
368
|
+
onClick: (e) => ye(e, i),
|
|
369
|
+
onDoubleClick: () => m?.(t),
|
|
370
|
+
onFocus: (e) => {
|
|
371
|
+
e.target === e.currentTarget && te(i);
|
|
372
|
+
},
|
|
373
|
+
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"),
|
|
374
|
+
style: {
|
|
375
|
+
top: i * g,
|
|
376
|
+
height: g,
|
|
377
|
+
gridTemplateColumns: fe
|
|
378
|
+
},
|
|
379
|
+
children: [
|
|
380
|
+
B && /* @__PURE__ */ V("div", {
|
|
381
|
+
role: "gridcell",
|
|
382
|
+
className: "grid place-items-center",
|
|
383
|
+
children: /* @__PURE__ */ V(h, {
|
|
384
|
+
tabIndex: -1,
|
|
385
|
+
"aria-label": b("bento.table.selectRow", {
|
|
386
|
+
defaultValue: "Select {{row}}",
|
|
387
|
+
row: c
|
|
388
|
+
}),
|
|
389
|
+
checked: s,
|
|
390
|
+
onCheckedChange: () => _e(i)
|
|
391
|
+
})
|
|
392
|
+
}),
|
|
393
|
+
le.map((e) => /* @__PURE__ */ V("div", {
|
|
394
|
+
role: "gridcell",
|
|
395
|
+
className: "min-w-0 truncate px-2",
|
|
396
|
+
children: e.cell(t)
|
|
397
|
+
}, e.id)),
|
|
398
|
+
o?.length ? /* @__PURE__ */ V("div", {
|
|
399
|
+
role: "gridcell",
|
|
400
|
+
className: "grid place-items-center",
|
|
401
|
+
children: /* @__PURE__ */ V(Ze, {
|
|
402
|
+
triggerLabel: b("bento.table.rowActions", {
|
|
403
|
+
defaultValue: "Actions for {{row}}",
|
|
404
|
+
row: c
|
|
405
|
+
}),
|
|
406
|
+
actions: o.map((e) => ({
|
|
407
|
+
id: e.id,
|
|
408
|
+
label: e.label,
|
|
409
|
+
icon: e.icon,
|
|
410
|
+
tone: e.tone,
|
|
411
|
+
onSelect: () => e.onSelect([t])
|
|
412
|
+
}))
|
|
413
|
+
})
|
|
414
|
+
}) : null
|
|
415
|
+
]
|
|
416
|
+
}, a);
|
|
417
|
+
})
|
|
418
|
+
})
|
|
419
|
+
})]
|
|
420
|
+
})]
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
//#endregion
|
|
81
424
|
//#region src/bento/bento-empty-state.tsx
|
|
82
|
-
function
|
|
83
|
-
let
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
className:
|
|
425
|
+
function it({ icon: t = Ce, tone: n = "indigo", title: r, description: i, action: a, align: o = "center", titleLevel: s = 2, className: c }) {
|
|
426
|
+
let l = Q(n), u = o === "center", d = `h${s}`;
|
|
427
|
+
return /* @__PURE__ */ H("div", {
|
|
428
|
+
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),
|
|
86
429
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
className: `grid h-12 w-12 place-items-center rounded-2xl ${
|
|
89
|
-
children: /* @__PURE__ */
|
|
90
|
-
}),
|
|
91
|
-
/* @__PURE__ */ I("div", {
|
|
92
|
-
className: "text-lg font-semibold tracking-tight",
|
|
93
|
-
children: n
|
|
430
|
+
/* @__PURE__ */ V("span", {
|
|
431
|
+
className: `grid h-12 w-12 place-items-center rounded-2xl ${l} text-white shadow-md`,
|
|
432
|
+
children: /* @__PURE__ */ V(t, { size: 24 })
|
|
94
433
|
}),
|
|
95
|
-
|
|
96
|
-
className:
|
|
434
|
+
/* @__PURE__ */ V(d, {
|
|
435
|
+
className: "m-0 text-lg font-semibold tracking-tight",
|
|
97
436
|
children: r
|
|
98
437
|
}),
|
|
99
|
-
i && /* @__PURE__ */
|
|
100
|
-
className:
|
|
438
|
+
i && /* @__PURE__ */ V("p", {
|
|
439
|
+
className: e("max-w-md text-sm text-muted-foreground", u && "mx-auto"),
|
|
101
440
|
children: i
|
|
441
|
+
}),
|
|
442
|
+
a && /* @__PURE__ */ V("div", {
|
|
443
|
+
className: e("mt-1", u && "mx-auto"),
|
|
444
|
+
children: a
|
|
102
445
|
})
|
|
103
446
|
]
|
|
104
447
|
});
|
|
105
448
|
}
|
|
106
449
|
//#endregion
|
|
107
450
|
//#region src/bento/bento-hero.tsx
|
|
108
|
-
function
|
|
109
|
-
return /* @__PURE__ */
|
|
451
|
+
function at({ to: e, children: t }) {
|
|
452
|
+
return /* @__PURE__ */ H(Z, {
|
|
110
453
|
to: e,
|
|
111
454
|
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ V(ce, {
|
|
113
456
|
size: 14,
|
|
114
457
|
"aria-hidden": !0
|
|
115
458
|
}), t]
|
|
116
459
|
});
|
|
117
460
|
}
|
|
118
|
-
function
|
|
119
|
-
let s = e ?? (t == null ? null : /* @__PURE__ */
|
|
461
|
+
function ot({ eyebrow: e, backTo: t, backLabel: n, title: r, subtitle: i, leading: a, trailing: o }) {
|
|
462
|
+
let s = e ?? (t == null ? null : /* @__PURE__ */ V(at, {
|
|
120
463
|
to: t,
|
|
121
464
|
children: n
|
|
122
465
|
}));
|
|
123
|
-
return /* @__PURE__ */
|
|
466
|
+
return /* @__PURE__ */ V("header", {
|
|
124
467
|
className: "bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10",
|
|
125
|
-
children: /* @__PURE__ */
|
|
468
|
+
children: /* @__PURE__ */ H("div", {
|
|
126
469
|
className: "flex w-full items-start gap-4",
|
|
127
470
|
children: [
|
|
128
|
-
a && /* @__PURE__ */
|
|
471
|
+
a && /* @__PURE__ */ V("div", {
|
|
129
472
|
className: "shrink-0",
|
|
130
473
|
children: a
|
|
131
474
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ H("div", {
|
|
133
476
|
className: "flex flex-1 flex-col gap-1",
|
|
134
477
|
children: [
|
|
135
|
-
s && /* @__PURE__ */
|
|
478
|
+
s && /* @__PURE__ */ V("span", {
|
|
136
479
|
className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
|
|
137
480
|
children: s
|
|
138
481
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ V("h1", {
|
|
140
483
|
className: "text-3xl font-semibold tracking-tight md:text-4xl",
|
|
141
484
|
children: r
|
|
142
485
|
}),
|
|
143
|
-
i && /* @__PURE__ */
|
|
486
|
+
i && /* @__PURE__ */ V("p", {
|
|
144
487
|
className: "max-w-2xl text-sm text-muted-foreground",
|
|
145
488
|
children: i
|
|
146
489
|
})
|
|
147
490
|
]
|
|
148
491
|
}),
|
|
149
|
-
o && /* @__PURE__ */
|
|
492
|
+
o && /* @__PURE__ */ V("div", {
|
|
150
493
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
151
494
|
children: o
|
|
152
495
|
})
|
|
@@ -156,31 +499,31 @@ function Q({ eyebrow: e, backTo: t, backLabel: n, title: r, subtitle: i, leading
|
|
|
156
499
|
}
|
|
157
500
|
//#endregion
|
|
158
501
|
//#region src/bento/bento-hero-icon-picker.tsx
|
|
159
|
-
function
|
|
160
|
-
let { t: c } =
|
|
161
|
-
return s ? /* @__PURE__ */
|
|
162
|
-
className: `grid h-12 w-12 place-items-center rounded-2xl ${
|
|
163
|
-
children: e ? /* @__PURE__ */
|
|
502
|
+
function st({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title: a, description: o, readOnly: s = !1 }) {
|
|
503
|
+
let { t: c } = U(), [l, u] = z(!1);
|
|
504
|
+
return s ? /* @__PURE__ */ V("span", {
|
|
505
|
+
className: `grid h-12 w-12 place-items-center rounded-2xl ${Q(i)} text-white shadow-md`,
|
|
506
|
+
children: e ? /* @__PURE__ */ V(ke, {
|
|
164
507
|
icon: e,
|
|
165
508
|
className: "size-6 text-white"
|
|
166
|
-
}) : /* @__PURE__ */
|
|
167
|
-
}) : /* @__PURE__ */
|
|
509
|
+
}) : /* @__PURE__ */ V(r, { size: 24 })
|
|
510
|
+
}) : /* @__PURE__ */ H("div", {
|
|
168
511
|
className: "group relative",
|
|
169
512
|
children: [
|
|
170
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ H("button", {
|
|
171
514
|
type: "button",
|
|
172
515
|
onClick: () => u(!0),
|
|
173
516
|
"aria-label": c("forms.iconPicker.chooseAnIcon"),
|
|
174
|
-
className: `group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${
|
|
175
|
-
children: [e ? /* @__PURE__ */
|
|
517
|
+
className: `group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${Q(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`,
|
|
518
|
+
children: [e ? /* @__PURE__ */ V(ke, {
|
|
176
519
|
icon: e,
|
|
177
520
|
className: "size-6 text-white"
|
|
178
|
-
}) : /* @__PURE__ */
|
|
521
|
+
}) : /* @__PURE__ */ V(r, { size: 24 }), /* @__PURE__ */ V("span", {
|
|
179
522
|
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",
|
|
180
|
-
children: /* @__PURE__ */
|
|
523
|
+
children: /* @__PURE__ */ V(be, { className: "size-5 text-white" })
|
|
181
524
|
})]
|
|
182
525
|
}),
|
|
183
|
-
e && n && /* @__PURE__ */
|
|
526
|
+
e && n && /* @__PURE__ */ V("button", {
|
|
184
527
|
type: "button",
|
|
185
528
|
onClick: (e) => {
|
|
186
529
|
e.stopPropagation(), n();
|
|
@@ -188,9 +531,9 @@ function Fe({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title:
|
|
|
188
531
|
"aria-label": c("forms.common.remove"),
|
|
189
532
|
title: c("forms.common.remove"),
|
|
190
533
|
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",
|
|
191
|
-
children: /* @__PURE__ */
|
|
534
|
+
children: /* @__PURE__ */ V(Oe, { size: 12 })
|
|
192
535
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ V(g, {
|
|
194
537
|
open: l,
|
|
195
538
|
onOpenChange: u,
|
|
196
539
|
value: e,
|
|
@@ -204,103 +547,109 @@ function Fe({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title:
|
|
|
204
547
|
}
|
|
205
548
|
//#endregion
|
|
206
549
|
//#region src/bento/bento-inline-edit.tsx
|
|
207
|
-
function
|
|
208
|
-
let { t:
|
|
209
|
-
!
|
|
210
|
-
|
|
211
|
-
}, [
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
550
|
+
function ct({ value: n, onSave: r, multiline: i = !1, placeholder: a, className: o, ariaLabel: s, autoFocus: c = !1, readOnly: l = !1, commitOnChange: u = !1 }) {
|
|
551
|
+
let { t: d } = U(), [f, p] = z(c), [m, h] = z(n), [g, _] = z(!1), v = R(null), y = R(null), b = R(!1), x = R(!1), [S, C] = z(n);
|
|
552
|
+
!f && n !== S && (C(n), h(n)), F(() => {
|
|
553
|
+
f && v.current ? (v.current.focus(), v.current.select()) : !f && x.current && (x.current = !1, y.current?.focus());
|
|
554
|
+
}, [f]);
|
|
555
|
+
function w() {
|
|
556
|
+
x.current = v.current !== null && document.activeElement === v.current, p(!1);
|
|
557
|
+
}
|
|
558
|
+
async function T() {
|
|
559
|
+
if (b.current) return;
|
|
560
|
+
let e = m.trim();
|
|
561
|
+
if (e === n) {
|
|
562
|
+
w();
|
|
216
563
|
return;
|
|
217
564
|
}
|
|
218
|
-
if (!
|
|
219
|
-
|
|
565
|
+
if (!e && !a) {
|
|
566
|
+
h(n), w();
|
|
220
567
|
return;
|
|
221
568
|
}
|
|
222
|
-
|
|
569
|
+
b.current = !0, _(!0);
|
|
223
570
|
try {
|
|
224
|
-
await
|
|
571
|
+
await r(e);
|
|
225
572
|
} catch {
|
|
226
|
-
|
|
573
|
+
h(n);
|
|
227
574
|
} finally {
|
|
228
|
-
|
|
575
|
+
b.current = !1, _(!1), w();
|
|
229
576
|
}
|
|
230
577
|
}
|
|
231
|
-
function
|
|
232
|
-
|
|
578
|
+
function E() {
|
|
579
|
+
h(n), w();
|
|
233
580
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
581
|
+
function D(e) {
|
|
582
|
+
h(e), u && r(e);
|
|
236
583
|
}
|
|
237
|
-
let
|
|
238
|
-
if (
|
|
239
|
-
className:
|
|
240
|
-
"aria-label":
|
|
241
|
-
children:
|
|
584
|
+
let O = !n;
|
|
585
|
+
if (l) return /* @__PURE__ */ V("span", {
|
|
586
|
+
className: e("block w-full", o),
|
|
587
|
+
"aria-label": s,
|
|
588
|
+
children: n || /* @__PURE__ */ V("span", {
|
|
242
589
|
className: "text-muted-foreground/80",
|
|
243
|
-
children:
|
|
590
|
+
children: a ?? "—"
|
|
244
591
|
})
|
|
245
592
|
});
|
|
246
|
-
let
|
|
247
|
-
if (!
|
|
593
|
+
let k = "w-full bg-transparent outline-none border-b transition-colors duration-200", A = e(k, "cursor-text rounded-sm", O ? "border-dashed border-border/70 hover:border-foreground/40" : "border-transparent hover:border-border/60 focus-visible:border-border/80"), j = e(k, "bento-editing");
|
|
594
|
+
if (!f) return /* @__PURE__ */ V("button", {
|
|
595
|
+
ref: y,
|
|
248
596
|
type: "button",
|
|
249
|
-
onClick: () =>
|
|
250
|
-
className:
|
|
251
|
-
"aria-label":
|
|
252
|
-
|
|
253
|
-
children: e || /* @__PURE__ */ I("span", {
|
|
597
|
+
onClick: () => p(!0),
|
|
598
|
+
className: e(A, "text-left", o),
|
|
599
|
+
"aria-label": s ?? d("forms.formActions.edit"),
|
|
600
|
+
children: n || /* @__PURE__ */ V("span", {
|
|
254
601
|
className: "text-muted-foreground/80",
|
|
255
|
-
children:
|
|
602
|
+
children: a ?? "—"
|
|
256
603
|
})
|
|
257
604
|
});
|
|
258
|
-
function
|
|
605
|
+
function M(e) {
|
|
259
606
|
if (e.key === "Escape") {
|
|
260
|
-
e.preventDefault(),
|
|
607
|
+
e.preventDefault(), E();
|
|
261
608
|
return;
|
|
262
609
|
}
|
|
263
|
-
e.key === "Enter" && (!
|
|
610
|
+
e.key === "Enter" && (!i || e.metaKey || e.ctrlKey) && (e.preventDefault(), T());
|
|
264
611
|
}
|
|
265
|
-
return
|
|
266
|
-
ref:
|
|
267
|
-
value:
|
|
268
|
-
onChange: (e) =>
|
|
269
|
-
onBlur:
|
|
270
|
-
onKeyDown:
|
|
271
|
-
placeholder:
|
|
272
|
-
"aria-label":
|
|
612
|
+
return i ? /* @__PURE__ */ V("textarea", {
|
|
613
|
+
ref: v,
|
|
614
|
+
value: m,
|
|
615
|
+
onChange: (e) => D(e.target.value),
|
|
616
|
+
onBlur: T,
|
|
617
|
+
onKeyDown: M,
|
|
618
|
+
placeholder: a,
|
|
619
|
+
"aria-label": s,
|
|
620
|
+
"aria-busy": g || void 0,
|
|
273
621
|
rows: 3,
|
|
274
|
-
className:
|
|
275
|
-
}) : /* @__PURE__ */
|
|
276
|
-
ref:
|
|
277
|
-
value:
|
|
278
|
-
onChange: (e) =>
|
|
279
|
-
onBlur:
|
|
280
|
-
onKeyDown:
|
|
281
|
-
placeholder:
|
|
282
|
-
"aria-label":
|
|
283
|
-
|
|
622
|
+
className: e(j, "resize-none py-0.5 leading-snug", o)
|
|
623
|
+
}) : /* @__PURE__ */ V(t, {
|
|
624
|
+
ref: v,
|
|
625
|
+
value: m,
|
|
626
|
+
onChange: (e) => D(e.target.value),
|
|
627
|
+
onBlur: T,
|
|
628
|
+
onKeyDown: M,
|
|
629
|
+
placeholder: a,
|
|
630
|
+
"aria-label": s,
|
|
631
|
+
"aria-busy": g || void 0,
|
|
632
|
+
className: e(j, "h-auto px-0 py-0 shadow-none focus-visible:ring-0", o)
|
|
284
633
|
});
|
|
285
634
|
}
|
|
286
635
|
//#endregion
|
|
287
636
|
//#region src/bento/bento-status-marker.tsx
|
|
288
|
-
function
|
|
289
|
-
let { t:
|
|
290
|
-
if (!
|
|
291
|
-
let
|
|
292
|
-
return
|
|
293
|
-
className:
|
|
294
|
-
children: [/* @__PURE__ */
|
|
295
|
-
}) : /* @__PURE__ */
|
|
296
|
-
className:
|
|
297
|
-
children: [/* @__PURE__ */
|
|
637
|
+
function lt({ titleMissing: t, dirty: n, className: r }) {
|
|
638
|
+
let { t: i } = U();
|
|
639
|
+
if (!t && !n) return null;
|
|
640
|
+
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";
|
|
641
|
+
return t ? /* @__PURE__ */ H("span", {
|
|
642
|
+
className: e(a, "bento-status bento-status-error", r),
|
|
643
|
+
children: [/* @__PURE__ */ V(oe, { className: "size-3" }), i("bento.saveBar.titleRequired", { defaultValue: "Title required" })]
|
|
644
|
+
}) : /* @__PURE__ */ H("span", {
|
|
645
|
+
className: e(a, "bento-status bento-status-warn", r),
|
|
646
|
+
children: [/* @__PURE__ */ V("span", { className: "h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse" }), i("bento.saveBar.unsaved", { defaultValue: "Unsaved changes" })]
|
|
298
647
|
});
|
|
299
648
|
}
|
|
300
649
|
//#endregion
|
|
301
650
|
//#region src/bento/bento-scroll-fade.ts
|
|
302
|
-
function
|
|
303
|
-
|
|
651
|
+
function ut(e) {
|
|
652
|
+
F(() => {
|
|
304
653
|
let t = e.current;
|
|
305
654
|
if (!t) return;
|
|
306
655
|
let n = document.documentElement, r = 0, i = () => {
|
|
@@ -317,183 +666,361 @@ function Re(e) {
|
|
|
317
666
|
}
|
|
318
667
|
//#endregion
|
|
319
668
|
//#region src/bento/bento-entity-shell.tsx
|
|
320
|
-
function
|
|
669
|
+
function dt(e, t) {
|
|
321
670
|
let n = {};
|
|
322
671
|
for (let r of Object.keys(e)) Object.assign(n, { [r]: t[r] });
|
|
323
672
|
return n;
|
|
324
673
|
}
|
|
325
|
-
function
|
|
326
|
-
let { t:
|
|
674
|
+
function ft({ entity: e, isNew: t, headlineFallback: n, eyebrow: r, listRoute: i, icon: o, tone: s, formId: c, feature: l, hasStatus: u = !1, hideIcon: d = !1, readOnly: f = !1, autosaveOnly: p = !1, badge: m, notice: h, onUpdate: g, onDelete: _, extraActions: v, children: y }) {
|
|
675
|
+
let { t: x } = U(), S = Me(), [C, w] = z(!1), [T, E] = z({
|
|
327
676
|
isDirty: !1,
|
|
328
677
|
isSubmitting: !1
|
|
329
|
-
}),
|
|
330
|
-
|
|
331
|
-
let
|
|
678
|
+
}), D = R(null);
|
|
679
|
+
ut(D);
|
|
680
|
+
let O = {
|
|
332
681
|
title: e.title ?? "",
|
|
333
682
|
description: e.description ?? "",
|
|
334
683
|
icon: e.icon ?? null,
|
|
335
684
|
enabled: e.enabled ?? 1
|
|
336
|
-
}, [
|
|
337
|
-
(
|
|
338
|
-
async function
|
|
339
|
-
if (
|
|
685
|
+
}, [k, A] = z(O), [j, M] = z(O);
|
|
686
|
+
(O.title !== j.title || O.description !== j.description || O.icon !== j.icon || O.enabled !== j.enabled) && (M(O), A(O));
|
|
687
|
+
async function N(n) {
|
|
688
|
+
if (A((e) => ({
|
|
340
689
|
...e,
|
|
341
690
|
...n
|
|
342
|
-
})), t || !
|
|
343
|
-
let r = n.title ??
|
|
691
|
+
})), t || !g) return;
|
|
692
|
+
let r = n.title ?? k.title;
|
|
344
693
|
try {
|
|
345
|
-
await
|
|
694
|
+
await g({
|
|
346
695
|
...e,
|
|
347
696
|
...n
|
|
348
|
-
}),
|
|
697
|
+
}), b.success(x("forms.common.updated", {
|
|
349
698
|
name: r,
|
|
350
|
-
feature:
|
|
699
|
+
feature: l
|
|
351
700
|
}));
|
|
352
701
|
} catch (e) {
|
|
353
|
-
console.error("Failed to update entity field", e),
|
|
702
|
+
console.error("Failed to update entity field", e), A((e) => ({
|
|
354
703
|
...e,
|
|
355
|
-
...
|
|
356
|
-
})),
|
|
357
|
-
name:
|
|
358
|
-
feature:
|
|
704
|
+
...dt(n, O)
|
|
705
|
+
})), b.error(x("forms.common.notUpdated", {
|
|
706
|
+
name: O.title || r,
|
|
707
|
+
feature: l
|
|
359
708
|
}));
|
|
360
709
|
}
|
|
361
710
|
}
|
|
362
711
|
async function te() {
|
|
363
|
-
if (
|
|
712
|
+
if (_) {
|
|
364
713
|
try {
|
|
365
|
-
await
|
|
366
|
-
name:
|
|
367
|
-
feature:
|
|
368
|
-
})),
|
|
369
|
-
name:
|
|
370
|
-
feature:
|
|
714
|
+
await _() ? (b.success(x("forms.common.deleted", {
|
|
715
|
+
name: k.title,
|
|
716
|
+
feature: l
|
|
717
|
+
})), S(i)) : b.error(x("forms.common.notDeleted", {
|
|
718
|
+
name: k.title,
|
|
719
|
+
feature: l
|
|
371
720
|
}));
|
|
372
721
|
} catch (e) {
|
|
373
|
-
console.error("Failed to delete entity", e),
|
|
374
|
-
name:
|
|
375
|
-
feature:
|
|
722
|
+
console.error("Failed to delete entity", e), b.error(x("forms.common.notDeleted", {
|
|
723
|
+
name: k.title,
|
|
724
|
+
feature: l
|
|
376
725
|
}));
|
|
377
726
|
}
|
|
378
727
|
w(!1);
|
|
379
728
|
}
|
|
380
729
|
}
|
|
381
|
-
let
|
|
382
|
-
|
|
383
|
-
|
|
730
|
+
let P = k.enabled === 1, ne = !f, re = !(p && !t), F = !k.title.trim(), I = !t && !T.isDirty, L = F || I, ie = [...v ?? [], ..._ && !f ? [{
|
|
731
|
+
id: "entity.delete",
|
|
732
|
+
label: x("forms.formActions.delete"),
|
|
733
|
+
icon: we,
|
|
384
734
|
tone: "destructive",
|
|
385
735
|
onSelect: () => w(!0)
|
|
386
736
|
}] : []];
|
|
387
|
-
return /* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
eyebrow: /* @__PURE__ */
|
|
737
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
738
|
+
/* @__PURE__ */ V(ot, {
|
|
739
|
+
eyebrow: /* @__PURE__ */ H("span", {
|
|
390
740
|
className: "inline-flex items-center gap-2",
|
|
391
|
-
children: [/* @__PURE__ */
|
|
741
|
+
children: [/* @__PURE__ */ V(at, {
|
|
392
742
|
to: i,
|
|
393
743
|
children: r
|
|
394
|
-
}), !
|
|
395
|
-
titleMissing:
|
|
396
|
-
dirty: t ||
|
|
744
|
+
}), !f && /* @__PURE__ */ V(lt, {
|
|
745
|
+
titleMissing: F,
|
|
746
|
+
dirty: t || T.isDirty
|
|
397
747
|
})]
|
|
398
748
|
}),
|
|
399
|
-
leading: /* @__PURE__ */
|
|
400
|
-
value:
|
|
401
|
-
onChange: (e) =>
|
|
402
|
-
onClear: () =>
|
|
403
|
-
defaultIcon:
|
|
404
|
-
tone:
|
|
405
|
-
title:
|
|
406
|
-
description:
|
|
407
|
-
readOnly:
|
|
749
|
+
leading: /* @__PURE__ */ V(st, {
|
|
750
|
+
value: k.icon,
|
|
751
|
+
onChange: (e) => N({ icon: e }),
|
|
752
|
+
onClear: () => N({ icon: null }),
|
|
753
|
+
defaultIcon: o,
|
|
754
|
+
tone: s,
|
|
755
|
+
title: k.title,
|
|
756
|
+
description: k.description,
|
|
757
|
+
readOnly: f || d
|
|
408
758
|
}),
|
|
409
|
-
title: /* @__PURE__ */
|
|
410
|
-
value:
|
|
411
|
-
onSave: (e) =>
|
|
759
|
+
title: /* @__PURE__ */ V(ct, {
|
|
760
|
+
value: k.title,
|
|
761
|
+
onSave: (e) => N({ title: e }),
|
|
412
762
|
placeholder: n,
|
|
413
763
|
className: "text-3xl font-semibold tracking-tight md:text-4xl",
|
|
414
|
-
ariaLabel:
|
|
764
|
+
ariaLabel: x("forms.common.title"),
|
|
415
765
|
autoFocus: t,
|
|
416
766
|
commitOnChange: t,
|
|
417
|
-
readOnly:
|
|
767
|
+
readOnly: f
|
|
418
768
|
}),
|
|
419
|
-
subtitle: /* @__PURE__ */
|
|
420
|
-
value:
|
|
421
|
-
onSave: (e) =>
|
|
769
|
+
subtitle: /* @__PURE__ */ V(ct, {
|
|
770
|
+
value: k.description,
|
|
771
|
+
onSave: (e) => N({ description: e }),
|
|
422
772
|
multiline: !0,
|
|
423
|
-
placeholder:
|
|
773
|
+
placeholder: x("forms.common.description"),
|
|
424
774
|
className: "max-w-2xl text-sm text-muted-foreground",
|
|
425
|
-
ariaLabel:
|
|
775
|
+
ariaLabel: x("forms.common.description"),
|
|
426
776
|
commitOnChange: t,
|
|
427
|
-
readOnly:
|
|
777
|
+
readOnly: f
|
|
428
778
|
}),
|
|
429
|
-
trailing: /* @__PURE__ */
|
|
430
|
-
ne && /* @__PURE__ */
|
|
779
|
+
trailing: /* @__PURE__ */ H(B, { children: [
|
|
780
|
+
ne && /* @__PURE__ */ H("div", {
|
|
431
781
|
className: "bento-fade-out flex shrink-0 items-center gap-2",
|
|
432
|
-
children: [re && /* @__PURE__ */
|
|
782
|
+
children: [re && /* @__PURE__ */ H(a, {
|
|
433
783
|
type: "submit",
|
|
434
|
-
form:
|
|
784
|
+
form: c,
|
|
435
785
|
size: "sm",
|
|
436
|
-
loading:
|
|
437
|
-
disabled:
|
|
438
|
-
children: [/* @__PURE__ */
|
|
439
|
-
}), /* @__PURE__ */
|
|
786
|
+
loading: T.isSubmitting,
|
|
787
|
+
"aria-disabled": L ? "true" : void 0,
|
|
788
|
+
children: [/* @__PURE__ */ V(he, { className: "size-4" }), x("forms.formActions.saveChanges")]
|
|
789
|
+
}), /* @__PURE__ */ H(a, {
|
|
440
790
|
type: "button",
|
|
441
791
|
size: "sm",
|
|
442
792
|
variant: "outline",
|
|
443
|
-
onClick: () =>
|
|
444
|
-
children: [/* @__PURE__ */
|
|
793
|
+
onClick: () => S(i),
|
|
794
|
+
children: [/* @__PURE__ */ V(Oe, { className: "size-4" }), x("forms.formActions.cancel")]
|
|
445
795
|
})]
|
|
446
796
|
}),
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
className: `flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${
|
|
450
|
-
children: [/* @__PURE__ */
|
|
451
|
-
}) : /* @__PURE__ */
|
|
797
|
+
m,
|
|
798
|
+
u && (f ? /* @__PURE__ */ H("span", {
|
|
799
|
+
className: `flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${P ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
|
|
800
|
+
children: [/* @__PURE__ */ V("span", { className: `h-1.5 w-1.5 rounded-full ${P ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), P ? x("common.active", { defaultValue: "Active" }) : x("common.idle", { defaultValue: "Idle" })]
|
|
801
|
+
}) : /* @__PURE__ */ H("button", {
|
|
452
802
|
type: "button",
|
|
453
|
-
onClick: () =>
|
|
454
|
-
"aria-label":
|
|
455
|
-
title:
|
|
456
|
-
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 ${
|
|
457
|
-
children: [/* @__PURE__ */
|
|
803
|
+
onClick: () => N({ enabled: +!P }),
|
|
804
|
+
"aria-label": x("forms.common.enabled"),
|
|
805
|
+
title: x(P ? "common.activeToggleHint" : "common.idleToggleHint"),
|
|
806
|
+
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 ${P ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground hover:bg-muted/80"}`,
|
|
807
|
+
children: [/* @__PURE__ */ V("span", { className: `h-1.5 w-1.5 rounded-full ${P ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), P ? x("common.active", { defaultValue: "Active" }) : x("common.idle", { defaultValue: "Idle" })]
|
|
458
808
|
})),
|
|
459
|
-
!t &&
|
|
809
|
+
!t && ie.length > 0 && /* @__PURE__ */ V(Ze, { actions: ie })
|
|
460
810
|
] })
|
|
461
811
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
-
ref:
|
|
812
|
+
/* @__PURE__ */ V("div", {
|
|
813
|
+
ref: D,
|
|
464
814
|
"aria-hidden": !0,
|
|
465
815
|
className: "h-px"
|
|
466
816
|
}),
|
|
467
|
-
|
|
468
|
-
!t &&
|
|
469
|
-
feature:
|
|
470
|
-
name:
|
|
817
|
+
h,
|
|
818
|
+
!t && _ && /* @__PURE__ */ V(ee, {
|
|
819
|
+
feature: l,
|
|
820
|
+
name: k.title,
|
|
471
821
|
onDelete: te,
|
|
472
822
|
open: C,
|
|
473
823
|
setOpen: w,
|
|
474
|
-
trigger: /* @__PURE__ */
|
|
824
|
+
trigger: /* @__PURE__ */ V("span", {
|
|
475
825
|
className: "hidden",
|
|
476
826
|
"aria-hidden": !0
|
|
477
827
|
})
|
|
478
828
|
}),
|
|
479
829
|
y({
|
|
480
|
-
staged:
|
|
481
|
-
onStateChange:
|
|
830
|
+
staged: k,
|
|
831
|
+
onStateChange: E
|
|
482
832
|
})
|
|
483
833
|
] });
|
|
484
834
|
}
|
|
485
835
|
//#endregion
|
|
836
|
+
//#region src/bento/bento-diff.tsx
|
|
837
|
+
function pt(e, t, n = !0) {
|
|
838
|
+
let r = e.length, i = t.length;
|
|
839
|
+
if (r * i > 4e5) return null;
|
|
840
|
+
let a = Array.from({ length: r + 1 }, () => new Uint32Array(i + 1));
|
|
841
|
+
for (let n = r - 1; n >= 0; n--) for (let r = i - 1; r >= 0; r--) a[n][r] = e[n] === t[r] ? a[n + 1][r + 1] + 1 : Math.max(a[n + 1][r], a[n][r + 1]);
|
|
842
|
+
let o = [], s = (e, t) => {
|
|
843
|
+
let r = o[o.length - 1];
|
|
844
|
+
n && r?.op === e ? r.text += t : o.push({
|
|
845
|
+
op: e,
|
|
846
|
+
text: t
|
|
847
|
+
});
|
|
848
|
+
}, c = 0, l = 0;
|
|
849
|
+
for (; c < r && l < i;) e[c] === t[l] ? (s("same", e[c]), c++, l++) : a[c + 1][l] >= a[c][l + 1] ? s("remove", e[c++]) : s("add", t[l++]);
|
|
850
|
+
for (; c < r;) s("remove", e[c++]);
|
|
851
|
+
for (; l < i;) s("add", t[l++]);
|
|
852
|
+
return o;
|
|
853
|
+
}
|
|
854
|
+
var mt = (e) => e.split(/(\s+)/).filter((e) => e !== "");
|
|
855
|
+
function ht(e) {
|
|
856
|
+
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);
|
|
857
|
+
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();
|
|
858
|
+
return n.length > 0 ? n : r ? [r] : [];
|
|
859
|
+
}
|
|
860
|
+
var $ = (e) => e == null ? "" : String(e);
|
|
861
|
+
function gt({ before: t, after: n, fields: r, showUnchanged: i = !1 }) {
|
|
862
|
+
let { t: a } = U(), [o, s] = z(i), c = r.map((e) => {
|
|
863
|
+
let r = t?.[e.id], i = n?.[e.id], a = e.kind ?? "text", o = a === "rich" ? ht($(r)).join("\n") === ht($(i)).join("\n") : a === "value" ? JSON.stringify(r ?? null) === JSON.stringify(i ?? null) : $(r) === $(i), s = "changed";
|
|
864
|
+
return t === null || (r == null || r === "") && !o ? s = "added" : n === null || (i == null || i === "") && !o ? s = "removed" : o && (s = "unchanged"), {
|
|
865
|
+
field: e,
|
|
866
|
+
a: r,
|
|
867
|
+
b: i,
|
|
868
|
+
kind: a,
|
|
869
|
+
state: s
|
|
870
|
+
};
|
|
871
|
+
}), l = c.filter((e) => e.state !== "unchanged"), u = c.filter((e) => e.state === "unchanged"), d = {
|
|
872
|
+
added: a("bento.diff.added", { defaultValue: "Added" }),
|
|
873
|
+
removed: a("bento.diff.removed", { defaultValue: "Removed" }),
|
|
874
|
+
changed: a("bento.diff.changed", { defaultValue: "Changed" }),
|
|
875
|
+
unchanged: a("bento.diff.unchanged", { defaultValue: "Unchanged" })
|
|
876
|
+
};
|
|
877
|
+
return /* @__PURE__ */ H("div", {
|
|
878
|
+
"data-slot": "bento-diff",
|
|
879
|
+
className: "flex flex-col gap-3",
|
|
880
|
+
children: [
|
|
881
|
+
(t === null || n === null) && /* @__PURE__ */ V("p", {
|
|
882
|
+
className: "m-0 text-sm font-medium",
|
|
883
|
+
children: t === null ? a("bento.diff.created", { defaultValue: "Created in this version" }) : a("bento.diff.deleted", { defaultValue: "Deleted in this version" })
|
|
884
|
+
}),
|
|
885
|
+
l.length === 0 && /* @__PURE__ */ V("p", {
|
|
886
|
+
className: "m-0 text-sm text-muted-foreground",
|
|
887
|
+
children: a("bento.diff.noChanges", { defaultValue: "No field changed" })
|
|
888
|
+
}),
|
|
889
|
+
/* @__PURE__ */ V("dl", {
|
|
890
|
+
className: "m-0 flex flex-col gap-3",
|
|
891
|
+
children: l.map((e) => /* @__PURE__ */ V(_t, {
|
|
892
|
+
label: e.field.label,
|
|
893
|
+
status: d[e.state],
|
|
894
|
+
state: e.state,
|
|
895
|
+
children: /* @__PURE__ */ V(vt, { row: e })
|
|
896
|
+
}, e.field.id))
|
|
897
|
+
}),
|
|
898
|
+
u.length > 0 && /* @__PURE__ */ H("div", {
|
|
899
|
+
className: "flex flex-col gap-3",
|
|
900
|
+
children: [/* @__PURE__ */ H("button", {
|
|
901
|
+
type: "button",
|
|
902
|
+
"aria-expanded": o ? "true" : "false",
|
|
903
|
+
onClick: () => s(!o),
|
|
904
|
+
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",
|
|
905
|
+
children: [/* @__PURE__ */ V(K, {
|
|
906
|
+
size: 14,
|
|
907
|
+
"aria-hidden": "true",
|
|
908
|
+
className: e("transition-transform", o && "rotate-90")
|
|
909
|
+
}), a("bento.diff.unchangedCount", {
|
|
910
|
+
defaultValue: "{{count}} unchanged",
|
|
911
|
+
count: u.length
|
|
912
|
+
})]
|
|
913
|
+
}), o && /* @__PURE__ */ V("dl", {
|
|
914
|
+
className: "m-0 flex flex-col gap-3",
|
|
915
|
+
children: u.map((e) => /* @__PURE__ */ V(_t, {
|
|
916
|
+
label: e.field.label,
|
|
917
|
+
status: d.unchanged,
|
|
918
|
+
state: "unchanged",
|
|
919
|
+
children: /* @__PURE__ */ V("p", {
|
|
920
|
+
className: "m-0 whitespace-pre-wrap text-sm text-muted-foreground",
|
|
921
|
+
children: e.kind === "rich" ? ht($(e.b)).join("\n\n") : e.field.format ? e.field.format(e.b) : $(e.b)
|
|
922
|
+
})
|
|
923
|
+
}, e.field.id))
|
|
924
|
+
})]
|
|
925
|
+
})
|
|
926
|
+
]
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
function _t({ label: t, status: n, state: r, children: i }) {
|
|
930
|
+
return /* @__PURE__ */ H("div", {
|
|
931
|
+
className: "rounded-xl border border-border/60 bg-card/40 p-3",
|
|
932
|
+
children: [/* @__PURE__ */ H("dt", {
|
|
933
|
+
className: "mb-1.5 flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
934
|
+
children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ V("span", {
|
|
935
|
+
className: e("rounded-full border px-1.5 leading-4", r === "added" && "bento-status bento-status-on", r === "removed" && "bento-status bento-status-error", r === "changed" && "bento-status bento-status-warn"),
|
|
936
|
+
children: n
|
|
937
|
+
})]
|
|
938
|
+
}), /* @__PURE__ */ V("dd", {
|
|
939
|
+
className: "m-0",
|
|
940
|
+
children: i
|
|
941
|
+
})]
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
function vt({ row: e }) {
|
|
945
|
+
let { t } = U(), { field: n, a: r, b: i, kind: a, state: o } = e;
|
|
946
|
+
if (a === "value") {
|
|
947
|
+
let e = (e) => n.format ? n.format(e) : $(e);
|
|
948
|
+
return /* @__PURE__ */ H("p", {
|
|
949
|
+
className: "m-0 flex flex-wrap items-center gap-2 text-sm",
|
|
950
|
+
children: [
|
|
951
|
+
o !== "added" && /* @__PURE__ */ V(bt, { children: e(r) }),
|
|
952
|
+
o === "changed" && /* @__PURE__ */ V("span", {
|
|
953
|
+
"aria-hidden": "true",
|
|
954
|
+
children: "→"
|
|
955
|
+
}),
|
|
956
|
+
o !== "removed" && /* @__PURE__ */ V(yt, { children: e(i) })
|
|
957
|
+
]
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
let s = a === "rich" ? ht($(r)) : [$(r)].filter(Boolean), c = a === "rich" ? ht($(i)) : [$(i)].filter(Boolean), l = pt(s, c, !1) ?? [...s.map((e) => ({
|
|
961
|
+
op: "remove",
|
|
962
|
+
text: e
|
|
963
|
+
})), ...c.map((e) => ({
|
|
964
|
+
op: "add",
|
|
965
|
+
text: e
|
|
966
|
+
}))], u = [];
|
|
967
|
+
for (let e = 0; e < l.length; e++) {
|
|
968
|
+
let t = l[e], n = l[e + 1];
|
|
969
|
+
if (t.op === "remove" && n?.op === "add") {
|
|
970
|
+
let r = pt(mt(t.text), mt(n.text));
|
|
971
|
+
u.push(/* @__PURE__ */ V("p", {
|
|
972
|
+
className: "m-0 whitespace-pre-wrap text-sm leading-relaxed",
|
|
973
|
+
children: r ? r.map((e, t) => e.op === "same" ? /* @__PURE__ */ V("span", { children: e.text }, t) : e.op === "add" ? /* @__PURE__ */ V(yt, { children: e.text }, t) : /* @__PURE__ */ V(bt, { children: e.text }, t)) : [
|
|
974
|
+
/* @__PURE__ */ V(bt, { children: t.text }, "r"),
|
|
975
|
+
" ",
|
|
976
|
+
/* @__PURE__ */ V(yt, { children: n.text }, "a")
|
|
977
|
+
]
|
|
978
|
+
}, e)), e++;
|
|
979
|
+
} else u.push(/* @__PURE__ */ V("p", {
|
|
980
|
+
className: "m-0 whitespace-pre-wrap text-sm leading-relaxed",
|
|
981
|
+
children: t.op === "same" ? t.text : t.op === "add" ? /* @__PURE__ */ V(yt, { children: t.text }) : /* @__PURE__ */ V(bt, { children: t.text })
|
|
982
|
+
}, e));
|
|
983
|
+
}
|
|
984
|
+
return u.length === 0 ? /* @__PURE__ */ V("p", {
|
|
985
|
+
className: "m-0 text-sm text-muted-foreground",
|
|
986
|
+
children: t("bento.diff.empty", { defaultValue: "Empty" })
|
|
987
|
+
}) : /* @__PURE__ */ V("div", {
|
|
988
|
+
className: "flex flex-col gap-2",
|
|
989
|
+
children: u
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
function yt({ children: e }) {
|
|
993
|
+
let { t } = U();
|
|
994
|
+
return /* @__PURE__ */ H("ins", {
|
|
995
|
+
className: "bento-status bento-status-on rounded-sm px-0.5 underline decoration-2 underline-offset-2",
|
|
996
|
+
children: [/* @__PURE__ */ H("span", {
|
|
997
|
+
className: "sr-only",
|
|
998
|
+
children: [t("bento.diff.addedStart", { defaultValue: "added:" }), " "]
|
|
999
|
+
}), e]
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
function bt({ children: e }) {
|
|
1003
|
+
let { t } = U();
|
|
1004
|
+
return /* @__PURE__ */ H("del", {
|
|
1005
|
+
className: "bento-status bento-status-error rounded-sm px-0.5 line-through decoration-2",
|
|
1006
|
+
children: [/* @__PURE__ */ H("span", {
|
|
1007
|
+
className: "sr-only",
|
|
1008
|
+
children: [t("bento.diff.removedStart", { defaultValue: "removed:" }), " "]
|
|
1009
|
+
}), e]
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
//#endregion
|
|
486
1013
|
//#region src/bento/bento-layout.ts
|
|
487
|
-
var
|
|
1014
|
+
var xt = {
|
|
488
1015
|
LARGE: "col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2",
|
|
489
1016
|
MEDIUM: "col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1",
|
|
490
1017
|
SMALL: "col-span-1 row-span-1"
|
|
491
|
-
},
|
|
1018
|
+
}, St = {
|
|
492
1019
|
SMALL: "MEDIUM",
|
|
493
1020
|
MEDIUM: "LARGE",
|
|
494
1021
|
LARGE: "SMALL"
|
|
495
1022
|
};
|
|
496
|
-
function
|
|
1023
|
+
function Ct(e, t, n) {
|
|
497
1024
|
if (!n || n.length === 0) return e.map((e, n) => ({
|
|
498
1025
|
item: e,
|
|
499
1026
|
key: t(e),
|
|
@@ -514,7 +1041,7 @@ function Ue(e, t, n) {
|
|
|
514
1041
|
emphasis: i.get(t) ?? "MEDIUM"
|
|
515
1042
|
}));
|
|
516
1043
|
}
|
|
517
|
-
function
|
|
1044
|
+
function wt(e) {
|
|
518
1045
|
return e.map((e, t) => ({
|
|
519
1046
|
itemId: e.key,
|
|
520
1047
|
emphasis: e.emphasis,
|
|
@@ -523,45 +1050,45 @@ function We(e) {
|
|
|
523
1050
|
}
|
|
524
1051
|
//#endregion
|
|
525
1052
|
//#region src/bento/bento-entity-tile.tsx
|
|
526
|
-
function
|
|
527
|
-
let { t: f } =
|
|
528
|
-
return /* @__PURE__ */
|
|
1053
|
+
function Tt({ 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 }) {
|
|
1054
|
+
let { t: f } = U(), p = Q(a), m = t ?? (n ? "LARGE" : "MEDIUM"), h = m === "LARGE", g = m === "SMALL", _ = xt[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";
|
|
1055
|
+
return /* @__PURE__ */ H(Z, {
|
|
529
1056
|
to: e,
|
|
530
1057
|
className: `bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${h ? "gap-5" : "gap-4"} overflow-hidden ${y} ${_}`,
|
|
531
1058
|
style: d ? { viewTransitionName: d } : void 0,
|
|
532
1059
|
children: [
|
|
533
|
-
h && /* @__PURE__ */
|
|
1060
|
+
h && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
|
|
534
1061
|
"aria-hidden": !0,
|
|
535
1062
|
className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${p} opacity-40 blur-2xl dark:opacity-50`
|
|
536
|
-
}), /* @__PURE__ */
|
|
1063
|
+
}), /* @__PURE__ */ V("div", {
|
|
537
1064
|
"aria-hidden": !0,
|
|
538
1065
|
className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${p} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`
|
|
539
1066
|
})] }),
|
|
540
|
-
/* @__PURE__ */
|
|
1067
|
+
/* @__PURE__ */ H("div", {
|
|
541
1068
|
className: "relative z-1 flex items-center justify-between",
|
|
542
|
-
children: [/* @__PURE__ */
|
|
1069
|
+
children: [/* @__PURE__ */ V("span", {
|
|
543
1070
|
className: `grid place-items-center rounded-2xl ${p} text-white shadow-md ${b}`,
|
|
544
|
-
children: i ? /* @__PURE__ */
|
|
1071
|
+
children: i ? /* @__PURE__ */ V(ke, {
|
|
545
1072
|
icon: i,
|
|
546
1073
|
className: h ? "size-7 text-white" : "size-4.5 text-white"
|
|
547
|
-
}) : /* @__PURE__ */
|
|
548
|
-
}), u && /* @__PURE__ */
|
|
1074
|
+
}) : /* @__PURE__ */ V(r, { size: x })
|
|
1075
|
+
}), u && /* @__PURE__ */ H("span", {
|
|
549
1076
|
className: `flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${v ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
|
|
550
|
-
children: [/* @__PURE__ */
|
|
1077
|
+
children: [/* @__PURE__ */ V("span", { className: `h-1.5 w-1.5 rounded-full ${v ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), v ? f("common.active", { defaultValue: "Active" }) : f("common.idle", { defaultValue: "Idle" })]
|
|
551
1078
|
})]
|
|
552
1079
|
}),
|
|
553
|
-
/* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ H("div", {
|
|
554
1081
|
className: "relative z-1",
|
|
555
1082
|
children: [
|
|
556
|
-
/* @__PURE__ */
|
|
1083
|
+
/* @__PURE__ */ V("div", {
|
|
557
1084
|
className: `font-semibold tracking-tight ${S}`,
|
|
558
1085
|
children: o
|
|
559
1086
|
}),
|
|
560
|
-
!g && c && /* @__PURE__ */
|
|
1087
|
+
!g && c && /* @__PURE__ */ V("div", {
|
|
561
1088
|
className: "mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",
|
|
562
1089
|
children: c
|
|
563
1090
|
}),
|
|
564
|
-
!g && s && /* @__PURE__ */
|
|
1091
|
+
!g && s && /* @__PURE__ */ V("p", {
|
|
565
1092
|
className: "mt-2 text-sm text-muted-foreground",
|
|
566
1093
|
children: s
|
|
567
1094
|
})
|
|
@@ -571,56 +1098,282 @@ function Ge({ to: e, emphasis: t, featured: n, defaultIcon: r, icon: i, tone: a
|
|
|
571
1098
|
});
|
|
572
1099
|
}
|
|
573
1100
|
//#endregion
|
|
1101
|
+
//#region src/bento/bento-filter-bar.tsx
|
|
1102
|
+
var Et = {
|
|
1103
|
+
query: "",
|
|
1104
|
+
facets: {}
|
|
1105
|
+
}, Dt = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ot = (e) => Array.isArray(e) ? e : [];
|
|
1106
|
+
function kt(e, t, n) {
|
|
1107
|
+
let r = { ...e.facets };
|
|
1108
|
+
return n === void 0 || Array.isArray(n) && n.length === 0 || Dt(n) && !n.from && !n.to ? delete r[t] : r[t] = n, {
|
|
1109
|
+
...e,
|
|
1110
|
+
facets: r
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
function At({ value: e, onChange: n, facets: r, queryLabel: i, queryDelay: a = 300, views: o }) {
|
|
1114
|
+
let { t: s } = U(), [c, l] = z({
|
|
1115
|
+
source: e.query,
|
|
1116
|
+
text: e.query
|
|
1117
|
+
}), [u, d] = z(null);
|
|
1118
|
+
c.source !== e.query && l({
|
|
1119
|
+
source: e.query,
|
|
1120
|
+
text: e.query === u ? c.text : e.query
|
|
1121
|
+
}), F(() => {
|
|
1122
|
+
if (c.text === e.query) return;
|
|
1123
|
+
let t = setTimeout(() => {
|
|
1124
|
+
d(c.text), n({
|
|
1125
|
+
...e,
|
|
1126
|
+
query: c.text
|
|
1127
|
+
});
|
|
1128
|
+
}, a);
|
|
1129
|
+
return () => clearTimeout(t);
|
|
1130
|
+
}, [
|
|
1131
|
+
c.text,
|
|
1132
|
+
e,
|
|
1133
|
+
n,
|
|
1134
|
+
a
|
|
1135
|
+
]);
|
|
1136
|
+
let f = [];
|
|
1137
|
+
for (let t of r) {
|
|
1138
|
+
let n = e.facets[t.id];
|
|
1139
|
+
if (t.kind === "choice") for (let r of Ot(n)) {
|
|
1140
|
+
let i = t.options.find((e) => e.value === r);
|
|
1141
|
+
f.push({
|
|
1142
|
+
key: `${t.id}:${r}`,
|
|
1143
|
+
text: `${t.label}: ${i?.label ?? r}`,
|
|
1144
|
+
remove: () => kt(e, t.id, Ot(n).filter((e) => e !== r))
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
else Dt(n) && (n.from || n.to) && f.push({
|
|
1148
|
+
key: t.id,
|
|
1149
|
+
text: `${t.label}: ${n.from ?? "…"} – ${n.to ?? "…"}`,
|
|
1150
|
+
remove: () => kt(e, t.id, void 0)
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
let p = f.length > 0 || e.query !== "", m = i ?? s("bento.filters.search", { defaultValue: "Search" });
|
|
1154
|
+
return /* @__PURE__ */ H("div", {
|
|
1155
|
+
role: "search",
|
|
1156
|
+
"aria-label": s("bento.filters.label", { defaultValue: "Filters" }),
|
|
1157
|
+
"data-slot": "bento-filter-bar",
|
|
1158
|
+
className: "flex flex-col gap-2",
|
|
1159
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1160
|
+
className: "flex flex-wrap items-center gap-2",
|
|
1161
|
+
children: [
|
|
1162
|
+
/* @__PURE__ */ H("div", {
|
|
1163
|
+
className: "relative min-w-48 flex-1",
|
|
1164
|
+
children: [/* @__PURE__ */ V(Se, {
|
|
1165
|
+
size: 16,
|
|
1166
|
+
"aria-hidden": "true",
|
|
1167
|
+
className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
1168
|
+
}), /* @__PURE__ */ V(t, {
|
|
1169
|
+
type: "search",
|
|
1170
|
+
value: c.text,
|
|
1171
|
+
placeholder: m,
|
|
1172
|
+
"aria-label": m,
|
|
1173
|
+
onChange: (e) => l({
|
|
1174
|
+
...c,
|
|
1175
|
+
text: e.target.value
|
|
1176
|
+
}),
|
|
1177
|
+
className: "pl-9"
|
|
1178
|
+
})]
|
|
1179
|
+
}),
|
|
1180
|
+
r.map((t) => t.kind === "choice" ? /* @__PURE__ */ V(Mt, {
|
|
1181
|
+
facet: t,
|
|
1182
|
+
value: e,
|
|
1183
|
+
onChange: n
|
|
1184
|
+
}, t.id) : /* @__PURE__ */ V(Nt, {
|
|
1185
|
+
facet: t,
|
|
1186
|
+
value: e,
|
|
1187
|
+
onChange: n
|
|
1188
|
+
}, t.id)),
|
|
1189
|
+
o
|
|
1190
|
+
]
|
|
1191
|
+
}), p && /* @__PURE__ */ H("ul", {
|
|
1192
|
+
className: "m-0 flex list-none flex-wrap items-center gap-1.5 p-0",
|
|
1193
|
+
"aria-label": s("bento.filters.active", { defaultValue: "Active filters" }),
|
|
1194
|
+
children: [f.map((e) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H("button", {
|
|
1195
|
+
type: "button",
|
|
1196
|
+
"aria-label": s("bento.filters.remove", {
|
|
1197
|
+
defaultValue: "Remove filter {{filter}}",
|
|
1198
|
+
filter: e.text
|
|
1199
|
+
}),
|
|
1200
|
+
onClick: () => n(e.remove()),
|
|
1201
|
+
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",
|
|
1202
|
+
children: [e.text, /* @__PURE__ */ V(Oe, {
|
|
1203
|
+
size: 12,
|
|
1204
|
+
"aria-hidden": "true"
|
|
1205
|
+
})]
|
|
1206
|
+
}) }, e.key)), /* @__PURE__ */ V("li", { children: /* @__PURE__ */ V(N, {
|
|
1207
|
+
variant: "ghost",
|
|
1208
|
+
size: "sm",
|
|
1209
|
+
className: "h-6 px-2 text-xs",
|
|
1210
|
+
onClick: () => {
|
|
1211
|
+
l({
|
|
1212
|
+
source: "",
|
|
1213
|
+
text: ""
|
|
1214
|
+
}), n(Et);
|
|
1215
|
+
},
|
|
1216
|
+
children: s("bento.filters.clearAll", { defaultValue: "Clear all" })
|
|
1217
|
+
}) })]
|
|
1218
|
+
})]
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
function jt({ label: e, count: t, ...n }) {
|
|
1222
|
+
return /* @__PURE__ */ H(N, {
|
|
1223
|
+
variant: "outline",
|
|
1224
|
+
size: "sm",
|
|
1225
|
+
className: "gap-1.5",
|
|
1226
|
+
...n,
|
|
1227
|
+
children: [
|
|
1228
|
+
e,
|
|
1229
|
+
t > 0 && /* @__PURE__ */ V("span", {
|
|
1230
|
+
className: "rounded-full bg-primary px-1.5 text-[0.6875rem] leading-4 text-primary-foreground",
|
|
1231
|
+
children: t
|
|
1232
|
+
}),
|
|
1233
|
+
/* @__PURE__ */ V(pe, {
|
|
1234
|
+
size: 14,
|
|
1235
|
+
"aria-hidden": "true"
|
|
1236
|
+
})
|
|
1237
|
+
]
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
function Mt({ facet: e, value: t, onChange: n }) {
|
|
1241
|
+
let r = Ot(t.facets[e.id]);
|
|
1242
|
+
return /* @__PURE__ */ H(l, { children: [/* @__PURE__ */ V(f, {
|
|
1243
|
+
asChild: !0,
|
|
1244
|
+
children: /* @__PURE__ */ V(jt, {
|
|
1245
|
+
label: e.label,
|
|
1246
|
+
count: r.length
|
|
1247
|
+
})
|
|
1248
|
+
}), /* @__PURE__ */ V(_, {
|
|
1249
|
+
align: "start",
|
|
1250
|
+
className: "bento-dropdown min-w-44 p-1.5",
|
|
1251
|
+
children: e.multiple ? e.options.map((i) => /* @__PURE__ */ V(j, {
|
|
1252
|
+
checked: r.includes(i.value),
|
|
1253
|
+
onCheckedChange: (a) => n(kt(t, e.id, a === !0 ? [...r, i.value] : r.filter((e) => e !== i.value))),
|
|
1254
|
+
onSelect: (e) => e.preventDefault(),
|
|
1255
|
+
children: i.label
|
|
1256
|
+
}, i.value)) : /* @__PURE__ */ V(c, {
|
|
1257
|
+
value: r[0] ?? "",
|
|
1258
|
+
onValueChange: (i) => n(kt(t, e.id, i === r[0] ? [] : [i])),
|
|
1259
|
+
children: e.options.map((e) => /* @__PURE__ */ V(T, {
|
|
1260
|
+
value: e.value,
|
|
1261
|
+
children: e.label
|
|
1262
|
+
}, e.value))
|
|
1263
|
+
})
|
|
1264
|
+
})] });
|
|
1265
|
+
}
|
|
1266
|
+
function Nt({ facet: e, value: n, onChange: r }) {
|
|
1267
|
+
let { t: i } = U(), a = n.facets[e.id], o = Dt(a) ? a : {}, [s, c] = z(!1), [l, u] = z(o.from ?? ""), [d, f] = z(o.to ?? ""), p = I(), m = I();
|
|
1268
|
+
return /* @__PURE__ */ H(C, {
|
|
1269
|
+
open: s,
|
|
1270
|
+
onOpenChange: (e) => {
|
|
1271
|
+
e && (u(o.from ?? ""), f(o.to ?? "")), c(e);
|
|
1272
|
+
},
|
|
1273
|
+
children: [/* @__PURE__ */ V(M, {
|
|
1274
|
+
asChild: !0,
|
|
1275
|
+
children: /* @__PURE__ */ V(jt, {
|
|
1276
|
+
label: e.label,
|
|
1277
|
+
count: o.from || o.to ? 1 : 0
|
|
1278
|
+
})
|
|
1279
|
+
}), /* @__PURE__ */ V(v, {
|
|
1280
|
+
align: "start",
|
|
1281
|
+
className: "bento-dropdown w-64 p-3",
|
|
1282
|
+
children: /* @__PURE__ */ H("form", {
|
|
1283
|
+
className: "flex flex-col gap-2",
|
|
1284
|
+
onSubmit: (t) => {
|
|
1285
|
+
t.preventDefault(), r(kt(n, e.id, {
|
|
1286
|
+
from: l || void 0,
|
|
1287
|
+
to: d || void 0
|
|
1288
|
+
})), c(!1);
|
|
1289
|
+
},
|
|
1290
|
+
children: [
|
|
1291
|
+
/* @__PURE__ */ V("label", {
|
|
1292
|
+
htmlFor: p,
|
|
1293
|
+
className: "text-xs text-muted-foreground",
|
|
1294
|
+
children: i("bento.filters.from", { defaultValue: "From" })
|
|
1295
|
+
}),
|
|
1296
|
+
/* @__PURE__ */ V(t, {
|
|
1297
|
+
id: p,
|
|
1298
|
+
type: "date",
|
|
1299
|
+
value: l,
|
|
1300
|
+
max: d || void 0,
|
|
1301
|
+
onChange: (e) => u(e.target.value)
|
|
1302
|
+
}),
|
|
1303
|
+
/* @__PURE__ */ V("label", {
|
|
1304
|
+
htmlFor: m,
|
|
1305
|
+
className: "text-xs text-muted-foreground",
|
|
1306
|
+
children: i("bento.filters.to", { defaultValue: "To" })
|
|
1307
|
+
}),
|
|
1308
|
+
/* @__PURE__ */ V(t, {
|
|
1309
|
+
id: m,
|
|
1310
|
+
type: "date",
|
|
1311
|
+
value: d,
|
|
1312
|
+
min: l || void 0,
|
|
1313
|
+
onChange: (e) => f(e.target.value)
|
|
1314
|
+
}),
|
|
1315
|
+
/* @__PURE__ */ V(N, {
|
|
1316
|
+
type: "submit",
|
|
1317
|
+
size: "sm",
|
|
1318
|
+
className: "mt-1",
|
|
1319
|
+
children: i("bento.filters.apply", { defaultValue: "Apply" })
|
|
1320
|
+
})
|
|
1321
|
+
]
|
|
1322
|
+
})
|
|
1323
|
+
})]
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
//#endregion
|
|
574
1327
|
//#region src/bento/bento-list-page.tsx
|
|
575
|
-
var
|
|
576
|
-
function
|
|
577
|
-
let { t:
|
|
1328
|
+
var Pt = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
|
|
1329
|
+
function Ft({ items: e, error: t, tryAgainUrl: n, listId: r, eyebrow: i, backTo: a, backLabel: o, heroIcon: s, title: c, subtitle: l, tone: u = "indigo", headerAction: d, newRoute: f, newLabel: p, newSubtitle: m, hideNew: h = !1, itemKey: g, renderTile: _, emptyTitle: v, emptyDescription: y, layout: b }) {
|
|
1330
|
+
let { t: x } = U(), S = Q(u), [C, w] = z(!1), T = L(() => Ct(e ?? [], g, b?.data?.entries), [
|
|
578
1331
|
e,
|
|
579
1332
|
g,
|
|
580
|
-
|
|
581
|
-
]),
|
|
582
|
-
return /* @__PURE__ */
|
|
1333
|
+
b?.data?.entries
|
|
1334
|
+
]), E = !!r && !!b && (e?.length ?? 0) > 0;
|
|
1335
|
+
return /* @__PURE__ */ H(te, {
|
|
583
1336
|
checkIsNotUndefined: e,
|
|
584
1337
|
error: t ?? null,
|
|
585
1338
|
tryAgainUrl: n,
|
|
586
1339
|
children: [
|
|
587
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ V(ot, {
|
|
588
1341
|
eyebrow: i,
|
|
589
1342
|
backTo: a,
|
|
590
1343
|
backLabel: o,
|
|
591
|
-
leading: /* @__PURE__ */
|
|
592
|
-
className: `grid h-12 w-12 place-items-center rounded-2xl ${
|
|
593
|
-
children: /* @__PURE__ */
|
|
1344
|
+
leading: /* @__PURE__ */ V("span", {
|
|
1345
|
+
className: `grid h-12 w-12 place-items-center rounded-2xl ${S} text-white shadow-md`,
|
|
1346
|
+
children: /* @__PURE__ */ V(s, { size: 24 })
|
|
594
1347
|
}),
|
|
595
1348
|
title: c,
|
|
596
1349
|
subtitle: l
|
|
597
1350
|
}),
|
|
598
|
-
(d ||
|
|
1351
|
+
(d || E && !C) && /* @__PURE__ */ H("div", {
|
|
599
1352
|
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
600
|
-
children: [d,
|
|
1353
|
+
children: [d, E && !C && /* @__PURE__ */ H(N, {
|
|
601
1354
|
variant: "outline",
|
|
602
1355
|
size: "sm",
|
|
603
|
-
onClick: () =>
|
|
1356
|
+
onClick: () => w(!0),
|
|
604
1357
|
className: "ml-auto gap-2",
|
|
605
|
-
children: [/* @__PURE__ */
|
|
1358
|
+
children: [/* @__PURE__ */ V(ae, { size: 16 }), x("bento.layout.customize", { defaultValue: "Customize layout" })]
|
|
606
1359
|
})]
|
|
607
1360
|
}),
|
|
608
|
-
|
|
609
|
-
layout:
|
|
610
|
-
resolved:
|
|
611
|
-
canEditGlobal:
|
|
612
|
-
isCustomized:
|
|
1361
|
+
C && r && b ? /* @__PURE__ */ V(Rt, {
|
|
1362
|
+
layout: b,
|
|
1363
|
+
resolved: T,
|
|
1364
|
+
canEditGlobal: b?.data?.canEditGlobal ?? !1,
|
|
1365
|
+
isCustomized: b?.data?.source === "USER",
|
|
613
1366
|
renderTile: _,
|
|
614
|
-
chip:
|
|
1367
|
+
chip: S,
|
|
615
1368
|
hideNew: h,
|
|
616
1369
|
newRoute: f,
|
|
617
1370
|
newLabel: p,
|
|
618
1371
|
newSubtitle: m,
|
|
619
|
-
onClose: () =>
|
|
620
|
-
}) : /* @__PURE__ */
|
|
621
|
-
resolved:
|
|
1372
|
+
onClose: () => w(!1)
|
|
1373
|
+
}) : /* @__PURE__ */ V(Lt, {
|
|
1374
|
+
resolved: T,
|
|
622
1375
|
renderTile: _,
|
|
623
|
-
chip:
|
|
1376
|
+
chip: S,
|
|
624
1377
|
hideNew: h,
|
|
625
1378
|
newRoute: f,
|
|
626
1379
|
newLabel: p,
|
|
@@ -632,26 +1385,26 @@ function qe({ items: e, error: t, tryAgainUrl: n, listId: r, eyebrow: i, backTo:
|
|
|
632
1385
|
]
|
|
633
1386
|
});
|
|
634
1387
|
}
|
|
635
|
-
function
|
|
636
|
-
let f =
|
|
637
|
-
return /* @__PURE__ */
|
|
1388
|
+
function It({ 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 }) {
|
|
1389
|
+
let f = Q(r);
|
|
1390
|
+
return /* @__PURE__ */ V(te, {
|
|
638
1391
|
checkIsNotUndefined: e,
|
|
639
1392
|
error: t ?? null,
|
|
640
1393
|
tryAgainUrl: n,
|
|
641
|
-
children: /* @__PURE__ */
|
|
642
|
-
className:
|
|
1394
|
+
children: /* @__PURE__ */ H("div", {
|
|
1395
|
+
className: Pt,
|
|
643
1396
|
children: [
|
|
644
|
-
!s && i && a ? /* @__PURE__ */
|
|
1397
|
+
!s && i && a ? /* @__PURE__ */ V(Ht, {
|
|
645
1398
|
route: i,
|
|
646
1399
|
label: a,
|
|
647
1400
|
subtitle: o,
|
|
648
1401
|
chip: f
|
|
649
1402
|
}) : null,
|
|
650
|
-
(e ?? []).map((e) => /* @__PURE__ */
|
|
1403
|
+
(e ?? []).map((e) => /* @__PURE__ */ V("span", {
|
|
651
1404
|
className: "contents",
|
|
652
1405
|
children: l(e)
|
|
653
1406
|
}, c(e))),
|
|
654
|
-
e?.length === 0 && /* @__PURE__ */
|
|
1407
|
+
e?.length === 0 && /* @__PURE__ */ V(Ut, {
|
|
655
1408
|
title: u,
|
|
656
1409
|
description: d
|
|
657
1410
|
})
|
|
@@ -659,126 +1412,128 @@ function Je({ items: e, error: t, tryAgainUrl: n, tone: r = "indigo", newRoute:
|
|
|
659
1412
|
})
|
|
660
1413
|
});
|
|
661
1414
|
}
|
|
662
|
-
function
|
|
663
|
-
let d =
|
|
664
|
-
return /* @__PURE__ */
|
|
665
|
-
className:
|
|
1415
|
+
function Lt({ resolved: t, renderTile: n, chip: r, hideNew: i, newRoute: a, newLabel: o, newSubtitle: s, isEmpty: c, emptyTitle: l, emptyDescription: u }) {
|
|
1416
|
+
let d = t.some((e) => e.emphasis === "SMALL");
|
|
1417
|
+
return /* @__PURE__ */ H("div", {
|
|
1418
|
+
className: e(Pt, d && "grid-flow-dense"),
|
|
666
1419
|
children: [
|
|
667
|
-
!
|
|
668
|
-
route:
|
|
1420
|
+
!i && /* @__PURE__ */ V(Ht, {
|
|
1421
|
+
route: a,
|
|
669
1422
|
label: o,
|
|
670
1423
|
subtitle: s,
|
|
671
|
-
chip:
|
|
1424
|
+
chip: r
|
|
672
1425
|
}),
|
|
673
|
-
|
|
1426
|
+
t.map(({ item: e, key: t, emphasis: r }) => /* @__PURE__ */ V("span", {
|
|
674
1427
|
className: "contents",
|
|
675
|
-
children:
|
|
676
|
-
},
|
|
677
|
-
c && /* @__PURE__ */
|
|
1428
|
+
children: n(e, r)
|
|
1429
|
+
}, t)),
|
|
1430
|
+
c && /* @__PURE__ */ V(Ut, {
|
|
678
1431
|
title: l,
|
|
679
1432
|
description: u
|
|
680
1433
|
})
|
|
681
1434
|
]
|
|
682
1435
|
});
|
|
683
1436
|
}
|
|
684
|
-
function
|
|
685
|
-
let { t: f } =
|
|
686
|
-
if (
|
|
687
|
-
|
|
1437
|
+
function Rt({ layout: t, resolved: n, canEditGlobal: r, isCustomized: i, renderTile: a, chip: o, hideNew: s, newRoute: c, newLabel: l, newSubtitle: u, onClose: d }) {
|
|
1438
|
+
let { t: f } = U(), [p, m] = z(n), [h, g] = z(null), _ = (t.saving ?? !1) || h !== null, v = (e) => _ && h === e ? { loading: !0 } : { "aria-disabled": _ || void 0 }, [y, b] = z(!1), x = (e, t) => async () => {
|
|
1439
|
+
if (t) {
|
|
1440
|
+
g(e), b(!1);
|
|
688
1441
|
try {
|
|
689
|
-
await
|
|
1442
|
+
await t(), d();
|
|
690
1443
|
} catch (e) {
|
|
691
|
-
console.error("Failed to save the bento layout", e),
|
|
1444
|
+
console.error("Failed to save the bento layout", e), b(!0);
|
|
1445
|
+
} finally {
|
|
1446
|
+
g(null);
|
|
692
1447
|
}
|
|
693
1448
|
}
|
|
694
|
-
},
|
|
695
|
-
function
|
|
1449
|
+
}, S = He(Ve(ze, { activationConstraint: { distance: 8 } }), Ve(Re));
|
|
1450
|
+
function C(e) {
|
|
696
1451
|
let { active: t, over: n } = e;
|
|
697
1452
|
!n || t.id === n.id || m((e) => {
|
|
698
1453
|
let r = e.findIndex((e) => e.key === t.id), i = e.findIndex((e) => e.key === n.id);
|
|
699
|
-
return r < 0 || i < 0 ? e :
|
|
1454
|
+
return r < 0 || i < 0 ? e : We(e, r, i);
|
|
700
1455
|
});
|
|
701
1456
|
}
|
|
702
|
-
function
|
|
1457
|
+
function w(e, t) {
|
|
703
1458
|
m((n) => n.map((n) => n.key === e ? {
|
|
704
1459
|
...n,
|
|
705
1460
|
emphasis: t
|
|
706
1461
|
} : n));
|
|
707
1462
|
}
|
|
708
|
-
let
|
|
709
|
-
return /* @__PURE__ */
|
|
1463
|
+
let T = L(() => wt(p), [p]), E = p.some((e) => e.emphasis === "SMALL");
|
|
1464
|
+
return /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("div", {
|
|
710
1465
|
className: "mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md",
|
|
711
1466
|
children: [
|
|
712
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ V("span", {
|
|
713
1468
|
className: "mr-auto text-sm text-muted-foreground",
|
|
714
1469
|
children: f("bento.layout.editHint", { defaultValue: "Drag tiles to reorder · tap the size button to resize" })
|
|
715
1470
|
}),
|
|
716
|
-
|
|
1471
|
+
i && t.onReset && /* @__PURE__ */ H(N, {
|
|
717
1472
|
variant: "ghost",
|
|
718
1473
|
size: "sm",
|
|
719
1474
|
className: "gap-2",
|
|
720
|
-
|
|
721
|
-
onClick:
|
|
722
|
-
children: [/* @__PURE__ */
|
|
1475
|
+
...v("reset"),
|
|
1476
|
+
onClick: x("reset", t.onReset),
|
|
1477
|
+
children: [h !== "reset" && /* @__PURE__ */ V(W, { size: 16 }), f("bento.layout.reset", { defaultValue: "Reset to default" })]
|
|
723
1478
|
}),
|
|
724
|
-
|
|
1479
|
+
r && t.onSaveGlobal && /* @__PURE__ */ H(N, {
|
|
725
1480
|
variant: "outline",
|
|
726
1481
|
size: "sm",
|
|
727
1482
|
className: "gap-2",
|
|
728
|
-
|
|
729
|
-
onClick:
|
|
730
|
-
children: [/* @__PURE__ */
|
|
1483
|
+
...v("global"),
|
|
1484
|
+
onClick: x("global", () => t.onSaveGlobal?.(T)),
|
|
1485
|
+
children: [h !== "global" && /* @__PURE__ */ V(De, { size: 16 }), f("bento.layout.saveGlobal", { defaultValue: "Set as default for everyone" })]
|
|
731
1486
|
}),
|
|
732
|
-
/* @__PURE__ */
|
|
1487
|
+
/* @__PURE__ */ H(N, {
|
|
733
1488
|
variant: "ghost",
|
|
734
1489
|
size: "sm",
|
|
735
1490
|
className: "gap-2",
|
|
736
|
-
|
|
1491
|
+
...v("cancel"),
|
|
737
1492
|
onClick: d,
|
|
738
|
-
children: [/* @__PURE__ */
|
|
1493
|
+
children: [/* @__PURE__ */ V(Oe, { size: 16 }), f("common.cancel", { defaultValue: "Cancel" })]
|
|
739
1494
|
}),
|
|
740
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ H(N, {
|
|
741
1496
|
size: "sm",
|
|
742
1497
|
className: "gap-2",
|
|
743
|
-
|
|
744
|
-
onClick:
|
|
745
|
-
children: [/* @__PURE__ */
|
|
1498
|
+
...v("save"),
|
|
1499
|
+
onClick: x("save", () => t.onSave(T)),
|
|
1500
|
+
children: [h !== "save" && /* @__PURE__ */ V(he, { size: 16 }), f("bento.layout.save", { defaultValue: "Save layout" })]
|
|
746
1501
|
}),
|
|
747
|
-
|
|
1502
|
+
y && /* @__PURE__ */ V("p", {
|
|
748
1503
|
role: "alert",
|
|
749
1504
|
className: "w-full text-sm text-destructive",
|
|
750
1505
|
children: f("bento.layout.saveFailed", { defaultValue: "The layout could not be saved. Nothing has changed — try again." })
|
|
751
1506
|
})
|
|
752
1507
|
]
|
|
753
|
-
}), /* @__PURE__ */
|
|
754
|
-
sensors:
|
|
755
|
-
collisionDetection:
|
|
756
|
-
onDragEnd:
|
|
757
|
-
children: /* @__PURE__ */
|
|
1508
|
+
}), /* @__PURE__ */ V(Le, {
|
|
1509
|
+
sensors: S,
|
|
1510
|
+
collisionDetection: Be,
|
|
1511
|
+
onDragEnd: C,
|
|
1512
|
+
children: /* @__PURE__ */ V(Ue, {
|
|
758
1513
|
items: p.map((e) => e.key),
|
|
759
|
-
strategy:
|
|
760
|
-
children: /* @__PURE__ */
|
|
761
|
-
className:
|
|
762
|
-
children: [!s && /* @__PURE__ */
|
|
1514
|
+
strategy: Ge,
|
|
1515
|
+
children: /* @__PURE__ */ H("div", {
|
|
1516
|
+
className: e(Pt, E && "grid-flow-dense"),
|
|
1517
|
+
children: [!s && /* @__PURE__ */ V(Ht, {
|
|
763
1518
|
route: c,
|
|
764
1519
|
label: l,
|
|
765
1520
|
subtitle: u,
|
|
766
1521
|
chip: o
|
|
767
|
-
}), p.map(({ item: e, key: t, emphasis: n }) => /* @__PURE__ */
|
|
1522
|
+
}), p.map(({ item: e, key: t, emphasis: n }) => /* @__PURE__ */ V(Vt, {
|
|
768
1523
|
id: t,
|
|
769
1524
|
emphasis: n,
|
|
770
|
-
onSetEmphasis: (e) =>
|
|
771
|
-
children:
|
|
1525
|
+
onSetEmphasis: (e) => w(t, e),
|
|
1526
|
+
children: a(e, n)
|
|
772
1527
|
}, t))]
|
|
773
1528
|
})
|
|
774
1529
|
})
|
|
775
1530
|
})] });
|
|
776
1531
|
}
|
|
777
|
-
var
|
|
1532
|
+
var zt = [
|
|
778
1533
|
"SMALL",
|
|
779
1534
|
"MEDIUM",
|
|
780
1535
|
"LARGE"
|
|
781
|
-
],
|
|
1536
|
+
], Bt = {
|
|
782
1537
|
SMALL: {
|
|
783
1538
|
key: "bento.layout.size.small",
|
|
784
1539
|
def: "Small"
|
|
@@ -792,45 +1547,45 @@ var Ze = [
|
|
|
792
1547
|
def: "Large"
|
|
793
1548
|
}
|
|
794
1549
|
};
|
|
795
|
-
function
|
|
796
|
-
let { t:
|
|
797
|
-
transform:
|
|
1550
|
+
function Vt({ id: t, emphasis: n, onSetEmphasis: r, children: i }) {
|
|
1551
|
+
let { t: a } = U(), { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } = Ke({ id: t }), f = {
|
|
1552
|
+
transform: qe.Translate.toString(l),
|
|
798
1553
|
transition: u,
|
|
799
1554
|
opacity: d ? .6 : 1,
|
|
800
1555
|
zIndex: d ? 50 : void 0
|
|
801
1556
|
};
|
|
802
|
-
return /* @__PURE__ */
|
|
1557
|
+
return /* @__PURE__ */ H("div", {
|
|
803
1558
|
ref: c,
|
|
804
1559
|
style: f,
|
|
805
|
-
className:
|
|
806
|
-
children: [/* @__PURE__ */
|
|
1560
|
+
className: e("relative h-full", xt[n]),
|
|
1561
|
+
children: [/* @__PURE__ */ V("div", {
|
|
807
1562
|
className: "pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full",
|
|
808
|
-
children:
|
|
809
|
-
}), /* @__PURE__ */
|
|
1563
|
+
children: i
|
|
1564
|
+
}), /* @__PURE__ */ H("div", {
|
|
810
1565
|
className: "absolute right-2 top-2 z-10 flex items-center gap-1",
|
|
811
|
-
children: [/* @__PURE__ */
|
|
1566
|
+
children: [/* @__PURE__ */ V("div", {
|
|
812
1567
|
role: "group",
|
|
813
|
-
"aria-label":
|
|
1568
|
+
"aria-label": a("bento.layout.sizeGroup", { defaultValue: "Tile size" }),
|
|
814
1569
|
className: "flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur",
|
|
815
|
-
children:
|
|
816
|
-
let
|
|
817
|
-
return /* @__PURE__ */
|
|
1570
|
+
children: zt.map((t) => {
|
|
1571
|
+
let i = t === n, o = a(Bt[t].key, { defaultValue: Bt[t].def });
|
|
1572
|
+
return /* @__PURE__ */ V("button", {
|
|
818
1573
|
type: "button",
|
|
819
|
-
onClick: () =>
|
|
820
|
-
"aria-pressed":
|
|
1574
|
+
onClick: () => r(t),
|
|
1575
|
+
"aria-pressed": i,
|
|
821
1576
|
"aria-label": o,
|
|
822
1577
|
title: o,
|
|
823
|
-
className:
|
|
1578
|
+
className: e("grid h-6 w-6 place-items-center rounded-full text-[11px] font-semibold uppercase transition-colors", i ? "bg-primary text-primary-foreground shadow" : "text-muted-foreground hover:bg-muted"),
|
|
824
1579
|
children: o.charAt(0)
|
|
825
|
-
},
|
|
1580
|
+
}, t);
|
|
826
1581
|
})
|
|
827
|
-
}), /* @__PURE__ */
|
|
1582
|
+
}), /* @__PURE__ */ V("button", {
|
|
828
1583
|
type: "button",
|
|
829
1584
|
...o,
|
|
830
1585
|
...s,
|
|
831
|
-
"aria-label":
|
|
1586
|
+
"aria-label": a("bento.layout.dragToReorder", { defaultValue: "Drag to reorder" }),
|
|
832
1587
|
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",
|
|
833
|
-
children: /* @__PURE__ */
|
|
1588
|
+
children: /* @__PURE__ */ V(ge, {
|
|
834
1589
|
size: 14,
|
|
835
1590
|
className: "text-muted-foreground"
|
|
836
1591
|
})
|
|
@@ -838,35 +1593,35 @@ function $e({ id: e, emphasis: t, onSetEmphasis: n, children: r }) {
|
|
|
838
1593
|
})]
|
|
839
1594
|
});
|
|
840
1595
|
}
|
|
841
|
-
function
|
|
842
|
-
let { t: i } =
|
|
843
|
-
return /* @__PURE__ */
|
|
1596
|
+
function Ht({ route: e, label: t, subtitle: n, chip: r }) {
|
|
1597
|
+
let { t: i } = U();
|
|
1598
|
+
return /* @__PURE__ */ H(Z, {
|
|
844
1599
|
to: e,
|
|
845
1600
|
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",
|
|
846
|
-
children: [/* @__PURE__ */
|
|
1601
|
+
children: [/* @__PURE__ */ H("div", {
|
|
847
1602
|
className: "flex items-center gap-3",
|
|
848
|
-
children: [/* @__PURE__ */
|
|
1603
|
+
children: [/* @__PURE__ */ V("span", {
|
|
849
1604
|
className: `bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,
|
|
850
|
-
children: /* @__PURE__ */
|
|
851
|
-
}), /* @__PURE__ */
|
|
1605
|
+
children: /* @__PURE__ */ V(xe, { size: 20 })
|
|
1606
|
+
}), /* @__PURE__ */ V("span", {
|
|
852
1607
|
className: "text-[11px] uppercase tracking-wider text-muted-foreground",
|
|
853
1608
|
children: i("forms.formActions.new", { defaultValue: "New" })
|
|
854
1609
|
})]
|
|
855
|
-
}), /* @__PURE__ */
|
|
1610
|
+
}), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("div", {
|
|
856
1611
|
className: "text-base font-semibold tracking-tight md:text-lg",
|
|
857
|
-
children: /* @__PURE__ */
|
|
1612
|
+
children: /* @__PURE__ */ V("span", {
|
|
858
1613
|
className: `${r} bg-clip-text text-transparent`,
|
|
859
1614
|
children: t
|
|
860
1615
|
})
|
|
861
|
-
}), n && /* @__PURE__ */
|
|
1616
|
+
}), n && /* @__PURE__ */ V("p", {
|
|
862
1617
|
className: "mt-1 text-sm text-muted-foreground",
|
|
863
1618
|
children: n
|
|
864
1619
|
})] })]
|
|
865
1620
|
});
|
|
866
1621
|
}
|
|
867
|
-
function
|
|
868
|
-
return /* @__PURE__ */
|
|
869
|
-
icon:
|
|
1622
|
+
function Ut({ title: e, description: t }) {
|
|
1623
|
+
return /* @__PURE__ */ V(it, {
|
|
1624
|
+
icon: Ce,
|
|
870
1625
|
title: e,
|
|
871
1626
|
description: t,
|
|
872
1627
|
align: "start",
|
|
@@ -875,189 +1630,230 @@ function tt({ title: e, description: t }) {
|
|
|
875
1630
|
}
|
|
876
1631
|
//#endregion
|
|
877
1632
|
//#region src/bento/bento-save-bar.tsx
|
|
878
|
-
function
|
|
879
|
-
let { t:
|
|
880
|
-
return /* @__PURE__ */
|
|
1633
|
+
function Wt({ title: e, badges: t, actions: n, onCancel: r, loading: i, disabled: o, dirty: s, titleMissing: c }) {
|
|
1634
|
+
let { t: l } = U();
|
|
1635
|
+
return /* @__PURE__ */ H("div", {
|
|
881
1636
|
className: "bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl",
|
|
882
|
-
children: [/* @__PURE__ */
|
|
1637
|
+
children: [/* @__PURE__ */ H("div", {
|
|
883
1638
|
className: "flex min-w-0 items-center gap-3",
|
|
884
1639
|
children: [
|
|
885
|
-
e && /* @__PURE__ */
|
|
1640
|
+
e && /* @__PURE__ */ V("p", {
|
|
886
1641
|
className: "truncate text-base font-semibold tracking-tight md:text-lg",
|
|
887
1642
|
children: e
|
|
888
1643
|
}),
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
titleMissing:
|
|
891
|
-
dirty:
|
|
1644
|
+
/* @__PURE__ */ V(lt, {
|
|
1645
|
+
titleMissing: c,
|
|
1646
|
+
dirty: s
|
|
892
1647
|
}),
|
|
893
|
-
t && /* @__PURE__ */
|
|
1648
|
+
t && /* @__PURE__ */ V("div", {
|
|
894
1649
|
className: "flex shrink-0 items-center gap-1.5",
|
|
895
1650
|
children: t
|
|
896
1651
|
})
|
|
897
1652
|
]
|
|
898
|
-
}), /* @__PURE__ */
|
|
1653
|
+
}), /* @__PURE__ */ V("div", {
|
|
899
1654
|
className: "flex shrink-0 gap-2",
|
|
900
|
-
children: n ?? /* @__PURE__ */
|
|
1655
|
+
children: n ?? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H(a, {
|
|
901
1656
|
type: "submit",
|
|
902
1657
|
size: "sm",
|
|
903
1658
|
loading: i,
|
|
904
|
-
disabled:
|
|
905
|
-
children: [/* @__PURE__ */
|
|
906
|
-
}), r && /* @__PURE__ */
|
|
1659
|
+
"aria-disabled": o ? "true" : void 0,
|
|
1660
|
+
children: [/* @__PURE__ */ V(he, { className: "size-4" }), l("forms.formActions.saveChanges")]
|
|
1661
|
+
}), r && /* @__PURE__ */ H(a, {
|
|
907
1662
|
type: "button",
|
|
908
1663
|
variant: "outline",
|
|
909
1664
|
size: "sm",
|
|
910
1665
|
onClick: r,
|
|
911
|
-
children: [/* @__PURE__ */
|
|
1666
|
+
children: [/* @__PURE__ */ V(Oe, { className: "size-4" }), l("forms.formActions.cancel")]
|
|
912
1667
|
})] })
|
|
913
1668
|
})]
|
|
914
1669
|
});
|
|
915
1670
|
}
|
|
916
|
-
function
|
|
917
|
-
return /* @__PURE__ */
|
|
1671
|
+
function Gt({ children: e }) {
|
|
1672
|
+
return /* @__PURE__ */ V("span", {
|
|
918
1673
|
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",
|
|
919
1674
|
children: e
|
|
920
1675
|
});
|
|
921
1676
|
}
|
|
922
|
-
|
|
1677
|
+
Wt.Badge = Gt;
|
|
923
1678
|
//#endregion
|
|
924
1679
|
//#region src/bento/bento-scroll-save-bar.tsx
|
|
925
|
-
function
|
|
926
|
-
let t =
|
|
927
|
-
return
|
|
928
|
-
/* @__PURE__ */
|
|
1680
|
+
function Kt(e) {
|
|
1681
|
+
let t = R(null);
|
|
1682
|
+
return ut(t), /* @__PURE__ */ H(B, { children: [
|
|
1683
|
+
/* @__PURE__ */ V("div", {
|
|
929
1684
|
ref: t,
|
|
930
1685
|
"aria-hidden": !0,
|
|
931
1686
|
className: "h-px"
|
|
932
1687
|
}),
|
|
933
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ V("div", {
|
|
934
1689
|
"aria-hidden": !0,
|
|
935
1690
|
className: "bento-save-bar-spacer"
|
|
936
1691
|
}),
|
|
937
|
-
/* @__PURE__ */
|
|
1692
|
+
/* @__PURE__ */ V("div", {
|
|
938
1693
|
className: "bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8",
|
|
939
|
-
children: /* @__PURE__ */
|
|
1694
|
+
children: /* @__PURE__ */ V(Wt, { ...e })
|
|
940
1695
|
})
|
|
941
1696
|
] });
|
|
942
1697
|
}
|
|
943
1698
|
//#endregion
|
|
944
1699
|
//#region src/bento/bento-form-hero.tsx
|
|
945
|
-
function
|
|
946
|
-
let { t:
|
|
947
|
-
return /* @__PURE__ */
|
|
948
|
-
eyebrow: t === void 0 ? e : /* @__PURE__ */
|
|
1700
|
+
function qt({ eyebrow: e, backTo: t, backLabel: n, leading: r, title: i, subtitle: o, trailing: s, onCancel: c, actions: l, loading: u, dirty: d, titleMissing: f, saveDisabled: p, stickyTitle: m, stickyBadges: h }) {
|
|
1701
|
+
let { t: g } = U(), _ = p ?? (!!f || !d);
|
|
1702
|
+
return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(ot, {
|
|
1703
|
+
eyebrow: t === void 0 ? e : /* @__PURE__ */ V(at, {
|
|
949
1704
|
to: t,
|
|
950
1705
|
children: n
|
|
951
1706
|
}),
|
|
952
1707
|
leading: r,
|
|
953
1708
|
title: i,
|
|
954
|
-
subtitle:
|
|
955
|
-
trailing: /* @__PURE__ */
|
|
1709
|
+
subtitle: o,
|
|
1710
|
+
trailing: /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
|
|
956
1711
|
className: "bento-fade-out flex shrink-0 items-center gap-2",
|
|
957
|
-
children:
|
|
1712
|
+
children: l ?? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H(a, {
|
|
958
1713
|
type: "submit",
|
|
959
1714
|
size: "sm",
|
|
960
|
-
loading:
|
|
961
|
-
disabled:
|
|
962
|
-
children: [/* @__PURE__ */
|
|
963
|
-
}), /* @__PURE__ */
|
|
1715
|
+
loading: u,
|
|
1716
|
+
"aria-disabled": _ ? "true" : void 0,
|
|
1717
|
+
children: [/* @__PURE__ */ V(he, { className: "size-4" }), g("forms.formActions.saveChanges")]
|
|
1718
|
+
}), /* @__PURE__ */ H(a, {
|
|
964
1719
|
type: "button",
|
|
965
1720
|
variant: "outline",
|
|
966
1721
|
size: "sm",
|
|
967
|
-
onClick:
|
|
968
|
-
children: [/* @__PURE__ */
|
|
1722
|
+
onClick: c,
|
|
1723
|
+
children: [/* @__PURE__ */ V(Oe, { className: "size-4" }), g("forms.formActions.cancel")]
|
|
969
1724
|
})] })
|
|
970
|
-
}),
|
|
971
|
-
}), /* @__PURE__ */
|
|
972
|
-
title:
|
|
973
|
-
badges:
|
|
974
|
-
actions:
|
|
975
|
-
onCancel:
|
|
976
|
-
loading:
|
|
977
|
-
disabled:
|
|
978
|
-
dirty:
|
|
979
|
-
titleMissing:
|
|
1725
|
+
}), s] })
|
|
1726
|
+
}), /* @__PURE__ */ V(Kt, {
|
|
1727
|
+
title: m,
|
|
1728
|
+
badges: h,
|
|
1729
|
+
actions: l,
|
|
1730
|
+
onCancel: c,
|
|
1731
|
+
loading: u,
|
|
1732
|
+
disabled: _,
|
|
1733
|
+
dirty: d,
|
|
1734
|
+
titleMissing: f
|
|
980
1735
|
})] });
|
|
981
1736
|
}
|
|
982
1737
|
//#endregion
|
|
983
1738
|
//#region src/bento/bento-form-section.tsx
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1739
|
+
var Jt = "bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6";
|
|
1740
|
+
function Yt({ icon: t, tone: n, title: r, description: i, children: a, trailing: o, as: s = "h2", className: c }) {
|
|
1741
|
+
return /* @__PURE__ */ H("section", {
|
|
1742
|
+
className: e(Jt, c),
|
|
1743
|
+
children: [/* @__PURE__ */ H("header", {
|
|
988
1744
|
className: "flex items-start justify-between gap-3",
|
|
989
|
-
children: [/* @__PURE__ */
|
|
1745
|
+
children: [/* @__PURE__ */ H("div", {
|
|
990
1746
|
className: "flex items-center gap-3",
|
|
991
|
-
children: [/* @__PURE__ */
|
|
992
|
-
className: `grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${
|
|
993
|
-
children: /* @__PURE__ */
|
|
994
|
-
}), /* @__PURE__ */
|
|
1747
|
+
children: [/* @__PURE__ */ V("span", {
|
|
1748
|
+
className: `grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${Q(n)}`,
|
|
1749
|
+
children: /* @__PURE__ */ V(t, { size: 20 })
|
|
1750
|
+
}), /* @__PURE__ */ H("div", {
|
|
995
1751
|
className: "flex flex-col gap-0.5",
|
|
996
|
-
children: [/* @__PURE__ */
|
|
1752
|
+
children: [/* @__PURE__ */ V(s, {
|
|
997
1753
|
className: "text-base font-semibold tracking-tight md:text-lg",
|
|
998
|
-
children: n
|
|
999
|
-
}), r && /* @__PURE__ */ I("p", {
|
|
1000
|
-
className: "text-sm text-muted-foreground",
|
|
1001
1754
|
children: r
|
|
1755
|
+
}), i && /* @__PURE__ */ V("p", {
|
|
1756
|
+
className: "text-sm text-muted-foreground",
|
|
1757
|
+
children: i
|
|
1002
1758
|
})]
|
|
1003
1759
|
})]
|
|
1004
|
-
}),
|
|
1760
|
+
}), o && /* @__PURE__ */ V("div", {
|
|
1005
1761
|
className: "shrink-0",
|
|
1006
|
-
children:
|
|
1762
|
+
children: o
|
|
1007
1763
|
})]
|
|
1008
|
-
}), /* @__PURE__ */
|
|
1764
|
+
}), /* @__PURE__ */ V("div", {
|
|
1009
1765
|
className: "flex flex-col gap-5",
|
|
1010
|
-
children:
|
|
1766
|
+
children: a
|
|
1011
1767
|
})]
|
|
1012
1768
|
});
|
|
1013
1769
|
}
|
|
1014
1770
|
//#endregion
|
|
1015
1771
|
//#region src/bento/bento-panel.tsx
|
|
1016
|
-
function
|
|
1017
|
-
return /* @__PURE__ */
|
|
1018
|
-
className:
|
|
1019
|
-
children: /* @__PURE__ */
|
|
1020
|
-
className:
|
|
1021
|
-
children:
|
|
1772
|
+
function Xt({ children: t, className: n, contentClassName: r }) {
|
|
1773
|
+
return /* @__PURE__ */ V("div", {
|
|
1774
|
+
className: e("bento-glass rounded-2xl shadow-md", n),
|
|
1775
|
+
children: /* @__PURE__ */ V("div", {
|
|
1776
|
+
className: r,
|
|
1777
|
+
children: t
|
|
1022
1778
|
})
|
|
1023
1779
|
});
|
|
1024
1780
|
}
|
|
1025
1781
|
//#endregion
|
|
1026
1782
|
//#region src/bento/bento-back-to-top.tsx
|
|
1027
|
-
var
|
|
1028
|
-
function
|
|
1783
|
+
var Zt = 480;
|
|
1784
|
+
function Qt(e) {
|
|
1029
1785
|
return window.addEventListener("scroll", e, { passive: !0 }), () => window.removeEventListener("scroll", e);
|
|
1030
1786
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return window.scrollY >
|
|
1787
|
+
function $t() {
|
|
1788
|
+
return window.scrollY > Zt;
|
|
1033
1789
|
}
|
|
1034
|
-
function
|
|
1035
|
-
let { t
|
|
1036
|
-
return /* @__PURE__ */
|
|
1790
|
+
function en({ inline: e = !1 } = {}) {
|
|
1791
|
+
let { t } = U(), n = w(), r = e || n, i = ie(Qt, $t, () => !1);
|
|
1792
|
+
return /* @__PURE__ */ V("button", {
|
|
1037
1793
|
type: "button",
|
|
1038
|
-
"aria-label":
|
|
1039
|
-
tabIndex:
|
|
1794
|
+
"aria-label": t("bento.backToTop", { defaultValue: "Back to top" }),
|
|
1795
|
+
tabIndex: i ? 0 : -1,
|
|
1040
1796
|
onClick: () => window.scrollTo({
|
|
1041
1797
|
top: 0,
|
|
1042
1798
|
behavior: "smooth"
|
|
1043
1799
|
}),
|
|
1044
|
-
className:
|
|
1045
|
-
children: /* @__PURE__ */
|
|
1800
|
+
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"}`,
|
|
1801
|
+
children: /* @__PURE__ */ V(ue, { size: 18 })
|
|
1046
1802
|
});
|
|
1047
1803
|
}
|
|
1048
1804
|
//#endregion
|
|
1049
1805
|
//#region src/bento/bento-nav.ts
|
|
1050
|
-
function
|
|
1806
|
+
function tn(e) {
|
|
1051
1807
|
return e.bentoRoute ?? e.fallbackRoute;
|
|
1052
1808
|
}
|
|
1053
1809
|
//#endregion
|
|
1054
1810
|
//#region src/bento/bento-command-palette.tsx
|
|
1055
|
-
function
|
|
1056
|
-
|
|
1057
|
-
|
|
1811
|
+
function nn({ label: e, children: t }) {
|
|
1812
|
+
return e ? /* @__PURE__ */ H("div", {
|
|
1813
|
+
role: "group",
|
|
1814
|
+
"aria-label": e,
|
|
1815
|
+
children: [/* @__PURE__ */ V("p", {
|
|
1816
|
+
className: "px-3 pt-2 pb-1 text-xs font-medium text-muted-foreground",
|
|
1817
|
+
children: e
|
|
1818
|
+
}), t]
|
|
1819
|
+
}) : /* @__PURE__ */ V(B, { children: t });
|
|
1820
|
+
}
|
|
1821
|
+
function rn({ index: e, active: t, icon: n, label: r, description: i, trailing: a, onActivate: o, onChoose: s }) {
|
|
1822
|
+
return /* @__PURE__ */ H("button", {
|
|
1823
|
+
type: "button",
|
|
1824
|
+
id: `bento-palette-opt-${e}`,
|
|
1825
|
+
"data-index": e,
|
|
1826
|
+
role: "option",
|
|
1827
|
+
"aria-selected": t ? "true" : "false",
|
|
1828
|
+
onMouseEnter: o,
|
|
1829
|
+
onClick: s,
|
|
1830
|
+
className: `flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${t ? "bg-accent text-accent-foreground" : "text-foreground"}`,
|
|
1831
|
+
children: [
|
|
1832
|
+
n && /* @__PURE__ */ V(n, {
|
|
1833
|
+
size: 18,
|
|
1834
|
+
className: "shrink-0 text-muted-foreground"
|
|
1835
|
+
}),
|
|
1836
|
+
/* @__PURE__ */ H("span", {
|
|
1837
|
+
className: "flex-1 truncate",
|
|
1838
|
+
children: [r, i && /* @__PURE__ */ V("span", {
|
|
1839
|
+
className: "ml-2 text-muted-foreground",
|
|
1840
|
+
children: i
|
|
1841
|
+
})]
|
|
1842
|
+
}),
|
|
1843
|
+
a ?? (t && /* @__PURE__ */ V(le, {
|
|
1844
|
+
"aria-hidden": !0,
|
|
1845
|
+
size: 15,
|
|
1846
|
+
className: "shrink-0 text-muted-foreground"
|
|
1847
|
+
}))
|
|
1848
|
+
]
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
function an({ open: e, onOpenChange: t, items: a, group: o, onQueryChange: c }) {
|
|
1852
|
+
let { t: l } = U(), u = Me(), [d, f] = z(""), [p, m] = z(0), h = R(null), g = L(() => {
|
|
1853
|
+
let e = d.trim().toLowerCase(), t = a.map((e) => ({
|
|
1058
1854
|
item: e,
|
|
1059
|
-
label:
|
|
1060
|
-
description:
|
|
1855
|
+
label: l(e.titleKey),
|
|
1856
|
+
description: l(e.descriptionKey)
|
|
1061
1857
|
}));
|
|
1062
1858
|
if (!e) return t;
|
|
1063
1859
|
let n = [], r = [];
|
|
@@ -1065,169 +1861,354 @@ function pt({ open: n, onOpenChange: i, items: a }) {
|
|
|
1065
1861
|
return [...n, ...r];
|
|
1066
1862
|
}, [
|
|
1067
1863
|
a,
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
]), [
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1864
|
+
d,
|
|
1865
|
+
l
|
|
1866
|
+
]), _ = L(() => [...g.map((e) => ({
|
|
1867
|
+
kind: "nav",
|
|
1868
|
+
entry: e
|
|
1869
|
+
})), ...(o?.items ?? []).map((e) => ({
|
|
1870
|
+
kind: "supplied",
|
|
1871
|
+
item: e
|
|
1872
|
+
}))], [g, o]), v = R(c);
|
|
1873
|
+
F(() => {
|
|
1874
|
+
v.current = c;
|
|
1875
|
+
}), F(() => {
|
|
1876
|
+
v.current?.(d);
|
|
1877
|
+
}, [d]);
|
|
1878
|
+
let [y, b] = z(e);
|
|
1879
|
+
e !== y && (b(e), e && (f(""), m(0)));
|
|
1880
|
+
let x = _.length === 0 ? 0 : _.length - 1;
|
|
1881
|
+
p > x && m(x), F(() => {
|
|
1882
|
+
(h.current?.querySelector(`[data-index="${p}"]`))?.scrollIntoView({ block: "nearest" });
|
|
1883
|
+
}, [p]);
|
|
1884
|
+
function S(e) {
|
|
1885
|
+
t(!1), e.kind === "nav" ? u(tn(e.entry.item)) : o?.onSelect(e.item);
|
|
1078
1886
|
}
|
|
1079
|
-
function
|
|
1080
|
-
if (e.key === "ArrowDown") e.preventDefault(),
|
|
1081
|
-
else if (e.key === "ArrowUp") e.preventDefault(),
|
|
1887
|
+
function C(e) {
|
|
1888
|
+
if (e.key === "ArrowDown") e.preventDefault(), m((e) => _.length === 0 ? 0 : (e + 1) % _.length);
|
|
1889
|
+
else if (e.key === "ArrowUp") e.preventDefault(), m((e) => _.length === 0 ? 0 : (e - 1 + _.length) % _.length);
|
|
1082
1890
|
else if (e.key === "Enter") {
|
|
1083
1891
|
e.preventDefault();
|
|
1084
|
-
let t =
|
|
1085
|
-
t &&
|
|
1892
|
+
let t = _[p];
|
|
1893
|
+
t && S(t);
|
|
1086
1894
|
}
|
|
1087
1895
|
}
|
|
1088
|
-
return /* @__PURE__ */
|
|
1089
|
-
open:
|
|
1090
|
-
onOpenChange:
|
|
1091
|
-
children: /* @__PURE__ */
|
|
1896
|
+
return /* @__PURE__ */ V(n, {
|
|
1897
|
+
open: e,
|
|
1898
|
+
onOpenChange: t,
|
|
1899
|
+
children: /* @__PURE__ */ H(s, {
|
|
1092
1900
|
showCloseButton: !1,
|
|
1093
1901
|
className: "top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0",
|
|
1094
|
-
onKeyDown:
|
|
1902
|
+
onKeyDown: C,
|
|
1095
1903
|
children: [
|
|
1096
|
-
/* @__PURE__ */
|
|
1904
|
+
/* @__PURE__ */ V(i, {
|
|
1097
1905
|
className: "sr-only",
|
|
1098
|
-
children:
|
|
1906
|
+
children: l("bento.palette.title", { defaultValue: "Command palette" })
|
|
1099
1907
|
}),
|
|
1100
|
-
/* @__PURE__ */
|
|
1908
|
+
/* @__PURE__ */ V(r, {
|
|
1101
1909
|
className: "sr-only",
|
|
1102
|
-
children:
|
|
1910
|
+
children: l("bento.palette.description", { defaultValue: "Search and jump to any area" })
|
|
1103
1911
|
}),
|
|
1104
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ H("div", {
|
|
1105
1913
|
className: "flex items-center gap-3 border-b border-border/60 px-4",
|
|
1106
|
-
children: [/* @__PURE__ */
|
|
1914
|
+
children: [/* @__PURE__ */ V(Se, {
|
|
1107
1915
|
size: 18,
|
|
1108
1916
|
className: "shrink-0 text-muted-foreground"
|
|
1109
|
-
}), /* @__PURE__ */
|
|
1917
|
+
}), /* @__PURE__ */ V("input", {
|
|
1110
1918
|
autoFocus: !0,
|
|
1111
1919
|
type: "text",
|
|
1112
1920
|
role: "combobox",
|
|
1113
1921
|
"aria-expanded": "true",
|
|
1114
1922
|
"aria-controls": "bento-palette-list",
|
|
1115
|
-
"aria-activedescendant":
|
|
1116
|
-
value:
|
|
1117
|
-
onChange: (e) =>
|
|
1118
|
-
placeholder:
|
|
1923
|
+
"aria-activedescendant": _[p] ? `bento-palette-opt-${p}` : void 0,
|
|
1924
|
+
value: d,
|
|
1925
|
+
onChange: (e) => f(e.target.value),
|
|
1926
|
+
placeholder: l("bento.palette.placeholder", { defaultValue: "Search areas…" }),
|
|
1119
1927
|
className: "h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
|
1120
1928
|
})]
|
|
1121
1929
|
}),
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
ref:
|
|
1930
|
+
/* @__PURE__ */ H("div", {
|
|
1931
|
+
ref: h,
|
|
1124
1932
|
id: "bento-palette-list",
|
|
1125
1933
|
role: "listbox",
|
|
1126
|
-
"aria-label":
|
|
1934
|
+
"aria-label": l("bento.palette.title", { defaultValue: "Command palette" }),
|
|
1127
1935
|
className: "max-h-80 overflow-y-auto p-2",
|
|
1128
|
-
children: [
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
/* @__PURE__ */ I(a, {
|
|
1144
|
-
size: 18,
|
|
1145
|
-
className: "shrink-0 text-muted-foreground"
|
|
1146
|
-
}),
|
|
1147
|
-
/* @__PURE__ */ I("span", {
|
|
1148
|
-
className: "flex-1 truncate",
|
|
1149
|
-
children: t
|
|
1150
|
-
}),
|
|
1151
|
-
r ? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(se, {
|
|
1936
|
+
children: [
|
|
1937
|
+
_.length === 0 && !o?.pending && /* @__PURE__ */ V("p", {
|
|
1938
|
+
className: "px-3 py-6 text-center text-sm text-muted-foreground",
|
|
1939
|
+
children: l("bento.palette.noResults", { defaultValue: "No matches" })
|
|
1940
|
+
}),
|
|
1941
|
+
/* @__PURE__ */ V(nn, {
|
|
1942
|
+
label: o && g.length > 0 ? l("bento.palette.areas", { defaultValue: "Areas" }) : void 0,
|
|
1943
|
+
children: g.map(({ item: e, label: t }, n) => /* @__PURE__ */ V(rn, {
|
|
1944
|
+
index: n,
|
|
1945
|
+
active: n === p,
|
|
1946
|
+
icon: e.icon,
|
|
1947
|
+
label: t,
|
|
1948
|
+
onActivate: () => m(n),
|
|
1949
|
+
onChoose: () => S(_[n]),
|
|
1950
|
+
trailing: e.bentoRoute ? void 0 : /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(J, {
|
|
1152
1951
|
"aria-hidden": !0,
|
|
1153
1952
|
size: 15,
|
|
1154
1953
|
className: "shrink-0 text-muted-foreground/70"
|
|
1155
|
-
}), /* @__PURE__ */
|
|
1954
|
+
}), /* @__PURE__ */ V("span", {
|
|
1156
1955
|
className: "sr-only",
|
|
1157
|
-
children:
|
|
1158
|
-
})] })
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1956
|
+
children: l("bento.palette.opensConsole", { defaultValue: "Opens in console" })
|
|
1957
|
+
})] })
|
|
1958
|
+
}, e.id))
|
|
1959
|
+
}),
|
|
1960
|
+
o && /* @__PURE__ */ H(nn, {
|
|
1961
|
+
label: o.label,
|
|
1962
|
+
children: [o.items.map((e, t) => {
|
|
1963
|
+
let n = g.length + t;
|
|
1964
|
+
return /* @__PURE__ */ V(rn, {
|
|
1965
|
+
index: n,
|
|
1966
|
+
active: n === p,
|
|
1967
|
+
icon: e.icon,
|
|
1968
|
+
label: e.label,
|
|
1969
|
+
description: e.description,
|
|
1970
|
+
onActivate: () => m(n),
|
|
1971
|
+
onChoose: () => S(_[n])
|
|
1972
|
+
}, e.id);
|
|
1973
|
+
}), o.pending && /* @__PURE__ */ V("p", {
|
|
1974
|
+
className: "px-3 py-2.5 text-sm text-muted-foreground",
|
|
1975
|
+
children: l("bento.palette.searching", { defaultValue: "Searching…" })
|
|
1976
|
+
})]
|
|
1977
|
+
})
|
|
1978
|
+
]
|
|
1166
1979
|
})
|
|
1167
1980
|
]
|
|
1168
1981
|
})
|
|
1169
1982
|
});
|
|
1170
1983
|
}
|
|
1171
1984
|
//#endregion
|
|
1985
|
+
//#region src/bento/bento-shell.tsx
|
|
1986
|
+
function on({ rail: t, headerStart: n, headerEnd: r, column: i = "default", dock: a, backToTop: o = !0, children: s }) {
|
|
1987
|
+
let { t: c } = U(), l = Ae(), u = I(), d = R(null), f = R(null), p = i === "full", m = n != null || r != null, h = o || a != null;
|
|
1988
|
+
return /* @__PURE__ */ H("div", {
|
|
1989
|
+
"data-slot": "bento-shell",
|
|
1990
|
+
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"),
|
|
1991
|
+
children: [
|
|
1992
|
+
/* @__PURE__ */ V("a", {
|
|
1993
|
+
href: `#${u}`,
|
|
1994
|
+
onClick: (e) => {
|
|
1995
|
+
e.preventDefault(), d.current?.focus();
|
|
1996
|
+
},
|
|
1997
|
+
className: "sr-only rounded-full border border-border/60 bg-card px-4 py-2 text-sm shadow-lg focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[60]",
|
|
1998
|
+
children: c("bento.shell.skip", { defaultValue: "Skip to content" })
|
|
1999
|
+
}),
|
|
2000
|
+
/* @__PURE__ */ V("span", {
|
|
2001
|
+
ref: f,
|
|
2002
|
+
role: "status",
|
|
2003
|
+
"aria-live": "polite",
|
|
2004
|
+
className: "sr-only"
|
|
2005
|
+
}),
|
|
2006
|
+
l && /* @__PURE__ */ V(sn, {
|
|
2007
|
+
main: d,
|
|
2008
|
+
announcer: f
|
|
2009
|
+
}),
|
|
2010
|
+
t,
|
|
2011
|
+
m && /* @__PURE__ */ H("header", {
|
|
2012
|
+
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",
|
|
2013
|
+
children: [/* @__PURE__ */ V("div", {
|
|
2014
|
+
className: "flex min-w-0 items-center gap-3",
|
|
2015
|
+
children: n
|
|
2016
|
+
}), /* @__PURE__ */ V("div", {
|
|
2017
|
+
className: "flex items-center gap-2",
|
|
2018
|
+
children: r
|
|
2019
|
+
})]
|
|
2020
|
+
}),
|
|
2021
|
+
/* @__PURE__ */ V("main", {
|
|
2022
|
+
ref: d,
|
|
2023
|
+
id: u,
|
|
2024
|
+
tabIndex: -1,
|
|
2025
|
+
"aria-label": c("bento.shell.main", { defaultValue: "Main content" }),
|
|
2026
|
+
"data-column": i,
|
|
2027
|
+
className: "bento-shell-main",
|
|
2028
|
+
children: s
|
|
2029
|
+
}),
|
|
2030
|
+
h && /* @__PURE__ */ V("div", {
|
|
2031
|
+
"data-slot": "bento-shell-corner",
|
|
2032
|
+
className: "pointer-events-none fixed bottom-5 right-5 z-50 flex flex-col items-end gap-3",
|
|
2033
|
+
children: /* @__PURE__ */ H(k.Provider, {
|
|
2034
|
+
value: !0,
|
|
2035
|
+
children: [o && /* @__PURE__ */ V(en, {}), a]
|
|
2036
|
+
})
|
|
2037
|
+
})
|
|
2038
|
+
]
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
function sn({ main: e, announcer: t }) {
|
|
2042
|
+
let { pathname: n } = je(), r = R(n);
|
|
2043
|
+
return F(() => {
|
|
2044
|
+
if (r.current === n) return;
|
|
2045
|
+
r.current = n;
|
|
2046
|
+
let i = 0, a, o = () => {
|
|
2047
|
+
let n = e.current?.querySelector("h1") ?? null;
|
|
2048
|
+
if (!n && i++ < 20) {
|
|
2049
|
+
a = setTimeout(o, 50);
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2052
|
+
n && !n.hasAttribute("tabindex") && n.setAttribute("tabindex", "-1"), (n ?? e.current)?.focus(), t.current && (t.current.textContent = n?.textContent?.trim() || document.title);
|
|
2053
|
+
};
|
|
2054
|
+
return o(), () => clearTimeout(a);
|
|
2055
|
+
}, [
|
|
2056
|
+
n,
|
|
2057
|
+
e,
|
|
2058
|
+
t
|
|
2059
|
+
]), null;
|
|
2060
|
+
}
|
|
2061
|
+
//#endregion
|
|
2062
|
+
//#region src/bento/bento-shell-shortcuts.ts
|
|
2063
|
+
var cn = Object.freeze([
|
|
2064
|
+
{
|
|
2065
|
+
action: "palette",
|
|
2066
|
+
key: "k",
|
|
2067
|
+
mod: !0
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
action: "palette",
|
|
2071
|
+
key: "/"
|
|
2072
|
+
},
|
|
2073
|
+
{
|
|
2074
|
+
action: "shortcuts",
|
|
2075
|
+
key: "?"
|
|
2076
|
+
}
|
|
2077
|
+
]);
|
|
2078
|
+
function ln() {
|
|
2079
|
+
return typeof navigator > "u" ? !1 : /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || "");
|
|
2080
|
+
}
|
|
2081
|
+
function un(e, t) {
|
|
2082
|
+
let n = e.key.length === 1 ? e.key.toUpperCase() : e.key;
|
|
2083
|
+
return e.mod ? [t ? "⌘" : "Ctrl", n] : [n];
|
|
2084
|
+
}
|
|
2085
|
+
function dn(e) {
|
|
2086
|
+
if (!(e instanceof HTMLElement)) return !1;
|
|
2087
|
+
if ([
|
|
2088
|
+
"INPUT",
|
|
2089
|
+
"TEXTAREA",
|
|
2090
|
+
"SELECT"
|
|
2091
|
+
].includes(e.tagName) || e.isContentEditable) return !0;
|
|
2092
|
+
let t = e.closest("[contenteditable]");
|
|
2093
|
+
return t !== null && t.getAttribute("contenteditable") !== "false";
|
|
2094
|
+
}
|
|
2095
|
+
function fn(e, t) {
|
|
2096
|
+
if (e.defaultPrevented || e.isComposing || e.repeat) return;
|
|
2097
|
+
let n = e.key.toLowerCase();
|
|
2098
|
+
return cn.find((r) => n === r.key ? r.mod ? (t ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey) && !e.altKey && !e.shiftKey : e.metaKey || dn(e.target) ? !1 : e.ctrlKey === e.altKey : !1);
|
|
2099
|
+
}
|
|
2100
|
+
function pn({ onPalette: e, onShortcuts: t, isMac: n = ln() }) {
|
|
2101
|
+
let r = R({
|
|
2102
|
+
onPalette: e,
|
|
2103
|
+
onShortcuts: t
|
|
2104
|
+
});
|
|
2105
|
+
F(() => {
|
|
2106
|
+
r.current = {
|
|
2107
|
+
onPalette: e,
|
|
2108
|
+
onShortcuts: t
|
|
2109
|
+
};
|
|
2110
|
+
}), F(() => {
|
|
2111
|
+
function e(e) {
|
|
2112
|
+
let t = fn(e, n), i = t?.action === "palette" ? r.current.onPalette : t && r.current.onShortcuts;
|
|
2113
|
+
i && (e.preventDefault(), i());
|
|
2114
|
+
}
|
|
2115
|
+
return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
|
|
2116
|
+
}, [n]);
|
|
2117
|
+
}
|
|
2118
|
+
//#endregion
|
|
2119
|
+
//#region src/bento/bento-palette-trigger.tsx
|
|
2120
|
+
function mn({ onClick: t, isMac: n = ln(), className: r }) {
|
|
2121
|
+
let { t: i } = U(), a = cn.filter((e) => e.action === "palette"), o = a.find((e) => e.mod);
|
|
2122
|
+
return /* @__PURE__ */ H("button", {
|
|
2123
|
+
type: "button",
|
|
2124
|
+
onClick: t,
|
|
2125
|
+
"aria-keyshortcuts": a.map((e) => e.mod ? `${n ? "Meta" : "Control"}+${e.key.toUpperCase()}` : e.key).join(" "),
|
|
2126
|
+
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),
|
|
2127
|
+
children: [
|
|
2128
|
+
/* @__PURE__ */ V(Se, {
|
|
2129
|
+
"aria-hidden": !0,
|
|
2130
|
+
size: 16
|
|
2131
|
+
}),
|
|
2132
|
+
/* @__PURE__ */ V("span", {
|
|
2133
|
+
className: "sr-only sm:not-sr-only",
|
|
2134
|
+
children: i("bento.palette.search", { defaultValue: "Search" })
|
|
2135
|
+
}),
|
|
2136
|
+
o && /* @__PURE__ */ V("kbd", {
|
|
2137
|
+
"aria-hidden": !0,
|
|
2138
|
+
className: "hidden rounded border border-border/60 bg-muted px-1.5 py-0.5 text-[10px] font-medium tracking-wide sm:inline",
|
|
2139
|
+
children: un(o, n).join(n ? "" : " ")
|
|
2140
|
+
})
|
|
2141
|
+
]
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
//#endregion
|
|
1172
2145
|
//#region src/bento/bento-shortcuts-dialog.tsx
|
|
1173
|
-
function
|
|
1174
|
-
let { t:
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
label:
|
|
1182
|
-
|
|
2146
|
+
function hn({ open: e, onOpenChange: t, isMac: a = ln() }) {
|
|
2147
|
+
let { t: c } = U(), l = {
|
|
2148
|
+
palette: c("bento.palette.open", { defaultValue: "Open command palette" }),
|
|
2149
|
+
shortcuts: c("bento.shortcuts.openGuide", { defaultValue: "Show keyboard shortcuts" })
|
|
2150
|
+
}, u = [...new Set(cn.map((e) => e.action))], d = [{
|
|
2151
|
+
heading: c("bento.shortcuts.global", { defaultValue: "Global" }),
|
|
2152
|
+
rows: u.map((e) => ({
|
|
2153
|
+
id: e,
|
|
2154
|
+
label: l[e],
|
|
2155
|
+
combos: cn.filter((t) => t.action === e).map((e) => un(e, a))
|
|
2156
|
+
}))
|
|
1183
2157
|
}, {
|
|
1184
|
-
heading:
|
|
2158
|
+
heading: c("bento.shortcuts.palette", { defaultValue: "Command palette" }),
|
|
1185
2159
|
rows: [
|
|
1186
2160
|
{
|
|
1187
|
-
|
|
1188
|
-
|
|
2161
|
+
id: "navigate",
|
|
2162
|
+
combos: [["↑", "↓"]],
|
|
2163
|
+
label: c("bento.shortcuts.navigate", { defaultValue: "Move between results" })
|
|
1189
2164
|
},
|
|
1190
2165
|
{
|
|
1191
|
-
|
|
1192
|
-
|
|
2166
|
+
id: "open",
|
|
2167
|
+
combos: [["↵"]],
|
|
2168
|
+
label: c("bento.shortcuts.openSelected", { defaultValue: "Open the selected area" })
|
|
1193
2169
|
},
|
|
1194
2170
|
{
|
|
1195
|
-
|
|
1196
|
-
|
|
2171
|
+
id: "dismiss",
|
|
2172
|
+
combos: [["Esc"]],
|
|
2173
|
+
label: c("bento.shortcuts.dismiss", { defaultValue: "Close the palette or a dialog" })
|
|
1197
2174
|
}
|
|
1198
2175
|
]
|
|
1199
2176
|
}];
|
|
1200
|
-
return /* @__PURE__ */
|
|
1201
|
-
open:
|
|
1202
|
-
onOpenChange:
|
|
1203
|
-
children: /* @__PURE__ */
|
|
2177
|
+
return /* @__PURE__ */ V(n, {
|
|
2178
|
+
open: e,
|
|
2179
|
+
onOpenChange: t,
|
|
2180
|
+
children: /* @__PURE__ */ H(s, {
|
|
1204
2181
|
className: "max-w-md",
|
|
1205
|
-
children: [/* @__PURE__ */
|
|
2182
|
+
children: [/* @__PURE__ */ H(o, { children: [/* @__PURE__ */ H(i, {
|
|
1206
2183
|
className: "flex items-center gap-2",
|
|
1207
|
-
children: [/* @__PURE__ */
|
|
2184
|
+
children: [/* @__PURE__ */ V(Y, {
|
|
1208
2185
|
size: 20,
|
|
1209
2186
|
className: "bento-accent-icon"
|
|
1210
|
-
}),
|
|
1211
|
-
}), /* @__PURE__ */
|
|
2187
|
+
}), c("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
|
|
2188
|
+
}), /* @__PURE__ */ V(r, { children: c("bento.shortcuts.description", { defaultValue: "Move around without leaving the keyboard." }) })] }), /* @__PURE__ */ V("div", {
|
|
1212
2189
|
className: "flex flex-col gap-5",
|
|
1213
|
-
children:
|
|
2190
|
+
children: d.map((e) => /* @__PURE__ */ H("section", { children: [/* @__PURE__ */ V("h3", {
|
|
1214
2191
|
className: "mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
|
|
1215
2192
|
children: e.heading
|
|
1216
|
-
}), /* @__PURE__ */
|
|
2193
|
+
}), /* @__PURE__ */ V("ul", {
|
|
1217
2194
|
className: "flex flex-col gap-1.5",
|
|
1218
|
-
children: e.rows.map((e) => /* @__PURE__ */
|
|
2195
|
+
children: e.rows.map((e) => /* @__PURE__ */ H("li", {
|
|
2196
|
+
"data-shortcut": e.id,
|
|
1219
2197
|
className: "flex items-center justify-between gap-4",
|
|
1220
|
-
children: [/* @__PURE__ */
|
|
2198
|
+
children: [/* @__PURE__ */ V("span", {
|
|
1221
2199
|
className: "text-sm text-foreground",
|
|
1222
2200
|
children: e.label
|
|
1223
|
-
}), /* @__PURE__ */
|
|
2201
|
+
}), /* @__PURE__ */ V("span", {
|
|
1224
2202
|
className: "flex shrink-0 items-center gap-1",
|
|
1225
|
-
children: e.
|
|
2203
|
+
children: e.combos.map((e, t) => /* @__PURE__ */ H(ne, { children: [t > 0 && /* @__PURE__ */ V("span", {
|
|
2204
|
+
className: "px-0.5 text-[11px] text-muted-foreground",
|
|
2205
|
+
children: c("bento.shortcuts.or", { defaultValue: "or" })
|
|
2206
|
+
}), e.map((e) => /* @__PURE__ */ V("kbd", {
|
|
1226
2207
|
className: "inline-flex min-w-6 items-center justify-center rounded-md border border-border/60 bg-muted px-1.5 py-0.5 text-[11px] font-medium tracking-wide",
|
|
1227
2208
|
children: e
|
|
1228
|
-
}, e))
|
|
2209
|
+
}, e))] }, e.join("+")))
|
|
1229
2210
|
})]
|
|
1230
|
-
}, e.
|
|
2211
|
+
}, e.id))
|
|
1231
2212
|
})] }, e.heading))
|
|
1232
2213
|
})]
|
|
1233
2214
|
})
|
|
@@ -1235,157 +2216,148 @@ function mt({ open: n, onOpenChange: a, isMac: o }) {
|
|
|
1235
2216
|
}
|
|
1236
2217
|
//#endregion
|
|
1237
2218
|
//#region src/bento/bento-nav-rail.tsx
|
|
1238
|
-
|
|
2219
|
+
var gn = ve;
|
|
2220
|
+
function _n(e, t) {
|
|
1239
2221
|
return e === t || e.startsWith(`${t}/`);
|
|
1240
2222
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return t.section.areaRoute &&
|
|
2223
|
+
function vn(e, t) {
|
|
2224
|
+
return t.section.areaRoute && _n(e, t.section.areaRoute) ? !0 : t.items.some((t) => t.bentoRoute && _n(e, t.bentoRoute));
|
|
1243
2225
|
}
|
|
1244
|
-
function
|
|
1245
|
-
let { t: i } =
|
|
1246
|
-
return /* @__PURE__ */
|
|
2226
|
+
function yn({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
|
|
2227
|
+
let { t: i } = U(), { pathname: a } = je(), o = L(() => e.filter((e) => !!e.section.areaRoute), [e]), s = a === t || (n?.includes(a) ?? !1);
|
|
2228
|
+
return /* @__PURE__ */ V(x, {
|
|
1247
2229
|
delayDuration: 200,
|
|
1248
|
-
children: /* @__PURE__ */
|
|
2230
|
+
children: /* @__PURE__ */ H("nav", {
|
|
1249
2231
|
"aria-label": i("bento.nav.label", { defaultValue: "Primary" }),
|
|
1250
2232
|
className: "fixed inset-y-0 left-0 z-40 hidden w-16 flex-col items-center gap-1 overflow-y-auto overflow-x-hidden border-r border-border/40 bg-background/55 pt-20 pb-4 backdrop-blur-xl backdrop-saturate-150 md:flex",
|
|
1251
2233
|
children: [
|
|
1252
|
-
/* @__PURE__ */
|
|
2234
|
+
/* @__PURE__ */ V(bn, {
|
|
1253
2235
|
to: t,
|
|
1254
|
-
icon:
|
|
2236
|
+
icon: _e,
|
|
1255
2237
|
label: r ?? i("home.title", { defaultValue: "Home" }),
|
|
1256
2238
|
active: s
|
|
1257
2239
|
}),
|
|
1258
|
-
o.length > 0 && /* @__PURE__ */
|
|
2240
|
+
o.length > 0 && /* @__PURE__ */ V("span", {
|
|
1259
2241
|
"aria-hidden": !0,
|
|
1260
2242
|
className: "my-1 h-px w-6 bg-border/60"
|
|
1261
2243
|
}),
|
|
1262
|
-
o.map((e) => /* @__PURE__ */
|
|
2244
|
+
o.map((e) => /* @__PURE__ */ V(bn, {
|
|
1263
2245
|
to: e.section.areaRoute,
|
|
1264
|
-
icon: e.section.icon,
|
|
1265
|
-
label: i(e.section.labelKey),
|
|
1266
|
-
active:
|
|
2246
|
+
icon: e.section.icon ?? gn,
|
|
2247
|
+
label: e.section.labelKey ? i(e.section.labelKey) : e.section.id,
|
|
2248
|
+
active: vn(a, e)
|
|
1267
2249
|
}, e.section.id))
|
|
1268
2250
|
]
|
|
1269
2251
|
})
|
|
1270
2252
|
});
|
|
1271
2253
|
}
|
|
1272
|
-
function
|
|
1273
|
-
return /* @__PURE__ */
|
|
2254
|
+
function bn({ to: e, icon: t, label: n, active: r }) {
|
|
2255
|
+
return /* @__PURE__ */ H(E, { children: [/* @__PURE__ */ V(S, {
|
|
1274
2256
|
asChild: !0,
|
|
1275
|
-
children: /* @__PURE__ */
|
|
2257
|
+
children: /* @__PURE__ */ V(Z, {
|
|
1276
2258
|
to: e,
|
|
1277
2259
|
"aria-label": n,
|
|
1278
2260
|
"aria-current": r ? "page" : void 0,
|
|
1279
2261
|
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"}`,
|
|
1280
|
-
children: /* @__PURE__ */
|
|
2262
|
+
children: /* @__PURE__ */ V(t, { size: 20 })
|
|
1281
2263
|
})
|
|
1282
|
-
}), /* @__PURE__ */
|
|
2264
|
+
}), /* @__PURE__ */ V(A, {
|
|
1283
2265
|
side: "right",
|
|
1284
2266
|
children: n
|
|
1285
2267
|
})] });
|
|
1286
2268
|
}
|
|
1287
2269
|
//#endregion
|
|
1288
2270
|
//#region src/bento/bento-user-menu.tsx
|
|
1289
|
-
function
|
|
1290
|
-
let { user:
|
|
1291
|
-
return
|
|
2271
|
+
function xn({ accountRoute: e, logoutUrl: t, organizationsRoute: n, tenantAdminRoute: r, onOpenShortcuts: i, onReplayTour: a }) {
|
|
2272
|
+
let { user: o, status: s } = D(), { t: c } = U(), h = Me(), g = `${o.firstName ?? ""} ${o.lastName ?? ""}`.trim() || o.username || "";
|
|
2273
|
+
return s === "loading" ? /* @__PURE__ */ V("div", {
|
|
1292
2274
|
className: "h-9 w-9 rounded-full bg-muted/40",
|
|
1293
2275
|
"aria-hidden": !0
|
|
1294
|
-
}) : /* @__PURE__ */
|
|
2276
|
+
}) : /* @__PURE__ */ H(l, { children: [/* @__PURE__ */ V(f, {
|
|
1295
2277
|
asChild: !0,
|
|
1296
|
-
children: /* @__PURE__ */
|
|
2278
|
+
children: /* @__PURE__ */ V("button", {
|
|
1297
2279
|
type: "button",
|
|
1298
|
-
title: g ||
|
|
2280
|
+
title: g || o.username,
|
|
1299
2281
|
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",
|
|
1300
|
-
children: /* @__PURE__ */
|
|
1301
|
-
givenName:
|
|
1302
|
-
familyName:
|
|
1303
|
-
name: g ||
|
|
1304
|
-
src:
|
|
1305
|
-
alt:
|
|
2282
|
+
children: /* @__PURE__ */ V(y, {
|
|
2283
|
+
givenName: o.firstName,
|
|
2284
|
+
familyName: o.lastName,
|
|
2285
|
+
name: g || o.username,
|
|
2286
|
+
src: o.avatarUrl || void 0,
|
|
2287
|
+
alt: o.username
|
|
1306
2288
|
})
|
|
1307
2289
|
})
|
|
1308
|
-
}), /* @__PURE__ */
|
|
2290
|
+
}), /* @__PURE__ */ H(_, {
|
|
1309
2291
|
align: "end",
|
|
1310
2292
|
sideOffset: 10,
|
|
1311
2293
|
className: "bento-dropdown min-w-64 p-2",
|
|
1312
2294
|
children: [
|
|
1313
|
-
/* @__PURE__ */
|
|
2295
|
+
/* @__PURE__ */ V(m, {
|
|
1314
2296
|
className: "p-0 font-normal",
|
|
1315
|
-
children: /* @__PURE__ */
|
|
2297
|
+
children: /* @__PURE__ */ H("div", {
|
|
1316
2298
|
className: "flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm",
|
|
1317
|
-
children: [/* @__PURE__ */
|
|
2299
|
+
children: [/* @__PURE__ */ V("span", {
|
|
1318
2300
|
className: "rounded-full p-0.5 ring-1 ring-border/60",
|
|
1319
|
-
children: /* @__PURE__ */
|
|
1320
|
-
givenName:
|
|
1321
|
-
familyName:
|
|
1322
|
-
name: g ||
|
|
1323
|
-
src:
|
|
1324
|
-
alt:
|
|
2301
|
+
children: /* @__PURE__ */ V(y, {
|
|
2302
|
+
givenName: o.firstName,
|
|
2303
|
+
familyName: o.lastName,
|
|
2304
|
+
name: g || o.username,
|
|
2305
|
+
src: o.avatarUrl || void 0,
|
|
2306
|
+
alt: o.username
|
|
1325
2307
|
})
|
|
1326
|
-
}), /* @__PURE__ */
|
|
2308
|
+
}), /* @__PURE__ */ H("div", {
|
|
1327
2309
|
className: "grid flex-1 text-left text-sm leading-tight",
|
|
1328
|
-
children: [g && /* @__PURE__ */
|
|
2310
|
+
children: [g && /* @__PURE__ */ V("span", {
|
|
1329
2311
|
className: "truncate font-medium",
|
|
1330
2312
|
children: g
|
|
1331
|
-
}),
|
|
2313
|
+
}), o.email && /* @__PURE__ */ V("span", {
|
|
1332
2314
|
className: "truncate text-xs text-muted-foreground",
|
|
1333
|
-
children:
|
|
2315
|
+
children: o.email
|
|
1334
2316
|
})]
|
|
1335
2317
|
})]
|
|
1336
2318
|
})
|
|
1337
2319
|
}),
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */
|
|
2320
|
+
/* @__PURE__ */ V(p, { className: "my-1.5 bg-border/50" }),
|
|
2321
|
+
/* @__PURE__ */ H(d, { children: [
|
|
2322
|
+
/* @__PURE__ */ H(u, {
|
|
1341
2323
|
onSelect: () => h(e),
|
|
1342
2324
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
1343
|
-
children: [/* @__PURE__ */
|
|
2325
|
+
children: [/* @__PURE__ */ V(Ee, { size: 18 }), c("nav.account")]
|
|
1344
2326
|
}),
|
|
1345
|
-
|
|
1346
|
-
onSelect: () => h(
|
|
2327
|
+
n && /* @__PURE__ */ H(u, {
|
|
2328
|
+
onSelect: () => h(n),
|
|
1347
2329
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
1348
|
-
children: [/* @__PURE__ */
|
|
2330
|
+
children: [/* @__PURE__ */ V(fe, { size: 18 }), c("nav.organizations", { defaultValue: "Organizations" })]
|
|
1349
2331
|
}),
|
|
1350
|
-
|
|
1351
|
-
onSelect: () => h(
|
|
2332
|
+
r && /* @__PURE__ */ H(u, {
|
|
2333
|
+
onSelect: () => h(r),
|
|
1352
2334
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
1353
|
-
children: [/* @__PURE__ */
|
|
2335
|
+
children: [/* @__PURE__ */ V(G, { size: 18 }), c("nav.tenantAdmin", { defaultValue: "Tenant administration" })]
|
|
1354
2336
|
})
|
|
1355
2337
|
] }),
|
|
1356
|
-
(
|
|
1357
|
-
onSelect: () => s(),
|
|
1358
|
-
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
1359
|
-
children: [/* @__PURE__ */ I(W, { size: 18 }), p("bento.tour.replay", { defaultValue: "Take the tour" })]
|
|
1360
|
-
}), a && /* @__PURE__ */ L(l, {
|
|
2338
|
+
(i || a) && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(p, { className: "my-1.5 bg-border/50" }), /* @__PURE__ */ H(d, { children: [a && /* @__PURE__ */ H(u, {
|
|
1361
2339
|
onSelect: () => a(),
|
|
1362
2340
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
1363
|
-
children: [/* @__PURE__ */
|
|
2341
|
+
children: [/* @__PURE__ */ V(Ce, { size: 18 }), c("bento.tour.replay", { defaultValue: "Take the tour" })]
|
|
2342
|
+
}), i && /* @__PURE__ */ H(u, {
|
|
2343
|
+
onSelect: () => i(),
|
|
2344
|
+
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
|
|
2345
|
+
children: [/* @__PURE__ */ V(Y, { size: 18 }), c("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
|
|
1364
2346
|
})] })] }),
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */
|
|
2347
|
+
/* @__PURE__ */ V(p, { className: "my-1.5 bg-border/50" }),
|
|
2348
|
+
/* @__PURE__ */ H(u, {
|
|
1367
2349
|
onSelect: () => {
|
|
1368
2350
|
globalThis.location.href = t;
|
|
1369
2351
|
},
|
|
1370
2352
|
className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger",
|
|
1371
|
-
children: [/* @__PURE__ */
|
|
2353
|
+
children: [/* @__PURE__ */ V(ye, { size: 18 }), c("nav.logOut")]
|
|
1372
2354
|
})
|
|
1373
2355
|
]
|
|
1374
2356
|
})] });
|
|
1375
2357
|
}
|
|
1376
2358
|
//#endregion
|
|
1377
2359
|
//#region src/bento/bento-section-chrome.tsx
|
|
1378
|
-
var
|
|
1379
|
-
function xt({ chrome: e, children: t }) {
|
|
1380
|
-
return /* @__PURE__ */ I(bt.Provider, {
|
|
1381
|
-
value: e,
|
|
1382
|
-
children: t
|
|
1383
|
-
});
|
|
1384
|
-
}
|
|
1385
|
-
function St() {
|
|
1386
|
-
return A(bt);
|
|
1387
|
-
}
|
|
1388
|
-
var Ct = {
|
|
2360
|
+
var Sn = {
|
|
1389
2361
|
blue: "blue",
|
|
1390
2362
|
violet: "violet",
|
|
1391
2363
|
emerald: "emerald",
|
|
@@ -1395,57 +2367,62 @@ var Ct = {
|
|
|
1395
2367
|
cyan: "blue",
|
|
1396
2368
|
orange: "amber"
|
|
1397
2369
|
};
|
|
1398
|
-
function
|
|
1399
|
-
let i
|
|
1400
|
-
|
|
1401
|
-
if (!
|
|
2370
|
+
function Cn({ variant: t = "blue", className: n, children: r }) {
|
|
2371
|
+
let i;
|
|
2372
|
+
P.forEach(r, (e) => {
|
|
2373
|
+
if (!re(e)) return;
|
|
1402
2374
|
let { type: t } = e;
|
|
1403
|
-
t ===
|
|
1404
|
-
})
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
2375
|
+
(t === O.Header || t === O.StaticHeader) && (i ??= e.props);
|
|
2376
|
+
});
|
|
2377
|
+
let a = P.map(r, (e) => {
|
|
2378
|
+
if (!re(e)) return e;
|
|
2379
|
+
let { type: t } = e;
|
|
2380
|
+
return t === O.Header || t === O.StaticHeader ? null : t === O.Content ? e.props.children : e;
|
|
2381
|
+
});
|
|
2382
|
+
return i ? /* @__PURE__ */ V(Yt, {
|
|
2383
|
+
icon: i.icon,
|
|
2384
|
+
tone: Sn[t] ?? "blue",
|
|
2385
|
+
title: i.title,
|
|
2386
|
+
description: i.description,
|
|
1413
2387
|
className: n,
|
|
1414
|
-
children:
|
|
2388
|
+
children: a
|
|
2389
|
+
}) : /* @__PURE__ */ V("section", {
|
|
2390
|
+
className: e(Jt, n),
|
|
2391
|
+
children: a
|
|
1415
2392
|
});
|
|
1416
2393
|
}
|
|
1417
|
-
|
|
2394
|
+
Cn.Header = O.Header, Cn.StaticHeader = O.StaticHeader, Cn.Content = O.Content;
|
|
1418
2395
|
//#endregion
|
|
1419
2396
|
//#region src/bento/bento-section.tsx
|
|
1420
|
-
var
|
|
1421
|
-
function
|
|
1422
|
-
let o = /* @__PURE__ */
|
|
2397
|
+
var wn = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
|
|
2398
|
+
function Tn({ eyebrow: e, title: t, description: n, titleHref: r, children: i, gridClassName: a = wn }) {
|
|
2399
|
+
let o = /* @__PURE__ */ V("h2", {
|
|
1423
2400
|
className: "text-xl font-semibold tracking-tight md:text-2xl",
|
|
1424
2401
|
children: t
|
|
1425
2402
|
});
|
|
1426
|
-
return /* @__PURE__ */
|
|
2403
|
+
return /* @__PURE__ */ H("section", {
|
|
1427
2404
|
className: "mb-8 md:mb-10",
|
|
1428
|
-
children: [/* @__PURE__ */
|
|
2405
|
+
children: [/* @__PURE__ */ H("header", {
|
|
1429
2406
|
className: "bento-shell-header mb-4 flex flex-col gap-0.5",
|
|
1430
2407
|
children: [
|
|
1431
|
-
e && /* @__PURE__ */
|
|
2408
|
+
e && /* @__PURE__ */ V("span", {
|
|
1432
2409
|
className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
|
|
1433
2410
|
children: e
|
|
1434
2411
|
}),
|
|
1435
|
-
r ? /* @__PURE__ */
|
|
2412
|
+
r ? /* @__PURE__ */ H(Z, {
|
|
1436
2413
|
to: r,
|
|
1437
2414
|
className: "group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary",
|
|
1438
|
-
children: [o, /* @__PURE__ */
|
|
2415
|
+
children: [o, /* @__PURE__ */ V(K, {
|
|
1439
2416
|
size: 20,
|
|
1440
2417
|
className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
|
|
1441
2418
|
})]
|
|
1442
2419
|
}) : o,
|
|
1443
|
-
n && /* @__PURE__ */
|
|
2420
|
+
n && /* @__PURE__ */ V("p", {
|
|
1444
2421
|
className: "max-w-2xl text-sm text-muted-foreground",
|
|
1445
2422
|
children: n
|
|
1446
2423
|
})
|
|
1447
2424
|
]
|
|
1448
|
-
}), /* @__PURE__ */
|
|
2425
|
+
}), /* @__PURE__ */ V("div", {
|
|
1449
2426
|
className: a,
|
|
1450
2427
|
children: i
|
|
1451
2428
|
})]
|
|
@@ -1453,61 +2430,161 @@ function Tt({ eyebrow: e, title: t, description: n, titleHref: r, children: i, g
|
|
|
1453
2430
|
}
|
|
1454
2431
|
//#endregion
|
|
1455
2432
|
//#region src/bento/bento-tile.tsx
|
|
1456
|
-
function
|
|
1457
|
-
let
|
|
1458
|
-
|
|
2433
|
+
function En({ to: t, onClick: n, disabled: r = !1, disabledHint: i, icon: a, tone: o, eyebrow: s, title: c, span: l, featured: u = !1, children: d }) {
|
|
2434
|
+
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__ */ H(B, { children: [
|
|
2435
|
+
u && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
|
|
1459
2436
|
"aria-hidden": !0,
|
|
1460
|
-
className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${
|
|
1461
|
-
}), /* @__PURE__ */
|
|
2437
|
+
className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${Q(o)} opacity-40 blur-2xl dark:opacity-50`
|
|
2438
|
+
}), /* @__PURE__ */ V("div", {
|
|
1462
2439
|
"aria-hidden": !0,
|
|
1463
|
-
className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${
|
|
2440
|
+
className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${Q(o)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`
|
|
1464
2441
|
})] }),
|
|
1465
|
-
/* @__PURE__ */
|
|
2442
|
+
/* @__PURE__ */ H("div", {
|
|
1466
2443
|
className: "relative z-1 flex items-center justify-between",
|
|
1467
|
-
children: [/* @__PURE__ */
|
|
1468
|
-
className: `grid place-items-center ${
|
|
1469
|
-
children: /* @__PURE__ */
|
|
1470
|
-
}),
|
|
1471
|
-
size:
|
|
2444
|
+
children: [/* @__PURE__ */ V("span", {
|
|
2445
|
+
className: `grid place-items-center ${Q(o)} text-white shadow-md ${p}`,
|
|
2446
|
+
children: /* @__PURE__ */ V(a, { size: m })
|
|
2447
|
+
}), f && /* @__PURE__ */ V(K, {
|
|
2448
|
+
size: u ? 18 : 16,
|
|
1472
2449
|
className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
|
|
1473
2450
|
})]
|
|
1474
2451
|
}),
|
|
1475
|
-
/* @__PURE__ */
|
|
2452
|
+
/* @__PURE__ */ H("div", {
|
|
1476
2453
|
className: "relative z-1",
|
|
1477
2454
|
children: [
|
|
1478
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ V("div", {
|
|
1479
2456
|
className: "text-[11px] uppercase tracking-wider text-muted-foreground",
|
|
1480
|
-
children: o
|
|
1481
|
-
}),
|
|
1482
|
-
/* @__PURE__ */ I("div", {
|
|
1483
|
-
className: `mt-0.5 ${m}`,
|
|
1484
2457
|
children: s
|
|
1485
2458
|
}),
|
|
1486
|
-
|
|
2459
|
+
/* @__PURE__ */ V("div", {
|
|
2460
|
+
className: `mt-0.5 ${h}`,
|
|
2461
|
+
children: c
|
|
2462
|
+
}),
|
|
2463
|
+
d && /* @__PURE__ */ V("div", {
|
|
1487
2464
|
className: "mt-2",
|
|
1488
|
-
children:
|
|
2465
|
+
children: d
|
|
1489
2466
|
})
|
|
1490
2467
|
]
|
|
1491
2468
|
})
|
|
1492
|
-
] }),
|
|
1493
|
-
return
|
|
1494
|
-
className:
|
|
2469
|
+
] }), _ = `bento-tile bento-glass group relative flex flex-col ${u ? "gap-5" : "gap-4"} overflow-hidden text-left ${u ? "p-6 md:p-7" : "p-5"} ${l}${f ? " bento-tile-clickable" : ""}${r ? " cursor-not-allowed opacity-60" : ""}`;
|
|
2470
|
+
return r ? /* @__PURE__ */ V("div", {
|
|
2471
|
+
className: _,
|
|
1495
2472
|
"aria-disabled": "true",
|
|
1496
|
-
title:
|
|
1497
|
-
children:
|
|
1498
|
-
}) :
|
|
1499
|
-
to:
|
|
1500
|
-
className:
|
|
1501
|
-
children:
|
|
1502
|
-
}) :
|
|
2473
|
+
title: i,
|
|
2474
|
+
children: g
|
|
2475
|
+
}) : t ? /* @__PURE__ */ V(Z, {
|
|
2476
|
+
to: t,
|
|
2477
|
+
className: _,
|
|
2478
|
+
children: g
|
|
2479
|
+
}) : n ? /* @__PURE__ */ V("button", {
|
|
1503
2480
|
type: "button",
|
|
1504
|
-
onClick:
|
|
1505
|
-
className:
|
|
1506
|
-
children:
|
|
1507
|
-
}) : /* @__PURE__ */
|
|
1508
|
-
className:
|
|
1509
|
-
children:
|
|
2481
|
+
onClick: n,
|
|
2482
|
+
className: e("w-full", _),
|
|
2483
|
+
children: g
|
|
2484
|
+
}) : /* @__PURE__ */ V("div", {
|
|
2485
|
+
className: _,
|
|
2486
|
+
children: g
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
//#endregion
|
|
2490
|
+
//#region src/bento/bento-version-rail.tsx
|
|
2491
|
+
function Dn({ versions: t, selected: n, onSelect: r, label: i }) {
|
|
2492
|
+
let { t: a, i18n: o } = U(), [s, c] = z(0), [l, u] = z([]), d = R(/* @__PURE__ */ new Map()), f = (e) => [...e].sort((e, n) => t.findIndex((e) => e.id === n) - t.findIndex((t) => t.id === e));
|
|
2493
|
+
function p(e) {
|
|
2494
|
+
if (n.includes(e)) {
|
|
2495
|
+
u(l.filter((t) => t !== e)), r(n.filter((t) => t !== e));
|
|
2496
|
+
return;
|
|
2497
|
+
}
|
|
2498
|
+
let t = [...n.filter((e) => !l.includes(e)), ...l.filter((e) => n.includes(e))], i = t.length >= 2 ? t.slice(t.length - 1) : t;
|
|
2499
|
+
u([...i, e]), r(f([...i, e]));
|
|
2500
|
+
}
|
|
2501
|
+
function m(e) {
|
|
2502
|
+
let n = Math.max(0, Math.min(t.length - 1, e));
|
|
2503
|
+
c(n), d.current.get(n)?.focus();
|
|
2504
|
+
}
|
|
2505
|
+
function h(e, n) {
|
|
2506
|
+
switch (e.key) {
|
|
2507
|
+
case "ArrowDown":
|
|
2508
|
+
m(n + 1);
|
|
2509
|
+
break;
|
|
2510
|
+
case "ArrowUp":
|
|
2511
|
+
m(n - 1);
|
|
2512
|
+
break;
|
|
2513
|
+
case "Home":
|
|
2514
|
+
m(0);
|
|
2515
|
+
break;
|
|
2516
|
+
case "End":
|
|
2517
|
+
m(t.length - 1);
|
|
2518
|
+
break;
|
|
2519
|
+
case " ":
|
|
2520
|
+
case "Enter":
|
|
2521
|
+
p(t[n].id);
|
|
2522
|
+
break;
|
|
2523
|
+
default: return;
|
|
2524
|
+
}
|
|
2525
|
+
e.preventDefault();
|
|
2526
|
+
}
|
|
2527
|
+
let g = (e) => {
|
|
2528
|
+
let t = new Date(e);
|
|
2529
|
+
return Number.isNaN(t.getTime()) ? {
|
|
2530
|
+
iso: void 0,
|
|
2531
|
+
text: String(e)
|
|
2532
|
+
} : {
|
|
2533
|
+
iso: t.toISOString(),
|
|
2534
|
+
text: new Intl.DateTimeFormat(o?.resolvedLanguage, {
|
|
2535
|
+
dateStyle: "medium",
|
|
2536
|
+
timeStyle: "short"
|
|
2537
|
+
}).format(t)
|
|
2538
|
+
};
|
|
2539
|
+
};
|
|
2540
|
+
return /* @__PURE__ */ V("ul", {
|
|
2541
|
+
role: "listbox",
|
|
2542
|
+
"aria-label": i ?? a("bento.versions.label", { defaultValue: "Versions" }),
|
|
2543
|
+
"aria-multiselectable": "true",
|
|
2544
|
+
"data-slot": "bento-version-rail",
|
|
2545
|
+
className: "m-0 flex list-none flex-col gap-1 p-0",
|
|
2546
|
+
children: t.map((r, i) => {
|
|
2547
|
+
let o = n.includes(r.id), l = g(r.at), u = r.actor === "agent" ? X : Te;
|
|
2548
|
+
return /* @__PURE__ */ H("li", {
|
|
2549
|
+
ref: (e) => {
|
|
2550
|
+
e ? d.current.set(i, e) : d.current.delete(i);
|
|
2551
|
+
},
|
|
2552
|
+
role: "option",
|
|
2553
|
+
"aria-selected": o ? "true" : "false",
|
|
2554
|
+
tabIndex: i === Math.min(s, t.length - 1) ? 0 : -1,
|
|
2555
|
+
onKeyDown: (e) => h(e, i),
|
|
2556
|
+
onClick: () => {
|
|
2557
|
+
c(i), p(r.id);
|
|
2558
|
+
},
|
|
2559
|
+
className: e("flex cursor-pointer flex-col gap-0.5 rounded-xl border px-3 py-2 text-sm outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-ring", o ? "border-primary/50 bg-primary/10" : "border-transparent hover:bg-muted/50"),
|
|
2560
|
+
children: [
|
|
2561
|
+
/* @__PURE__ */ H("span", {
|
|
2562
|
+
className: "flex items-center gap-1.5 font-medium",
|
|
2563
|
+
children: [
|
|
2564
|
+
/* @__PURE__ */ V(u, {
|
|
2565
|
+
size: 14,
|
|
2566
|
+
"aria-hidden": "true"
|
|
2567
|
+
}),
|
|
2568
|
+
r.author,
|
|
2569
|
+
/* @__PURE__ */ V("span", {
|
|
2570
|
+
className: "text-xs font-normal text-muted-foreground",
|
|
2571
|
+
children: r.actor === "agent" ? a("bento.versions.agent", { defaultValue: "Agent" }) : a("bento.versions.human", { defaultValue: "Person" })
|
|
2572
|
+
})
|
|
2573
|
+
]
|
|
2574
|
+
}),
|
|
2575
|
+
/* @__PURE__ */ V("time", {
|
|
2576
|
+
dateTime: l.iso,
|
|
2577
|
+
className: "text-xs text-muted-foreground",
|
|
2578
|
+
children: l.text
|
|
2579
|
+
}),
|
|
2580
|
+
r.summary && /* @__PURE__ */ V("span", {
|
|
2581
|
+
className: "text-xs",
|
|
2582
|
+
children: r.summary
|
|
2583
|
+
})
|
|
2584
|
+
]
|
|
2585
|
+
}, r.id);
|
|
2586
|
+
})
|
|
1510
2587
|
});
|
|
1511
2588
|
}
|
|
1512
2589
|
//#endregion
|
|
1513
|
-
export {
|
|
2590
|
+
export { Cn as AdaptiveSectionCard, St as BENTO_EMPHASIS_NEXT, xt as BENTO_EMPHASIS_SPAN, cn as BENTO_SHELL_SHORTCUTS, $e as BENTO_TONES, Qe as BENTO_TONE_CLASS, Ze as BentoActionsMenu, at as BentoBackLink, en as BentoBackToTop, an as BentoCommandPalette, et as BentoCountTile, rt as BentoDataTable, gt as BentoDiff, it as BentoEmptyState, ft as BentoEntityShell, Tt as BentoEntityTile, At as BentoFilterBar, qt as BentoFormHero, Yt as BentoFormSection, ot as BentoHero, st as BentoHeroIconPicker, ct as BentoInlineEdit, Ft as BentoListPage, yn as BentoNavRail, mn as BentoPaletteTrigger, Xt as BentoPanel, Wt as BentoSaveBar, Kt as BentoScrollSaveBar, Tn as BentoSection, on as BentoShell, hn as BentoShortcutsDialog, lt as BentoStatusMarker, En as BentoTile, It as BentoTileGrid, xn as BentoUserMenu, Dn as BentoVersionRail, Et as EMPTY_FILTERS, Q as bentoChipClass, tn as bentoNavTarget, Ct as resolveBentoLayout, wt as toBentoLayoutEntries, ut as useBentoScrollFade, pn as useBentoShellShortcuts };
|