@viglet/viglet-design-system 2026.3.2 → 2026.3.4

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.
Files changed (184) hide show
  1. package/README.md +334 -8
  2. package/dist/assets.cjs +1 -0
  3. package/dist/assets.es.js +2 -0
  4. package/dist/badge-locale-BxI9TwkE.js +579 -0
  5. package/dist/badge-locale-sIsBdP_e.cjs +7 -0
  6. package/dist/bento/bento-actions-menu.d.ts +42 -0
  7. package/dist/bento/bento-actions-menu.d.ts.map +1 -0
  8. package/dist/bento/bento-back-to-top.d.ts +11 -0
  9. package/dist/bento/bento-back-to-top.d.ts.map +1 -0
  10. package/dist/bento/bento-command-palette.d.ts +28 -0
  11. package/dist/bento/bento-command-palette.d.ts.map +1 -0
  12. package/dist/bento/bento-count-tile.d.ts +18 -0
  13. package/dist/bento/bento-count-tile.d.ts.map +1 -0
  14. package/dist/bento/bento-empty-state.d.ts +35 -0
  15. package/dist/bento/bento-empty-state.d.ts.map +1 -0
  16. package/dist/bento/bento-entity-shell.d.ts +123 -0
  17. package/dist/bento/bento-entity-shell.d.ts.map +1 -0
  18. package/dist/bento/bento-entity-tile.d.ts +40 -0
  19. package/dist/bento/bento-entity-tile.d.ts.map +1 -0
  20. package/dist/bento/bento-form-hero.d.ts +91 -0
  21. package/dist/bento/bento-form-hero.d.ts.map +1 -0
  22. package/dist/bento/bento-form-section.d.ts +31 -0
  23. package/dist/bento/bento-form-section.d.ts.map +1 -0
  24. package/dist/bento/bento-hero-icon-picker.d.ts +35 -0
  25. package/dist/bento/bento-hero-icon-picker.d.ts.map +1 -0
  26. package/dist/bento/bento-hero.d.ts +62 -0
  27. package/dist/bento/bento-hero.d.ts.map +1 -0
  28. package/dist/bento/bento-inline-edit.d.ts +52 -0
  29. package/dist/bento/bento-inline-edit.d.ts.map +1 -0
  30. package/dist/bento/bento-layout.d.ts +52 -0
  31. package/dist/bento/bento-layout.d.ts.map +1 -0
  32. package/dist/bento/bento-list-page.d.ts +124 -0
  33. package/dist/bento/bento-list-page.d.ts.map +1 -0
  34. package/dist/bento/bento-nav-rail.d.ts +32 -0
  35. package/dist/bento/bento-nav-rail.d.ts.map +1 -0
  36. package/dist/bento/bento-nav.d.ts +69 -0
  37. package/dist/bento/bento-nav.d.ts.map +1 -0
  38. package/dist/bento/bento-save-bar.d.ts +36 -0
  39. package/dist/bento/bento-save-bar.d.ts.map +1 -0
  40. package/dist/bento/bento-scroll-fade.d.ts +20 -0
  41. package/dist/bento/bento-scroll-fade.d.ts.map +1 -0
  42. package/dist/bento/bento-scroll-save-bar.d.ts +22 -0
  43. package/dist/bento/bento-scroll-save-bar.d.ts.map +1 -0
  44. package/dist/bento/bento-section-chrome.d.ts +60 -0
  45. package/dist/bento/bento-section-chrome.d.ts.map +1 -0
  46. package/dist/bento/bento-section.d.ts +27 -0
  47. package/dist/bento/bento-section.d.ts.map +1 -0
  48. package/dist/bento/bento-shortcuts-dialog.d.ts +15 -0
  49. package/dist/bento/bento-shortcuts-dialog.d.ts.map +1 -0
  50. package/dist/bento/bento-status-marker.d.ts +26 -0
  51. package/dist/bento/bento-status-marker.d.ts.map +1 -0
  52. package/dist/bento/bento-tile.d.ts +42 -0
  53. package/dist/bento/bento-tile.d.ts.map +1 -0
  54. package/dist/bento/bento-tones.d.ts +33 -0
  55. package/dist/bento/bento-tones.d.ts.map +1 -0
  56. package/dist/bento/bento-user-menu.d.ts +31 -0
  57. package/dist/bento/bento-user-menu.d.ts.map +1 -0
  58. package/dist/bento/index.d.ts +59 -0
  59. package/dist/bento/index.d.ts.map +1 -0
  60. package/dist/bento.cjs +1 -0
  61. package/dist/bento.css +442 -0
  62. package/dist/bento.es.js +1502 -0
  63. package/dist/breadcrumb.context-CGqjI0-U.js +914 -0
  64. package/dist/breadcrumb.context-DYeZEC65.cjs +1 -0
  65. package/dist/components/app-switcher.d.ts +2 -0
  66. package/dist/components/app-switcher.d.ts.map +1 -1
  67. package/dist/components/badge-locale.d.ts.map +1 -1
  68. package/dist/components/error-boundary.d.ts.map +1 -1
  69. package/dist/components/language-select.d.ts.map +1 -1
  70. package/dist/components/router/blank-slate.d.ts +10 -0
  71. package/dist/components/router/blank-slate.d.ts.map +1 -1
  72. package/dist/components/router/grid.list.d.ts +13 -0
  73. package/dist/components/router/grid.list.d.ts.map +1 -1
  74. package/dist/components/router/internal.sidebar.d.ts +39 -3
  75. package/dist/components/router/internal.sidebar.d.ts.map +1 -1
  76. package/dist/components/router/loading-provider.d.ts +6 -1
  77. package/dist/components/router/loading-provider.d.ts.map +1 -1
  78. package/dist/components/router/nav-main.d.ts +10 -0
  79. package/dist/components/router/nav-main.d.ts.map +1 -1
  80. package/dist/components/router/nav-user.d.ts +13 -0
  81. package/dist/components/router/nav-user.d.ts.map +1 -1
  82. package/dist/components/router/page-content.d.ts +10 -0
  83. package/dist/components/router/page-content.d.ts.map +1 -1
  84. package/dist/components/router/page-header.d.ts +13 -0
  85. package/dist/components/router/page-header.d.ts.map +1 -1
  86. package/dist/components/router/page.d.ts +13 -0
  87. package/dist/components/router/page.d.ts.map +1 -1
  88. package/dist/components/router/sticky.page.header.d.ts +14 -0
  89. package/dist/components/router/sticky.page.header.d.ts.map +1 -1
  90. package/dist/components/router/sub.page.d.ts +31 -11
  91. package/dist/components/router/sub.page.d.ts.map +1 -1
  92. package/dist/components/router/sub.page.header.d.ts +13 -0
  93. package/dist/components/router/sub.page.header.d.ts.map +1 -1
  94. package/dist/components/startup-first/startup-first.d.ts.map +1 -1
  95. package/dist/components/theme-provider.d.ts +37 -2
  96. package/dist/components/theme-provider.d.ts.map +1 -1
  97. package/dist/components/ui/floating-formulas-bg.d.ts +8 -1
  98. package/dist/components/ui/floating-formulas-bg.d.ts.map +1 -1
  99. package/dist/components/ui/form.d.ts +2 -2
  100. package/dist/components/ui/form.d.ts.map +1 -1
  101. package/dist/components/ui/gradient-button.d.ts.map +1 -1
  102. package/dist/components/ui/gradient-switch.d.ts.map +1 -1
  103. package/dist/components/ui/icon-picker-dialog.d.ts +35 -0
  104. package/dist/components/ui/icon-picker-dialog.d.ts.map +1 -0
  105. package/dist/components/ui/index.d.ts +1 -0
  106. package/dist/components/ui/index.d.ts.map +1 -1
  107. package/dist/components/ui/section-card.d.ts +3 -3
  108. package/dist/components/ui/section-card.d.ts.map +1 -1
  109. package/dist/components/ui/sidebar.d.ts.map +1 -1
  110. package/dist/components/ui/slider.d.ts +1 -1
  111. package/dist/components/ui/slider.d.ts.map +1 -1
  112. package/dist/components/viglet-app-switcher.d.ts +3 -0
  113. package/dist/components/viglet-app-switcher.d.ts.map +1 -1
  114. package/dist/contexts/user.context.d.ts +24 -0
  115. package/dist/contexts/user.context.d.ts.map +1 -1
  116. package/dist/exports.json +404 -0
  117. package/dist/floating-formulas-bg.cjs +1 -0
  118. package/dist/floating-formulas-bg.css +21 -0
  119. package/dist/floating-formulas-bg.es.js +84 -56
  120. package/dist/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
  121. package/dist/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
  122. package/dist/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
  123. package/dist/fonts/inter-greek-wght-normal.woff2 +0 -0
  124. package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  125. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  126. package/dist/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
  127. package/dist/fonts/plus-jakarta-sans-cyrillic-ext-wght-normal.woff2 +0 -0
  128. package/dist/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2 +0 -0
  129. package/dist/fonts/plus-jakarta-sans-latin-wght-normal.woff2 +0 -0
  130. package/dist/fonts/plus-jakarta-sans-vietnamese-wght-normal.woff2 +0 -0
  131. package/dist/fonts.css +126 -0
  132. package/dist/hooks/use-grid-adapter.d.ts.map +1 -1
  133. package/dist/hooks/use-mobile.d.ts +10 -0
  134. package/dist/hooks/use-mobile.d.ts.map +1 -1
  135. package/dist/hooks/use-sub-page-breadcrumb.d.ts.map +1 -1
  136. package/dist/i18n/index.d.ts +136 -0
  137. package/dist/i18n/index.d.ts.map +1 -1
  138. package/dist/i18n/locales/en/bento.json.d.ts +51 -0
  139. package/dist/i18n/locales/en/common.json.d.ts +7 -1
  140. package/dist/i18n/locales/en/forms.json.d.ts +15 -1
  141. package/dist/i18n/locales/en/nav.json.d.ts +3 -1
  142. package/dist/i18n/locales/pt/bento.json.d.ts +51 -0
  143. package/dist/i18n/locales/pt/common.json.d.ts +7 -1
  144. package/dist/i18n/locales/pt/forms.json.d.ts +15 -1
  145. package/dist/i18n/locales/pt/nav.json.d.ts +3 -1
  146. package/dist/i18n-DoNdMLEd.cjs +1 -0
  147. package/dist/{i18n-C94rDRaM.js → i18n-DuNITbWa.js} +155 -27
  148. package/dist/i18n.cjs +1 -0
  149. package/dist/i18n.es.js +2 -1
  150. package/dist/index.cjs +1 -0
  151. package/dist/index.d.ts +0 -1
  152. package/dist/index.d.ts.map +1 -1
  153. package/dist/index.es.js +493 -750
  154. package/dist/lib/axios.d.ts.map +1 -1
  155. package/dist/lib/export-xlsx.d.ts +7 -1
  156. package/dist/lib/export-xlsx.d.ts.map +1 -1
  157. package/dist/lib/react-markers.d.ts +17 -0
  158. package/dist/lib/react-markers.d.ts.map +1 -0
  159. package/dist/lib/utils.d.ts +22 -0
  160. package/dist/lib/utils.d.ts.map +1 -1
  161. package/dist/loading-provider-1mgM91iY.cjs +1 -0
  162. package/dist/loading-provider-CMnOuvdR.js +224 -0
  163. package/dist/preset.css +103 -3
  164. package/dist/products-DL_YYXkV.cjs +1 -0
  165. package/dist/products-Du9KB6Xl.js +9 -0
  166. package/dist/{rolldown-runtime-CMqjfN_6.cjs → rolldown-runtime-BocRIvOZ.cjs} +1 -1
  167. package/dist/router.cjs +1 -0
  168. package/dist/router.es.js +334 -504
  169. package/dist/user.context-kPAqKN4o.js +512 -0
  170. package/dist/user.context-r50nSWER.cjs +1 -0
  171. package/dist/viglet-design-system.css +1 -1
  172. package/dist/vite/boot-loader.d.ts +21 -7
  173. package/dist/vite/boot-loader.d.ts.map +1 -1
  174. package/dist/{vite.cjs.js → vite.cjs} +8 -8
  175. package/dist/vite.es.js +29 -16
  176. package/package.json +66 -22
  177. package/scripts/check-duplicates.mjs +198 -0
  178. package/dist/breadcrumb.context-C7VCfh49.js +0 -1501
  179. package/dist/breadcrumb.context-Td6Tjc_z.cjs +0 -7
  180. package/dist/floating-formulas-bg.cjs.js +0 -1
  181. package/dist/i18n-DN_2YzjB.cjs +0 -1
  182. package/dist/i18n.cjs.js +0 -1
  183. package/dist/index.cjs.js +0 -1
  184. package/dist/router.cjs.js +0 -1
@@ -0,0 +1,1502 @@
1
+ "use client";
2
+ import { A as e, D as t, E as n, F as r, M as i, U as a, _ as o, a as s, f as c, g as l, h as u, i as d, k as f, l as p, m, o as h, s as g, u as _, x as v } from "./badge-locale-BxI9TwkE.js";
3
+ import { c as y, l as b, n as x, o as S, r as C, s as w } from "./user.context-kPAqKN4o.js";
4
+ import { i as T, t as E } from "./loading-provider-CMnOuvdR.js";
5
+ import { Children as D, createContext as O, isValidElement as k, useContext as A, useEffect as j, useMemo as M, useRef as N, useState as P, useSyncExternalStore as ee } from "react";
6
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
7
+ import { IconAdjustmentsHorizontal as R, IconAlertTriangle as te, IconArrowBackUp as z, IconArrowLeft as ne, IconArrowRight as re, IconArrowUp as B, IconBuildingCommunity as ie, IconBuildingSkyscraper as ae, IconChevronRight as V, IconDeviceFloppy as H, IconDotsVertical as oe, IconExternalLink as se, IconGripVertical as ce, IconHome as le, IconKeyboard as ue, IconLogout as de, IconPalette as fe, IconPlus as pe, IconSearch as me, IconSparkles as U, IconTrash as he, IconUserCircle as ge, IconUsers as _e, IconX as W } from "@tabler/icons-react";
8
+ import { useTranslation as G } from "react-i18next";
9
+ import { Icon as K } from "@iconify/react";
10
+ import { Link as q, useLocation as ve, useNavigate as J } from "react-router-dom";
11
+ import { DndContext as ye, KeyboardSensor as be, PointerSensor as xe, closestCenter as Se, useSensor as Ce, useSensors as we } from "@dnd-kit/core";
12
+ import { SortableContext as Te, arrayMove as Ee, rectSortingStrategy as De, useSortable as Oe } from "@dnd-kit/sortable";
13
+ import { CSS as ke } from "@dnd-kit/utilities";
14
+ //#region src/bento/bento-actions-menu.tsx
15
+ var Ae = {
16
+ default: "",
17
+ destructive: "bento-item-danger"
18
+ };
19
+ function je({ actions: e, triggerLabel: t }) {
20
+ let { t: r } = G();
21
+ return e.length === 0 ? null : /* @__PURE__ */ L(c, { children: [/* @__PURE__ */ I(n, {
22
+ asChild: !0,
23
+ children: /* @__PURE__ */ I("button", {
24
+ type: "button",
25
+ "aria-label": t ?? r("forms.formActions.moreActions", { defaultValue: "More actions" }),
26
+ className: "bento-tile-clickable inline-flex h-9 w-9 items-center justify-center rounded-full border border-border/60 bg-card/60 text-muted-foreground backdrop-blur transition-colors duration-200 hover:text-foreground",
27
+ children: /* @__PURE__ */ I(oe, { size: 18 })
28
+ })
29
+ }), /* @__PURE__ */ I(m, {
30
+ align: "end",
31
+ sideOffset: 8,
32
+ className: "bento-dropdown min-w-44 p-1.5",
33
+ children: e.map((e) => {
34
+ let t = e.icon, n = Ae[e.tone ?? "default"];
35
+ return /* @__PURE__ */ L(l, {
36
+ onSelect: e.onSelect,
37
+ disabled: e.disabled,
38
+ className: `bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${n}`,
39
+ children: [/* @__PURE__ */ I(t, { size: 16 }), e.label]
40
+ }, e.label);
41
+ })
42
+ })] });
43
+ }
44
+ //#endregion
45
+ //#region src/bento/bento-tones.ts
46
+ var Y = {
47
+ blue: "bento-tone-blue",
48
+ indigo: "bento-tone-indigo",
49
+ violet: "bento-tone-violet",
50
+ emerald: "bento-tone-emerald",
51
+ amber: "bento-tone-amber",
52
+ rose: "bento-tone-rose",
53
+ slate: "bento-tone-slate"
54
+ }, Me = Object.keys(Y);
55
+ function X(e) {
56
+ return `bento-chip ${Y[e] ?? Y.slate}`;
57
+ }
58
+ //#endregion
59
+ //#region src/bento/bento-count-tile.tsx
60
+ function Ne({ to: e, icon: t, tone: n, label: r, count: i, span: a }) {
61
+ let o = /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("span", {
62
+ className: `grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${X(n)}`,
63
+ children: /* @__PURE__ */ I(t, { size: 18 })
64
+ }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("div", {
65
+ className: "text-3xl font-semibold tabular-nums tracking-tight",
66
+ children: i
67
+ }), /* @__PURE__ */ I("div", {
68
+ className: "text-[11px] uppercase tracking-wider text-muted-foreground",
69
+ children: r
70
+ })] })] }), s = `bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${a}${e ? " bento-tile-clickable" : ""}`;
71
+ return e ? /* @__PURE__ */ I(q, {
72
+ to: e,
73
+ className: s,
74
+ children: o
75
+ }) : /* @__PURE__ */ I("div", {
76
+ className: s,
77
+ children: o
78
+ });
79
+ }
80
+ //#endregion
81
+ //#region src/bento/bento-empty-state.tsx
82
+ function Pe({ icon: e = U, tone: t = "indigo", title: n, description: r, action: i, align: o = "center", className: s }) {
83
+ let c = X(t), l = o === "center";
84
+ return /* @__PURE__ */ L("div", {
85
+ className: a("bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8", l ? "items-center text-center" : "items-start text-left", s),
86
+ children: [
87
+ /* @__PURE__ */ I("span", {
88
+ className: `grid h-12 w-12 place-items-center rounded-2xl ${c} text-white shadow-md`,
89
+ children: /* @__PURE__ */ I(e, { size: 24 })
90
+ }),
91
+ /* @__PURE__ */ I("div", {
92
+ className: "text-lg font-semibold tracking-tight",
93
+ children: n
94
+ }),
95
+ r && /* @__PURE__ */ I("p", {
96
+ className: a("max-w-md text-sm text-muted-foreground", l && "mx-auto"),
97
+ children: r
98
+ }),
99
+ i && /* @__PURE__ */ I("div", {
100
+ className: a("mt-1", l && "mx-auto"),
101
+ children: i
102
+ })
103
+ ]
104
+ });
105
+ }
106
+ //#endregion
107
+ //#region src/bento/bento-hero.tsx
108
+ function Z({ to: e, children: t }) {
109
+ return /* @__PURE__ */ L(q, {
110
+ to: e,
111
+ className: "inline-flex items-center gap-1 hover:text-foreground",
112
+ children: [/* @__PURE__ */ I(ne, {
113
+ size: 14,
114
+ "aria-hidden": !0
115
+ }), t]
116
+ });
117
+ }
118
+ function Q({ eyebrow: e, backTo: t, backLabel: n, title: r, subtitle: i, leading: a, trailing: o }) {
119
+ let s = e ?? (t == null ? null : /* @__PURE__ */ I(Z, {
120
+ to: t,
121
+ children: n
122
+ }));
123
+ return /* @__PURE__ */ I("header", {
124
+ className: "bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10",
125
+ children: /* @__PURE__ */ L("div", {
126
+ className: "flex w-full items-start gap-4",
127
+ children: [
128
+ a && /* @__PURE__ */ I("div", {
129
+ className: "shrink-0",
130
+ children: a
131
+ }),
132
+ /* @__PURE__ */ L("div", {
133
+ className: "flex flex-1 flex-col gap-1",
134
+ children: [
135
+ s && /* @__PURE__ */ I("span", {
136
+ className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
137
+ children: s
138
+ }),
139
+ /* @__PURE__ */ I("h1", {
140
+ className: "text-3xl font-semibold tracking-tight md:text-4xl",
141
+ children: r
142
+ }),
143
+ i && /* @__PURE__ */ I("p", {
144
+ className: "max-w-2xl text-sm text-muted-foreground",
145
+ children: i
146
+ })
147
+ ]
148
+ }),
149
+ o && /* @__PURE__ */ I("div", {
150
+ className: "ml-auto flex shrink-0 items-center gap-2",
151
+ children: o
152
+ })
153
+ ]
154
+ })
155
+ });
156
+ }
157
+ //#endregion
158
+ //#region src/bento/bento-hero-icon-picker.tsx
159
+ function Fe({ value: e, onChange: t, onClear: n, defaultIcon: r, tone: i, title: a, description: o, readOnly: s = !1 }) {
160
+ let { t: c } = G(), [l, u] = P(!1);
161
+ return s ? /* @__PURE__ */ I("span", {
162
+ className: `grid h-12 w-12 place-items-center rounded-2xl ${X(i)} text-white shadow-md`,
163
+ children: e ? /* @__PURE__ */ I(K, {
164
+ icon: e,
165
+ className: "size-6 text-white"
166
+ }) : /* @__PURE__ */ I(r, { size: 24 })
167
+ }) : /* @__PURE__ */ L("div", {
168
+ className: "group relative",
169
+ children: [
170
+ /* @__PURE__ */ L("button", {
171
+ type: "button",
172
+ onClick: () => u(!0),
173
+ "aria-label": c("forms.iconPicker.chooseAnIcon"),
174
+ className: `group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${X(i)} text-white shadow-md outline-none transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] hover:scale-105 focus-visible:ring-2 focus-visible:ring-ring active:scale-95`,
175
+ children: [e ? /* @__PURE__ */ I(K, {
176
+ icon: e,
177
+ className: "size-6 text-white"
178
+ }) : /* @__PURE__ */ I(r, { size: 24 }), /* @__PURE__ */ I("span", {
179
+ className: "pointer-events-none absolute inset-0 grid place-items-center bg-black/40 opacity-0 transition-opacity duration-200 group-hover/icon:opacity-100",
180
+ children: /* @__PURE__ */ I(fe, { className: "size-5 text-white" })
181
+ })]
182
+ }),
183
+ e && n && /* @__PURE__ */ I("button", {
184
+ type: "button",
185
+ onClick: (e) => {
186
+ e.stopPropagation(), n();
187
+ },
188
+ "aria-label": c("forms.common.remove"),
189
+ title: c("forms.common.remove"),
190
+ className: "absolute -right-1.5 -top-1.5 grid h-5 w-5 cursor-pointer place-items-center rounded-full border border-border/60 bg-card/90 text-foreground opacity-0 shadow-md backdrop-blur transition-opacity duration-200 bento-clear focus-visible:opacity-100 group-hover:opacity-100",
191
+ children: /* @__PURE__ */ I(W, { size: 12 })
192
+ }),
193
+ /* @__PURE__ */ I(y, {
194
+ open: l,
195
+ onOpenChange: u,
196
+ value: e,
197
+ onSelect: t,
198
+ onClear: n,
199
+ title: a,
200
+ description: o
201
+ })
202
+ ]
203
+ });
204
+ }
205
+ //#endregion
206
+ //#region src/bento/bento-inline-edit.tsx
207
+ function Ie({ value: e, onSave: t, multiline: n = !1, placeholder: r, className: i = "", ariaLabel: a, autoFocus: o = !1, readOnly: s = !1, commitOnChange: c = !1 }) {
208
+ let { t: l } = G(), [u, d] = P(o), [f, m] = P(e), [h, g] = P(!1), _ = N(null), [v, y] = P(e);
209
+ !u && e !== v && (y(e), m(e)), j(() => {
210
+ u && _.current && (_.current.focus(), _.current.select());
211
+ }, [u]);
212
+ async function b() {
213
+ let n = f.trim();
214
+ if (n === e) {
215
+ d(!1);
216
+ return;
217
+ }
218
+ if (!n && !r) {
219
+ m(e), d(!1);
220
+ return;
221
+ }
222
+ g(!0);
223
+ try {
224
+ await t(n);
225
+ } catch {
226
+ m(e);
227
+ } finally {
228
+ g(!1), d(!1);
229
+ }
230
+ }
231
+ function x() {
232
+ m(e), d(!1);
233
+ }
234
+ function S(e) {
235
+ m(e), c && t(e);
236
+ }
237
+ let C = !e;
238
+ if (s) return /* @__PURE__ */ I("span", {
239
+ className: `block w-full ${i}`,
240
+ "aria-label": a,
241
+ children: e || /* @__PURE__ */ I("span", {
242
+ className: "text-muted-foreground/80",
243
+ children: r ?? "—"
244
+ })
245
+ });
246
+ let w = `w-full bg-transparent outline-none border-b transition-colors duration-200 ${i}`, T = `${w} cursor-text rounded-sm ${C ? "border-dashed border-border/70 hover:border-foreground/40" : "border-transparent hover:border-border/60 focus-visible:border-border/80"} ${h ? "opacity-60" : ""}`, E = `${w} bento-editing`;
247
+ if (!u) return /* @__PURE__ */ I("button", {
248
+ type: "button",
249
+ onClick: () => d(!0),
250
+ className: `${T} text-left`,
251
+ "aria-label": a ?? l("forms.formActions.edit"),
252
+ disabled: h,
253
+ children: e || /* @__PURE__ */ I("span", {
254
+ className: "text-muted-foreground/80",
255
+ children: r ?? "—"
256
+ })
257
+ });
258
+ function D(e) {
259
+ if (e.key === "Escape") {
260
+ e.preventDefault(), x();
261
+ return;
262
+ }
263
+ e.key === "Enter" && (!n || e.metaKey || e.ctrlKey) && (e.preventDefault(), b());
264
+ }
265
+ return n ? /* @__PURE__ */ I("textarea", {
266
+ ref: _,
267
+ value: f,
268
+ onChange: (e) => S(e.target.value),
269
+ onBlur: b,
270
+ onKeyDown: D,
271
+ placeholder: r,
272
+ "aria-label": a,
273
+ rows: 3,
274
+ className: `${E} resize-none py-0.5 leading-snug`
275
+ }) : /* @__PURE__ */ I(p, {
276
+ ref: _,
277
+ value: f,
278
+ onChange: (e) => S(e.target.value),
279
+ onBlur: b,
280
+ onKeyDown: D,
281
+ placeholder: r,
282
+ "aria-label": a,
283
+ className: `${E} h-auto px-0 py-0 shadow-none focus-visible:ring-0`
284
+ });
285
+ }
286
+ //#endregion
287
+ //#region src/bento/bento-status-marker.tsx
288
+ function Le({ titleMissing: e, dirty: t, className: n }) {
289
+ let { t: r } = G();
290
+ if (!e && !t) return null;
291
+ let i = "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal";
292
+ return e ? /* @__PURE__ */ L("span", {
293
+ className: `${i} bento-status bento-status-error ${n ?? ""}`,
294
+ children: [/* @__PURE__ */ I(te, { className: "size-3" }), r("bento.saveBar.titleRequired", { defaultValue: "Title required" })]
295
+ }) : /* @__PURE__ */ L("span", {
296
+ className: `${i} bento-status bento-status-warn ${n ?? ""}`,
297
+ children: [/* @__PURE__ */ I("span", { className: "h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse" }), r("bento.saveBar.unsaved", { defaultValue: "Unsaved changes" })]
298
+ });
299
+ }
300
+ //#endregion
301
+ //#region src/bento/bento-scroll-fade.ts
302
+ function Re(e) {
303
+ j(() => {
304
+ let t = e.current;
305
+ if (!t) return;
306
+ let n = document.documentElement, r = 0, i = () => {
307
+ r = 0;
308
+ let e = t.getBoundingClientRect().top, i = Math.max(0, Math.min(1, (160 - e) / 80));
309
+ n.style.setProperty("--bento-fade", String(i)), n.classList.toggle("bento-fade-half", i > .5);
310
+ }, a = () => {
311
+ r ||= requestAnimationFrame(i);
312
+ };
313
+ return i(), window.addEventListener("scroll", a, { passive: !0 }), window.addEventListener("resize", a), () => {
314
+ r && cancelAnimationFrame(r), window.removeEventListener("scroll", a), window.removeEventListener("resize", a), n.style.removeProperty("--bento-fade"), n.classList.remove("bento-fade-half");
315
+ };
316
+ }, [e]);
317
+ }
318
+ //#endregion
319
+ //#region src/bento/bento-entity-shell.tsx
320
+ function ze(e, t) {
321
+ let n = {};
322
+ for (let r of Object.keys(e)) Object.assign(n, { [r]: t[r] });
323
+ return n;
324
+ }
325
+ function Be({ entity: e, isNew: t, headlineFallback: n, eyebrow: r, listRoute: i, icon: a, tone: o, formId: s, feature: c, hasStatus: l = !1, hideIcon: u = !1, readOnly: d = !1, autosaveOnly: f = !1, badge: p, notice: m, onUpdate: h, onDelete: g, extraActions: v, children: y }) {
326
+ let { t: b } = G(), x = J(), [C, w] = P(!1), [E, D] = P({
327
+ isDirty: !1,
328
+ isSubmitting: !1
329
+ }), O = N(null);
330
+ Re(O);
331
+ let k = {
332
+ title: e.title ?? "",
333
+ description: e.description ?? "",
334
+ icon: e.icon ?? null,
335
+ enabled: e.enabled ?? 1
336
+ }, [A, j] = P(k), [M, ee] = P(k);
337
+ (k.title !== M.title || k.description !== M.description || k.icon !== M.icon || k.enabled !== M.enabled) && (ee(k), j(k));
338
+ async function R(n) {
339
+ if (j((e) => ({
340
+ ...e,
341
+ ...n
342
+ })), t || !h) return;
343
+ let r = n.title ?? A.title;
344
+ try {
345
+ await h({
346
+ ...e,
347
+ ...n
348
+ }), S.success(b("forms.common.updated", {
349
+ name: r,
350
+ feature: c
351
+ }));
352
+ } catch (e) {
353
+ console.error("Failed to update entity field", e), j((e) => ({
354
+ ...e,
355
+ ...ze(n, k)
356
+ })), S.error(b("forms.common.notUpdated", {
357
+ name: k.title || r,
358
+ feature: c
359
+ }));
360
+ }
361
+ }
362
+ async function te() {
363
+ if (g) {
364
+ try {
365
+ await g() ? (S.success(b("forms.common.deleted", {
366
+ name: A.title,
367
+ feature: c
368
+ })), x(i)) : S.error(b("forms.common.notDeleted", {
369
+ name: A.title,
370
+ feature: c
371
+ }));
372
+ } catch (e) {
373
+ console.error("Failed to delete entity", e), S.error(b("forms.common.notDeleted", {
374
+ name: A.title,
375
+ feature: c
376
+ }));
377
+ }
378
+ w(!1);
379
+ }
380
+ }
381
+ let z = A.enabled === 1, ne = !d, re = !(f && !t), B = !A.title.trim(), ie = !t && !E.isDirty, ae = B || ie, V = [...v ?? [], ...g && !d ? [{
382
+ label: b("forms.formActions.delete"),
383
+ icon: he,
384
+ tone: "destructive",
385
+ onSelect: () => w(!0)
386
+ }] : []];
387
+ return /* @__PURE__ */ L(F, { children: [
388
+ /* @__PURE__ */ I(Q, {
389
+ eyebrow: /* @__PURE__ */ L("span", {
390
+ className: "inline-flex items-center gap-2",
391
+ children: [/* @__PURE__ */ I(Z, {
392
+ to: i,
393
+ children: r
394
+ }), !d && /* @__PURE__ */ I(Le, {
395
+ titleMissing: B,
396
+ dirty: t || E.isDirty
397
+ })]
398
+ }),
399
+ leading: /* @__PURE__ */ I(Fe, {
400
+ value: A.icon,
401
+ onChange: (e) => R({ icon: e }),
402
+ onClear: () => R({ icon: null }),
403
+ defaultIcon: a,
404
+ tone: o,
405
+ title: A.title,
406
+ description: A.description,
407
+ readOnly: d || u
408
+ }),
409
+ title: /* @__PURE__ */ I(Ie, {
410
+ value: A.title,
411
+ onSave: (e) => R({ title: e }),
412
+ placeholder: n,
413
+ className: "text-3xl font-semibold tracking-tight md:text-4xl",
414
+ ariaLabel: b("forms.common.title"),
415
+ autoFocus: t,
416
+ commitOnChange: t,
417
+ readOnly: d
418
+ }),
419
+ subtitle: /* @__PURE__ */ I(Ie, {
420
+ value: A.description,
421
+ onSave: (e) => R({ description: e }),
422
+ multiline: !0,
423
+ placeholder: b("forms.common.description"),
424
+ className: "max-w-2xl text-sm text-muted-foreground",
425
+ ariaLabel: b("forms.common.description"),
426
+ commitOnChange: t,
427
+ readOnly: d
428
+ }),
429
+ trailing: /* @__PURE__ */ L(F, { children: [
430
+ ne && /* @__PURE__ */ L("div", {
431
+ className: "bento-fade-out flex shrink-0 items-center gap-2",
432
+ children: [re && /* @__PURE__ */ L(_, {
433
+ type: "submit",
434
+ form: s,
435
+ size: "sm",
436
+ loading: E.isSubmitting,
437
+ disabled: ae,
438
+ children: [/* @__PURE__ */ I(H, { className: "size-4" }), b("forms.formActions.saveChanges")]
439
+ }), /* @__PURE__ */ L(_, {
440
+ type: "button",
441
+ size: "sm",
442
+ variant: "outline",
443
+ onClick: () => x(i),
444
+ children: [/* @__PURE__ */ I(W, { className: "size-4" }), b("forms.formActions.cancel")]
445
+ })]
446
+ }),
447
+ p,
448
+ l && (d ? /* @__PURE__ */ L("span", {
449
+ className: `flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${z ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
450
+ children: [/* @__PURE__ */ I("span", { className: `h-1.5 w-1.5 rounded-full ${z ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), z ? b("common.active", { defaultValue: "Active" }) : b("common.idle", { defaultValue: "Idle" })]
451
+ }) : /* @__PURE__ */ L("button", {
452
+ type: "button",
453
+ onClick: () => R({ enabled: +!z }),
454
+ "aria-label": b("forms.common.enabled"),
455
+ title: b(z ? "common.activeToggleHint" : "common.idleToggleHint"),
456
+ className: `bento-tile-clickable flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider transition-colors duration-200 ${z ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground hover:bg-muted/80"}`,
457
+ children: [/* @__PURE__ */ I("span", { className: `h-1.5 w-1.5 rounded-full ${z ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), z ? b("common.active", { defaultValue: "Active" }) : b("common.idle", { defaultValue: "Idle" })]
458
+ })),
459
+ !t && V.length > 0 && /* @__PURE__ */ I(je, { actions: V })
460
+ ] })
461
+ }),
462
+ /* @__PURE__ */ I("div", {
463
+ ref: O,
464
+ "aria-hidden": !0,
465
+ className: "h-px"
466
+ }),
467
+ m,
468
+ !t && g && /* @__PURE__ */ I(T, {
469
+ feature: c,
470
+ name: A.title,
471
+ onDelete: te,
472
+ open: C,
473
+ setOpen: w,
474
+ trigger: /* @__PURE__ */ I("span", {
475
+ className: "hidden",
476
+ "aria-hidden": !0
477
+ })
478
+ }),
479
+ y({
480
+ staged: A,
481
+ onStateChange: D
482
+ })
483
+ ] });
484
+ }
485
+ //#endregion
486
+ //#region src/bento/bento-layout.ts
487
+ var Ve = {
488
+ LARGE: "col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2",
489
+ MEDIUM: "col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1",
490
+ SMALL: "col-span-1 row-span-1"
491
+ }, He = {
492
+ SMALL: "MEDIUM",
493
+ MEDIUM: "LARGE",
494
+ LARGE: "SMALL"
495
+ };
496
+ function Ue(e, t, n) {
497
+ if (!n || n.length === 0) return e.map((e, n) => ({
498
+ item: e,
499
+ key: t(e),
500
+ emphasis: n === 0 ? "LARGE" : "MEDIUM"
501
+ }));
502
+ let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
503
+ for (let e of n) r.set(e.itemId, e.displayOrder), i.set(e.itemId, e.emphasis);
504
+ return e.map((e, n) => ({
505
+ item: e,
506
+ key: t(e),
507
+ idx: n
508
+ })).sort((e, t) => {
509
+ 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;
510
+ return n === i ? e.idx - t.idx : n - i;
511
+ }).map(({ item: e, key: t }) => ({
512
+ item: e,
513
+ key: t,
514
+ emphasis: i.get(t) ?? "MEDIUM"
515
+ }));
516
+ }
517
+ function We(e) {
518
+ return e.map((e, t) => ({
519
+ itemId: e.key,
520
+ emphasis: e.emphasis,
521
+ displayOrder: t
522
+ }));
523
+ }
524
+ //#endregion
525
+ //#region src/bento/bento-entity-tile.tsx
526
+ function Ge({ to: e, emphasis: t, featured: n, defaultIcon: r, icon: i, tone: a = "indigo", title: o, description: s, meta: c, enabled: l, hasStatus: u = !1, viewTransitionName: d }) {
527
+ let { t: f } = G(), p = X(a), m = t ?? (n ? "LARGE" : "MEDIUM"), h = m === "LARGE", g = m === "SMALL", _ = Ve[m], v = l === 1, y = h ? "p-6 md:p-7" : g ? "p-4" : "p-5", b = h ? "h-14 w-14" : g ? "h-8 w-8" : "h-9 w-9", x = h ? 28 : g ? 16 : 18, S = h ? "text-xl md:text-2xl" : g ? "text-sm" : "text-base md:text-lg";
528
+ return /* @__PURE__ */ L(q, {
529
+ to: e,
530
+ className: `bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${h ? "gap-5" : "gap-4"} overflow-hidden ${y} ${_}`,
531
+ style: d ? { viewTransitionName: d } : void 0,
532
+ children: [
533
+ h && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
534
+ "aria-hidden": !0,
535
+ className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${p} opacity-40 blur-2xl dark:opacity-50`
536
+ }), /* @__PURE__ */ I("div", {
537
+ "aria-hidden": !0,
538
+ className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${p} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`
539
+ })] }),
540
+ /* @__PURE__ */ L("div", {
541
+ className: "relative z-1 flex items-center justify-between",
542
+ children: [/* @__PURE__ */ I("span", {
543
+ className: `grid place-items-center rounded-2xl ${p} text-white shadow-md ${b}`,
544
+ children: i ? /* @__PURE__ */ I(K, {
545
+ icon: i,
546
+ className: h ? "size-7 text-white" : "size-4.5 text-white"
547
+ }) : /* @__PURE__ */ I(r, { size: x })
548
+ }), u && /* @__PURE__ */ L("span", {
549
+ className: `flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${v ? "bento-status bento-status-on" : "border-border bg-muted text-muted-foreground"}`,
550
+ children: [/* @__PURE__ */ I("span", { className: `h-1.5 w-1.5 rounded-full ${v ? "bento-status-dot bento-pulse" : "bg-muted-foreground/60"}` }), v ? f("common.active", { defaultValue: "Active" }) : f("common.idle", { defaultValue: "Idle" })]
551
+ })]
552
+ }),
553
+ /* @__PURE__ */ L("div", {
554
+ className: "relative z-1",
555
+ children: [
556
+ /* @__PURE__ */ I("div", {
557
+ className: `font-semibold tracking-tight ${S}`,
558
+ children: o
559
+ }),
560
+ !g && c && /* @__PURE__ */ I("div", {
561
+ className: "mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",
562
+ children: c
563
+ }),
564
+ !g && s && /* @__PURE__ */ I("p", {
565
+ className: "mt-2 text-sm text-muted-foreground",
566
+ children: s
567
+ })
568
+ ]
569
+ })
570
+ ]
571
+ });
572
+ }
573
+ //#endregion
574
+ //#region src/bento/bento-list-page.tsx
575
+ 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";
576
+ function qe({ items: e, error: t, tryAgainUrl: n, listId: r, eyebrow: i, backTo: a, backLabel: o, heroIcon: s, title: c, subtitle: l, tone: u = "indigo", headerAction: d, newRoute: f, newLabel: p, newSubtitle: m, hideNew: h = !1, itemKey: g, renderTile: _, emptyTitle: v, emptyDescription: y, layout: x }) {
577
+ let { t: S } = G(), C = X(u), [w, T] = P(!1), D = M(() => Ue(e ?? [], g, x?.data?.entries), [
578
+ e,
579
+ g,
580
+ x?.data?.entries
581
+ ]), O = !!r && !!x && (e?.length ?? 0) > 0;
582
+ return /* @__PURE__ */ L(E, {
583
+ checkIsNotUndefined: e,
584
+ error: t ?? null,
585
+ tryAgainUrl: n,
586
+ children: [
587
+ /* @__PURE__ */ I(Q, {
588
+ eyebrow: i,
589
+ backTo: a,
590
+ backLabel: o,
591
+ leading: /* @__PURE__ */ I("span", {
592
+ className: `grid h-12 w-12 place-items-center rounded-2xl ${C} text-white shadow-md`,
593
+ children: /* @__PURE__ */ I(s, { size: 24 })
594
+ }),
595
+ title: c,
596
+ subtitle: l
597
+ }),
598
+ (d || O && !w) && /* @__PURE__ */ L("div", {
599
+ className: "mb-4 flex flex-wrap items-center gap-2",
600
+ children: [d, O && !w && /* @__PURE__ */ L(b, {
601
+ variant: "outline",
602
+ size: "sm",
603
+ onClick: () => T(!0),
604
+ className: "ml-auto gap-2",
605
+ children: [/* @__PURE__ */ I(R, { size: 16 }), S("bento.layout.customize", { defaultValue: "Customize layout" })]
606
+ })]
607
+ }),
608
+ w && r && x ? /* @__PURE__ */ I(Xe, {
609
+ layout: x,
610
+ resolved: D,
611
+ canEditGlobal: x?.data?.canEditGlobal ?? !1,
612
+ isCustomized: x?.data?.source === "USER",
613
+ renderTile: _,
614
+ chip: C,
615
+ hideNew: h,
616
+ newRoute: f,
617
+ newLabel: p,
618
+ newSubtitle: m,
619
+ onClose: () => T(!1)
620
+ }) : /* @__PURE__ */ I(Ye, {
621
+ resolved: D,
622
+ renderTile: _,
623
+ chip: C,
624
+ hideNew: h,
625
+ newRoute: f,
626
+ newLabel: p,
627
+ newSubtitle: m,
628
+ isEmpty: e?.length === 0,
629
+ emptyTitle: v,
630
+ emptyDescription: y
631
+ })
632
+ ]
633
+ });
634
+ }
635
+ function Je({ items: e, error: t, tryAgainUrl: n, tone: r = "indigo", newRoute: i, newLabel: a, newSubtitle: o, hideNew: s = !1, itemKey: c, renderTile: l, emptyTitle: u, emptyDescription: d }) {
636
+ let f = X(r);
637
+ return /* @__PURE__ */ I(E, {
638
+ checkIsNotUndefined: e,
639
+ error: t ?? null,
640
+ tryAgainUrl: n,
641
+ children: /* @__PURE__ */ L("div", {
642
+ className: Ke,
643
+ children: [
644
+ !s && i && a ? /* @__PURE__ */ I(et, {
645
+ route: i,
646
+ label: a,
647
+ subtitle: o,
648
+ chip: f
649
+ }) : null,
650
+ (e ?? []).map((e) => /* @__PURE__ */ I("span", {
651
+ className: "contents",
652
+ children: l(e)
653
+ }, c(e))),
654
+ e?.length === 0 && /* @__PURE__ */ I(tt, {
655
+ title: u,
656
+ description: d
657
+ })
658
+ ]
659
+ })
660
+ });
661
+ }
662
+ function Ye({ resolved: e, renderTile: t, chip: n, hideNew: r, newRoute: i, newLabel: o, newSubtitle: s, isEmpty: c, emptyTitle: l, emptyDescription: u }) {
663
+ let d = e.some((e) => e.emphasis === "SMALL");
664
+ return /* @__PURE__ */ L("div", {
665
+ className: a(Ke, d && "grid-flow-dense"),
666
+ children: [
667
+ !r && /* @__PURE__ */ I(et, {
668
+ route: i,
669
+ label: o,
670
+ subtitle: s,
671
+ chip: n
672
+ }),
673
+ e.map(({ item: e, key: n, emphasis: r }) => /* @__PURE__ */ I("span", {
674
+ className: "contents",
675
+ children: t(e, r)
676
+ }, n)),
677
+ c && /* @__PURE__ */ I(tt, {
678
+ title: l,
679
+ description: u
680
+ })
681
+ ]
682
+ });
683
+ }
684
+ function Xe({ layout: e, resolved: t, canEditGlobal: n, isCustomized: r, renderTile: i, chip: o, hideNew: s, newRoute: c, newLabel: l, newSubtitle: u, onClose: d }) {
685
+ let { t: f } = G(), [p, m] = P(t), h = e.saving ?? !1, [g, _] = P(!1), v = (e) => async () => {
686
+ if (e) {
687
+ _(!1);
688
+ try {
689
+ await e(), d();
690
+ } catch (e) {
691
+ console.error("Failed to save the bento layout", e), _(!0);
692
+ }
693
+ }
694
+ }, y = we(Ce(xe, { activationConstraint: { distance: 8 } }), Ce(be));
695
+ function x(e) {
696
+ let { active: t, over: n } = e;
697
+ !n || t.id === n.id || m((e) => {
698
+ let r = e.findIndex((e) => e.key === t.id), i = e.findIndex((e) => e.key === n.id);
699
+ return r < 0 || i < 0 ? e : Ee(e, r, i);
700
+ });
701
+ }
702
+ function S(e, t) {
703
+ m((n) => n.map((n) => n.key === e ? {
704
+ ...n,
705
+ emphasis: t
706
+ } : n));
707
+ }
708
+ let C = M(() => We(p), [p]), w = p.some((e) => e.emphasis === "SMALL");
709
+ return /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ L("div", {
710
+ className: "mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md",
711
+ children: [
712
+ /* @__PURE__ */ I("span", {
713
+ className: "mr-auto text-sm text-muted-foreground",
714
+ children: f("bento.layout.editHint", { defaultValue: "Drag tiles to reorder · tap the size button to resize" })
715
+ }),
716
+ r && e.onReset && /* @__PURE__ */ L(b, {
717
+ variant: "ghost",
718
+ size: "sm",
719
+ className: "gap-2",
720
+ disabled: h,
721
+ onClick: v(e.onReset),
722
+ children: [/* @__PURE__ */ I(z, { size: 16 }), f("bento.layout.reset", { defaultValue: "Reset to default" })]
723
+ }),
724
+ n && e.onSaveGlobal && /* @__PURE__ */ L(b, {
725
+ variant: "outline",
726
+ size: "sm",
727
+ className: "gap-2",
728
+ disabled: h,
729
+ onClick: v(() => e.onSaveGlobal?.(C)),
730
+ children: [/* @__PURE__ */ I(_e, { size: 16 }), f("bento.layout.saveGlobal", { defaultValue: "Set as default for everyone" })]
731
+ }),
732
+ /* @__PURE__ */ L(b, {
733
+ variant: "ghost",
734
+ size: "sm",
735
+ className: "gap-2",
736
+ disabled: h,
737
+ onClick: d,
738
+ children: [/* @__PURE__ */ I(W, { size: 16 }), f("common.cancel", { defaultValue: "Cancel" })]
739
+ }),
740
+ /* @__PURE__ */ L(b, {
741
+ size: "sm",
742
+ className: "gap-2",
743
+ disabled: h,
744
+ onClick: v(() => e.onSave(C)),
745
+ children: [/* @__PURE__ */ I(H, { size: 16 }), f("bento.layout.save", { defaultValue: "Save layout" })]
746
+ }),
747
+ g && /* @__PURE__ */ I("p", {
748
+ role: "alert",
749
+ className: "w-full text-sm text-destructive",
750
+ children: f("bento.layout.saveFailed", { defaultValue: "The layout could not be saved. Nothing has changed — try again." })
751
+ })
752
+ ]
753
+ }), /* @__PURE__ */ I(ye, {
754
+ sensors: y,
755
+ collisionDetection: Se,
756
+ onDragEnd: x,
757
+ children: /* @__PURE__ */ I(Te, {
758
+ items: p.map((e) => e.key),
759
+ strategy: De,
760
+ children: /* @__PURE__ */ L("div", {
761
+ className: a(Ke, w && "grid-flow-dense"),
762
+ children: [!s && /* @__PURE__ */ I(et, {
763
+ route: c,
764
+ label: l,
765
+ subtitle: u,
766
+ chip: o
767
+ }), p.map(({ item: e, key: t, emphasis: n }) => /* @__PURE__ */ I($e, {
768
+ id: t,
769
+ emphasis: n,
770
+ onSetEmphasis: (e) => S(t, e),
771
+ children: i(e, n)
772
+ }, t))]
773
+ })
774
+ })
775
+ })] });
776
+ }
777
+ var Ze = [
778
+ "SMALL",
779
+ "MEDIUM",
780
+ "LARGE"
781
+ ], Qe = {
782
+ SMALL: {
783
+ key: "bento.layout.size.small",
784
+ def: "Small"
785
+ },
786
+ MEDIUM: {
787
+ key: "bento.layout.size.medium",
788
+ def: "Medium"
789
+ },
790
+ LARGE: {
791
+ key: "bento.layout.size.large",
792
+ def: "Large"
793
+ }
794
+ };
795
+ function $e({ id: e, emphasis: t, onSetEmphasis: n, children: r }) {
796
+ let { t: i } = G(), { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } = Oe({ id: e }), f = {
797
+ transform: ke.Translate.toString(l),
798
+ transition: u,
799
+ opacity: d ? .6 : 1,
800
+ zIndex: d ? 50 : void 0
801
+ };
802
+ return /* @__PURE__ */ L("div", {
803
+ ref: c,
804
+ style: f,
805
+ className: a("relative h-full", Ve[t]),
806
+ children: [/* @__PURE__ */ I("div", {
807
+ className: "pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full",
808
+ children: r
809
+ }), /* @__PURE__ */ L("div", {
810
+ className: "absolute right-2 top-2 z-10 flex items-center gap-1",
811
+ children: [/* @__PURE__ */ I("div", {
812
+ role: "group",
813
+ "aria-label": i("bento.layout.sizeGroup", { defaultValue: "Tile size" }),
814
+ className: "flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur",
815
+ children: Ze.map((e) => {
816
+ let r = e === t, o = i(Qe[e].key, { defaultValue: Qe[e].def });
817
+ return /* @__PURE__ */ I("button", {
818
+ type: "button",
819
+ onClick: () => n(e),
820
+ "aria-pressed": r,
821
+ "aria-label": o,
822
+ title: o,
823
+ className: a("grid h-6 w-6 place-items-center rounded-full text-[11px] font-semibold uppercase transition-colors", r ? "bg-primary text-primary-foreground shadow" : "text-muted-foreground hover:bg-muted"),
824
+ children: o.charAt(0)
825
+ }, e);
826
+ })
827
+ }), /* @__PURE__ */ I("button", {
828
+ type: "button",
829
+ ...o,
830
+ ...s,
831
+ "aria-label": i("bento.layout.dragToReorder", { defaultValue: "Drag to reorder" }),
832
+ className: "grid h-7 w-7 cursor-grab place-items-center rounded-full border border-border/60 bg-background/80 shadow-sm backdrop-blur hover:bg-background active:cursor-grabbing",
833
+ children: /* @__PURE__ */ I(ce, {
834
+ size: 14,
835
+ className: "text-muted-foreground"
836
+ })
837
+ })]
838
+ })]
839
+ });
840
+ }
841
+ function et({ route: e, label: t, subtitle: n, chip: r }) {
842
+ let { t: i } = G();
843
+ return /* @__PURE__ */ L(q, {
844
+ to: e,
845
+ className: "bento-tile bento-tile-clickable col-span-2 row-span-1 flex flex-col gap-3 rounded-3xl border-2 border-dashed border-border/60 bg-card/30 p-5 backdrop-blur-md bento-new-tile hover:bg-card/50 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1",
846
+ children: [/* @__PURE__ */ L("div", {
847
+ className: "flex items-center gap-3",
848
+ children: [/* @__PURE__ */ I("span", {
849
+ className: `bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,
850
+ children: /* @__PURE__ */ I(pe, { size: 20 })
851
+ }), /* @__PURE__ */ I("span", {
852
+ className: "text-[11px] uppercase tracking-wider text-muted-foreground",
853
+ children: i("forms.formActions.new", { defaultValue: "New" })
854
+ })]
855
+ }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("div", {
856
+ className: "text-base font-semibold tracking-tight md:text-lg",
857
+ children: /* @__PURE__ */ I("span", {
858
+ className: `${r} bg-clip-text text-transparent`,
859
+ children: t
860
+ })
861
+ }), n && /* @__PURE__ */ I("p", {
862
+ className: "mt-1 text-sm text-muted-foreground",
863
+ children: n
864
+ })] })]
865
+ });
866
+ }
867
+ function tt({ title: e, description: t }) {
868
+ return /* @__PURE__ */ I(Pe, {
869
+ icon: U,
870
+ title: e,
871
+ description: t,
872
+ align: "start",
873
+ className: "col-span-2 row-span-2 justify-end md:col-span-4"
874
+ });
875
+ }
876
+ //#endregion
877
+ //#region src/bento/bento-save-bar.tsx
878
+ function nt({ title: e, badges: t, actions: n, onCancel: r, loading: i, disabled: a, dirty: o, titleMissing: s }) {
879
+ let { t: c } = G();
880
+ return /* @__PURE__ */ L("div", {
881
+ className: "bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl",
882
+ children: [/* @__PURE__ */ L("div", {
883
+ className: "flex min-w-0 items-center gap-3",
884
+ children: [
885
+ e && /* @__PURE__ */ I("p", {
886
+ className: "truncate text-base font-semibold tracking-tight md:text-lg",
887
+ children: e
888
+ }),
889
+ /* @__PURE__ */ I(Le, {
890
+ titleMissing: s,
891
+ dirty: o
892
+ }),
893
+ t && /* @__PURE__ */ I("div", {
894
+ className: "flex shrink-0 items-center gap-1.5",
895
+ children: t
896
+ })
897
+ ]
898
+ }), /* @__PURE__ */ I("div", {
899
+ className: "flex shrink-0 gap-2",
900
+ children: n ?? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ L(_, {
901
+ type: "submit",
902
+ size: "sm",
903
+ loading: i,
904
+ disabled: a,
905
+ children: [/* @__PURE__ */ I(H, { className: "size-4" }), c("forms.formActions.saveChanges")]
906
+ }), r && /* @__PURE__ */ L(_, {
907
+ type: "button",
908
+ variant: "outline",
909
+ size: "sm",
910
+ onClick: r,
911
+ children: [/* @__PURE__ */ I(W, { className: "size-4" }), c("forms.formActions.cancel")]
912
+ })] })
913
+ })]
914
+ });
915
+ }
916
+ function rt({ children: e }) {
917
+ return /* @__PURE__ */ I("span", {
918
+ className: "rounded-full border border-border/60 bg-card/50 px-2 py-0.5 text-[10px] uppercase tracking-wider text-muted-foreground backdrop-blur",
919
+ children: e
920
+ });
921
+ }
922
+ nt.Badge = rt;
923
+ //#endregion
924
+ //#region src/bento/bento-scroll-save-bar.tsx
925
+ function it(e) {
926
+ let t = N(null);
927
+ return Re(t), /* @__PURE__ */ L(F, { children: [
928
+ /* @__PURE__ */ I("div", {
929
+ ref: t,
930
+ "aria-hidden": !0,
931
+ className: "h-px"
932
+ }),
933
+ /* @__PURE__ */ I("div", {
934
+ "aria-hidden": !0,
935
+ className: "bento-save-bar-spacer"
936
+ }),
937
+ /* @__PURE__ */ I("div", {
938
+ className: "bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8",
939
+ children: /* @__PURE__ */ I(nt, { ...e })
940
+ })
941
+ ] });
942
+ }
943
+ //#endregion
944
+ //#region src/bento/bento-form-hero.tsx
945
+ function at({ eyebrow: e, backTo: t, backLabel: n, leading: r, title: i, subtitle: a, trailing: o, onCancel: s, actions: c, loading: l, dirty: u, titleMissing: d, saveDisabled: f, stickyTitle: p, stickyBadges: m }) {
946
+ let { t: h } = G(), g = f ?? (!!d || !u);
947
+ return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(Q, {
948
+ eyebrow: t === void 0 ? e : /* @__PURE__ */ I(Z, {
949
+ to: t,
950
+ children: n
951
+ }),
952
+ leading: r,
953
+ title: i,
954
+ subtitle: a,
955
+ trailing: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
956
+ className: "bento-fade-out flex shrink-0 items-center gap-2",
957
+ children: c ?? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ L(_, {
958
+ type: "submit",
959
+ size: "sm",
960
+ loading: l,
961
+ disabled: g,
962
+ children: [/* @__PURE__ */ I(H, { className: "size-4" }), h("forms.formActions.saveChanges")]
963
+ }), /* @__PURE__ */ L(_, {
964
+ type: "button",
965
+ variant: "outline",
966
+ size: "sm",
967
+ onClick: s,
968
+ children: [/* @__PURE__ */ I(W, { className: "size-4" }), h("forms.formActions.cancel")]
969
+ })] })
970
+ }), o] })
971
+ }), /* @__PURE__ */ I(it, {
972
+ title: p,
973
+ badges: m,
974
+ actions: c,
975
+ onCancel: s,
976
+ loading: l,
977
+ disabled: g,
978
+ dirty: u,
979
+ titleMissing: d
980
+ })] });
981
+ }
982
+ //#endregion
983
+ //#region src/bento/bento-form-section.tsx
984
+ function ot({ icon: e, tone: t, title: n, description: r, children: i, trailing: a, as: o = "h2" }) {
985
+ return /* @__PURE__ */ L("section", {
986
+ className: "bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6",
987
+ children: [/* @__PURE__ */ L("header", {
988
+ className: "flex items-start justify-between gap-3",
989
+ children: [/* @__PURE__ */ L("div", {
990
+ className: "flex items-center gap-3",
991
+ children: [/* @__PURE__ */ I("span", {
992
+ className: `grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${X(t)}`,
993
+ children: /* @__PURE__ */ I(e, { size: 20 })
994
+ }), /* @__PURE__ */ L("div", {
995
+ className: "flex flex-col gap-0.5",
996
+ children: [/* @__PURE__ */ I(o, {
997
+ className: "text-base font-semibold tracking-tight md:text-lg",
998
+ children: n
999
+ }), r && /* @__PURE__ */ I("p", {
1000
+ className: "text-sm text-muted-foreground",
1001
+ children: r
1002
+ })]
1003
+ })]
1004
+ }), a && /* @__PURE__ */ I("div", {
1005
+ className: "shrink-0",
1006
+ children: a
1007
+ })]
1008
+ }), /* @__PURE__ */ I("div", {
1009
+ className: "flex flex-col gap-5",
1010
+ children: i
1011
+ })]
1012
+ });
1013
+ }
1014
+ //#endregion
1015
+ //#region src/bento/bento-back-to-top.tsx
1016
+ var st = 480;
1017
+ function ct(e) {
1018
+ return window.addEventListener("scroll", e, { passive: !0 }), () => window.removeEventListener("scroll", e);
1019
+ }
1020
+ function lt() {
1021
+ return window.scrollY > st;
1022
+ }
1023
+ function ut() {
1024
+ let e = ee(ct, lt, () => !1);
1025
+ return /* @__PURE__ */ I("button", {
1026
+ type: "button",
1027
+ "aria-label": "Back to top",
1028
+ tabIndex: e ? 0 : -1,
1029
+ onClick: () => window.scrollTo({
1030
+ top: 0,
1031
+ behavior: "smooth"
1032
+ }),
1033
+ 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 ${e ? "translate-y-0 scale-100 opacity-100" : "pointer-events-none translate-y-4 scale-90 opacity-0"}`,
1034
+ children: /* @__PURE__ */ I(B, { size: 18 })
1035
+ });
1036
+ }
1037
+ //#endregion
1038
+ //#region src/bento/bento-nav.ts
1039
+ function dt(e) {
1040
+ return e.bentoRoute ?? e.fallbackRoute;
1041
+ }
1042
+ //#endregion
1043
+ //#region src/bento/bento-command-palette.tsx
1044
+ function ft({ open: n, onOpenChange: i, items: a }) {
1045
+ let { t: o } = G(), s = J(), [c, l] = P(""), [u, d] = P(0), p = N(null), m = M(() => {
1046
+ let e = c.trim().toLowerCase(), t = a.map((e) => ({
1047
+ item: e,
1048
+ label: o(e.titleKey),
1049
+ description: o(e.descriptionKey)
1050
+ }));
1051
+ if (!e) return t;
1052
+ let n = [], r = [];
1053
+ for (let i of t) i.label.toLowerCase().includes(e) ? n.push(i) : i.description.toLowerCase().includes(e) && r.push(i);
1054
+ return [...n, ...r];
1055
+ }, [
1056
+ a,
1057
+ c,
1058
+ o
1059
+ ]), [h, g] = P(n);
1060
+ n !== h && (g(n), n && (l(""), d(0)));
1061
+ let _ = m.length === 0 ? 0 : m.length - 1;
1062
+ u > _ && d(_), j(() => {
1063
+ (p.current?.querySelector(`[data-index="${u}"]`))?.scrollIntoView({ block: "nearest" });
1064
+ }, [u]);
1065
+ function v(e) {
1066
+ i(!1), s(dt(e));
1067
+ }
1068
+ function y(e) {
1069
+ if (e.key === "ArrowDown") e.preventDefault(), d((e) => m.length === 0 ? 0 : (e + 1) % m.length);
1070
+ else if (e.key === "ArrowUp") e.preventDefault(), d((e) => m.length === 0 ? 0 : (e - 1 + m.length) % m.length);
1071
+ else if (e.key === "Enter") {
1072
+ e.preventDefault();
1073
+ let t = m[u];
1074
+ t && v(t.item);
1075
+ }
1076
+ }
1077
+ return /* @__PURE__ */ I(t, {
1078
+ open: n,
1079
+ onOpenChange: i,
1080
+ children: /* @__PURE__ */ L(f, {
1081
+ showCloseButton: !1,
1082
+ className: "top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0",
1083
+ onKeyDown: y,
1084
+ children: [
1085
+ /* @__PURE__ */ I(r, {
1086
+ className: "sr-only",
1087
+ children: o("bento.palette.title", { defaultValue: "Command palette" })
1088
+ }),
1089
+ /* @__PURE__ */ I(e, {
1090
+ className: "sr-only",
1091
+ children: o("bento.palette.description", { defaultValue: "Search and jump to any area" })
1092
+ }),
1093
+ /* @__PURE__ */ L("div", {
1094
+ className: "flex items-center gap-3 border-b border-border/60 px-4",
1095
+ children: [/* @__PURE__ */ I(me, {
1096
+ size: 18,
1097
+ className: "shrink-0 text-muted-foreground"
1098
+ }), /* @__PURE__ */ I("input", {
1099
+ autoFocus: !0,
1100
+ type: "text",
1101
+ role: "combobox",
1102
+ "aria-expanded": "true",
1103
+ "aria-controls": "bento-palette-list",
1104
+ "aria-activedescendant": m[u] ? `bento-palette-opt-${u}` : void 0,
1105
+ value: c,
1106
+ onChange: (e) => l(e.target.value),
1107
+ placeholder: o("bento.palette.placeholder", { defaultValue: "Search areas…" }),
1108
+ className: "h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
1109
+ })]
1110
+ }),
1111
+ /* @__PURE__ */ L("div", {
1112
+ ref: p,
1113
+ id: "bento-palette-list",
1114
+ role: "listbox",
1115
+ "aria-label": o("bento.palette.title", { defaultValue: "Command palette" }),
1116
+ className: "max-h-80 overflow-y-auto p-2",
1117
+ children: [m.length === 0 && /* @__PURE__ */ I("p", {
1118
+ className: "px-3 py-6 text-center text-sm text-muted-foreground",
1119
+ children: o("bento.palette.noResults", { defaultValue: "No matches" })
1120
+ }), m.map(({ item: e, label: t }, n) => {
1121
+ let r = !e.bentoRoute, i = n === u, a = e.icon;
1122
+ return /* @__PURE__ */ L("button", {
1123
+ type: "button",
1124
+ id: `bento-palette-opt-${n}`,
1125
+ "data-index": n,
1126
+ role: "option",
1127
+ "aria-selected": i ? "true" : "false",
1128
+ onMouseEnter: () => d(n),
1129
+ onClick: () => v(e),
1130
+ className: `flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${i ? "bg-accent text-accent-foreground" : "text-foreground"}`,
1131
+ children: [
1132
+ /* @__PURE__ */ I(a, {
1133
+ size: 18,
1134
+ className: "shrink-0 text-muted-foreground"
1135
+ }),
1136
+ /* @__PURE__ */ I("span", {
1137
+ className: "flex-1 truncate",
1138
+ children: t
1139
+ }),
1140
+ r ? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(se, {
1141
+ "aria-hidden": !0,
1142
+ size: 15,
1143
+ className: "shrink-0 text-muted-foreground/70"
1144
+ }), /* @__PURE__ */ I("span", {
1145
+ className: "sr-only",
1146
+ children: o("bento.palette.opensConsole", { defaultValue: "Opens in console" })
1147
+ })] }) : i && /* @__PURE__ */ I(re, {
1148
+ "aria-hidden": !0,
1149
+ size: 15,
1150
+ className: "shrink-0 text-muted-foreground"
1151
+ })
1152
+ ]
1153
+ }, e.id);
1154
+ })]
1155
+ })
1156
+ ]
1157
+ })
1158
+ });
1159
+ }
1160
+ //#endregion
1161
+ //#region src/bento/bento-shortcuts-dialog.tsx
1162
+ function pt({ open: n, onOpenChange: a, isMac: o }) {
1163
+ let { t: s } = G(), c = o ? "⌘" : "Ctrl", l = [{
1164
+ heading: s("bento.shortcuts.global", { defaultValue: "Global" }),
1165
+ rows: [{
1166
+ keys: [c, "K"],
1167
+ label: s("bento.palette.open", { defaultValue: "Open command palette" })
1168
+ }, {
1169
+ keys: ["?"],
1170
+ label: s("bento.shortcuts.openGuide", { defaultValue: "Show keyboard shortcuts" })
1171
+ }]
1172
+ }, {
1173
+ heading: s("bento.shortcuts.palette", { defaultValue: "Command palette" }),
1174
+ rows: [
1175
+ {
1176
+ keys: ["↑", "↓"],
1177
+ label: s("bento.shortcuts.navigate", { defaultValue: "Move between results" })
1178
+ },
1179
+ {
1180
+ keys: ["↵"],
1181
+ label: s("bento.shortcuts.openSelected", { defaultValue: "Open the selected area" })
1182
+ },
1183
+ {
1184
+ keys: ["Esc"],
1185
+ label: s("bento.shortcuts.dismiss", { defaultValue: "Close the palette or a dialog" })
1186
+ }
1187
+ ]
1188
+ }];
1189
+ return /* @__PURE__ */ I(t, {
1190
+ open: n,
1191
+ onOpenChange: a,
1192
+ children: /* @__PURE__ */ L(f, {
1193
+ className: "max-w-md",
1194
+ children: [/* @__PURE__ */ L(i, { children: [/* @__PURE__ */ L(r, {
1195
+ className: "flex items-center gap-2",
1196
+ children: [/* @__PURE__ */ I(ue, {
1197
+ size: 20,
1198
+ className: "bento-accent-icon"
1199
+ }), s("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
1200
+ }), /* @__PURE__ */ I(e, { children: s("bento.shortcuts.description", { defaultValue: "Move around Turing without leaving the keyboard." }) })] }), /* @__PURE__ */ I("div", {
1201
+ className: "flex flex-col gap-5",
1202
+ children: l.map((e) => /* @__PURE__ */ L("section", { children: [/* @__PURE__ */ I("h3", {
1203
+ className: "mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
1204
+ children: e.heading
1205
+ }), /* @__PURE__ */ I("ul", {
1206
+ className: "flex flex-col gap-1.5",
1207
+ children: e.rows.map((e) => /* @__PURE__ */ L("li", {
1208
+ className: "flex items-center justify-between gap-4",
1209
+ children: [/* @__PURE__ */ I("span", {
1210
+ className: "text-sm text-foreground",
1211
+ children: e.label
1212
+ }), /* @__PURE__ */ I("span", {
1213
+ className: "flex shrink-0 items-center gap-1",
1214
+ children: e.keys.map((e) => /* @__PURE__ */ I("kbd", {
1215
+ 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",
1216
+ children: e
1217
+ }, e))
1218
+ })]
1219
+ }, e.label))
1220
+ })] }, e.heading))
1221
+ })]
1222
+ })
1223
+ });
1224
+ }
1225
+ //#endregion
1226
+ //#region src/bento/bento-nav-rail.tsx
1227
+ function mt(e, t) {
1228
+ return e === t || e.startsWith(`${t}/`);
1229
+ }
1230
+ function ht(e, t) {
1231
+ return t.section.areaRoute && mt(e, t.section.areaRoute) ? !0 : t.items.some((t) => t.bentoRoute && mt(e, t.bentoRoute));
1232
+ }
1233
+ function gt({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
1234
+ let { t: i } = G(), { pathname: a } = ve(), o = M(() => e.filter((e) => e.section.areaRoute), [e]), s = a === t || (n?.includes(a) ?? !1);
1235
+ return /* @__PURE__ */ I(h, {
1236
+ delayDuration: 200,
1237
+ children: /* @__PURE__ */ L("nav", {
1238
+ "aria-label": i("bento.nav.label", { defaultValue: "Primary" }),
1239
+ 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",
1240
+ children: [
1241
+ /* @__PURE__ */ I(_t, {
1242
+ to: t,
1243
+ icon: le,
1244
+ label: r ?? i("home.title", { defaultValue: "Home" }),
1245
+ active: s
1246
+ }),
1247
+ o.length > 0 && /* @__PURE__ */ I("span", {
1248
+ "aria-hidden": !0,
1249
+ className: "my-1 h-px w-6 bg-border/60"
1250
+ }),
1251
+ o.map((e) => /* @__PURE__ */ I(_t, {
1252
+ to: e.section.areaRoute,
1253
+ icon: e.section.icon,
1254
+ label: i(e.section.labelKey),
1255
+ active: ht(a, e)
1256
+ }, e.section.id))
1257
+ ]
1258
+ })
1259
+ });
1260
+ }
1261
+ function _t({ to: e, icon: t, label: n, active: r }) {
1262
+ return /* @__PURE__ */ L(d, { children: [/* @__PURE__ */ I(g, {
1263
+ asChild: !0,
1264
+ children: /* @__PURE__ */ I(q, {
1265
+ to: e,
1266
+ "aria-label": n,
1267
+ "aria-current": r ? "page" : void 0,
1268
+ className: `bento-tile-clickable grid h-11 w-11 shrink-0 place-items-center rounded-2xl border transition-colors duration-200 ${r ? "bento-rail-active" : "border-transparent text-muted-foreground hover:border-border/60 hover:bg-card/60 hover:text-foreground"}`,
1269
+ children: /* @__PURE__ */ I(t, { size: 20 })
1270
+ })
1271
+ }), /* @__PURE__ */ I(s, {
1272
+ side: "right",
1273
+ children: n
1274
+ })] });
1275
+ }
1276
+ //#endregion
1277
+ //#region src/bento/bento-user-menu.tsx
1278
+ function vt({ accountRoute: e, logoutUrl: t, organizationsRoute: r, tenantAdminRoute: i, onOpenShortcuts: a, onReplayTour: s }) {
1279
+ let { user: d, status: f } = x(), { t: p } = G(), h = J(), g = `${d.firstName ?? ""} ${d.lastName ?? ""}`.trim() || d.username || "";
1280
+ return f === "loading" ? /* @__PURE__ */ I("div", {
1281
+ className: "h-9 w-9 rounded-full bg-muted/40",
1282
+ "aria-hidden": !0
1283
+ }) : /* @__PURE__ */ L(c, { children: [/* @__PURE__ */ I(n, {
1284
+ asChild: !0,
1285
+ children: /* @__PURE__ */ I("button", {
1286
+ type: "button",
1287
+ title: g || d.username,
1288
+ 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",
1289
+ children: /* @__PURE__ */ I(C, {
1290
+ givenName: d.firstName,
1291
+ familyName: d.lastName,
1292
+ name: g || d.username,
1293
+ src: d.avatarUrl || void 0,
1294
+ alt: d.username
1295
+ })
1296
+ })
1297
+ }), /* @__PURE__ */ L(m, {
1298
+ align: "end",
1299
+ sideOffset: 10,
1300
+ className: "bento-dropdown min-w-64 p-2",
1301
+ children: [
1302
+ /* @__PURE__ */ I(o, {
1303
+ className: "p-0 font-normal",
1304
+ children: /* @__PURE__ */ L("div", {
1305
+ className: "flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm",
1306
+ children: [/* @__PURE__ */ I("span", {
1307
+ className: "rounded-full p-0.5 ring-1 ring-border/60",
1308
+ children: /* @__PURE__ */ I(C, {
1309
+ givenName: d.firstName,
1310
+ familyName: d.lastName,
1311
+ name: g || d.username,
1312
+ src: d.avatarUrl || void 0,
1313
+ alt: d.username
1314
+ })
1315
+ }), /* @__PURE__ */ L("div", {
1316
+ className: "grid flex-1 text-left text-sm leading-tight",
1317
+ children: [g && /* @__PURE__ */ I("span", {
1318
+ className: "truncate font-medium",
1319
+ children: g
1320
+ }), d.email && /* @__PURE__ */ I("span", {
1321
+ className: "truncate text-xs text-muted-foreground",
1322
+ children: d.email
1323
+ })]
1324
+ })]
1325
+ })
1326
+ }),
1327
+ /* @__PURE__ */ I(v, { className: "my-1.5 bg-border/50" }),
1328
+ /* @__PURE__ */ L(u, { children: [
1329
+ /* @__PURE__ */ L(l, {
1330
+ onSelect: () => h(e),
1331
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1332
+ children: [/* @__PURE__ */ I(ge, { size: 18 }), p("nav.account")]
1333
+ }),
1334
+ r && /* @__PURE__ */ L(l, {
1335
+ onSelect: () => h(r),
1336
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1337
+ children: [/* @__PURE__ */ I(ie, { size: 18 }), p("nav.organizations", { defaultValue: "Organizations" })]
1338
+ }),
1339
+ i && /* @__PURE__ */ L(l, {
1340
+ onSelect: () => h(i),
1341
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1342
+ children: [/* @__PURE__ */ I(ae, { size: 18 }), p("nav.tenantAdmin", { defaultValue: "Tenant administration" })]
1343
+ })
1344
+ ] }),
1345
+ (a || s) && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(v, { className: "my-1.5 bg-border/50" }), /* @__PURE__ */ L(u, { children: [s && /* @__PURE__ */ L(l, {
1346
+ onSelect: () => s(),
1347
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1348
+ children: [/* @__PURE__ */ I(U, { size: 18 }), p("bento.tour.replay", { defaultValue: "Take the tour" })]
1349
+ }), a && /* @__PURE__ */ L(l, {
1350
+ onSelect: () => a(),
1351
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2",
1352
+ children: [/* @__PURE__ */ I(ue, { size: 18 }), p("bento.shortcuts.title", { defaultValue: "Keyboard shortcuts" })]
1353
+ })] })] }),
1354
+ /* @__PURE__ */ I(v, { className: "my-1.5 bg-border/50" }),
1355
+ /* @__PURE__ */ L(l, {
1356
+ onSelect: () => {
1357
+ globalThis.location.href = t;
1358
+ },
1359
+ className: "bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger",
1360
+ children: [/* @__PURE__ */ I(de, { size: 18 }), p("nav.logOut")]
1361
+ })
1362
+ ]
1363
+ })] });
1364
+ }
1365
+ //#endregion
1366
+ //#region src/bento/bento-section-chrome.tsx
1367
+ var yt = O("console");
1368
+ function bt({ chrome: e, children: t }) {
1369
+ return /* @__PURE__ */ I(yt.Provider, {
1370
+ value: e,
1371
+ children: t
1372
+ });
1373
+ }
1374
+ function xt() {
1375
+ return A(yt);
1376
+ }
1377
+ var St = {
1378
+ blue: "blue",
1379
+ violet: "violet",
1380
+ emerald: "emerald",
1381
+ amber: "amber",
1382
+ rose: "rose",
1383
+ slate: "slate",
1384
+ cyan: "blue",
1385
+ orange: "amber"
1386
+ };
1387
+ function $({ variant: e = "blue", defaultOpen: t, className: n, children: r }) {
1388
+ let i = A(yt), a, o;
1389
+ return i === "bento" && D.forEach(r, (e) => {
1390
+ if (!k(e)) return;
1391
+ let { type: t } = e;
1392
+ t === w.Header || t === w.StaticHeader ? a = e.props : t === w.Content && (o = e.props.children);
1393
+ }), i === "bento" && a ? /* @__PURE__ */ I(ot, {
1394
+ icon: a.icon,
1395
+ tone: St[e] ?? "blue",
1396
+ title: a.title,
1397
+ description: a.description,
1398
+ children: o
1399
+ }) : /* @__PURE__ */ I(w, {
1400
+ variant: e,
1401
+ defaultOpen: t,
1402
+ className: n,
1403
+ children: r
1404
+ });
1405
+ }
1406
+ $.Header = w.Header, $.StaticHeader = w.StaticHeader, $.Content = w.Content;
1407
+ //#endregion
1408
+ //#region src/bento/bento-section.tsx
1409
+ var Ct = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
1410
+ function wt({ eyebrow: e, title: t, description: n, titleHref: r, children: i, gridClassName: a = Ct }) {
1411
+ let o = /* @__PURE__ */ I("h2", {
1412
+ className: "text-xl font-semibold tracking-tight md:text-2xl",
1413
+ children: t
1414
+ });
1415
+ return /* @__PURE__ */ L("section", {
1416
+ className: "mb-8 md:mb-10",
1417
+ children: [/* @__PURE__ */ L("header", {
1418
+ className: "bento-shell-header mb-4 flex flex-col gap-0.5",
1419
+ children: [
1420
+ e && /* @__PURE__ */ I("span", {
1421
+ className: "text-xs uppercase tracking-[0.18em] text-muted-foreground",
1422
+ children: e
1423
+ }),
1424
+ r ? /* @__PURE__ */ L(q, {
1425
+ to: r,
1426
+ className: "group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary",
1427
+ children: [o, /* @__PURE__ */ I(V, {
1428
+ size: 20,
1429
+ className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
1430
+ })]
1431
+ }) : o,
1432
+ n && /* @__PURE__ */ I("p", {
1433
+ className: "max-w-2xl text-sm text-muted-foreground",
1434
+ children: n
1435
+ })
1436
+ ]
1437
+ }), /* @__PURE__ */ I("div", {
1438
+ className: a,
1439
+ children: i
1440
+ })]
1441
+ });
1442
+ }
1443
+ //#endregion
1444
+ //#region src/bento/bento-tile.tsx
1445
+ function Tt({ to: e, onClick: t, disabled: n = !1, disabledHint: r, icon: i, tone: a, eyebrow: o, title: s, span: c, featured: l = !1, children: u }) {
1446
+ let d = !n && !!(e || t), f = l ? "h-14 w-14 rounded-2xl" : "h-9 w-9 rounded-2xl", p = l ? 28 : 18, m = l ? "text-xl font-semibold tracking-tight md:text-2xl" : "text-base font-semibold tracking-tight md:text-lg", h = /* @__PURE__ */ L(F, { children: [
1447
+ l && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
1448
+ "aria-hidden": !0,
1449
+ className: `pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${X(a)} opacity-40 blur-2xl dark:opacity-50`
1450
+ }), /* @__PURE__ */ I("div", {
1451
+ "aria-hidden": !0,
1452
+ className: `pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${X(a)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`
1453
+ })] }),
1454
+ /* @__PURE__ */ L("div", {
1455
+ className: "relative z-1 flex items-center justify-between",
1456
+ children: [/* @__PURE__ */ I("span", {
1457
+ className: `grid place-items-center ${X(a)} text-white shadow-md ${f}`,
1458
+ children: /* @__PURE__ */ I(i, { size: p })
1459
+ }), d && /* @__PURE__ */ I(V, {
1460
+ size: l ? 18 : 16,
1461
+ className: "text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1"
1462
+ })]
1463
+ }),
1464
+ /* @__PURE__ */ L("div", {
1465
+ className: "relative z-1",
1466
+ children: [
1467
+ /* @__PURE__ */ I("div", {
1468
+ className: "text-[11px] uppercase tracking-wider text-muted-foreground",
1469
+ children: o
1470
+ }),
1471
+ /* @__PURE__ */ I("div", {
1472
+ className: `mt-0.5 ${m}`,
1473
+ children: s
1474
+ }),
1475
+ u && /* @__PURE__ */ I("div", {
1476
+ className: "mt-2",
1477
+ children: u
1478
+ })
1479
+ ]
1480
+ })
1481
+ ] }), g = `bento-tile bento-glass group relative flex flex-col ${l ? "gap-5" : "gap-4"} overflow-hidden text-left ${l ? "p-6 md:p-7" : "p-5"} ${c}${d ? " bento-tile-clickable" : ""}${n ? " cursor-not-allowed opacity-60" : ""}`;
1482
+ return n ? /* @__PURE__ */ I("div", {
1483
+ className: g,
1484
+ "aria-disabled": "true",
1485
+ title: r,
1486
+ children: h
1487
+ }) : e ? /* @__PURE__ */ I(q, {
1488
+ to: e,
1489
+ className: g,
1490
+ children: h
1491
+ }) : t ? /* @__PURE__ */ I("button", {
1492
+ type: "button",
1493
+ onClick: t,
1494
+ className: `${g} w-full`,
1495
+ children: h
1496
+ }) : /* @__PURE__ */ I("div", {
1497
+ className: g,
1498
+ children: h
1499
+ });
1500
+ }
1501
+ //#endregion
1502
+ export { $ as AdaptiveSectionCard, He as BENTO_EMPHASIS_NEXT, Ve as BENTO_EMPHASIS_SPAN, Me as BENTO_TONES, Y as BENTO_TONE_CLASS, je as BentoActionsMenu, Z as BentoBackLink, ut as BentoBackToTop, ft as BentoCommandPalette, Ne as BentoCountTile, Pe as BentoEmptyState, Be as BentoEntityShell, Ge as BentoEntityTile, at as BentoFormHero, ot as BentoFormSection, Q as BentoHero, Fe as BentoHeroIconPicker, Ie as BentoInlineEdit, qe as BentoListPage, gt as BentoNavRail, nt as BentoSaveBar, it as BentoScrollSaveBar, wt as BentoSection, pt as BentoShortcutsDialog, Le as BentoStatusMarker, Tt as BentoTile, Je as BentoTileGrid, vt as BentoUserMenu, bt as SectionCardChromeProvider, X as bentoChipClass, dt as bentoNavTarget, Ue as resolveBentoLayout, We as toBentoLayoutEntries, Re as useBentoScrollFade, xt as useSectionChrome };