@viglet/viglet-design-system 2026.3.10 → 2026.3.12
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 +323 -36
- package/consumers.json +186 -0
- package/dist/badge-locale-1_BmNTro.cjs +1 -0
- package/dist/badge-locale-Bx7m7tg2.js +501 -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 +12 -0
- 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 +10 -3
- 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-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 +17 -42
- 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-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 +14 -5
- 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 +1642 -625
- package/dist/catalogue.json +5349 -0
- package/dist/components/app-footer.d.ts +7 -0
- package/dist/components/app-footer.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 +4 -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 +26 -1
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/glass-card.d.ts +13 -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/index.d.ts +2 -1
- 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 +29 -2
- 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 +6 -2
- 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/tree.d.ts +60 -0
- package/dist/components/ui/tree.d.ts.map +1 -0
- 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 +71 -28
- package/dist/components/ui/viglet-assistant.d.ts.map +1 -1
- package/dist/components/ui/viglet-avatar.d.ts +14 -12
- package/dist/components/ui/viglet-avatar.d.ts.map +1 -1
- 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 +344 -28
- package/dist/i18n/index.d.ts +94 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en/assistant.json.d.ts +4 -1
- package/dist/i18n/locales/en/bento.json.d.ts +45 -1
- package/dist/i18n/locales/pt/assistant.json.d.ts +4 -1
- package/dist/i18n/locales/pt/bento.json.d.ts +45 -1
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.es.js +98 -4
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +2094 -913
- 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-E3fbcekM.js → loading-provider-D-_5G-08.js} +71 -69
- package/dist/loading-provider-E4tIG9BM.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-BXQ7lgg5.js +815 -0
- package/dist/user.context-D01CI8gq.cjs +1 -0
- package/dist/viglet-design-system.css +1 -1
- package/docs/BENTO-AUTHORING.md +61 -9
- package/package.json +13 -2
- 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-Bij94NwL.cjs +0 -1
- package/dist/badge-locale-Du41PpLA.js +0 -533
- package/dist/breadcrumb.context-BssgEydx.js +0 -926
- package/dist/breadcrumb.context-DLsiMS59.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/lib/react-markers.d.ts +0 -17
- package/dist/lib/react-markers.d.ts.map +0 -1
- package/dist/loading-provider-B6-R2ONB.cjs +0 -1
- package/dist/user.context-CPmUBBLa.js +0 -522
- package/dist/user.context-xsJgPpcO.cjs +0 -1
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User avatar + dropdown styled to harmonize with the Bento UI.
|
|
3
|
-
*
|
|
4
|
-
* Uses the same Radix DropdownMenu primitives as the design-system
|
|
5
|
-
* `UserMenu`, but the surface (`.bento-dropdown`) and items
|
|
6
|
-
* (`.bento-dropdown-item`) carry the frosted-glass look and iOS spring
|
|
7
|
-
* easing so it feels like part of the bento language.
|
|
8
|
-
*/
|
|
9
1
|
export interface BentoUserMenuProps {
|
|
10
2
|
/** Where the account entry leads. */
|
|
11
3
|
accountRoute: string;
|
|
@@ -27,5 +19,14 @@ export interface BentoUserMenuProps {
|
|
|
27
19
|
/** Replay the first-run tour. Omit to hide the entry. */
|
|
28
20
|
onReplayTour?: () => void;
|
|
29
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* The signed-in user's avatar and menu at the end of a bento header: account,
|
|
24
|
+
* the tenancy routes a product passes, the shortcut guide, the tour and sign-out.
|
|
25
|
+
*
|
|
26
|
+
* It reads the user from `UserProvider`, which has to be mounted above it. The
|
|
27
|
+
* Radix DropdownMenu primitives are the console's, and the surface and items take
|
|
28
|
+
* the frosted bento look and its spring easing. It replaced `NavUser`, which left
|
|
29
|
+
* with the console era in VDS147.
|
|
30
|
+
*/
|
|
30
31
|
export declare function BentoUserMenu({ accountRoute, logoutUrl, organizationsRoute, tenantAdminRoute, onOpenShortcuts, onReplayTour, }: Readonly<BentoUserMenuProps>): import("react").JSX.Element;
|
|
31
32
|
//# sourceMappingURL=bento-user-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bento-user-menu.d.ts","sourceRoot":"","sources":["../../src/bento/bento-user-menu.tsx"],"names":[],"mappings":"AAeA
|
|
1
|
+
{"version":3,"file":"bento-user-menu.d.ts","sourceRoot":"","sources":["../../src/bento/bento-user-menu.tsx"],"names":[],"mappings":"AAeA,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC5B,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,YAAY,GACb,EAAE,QAAQ,CAAC,kBAAkB,CAAC,+BAmI9B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface BentoVersion {
|
|
2
|
+
id: string;
|
|
3
|
+
/** Who made it, already a display name. */
|
|
4
|
+
author: string;
|
|
5
|
+
/** A person, or an agent acting for one. */
|
|
6
|
+
actor: "human" | "agent";
|
|
7
|
+
at: Date | number | string;
|
|
8
|
+
/** What changed, in a line, already translated. */
|
|
9
|
+
summary?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface BentoVersionRailProps {
|
|
12
|
+
/** Newest first. */
|
|
13
|
+
versions: readonly BentoVersion[];
|
|
14
|
+
/** The one or two versions being compared, older first. */
|
|
15
|
+
selected: readonly string[];
|
|
16
|
+
/** Called with the new pair, older first, whenever a reader picks. */
|
|
17
|
+
onSelect: (ids: string[]) => void;
|
|
18
|
+
/** The rail's accessible name. */
|
|
19
|
+
label?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* VDS140 — the list of revisions two are compared from.
|
|
23
|
+
*
|
|
24
|
+
* Each revision shows who made it, whether a person or an agent did, and when:
|
|
25
|
+
* a review of an agent's change reads differently from a colleague's, and the
|
|
26
|
+
* rail says which before the diff does. It is a listbox of up to two selected
|
|
27
|
+
* options: arrows move, Space or Enter picks, and a third pick lets go of the
|
|
28
|
+
* one picked longest ago, so the pair is always the last two the reader chose.
|
|
29
|
+
*/
|
|
30
|
+
export declare function BentoVersionRail({ versions, selected, onSelect, label }: Readonly<BentoVersionRailProps>): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=bento-version-rail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-version-rail.d.ts","sourceRoot":"","sources":["../../src/bento/bento-version-rail.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,EAAE,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC3B,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,oBAAoB;IACpB,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,2DAA2D;IAC3D,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,sEAAsE;IACtE,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAClC,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,qBAAqB,CAAC,+BAmHxG"}
|
package/dist/bento/index.d.ts
CHANGED
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
*
|
|
18
18
|
* import "@viglet/viglet-design-system/bento.css"
|
|
19
19
|
*
|
|
20
|
-
* The shell is
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* The shell is BentoShell, and no provider: it reserves the gutter for the
|
|
21
|
+
* BentoNavRail passed as `rail`, lays out the header's two edges (BentoUserMenu
|
|
22
|
+
* goes in the trailing one), owns `main` and its reading column, and puts
|
|
23
|
+
* BentoBackToTop at the corner. The routed page is its children and sets no
|
|
24
|
+
* width of its own.
|
|
23
25
|
*
|
|
24
26
|
* There is deliberately no sidebar provider here, and no context between them.
|
|
25
27
|
* The console era needs one because its sidebar collapses, remembers and
|
|
@@ -32,17 +34,23 @@
|
|
|
32
34
|
*/
|
|
33
35
|
export { BentoActionsMenu, type BentoActionsMenuItem, type BentoActionsMenuProps, type BentoActionTone } from './bento-actions-menu';
|
|
34
36
|
export { BentoCountTile, type BentoCountTileProps } from './bento-count-tile';
|
|
37
|
+
export { BentoDataTable, type BentoDataTableAction, type BentoDataTableColumn, type BentoDataTableLayout, type BentoDataTableProps, } from './bento-data-table';
|
|
35
38
|
export { BentoEmptyState, type BentoEmptyStateProps } from './bento-empty-state';
|
|
36
39
|
export { BentoEntityShell, type BentoEntityShellProps, type BentoEntityShellRenderArgs, type BentoIdentity, type BentoShellFormState, } from './bento-entity-shell';
|
|
40
|
+
export { BentoDiff, type BentoDiffField, type BentoDiffFieldKind, type BentoDiffProps, type BentoDiffSide, } from './bento-diff';
|
|
37
41
|
export { BentoEntityTile, type BentoEntityTileProps } from './bento-entity-tile';
|
|
42
|
+
export { BentoFilterBar, EMPTY_FILTERS, type BentoFilterBarProps, type BentoFilterChoiceFacet, type BentoFilterDateFacet, type BentoFilterDateRange, type BentoFilterFacet, type BentoFilterValue, } from './bento-filter-bar';
|
|
38
43
|
export { BentoListPage, type BentoListPageProps, type BentoListLayout, BentoTileGrid, type BentoTileGridProps, } from './bento-list-page';
|
|
39
44
|
export { BentoHeroIconPicker, type BentoHeroIconPickerProps } from './bento-hero-icon-picker';
|
|
40
45
|
export { BentoInlineEdit, type BentoInlineEditProps } from './bento-inline-edit';
|
|
41
46
|
export { BentoFormHero, type BentoFormHeroProps } from './bento-form-hero';
|
|
42
47
|
export { BentoFormSection, type BentoFormSectionProps } from './bento-form-section';
|
|
43
48
|
export { BentoPanel, type BentoPanelProps } from './bento-panel';
|
|
44
|
-
export { BentoBackToTop } from './bento-back-to-top';
|
|
49
|
+
export { BentoBackToTop, type BentoBackToTopProps } from './bento-back-to-top';
|
|
45
50
|
export { BentoCommandPalette, type BentoCommandPaletteGroup, type BentoCommandPaletteProps, type BentoCommandPaletteResult, } from './bento-command-palette';
|
|
51
|
+
export { BentoShell, type BentoShellColumn, type BentoShellProps } from './bento-shell';
|
|
52
|
+
export { BENTO_SHELL_SHORTCUTS, useBentoShellShortcuts, type BentoShellAction, type BentoShellShortcut, type BentoShellShortcutsOptions, } from './bento-shell-shortcuts';
|
|
53
|
+
export { BentoPaletteTrigger, type BentoPaletteTriggerProps } from './bento-palette-trigger';
|
|
46
54
|
export { BentoShortcutsDialog, type BentoShortcutsDialogProps } from './bento-shortcuts-dialog';
|
|
47
55
|
export { BentoNavRail, type BentoNavRailProps } from './bento-nav-rail';
|
|
48
56
|
export { BentoUserMenu, type BentoUserMenuProps } from './bento-user-menu';
|
|
@@ -51,10 +59,11 @@ export { BentoBackLink, BentoHero, type BentoHeroProps } from './bento-hero';
|
|
|
51
59
|
export { BentoSaveBar, type BentoSaveBarProps } from './bento-save-bar';
|
|
52
60
|
export { useBentoScrollFade } from './bento-scroll-fade';
|
|
53
61
|
export { BentoScrollSaveBar } from './bento-scroll-save-bar';
|
|
54
|
-
export { AdaptiveSectionCard, type AdaptiveSectionCardProps
|
|
62
|
+
export { AdaptiveSectionCard, type AdaptiveSectionCardProps } from './bento-section-chrome';
|
|
55
63
|
export { BentoSection, type BentoSectionProps } from './bento-section';
|
|
56
64
|
export { BentoStatusMarker, type BentoStatusMarkerProps } from './bento-status-marker';
|
|
57
65
|
export { BentoTile, type BentoTileProps } from './bento-tile';
|
|
66
|
+
export { BentoVersionRail, type BentoVersion, type BentoVersionRailProps } from './bento-version-rail';
|
|
58
67
|
export { BENTO_TONES, BENTO_TONE_CLASS, bentoChipClass, type BentoTone, } from './bento-tones';
|
|
59
68
|
export { BENTO_EMPHASIS_NEXT, BENTO_EMPHASIS_SPAN, resolveBentoLayout, toBentoLayoutEntries, type BentoEmphasis, type BentoLayoutEntry, type BentoLayoutResponse, type BentoLayoutSource, type ResolvedBentoItem, } from './bento-layout';
|
|
60
69
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bento/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bento/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,EAAE,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrI,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,cAAc,EACd,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAEvG,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC"}
|
package/dist/bento.cjs
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-Oagwe_oa.cjs"),t=require("./badge-locale-Bij94NwL.cjs"),n=require("./user.context-xsJgPpcO.cjs"),r=require("./loading-provider-B6-R2ONB.cjs");let i=require("react"),a=require("react/jsx-runtime"),o=require("react-i18next"),s=require("@tabler/icons-react"),c=require("@iconify/react"),l=require("react-router-dom"),u=require("@dnd-kit/core"),d=require("@dnd-kit/sortable"),f=require("@dnd-kit/utilities"),p=require("sonner");var m={default:``,destructive:`bento-item-danger`};function h({actions:e,triggerLabel:n}){let{t:r}=(0,o.useTranslation)();return e.length===0?null:(0,a.jsxs)(t.f,{children:[(0,a.jsx)(t.E,{asChild:!0,children:(0,a.jsx)(`button`,{type:`button`,"aria-label":n??r(`forms.formActions.moreActions`,{defaultValue:`More actions`}),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`,children:(0,a.jsx)(s.IconDotsVertical,{size:18})})}),(0,a.jsx)(t.m,{align:`end`,sideOffset:8,className:`bento-dropdown min-w-44 p-1.5`,children:e.map(e=>{let n=e.icon,r=m[e.tone??`default`];return(0,a.jsxs)(t.g,{onSelect:e.onSelect,disabled:e.disabled,className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${r}`,children:[(0,a.jsx)(n,{size:16}),e.label]},e.label)})})]})}var g={blue:`bento-tone-blue`,indigo:`bento-tone-indigo`,violet:`bento-tone-violet`,emerald:`bento-tone-emerald`,amber:`bento-tone-amber`,rose:`bento-tone-rose`,slate:`bento-tone-slate`},_=Object.keys(g);function v(e){return`bento-chip ${g[e]??g.slate}`}function y({to:e,icon:t,tone:n,label:r,count:i,span:o}){let s=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:`grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${v(n)}`,children:(0,a.jsx)(t,{size:18})}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`div`,{className:`text-3xl font-semibold tabular-nums tracking-tight`,children:i}),(0,a.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:r})]})]}),c=`bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${o}${e?` bento-tile-clickable`:``}`;return e?(0,a.jsx)(l.Link,{to:e,className:c,children:s}):(0,a.jsx)(`div`,{className:c,children:s})}function b({icon:t=s.IconSparkles,tone:n=`indigo`,title:r,description:i,action:o,align:c=`center`,className:l}){let u=v(n),d=c===`center`;return(0,a.jsxs)(`div`,{className:e.t(`bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8`,d?`items-center text-center`:`items-start text-left`,l),children:[(0,a.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${u} text-white shadow-md`,children:(0,a.jsx)(t,{size:24})}),(0,a.jsx)(`div`,{className:`text-lg font-semibold tracking-tight`,children:r}),i&&(0,a.jsx)(`p`,{className:e.t(`max-w-md text-sm text-muted-foreground`,d&&`mx-auto`),children:i}),o&&(0,a.jsx)(`div`,{className:e.t(`mt-1`,d&&`mx-auto`),children:o})]})}function x({to:e,children:t}){return(0,a.jsxs)(l.Link,{to:e,className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,a.jsx)(s.IconArrowLeft,{size:14,"aria-hidden":!0}),t]})}function S({eyebrow:e,backTo:t,backLabel:n,title:r,subtitle:i,leading:o,trailing:s}){let c=e??(t==null?null:(0,a.jsx)(x,{to:t,children:n}));return(0,a.jsx)(`header`,{className:`bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10`,children:(0,a.jsxs)(`div`,{className:`flex w-full items-start gap-4`,children:[o&&(0,a.jsx)(`div`,{className:`shrink-0`,children:o}),(0,a.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[c&&(0,a.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:c}),(0,a.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight md:text-4xl`,children:r}),i&&(0,a.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:i})]}),s&&(0,a.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:s})]})})}function C({value:e,onChange:t,onClear:r,defaultIcon:l,tone:u,title:d,description:f,readOnly:p=!1}){let{t:m}=(0,o.useTranslation)(),[h,g]=(0,i.useState)(!1);return p?(0,a.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${v(u)} text-white shadow-md`,children:e?(0,a.jsx)(c.Icon,{icon:e,className:`size-6 text-white`}):(0,a.jsx)(l,{size:24})}):(0,a.jsxs)(`div`,{className:`group relative`,children:[(0,a.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),"aria-label":m(`forms.iconPicker.chooseAnIcon`),className:`group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${v(u)} 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`,children:[e?(0,a.jsx)(c.Icon,{icon:e,className:`size-6 text-white`}):(0,a.jsx)(l,{size:24}),(0,a.jsx)(`span`,{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`,children:(0,a.jsx)(s.IconPalette,{className:`size-5 text-white`})})]}),e&&r&&(0,a.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r()},"aria-label":m(`forms.common.remove`),title:m(`forms.common.remove`),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`,children:(0,a.jsx)(s.IconX,{size:12})}),(0,a.jsx)(n.c,{open:h,onOpenChange:g,value:e,onSelect:t,onClear:r,title:d,description:f})]})}function w({value:n,onSave:r,multiline:s=!1,placeholder:c,className:l,ariaLabel:u,autoFocus:d=!1,readOnly:f=!1,commitOnChange:p=!1}){let{t:m}=(0,o.useTranslation)(),[h,g]=(0,i.useState)(d),[_,v]=(0,i.useState)(n),[y,b]=(0,i.useState)(!1),x=(0,i.useRef)(null),[S,C]=(0,i.useState)(n);!h&&n!==S&&(C(n),v(n)),(0,i.useEffect)(()=>{h&&x.current&&(x.current.focus(),x.current.select())},[h]);async function w(){let e=_.trim();if(e===n){g(!1);return}if(!e&&!c){v(n),g(!1);return}b(!0);try{await r(e)}catch{v(n)}finally{b(!1),g(!1)}}function T(){v(n),g(!1)}function E(e){v(e),p&&r(e)}let D=!n;if(f)return(0,a.jsx)(`span`,{className:e.t(`block w-full`,l),"aria-label":u,children:n||(0,a.jsx)(`span`,{className:`text-muted-foreground/80`,children:c??`—`})});let O=`w-full bg-transparent outline-none border-b transition-colors duration-200`,k=e.t(O,`cursor-text rounded-sm`,D?`border-dashed border-border/70 hover:border-foreground/40`:`border-transparent hover:border-border/60 focus-visible:border-border/80`,y&&`opacity-60`),A=e.t(O,`bento-editing`);if(!h)return(0,a.jsx)(`button`,{type:`button`,onClick:()=>g(!0),className:e.t(k,`text-left`,l),"aria-label":u??m(`forms.formActions.edit`),disabled:y,children:n||(0,a.jsx)(`span`,{className:`text-muted-foreground/80`,children:c??`—`})});function j(e){if(e.key===`Escape`){e.preventDefault(),T();return}e.key===`Enter`&&(!s||e.metaKey||e.ctrlKey)&&(e.preventDefault(),w())}return s?(0,a.jsx)(`textarea`,{ref:x,value:_,onChange:e=>E(e.target.value),onBlur:w,onKeyDown:j,placeholder:c,"aria-label":u,rows:3,className:e.t(A,`resize-none py-0.5 leading-snug`,l)}):(0,a.jsx)(t.l,{ref:x,value:_,onChange:e=>E(e.target.value),onBlur:w,onKeyDown:j,placeholder:c,"aria-label":u,className:e.t(A,`h-auto px-0 py-0 shadow-none focus-visible:ring-0`,l)})}function T({titleMissing:t,dirty:n,className:r}){let{t:i}=(0,o.useTranslation)();if(!t&&!n)return null;let c=`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal`;return t?(0,a.jsxs)(`span`,{className:e.t(c,`bento-status bento-status-error`,r),children:[(0,a.jsx)(s.IconAlertTriangle,{className:`size-3`}),i(`bento.saveBar.titleRequired`,{defaultValue:`Title required`})]}):(0,a.jsxs)(`span`,{className:e.t(c,`bento-status bento-status-warn`,r),children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse`}),i(`bento.saveBar.unsaved`,{defaultValue:`Unsaved changes`})]})}function E(e){(0,i.useEffect)(()=>{let t=e.current;if(!t)return;let n=document.documentElement,r=0,i=()=>{r=0;let e=t.getBoundingClientRect().top,i=Math.max(0,Math.min(1,(160-e)/80));n.style.setProperty(`--bento-fade`,String(i)),n.classList.toggle(`bento-fade-half`,i>.5)},a=()=>{r||=requestAnimationFrame(i)};return i(),window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a),()=>{r&&cancelAnimationFrame(r),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a),n.style.removeProperty(`--bento-fade`),n.classList.remove(`bento-fade-half`)}},[e])}function D(e,t){let n={};for(let r of Object.keys(e))Object.assign(n,{[r]:t[r]});return n}function O({entity:e,isNew:n,headlineFallback:c,eyebrow:u,listRoute:d,icon:f,tone:m,formId:g,feature:_,hasStatus:v=!1,hideIcon:y=!1,readOnly:b=!1,autosaveOnly:O=!1,badge:k,notice:A,onUpdate:j,onDelete:M,extraActions:N,children:P}){let{t:F}=(0,o.useTranslation)(),I=(0,l.useNavigate)(),[ee,L]=(0,i.useState)(!1),[R,z]=(0,i.useState)({isDirty:!1,isSubmitting:!1}),B=(0,i.useRef)(null);E(B);let V={title:e.title??``,description:e.description??``,icon:e.icon??null,enabled:e.enabled??1},[H,U]=(0,i.useState)(V),[W,G]=(0,i.useState)(V);(V.title!==W.title||V.description!==W.description||V.icon!==W.icon||V.enabled!==W.enabled)&&(G(V),U(V));async function K(t){if(U(e=>({...e,...t})),n||!j)return;let r=t.title??H.title;try{await j({...e,...t}),p.toast.success(F(`forms.common.updated`,{name:r,feature:_}))}catch(e){console.error(`Failed to update entity field`,e),U(e=>({...e,...D(t,V)})),p.toast.error(F(`forms.common.notUpdated`,{name:V.title||r,feature:_}))}}async function q(){if(M){try{await M()?(p.toast.success(F(`forms.common.deleted`,{name:H.title,feature:_})),I(d)):p.toast.error(F(`forms.common.notDeleted`,{name:H.title,feature:_}))}catch(e){console.error(`Failed to delete entity`,e),p.toast.error(F(`forms.common.notDeleted`,{name:H.title,feature:_}))}L(!1)}}let J=H.enabled===1,te=!b,ne=!(O&&!n),Y=!H.title.trim(),re=!n&&!R.isDirty,X=Y||re,Z=[...N??[],...M&&!b?[{label:F(`forms.formActions.delete`),icon:s.IconTrash,tone:`destructive`,onSelect:()=>L(!0)}]:[]];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S,{eyebrow:(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,a.jsx)(x,{to:d,children:u}),!b&&(0,a.jsx)(T,{titleMissing:Y,dirty:n||R.isDirty})]}),leading:(0,a.jsx)(C,{value:H.icon,onChange:e=>K({icon:e}),onClear:()=>K({icon:null}),defaultIcon:f,tone:m,title:H.title,description:H.description,readOnly:b||y}),title:(0,a.jsx)(w,{value:H.title,onSave:e=>K({title:e}),placeholder:c,className:`text-3xl font-semibold tracking-tight md:text-4xl`,ariaLabel:F(`forms.common.title`),autoFocus:n,commitOnChange:n,readOnly:b}),subtitle:(0,a.jsx)(w,{value:H.description,onSave:e=>K({description:e}),multiline:!0,placeholder:F(`forms.common.description`),className:`max-w-2xl text-sm text-muted-foreground`,ariaLabel:F(`forms.common.description`),commitOnChange:n,readOnly:b}),trailing:(0,a.jsxs)(a.Fragment,{children:[te&&(0,a.jsxs)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:[ne&&(0,a.jsxs)(t.u,{type:`submit`,form:g,size:`sm`,loading:R.isSubmitting,disabled:X,children:[(0,a.jsx)(s.IconDeviceFloppy,{className:`size-4`}),F(`forms.formActions.saveChanges`)]}),(0,a.jsxs)(t.u,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>I(d),children:[(0,a.jsx)(s.IconX,{className:`size-4`}),F(`forms.formActions.cancel`)]})]}),k,v&&(b?(0,a.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${J?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${J?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),J?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]}):(0,a.jsxs)(`button`,{type:`button`,onClick:()=>K({enabled:+!J}),"aria-label":F(`forms.common.enabled`),title:F(J?`common.activeToggleHint`:`common.idleToggleHint`),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 ${J?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground hover:bg-muted/80`}`,children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${J?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),J?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]})),!n&&Z.length>0&&(0,a.jsx)(h,{actions:Z})]})}),(0,a.jsx)(`div`,{ref:B,"aria-hidden":!0,className:`h-px`}),A,!n&&M&&(0,a.jsx)(r.i,{feature:_,name:H.title,onDelete:q,open:ee,setOpen:L,trigger:(0,a.jsx)(`span`,{className:`hidden`,"aria-hidden":!0})}),P({staged:H,onStateChange:z})]})}var k={LARGE:`col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2`,MEDIUM:`col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1`,SMALL:`col-span-1 row-span-1`},A={SMALL:`MEDIUM`,MEDIUM:`LARGE`,LARGE:`SMALL`};function j(e,t,n){if(!n||n.length===0)return e.map((e,n)=>({item:e,key:t(e),emphasis:n===0?`LARGE`:`MEDIUM`}));let r=new Map,i=new Map;for(let e of n)r.set(e.itemId,e.displayOrder),i.set(e.itemId,e.emphasis);return e.map((e,n)=>({item:e,key:t(e),idx:n})).sort((e,t)=>{let n=r.has(e.key)?r.get(e.key):2**53-1,i=r.has(t.key)?r.get(t.key):2**53-1;return n===i?e.idx-t.idx:n-i}).map(({item:e,key:t})=>({item:e,key:t,emphasis:i.get(t)??`MEDIUM`}))}function M(e){return e.map((e,t)=>({itemId:e.key,emphasis:e.emphasis,displayOrder:t}))}function N({to:e,emphasis:t,featured:n,defaultIcon:r,icon:i,tone:s=`indigo`,title:u,description:d,meta:f,enabled:p,hasStatus:m=!1,viewTransitionName:h}){let{t:g}=(0,o.useTranslation)(),_=v(s),y=t??(n?`LARGE`:`MEDIUM`),b=y===`LARGE`,x=y===`SMALL`,S=k[y],C=p===1,w=b?`p-6 md:p-7`:x?`p-4`:`p-5`,T=b?`h-14 w-14`:x?`h-8 w-8`:`h-9 w-9`,E=b?28:x?16:18,D=b?`text-xl md:text-2xl`:x?`text-sm`:`text-base md:text-lg`;return(0,a.jsxs)(l.Link,{to:e,className:`bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${b?`gap-5`:`gap-4`} overflow-hidden ${w} ${S}`,style:h?{viewTransitionName:h}:void 0,children:[b&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${_} opacity-40 blur-2xl dark:opacity-50`}),(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${_} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,a.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,a.jsx)(`span`,{className:`grid place-items-center rounded-2xl ${_} text-white shadow-md ${T}`,children:i?(0,a.jsx)(c.Icon,{icon:i,className:b?`size-7 text-white`:`size-4.5 text-white`}):(0,a.jsx)(r,{size:E})}),m&&(0,a.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${C?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${C?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),C?g(`common.active`,{defaultValue:`Active`}):g(`common.idle`,{defaultValue:`Idle`})]})]}),(0,a.jsxs)(`div`,{className:`relative z-1`,children:[(0,a.jsx)(`div`,{className:`font-semibold tracking-tight ${D}`,children:u}),!x&&f&&(0,a.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:f}),!x&&d&&(0,a.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:d})]})]})}var P=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function F({items:e,error:t,tryAgainUrl:c,listId:l,eyebrow:u,backTo:d,backLabel:f,heroIcon:p,title:m,subtitle:h,tone:g=`indigo`,headerAction:_,newRoute:y,newLabel:b,newSubtitle:x,hideNew:C=!1,itemKey:w,renderTile:T,emptyTitle:E,emptyDescription:D,layout:O}){let{t:k}=(0,o.useTranslation)(),A=v(g),[M,N]=(0,i.useState)(!1),P=(0,i.useMemo)(()=>j(e??[],w,O?.data?.entries),[e,w,O?.data?.entries]),F=!!l&&!!O&&(e?.length??0)>0;return(0,a.jsxs)(r.t,{checkIsNotUndefined:e,error:t??null,tryAgainUrl:c,children:[(0,a.jsx)(S,{eyebrow:u,backTo:d,backLabel:f,leading:(0,a.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${A} text-white shadow-md`,children:(0,a.jsx)(p,{size:24})}),title:m,subtitle:h}),(_||F&&!M)&&(0,a.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[_,F&&!M&&(0,a.jsxs)(n.l,{variant:`outline`,size:`sm`,onClick:()=>N(!0),className:`ml-auto gap-2`,children:[(0,a.jsx)(s.IconAdjustmentsHorizontal,{size:16}),k(`bento.layout.customize`,{defaultValue:`Customize layout`})]})]}),M&&l&&O?(0,a.jsx)(L,{layout:O,resolved:P,canEditGlobal:O?.data?.canEditGlobal??!1,isCustomized:O?.data?.source===`USER`,renderTile:T,chip:A,hideNew:C,newRoute:y,newLabel:b,newSubtitle:x,onClose:()=>N(!1)}):(0,a.jsx)(ee,{resolved:P,renderTile:T,chip:A,hideNew:C,newRoute:y,newLabel:b,newSubtitle:x,isEmpty:e?.length===0,emptyTitle:E,emptyDescription:D})]})}function I({items:e,error:t,tryAgainUrl:n,tone:i=`indigo`,newRoute:o,newLabel:s,newSubtitle:c,hideNew:l=!1,itemKey:u,renderTile:d,emptyTitle:f,emptyDescription:p}){let m=v(i);return(0,a.jsx)(r.t,{checkIsNotUndefined:e,error:t??null,tryAgainUrl:n,children:(0,a.jsxs)(`div`,{className:P,children:[!l&&o&&s?(0,a.jsx)(V,{route:o,label:s,subtitle:c,chip:m}):null,(e??[]).map(e=>(0,a.jsx)(`span`,{className:`contents`,children:d(e)},u(e))),e?.length===0&&(0,a.jsx)(H,{title:f,description:p})]})})}function ee({resolved:t,renderTile:n,chip:r,hideNew:i,newRoute:o,newLabel:s,newSubtitle:c,isEmpty:l,emptyTitle:u,emptyDescription:d}){let f=t.some(e=>e.emphasis===`SMALL`);return(0,a.jsxs)(`div`,{className:e.t(P,f&&`grid-flow-dense`),children:[!i&&(0,a.jsx)(V,{route:o,label:s,subtitle:c,chip:r}),t.map(({item:e,key:t,emphasis:r})=>(0,a.jsx)(`span`,{className:`contents`,children:n(e,r)},t)),l&&(0,a.jsx)(H,{title:u,description:d})]})}function L({layout:t,resolved:r,canEditGlobal:c,isCustomized:l,renderTile:f,chip:p,hideNew:m,newRoute:h,newLabel:g,newSubtitle:_,onClose:v}){let{t:y}=(0,o.useTranslation)(),[b,x]=(0,i.useState)(r),S=t.saving??!1,[C,w]=(0,i.useState)(!1),T=e=>async()=>{if(e){w(!1);try{await e(),v()}catch(e){console.error(`Failed to save the bento layout`,e),w(!0)}}},E=(0,u.useSensors)((0,u.useSensor)(u.PointerSensor,{activationConstraint:{distance:8}}),(0,u.useSensor)(u.KeyboardSensor));function D(e){let{active:t,over:n}=e;!n||t.id===n.id||x(e=>{let r=e.findIndex(e=>e.key===t.id),i=e.findIndex(e=>e.key===n.id);return r<0||i<0?e:(0,d.arrayMove)(e,r,i)})}function O(e,t){x(n=>n.map(n=>n.key===e?{...n,emphasis:t}:n))}let k=(0,i.useMemo)(()=>M(b),[b]),A=b.some(e=>e.emphasis===`SMALL`);return(0,a.jsxs)(`div`,{children:[(0,a.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md`,children:[(0,a.jsx)(`span`,{className:`mr-auto text-sm text-muted-foreground`,children:y(`bento.layout.editHint`,{defaultValue:`Drag tiles to reorder · tap the size button to resize`})}),l&&t.onReset&&(0,a.jsxs)(n.l,{variant:`ghost`,size:`sm`,className:`gap-2`,disabled:S,onClick:T(t.onReset),children:[(0,a.jsx)(s.IconArrowBackUp,{size:16}),y(`bento.layout.reset`,{defaultValue:`Reset to default`})]}),c&&t.onSaveGlobal&&(0,a.jsxs)(n.l,{variant:`outline`,size:`sm`,className:`gap-2`,disabled:S,onClick:T(()=>t.onSaveGlobal?.(k)),children:[(0,a.jsx)(s.IconUsers,{size:16}),y(`bento.layout.saveGlobal`,{defaultValue:`Set as default for everyone`})]}),(0,a.jsxs)(n.l,{variant:`ghost`,size:`sm`,className:`gap-2`,disabled:S,onClick:v,children:[(0,a.jsx)(s.IconX,{size:16}),y(`common.cancel`,{defaultValue:`Cancel`})]}),(0,a.jsxs)(n.l,{size:`sm`,className:`gap-2`,disabled:S,onClick:T(()=>t.onSave(k)),children:[(0,a.jsx)(s.IconDeviceFloppy,{size:16}),y(`bento.layout.save`,{defaultValue:`Save layout`})]}),C&&(0,a.jsx)(`p`,{role:`alert`,className:`w-full text-sm text-destructive`,children:y(`bento.layout.saveFailed`,{defaultValue:`The layout could not be saved. Nothing has changed — try again.`})})]}),(0,a.jsx)(u.DndContext,{sensors:E,collisionDetection:u.closestCenter,onDragEnd:D,children:(0,a.jsx)(d.SortableContext,{items:b.map(e=>e.key),strategy:d.rectSortingStrategy,children:(0,a.jsxs)(`div`,{className:e.t(P,A&&`grid-flow-dense`),children:[!m&&(0,a.jsx)(V,{route:h,label:g,subtitle:_,chip:p}),b.map(({item:e,key:t,emphasis:n})=>(0,a.jsx)(B,{id:t,emphasis:n,onSetEmphasis:e=>O(t,e),children:f(e,n)},t))]})})})]})}var R=[`SMALL`,`MEDIUM`,`LARGE`],z={SMALL:{key:`bento.layout.size.small`,def:`Small`},MEDIUM:{key:`bento.layout.size.medium`,def:`Medium`},LARGE:{key:`bento.layout.size.large`,def:`Large`}};function B({id:t,emphasis:n,onSetEmphasis:r,children:i}){let{t:c}=(0,o.useTranslation)(),{attributes:l,listeners:u,setNodeRef:p,transform:m,transition:h,isDragging:g}=(0,d.useSortable)({id:t}),_={transform:f.CSS.Translate.toString(m),transition:h,opacity:g?.6:1,zIndex:g?50:void 0};return(0,a.jsxs)(`div`,{ref:p,style:_,className:e.t(`relative h-full`,k[n]),children:[(0,a.jsx)(`div`,{className:`pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full`,children:i}),(0,a.jsxs)(`div`,{className:`absolute right-2 top-2 z-10 flex items-center gap-1`,children:[(0,a.jsx)(`div`,{role:`group`,"aria-label":c(`bento.layout.sizeGroup`,{defaultValue:`Tile size`}),className:`flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur`,children:R.map(t=>{let i=t===n,o=c(z[t].key,{defaultValue:z[t].def});return(0,a.jsx)(`button`,{type:`button`,onClick:()=>r(t),"aria-pressed":i,"aria-label":o,title:o,className:e.t(`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`),children:o.charAt(0)},t)})}),(0,a.jsx)(`button`,{type:`button`,...l,...u,"aria-label":c(`bento.layout.dragToReorder`,{defaultValue:`Drag to reorder`}),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`,children:(0,a.jsx)(s.IconGripVertical,{size:14,className:`text-muted-foreground`})})]})]})}function V({route:e,label:t,subtitle:n,chip:r}){let{t:i}=(0,o.useTranslation)();return(0,a.jsxs)(l.Link,{to:e,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`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(`span`,{className:`bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,children:(0,a.jsx)(s.IconPlus,{size:20})}),(0,a.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:i(`forms.formActions.new`,{defaultValue:`New`})})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`div`,{className:`text-base font-semibold tracking-tight md:text-lg`,children:(0,a.jsx)(`span`,{className:`${r} bg-clip-text text-transparent`,children:t})}),n&&(0,a.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n})]})]})}function H({title:e,description:t}){return(0,a.jsx)(b,{icon:s.IconSparkles,title:e,description:t,align:`start`,className:`col-span-2 row-span-2 justify-end md:col-span-4`})}function U({title:e,badges:n,actions:r,onCancel:i,loading:c,disabled:l,dirty:u,titleMissing:d}){let{t:f}=(0,o.useTranslation)();return(0,a.jsxs)(`div`,{className:`bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl`,children:[(0,a.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[e&&(0,a.jsx)(`p`,{className:`truncate text-base font-semibold tracking-tight md:text-lg`,children:e}),(0,a.jsx)(T,{titleMissing:d,dirty:u}),n&&(0,a.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:n})]}),(0,a.jsx)(`div`,{className:`flex shrink-0 gap-2`,children:r??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.u,{type:`submit`,size:`sm`,loading:c,disabled:l,children:[(0,a.jsx)(s.IconDeviceFloppy,{className:`size-4`}),f(`forms.formActions.saveChanges`)]}),i&&(0,a.jsxs)(t.u,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:[(0,a.jsx)(s.IconX,{className:`size-4`}),f(`forms.formActions.cancel`)]})]})})]})}function W({children:e}){return(0,a.jsx)(`span`,{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`,children:e})}U.Badge=W;function G(e){let t=(0,i.useRef)(null);return E(t),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{ref:t,"aria-hidden":!0,className:`h-px`}),(0,a.jsx)(`div`,{"aria-hidden":!0,className:`bento-save-bar-spacer`}),(0,a.jsx)(`div`,{className:`bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8`,children:(0,a.jsx)(U,{...e})})]})}function K({eyebrow:e,backTo:n,backLabel:r,leading:i,title:c,subtitle:l,trailing:u,onCancel:d,actions:f,loading:p,dirty:m,titleMissing:h,saveDisabled:g,stickyTitle:_,stickyBadges:v}){let{t:y}=(0,o.useTranslation)(),b=g??(!!h||!m);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S,{eyebrow:n===void 0?e:(0,a.jsx)(x,{to:n,children:r}),leading:i,title:c,subtitle:l,trailing:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:f??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.u,{type:`submit`,size:`sm`,loading:p,disabled:b,children:[(0,a.jsx)(s.IconDeviceFloppy,{className:`size-4`}),y(`forms.formActions.saveChanges`)]}),(0,a.jsxs)(t.u,{type:`button`,variant:`outline`,size:`sm`,onClick:d,children:[(0,a.jsx)(s.IconX,{className:`size-4`}),y(`forms.formActions.cancel`)]})]})}),u]})}),(0,a.jsx)(G,{title:_,badges:v,actions:f,onCancel:d,loading:p,disabled:b,dirty:m,titleMissing:h})]})}function q({icon:t,tone:n,title:r,description:i,children:o,trailing:s,as:c=`h2`,className:l}){return(0,a.jsxs)(`section`,{className:e.t(`bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6`,l),children:[(0,a.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(`span`,{className:`grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${v(n)}`,children:(0,a.jsx)(t,{size:20})}),(0,a.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,a.jsx)(c,{className:`text-base font-semibold tracking-tight md:text-lg`,children:r}),i&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i})]})]}),s&&(0,a.jsx)(`div`,{className:`shrink-0`,children:s})]}),(0,a.jsx)(`div`,{className:`flex flex-col gap-5`,children:o})]})}function J({children:t,className:n,contentClassName:r}){return(0,a.jsx)(`div`,{className:e.t(`bento-glass rounded-2xl shadow-md`,n),children:(0,a.jsx)(`div`,{className:r,children:t})})}var te=480;function ne(e){return window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)}function Y(){return window.scrollY>te}function re(){let{t:e}=(0,o.useTranslation)(),t=(0,i.useSyncExternalStore)(ne,Y,()=>!1);return(0,a.jsx)(`button`,{type:`button`,"aria-label":e(`bento.backToTop`,{defaultValue:`Back to top`}),tabIndex:t?0:-1,onClick:()=>window.scrollTo({top:0,behavior:`smooth`}),className:`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 ${t?`translate-y-0 scale-100 opacity-100`:`pointer-events-none translate-y-4 scale-90 opacity-0`}`,children:(0,a.jsx)(s.IconArrowUp,{size:18})})}function X(e){return e.bentoRoute??e.fallbackRoute}function Z({label:e,children:t}){return e?(0,a.jsxs)(`div`,{role:`group`,"aria-label":e,children:[(0,a.jsx)(`p`,{className:`px-3 pt-2 pb-1 text-xs font-medium text-muted-foreground`,children:e}),t]}):(0,a.jsx)(a.Fragment,{children:t})}function ie({index:e,active:t,icon:n,label:r,description:i,trailing:o,onActivate:c,onChoose:l}){return(0,a.jsxs)(`button`,{type:`button`,id:`bento-palette-opt-${e}`,"data-index":e,role:`option`,"aria-selected":t?`true`:`false`,onMouseEnter:c,onClick:l,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`}`,children:[n&&(0,a.jsx)(n,{size:18,className:`shrink-0 text-muted-foreground`}),(0,a.jsxs)(`span`,{className:`flex-1 truncate`,children:[r,i&&(0,a.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:i})]}),o??(t&&(0,a.jsx)(s.IconArrowRight,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground`}))]})}function ae({open:e,onOpenChange:n,items:r,group:c,onQueryChange:u}){let{t:d}=(0,o.useTranslation)(),f=(0,l.useNavigate)(),[p,m]=(0,i.useState)(``),[h,g]=(0,i.useState)(0),_=(0,i.useRef)(null),v=(0,i.useMemo)(()=>{let e=p.trim().toLowerCase(),t=r.map(e=>({item:e,label:d(e.titleKey),description:d(e.descriptionKey)}));if(!e)return t;let n=[],i=[];for(let r of t)r.label.toLowerCase().includes(e)?n.push(r):r.description.toLowerCase().includes(e)&&i.push(r);return[...n,...i]},[r,p,d]),y=(0,i.useMemo)(()=>[...v.map(e=>({kind:`nav`,entry:e})),...(c?.items??[]).map(e=>({kind:`supplied`,item:e}))],[v,c]),b=(0,i.useRef)(u);(0,i.useEffect)(()=>{b.current=u}),(0,i.useEffect)(()=>{b.current?.(p)},[p]);let[x,S]=(0,i.useState)(e);e!==x&&(S(e),e&&(m(``),g(0)));let C=y.length===0?0:y.length-1;h>C&&g(C),(0,i.useEffect)(()=>{(_.current?.querySelector(`[data-index="${h}"]`))?.scrollIntoView({block:`nearest`})},[h]);function w(e){n(!1),e.kind===`nav`?f(X(e.entry.item)):c?.onSelect(e.item)}function T(e){if(e.key===`ArrowDown`)e.preventDefault(),g(e=>y.length===0?0:(e+1)%y.length);else if(e.key===`ArrowUp`)e.preventDefault(),g(e=>y.length===0?0:(e-1+y.length)%y.length);else if(e.key===`Enter`){e.preventDefault();let t=y[h];t&&w(t)}}return(0,a.jsx)(t.D,{open:e,onOpenChange:n,children:(0,a.jsxs)(t.k,{showCloseButton:!1,className:`top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0`,onKeyDown:T,children:[(0,a.jsx)(t.F,{className:`sr-only`,children:d(`bento.palette.title`,{defaultValue:`Command palette`})}),(0,a.jsx)(t.A,{className:`sr-only`,children:d(`bento.palette.description`,{defaultValue:`Search and jump to any area`})}),(0,a.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/60 px-4`,children:[(0,a.jsx)(s.IconSearch,{size:18,className:`shrink-0 text-muted-foreground`}),(0,a.jsx)(`input`,{autoFocus:!0,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`bento-palette-list`,"aria-activedescendant":y[h]?`bento-palette-opt-${h}`:void 0,value:p,onChange:e=>m(e.target.value),placeholder:d(`bento.palette.placeholder`,{defaultValue:`Search areas…`}),className:`h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,a.jsxs)(`div`,{ref:_,id:`bento-palette-list`,role:`listbox`,"aria-label":d(`bento.palette.title`,{defaultValue:`Command palette`}),className:`max-h-80 overflow-y-auto p-2`,children:[y.length===0&&!c?.pending&&(0,a.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:d(`bento.palette.noResults`,{defaultValue:`No matches`})}),(0,a.jsx)(Z,{label:c&&v.length>0?d(`bento.palette.areas`,{defaultValue:`Areas`}):void 0,children:v.map(({item:e,label:t},n)=>(0,a.jsx)(ie,{index:n,active:n===h,icon:e.icon,label:t,onActivate:()=>g(n),onChoose:()=>w(y[n]),trailing:e.bentoRoute?void 0:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.IconExternalLink,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground/70`}),(0,a.jsx)(`span`,{className:`sr-only`,children:d(`bento.palette.opensConsole`,{defaultValue:`Opens in console`})})]})},e.id))}),c&&(0,a.jsxs)(Z,{label:c.label,children:[c.items.map((e,t)=>{let n=v.length+t;return(0,a.jsx)(ie,{index:n,active:n===h,icon:e.icon,label:e.label,description:e.description,onActivate:()=>g(n),onChoose:()=>w(y[n])},e.id)}),c.pending&&(0,a.jsx)(`p`,{className:`px-3 py-2.5 text-sm text-muted-foreground`,children:d(`bento.palette.searching`,{defaultValue:`Searching…`})})]})]})]})})}function oe({open:e,onOpenChange:n,isMac:r}){let{t:i}=(0,o.useTranslation)(),c=r?`⌘`:`Ctrl`,l=[{heading:i(`bento.shortcuts.global`,{defaultValue:`Global`}),rows:[{keys:[c,`K`],label:i(`bento.palette.open`,{defaultValue:`Open command palette`})},{keys:[`?`],label:i(`bento.shortcuts.openGuide`,{defaultValue:`Show keyboard shortcuts`})}]},{heading:i(`bento.shortcuts.palette`,{defaultValue:`Command palette`}),rows:[{keys:[`↑`,`↓`],label:i(`bento.shortcuts.navigate`,{defaultValue:`Move between results`})},{keys:[`↵`],label:i(`bento.shortcuts.openSelected`,{defaultValue:`Open the selected area`})},{keys:[`Esc`],label:i(`bento.shortcuts.dismiss`,{defaultValue:`Close the palette or a dialog`})}]}];return(0,a.jsx)(t.D,{open:e,onOpenChange:n,children:(0,a.jsxs)(t.k,{className:`max-w-md`,children:[(0,a.jsxs)(t.M,{children:[(0,a.jsxs)(t.F,{className:`flex items-center gap-2`,children:[(0,a.jsx)(s.IconKeyboard,{size:20,className:`bento-accent-icon`}),i(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]}),(0,a.jsx)(t.A,{children:i(`bento.shortcuts.description`,{defaultValue:`Move around without leaving the keyboard.`})})]}),(0,a.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,a.jsxs)(`section`,{children:[(0,a.jsx)(`h3`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e.heading}),(0,a.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.rows.map(e=>(0,a.jsxs)(`li`,{className:`flex items-center justify-between gap-4`,children:[(0,a.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),(0,a.jsx)(`span`,{className:`flex shrink-0 items-center gap-1`,children:e.keys.map(e=>(0,a.jsx)(`kbd`,{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`,children:e},e))})]},e.label))})]},e.heading))})]})})}var se=s.IconLayoutGrid;function ce(e,t){return e===t||e.startsWith(`${t}/`)}function le(e,t){return t.section.areaRoute&&ce(e,t.section.areaRoute)?!0:t.items.some(t=>t.bentoRoute&&ce(e,t.bentoRoute))}function ue({groups:e,homeRoute:n,homeAliases:r,homeLabel:c}){let{t:u}=(0,o.useTranslation)(),{pathname:d}=(0,l.useLocation)(),f=(0,i.useMemo)(()=>e.filter(e=>!!e.section.areaRoute),[e]),p=d===n||(r?.includes(d)??!1);return(0,a.jsx)(t.o,{delayDuration:200,children:(0,a.jsxs)(`nav`,{"aria-label":u(`bento.nav.label`,{defaultValue:`Primary`}),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`,children:[(0,a.jsx)(de,{to:n,icon:s.IconHome,label:c??u(`home.title`,{defaultValue:`Home`}),active:p}),f.length>0&&(0,a.jsx)(`span`,{"aria-hidden":!0,className:`my-1 h-px w-6 bg-border/60`}),f.map(e=>(0,a.jsx)(de,{to:e.section.areaRoute,icon:e.section.icon??se,label:e.section.labelKey?u(e.section.labelKey):e.section.id,active:le(d,e)},e.section.id))]})})}function de({to:e,icon:n,label:r,active:i}){return(0,a.jsxs)(t.i,{children:[(0,a.jsx)(t.s,{asChild:!0,children:(0,a.jsx)(l.Link,{to:e,"aria-label":r,"aria-current":i?`page`:void 0,className:`bento-tile-clickable grid h-11 w-11 shrink-0 place-items-center rounded-2xl border transition-colors duration-200 ${i?`bento-rail-active`:`border-transparent text-muted-foreground hover:border-border/60 hover:bg-card/60 hover:text-foreground`}`,children:(0,a.jsx)(n,{size:20})})}),(0,a.jsx)(t.a,{side:`right`,children:r})]})}function fe({accountRoute:e,logoutUrl:r,organizationsRoute:i,tenantAdminRoute:c,onOpenShortcuts:u,onReplayTour:d}){let{user:f,status:p}=n.n(),{t:m}=(0,o.useTranslation)(),h=(0,l.useNavigate)(),g=`${f.firstName??``} ${f.lastName??``}`.trim()||f.username||``;return p===`loading`?(0,a.jsx)(`div`,{className:`h-9 w-9 rounded-full bg-muted/40`,"aria-hidden":!0}):(0,a.jsxs)(t.f,{children:[(0,a.jsx)(t.E,{asChild:!0,children:(0,a.jsx)(`button`,{type:`button`,title:g||f.username,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`,children:(0,a.jsx)(n.r,{givenName:f.firstName,familyName:f.lastName,name:g||f.username,src:f.avatarUrl||void 0,alt:f.username})})}),(0,a.jsxs)(t.m,{align:`end`,sideOffset:10,className:`bento-dropdown min-w-64 p-2`,children:[(0,a.jsx)(t._,{className:`p-0 font-normal`,children:(0,a.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm`,children:[(0,a.jsx)(`span`,{className:`rounded-full p-0.5 ring-1 ring-border/60`,children:(0,a.jsx)(n.r,{givenName:f.firstName,familyName:f.lastName,name:g||f.username,src:f.avatarUrl||void 0,alt:f.username})}),(0,a.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[g&&(0,a.jsx)(`span`,{className:`truncate font-medium`,children:g}),f.email&&(0,a.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:f.email})]})]})}),(0,a.jsx)(t.x,{className:`my-1.5 bg-border/50`}),(0,a.jsxs)(t.h,{children:[(0,a.jsxs)(t.g,{onSelect:()=>h(e),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconUserCircle,{size:18}),m(`nav.account`)]}),i&&(0,a.jsxs)(t.g,{onSelect:()=>h(i),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconBuildingCommunity,{size:18}),m(`nav.organizations`,{defaultValue:`Organizations`})]}),c&&(0,a.jsxs)(t.g,{onSelect:()=>h(c),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconBuildingSkyscraper,{size:18}),m(`nav.tenantAdmin`,{defaultValue:`Tenant administration`})]})]}),(u||d)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.x,{className:`my-1.5 bg-border/50`}),(0,a.jsxs)(t.h,{children:[d&&(0,a.jsxs)(t.g,{onSelect:()=>d(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconSparkles,{size:18}),m(`bento.tour.replay`,{defaultValue:`Take the tour`})]}),u&&(0,a.jsxs)(t.g,{onSelect:()=>u(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconKeyboard,{size:18}),m(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]})]})]}),(0,a.jsx)(t.x,{className:`my-1.5 bg-border/50`}),(0,a.jsxs)(t.g,{onSelect:()=>{globalThis.location.href=r},className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger`,children:[(0,a.jsx)(s.IconLogout,{size:18}),m(`nav.logOut`)]})]})]})}var Q=(0,i.createContext)(`console`);function pe({chrome:e,children:t}){return(0,a.jsx)(Q.Provider,{value:e,children:t})}function me(){return(0,i.useContext)(Q)}var he={blue:`blue`,violet:`violet`,emerald:`emerald`,amber:`amber`,rose:`rose`,slate:`slate`,cyan:`blue`,orange:`amber`};function $({variant:e=`blue`,defaultOpen:t,className:r,children:o}){let s=(0,i.useContext)(Q),c,l;return s===`bento`&&i.Children.forEach(o,e=>{if(!(0,i.isValidElement)(e))return;let{type:t}=e;t===n.o.Header||t===n.o.StaticHeader?c=e.props:t===n.o.Content&&(l=e.props.children)}),s===`bento`&&c?(0,a.jsx)(q,{icon:c.icon,tone:he[e]??`blue`,title:c.title,description:c.description,className:r,children:l}):(0,a.jsx)(n.o,{variant:e,defaultOpen:t,className:r,children:o})}$.Header=n.o.Header,$.StaticHeader=n.o.StaticHeader,$.Content=n.o.Content;var ge=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function _e({eyebrow:e,title:t,description:n,titleHref:r,children:i,gridClassName:o=ge}){let c=(0,a.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight md:text-2xl`,children:t});return(0,a.jsxs)(`section`,{className:`mb-8 md:mb-10`,children:[(0,a.jsxs)(`header`,{className:`bento-shell-header mb-4 flex flex-col gap-0.5`,children:[e&&(0,a.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:e}),r?(0,a.jsxs)(l.Link,{to:r,className:`group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary`,children:[c,(0,a.jsx)(s.IconChevronRight,{size:20,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}):c,n&&(0,a.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:n})]}),(0,a.jsx)(`div`,{className:o,children:i})]})}function ve({to:t,onClick:n,disabled:r=!1,disabledHint:i,icon:o,tone:c,eyebrow:u,title:d,span:f,featured:p=!1,children:m}){let h=!r&&!!(t||n),g=p?`h-14 w-14 rounded-2xl`:`h-9 w-9 rounded-2xl`,_=p?28:18,y=p?`text-xl font-semibold tracking-tight md:text-2xl`:`text-base font-semibold tracking-tight md:text-lg`,b=(0,a.jsxs)(a.Fragment,{children:[p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${v(c)} opacity-40 blur-2xl dark:opacity-50`}),(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${v(c)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,a.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,a.jsx)(`span`,{className:`grid place-items-center ${v(c)} text-white shadow-md ${g}`,children:(0,a.jsx)(o,{size:_})}),h&&(0,a.jsx)(s.IconChevronRight,{size:p?18:16,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}),(0,a.jsxs)(`div`,{className:`relative z-1`,children:[(0,a.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:u}),(0,a.jsx)(`div`,{className:`mt-0.5 ${y}`,children:d}),m&&(0,a.jsx)(`div`,{className:`mt-2`,children:m})]})]}),x=`bento-tile bento-glass group relative flex flex-col ${p?`gap-5`:`gap-4`} overflow-hidden text-left ${p?`p-6 md:p-7`:`p-5`} ${f}${h?` bento-tile-clickable`:``}${r?` cursor-not-allowed opacity-60`:``}`;return r?(0,a.jsx)(`div`,{className:x,"aria-disabled":`true`,title:i,children:b}):t?(0,a.jsx)(l.Link,{to:t,className:x,children:b}):n?(0,a.jsx)(`button`,{type:`button`,onClick:n,className:e.t(`w-full`,x),children:b}):(0,a.jsx)(`div`,{className:x,children:b})}exports.AdaptiveSectionCard=$,exports.BENTO_EMPHASIS_NEXT=A,exports.BENTO_EMPHASIS_SPAN=k,exports.BENTO_TONES=_,exports.BENTO_TONE_CLASS=g,exports.BentoActionsMenu=h,exports.BentoBackLink=x,exports.BentoBackToTop=re,exports.BentoCommandPalette=ae,exports.BentoCountTile=y,exports.BentoEmptyState=b,exports.BentoEntityShell=O,exports.BentoEntityTile=N,exports.BentoFormHero=K,exports.BentoFormSection=q,exports.BentoHero=S,exports.BentoHeroIconPicker=C,exports.BentoInlineEdit=w,exports.BentoListPage=F,exports.BentoNavRail=ue,exports.BentoPanel=J,exports.BentoSaveBar=U,exports.BentoScrollSaveBar=G,exports.BentoSection=_e,exports.BentoShortcutsDialog=oe,exports.BentoStatusMarker=T,exports.BentoTile=ve,exports.BentoTileGrid=I,exports.BentoUserMenu=fe,exports.SectionCardChromeProvider=pe,exports.bentoChipClass=v,exports.bentoNavTarget=X,exports.resolveBentoLayout=j,exports.toBentoLayoutEntries=M,exports.useBentoScrollFade=E,exports.useSectionChrome=me;
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-Oagwe_oa.cjs"),t=require("./badge-locale-1_BmNTro.cjs"),n=require("./user.context-D01CI8gq.cjs"),r=require("./loading-provider-E4tIG9BM.cjs");let i=require("react"),a=require("react/jsx-runtime"),o=require("react-i18next"),s=require("@tabler/icons-react"),c=require("@iconify/react"),l=require("react-router-dom"),u=require("@tanstack/react-table"),d=require("@dnd-kit/core"),f=require("@dnd-kit/sortable"),p=require("@dnd-kit/utilities"),m=require("sonner");var h={default:``,destructive:`bento-item-danger`},g=new Set;function _(e){process.env.NODE_ENV===`production`||g.has(e)||(g.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.`))}function v({actions:e,triggerLabel:t}){let{t:r}=(0,o.useTranslation)();if(e.length===0)return null;for(let t of e)t.id||_(t.label);return(0,a.jsxs)(n.S,{children:[(0,a.jsx)(n.I,{asChild:!0,children:(0,a.jsx)(`button`,{type:`button`,"aria-label":t??r(`forms.formActions.moreActions`,{defaultValue:`More actions`}),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`,children:(0,a.jsx)(s.IconDotsVertical,{size:18})})}),(0,a.jsx)(n.w,{align:`end`,sideOffset:8,className:`bento-dropdown min-w-44 p-1.5`,children:e.map(e=>{let t=e.icon,r=h[e.tone??`default`];return(0,a.jsxs)(n.E,{"data-action-id":e.id,onSelect:e.onSelect,disabled:e.disabled,className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${r}`,children:[(0,a.jsx)(t,{size:16}),e.label]},e.id??e.label)})})]})}var y={blue:`bento-tone-blue`,indigo:`bento-tone-indigo`,violet:`bento-tone-violet`,emerald:`bento-tone-emerald`,amber:`bento-tone-amber`,rose:`bento-tone-rose`,slate:`bento-tone-slate`},b=Object.keys(y);function x(e){return`bento-chip ${y[e]??y.slate}`}function S({to:e,icon:t,tone:n,label:r,count:i,span:o}){let s=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:`grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${x(n)}`,children:(0,a.jsx)(t,{size:18})}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`div`,{className:`text-3xl font-semibold tabular-nums tracking-tight`,children:i}),(0,a.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:r})]})]}),c=`bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${o}${e?` bento-tile-clickable`:``}`;return e?(0,a.jsx)(l.Link,{to:e,className:c,children:s}):(0,a.jsx)(`div`,{className:c,children:s})}var C=6,w={rowSortingFeature:u.rowSortingFeature,coreRowModel:(0,u.createCoreRowModel)(),sortedRowModel:(0,u.createSortedRowModel)()};function T({rows:t,getRowId:r,columns:c,label:l,getRowLabel:d,rowActions:f,selectionActions:p,onSelectionChange:m,selectionScope:h,layout:g,onLayoutChange:_,onRowOpen:y,rowHeight:b=44,height:x=480,empty:S}){let{t:T}=(0,o.useTranslation)(),[E,D]=(0,i.useState)([]),[O,k]=(0,i.useState)({hidden:[]}),[A,j]=(0,i.useState)(new Set),[M,N]=(0,i.useState)(null),[P,F]=(0,i.useState)(h);P!==h&&(F(h),j(new Set),N(null));let I=(0,i.useRef)(h);(0,i.useEffect)(()=>{I.current!==h&&(I.current=h,m?.([]))},[h,m]);let[L,R]=(0,i.useState)(0),[z,ee]=(0,i.useState)(0),te=(0,i.useRef)(null),B=(0,i.useRef)(new Map),V=(0,i.useRef)(!1),H=(p?.length??0)>0,U=e=>d?.(e)??r(e),ne=(0,i.useMemo)(()=>c.map(e=>({id:e.id,accessorFn:t=>e.sortValue?.(t)??null,enableSorting:e.sortValue!==void 0})),[c]),W=(0,u.useTable)({features:w,data:t,columns:ne,state:{sorting:E},onSortingChange:D}).getRowModel().rows.map(e=>e.original),G=g??O,K=c.filter(e=>e.hideable===!1||!G.hidden.includes(e.id)),q=[H?`2.75rem`:null,...K.map(e=>e.width??`minmax(8rem, 1fr)`),f?.length?`3.25rem`:null].filter(Boolean).join(` `),J=W.length,Y=Math.max(1,Math.floor(x/b)),re=Math.max(0,Math.floor(z/b)-C),ie=Math.min(J,Math.ceil((z+x)/b)+C),X=Math.min(L,Math.max(0,J-1));(0,i.useEffect)(()=>{V.current&&(V.current=!1,B.current.get(X)?.focus())},[X,re]);function Z(e){j(e),m?.([...e])}function ae(e,t){let[n,i]=e<=t?[e,t]:[t,e];Z(new Set(W.slice(n,i+1).map(r)))}function oe(e){let t=r(W[e]),n=new Set(A);n.has(t)?n.delete(t):n.add(t),Z(n),N(e)}function Q(e,t){let n=Math.max(0,Math.min(J-1,e));if(t&&H){let e=M??X;N(e),ae(e,n)}let r=te.current,i=n*b;if(r){let e=r.scrollTop;i<e?e=i:i+b>e+x&&(e=i+b-x),e!==r.scrollTop&&(r.scrollTop=e,ee(e))}V.current=!0,R(n)}function se(e,t){if(e.target!==e.currentTarget)return;let n=e.shiftKey;switch(e.key){case`ArrowDown`:Q(t+1,n);break;case`ArrowUp`:Q(t-1,n);break;case`PageDown`:Q(t+Y,n);break;case`PageUp`:Q(t-Y,n);break;case`Home`:Q(0,n);break;case`End`:Q(J-1,n);break;case` `:if(!H)return;oe(t);break;case`Enter`:if(!y)return;y(W[t]);break;case`Escape`:if(!H||A.size===0)return;Z(new Set),N(null);break;case`a`:case`A`:if(!H||!(e.ctrlKey||e.metaKey))return;Z(new Set(W.map(r)));break;default:return}e.preventDefault()}function ce(e,t){if(!e.target.closest(`button, a, input, [role='checkbox']`)&&(R(t),H)){if(e.shiftKey){let e=M??X;N(e),ae(e,t)}else e.metaKey||e.ctrlKey?oe(t):(Z(new Set([r(W[t])])),N(t))}}function le(e){let t=E.find(t=>t.id===e);t?t.desc?D([]):D([{id:e,desc:!0}]):D([{id:e,desc:!1}])}function ue(e,t){let n={hidden:t?[...G.hidden,e]:G.hidden.filter(t=>t!==e)};g===void 0&&k(n),_?.(n)}let $=W.filter(e=>A.has(r(e))),de=J>0&&$.length===J,fe=c.filter(e=>e.hideable!==!1);return(0,a.jsxs)(`div`,{"data-slot":`bento-data-table`,className:`bento-glass overflow-hidden rounded-2xl`,children:[(0,a.jsxs)(`div`,{className:`flex min-h-12 flex-wrap items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,a.jsx)(`span`,{"aria-live":`polite`,className:`text-sm font-medium`,children:$.length>0?T(`bento.table.selected`,{defaultValue:`{{count}} selected`,count:$.length}):``}),$.length>0&&(0,a.jsxs)(`div`,{role:`toolbar`,"aria-label":T(`bento.table.selectionActions`,{defaultValue:`Actions on the selection`}),className:`flex flex-wrap items-center gap-2`,children:[p?.map(t=>{let r=t.icon;return(0,a.jsxs)(n.R,{variant:`outline`,size:`sm`,className:e.t(`gap-1.5`,t.tone===`destructive`&&`bento-item-danger`),onClick:()=>t.onSelect($),children:[(0,a.jsx)(r,{size:16}),t.label]},t.id)}),(0,a.jsx)(n.R,{variant:`ghost`,size:`sm`,onClick:()=>Z(new Set),children:T(`bento.table.clearSelection`,{defaultValue:`Clear selection`})})]}),fe.length>0&&(0,a.jsxs)(n.S,{children:[(0,a.jsx)(n.I,{asChild:!0,children:(0,a.jsxs)(n.R,{variant:`ghost`,size:`sm`,className:`ml-auto gap-1.5`,children:[(0,a.jsx)(s.IconColumns3,{size:16,"aria-hidden":`true`}),T(`bento.table.columns`,{defaultValue:`Columns`})]})}),(0,a.jsx)(n.w,{align:`end`,className:`bento-dropdown min-w-44 p-1.5`,children:fe.map(e=>(0,a.jsx)(n.C,{checked:!G.hidden.includes(e.id),onCheckedChange:t=>ue(e.id,t!==!0),onSelect:e=>e.preventDefault(),children:e.header},e.id))})]})]}),(0,a.jsxs)(`div`,{role:`grid`,"aria-label":l,"aria-rowcount":J+1,"aria-colcount":K.length+ +!!H+ +!!f?.length,"aria-multiselectable":H?`true`:void 0,children:[(0,a.jsx)(`div`,{role:`rowgroup`,children:(0,a.jsxs)(`div`,{role:`row`,"aria-rowindex":1,className:`grid items-center border-b border-border/50 px-1 text-xs font-medium text-muted-foreground`,style:{gridTemplateColumns:q,minHeight:b},children:[H&&(0,a.jsx)(`div`,{role:`columnheader`,className:`grid place-items-center`,children:(0,a.jsx)(n.L,{"aria-label":T(`bento.table.selectAll`,{defaultValue:`Select all rows`}),checked:de?!0:$.length>0&&`indeterminate`,onCheckedChange:()=>Z(de?new Set:new Set(W.map(r)))})}),K.map(e=>{let t=E.find(t=>t.id===e.id),n=t?t.desc?`descending`:`ascending`:`none`;return(0,a.jsx)(`div`,{role:`columnheader`,"aria-sort":e.sortValue?n:void 0,className:`min-w-0 px-2`,children:e.sortValue?(0,a.jsxs)(`button`,{type:`button`,onClick:()=>le(e.id),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`,children:[(0,a.jsx)(`span`,{className:`truncate`,children:e.header}),n===`ascending`&&(0,a.jsx)(s.IconArrowUp,{size:14,"aria-hidden":`true`}),n===`descending`&&(0,a.jsx)(s.IconArrowDown,{size:14,"aria-hidden":`true`}),n===`none`&&(0,a.jsx)(s.IconArrowsSort,{size:14,"aria-hidden":`true`,className:`opacity-40`})]}):(0,a.jsx)(`span`,{className:`block truncate py-1`,children:e.header})},e.id)}),f?.length?(0,a.jsx)(`div`,{role:`columnheader`,className:`px-2`,children:(0,a.jsx)(`span`,{className:`sr-only`,children:T(`bento.table.actions`,{defaultValue:`Actions`})})}):null]})}),J===0?(0,a.jsx)(`div`,{role:`rowgroup`,children:(0,a.jsx)(`div`,{role:`row`,"aria-rowindex":2,children:(0,a.jsx)(`div`,{role:`gridcell`,className:`px-4 py-10 text-center text-sm text-muted-foreground`,children:S??T(`bento.table.empty`,{defaultValue:`Nothing to show`})})})}):(0,a.jsx)(`div`,{role:`rowgroup`,ref:te,onScroll:e=>ee(e.currentTarget.scrollTop),className:`relative overflow-y-auto`,style:{height:x},children:(0,a.jsx)(`div`,{style:{height:J*b},className:`relative`,children:W.slice(re,ie).map((t,i)=>{let o=re+i,s=r(t),c=A.has(s),l=U(t);return(0,a.jsxs)(`div`,{ref:e=>{e?B.current.set(o,e):B.current.delete(o)},role:`row`,"aria-rowindex":o+2,"aria-selected":H?c?`true`:`false`:void 0,tabIndex:o===X?0:-1,onKeyDown:e=>se(e,o),onClick:e=>ce(e,o),onDoubleClick:()=>y?.(t),onFocus:e=>{e.target===e.currentTarget&&R(o)},className:e.t(`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`,c&&`bg-primary/10 hover:bg-primary/15`),style:{top:o*b,height:b,gridTemplateColumns:q},children:[H&&(0,a.jsx)(`div`,{role:`gridcell`,className:`grid place-items-center`,children:(0,a.jsx)(n.L,{tabIndex:-1,"aria-label":T(`bento.table.selectRow`,{defaultValue:`Select {{row}}`,row:l}),checked:c,onCheckedChange:()=>oe(o)})}),K.map(e=>(0,a.jsx)(`div`,{role:`gridcell`,className:`min-w-0 truncate px-2`,children:e.cell(t)},e.id)),f?.length?(0,a.jsx)(`div`,{role:`gridcell`,className:`grid place-items-center`,children:(0,a.jsx)(v,{triggerLabel:T(`bento.table.rowActions`,{defaultValue:`Actions for {{row}}`,row:l}),actions:f.map(e=>({id:e.id,label:e.label,icon:e.icon,tone:e.tone,onSelect:()=>e.onSelect([t])}))})}):null]},s)})})})]})]})}function E({icon:t=s.IconSparkles,tone:n=`indigo`,title:r,description:i,action:o,align:c=`center`,titleLevel:l=2,className:u}){let d=x(n),f=c===`center`,p=`h${l}`;return(0,a.jsxs)(`div`,{className:e.t(`bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8`,f?`items-center text-center`:`items-start text-left`,u),children:[(0,a.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${d} text-white shadow-md`,children:(0,a.jsx)(t,{size:24})}),(0,a.jsx)(p,{className:`m-0 text-lg font-semibold tracking-tight`,children:r}),i&&(0,a.jsx)(`p`,{className:e.t(`max-w-md text-sm text-muted-foreground`,f&&`mx-auto`),children:i}),o&&(0,a.jsx)(`div`,{className:e.t(`mt-1`,f&&`mx-auto`),children:o})]})}function D({to:e,children:t}){return(0,a.jsxs)(l.Link,{to:e,className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,a.jsx)(s.IconArrowLeft,{size:14,"aria-hidden":!0}),t]})}function O({eyebrow:e,backTo:t,backLabel:n,title:r,subtitle:i,leading:o,trailing:s}){let c=e??(t==null?null:(0,a.jsx)(D,{to:t,children:n}));return(0,a.jsx)(`header`,{className:`bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10`,children:(0,a.jsxs)(`div`,{className:`flex w-full items-start gap-4`,children:[o&&(0,a.jsx)(`div`,{className:`shrink-0`,children:o}),(0,a.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[c&&(0,a.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:c}),(0,a.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight md:text-4xl`,children:r}),i&&(0,a.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:i})]}),s&&(0,a.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:s})]})})}function k({value:e,onChange:t,onClear:r,defaultIcon:l,tone:u,title:d,description:f,readOnly:p=!1}){let{t:m}=(0,o.useTranslation)(),[h,g]=(0,i.useState)(!1);return p?(0,a.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${x(u)} text-white shadow-md`,children:e?(0,a.jsx)(c.Icon,{icon:e,className:`size-6 text-white`}):(0,a.jsx)(l,{size:24})}):(0,a.jsxs)(`div`,{className:`group relative`,children:[(0,a.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),"aria-label":m(`forms.iconPicker.chooseAnIcon`),className:`group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${x(u)} 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`,children:[e?(0,a.jsx)(c.Icon,{icon:e,className:`size-6 text-white`}):(0,a.jsx)(l,{size:24}),(0,a.jsx)(`span`,{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`,children:(0,a.jsx)(s.IconPalette,{className:`size-5 text-white`})})]}),e&&r&&(0,a.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r()},"aria-label":m(`forms.common.remove`),title:m(`forms.common.remove`),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`,children:(0,a.jsx)(s.IconX,{size:12})}),(0,a.jsx)(n.x,{open:h,onOpenChange:g,value:e,onSelect:t,onClear:r,title:d,description:f})]})}function A({value:n,onSave:r,multiline:s=!1,placeholder:c,className:l,ariaLabel:u,autoFocus:d=!1,readOnly:f=!1,commitOnChange:p=!1}){let{t:m}=(0,o.useTranslation)(),[h,g]=(0,i.useState)(d),[_,v]=(0,i.useState)(n),[y,b]=(0,i.useState)(!1),x=(0,i.useRef)(null),S=(0,i.useRef)(null),C=(0,i.useRef)(!1),w=(0,i.useRef)(!1),[T,E]=(0,i.useState)(n);!h&&n!==T&&(E(n),v(n)),(0,i.useEffect)(()=>{h&&x.current?(x.current.focus(),x.current.select()):!h&&w.current&&(w.current=!1,S.current?.focus())},[h]);function D(){w.current=x.current!==null&&document.activeElement===x.current,g(!1)}async function O(){if(C.current)return;let e=_.trim();if(e===n){D();return}if(!e&&!c){v(n),D();return}C.current=!0,b(!0);try{await r(e)}catch{v(n)}finally{C.current=!1,b(!1),D()}}function k(){v(n),D()}function A(e){v(e),p&&r(e)}let j=!n;if(f)return(0,a.jsx)(`span`,{className:e.t(`block w-full`,l),"aria-label":u,children:n||(0,a.jsx)(`span`,{className:`text-muted-foreground/80`,children:c??`—`})});let M=`w-full bg-transparent outline-none border-b transition-colors duration-200`,N=e.t(M,`cursor-text rounded-sm`,j?`border-dashed border-border/70 hover:border-foreground/40`:`border-transparent hover:border-border/60 focus-visible:border-border/80`),P=e.t(M,`bento-editing`);if(!h)return(0,a.jsx)(`button`,{ref:S,type:`button`,onClick:()=>g(!0),className:e.t(N,`text-left`,l),"aria-label":u??m(`forms.formActions.edit`),children:n||(0,a.jsx)(`span`,{className:`text-muted-foreground/80`,children:c??`—`})});function F(e){if(e.key===`Escape`){e.preventDefault(),k();return}e.key===`Enter`&&(!s||e.metaKey||e.ctrlKey)&&(e.preventDefault(),O())}return s?(0,a.jsx)(`textarea`,{ref:x,value:_,onChange:e=>A(e.target.value),onBlur:O,onKeyDown:F,placeholder:c,"aria-label":u,"aria-busy":y||void 0,rows:3,className:e.t(P,`resize-none py-0.5 leading-snug`,l)}):(0,a.jsx)(t.a,{ref:x,value:_,onChange:e=>A(e.target.value),onBlur:O,onKeyDown:F,placeholder:c,"aria-label":u,"aria-busy":y||void 0,className:e.t(P,`h-auto px-0 py-0 shadow-none focus-visible:ring-0`,l)})}function j({titleMissing:t,dirty:n,className:r}){let{t:i}=(0,o.useTranslation)();if(!t&&!n)return null;let c=`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal`;return t?(0,a.jsxs)(`span`,{className:e.t(c,`bento-status bento-status-error`,r),children:[(0,a.jsx)(s.IconAlertTriangle,{className:`size-3`}),i(`bento.saveBar.titleRequired`,{defaultValue:`Title required`})]}):(0,a.jsxs)(`span`,{className:e.t(c,`bento-status bento-status-warn`,r),children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse`}),i(`bento.saveBar.unsaved`,{defaultValue:`Unsaved changes`})]})}function M(e){(0,i.useEffect)(()=>{let t=e.current;if(!t)return;let n=document.documentElement,r=0,i=()=>{r=0;let e=t.getBoundingClientRect().top,i=Math.max(0,Math.min(1,(160-e)/80));n.style.setProperty(`--bento-fade`,String(i)),n.classList.toggle(`bento-fade-half`,i>.5)},a=()=>{r||=requestAnimationFrame(i)};return i(),window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a),()=>{r&&cancelAnimationFrame(r),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a),n.style.removeProperty(`--bento-fade`),n.classList.remove(`bento-fade-half`)}},[e])}function N(e,t){let n={};for(let r of Object.keys(e))Object.assign(n,{[r]:t[r]});return n}function P({entity:e,isNew:n,headlineFallback:c,eyebrow:u,listRoute:d,icon:f,tone:p,formId:h,feature:g,hasStatus:_=!1,hideIcon:y=!1,readOnly:b=!1,autosaveOnly:x=!1,badge:S,notice:C,onUpdate:w,onDelete:T,extraActions:E,children:P}){let{t:F}=(0,o.useTranslation)(),I=(0,l.useNavigate)(),[L,R]=(0,i.useState)(!1),[z,ee]=(0,i.useState)({isDirty:!1,isSubmitting:!1}),te=(0,i.useRef)(null);M(te);let B={title:e.title??``,description:e.description??``,icon:e.icon??null,enabled:e.enabled??1},[V,H]=(0,i.useState)(B),[U,ne]=(0,i.useState)(B);(B.title!==U.title||B.description!==U.description||B.icon!==U.icon||B.enabled!==U.enabled)&&(ne(B),H(B));async function W(t){if(H(e=>({...e,...t})),n||!w)return;let r=t.title??V.title;try{await w({...e,...t}),m.toast.success(F(`forms.common.updated`,{name:r,feature:g}))}catch(e){console.error(`Failed to update entity field`,e),H(e=>({...e,...N(t,B)})),m.toast.error(F(`forms.common.notUpdated`,{name:B.title||r,feature:g}))}}async function G(){if(T){try{await T()?(m.toast.success(F(`forms.common.deleted`,{name:V.title,feature:g})),I(d)):m.toast.error(F(`forms.common.notDeleted`,{name:V.title,feature:g}))}catch(e){console.error(`Failed to delete entity`,e),m.toast.error(F(`forms.common.notDeleted`,{name:V.title,feature:g}))}R(!1)}}let K=V.enabled===1,q=!b,J=!(x&&!n),Y=!V.title.trim(),re=!n&&!z.isDirty,ie=Y||re,X=[...E??[],...T&&!b?[{id:`entity.delete`,label:F(`forms.formActions.delete`),icon:s.IconTrash,tone:`destructive`,onSelect:()=>R(!0)}]:[]];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O,{eyebrow:(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,a.jsx)(D,{to:d,children:u}),!b&&(0,a.jsx)(j,{titleMissing:Y,dirty:n||z.isDirty})]}),leading:(0,a.jsx)(k,{value:V.icon,onChange:e=>W({icon:e}),onClear:()=>W({icon:null}),defaultIcon:f,tone:p,title:V.title,description:V.description,readOnly:b||y}),title:(0,a.jsx)(A,{value:V.title,onSave:e=>W({title:e}),placeholder:c,className:`text-3xl font-semibold tracking-tight md:text-4xl`,ariaLabel:F(`forms.common.title`),autoFocus:n,commitOnChange:n,readOnly:b}),subtitle:(0,a.jsx)(A,{value:V.description,onSave:e=>W({description:e}),multiline:!0,placeholder:F(`forms.common.description`),className:`max-w-2xl text-sm text-muted-foreground`,ariaLabel:F(`forms.common.description`),commitOnChange:n,readOnly:b}),trailing:(0,a.jsxs)(a.Fragment,{children:[q&&(0,a.jsxs)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:[J&&(0,a.jsxs)(t.o,{type:`submit`,form:h,size:`sm`,loading:z.isSubmitting,"aria-disabled":ie?`true`:void 0,children:[(0,a.jsx)(s.IconDeviceFloppy,{className:`size-4`}),F(`forms.formActions.saveChanges`)]}),(0,a.jsxs)(t.o,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>I(d),children:[(0,a.jsx)(s.IconX,{className:`size-4`}),F(`forms.formActions.cancel`)]})]}),S,_&&(b?(0,a.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${K?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${K?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),K?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]}):(0,a.jsxs)(`button`,{type:`button`,onClick:()=>W({enabled:+!K}),"aria-label":F(`forms.common.enabled`),title:F(K?`common.activeToggleHint`:`common.idleToggleHint`),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 ${K?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground hover:bg-muted/80`}`,children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${K?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),K?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]})),!n&&X.length>0&&(0,a.jsx)(v,{actions:X})]})}),(0,a.jsx)(`div`,{ref:te,"aria-hidden":!0,className:`h-px`}),C,!n&&T&&(0,a.jsx)(r.r,{feature:g,name:V.title,onDelete:G,open:L,setOpen:R,trigger:(0,a.jsx)(`span`,{className:`hidden`,"aria-hidden":!0})}),P({staged:V,onStateChange:ee})]})}function F(e,t,n=!0){let r=e.length,i=t.length;if(r*i>4e5)return null;let a=Array.from({length:r+1},()=>new Uint32Array(i+1));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]);let o=[],s=(e,t)=>{let r=o[o.length-1];n&&r?.op===e?r.text+=t:o.push({op:e,text:t})},c=0,l=0;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++]);for(;c<r;)s(`remove`,e[c++]);for(;l<i;)s(`add`,t[l++]);return o}var I=e=>e.split(/(\s+)/).filter(e=>e!==``);function L(e){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);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();return n.length>0?n:r?[r]:[]}var R=e=>e==null?``:String(e);function z({before:t,after:n,fields:r,showUnchanged:c=!1}){let{t:l}=(0,o.useTranslation)(),[u,d]=(0,i.useState)(c),f=r.map(e=>{let r=t?.[e.id],i=n?.[e.id],a=e.kind??`text`,o=a===`rich`?L(R(r)).join(`
|
|
2
|
+
`)===L(R(i)).join(`
|
|
3
|
+
`):a===`value`?JSON.stringify(r??null)===JSON.stringify(i??null):R(r)===R(i),s=`changed`;return t===null||(r==null||r===``)&&!o?s=`added`:n===null||(i==null||i===``)&&!o?s=`removed`:o&&(s=`unchanged`),{field:e,a:r,b:i,kind:a,state:s}}),p=f.filter(e=>e.state!==`unchanged`),m=f.filter(e=>e.state===`unchanged`),h={added:l(`bento.diff.added`,{defaultValue:`Added`}),removed:l(`bento.diff.removed`,{defaultValue:`Removed`}),changed:l(`bento.diff.changed`,{defaultValue:`Changed`}),unchanged:l(`bento.diff.unchanged`,{defaultValue:`Unchanged`})};return(0,a.jsxs)(`div`,{"data-slot":`bento-diff`,className:`flex flex-col gap-3`,children:[(t===null||n===null)&&(0,a.jsx)(`p`,{className:`m-0 text-sm font-medium`,children:t===null?l(`bento.diff.created`,{defaultValue:`Created in this version`}):l(`bento.diff.deleted`,{defaultValue:`Deleted in this version`})}),p.length===0&&(0,a.jsx)(`p`,{className:`m-0 text-sm text-muted-foreground`,children:l(`bento.diff.noChanges`,{defaultValue:`No field changed`})}),(0,a.jsx)(`dl`,{className:`m-0 flex flex-col gap-3`,children:p.map(e=>(0,a.jsx)(ee,{label:e.field.label,status:h[e.state],state:e.state,children:(0,a.jsx)(te,{row:e})},e.field.id))}),m.length>0&&(0,a.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,a.jsxs)(`button`,{type:`button`,"aria-expanded":u?`true`:`false`,onClick:()=>d(!u),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`,children:[(0,a.jsx)(s.IconChevronRight,{size:14,"aria-hidden":`true`,className:e.t(`transition-transform`,u&&`rotate-90`)}),l(`bento.diff.unchangedCount`,{defaultValue:`{{count}} unchanged`,count:m.length})]}),u&&(0,a.jsx)(`dl`,{className:`m-0 flex flex-col gap-3`,children:m.map(e=>(0,a.jsx)(ee,{label:e.field.label,status:h.unchanged,state:`unchanged`,children:(0,a.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-sm text-muted-foreground`,children:e.kind===`rich`?L(R(e.b)).join(`
|
|
4
|
+
|
|
5
|
+
`):e.field.format?e.field.format(e.b):R(e.b)})},e.field.id))})]})]})}function ee({label:t,status:n,state:r,children:i}){return(0,a.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card/40 p-3`,children:[(0,a.jsxs)(`dt`,{className:`mb-1.5 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,a.jsx)(`span`,{children:t}),(0,a.jsx)(`span`,{className:e.t(`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`),children:n})]}),(0,a.jsx)(`dd`,{className:`m-0`,children:i})]})}function te({row:e}){let{t}=(0,o.useTranslation)(),{field:n,a:r,b:i,kind:s,state:c}=e;if(s===`value`){let e=e=>n.format?n.format(e):R(e);return(0,a.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[c!==`added`&&(0,a.jsx)(V,{children:e(r)}),c===`changed`&&(0,a.jsx)(`span`,{"aria-hidden":`true`,children:`→`}),c!==`removed`&&(0,a.jsx)(B,{children:e(i)})]})}let l=s===`rich`?L(R(r)):[R(r)].filter(Boolean),u=s===`rich`?L(R(i)):[R(i)].filter(Boolean),d=F(l,u,!1)??[...l.map(e=>({op:`remove`,text:e})),...u.map(e=>({op:`add`,text:e}))],f=[];for(let e=0;e<d.length;e++){let t=d[e],n=d[e+1];if(t.op===`remove`&&n?.op===`add`){let r=F(I(t.text),I(n.text));f.push((0,a.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-sm leading-relaxed`,children:r?r.map((e,t)=>e.op===`same`?(0,a.jsx)(`span`,{children:e.text},t):e.op===`add`?(0,a.jsx)(B,{children:e.text},t):(0,a.jsx)(V,{children:e.text},t)):[(0,a.jsx)(V,{children:t.text},`r`),` `,(0,a.jsx)(B,{children:n.text},`a`)]},e)),e++}else f.push((0,a.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-sm leading-relaxed`,children:t.op===`same`?t.text:t.op===`add`?(0,a.jsx)(B,{children:t.text}):(0,a.jsx)(V,{children:t.text})},e))}return f.length===0?(0,a.jsx)(`p`,{className:`m-0 text-sm text-muted-foreground`,children:t(`bento.diff.empty`,{defaultValue:`Empty`})}):(0,a.jsx)(`div`,{className:`flex flex-col gap-2`,children:f})}function B({children:e}){let{t}=(0,o.useTranslation)();return(0,a.jsxs)(`ins`,{className:`bento-status bento-status-on rounded-sm px-0.5 underline decoration-2 underline-offset-2`,children:[(0,a.jsxs)(`span`,{className:`sr-only`,children:[t(`bento.diff.addedStart`,{defaultValue:`added:`}),` `]}),e]})}function V({children:e}){let{t}=(0,o.useTranslation)();return(0,a.jsxs)(`del`,{className:`bento-status bento-status-error rounded-sm px-0.5 line-through decoration-2`,children:[(0,a.jsxs)(`span`,{className:`sr-only`,children:[t(`bento.diff.removedStart`,{defaultValue:`removed:`}),` `]}),e]})}var H={LARGE:`col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2`,MEDIUM:`col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1`,SMALL:`col-span-1 row-span-1`},U={SMALL:`MEDIUM`,MEDIUM:`LARGE`,LARGE:`SMALL`};function ne(e,t,n){if(!n||n.length===0)return e.map((e,n)=>({item:e,key:t(e),emphasis:n===0?`LARGE`:`MEDIUM`}));let r=new Map,i=new Map;for(let e of n)r.set(e.itemId,e.displayOrder),i.set(e.itemId,e.emphasis);return e.map((e,n)=>({item:e,key:t(e),idx:n})).sort((e,t)=>{let n=r.has(e.key)?r.get(e.key):2**53-1,i=r.has(t.key)?r.get(t.key):2**53-1;return n===i?e.idx-t.idx:n-i}).map(({item:e,key:t})=>({item:e,key:t,emphasis:i.get(t)??`MEDIUM`}))}function W(e){return e.map((e,t)=>({itemId:e.key,emphasis:e.emphasis,displayOrder:t}))}function G({to:e,emphasis:t,featured:n,defaultIcon:r,icon:i,tone:s=`indigo`,title:u,description:d,meta:f,enabled:p,hasStatus:m=!1,viewTransitionName:h}){let{t:g}=(0,o.useTranslation)(),_=x(s),v=t??(n?`LARGE`:`MEDIUM`),y=v===`LARGE`,b=v===`SMALL`,S=H[v],C=p===1,w=y?`p-6 md:p-7`:b?`p-4`:`p-5`,T=y?`h-14 w-14`:b?`h-8 w-8`:`h-9 w-9`,E=y?28:b?16:18,D=y?`text-xl md:text-2xl`:b?`text-sm`:`text-base md:text-lg`;return(0,a.jsxs)(l.Link,{to:e,className:`bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${y?`gap-5`:`gap-4`} overflow-hidden ${w} ${S}`,style:h?{viewTransitionName:h}:void 0,children:[y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${_} opacity-40 blur-2xl dark:opacity-50`}),(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${_} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,a.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,a.jsx)(`span`,{className:`grid place-items-center rounded-2xl ${_} text-white shadow-md ${T}`,children:i?(0,a.jsx)(c.Icon,{icon:i,className:y?`size-7 text-white`:`size-4.5 text-white`}):(0,a.jsx)(r,{size:E})}),m&&(0,a.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${C?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,a.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${C?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),C?g(`common.active`,{defaultValue:`Active`}):g(`common.idle`,{defaultValue:`Idle`})]})]}),(0,a.jsxs)(`div`,{className:`relative z-1`,children:[(0,a.jsx)(`div`,{className:`font-semibold tracking-tight ${D}`,children:u}),!b&&f&&(0,a.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:f}),!b&&d&&(0,a.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:d})]})]})}var K={query:``,facets:{}},q=e=>typeof e==`object`&&!!e&&!Array.isArray(e),J=e=>Array.isArray(e)?e:[];function Y(e,t,n){let r={...e.facets};return n===void 0||Array.isArray(n)&&n.length===0||q(n)&&!n.from&&!n.to?delete r[t]:r[t]=n,{...e,facets:r}}function re({value:e,onChange:r,facets:c,queryLabel:l,queryDelay:u=300,views:d}){let{t:f}=(0,o.useTranslation)(),[p,m]=(0,i.useState)({source:e.query,text:e.query}),[h,g]=(0,i.useState)(null);p.source!==e.query&&m({source:e.query,text:e.query===h?p.text:e.query}),(0,i.useEffect)(()=>{if(p.text===e.query)return;let t=setTimeout(()=>{g(p.text),r({...e,query:p.text})},u);return()=>clearTimeout(t)},[p.text,e,r,u]);let _=[];for(let t of c){let n=e.facets[t.id];if(t.kind===`choice`)for(let r of J(n)){let i=t.options.find(e=>e.value===r);_.push({key:`${t.id}:${r}`,text:`${t.label}: ${i?.label??r}`,remove:()=>Y(e,t.id,J(n).filter(e=>e!==r))})}else q(n)&&(n.from||n.to)&&_.push({key:t.id,text:`${t.label}: ${n.from??`…`} – ${n.to??`…`}`,remove:()=>Y(e,t.id,void 0)})}let v=_.length>0||e.query!==``,y=l??f(`bento.filters.search`,{defaultValue:`Search`});return(0,a.jsxs)(`div`,{role:`search`,"aria-label":f(`bento.filters.label`,{defaultValue:`Filters`}),"data-slot":`bento-filter-bar`,className:`flex flex-col gap-2`,children:[(0,a.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,a.jsxs)(`div`,{className:`relative min-w-48 flex-1`,children:[(0,a.jsx)(s.IconSearch,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground`}),(0,a.jsx)(t.a,{type:`search`,value:p.text,placeholder:y,"aria-label":y,onChange:e=>m({...p,text:e.target.value}),className:`pl-9`})]}),c.map(t=>t.kind===`choice`?(0,a.jsx)(X,{facet:t,value:e,onChange:r},t.id):(0,a.jsx)(Z,{facet:t,value:e,onChange:r},t.id)),d]}),v&&(0,a.jsxs)(`ul`,{className:`m-0 flex list-none flex-wrap items-center gap-1.5 p-0`,"aria-label":f(`bento.filters.active`,{defaultValue:`Active filters`}),children:[_.map(e=>(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{type:`button`,"aria-label":f(`bento.filters.remove`,{defaultValue:`Remove filter {{filter}}`,filter:e.text}),onClick:()=>r(e.remove()),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`,children:[e.text,(0,a.jsx)(s.IconX,{size:12,"aria-hidden":`true`})]})},e.key)),(0,a.jsx)(`li`,{children:(0,a.jsx)(n.R,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>{m({source:``,text:``}),r(K)},children:f(`bento.filters.clearAll`,{defaultValue:`Clear all`})})})]})]})}function ie({label:e,count:t,...r}){return(0,a.jsxs)(n.R,{variant:`outline`,size:`sm`,className:`gap-1.5`,...r,children:[e,t>0&&(0,a.jsx)(`span`,{className:`rounded-full bg-primary px-1.5 text-[0.6875rem] leading-4 text-primary-foreground`,children:t}),(0,a.jsx)(s.IconChevronDown,{size:14,"aria-hidden":`true`})]})}function X({facet:e,value:t,onChange:r}){let i=J(t.facets[e.id]);return(0,a.jsxs)(n.S,{children:[(0,a.jsx)(n.I,{asChild:!0,children:(0,a.jsx)(ie,{label:e.label,count:i.length})}),(0,a.jsx)(n.w,{align:`start`,className:`bento-dropdown min-w-44 p-1.5`,children:e.multiple?e.options.map(o=>(0,a.jsx)(n.C,{checked:i.includes(o.value),onCheckedChange:n=>r(Y(t,e.id,n===!0?[...i,o.value]:i.filter(e=>e!==o.value))),onSelect:e=>e.preventDefault(),children:o.label},o.value)):(0,a.jsx)(n.k,{value:i[0]??``,onValueChange:n=>r(Y(t,e.id,n===i[0]?[]:[n])),children:e.options.map(e=>(0,a.jsx)(n.A,{value:e.value,children:e.label},e.value))})})]})}function Z({facet:e,value:r,onChange:s}){let{t:c}=(0,o.useTranslation)(),l=r.facets[e.id],u=q(l)?l:{},[d,f]=(0,i.useState)(!1),[p,m]=(0,i.useState)(u.from??``),[h,g]=(0,i.useState)(u.to??``),_=(0,i.useId)(),v=(0,i.useId)();return(0,a.jsxs)(n.m,{open:d,onOpenChange:e=>{e&&(m(u.from??``),g(u.to??``)),f(e)},children:[(0,a.jsx)(n.b,{asChild:!0,children:(0,a.jsx)(ie,{label:e.label,count:u.from||u.to?1:0})}),(0,a.jsx)(n.g,{align:`start`,className:`bento-dropdown w-64 p-3`,children:(0,a.jsxs)(`form`,{className:`flex flex-col gap-2`,onSubmit:t=>{t.preventDefault(),s(Y(r,e.id,{from:p||void 0,to:h||void 0})),f(!1)},children:[(0,a.jsx)(`label`,{htmlFor:_,className:`text-xs text-muted-foreground`,children:c(`bento.filters.from`,{defaultValue:`From`})}),(0,a.jsx)(t.a,{id:_,type:`date`,value:p,max:h||void 0,onChange:e=>m(e.target.value)}),(0,a.jsx)(`label`,{htmlFor:v,className:`text-xs text-muted-foreground`,children:c(`bento.filters.to`,{defaultValue:`To`})}),(0,a.jsx)(t.a,{id:v,type:`date`,value:h,min:p||void 0,onChange:e=>g(e.target.value)}),(0,a.jsx)(n.R,{type:`submit`,size:`sm`,className:`mt-1`,children:c(`bento.filters.apply`,{defaultValue:`Apply`})})]})})]})}var ae=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function oe({items:e,error:t,tryAgainUrl:c,listId:l,eyebrow:u,backTo:d,backLabel:f,heroIcon:p,title:m,subtitle:h,tone:g=`indigo`,headerAction:_,newRoute:v,newLabel:y,newSubtitle:b,hideNew:S=!1,itemKey:C,renderTile:w,emptyTitle:T,emptyDescription:E,layout:D}){let{t:k}=(0,o.useTranslation)(),A=x(g),[j,M]=(0,i.useState)(!1),N=(0,i.useMemo)(()=>ne(e??[],C,D?.data?.entries),[e,C,D?.data?.entries]),P=!!l&&!!D&&(e?.length??0)>0;return(0,a.jsxs)(r.t,{checkIsNotUndefined:e,error:t??null,tryAgainUrl:c,children:[(0,a.jsx)(O,{eyebrow:u,backTo:d,backLabel:f,leading:(0,a.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${A} text-white shadow-md`,children:(0,a.jsx)(p,{size:24})}),title:m,subtitle:h}),(_||P&&!j)&&(0,a.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[_,P&&!j&&(0,a.jsxs)(n.R,{variant:`outline`,size:`sm`,onClick:()=>M(!0),className:`ml-auto gap-2`,children:[(0,a.jsx)(s.IconAdjustmentsHorizontal,{size:16}),k(`bento.layout.customize`,{defaultValue:`Customize layout`})]})]}),j&&l&&D?(0,a.jsx)(ce,{layout:D,resolved:N,canEditGlobal:D?.data?.canEditGlobal??!1,isCustomized:D?.data?.source===`USER`,renderTile:w,chip:A,hideNew:S,newRoute:v,newLabel:y,newSubtitle:b,onClose:()=>M(!1)}):(0,a.jsx)(se,{resolved:N,renderTile:w,chip:A,hideNew:S,newRoute:v,newLabel:y,newSubtitle:b,isEmpty:e?.length===0,emptyTitle:T,emptyDescription:E})]})}function Q({items:e,error:t,tryAgainUrl:n,tone:i=`indigo`,newRoute:o,newLabel:s,newSubtitle:c,hideNew:l=!1,itemKey:u,renderTile:d,emptyTitle:f,emptyDescription:p}){let m=x(i);return(0,a.jsx)(r.t,{checkIsNotUndefined:e,error:t??null,tryAgainUrl:n,children:(0,a.jsxs)(`div`,{className:ae,children:[!l&&o&&s?(0,a.jsx)(de,{route:o,label:s,subtitle:c,chip:m}):null,(e??[]).map(e=>(0,a.jsx)(`span`,{className:`contents`,children:d(e)},u(e))),e?.length===0&&(0,a.jsx)(fe,{title:f,description:p})]})})}function se({resolved:t,renderTile:n,chip:r,hideNew:i,newRoute:o,newLabel:s,newSubtitle:c,isEmpty:l,emptyTitle:u,emptyDescription:d}){let f=t.some(e=>e.emphasis===`SMALL`);return(0,a.jsxs)(`div`,{className:e.t(ae,f&&`grid-flow-dense`),children:[!i&&(0,a.jsx)(de,{route:o,label:s,subtitle:c,chip:r}),t.map(({item:e,key:t,emphasis:r})=>(0,a.jsx)(`span`,{className:`contents`,children:n(e,r)},t)),l&&(0,a.jsx)(fe,{title:u,description:d})]})}function ce({layout:t,resolved:r,canEditGlobal:c,isCustomized:l,renderTile:u,chip:p,hideNew:m,newRoute:h,newLabel:g,newSubtitle:_,onClose:v}){let{t:y}=(0,o.useTranslation)(),[b,x]=(0,i.useState)(r),[S,C]=(0,i.useState)(null),w=(t.saving??!1)||S!==null,T=e=>w&&S===e?{loading:!0}:{"aria-disabled":w||void 0},[E,D]=(0,i.useState)(!1),O=(e,t)=>async()=>{if(t){C(e),D(!1);try{await t(),v()}catch(e){console.error(`Failed to save the bento layout`,e),D(!0)}finally{C(null)}}},k=(0,d.useSensors)((0,d.useSensor)(d.PointerSensor,{activationConstraint:{distance:8}}),(0,d.useSensor)(d.KeyboardSensor));function A(e){let{active:t,over:n}=e;!n||t.id===n.id||x(e=>{let r=e.findIndex(e=>e.key===t.id),i=e.findIndex(e=>e.key===n.id);return r<0||i<0?e:(0,f.arrayMove)(e,r,i)})}function j(e,t){x(n=>n.map(n=>n.key===e?{...n,emphasis:t}:n))}let M=(0,i.useMemo)(()=>W(b),[b]),N=b.some(e=>e.emphasis===`SMALL`);return(0,a.jsxs)(`div`,{children:[(0,a.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md`,children:[(0,a.jsx)(`span`,{className:`mr-auto text-sm text-muted-foreground`,children:y(`bento.layout.editHint`,{defaultValue:`Drag tiles to reorder · tap the size button to resize`})}),l&&t.onReset&&(0,a.jsxs)(n.R,{variant:`ghost`,size:`sm`,className:`gap-2`,...T(`reset`),onClick:O(`reset`,t.onReset),children:[S!==`reset`&&(0,a.jsx)(s.IconArrowBackUp,{size:16}),y(`bento.layout.reset`,{defaultValue:`Reset to default`})]}),c&&t.onSaveGlobal&&(0,a.jsxs)(n.R,{variant:`outline`,size:`sm`,className:`gap-2`,...T(`global`),onClick:O(`global`,()=>t.onSaveGlobal?.(M)),children:[S!==`global`&&(0,a.jsx)(s.IconUsers,{size:16}),y(`bento.layout.saveGlobal`,{defaultValue:`Set as default for everyone`})]}),(0,a.jsxs)(n.R,{variant:`ghost`,size:`sm`,className:`gap-2`,...T(`cancel`),onClick:v,children:[(0,a.jsx)(s.IconX,{size:16}),y(`common.cancel`,{defaultValue:`Cancel`})]}),(0,a.jsxs)(n.R,{size:`sm`,className:`gap-2`,...T(`save`),onClick:O(`save`,()=>t.onSave(M)),children:[S!==`save`&&(0,a.jsx)(s.IconDeviceFloppy,{size:16}),y(`bento.layout.save`,{defaultValue:`Save layout`})]}),E&&(0,a.jsx)(`p`,{role:`alert`,className:`w-full text-sm text-destructive`,children:y(`bento.layout.saveFailed`,{defaultValue:`The layout could not be saved. Nothing has changed — try again.`})})]}),(0,a.jsx)(d.DndContext,{sensors:k,collisionDetection:d.closestCenter,onDragEnd:A,children:(0,a.jsx)(f.SortableContext,{items:b.map(e=>e.key),strategy:f.rectSortingStrategy,children:(0,a.jsxs)(`div`,{className:e.t(ae,N&&`grid-flow-dense`),children:[!m&&(0,a.jsx)(de,{route:h,label:g,subtitle:_,chip:p}),b.map(({item:e,key:t,emphasis:n})=>(0,a.jsx)($,{id:t,emphasis:n,onSetEmphasis:e=>j(t,e),children:u(e,n)},t))]})})})]})}var le=[`SMALL`,`MEDIUM`,`LARGE`],ue={SMALL:{key:`bento.layout.size.small`,def:`Small`},MEDIUM:{key:`bento.layout.size.medium`,def:`Medium`},LARGE:{key:`bento.layout.size.large`,def:`Large`}};function $({id:t,emphasis:n,onSetEmphasis:r,children:i}){let{t:c}=(0,o.useTranslation)(),{attributes:l,listeners:u,setNodeRef:d,transform:m,transition:h,isDragging:g}=(0,f.useSortable)({id:t}),_={transform:p.CSS.Translate.toString(m),transition:h,opacity:g?.6:1,zIndex:g?50:void 0};return(0,a.jsxs)(`div`,{ref:d,style:_,className:e.t(`relative h-full`,H[n]),children:[(0,a.jsx)(`div`,{className:`pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full`,children:i}),(0,a.jsxs)(`div`,{className:`absolute right-2 top-2 z-10 flex items-center gap-1`,children:[(0,a.jsx)(`div`,{role:`group`,"aria-label":c(`bento.layout.sizeGroup`,{defaultValue:`Tile size`}),className:`flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur`,children:le.map(t=>{let i=t===n,o=c(ue[t].key,{defaultValue:ue[t].def});return(0,a.jsx)(`button`,{type:`button`,onClick:()=>r(t),"aria-pressed":i,"aria-label":o,title:o,className:e.t(`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`),children:o.charAt(0)},t)})}),(0,a.jsx)(`button`,{type:`button`,...l,...u,"aria-label":c(`bento.layout.dragToReorder`,{defaultValue:`Drag to reorder`}),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`,children:(0,a.jsx)(s.IconGripVertical,{size:14,className:`text-muted-foreground`})})]})]})}function de({route:e,label:t,subtitle:n,chip:r}){let{t:i}=(0,o.useTranslation)();return(0,a.jsxs)(l.Link,{to:e,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`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(`span`,{className:`bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,children:(0,a.jsx)(s.IconPlus,{size:20})}),(0,a.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:i(`forms.formActions.new`,{defaultValue:`New`})})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`div`,{className:`text-base font-semibold tracking-tight md:text-lg`,children:(0,a.jsx)(`span`,{className:`${r} bg-clip-text text-transparent`,children:t})}),n&&(0,a.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n})]})]})}function fe({title:e,description:t}){return(0,a.jsx)(E,{icon:s.IconSparkles,title:e,description:t,align:`start`,className:`col-span-2 row-span-2 justify-end md:col-span-4`})}function pe({title:e,badges:n,actions:r,onCancel:i,loading:c,disabled:l,dirty:u,titleMissing:d}){let{t:f}=(0,o.useTranslation)();return(0,a.jsxs)(`div`,{className:`bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl`,children:[(0,a.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[e&&(0,a.jsx)(`p`,{className:`truncate text-base font-semibold tracking-tight md:text-lg`,children:e}),(0,a.jsx)(j,{titleMissing:d,dirty:u}),n&&(0,a.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:n})]}),(0,a.jsx)(`div`,{className:`flex shrink-0 gap-2`,children:r??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.o,{type:`submit`,size:`sm`,loading:c,"aria-disabled":l?`true`:void 0,children:[(0,a.jsx)(s.IconDeviceFloppy,{className:`size-4`}),f(`forms.formActions.saveChanges`)]}),i&&(0,a.jsxs)(t.o,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:[(0,a.jsx)(s.IconX,{className:`size-4`}),f(`forms.formActions.cancel`)]})]})})]})}function me({children:e}){return(0,a.jsx)(`span`,{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`,children:e})}pe.Badge=me;function he(e){let t=(0,i.useRef)(null);return M(t),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{ref:t,"aria-hidden":!0,className:`h-px`}),(0,a.jsx)(`div`,{"aria-hidden":!0,className:`bento-save-bar-spacer`}),(0,a.jsx)(`div`,{className:`bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8`,children:(0,a.jsx)(pe,{...e})})]})}function ge({eyebrow:e,backTo:n,backLabel:r,leading:i,title:c,subtitle:l,trailing:u,onCancel:d,actions:f,loading:p,dirty:m,titleMissing:h,saveDisabled:g,stickyTitle:_,stickyBadges:v}){let{t:y}=(0,o.useTranslation)(),b=g??(!!h||!m);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O,{eyebrow:n===void 0?e:(0,a.jsx)(D,{to:n,children:r}),leading:i,title:c,subtitle:l,trailing:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:f??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.o,{type:`submit`,size:`sm`,loading:p,"aria-disabled":b?`true`:void 0,children:[(0,a.jsx)(s.IconDeviceFloppy,{className:`size-4`}),y(`forms.formActions.saveChanges`)]}),(0,a.jsxs)(t.o,{type:`button`,variant:`outline`,size:`sm`,onClick:d,children:[(0,a.jsx)(s.IconX,{className:`size-4`}),y(`forms.formActions.cancel`)]})]})}),u]})}),(0,a.jsx)(he,{title:_,badges:v,actions:f,onCancel:d,loading:p,disabled:b,dirty:m,titleMissing:h})]})}var _e=`bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6`;function ve({icon:t,tone:n,title:r,description:i,children:o,trailing:s,as:c=`h2`,className:l}){return(0,a.jsxs)(`section`,{className:e.t(_e,l),children:[(0,a.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(`span`,{className:`grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${x(n)}`,children:(0,a.jsx)(t,{size:20})}),(0,a.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,a.jsx)(c,{className:`text-base font-semibold tracking-tight md:text-lg`,children:r}),i&&(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i})]})]}),s&&(0,a.jsx)(`div`,{className:`shrink-0`,children:s})]}),(0,a.jsx)(`div`,{className:`flex flex-col gap-5`,children:o})]})}function ye({children:t,className:n,contentClassName:r}){return(0,a.jsx)(`div`,{className:e.t(`bento-glass rounded-2xl shadow-md`,n),children:(0,a.jsx)(`div`,{className:r,children:t})})}var be=480;function xe(e){return window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)}function Se(){return window.scrollY>be}function Ce({inline:e=!1}={}){let{t}=(0,o.useTranslation)(),r=n.i(),c=e||r,l=(0,i.useSyncExternalStore)(xe,Se,()=>!1);return(0,a.jsx)(`button`,{type:`button`,"aria-label":t(`bento.backToTop`,{defaultValue:`Back to top`}),tabIndex:l?0:-1,onClick:()=>window.scrollTo({top:0,behavior:`smooth`}),className:`${c?`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 ${l?`pointer-events-auto translate-y-0 scale-100 opacity-100`:`pointer-events-none translate-y-4 scale-90 opacity-0`}`,children:(0,a.jsx)(s.IconArrowUp,{size:18})})}function we(e){return e.bentoRoute??e.fallbackRoute}function Te({label:e,children:t}){return e?(0,a.jsxs)(`div`,{role:`group`,"aria-label":e,children:[(0,a.jsx)(`p`,{className:`px-3 pt-2 pb-1 text-xs font-medium text-muted-foreground`,children:e}),t]}):(0,a.jsx)(a.Fragment,{children:t})}function Ee({index:e,active:t,icon:n,label:r,description:i,trailing:o,onActivate:c,onChoose:l}){return(0,a.jsxs)(`button`,{type:`button`,id:`bento-palette-opt-${e}`,"data-index":e,role:`option`,"aria-selected":t?`true`:`false`,onMouseEnter:c,onClick:l,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`}`,children:[n&&(0,a.jsx)(n,{size:18,className:`shrink-0 text-muted-foreground`}),(0,a.jsxs)(`span`,{className:`flex-1 truncate`,children:[r,i&&(0,a.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:i})]}),o??(t&&(0,a.jsx)(s.IconArrowRight,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground`}))]})}function De({open:e,onOpenChange:n,items:r,group:c,onQueryChange:u}){let{t:d}=(0,o.useTranslation)(),f=(0,l.useNavigate)(),[p,m]=(0,i.useState)(``),[h,g]=(0,i.useState)(0),_=(0,i.useRef)(null),v=(0,i.useMemo)(()=>{let e=p.trim().toLowerCase(),t=r.map(e=>({item:e,label:d(e.titleKey),description:d(e.descriptionKey)}));if(!e)return t;let n=[],i=[];for(let r of t)r.label.toLowerCase().includes(e)?n.push(r):r.description.toLowerCase().includes(e)&&i.push(r);return[...n,...i]},[r,p,d]),y=(0,i.useMemo)(()=>[...v.map(e=>({kind:`nav`,entry:e})),...(c?.items??[]).map(e=>({kind:`supplied`,item:e}))],[v,c]),b=(0,i.useRef)(u);(0,i.useEffect)(()=>{b.current=u}),(0,i.useEffect)(()=>{b.current?.(p)},[p]);let[x,S]=(0,i.useState)(e);e!==x&&(S(e),e&&(m(``),g(0)));let C=y.length===0?0:y.length-1;h>C&&g(C),(0,i.useEffect)(()=>{(_.current?.querySelector(`[data-index="${h}"]`))?.scrollIntoView({block:`nearest`})},[h]);function w(e){n(!1),e.kind===`nav`?f(we(e.entry.item)):c?.onSelect(e.item)}function T(e){if(e.key===`ArrowDown`)e.preventDefault(),g(e=>y.length===0?0:(e+1)%y.length);else if(e.key===`ArrowUp`)e.preventDefault(),g(e=>y.length===0?0:(e-1+y.length)%y.length);else if(e.key===`Enter`){e.preventDefault();let t=y[h];t&&w(t)}}return(0,a.jsx)(t.c,{open:e,onOpenChange:n,children:(0,a.jsxs)(t.u,{showCloseButton:!1,className:`top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0`,onKeyDown:T,children:[(0,a.jsx)(t.g,{className:`sr-only`,children:d(`bento.palette.title`,{defaultValue:`Command palette`})}),(0,a.jsx)(t.d,{className:`sr-only`,children:d(`bento.palette.description`,{defaultValue:`Search and jump to any area`})}),(0,a.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/60 px-4`,children:[(0,a.jsx)(s.IconSearch,{size:18,className:`shrink-0 text-muted-foreground`}),(0,a.jsx)(`input`,{autoFocus:!0,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`bento-palette-list`,"aria-activedescendant":y[h]?`bento-palette-opt-${h}`:void 0,value:p,onChange:e=>m(e.target.value),placeholder:d(`bento.palette.placeholder`,{defaultValue:`Search areas…`}),className:`h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,a.jsxs)(`div`,{ref:_,id:`bento-palette-list`,role:`listbox`,"aria-label":d(`bento.palette.title`,{defaultValue:`Command palette`}),className:`max-h-80 overflow-y-auto p-2`,children:[y.length===0&&!c?.pending&&(0,a.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:d(`bento.palette.noResults`,{defaultValue:`No matches`})}),(0,a.jsx)(Te,{label:c&&v.length>0?d(`bento.palette.areas`,{defaultValue:`Areas`}):void 0,children:v.map(({item:e,label:t},n)=>(0,a.jsx)(Ee,{index:n,active:n===h,icon:e.icon,label:t,onActivate:()=>g(n),onChoose:()=>w(y[n]),trailing:e.bentoRoute?void 0:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.IconExternalLink,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground/70`}),(0,a.jsx)(`span`,{className:`sr-only`,children:d(`bento.palette.opensConsole`,{defaultValue:`Opens in console`})})]})},e.id))}),c&&(0,a.jsxs)(Te,{label:c.label,children:[c.items.map((e,t)=>{let n=v.length+t;return(0,a.jsx)(Ee,{index:n,active:n===h,icon:e.icon,label:e.label,description:e.description,onActivate:()=>g(n),onChoose:()=>w(y[n])},e.id)}),c.pending&&(0,a.jsx)(`p`,{className:`px-3 py-2.5 text-sm text-muted-foreground`,children:d(`bento.palette.searching`,{defaultValue:`Searching…`})})]})]})]})})}function Oe({rail:t,headerStart:r,headerEnd:s,column:c=`default`,dock:u,backToTop:d=!0,children:f}){let{t:p}=(0,o.useTranslation)(),m=(0,l.useInRouterContext)(),h=(0,i.useId)(),g=(0,i.useRef)(null),_=(0,i.useRef)(null),v=c===`full`,y=r!=null||s!=null,b=d||u!=null;return(0,a.jsxs)(`div`,{"data-slot":`bento-shell`,className:e.t(`relative w-full bg-background text-foreground`,t!=null&&`bento-rail-gutter`,v?`flex h-svh flex-col overflow-hidden`:`min-h-svh`),children:[(0,a.jsx)(`a`,{href:`#${h}`,onClick:e=>{e.preventDefault(),g.current?.focus()},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]`,children:p(`bento.shell.skip`,{defaultValue:`Skip to content`})}),(0,a.jsx)(`span`,{ref:_,role:`status`,"aria-live":`polite`,className:`sr-only`}),m&&(0,a.jsx)(ke,{main:g,announcer:_}),t,y&&(0,a.jsxs)(`header`,{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`,children:[(0,a.jsx)(`div`,{className:`flex min-w-0 items-center gap-3`,children:r}),(0,a.jsx)(`div`,{className:`flex items-center gap-2`,children:s})]}),(0,a.jsx)(`main`,{ref:g,id:h,tabIndex:-1,"aria-label":p(`bento.shell.main`,{defaultValue:`Main content`}),"data-column":c,className:`bento-shell-main`,children:f}),b&&(0,a.jsx)(`div`,{"data-slot":`bento-shell-corner`,className:`pointer-events-none fixed bottom-5 right-5 z-50 flex flex-col items-end gap-3`,children:(0,a.jsxs)(n.r.Provider,{value:!0,children:[d&&(0,a.jsx)(Ce,{}),u]})})]})}function ke({main:e,announcer:t}){let{pathname:n}=(0,l.useLocation)(),r=(0,i.useRef)(n);return(0,i.useEffect)(()=>{if(r.current===n)return;r.current=n;let i=0,a,o=()=>{let n=e.current?.querySelector(`h1`)??null;if(!n&&i++<20){a=setTimeout(o,50);return}n&&!n.hasAttribute(`tabindex`)&&n.setAttribute(`tabindex`,`-1`),(n??e.current)?.focus(),t.current&&(t.current.textContent=n?.textContent?.trim()||document.title)};return o(),()=>clearTimeout(a)},[n,e,t]),null}var Ae=Object.freeze([{action:`palette`,key:`k`,mod:!0},{action:`palette`,key:`/`},{action:`shortcuts`,key:`?`}]);function je(){return typeof navigator>`u`?!1:/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent||``)}function Me(e,t){let n=e.key.length===1?e.key.toUpperCase():e.key;return e.mod?[t?`⌘`:`Ctrl`,n]:[n]}function Ne(e){if(!(e instanceof HTMLElement))return!1;if([`INPUT`,`TEXTAREA`,`SELECT`].includes(e.tagName)||e.isContentEditable)return!0;let t=e.closest(`[contenteditable]`);return t!==null&&t.getAttribute(`contenteditable`)!==`false`}function Pe(e,t){if(e.defaultPrevented||e.isComposing||e.repeat)return;let n=e.key.toLowerCase();return Ae.find(r=>n===r.key?r.mod?(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey:e.metaKey||Ne(e.target)?!1:e.ctrlKey===e.altKey:!1)}function Fe({onPalette:e,onShortcuts:t,isMac:n=je()}){let r=(0,i.useRef)({onPalette:e,onShortcuts:t});(0,i.useEffect)(()=>{r.current={onPalette:e,onShortcuts:t}}),(0,i.useEffect)(()=>{function e(e){let t=Pe(e,n),i=t?.action===`palette`?r.current.onPalette:t&&r.current.onShortcuts;i&&(e.preventDefault(),i())}return globalThis.addEventListener(`keydown`,e),()=>globalThis.removeEventListener(`keydown`,e)},[n])}function Ie({onClick:t,isMac:n=je(),className:r}){let{t:i}=(0,o.useTranslation)(),c=Ae.filter(e=>e.action===`palette`),l=c.find(e=>e.mod);return(0,a.jsxs)(`button`,{type:`button`,onClick:t,"aria-keyshortcuts":c.map(e=>e.mod?`${n?`Meta`:`Control`}+${e.key.toUpperCase()}`:e.key).join(` `),className:e.t(`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),children:[(0,a.jsx)(s.IconSearch,{"aria-hidden":!0,size:16}),(0,a.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:i(`bento.palette.search`,{defaultValue:`Search`})}),l&&(0,a.jsx)(`kbd`,{"aria-hidden":!0,className:`hidden rounded border border-border/60 bg-muted px-1.5 py-0.5 text-[10px] font-medium tracking-wide sm:inline`,children:Me(l,n).join(n?``:` `)})]})}function Le({open:e,onOpenChange:n,isMac:r=je()}){let{t:c}=(0,o.useTranslation)(),l={palette:c(`bento.palette.open`,{defaultValue:`Open command palette`}),shortcuts:c(`bento.shortcuts.openGuide`,{defaultValue:`Show keyboard shortcuts`})},u=[...new Set(Ae.map(e=>e.action))],d=[{heading:c(`bento.shortcuts.global`,{defaultValue:`Global`}),rows:u.map(e=>({id:e,label:l[e],combos:Ae.filter(t=>t.action===e).map(e=>Me(e,r))}))},{heading:c(`bento.shortcuts.palette`,{defaultValue:`Command palette`}),rows:[{id:`navigate`,combos:[[`↑`,`↓`]],label:c(`bento.shortcuts.navigate`,{defaultValue:`Move between results`})},{id:`open`,combos:[[`↵`]],label:c(`bento.shortcuts.openSelected`,{defaultValue:`Open the selected area`})},{id:`dismiss`,combos:[[`Esc`]],label:c(`bento.shortcuts.dismiss`,{defaultValue:`Close the palette or a dialog`})}]}];return(0,a.jsx)(t.c,{open:e,onOpenChange:n,children:(0,a.jsxs)(t.u,{className:`max-w-md`,children:[(0,a.jsxs)(t.p,{children:[(0,a.jsxs)(t.g,{className:`flex items-center gap-2`,children:[(0,a.jsx)(s.IconKeyboard,{size:20,className:`bento-accent-icon`}),c(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]}),(0,a.jsx)(t.d,{children:c(`bento.shortcuts.description`,{defaultValue:`Move around without leaving the keyboard.`})})]}),(0,a.jsx)(`div`,{className:`flex flex-col gap-5`,children:d.map(e=>(0,a.jsxs)(`section`,{children:[(0,a.jsx)(`h3`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e.heading}),(0,a.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.rows.map(e=>(0,a.jsxs)(`li`,{"data-shortcut":e.id,className:`flex items-center justify-between gap-4`,children:[(0,a.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),(0,a.jsx)(`span`,{className:`flex shrink-0 items-center gap-1`,children:e.combos.map((e,t)=>(0,a.jsxs)(i.Fragment,{children:[t>0&&(0,a.jsx)(`span`,{className:`px-0.5 text-[11px] text-muted-foreground`,children:c(`bento.shortcuts.or`,{defaultValue:`or`})}),e.map(e=>(0,a.jsx)(`kbd`,{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`,children:e},e))]},e.join(`+`)))})]},e.id))})]},e.heading))})]})})}var Re=s.IconLayoutGrid;function ze(e,t){return e===t||e.startsWith(`${t}/`)}function Be(e,t){return t.section.areaRoute&&ze(e,t.section.areaRoute)?!0:t.items.some(t=>t.bentoRoute&&ze(e,t.bentoRoute))}function Ve({groups:e,homeRoute:t,homeAliases:r,homeLabel:c}){let{t:u}=(0,o.useTranslation)(),{pathname:d}=(0,l.useLocation)(),f=(0,i.useMemo)(()=>e.filter(e=>!!e.section.areaRoute),[e]),p=d===t||(r?.includes(d)??!1);return(0,a.jsx)(n.u,{delayDuration:200,children:(0,a.jsxs)(`nav`,{"aria-label":u(`bento.nav.label`,{defaultValue:`Primary`}),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`,children:[(0,a.jsx)(He,{to:t,icon:s.IconHome,label:c??u(`home.title`,{defaultValue:`Home`}),active:p}),f.length>0&&(0,a.jsx)(`span`,{"aria-hidden":!0,className:`my-1 h-px w-6 bg-border/60`}),f.map(e=>(0,a.jsx)(He,{to:e.section.areaRoute,icon:e.section.icon??Re,label:e.section.labelKey?u(e.section.labelKey):e.section.id,active:Be(d,e)},e.section.id))]})})}function He({to:e,icon:t,label:r,active:i}){return(0,a.jsxs)(n.c,{children:[(0,a.jsx)(n.d,{asChild:!0,children:(0,a.jsx)(l.Link,{to:e,"aria-label":r,"aria-current":i?`page`:void 0,className:`bento-tile-clickable grid h-11 w-11 shrink-0 place-items-center rounded-2xl border transition-colors duration-200 ${i?`bento-rail-active`:`border-transparent text-muted-foreground hover:border-border/60 hover:bg-card/60 hover:text-foreground`}`,children:(0,a.jsx)(t,{size:20})})}),(0,a.jsx)(n.l,{side:`right`,children:r})]})}function Ue({accountRoute:e,logoutUrl:t,organizationsRoute:r,tenantAdminRoute:i,onOpenShortcuts:c,onReplayTour:u}){let{user:d,status:f}=n.n(),{t:p}=(0,o.useTranslation)(),m=(0,l.useNavigate)(),h=`${d.firstName??``} ${d.lastName??``}`.trim()||d.username||``;return f===`loading`?(0,a.jsx)(`div`,{className:`h-9 w-9 rounded-full bg-muted/40`,"aria-hidden":!0}):(0,a.jsxs)(n.S,{children:[(0,a.jsx)(n.I,{asChild:!0,children:(0,a.jsx)(`button`,{type:`button`,title:h||d.username,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`,children:(0,a.jsx)(n.a,{givenName:d.firstName,familyName:d.lastName,name:h||d.username,src:d.avatarUrl||void 0,alt:d.username})})}),(0,a.jsxs)(n.w,{align:`end`,sideOffset:10,className:`bento-dropdown min-w-64 p-2`,children:[(0,a.jsx)(n.D,{className:`p-0 font-normal`,children:(0,a.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm`,children:[(0,a.jsx)(`span`,{className:`rounded-full p-0.5 ring-1 ring-border/60`,children:(0,a.jsx)(n.a,{givenName:d.firstName,familyName:d.lastName,name:h||d.username,src:d.avatarUrl||void 0,alt:d.username})}),(0,a.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[h&&(0,a.jsx)(`span`,{className:`truncate font-medium`,children:h}),d.email&&(0,a.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:d.email})]})]})}),(0,a.jsx)(n.j,{className:`my-1.5 bg-border/50`}),(0,a.jsxs)(n.T,{children:[(0,a.jsxs)(n.E,{onSelect:()=>m(e),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconUserCircle,{size:18}),p(`nav.account`)]}),r&&(0,a.jsxs)(n.E,{onSelect:()=>m(r),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconBuildingCommunity,{size:18}),p(`nav.organizations`,{defaultValue:`Organizations`})]}),i&&(0,a.jsxs)(n.E,{onSelect:()=>m(i),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconBuildingSkyscraper,{size:18}),p(`nav.tenantAdmin`,{defaultValue:`Tenant administration`})]})]}),(c||u)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.j,{className:`my-1.5 bg-border/50`}),(0,a.jsxs)(n.T,{children:[u&&(0,a.jsxs)(n.E,{onSelect:()=>u(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconSparkles,{size:18}),p(`bento.tour.replay`,{defaultValue:`Take the tour`})]}),c&&(0,a.jsxs)(n.E,{onSelect:()=>c(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,a.jsx)(s.IconKeyboard,{size:18}),p(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]})]})]}),(0,a.jsx)(n.j,{className:`my-1.5 bg-border/50`}),(0,a.jsxs)(n.E,{onSelect:()=>{globalThis.location.href=t},className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger`,children:[(0,a.jsx)(s.IconLogout,{size:18}),p(`nav.logOut`)]})]})]})}var We={blue:`blue`,violet:`violet`,emerald:`emerald`,amber:`amber`,rose:`rose`,slate:`slate`,cyan:`blue`,orange:`amber`};function Ge({variant:t=`blue`,className:r,children:o}){let s;i.Children.forEach(o,e=>{if(!(0,i.isValidElement)(e))return;let{type:t}=e;(t===n.f.Header||t===n.f.StaticHeader)&&(s??=e.props)});let c=i.Children.map(o,e=>{if(!(0,i.isValidElement)(e))return e;let{type:t}=e;return t===n.f.Header||t===n.f.StaticHeader?null:t===n.f.Content?e.props.children:e});return s?(0,a.jsx)(ve,{icon:s.icon,tone:We[t]??`blue`,title:s.title,description:s.description,className:r,children:c}):(0,a.jsx)(`section`,{className:e.t(_e,r),children:c})}Ge.Header=n.f.Header,Ge.StaticHeader=n.f.StaticHeader,Ge.Content=n.f.Content;var Ke=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function qe({eyebrow:e,title:t,description:n,titleHref:r,children:i,gridClassName:o=Ke}){let c=(0,a.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight md:text-2xl`,children:t});return(0,a.jsxs)(`section`,{className:`mb-8 md:mb-10`,children:[(0,a.jsxs)(`header`,{className:`bento-shell-header mb-4 flex flex-col gap-0.5`,children:[e&&(0,a.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:e}),r?(0,a.jsxs)(l.Link,{to:r,className:`group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary`,children:[c,(0,a.jsx)(s.IconChevronRight,{size:20,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}):c,n&&(0,a.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:n})]}),(0,a.jsx)(`div`,{className:o,children:i})]})}function Je({to:t,onClick:n,disabled:r=!1,disabledHint:i,icon:o,tone:c,eyebrow:u,title:d,span:f,featured:p=!1,children:m}){let h=!r&&!!(t||n),g=p?`h-14 w-14 rounded-2xl`:`h-9 w-9 rounded-2xl`,_=p?28:18,v=p?`text-xl font-semibold tracking-tight md:text-2xl`:`text-base font-semibold tracking-tight md:text-lg`,y=(0,a.jsxs)(a.Fragment,{children:[p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${x(c)} opacity-40 blur-2xl dark:opacity-50`}),(0,a.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${x(c)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,a.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,a.jsx)(`span`,{className:`grid place-items-center ${x(c)} text-white shadow-md ${g}`,children:(0,a.jsx)(o,{size:_})}),h&&(0,a.jsx)(s.IconChevronRight,{size:p?18:16,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}),(0,a.jsxs)(`div`,{className:`relative z-1`,children:[(0,a.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:u}),(0,a.jsx)(`div`,{className:`mt-0.5 ${v}`,children:d}),m&&(0,a.jsx)(`div`,{className:`mt-2`,children:m})]})]}),b=`bento-tile bento-glass group relative flex flex-col ${p?`gap-5`:`gap-4`} overflow-hidden text-left ${p?`p-6 md:p-7`:`p-5`} ${f}${h?` bento-tile-clickable`:``}${r?` cursor-not-allowed opacity-60`:``}`;return r?(0,a.jsx)(`div`,{className:b,"aria-disabled":`true`,title:i,children:y}):t?(0,a.jsx)(l.Link,{to:t,className:b,children:y}):n?(0,a.jsx)(`button`,{type:`button`,onClick:n,className:e.t(`w-full`,b),children:y}):(0,a.jsx)(`div`,{className:b,children:y})}function Ye({versions:t,selected:n,onSelect:r,label:c}){let{t:l,i18n:u}=(0,o.useTranslation)(),[d,f]=(0,i.useState)(0),[p,m]=(0,i.useState)([]),h=(0,i.useRef)(new Map),g=e=>[...e].sort((e,n)=>t.findIndex(e=>e.id===n)-t.findIndex(t=>t.id===e));function _(e){if(n.includes(e)){m(p.filter(t=>t!==e)),r(n.filter(t=>t!==e));return}let t=[...n.filter(e=>!p.includes(e)),...p.filter(e=>n.includes(e))],i=t.length>=2?t.slice(t.length-1):t;m([...i,e]),r(g([...i,e]))}function v(e){let n=Math.max(0,Math.min(t.length-1,e));f(n),h.current.get(n)?.focus()}function y(e,n){switch(e.key){case`ArrowDown`:v(n+1);break;case`ArrowUp`:v(n-1);break;case`Home`:v(0);break;case`End`:v(t.length-1);break;case` `:case`Enter`:_(t[n].id);break;default:return}e.preventDefault()}let b=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?{iso:void 0,text:String(e)}:{iso:t.toISOString(),text:new Intl.DateTimeFormat(u?.resolvedLanguage,{dateStyle:`medium`,timeStyle:`short`}).format(t)}};return(0,a.jsx)(`ul`,{role:`listbox`,"aria-label":c??l(`bento.versions.label`,{defaultValue:`Versions`}),"aria-multiselectable":`true`,"data-slot":`bento-version-rail`,className:`m-0 flex list-none flex-col gap-1 p-0`,children:t.map((r,i)=>{let o=n.includes(r.id),c=b(r.at),u=r.actor===`agent`?s.IconRobot:s.IconUser;return(0,a.jsxs)(`li`,{ref:e=>{e?h.current.set(i,e):h.current.delete(i)},role:`option`,"aria-selected":o?`true`:`false`,tabIndex:i===Math.min(d,t.length-1)?0:-1,onKeyDown:e=>y(e,i),onClick:()=>{f(i),_(r.id)},className:e.t(`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`),children:[(0,a.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,a.jsx)(u,{size:14,"aria-hidden":`true`}),r.author,(0,a.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:r.actor===`agent`?l(`bento.versions.agent`,{defaultValue:`Agent`}):l(`bento.versions.human`,{defaultValue:`Person`})})]}),(0,a.jsx)(`time`,{dateTime:c.iso,className:`text-xs text-muted-foreground`,children:c.text}),r.summary&&(0,a.jsx)(`span`,{className:`text-xs`,children:r.summary})]},r.id)})})}exports.AdaptiveSectionCard=Ge,exports.BENTO_EMPHASIS_NEXT=U,exports.BENTO_EMPHASIS_SPAN=H,exports.BENTO_SHELL_SHORTCUTS=Ae,exports.BENTO_TONES=b,exports.BENTO_TONE_CLASS=y,exports.BentoActionsMenu=v,exports.BentoBackLink=D,exports.BentoBackToTop=Ce,exports.BentoCommandPalette=De,exports.BentoCountTile=S,exports.BentoDataTable=T,exports.BentoDiff=z,exports.BentoEmptyState=E,exports.BentoEntityShell=P,exports.BentoEntityTile=G,exports.BentoFilterBar=re,exports.BentoFormHero=ge,exports.BentoFormSection=ve,exports.BentoHero=O,exports.BentoHeroIconPicker=k,exports.BentoInlineEdit=A,exports.BentoListPage=oe,exports.BentoNavRail=Ve,exports.BentoPaletteTrigger=Ie,exports.BentoPanel=ye,exports.BentoSaveBar=pe,exports.BentoScrollSaveBar=he,exports.BentoSection=qe,exports.BentoShell=Oe,exports.BentoShortcutsDialog=Le,exports.BentoStatusMarker=j,exports.BentoTile=Je,exports.BentoTileGrid=Q,exports.BentoUserMenu=Ue,exports.BentoVersionRail=Ye,exports.EMPTY_FILTERS=K,exports.bentoChipClass=x,exports.bentoNavTarget=we,exports.resolveBentoLayout=ne,exports.toBentoLayoutEntries=W,exports.useBentoScrollFade=M,exports.useBentoShellShortcuts=Fe;
|
package/dist/bento.css
CHANGED
|
@@ -422,17 +422,83 @@
|
|
|
422
422
|
|
|
423
423
|
/* Reserves the gutter the fixed nav rail occupies, so page content is not
|
|
424
424
|
underneath it. The rail is `w-16` and hidden below `md`, and this matches on
|
|
425
|
-
both counts
|
|
425
|
+
both counts.
|
|
426
426
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
`BentoShell` puts it on its own root when it is given a rail. It stays a class
|
|
428
|
+
for a product whose shell is still its own: the measurement is the rail's,
|
|
429
|
+
and a product copying the literal is how the two stop matching. */
|
|
430
430
|
@media (min-width: 48rem) {
|
|
431
431
|
.bento-rail-gutter {
|
|
432
432
|
padding-left: 4rem;
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
+
/* ---------------------------------------------------------------------------
|
|
437
|
+
* The reading column (VDS131).
|
|
438
|
+
*
|
|
439
|
+
* BENTO-AUTHORING §1 gives `main` the max width, the gutters and the vertical
|
|
440
|
+
* rhythm, once, and a page none of the three. Each is a property here rather than
|
|
441
|
+
* a Tailwind class, so a product re-keys the column by redefining one variable
|
|
442
|
+
* and a page has nothing to repeat. `BentoShell` picks the width by name through
|
|
443
|
+
* `data-column`.
|
|
444
|
+
* ------------------------------------------------------------------------- */
|
|
445
|
+
@layer base {
|
|
446
|
+
:root {
|
|
447
|
+
--bento-column-default: 80rem;
|
|
448
|
+
--bento-column-narrow: 56rem;
|
|
449
|
+
--bento-column-wide: 96rem;
|
|
450
|
+
--bento-shell-gutter: 1rem;
|
|
451
|
+
--bento-shell-rhythm: 1.5rem;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
@media (min-width: 48rem) {
|
|
455
|
+
:root {
|
|
456
|
+
--bento-shell-gutter: 2rem;
|
|
457
|
+
--bento-shell-rhythm: 2.5rem;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.bento-shell-main {
|
|
463
|
+
--bento-column: var(--bento-column-default);
|
|
464
|
+
position: relative;
|
|
465
|
+
z-index: 10;
|
|
466
|
+
box-sizing: border-box;
|
|
467
|
+
width: 100%;
|
|
468
|
+
max-width: var(--bento-column);
|
|
469
|
+
margin-inline: auto;
|
|
470
|
+
padding: var(--bento-shell-rhythm) var(--bento-shell-gutter);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.bento-shell-main:focus {
|
|
474
|
+
outline: none;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.bento-shell-main[data-column="narrow"] {
|
|
478
|
+
--bento-column: var(--bento-column-narrow);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.bento-shell-main[data-column="wide"] {
|
|
482
|
+
--bento-column: var(--bento-column-wide);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/* A tool that owns the viewport fills what the header leaves and scrolls inside
|
|
486
|
+
itself, so the column has no bottom rhythm to keep. */
|
|
487
|
+
.bento-shell-main[data-column="full"] {
|
|
488
|
+
--bento-column: none;
|
|
489
|
+
display: flex;
|
|
490
|
+
flex: 1 1 0%;
|
|
491
|
+
flex-direction: column;
|
|
492
|
+
min-height: 0;
|
|
493
|
+
padding-bottom: 0;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/* The header's edges line up with the column's gutter rather than with a
|
|
497
|
+
padding of their own. */
|
|
498
|
+
.bento-shell-bar {
|
|
499
|
+
padding-inline: var(--bento-shell-gutter);
|
|
500
|
+
}
|
|
501
|
+
|
|
436
502
|
/* An icon that leads a dialog title, in the product's accent rather than the
|
|
437
503
|
layer's own. */
|
|
438
504
|
.bento-accent-icon {
|