@viglet/viglet-design-system 2026.3.9 → 2026.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +528 -44
  2. package/consumers.json +186 -0
  3. package/dist/badge-locale-CJkHDlPg.cjs +1 -0
  4. package/dist/badge-locale-DxDp8Q3S.js +397 -0
  5. package/dist/bento/bento-actions-menu.d.ts +8 -0
  6. package/dist/bento/bento-actions-menu.d.ts.map +1 -1
  7. package/dist/bento/bento-back-to-top.d.ts +9 -1
  8. package/dist/bento/bento-back-to-top.d.ts.map +1 -1
  9. package/dist/bento/bento-command-palette.d.ts +56 -9
  10. package/dist/bento/bento-command-palette.d.ts.map +1 -1
  11. package/dist/bento/bento-data-table.d.ts +81 -0
  12. package/dist/bento/bento-data-table.d.ts.map +1 -0
  13. package/dist/bento/bento-diff.d.ts +41 -0
  14. package/dist/bento/bento-diff.d.ts.map +1 -0
  15. package/dist/bento/bento-empty-state.d.ts +8 -1
  16. package/dist/bento/bento-empty-state.d.ts.map +1 -1
  17. package/dist/bento/bento-entity-shell.d.ts.map +1 -1
  18. package/dist/bento/bento-filter-bar.d.ts +60 -0
  19. package/dist/bento/bento-filter-bar.d.ts.map +1 -0
  20. package/dist/bento/bento-form-section.d.ts +14 -1
  21. package/dist/bento/bento-form-section.d.ts.map +1 -1
  22. package/dist/bento/bento-inline-edit.d.ts.map +1 -1
  23. package/dist/bento/bento-nav-rail.d.ts +13 -13
  24. package/dist/bento/bento-nav-rail.d.ts.map +1 -1
  25. package/dist/bento/bento-nav.d.ts +10 -2
  26. package/dist/bento/bento-nav.d.ts.map +1 -1
  27. package/dist/bento/bento-palette-trigger.d.ts +18 -0
  28. package/dist/bento/bento-palette-trigger.d.ts.map +1 -0
  29. package/dist/bento/bento-section-chrome.d.ts +19 -39
  30. package/dist/bento/bento-section-chrome.d.ts.map +1 -1
  31. package/dist/bento/bento-shell-shortcuts.d.ts +67 -0
  32. package/dist/bento/bento-shell-shortcuts.d.ts.map +1 -0
  33. package/dist/bento/bento-shell.d.ts +53 -0
  34. package/dist/bento/bento-shell.d.ts.map +1 -0
  35. package/dist/bento/bento-shortcuts-dialog.d.ts +9 -7
  36. package/dist/bento/bento-shortcuts-dialog.d.ts.map +1 -1
  37. package/dist/bento/bento-status-marker.d.ts +5 -2
  38. package/dist/bento/bento-status-marker.d.ts.map +1 -1
  39. package/dist/bento/bento-tile.d.ts.map +1 -1
  40. package/dist/bento/bento-user-menu.d.ts +9 -8
  41. package/dist/bento/bento-user-menu.d.ts.map +1 -1
  42. package/dist/bento/bento-version-rail.d.ts +31 -0
  43. package/dist/bento/bento-version-rail.d.ts.map +1 -0
  44. package/dist/bento/index.d.ts +15 -6
  45. package/dist/bento/index.d.ts.map +1 -1
  46. package/dist/bento.cjs +5 -1
  47. package/dist/bento.css +70 -4
  48. package/dist/bento.es.js +1778 -701
  49. package/dist/catalogue.json +5283 -0
  50. package/dist/components/app-footer.d.ts +7 -0
  51. package/dist/components/app-footer.d.ts.map +1 -1
  52. package/dist/components/app-switcher.d.ts.map +1 -1
  53. package/dist/components/backend-status.d.ts +19 -11
  54. package/dist/components/backend-status.d.ts.map +1 -1
  55. package/dist/components/badge-colorful.d.ts +13 -0
  56. package/dist/components/badge-colorful.d.ts.map +1 -1
  57. package/dist/components/badge-locale.d.ts +7 -0
  58. package/dist/components/badge-locale.d.ts.map +1 -1
  59. package/dist/components/error-boundary.d.ts +15 -13
  60. package/dist/components/error-boundary.d.ts.map +1 -1
  61. package/dist/components/language-select.d.ts +8 -0
  62. package/dist/components/language-select.d.ts.map +1 -1
  63. package/dist/components/login/login.d.ts +27 -0
  64. package/dist/components/login/login.d.ts.map +1 -1
  65. package/dist/components/mode-toggle.d.ts +9 -0
  66. package/dist/components/mode-toggle.d.ts.map +1 -1
  67. package/dist/components/nav-secondary.d.ts +7 -0
  68. package/dist/components/nav-secondary.d.ts.map +1 -1
  69. package/dist/components/router/dialog.delete.d.ts +8 -0
  70. package/dist/components/router/dialog.delete.d.ts.map +1 -1
  71. package/dist/components/router/gradient-button-link.d.ts +6 -0
  72. package/dist/components/router/gradient-button-link.d.ts.map +1 -1
  73. package/dist/components/router/index.d.ts +0 -11
  74. package/dist/components/router/index.d.ts.map +1 -1
  75. package/dist/components/router/loading-provider.d.ts +4 -0
  76. package/dist/components/router/loading-provider.d.ts.map +1 -1
  77. package/dist/components/startup-first/startup-first.d.ts +29 -0
  78. package/dist/components/startup-first/startup-first.d.ts.map +1 -1
  79. package/dist/components/ui/accordion.d.ts +17 -0
  80. package/dist/components/ui/accordion.d.ts.map +1 -1
  81. package/dist/components/ui/avatar.d.ts +14 -0
  82. package/dist/components/ui/avatar.d.ts.map +1 -1
  83. package/dist/components/ui/badge.d.ts +6 -0
  84. package/dist/components/ui/badge.d.ts.map +1 -1
  85. package/dist/components/ui/breadcrumb.d.ts +25 -0
  86. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  87. package/dist/components/ui/button.d.ts +15 -1
  88. package/dist/components/ui/button.d.ts.map +1 -1
  89. package/dist/components/ui/card.d.ts +27 -0
  90. package/dist/components/ui/card.d.ts.map +1 -1
  91. package/dist/components/ui/checkbox.d.ts +4 -0
  92. package/dist/components/ui/checkbox.d.ts.map +1 -1
  93. package/dist/components/ui/dialog.d.ts +36 -0
  94. package/dist/components/ui/dialog.d.ts.map +1 -1
  95. package/dist/components/ui/drawer.d.ts +35 -0
  96. package/dist/components/ui/drawer.d.ts.map +1 -1
  97. package/dist/components/ui/dropdown-menu.d.ts +53 -0
  98. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  99. package/dist/components/ui/floating-formulas-bg.d.ts +8 -0
  100. package/dist/components/ui/floating-formulas-bg.d.ts.map +1 -1
  101. package/dist/components/ui/form-actions.d.ts +7 -0
  102. package/dist/components/ui/form-actions.d.ts.map +1 -1
  103. package/dist/components/ui/form-item-two-columns.d.ts +7 -0
  104. package/dist/components/ui/form-item-two-columns.d.ts.map +1 -1
  105. package/dist/components/ui/form.d.ts +25 -0
  106. package/dist/components/ui/form.d.ts.map +1 -1
  107. package/dist/components/ui/glass-card.d.ts +18 -14
  108. package/dist/components/ui/glass-card.d.ts.map +1 -1
  109. package/dist/components/ui/gradient-button.d.ts +15 -1
  110. package/dist/components/ui/gradient-button.d.ts.map +1 -1
  111. package/dist/components/ui/gradient-switch.d.ts +6 -0
  112. package/dist/components/ui/gradient-switch.d.ts.map +1 -1
  113. package/dist/components/ui/hover-card.d.ts +14 -0
  114. package/dist/components/ui/hover-card.d.ts.map +1 -1
  115. package/dist/components/ui/icon-picker-dialog.d.ts.map +1 -1
  116. package/dist/components/ui/index.d.ts +6 -4
  117. package/dist/components/ui/index.d.ts.map +1 -1
  118. package/dist/components/ui/input.d.ts +6 -0
  119. package/dist/components/ui/input.d.ts.map +1 -1
  120. package/dist/components/ui/label.d.ts +4 -0
  121. package/dist/components/ui/label.d.ts.map +1 -1
  122. package/dist/components/ui/navigation-menu.d.ts +41 -0
  123. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  124. package/dist/components/ui/pagination.d.ts +25 -0
  125. package/dist/components/ui/pagination.d.ts.map +1 -1
  126. package/dist/components/ui/popover.d.ts +24 -0
  127. package/dist/components/ui/popover.d.ts.map +1 -1
  128. package/dist/components/ui/progress.d.ts +4 -0
  129. package/dist/components/ui/progress.d.ts.map +1 -1
  130. package/dist/components/ui/pulse-ring.d.ts +9 -11
  131. package/dist/components/ui/pulse-ring.d.ts.map +1 -1
  132. package/dist/components/ui/resizable.d.ts +11 -0
  133. package/dist/components/ui/resizable.d.ts.map +1 -1
  134. package/dist/components/ui/section-card.d.ts +9 -0
  135. package/dist/components/ui/section-card.d.ts.map +1 -1
  136. package/dist/components/ui/select.d.ts +36 -0
  137. package/dist/components/ui/select.d.ts.map +1 -1
  138. package/dist/components/ui/separator.d.ts +4 -0
  139. package/dist/components/ui/separator.d.ts.map +1 -1
  140. package/dist/components/ui/sheet.d.ts +29 -0
  141. package/dist/components/ui/sheet.d.ts.map +1 -1
  142. package/dist/components/ui/sidebar.d.ts +83 -0
  143. package/dist/components/ui/sidebar.d.ts.map +1 -1
  144. package/dist/components/ui/skeleton.d.ts +4 -0
  145. package/dist/components/ui/skeleton.d.ts.map +1 -1
  146. package/dist/components/ui/slider.d.ts +4 -0
  147. package/dist/components/ui/slider.d.ts.map +1 -1
  148. package/dist/components/ui/sonner.d.ts +16 -0
  149. package/dist/components/ui/sonner.d.ts.map +1 -1
  150. package/dist/components/ui/stepper.d.ts +8 -0
  151. package/dist/components/ui/stepper.d.ts.map +1 -1
  152. package/dist/components/ui/sticky-save-bar.d.ts +7 -0
  153. package/dist/components/ui/sticky-save-bar.d.ts.map +1 -1
  154. package/dist/components/ui/switch.d.ts +4 -0
  155. package/dist/components/ui/switch.d.ts.map +1 -1
  156. package/dist/components/ui/table.d.ts +31 -0
  157. package/dist/components/ui/table.d.ts.map +1 -1
  158. package/dist/components/ui/tabs.d.ts +16 -0
  159. package/dist/components/ui/tabs.d.ts.map +1 -1
  160. package/dist/components/ui/textarea.d.ts +4 -0
  161. package/dist/components/ui/textarea.d.ts.map +1 -1
  162. package/dist/components/ui/toggle-group.d.ts +7 -0
  163. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  164. package/dist/components/ui/toggle.d.ts +4 -0
  165. package/dist/components/ui/toggle.d.ts.map +1 -1
  166. package/dist/components/ui/tooltip.d.ts +18 -0
  167. package/dist/components/ui/tooltip.d.ts.map +1 -1
  168. package/dist/components/ui/user-avatar.d.ts +2 -1
  169. package/dist/components/ui/user-avatar.d.ts.map +1 -1
  170. package/dist/components/ui/viglet-assistant.d.ts +103 -0
  171. package/dist/components/ui/viglet-assistant.d.ts.map +1 -0
  172. package/dist/components/ui/viglet-avatar.d.ts +44 -0
  173. package/dist/components/ui/viglet-avatar.d.ts.map +1 -0
  174. package/dist/contexts/breadcrumb.context.d.ts +7 -0
  175. package/dist/contexts/breadcrumb.context.d.ts.map +1 -1
  176. package/dist/contexts/user.context.d.ts +8 -0
  177. package/dist/contexts/user.context.d.ts.map +1 -1
  178. package/dist/exports.json +359 -30
  179. package/dist/floating-formulas-bg.cjs +1 -1
  180. package/dist/floating-formulas-bg.es.js +56 -55
  181. package/dist/hooks/index.d.ts +1 -0
  182. package/dist/hooks/index.d.ts.map +1 -1
  183. package/dist/hooks/use-assistant-notifications.d.ts +15 -0
  184. package/dist/hooks/use-assistant-notifications.d.ts.map +1 -0
  185. package/dist/i18n/index.d.ts +168 -0
  186. package/dist/i18n/index.d.ts.map +1 -1
  187. package/dist/i18n/locales/en/assistant.json.d.ts +25 -0
  188. package/dist/i18n/locales/en/bento.json.d.ts +48 -2
  189. package/dist/i18n/locales/en/common.json.d.ts +6 -1
  190. package/dist/i18n/locales/en/language.json.d.ts +8 -0
  191. package/dist/i18n/locales/pt/assistant.json.d.ts +25 -0
  192. package/dist/i18n/locales/pt/bento.json.d.ts +48 -2
  193. package/dist/i18n/locales/pt/common.json.d.ts +6 -1
  194. package/dist/i18n/locales/pt/language.json.d.ts +8 -0
  195. package/dist/i18n.cjs +1 -1
  196. package/dist/i18n.es.js +572 -2
  197. package/dist/index.cjs +1 -1
  198. package/dist/index.d.ts +0 -1
  199. package/dist/index.d.ts.map +1 -1
  200. package/dist/index.es.js +2280 -733
  201. package/dist/lib/busy.d.ts +26 -0
  202. package/dist/lib/busy.d.ts.map +1 -0
  203. package/dist/lib/corner-slot.d.ts +15 -0
  204. package/dist/lib/corner-slot.d.ts.map +1 -0
  205. package/dist/{loading-provider-BWWhhfEn.js → loading-provider-ClDkFPuv.js} +84 -81
  206. package/dist/loading-provider-DGuCfsl9.cjs +1 -0
  207. package/dist/preset.css +7 -10
  208. package/dist/router.cjs +1 -1
  209. package/dist/router.es.js +2 -776
  210. package/dist/user.context-Cr3GAQ_r.js +762 -0
  211. package/dist/user.context-hbdvmXOn.cjs +1 -0
  212. package/dist/utils-Fk5jmzzb.js +41 -0
  213. package/dist/utils-Oagwe_oa.cjs +1 -0
  214. package/dist/viglet-design-system.css +1 -1
  215. package/dist/vite/boot-loader.d.ts +33 -2
  216. package/dist/vite/boot-loader.d.ts.map +1 -1
  217. package/dist/vite.cjs +16 -5
  218. package/dist/vite.es.js +27 -14
  219. package/docs/BENTO-AUTHORING.md +81 -11
  220. package/docs/reference/grounds.dc.html +9 -9
  221. package/package.json +16 -4
  222. package/scripts/consumer-entries.mjs +209 -0
  223. package/scripts/lib/contrast.mjs +301 -0
  224. package/scripts/mcp.mjs +300 -0
  225. package/scripts/page-lint.mjs +428 -0
  226. package/scripts/page-reference.mjs +54 -10
  227. package/dist/badge-locale-CoEEv7s5.js +0 -581
  228. package/dist/badge-locale-hQyWhAKe.cjs +0 -7
  229. package/dist/breadcrumb.context-KQut7j8U.js +0 -917
  230. package/dist/breadcrumb.context-Vwc3lAlf.cjs +0 -1
  231. package/dist/components/router/blank-slate.d.ts +0 -21
  232. package/dist/components/router/blank-slate.d.ts.map +0 -1
  233. package/dist/components/router/grid.list.d.ts +0 -39
  234. package/dist/components/router/grid.list.d.ts.map +0 -1
  235. package/dist/components/router/internal.sidebar.d.ts +0 -61
  236. package/dist/components/router/internal.sidebar.d.ts.map +0 -1
  237. package/dist/components/router/nav-main.d.ts +0 -25
  238. package/dist/components/router/nav-main.d.ts.map +0 -1
  239. package/dist/components/router/nav-user.d.ts +0 -24
  240. package/dist/components/router/nav-user.d.ts.map +0 -1
  241. package/dist/components/router/page-content.d.ts +0 -12
  242. package/dist/components/router/page-content.d.ts.map +0 -1
  243. package/dist/components/router/page-header.d.ts +0 -23
  244. package/dist/components/router/page-header.d.ts.map +0 -1
  245. package/dist/components/router/page.d.ts +0 -22
  246. package/dist/components/router/page.d.ts.map +0 -1
  247. package/dist/components/router/sticky.page.header.d.ts +0 -85
  248. package/dist/components/router/sticky.page.header.d.ts.map +0 -1
  249. package/dist/components/router/sub.page.d.ts +0 -50
  250. package/dist/components/router/sub.page.d.ts.map +0 -1
  251. package/dist/components/router/sub.page.header.d.ts +0 -37
  252. package/dist/components/router/sub.page.header.d.ts.map +0 -1
  253. package/dist/i18n-DD3rQOWi.js +0 -426
  254. package/dist/i18n-DrBq-qJJ.cjs +0 -1
  255. package/dist/lib/react-markers.d.ts +0 -17
  256. package/dist/lib/react-markers.d.ts.map +0 -1
  257. package/dist/loading-provider-CmeMqLGk.cjs +0 -1
  258. package/dist/user.context-B9vIBzY5.cjs +0 -1
  259. package/dist/user.context-D1PxP4D4.js +0 -512
package/dist/router.es.js CHANGED
@@ -1,777 +1,3 @@
1
1
  "use client";
2
- import { E as e, _ as t, f as n, g as r, h as i, l as a, m as o, u as s, x as c } from "./badge-locale-CoEEv7s5.js";
3
- import { $ as l, A as u, D as d, H as f, K as p, M as m, Q as h, S as g, U as _, W as v, Z as y, _ as b, b as x, c as S, ct as C, d as w, dt as T, ft as E, h as D, ht as O, i as ee, j as k, l as te, lt as ne, m as A, mt as j, n as re, ot as ie, p as M, pt as N, ut as ae, v as P, x as F } from "./breadcrumb.context-KQut7j8U.js";
4
- import { i as I, n as oe, r as se, t as ce } from "./loading-provider-BWWhhfEn.js";
5
- import L, { useState as le } from "react";
6
- import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
7
- import { useTranslation as V } from "react-i18next";
8
- import { IconChevronLeft as ue, IconChevronRight as de, IconDotsVertical as H, IconDownload as fe, IconLogout as pe, IconPlus as U, IconSearch as W, IconUserCircle as me } from "@tabler/icons-react";
9
- import { Icon as he } from "@iconify/react";
10
- import { NavLink as G, Outlet as K, useLocation as q, useNavigate as J } from "react-router-dom";
11
- import { columnFilteringFeature as ge, createCoreRowModel as _e, createFilteredRowModel as ve, createPaginatedRowModel as ye, createSortedRowModel as be, globalFilteringFeature as xe, rowPaginationFeature as Se, rowSortingFeature as Ce, useTable as we } from "@tanstack/react-table";
12
- //#region src/lib/react-markers.ts
13
- function Y(e) {
14
- return typeof e.type == "string" ? void 0 : e.type.displayName;
15
- }
16
- //#endregion
17
- //#region src/components/router/grid.list.tsx
18
- var X = () => null;
19
- X.displayName = "GridListNewButton";
20
- var Te = () => null;
21
- Te.displayName = "GridListAction";
22
- var Ee = () => null;
23
- Ee.displayName = "GridListItemAction";
24
- var De = [
25
- "vg-accent-solid",
26
- "from-emerald-500 to-teal-500",
27
- "from-violet-500 to-purple-500",
28
- "from-amber-500 to-orange-500",
29
- "from-rose-500 to-pink-500",
30
- "from-cyan-500 to-sky-500",
31
- "from-fuchsia-500 to-pink-500",
32
- "from-lime-500 to-emerald-500"
33
- ];
34
- function Oe(e) {
35
- let t = 0;
36
- for (let n = 0; n < e.length; n++) t = (e.codePointAt(n) ?? 0) + ((t << 5) - t);
37
- return De[Math.abs(t) % De.length];
38
- }
39
- function ke(e) {
40
- return e.split(/[\s\-_]+/).filter(Boolean).slice(0, 2).map((e) => e[0].toUpperCase()).join("");
41
- }
42
- var Ae = {
43
- columnFilteringFeature: ge,
44
- globalFilteringFeature: xe,
45
- rowPaginationFeature: Se,
46
- rowSortingFeature: Ce,
47
- coreRowModel: _e(),
48
- filteredRowModel: ve(),
49
- paginatedRowModel: ye(),
50
- sortedRowModel: be()
51
- }, je = [
52
- {
53
- accessorKey: "name",
54
- header: "Name"
55
- },
56
- {
57
- accessorKey: "description",
58
- header: "Description"
59
- },
60
- {
61
- accessorKey: "url",
62
- header: "URL"
63
- }
64
- ], Me = Object.assign(({ gridItemList: t, children: i }) => {
65
- let { t: c } = V(), u = J(), d = [], f = [];
66
- L.Children.forEach(i, (e) => {
67
- if (L.isValidElement(e)) {
68
- if (Y(e) === "GridListNewButton") {
69
- let { to: t, label: n } = e.props;
70
- d.push({
71
- key: `new-${n}`,
72
- render: () => /* @__PURE__ */ B(r, {
73
- onClick: () => u(t),
74
- children: [/* @__PURE__ */ z(U, { className: "size-4 mr-2" }), c("sidebar.new", {
75
- feature: n,
76
- defaultValue: "New {{feature}}"
77
- })]
78
- })
79
- });
80
- } else if (Y(e) === "GridListAction") {
81
- let { children: t } = e.props;
82
- d.push({
83
- key: `action-${d.length}`,
84
- render: () => /* @__PURE__ */ z(R, { children: t })
85
- });
86
- } else if (Y(e) === "GridListItemAction") {
87
- let t = e.props;
88
- f.push({
89
- key: `item-action-${f.length}`,
90
- icon: t.icon,
91
- label: t.label,
92
- onClick: t.onClick,
93
- position: t.position ?? "right"
94
- });
95
- }
96
- }
97
- });
98
- let m = f.length > 0, g = f.filter((e) => e.position === "left"), b = f.filter((e) => e.position === "right"), [x, S] = le({
99
- pageIndex: 0,
100
- pageSize: 12
101
- }), [C, w] = L.useState([]), [T, E] = le(""), D = we({
102
- features: Ae,
103
- data: t,
104
- columns: je,
105
- onSortingChange: w,
106
- state: {
107
- globalFilter: T,
108
- pagination: x,
109
- sorting: C
110
- },
111
- onGlobalFilterChange: E,
112
- getColumnCanGlobalFilter: (e) => e.id === "name" || e.id === "description",
113
- onPaginationChange: S
114
- }), O = D.getRowModel().rows;
115
- return /* @__PURE__ */ B("div", {
116
- className: "px-6",
117
- children: [
118
- /* @__PURE__ */ B("div", {
119
- className: "flex items-center gap-3 mb-4",
120
- children: [
121
- /* @__PURE__ */ B("div", {
122
- className: "relative flex-1 max-w-sm",
123
- children: [/* @__PURE__ */ z(W, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ z(a, {
124
- placeholder: c("forms.common.search"),
125
- value: T ?? "",
126
- onChange: (e) => E(e.target.value),
127
- className: "pl-9"
128
- })]
129
- }),
130
- /* @__PURE__ */ B("span", {
131
- className: "text-sm text-muted-foreground whitespace-nowrap",
132
- children: [
133
- D.getFilteredRowModel().rows.length,
134
- " ",
135
- D.getFilteredRowModel().rows.length === 1 ? c("forms.common.item") : c("forms.common.items")
136
- ]
137
- }),
138
- d.length > 0 && /* @__PURE__ */ z("div", {
139
- className: "ml-auto",
140
- children: /* @__PURE__ */ B(n, { children: [/* @__PURE__ */ z(e, {
141
- asChild: !0,
142
- children: /* @__PURE__ */ B(s, {
143
- variant: "outline",
144
- size: "sm",
145
- className: "gap-1.5",
146
- children: [/* @__PURE__ */ z(H, { className: "size-4" }), /* @__PURE__ */ z("span", {
147
- className: "hidden sm:inline",
148
- children: c("forms.common.actions")
149
- })]
150
- })
151
- }), /* @__PURE__ */ z(o, {
152
- align: "end",
153
- children: d.map((e) => /* @__PURE__ */ z(L.Fragment, { children: e.render() }, e.key))
154
- })] })
155
- })
156
- ]
157
- }),
158
- O.length > 0 ? /* @__PURE__ */ z("div", {
159
- className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",
160
- children: O.map((e) => {
161
- let t = e.getValue("name"), n = e.getValue("description"), r = e.getValue("url"), i = e.original.icon ?? void 0, a = Oe(t), o = ke(t), s = /* @__PURE__ */ B(l, {
162
- className: "relative overflow-hidden p-0 h-full transition-all duration-200 hover:shadow-lg hover:shadow-[var(--vg-accent-surface)] hover:-translate-y-0.5 border-border/60 hover:border-[var(--vg-accent-line)]",
163
- children: [/* @__PURE__ */ z("div", { className: `h-1.5 bg-linear-to-r ${a} opacity-70 group-hover:opacity-100 transition-opacity` }), /* @__PURE__ */ B("div", {
164
- className: "p-4 flex items-start gap-3",
165
- children: [
166
- m && g.length > 0 && /* @__PURE__ */ z("div", {
167
- className: "flex items-center gap-1 shrink-0 mt-0.5",
168
- children: g.map((t) => /* @__PURE__ */ z("button", {
169
- type: "button",
170
- title: t.label,
171
- onClick: () => t.onClick(e.original),
172
- className: "inline-flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:text-[var(--vg-accent-fg)] hover:bg-[var(--vg-accent-surface)] transition-colors cursor-pointer",
173
- children: t.icon
174
- }, t.key))
175
- }),
176
- /* @__PURE__ */ z("div", {
177
- className: `shrink-0 w-10 h-10 rounded-lg bg-linear-to-br ${a} flex items-center justify-center text-white text-sm font-semibold shadow-sm`,
178
- children: i ? /* @__PURE__ */ z(he, {
179
- icon: i,
180
- className: "size-5"
181
- }) : o
182
- }),
183
- /* @__PURE__ */ B("div", {
184
- className: "flex-1 min-w-0",
185
- children: [/* @__PURE__ */ z("h3", {
186
- className: "font-medium text-sm truncate group-hover:text-[var(--vg-accent-fg)] transition-colors",
187
- children: t
188
- }), n ? /* @__PURE__ */ z("p", {
189
- className: "text-xs text-muted-foreground mt-1 line-clamp-2 leading-relaxed",
190
- children: n
191
- }) : /* @__PURE__ */ z("p", {
192
- className: "text-xs text-muted-foreground/50 mt-1 italic",
193
- children: c("forms.common.noDescription")
194
- })]
195
- }),
196
- m ? b.length > 0 && /* @__PURE__ */ z("div", {
197
- className: "flex items-center gap-1 shrink-0 mt-0.5",
198
- children: b.map((t) => /* @__PURE__ */ z("button", {
199
- type: "button",
200
- title: t.label,
201
- onClick: () => t.onClick(e.original),
202
- className: "inline-flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:text-[var(--vg-accent-fg)] hover:bg-[var(--vg-accent-surface)] transition-colors cursor-pointer",
203
- children: t.icon
204
- }, t.key))
205
- }) : /* @__PURE__ */ z(de, { className: "h-4 w-4 text-muted-foreground/40 group-hover:text-[var(--vg-accent-fg)] transition-all group-hover:translate-x-0.5 mt-0.5 shrink-0" })
206
- ]
207
- })]
208
- });
209
- return m ? /* @__PURE__ */ z("div", {
210
- className: "group",
211
- children: s
212
- }, e.id) : /* @__PURE__ */ z(G, {
213
- to: r,
214
- className: "group",
215
- children: s
216
- }, e.id);
217
- })
218
- }) : /* @__PURE__ */ z(l, {
219
- className: "p-8",
220
- children: /* @__PURE__ */ B("div", {
221
- className: "text-center text-muted-foreground",
222
- children: [/* @__PURE__ */ z(W, { className: "h-8 w-8 mx-auto mb-2 opacity-40" }), /* @__PURE__ */ z("p", {
223
- className: "text-sm",
224
- children: c("forms.common.noResults")
225
- })]
226
- })
227
- }),
228
- D.getPageCount() > 1 && /* @__PURE__ */ B("div", {
229
- className: "flex items-center justify-end space-x-2 mt-4",
230
- children: [
231
- /* @__PURE__ */ B("div", {
232
- className: "flex items-center space-x-2",
233
- children: [/* @__PURE__ */ z("p", {
234
- className: "text-sm text-muted-foreground",
235
- children: c("forms.common.perPage")
236
- }), /* @__PURE__ */ B(_, {
237
- value: `${D.state.pagination.pageSize}`,
238
- onValueChange: (e) => D.setPageSize(Number(e)),
239
- children: [/* @__PURE__ */ z(y, {
240
- className: "h-8 w-17.5",
241
- children: /* @__PURE__ */ z(h, { placeholder: D.state.pagination.pageSize })
242
- }), /* @__PURE__ */ z(v, {
243
- side: "top",
244
- children: [
245
- 12,
246
- 24,
247
- 36,
248
- 48
249
- ].map((e) => /* @__PURE__ */ z(p, {
250
- value: `${e}`,
251
- children: e
252
- }, e))
253
- })]
254
- })]
255
- }),
256
- /* @__PURE__ */ z("div", {
257
- className: "flex w-25 items-center justify-center text-sm font-medium",
258
- children: c("forms.common.pageOf", {
259
- index: D.state.pagination.pageIndex + 1,
260
- count: D.getPageCount()
261
- })
262
- }),
263
- /* @__PURE__ */ B("div", {
264
- className: "flex items-center space-x-2",
265
- children: [/* @__PURE__ */ z(s, {
266
- variant: "outline",
267
- size: "sm",
268
- onClick: () => D.previousPage(),
269
- disabled: !D.getCanPreviousPage(),
270
- className: "h-8 w-8 p-0",
271
- "aria-label": c("common.goToPreviousPage", { defaultValue: "Go to previous page" }),
272
- children: /* @__PURE__ */ z("span", { children: "<" })
273
- }), /* @__PURE__ */ z(s, {
274
- variant: "outline",
275
- size: "sm",
276
- onClick: () => D.nextPage(),
277
- disabled: !D.getCanNextPage(),
278
- className: "h-8 w-8 p-0",
279
- "aria-label": c("common.goToNextPage", { defaultValue: "Go to next page" }),
280
- children: /* @__PURE__ */ z("span", { children: ">" })
281
- })]
282
- })
283
- ]
284
- })
285
- ]
286
- });
287
- }, {
288
- NewButton: X,
289
- Action: Te,
290
- ItemAction: Ee
291
- }), Ne = (e) => !e.url && (e.children?.length ?? 0) > 0, Pe = (e, t, n) => {
292
- if (e.url) {
293
- let r = (t ?? "") + e.url;
294
- if (n === r || n.startsWith(r + "/")) return !0;
295
- }
296
- return e.children?.some((e) => Pe(e, t, n)) ?? !1;
297
- }, Fe = (e) => (e ?? 0).toLocaleString(), Z = (e, t, n, r, i) => e.map((e) => /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(F, {
298
- tooltip: e.title,
299
- isActive: Pe(e, t, n),
300
- asChild: !0,
301
- children: /* @__PURE__ */ B(G, {
302
- to: (t ?? "") + (e.url ?? ""),
303
- onClick: i,
304
- children: [e.icon && /* @__PURE__ */ z(e.icon, { className: "size-5!" }), /* @__PURE__ */ z("span", { children: e.title })]
305
- })
306
- }), !r && e.children && e.children.length > 0 && /* @__PURE__ */ z(P, {
307
- className: "ml-4",
308
- children: Z(e.children, t, n, r, i)
309
- })] }, e.title)), Q = ({ icon: e, feature: t, name: n, urlBase: r, isNew: i, data: a, onDelete: o, onExport: c, open: l, setOpen: u }) => {
310
- let { t: d } = V(), f = q().pathname, { state: p, isMobile: m, setOpenMobile: h } = k(), _ = p === "collapsed", v = m ? () => h(!1) : void 0;
311
- return /* @__PURE__ */ B(S, {
312
- collapsible: "icon",
313
- variant: "inset",
314
- position: "absolute",
315
- children: [/* @__PURE__ */ z(D, {
316
- className: "pb-3",
317
- children: /* @__PURE__ */ z(P, { children: /* @__PURE__ */ B(g, {
318
- className: "flex items-center",
319
- children: [/* @__PURE__ */ z(F, {
320
- asChild: !0,
321
- className: "data-[slot=sidebar-menu-button]:p-1.5!",
322
- children: /* @__PURE__ */ B(G, {
323
- to: r ?? "#",
324
- className: "flex items-center gap-2.5",
325
- children: [/* @__PURE__ */ z("div", {
326
- className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg vg-accent-chip ring-1",
327
- children: /* @__PURE__ */ z(e, { className: "size-5! vg-accent-text" })
328
- }), !_ && /* @__PURE__ */ z("span", {
329
- className: "text-sm font-semibold whitespace-nowrap truncate",
330
- children: i ? d("sidebar.new", { feature: t }) : n
331
- })]
332
- })
333
- }), !_ && /* @__PURE__ */ B("div", {
334
- className: "flex items-center gap-1 mr-auto",
335
- children: [!i && c && /* @__PURE__ */ z(s, {
336
- variant: "ghost",
337
- size: "icon-sm",
338
- onClick: c,
339
- children: /* @__PURE__ */ z(fe, { className: "size-5!" })
340
- }), !i && o && u && /* @__PURE__ */ z(I, {
341
- feature: t,
342
- name: n,
343
- onDelete: o,
344
- open: l ?? !1,
345
- setOpen: u
346
- })]
347
- })]
348
- }) })
349
- }), /* @__PURE__ */ B(te, { children: [a?.counts && a.counts.length > 0 && /* @__PURE__ */ B(w, { children: [/* @__PURE__ */ z(A, { children: d("sidebar.indexing") }), /* @__PURE__ */ z(M, {
350
- className: "flex flex-col gap-2 pt-4",
351
- children: /* @__PURE__ */ z(P, { children: a.counts.map((e) => /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ B(F, {
352
- tooltip: e.title + ": " + Fe(e.count),
353
- variant: "outline",
354
- children: [e.icon && /* @__PURE__ */ z(e.icon, { className: "size-5!" }), /* @__PURE__ */ z("span", { children: e.title })]
355
- }), !_ && /* @__PURE__ */ z(x, { children: Fe(e.count) })] }, e.title)) })
356
- })] }), (() => {
357
- let e = a?.navMain ?? [], n = i ? e.filter((e) => e.showOnNew ?? e.url === "/detail") : e, o = n.filter((e) => !Ne(e)), s = n.filter(Ne);
358
- return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B(w, { children: [/* @__PURE__ */ z(A, { children: t }), /* @__PURE__ */ z(M, {
359
- className: "flex flex-col gap-2",
360
- children: /* @__PURE__ */ z(P, { children: Z(o, r, f, _, v) })
361
- })] }), s.map((e) => /* @__PURE__ */ B(w, { children: [/* @__PURE__ */ z(A, { children: e.title }), /* @__PURE__ */ z(M, {
362
- className: "flex flex-col gap-2",
363
- children: /* @__PURE__ */ z(P, { children: Z(e.children ?? [], r, f, _, v) })
364
- })] }, e.title))] });
365
- })()] })]
366
- });
367
- };
368
- //#endregion
369
- //#region src/components/router/nav-main.tsx
370
- function Ie({ groups: e }) {
371
- let t = q().pathname, { isMobile: n, setOpenMobile: r } = k();
372
- return /* @__PURE__ */ z(R, { children: e.map((e) => /* @__PURE__ */ B(w, { children: [e.label && /* @__PURE__ */ z(A, { children: e.label }), /* @__PURE__ */ z(M, {
373
- className: "flex flex-col gap-2",
374
- children: /* @__PURE__ */ z(P, { children: e.items.map((e) => /* @__PURE__ */ z(g, { children: /* @__PURE__ */ z(F, {
375
- tooltip: e.title,
376
- isActive: t.startsWith(e.url),
377
- asChild: !0,
378
- children: /* @__PURE__ */ B(G, {
379
- to: e.url,
380
- onClick: () => n && r(!1),
381
- children: [e.icon && /* @__PURE__ */ z(e.icon, { className: "size-6!" }), /* @__PURE__ */ z("span", { children: e.title })]
382
- })
383
- }) }, e.title)) })
384
- })] }, e.label ?? "_ungrouped")) });
385
- }
386
- //#endregion
387
- //#region src/components/router/nav-user.tsx
388
- function Le({ user: a, accountUrl: s, logoutUrl: l, onLogout: u }) {
389
- let { t: d } = V(), { isMobile: f } = k(), p = () => {
390
- u ? u() : l && (globalThis.location.href = l);
391
- }, m = L.useMemo(() => {
392
- let e = a.firstName || "", t = a.lastName || "";
393
- if (!e && !t) return " ";
394
- let n = `${e} ${t}`.trim().split(" ").filter(Boolean);
395
- return n.length === 1 ? n[0].charAt(0).toUpperCase() : n[0].charAt(0).toUpperCase() + (n.at(-1)?.charAt(0).toUpperCase() ?? "");
396
- }, [a]), h = a?.avatarUrl || "";
397
- return /* @__PURE__ */ z(P, { children: /* @__PURE__ */ z(g, { children: /* @__PURE__ */ B(n, { children: [/* @__PURE__ */ z(e, {
398
- asChild: !0,
399
- children: /* @__PURE__ */ B(F, {
400
- size: "lg",
401
- className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
402
- children: [
403
- /* @__PURE__ */ B(N, {
404
- className: "h-8 w-8 rounded-lg",
405
- children: [h && /* @__PURE__ */ z(O, {
406
- src: h,
407
- alt: a.username
408
- }), /* @__PURE__ */ z(j, {
409
- className: "rounded-lg",
410
- children: m
411
- })]
412
- }),
413
- /* @__PURE__ */ B("div", {
414
- className: "grid flex-1 text-left text-sm leading-tight",
415
- children: [/* @__PURE__ */ B("span", {
416
- className: "truncate font-medium",
417
- children: [
418
- a.firstName,
419
- " ",
420
- a.lastName
421
- ]
422
- }), /* @__PURE__ */ z("span", {
423
- className: "text-muted-foreground truncate text-xs",
424
- children: a.email
425
- })]
426
- }),
427
- /* @__PURE__ */ z(H, { className: "ml-auto size-4" })
428
- ]
429
- })
430
- }), /* @__PURE__ */ B(o, {
431
- className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
432
- side: f ? "bottom" : "right",
433
- align: "end",
434
- sideOffset: 4,
435
- children: [
436
- /* @__PURE__ */ z(t, {
437
- className: "p-0 font-normal",
438
- children: /* @__PURE__ */ B("div", {
439
- className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm",
440
- children: [/* @__PURE__ */ B(N, {
441
- className: "h-8 w-8 rounded-lg",
442
- children: [h && /* @__PURE__ */ z(O, {
443
- src: h,
444
- alt: a.username
445
- }), /* @__PURE__ */ z(j, {
446
- className: "rounded-lg",
447
- children: m
448
- })]
449
- }), /* @__PURE__ */ B("div", {
450
- className: "grid flex-1 text-left text-sm leading-tight",
451
- children: [/* @__PURE__ */ B("span", {
452
- className: "truncate font-medium",
453
- children: [
454
- a.firstName,
455
- " ",
456
- a.lastName
457
- ]
458
- }), /* @__PURE__ */ z("span", {
459
- className: "text-muted-foreground truncate text-xs",
460
- children: a.email
461
- })]
462
- })]
463
- })
464
- }),
465
- /* @__PURE__ */ z(c, {}),
466
- s && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(i, { children: /* @__PURE__ */ z(G, {
467
- to: s,
468
- className: "w-full",
469
- children: /* @__PURE__ */ B(r, { children: [/* @__PURE__ */ z(me, {}), d("nav.account")] })
470
- }) }), /* @__PURE__ */ z(c, {})] }),
471
- /* @__PURE__ */ B(r, {
472
- onClick: p,
473
- className: "cursor-pointer",
474
- children: [/* @__PURE__ */ z(pe, {}), /* @__PURE__ */ z("span", { children: d("nav.logOut") })]
475
- })
476
- ]
477
- })] }) }) });
478
- }
479
- //#endregion
480
- //#region src/components/router/page-content.tsx
481
- var Re = () => /* @__PURE__ */ z("div", {
482
- className: "flex flex-1 flex-col",
483
- children: /* @__PURE__ */ z("div", {
484
- className: "@container/main flex flex-1 flex-col gap-2",
485
- children: /* @__PURE__ */ z("div", {
486
- className: "flex flex-col gap-2 px-1 py-1 md:gap-3 md:px-2 md:py-2",
487
- children: /* @__PURE__ */ z(K, {})
488
- })
489
- })
490
- }), ze = ({ icon: e, title: t, urlBase: n, children: r }) => {
491
- let { items: i } = re(), a = J(), { t: o } = V(), s = i.length > 0 ? i[i.length - 1] : null, c = i.length > 1 ? i[i.length - 2] : null;
492
- return /* @__PURE__ */ z("header", {
493
- className: "flex h-(--header-height) shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)",
494
- children: /* @__PURE__ */ B("div", {
495
- className: "flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",
496
- children: [
497
- /* @__PURE__ */ z(u, { className: "-ml-1 hidden md:flex" }),
498
- /* @__PURE__ */ z(f, {
499
- orientation: "vertical",
500
- className: "mx-2 data-[orientation=vertical]:h-4 hidden md:block"
501
- }),
502
- /* @__PURE__ */ B("div", {
503
- className: "hidden md:flex items-center gap-1",
504
- children: [e && /* @__PURE__ */ z("div", {
505
- className: "flex h-8 w-8 items-center justify-center rounded-lg vg-accent-chip ring-1 mr-1",
506
- children: /* @__PURE__ */ z(e, { className: "size-4.5! vg-accent-text" })
507
- }), n ? /* @__PURE__ */ z(ie, { children: /* @__PURE__ */ z(ae, { children: i.map((e, t) => /* @__PURE__ */ B(L.Fragment, { children: [t > 0 && /* @__PURE__ */ z(E, {}), /* @__PURE__ */ z(C, { children: e.href ? /* @__PURE__ */ z(ne, {
508
- asChild: !0,
509
- children: /* @__PURE__ */ z(G, {
510
- to: e.href,
511
- children: e.label
512
- })
513
- }) : /* @__PURE__ */ z(T, { children: e.label }) })] }, e.label)) }) }) : /* @__PURE__ */ z("h1", {
514
- className: "text-base font-semibold",
515
- children: t
516
- })]
517
- }),
518
- /* @__PURE__ */ B("div", {
519
- className: "flex md:hidden items-center gap-2 min-w-0 flex-1",
520
- children: [
521
- c?.href && /* @__PURE__ */ z("button", {
522
- type: "button",
523
- title: o("common.goBack"),
524
- onClick: () => a(c.href),
525
- className: "shrink-0 flex items-center justify-center size-8 rounded-lg hover:bg-muted transition-colors",
526
- children: /* @__PURE__ */ z(ue, { className: "size-4" })
527
- }),
528
- e && /* @__PURE__ */ z("div", {
529
- className: "flex shrink-0 h-7 w-7 items-center justify-center rounded-lg vg-accent-chip ring-1",
530
- children: /* @__PURE__ */ z(e, { className: "size-3.5! vg-accent-text" })
531
- }),
532
- /* @__PURE__ */ z("span", {
533
- className: "text-sm font-semibold truncate",
534
- children: s?.label ?? t
535
- })
536
- ]
537
- }),
538
- /* @__PURE__ */ B("div", {
539
- className: "ml-auto flex items-center gap-2",
540
- children: [
541
- r && /* @__PURE__ */ z("div", {
542
- className: "hidden md:flex items-center",
543
- children: r
544
- }),
545
- /* @__PURE__ */ z("div", {
546
- className: "hidden md:block",
547
- children: /* @__PURE__ */ z(ee, {})
548
- }),
549
- /* @__PURE__ */ z(u, { className: "md:hidden" })
550
- ]
551
- })
552
- ]
553
- })
554
- });
555
- }, Be = ({ icon: e, title: t, urlBase: n }) => /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(ze, {
556
- icon: e,
557
- title: t,
558
- urlBase: n
559
- }), /* @__PURE__ */ z(Re, {})] }), Ve = ({ icon: e, feature: t, description: n, urlBase: r }) => {
560
- let i = m(), a = i?.isMobile ?? !1, o = i?.toggleSidebar ?? (() => {}), { t: s } = V(), c = /* @__PURE__ */ z("div", {
561
- className: `flex h-9 w-9 items-center justify-center rounded-lg vg-accent-chip ring-1 ${a ? "cursor-pointer active:scale-95 transition-transform" : ""}`,
562
- onClick: a ? o : void 0,
563
- onKeyDown: a ? (e) => {
564
- (e.key === "Enter" || e.key === " ") && o();
565
- } : void 0,
566
- tabIndex: a ? 0 : void 0,
567
- role: a ? "button" : void 0,
568
- title: a ? s("common.openNavigation", { defaultValue: "Open navigation" }) : void 0,
569
- children: /* @__PURE__ */ z(e, { className: "size-5! vg-accent-text" })
570
- }), l = /* @__PURE__ */ B("div", {
571
- className: "flex items-center gap-3",
572
- children: [c, /* @__PURE__ */ B("div", {
573
- className: "min-w-0",
574
- children: [/* @__PURE__ */ z("h1", {
575
- className: "text-base font-semibold leading-tight text-foreground truncate",
576
- children: t
577
- }), /* @__PURE__ */ z("p", {
578
- className: "hidden md:block text-xs text-muted-foreground leading-relaxed mt-0.5 truncate",
579
- children: n
580
- })]
581
- })]
582
- });
583
- return r && !a ? /* @__PURE__ */ z("div", {
584
- className: "min-w-0 flex-1",
585
- children: /* @__PURE__ */ z(G, {
586
- to: r,
587
- className: "group inline-flex max-w-full",
588
- children: l
589
- })
590
- }) : /* @__PURE__ */ z("div", {
591
- className: "min-w-0 flex-1",
592
- children: l
593
- });
594
- };
595
- Ve.displayName = "StickyPageHeaderTitle";
596
- var He = () => null;
597
- He.displayName = "StickyPageHeaderAction";
598
- var Ue = ({ children: t, menuLabel: i }) => {
599
- let a = J(), { t: c } = V(), l = [], u = [];
600
- L.Children.forEach(t, (e) => {
601
- L.isValidElement(e) && e.type?.displayName === "StickyPageHeaderAction" ? l.push(e.props) : u.push(e);
602
- });
603
- let d = i ?? c("common.actions");
604
- return /* @__PURE__ */ B("div", {
605
- className: "flex items-center gap-2 shrink-0",
606
- children: [u, l.length > 0 && /* @__PURE__ */ B(n, { children: [/* @__PURE__ */ z(e, {
607
- asChild: !0,
608
- children: i ? /* @__PURE__ */ B(s, {
609
- variant: "outline",
610
- size: "sm",
611
- className: "gap-1.5",
612
- children: [/* @__PURE__ */ z(H, { className: "size-4" }), /* @__PURE__ */ z("span", {
613
- className: "hidden sm:inline",
614
- children: i
615
- })]
616
- }) : /* @__PURE__ */ z(s, {
617
- variant: "ghost",
618
- size: "icon-sm",
619
- "aria-label": d,
620
- title: d,
621
- children: /* @__PURE__ */ z(H, { className: "size-5!" })
622
- })
623
- }), /* @__PURE__ */ z(o, {
624
- align: "end",
625
- children: l.map((e) => {
626
- let t = e.icon ?? U;
627
- return /* @__PURE__ */ B(r, {
628
- disabled: e.disabled,
629
- onClick: () => {
630
- e.href && a(e.href), e.onClick && e.onClick();
631
- },
632
- children: [/* @__PURE__ */ z(t, { className: "size-4 mr-2" }), e.label]
633
- }, e.label);
634
- })
635
- })] })]
636
- });
637
- };
638
- Ue.displayName = "StickyPageHeaderActions";
639
- var We = Object.assign(({ children: e }) => /* @__PURE__ */ z("header", {
640
- className: "sticky top-0 z-10 -mx-4 lg:-mx-6 mb-5 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",
641
- children: /* @__PURE__ */ B("div", {
642
- className: "flex w-full items-center gap-3 px-4 lg:px-6 py-3",
643
- children: [/* @__PURE__ */ B("div", {
644
- className: "hidden md:flex items-center gap-1",
645
- children: [/* @__PURE__ */ z(u, { className: "-ml-1" }), /* @__PURE__ */ z(f, {
646
- orientation: "vertical",
647
- className: "mx-2 data-[orientation=vertical]:h-4"
648
- })]
649
- }), e]
650
- })
651
- }), {
652
- Title: Ve,
653
- Actions: Ue,
654
- Action: He
655
- }), Ge = {
656
- comfortable: {
657
- outer: "px-1 md:px-6 lg:px-8 py-1 md:py-4",
658
- inset: "md:mr-1.5 md:my-1.5",
659
- main: "pt-2 md:pt-4"
660
- },
661
- compact: {
662
- outer: "px-0 py-0",
663
- inset: "min-w-0 md:mx-1.5",
664
- main: "pt-1 md:pt-2"
665
- }
666
- }, Ke = ({ outletContext: e, density: t = "comfortable", ...n }) => {
667
- let r = Ge[t];
668
- return /* @__PURE__ */ z("div", {
669
- className: `w-full ${r.outer} min-h-[calc(100svh-10.5rem)]`,
670
- children: /* @__PURE__ */ z("div", {
671
- className: "flex min-h-full w-full md:rounded-xl md:border md:bg-sidebar md:shadow-sm",
672
- children: /* @__PURE__ */ B(d, {
673
- defaultOpen: !0,
674
- className: "min-h-0!",
675
- style: {
676
- "--sidebar-width": "calc(var(--spacing) * 72)",
677
- "--header-height": "calc(var(--spacing) * 12)",
678
- minHeight: 0
679
- },
680
- children: [/* @__PURE__ */ z(Q, { ...n }), /* @__PURE__ */ z(b, {
681
- className: `${r.inset} md:rounded-xl md:border bg-background md:shadow-sm`,
682
- children: /* @__PURE__ */ z("main", {
683
- className: `flex flex-1 flex-col ${r.main} max-md:[&_.px-6]:px-2`,
684
- children: /* @__PURE__ */ z(K, { context: e })
685
- })
686
- })]
687
- })
688
- })
689
- });
690
- }, $ = () => null;
691
- $.displayName = "SubPageHeaderAction";
692
- var qe = Object.assign(({ icon: t, feature: i, name: a, description: c, urlBase: l, onDelete: d, open: p, setOpen: h, children: g }) => {
693
- let _ = m(), v = _?.isMobile ?? !1, y = _?.toggleSidebar ?? (() => {}), b = J(), { t: x } = V(), S = [];
694
- L.Children.forEach(g, (e) => {
695
- L.isValidElement(e) && Y(e) === "SubPageHeaderAction" && S.push(e.props);
696
- });
697
- let C = t && /* @__PURE__ */ z("div", {
698
- className: `flex h-9 w-9 items-center justify-center rounded-lg vg-accent-chip ring-1 ${v ? "cursor-pointer active:scale-95 transition-transform" : ""}`,
699
- onClick: v ? y : void 0,
700
- onKeyDown: v ? (e) => {
701
- (e.key === "Enter" || e.key === " ") && y();
702
- } : void 0,
703
- tabIndex: v ? 0 : void 0,
704
- title: v ? x("common.openNavigation", { defaultValue: "Open navigation" }) : void 0,
705
- children: /* @__PURE__ */ z(t, { className: "size-5! vg-accent-text" })
706
- }), w = /* @__PURE__ */ B("div", {
707
- className: "flex items-center gap-3",
708
- children: [C, /* @__PURE__ */ B("div", {
709
- className: "min-w-0",
710
- children: [/* @__PURE__ */ z("h1", {
711
- className: "text-base font-semibold leading-tight text-foreground",
712
- children: i
713
- }), /* @__PURE__ */ z("p", {
714
- className: "hidden md:block text-xs text-muted-foreground leading-relaxed mt-0.5",
715
- children: c
716
- })]
717
- })]
718
- });
719
- return /* @__PURE__ */ B("header", {
720
- className: "mb-5",
721
- children: [/* @__PURE__ */ B("div", {
722
- className: "flex w-full items-center gap-3 px-4 lg:px-6",
723
- children: [
724
- /* @__PURE__ */ B("div", {
725
- className: "hidden md:flex items-center gap-1",
726
- children: [/* @__PURE__ */ z(u, { className: "-ml-1" }), /* @__PURE__ */ z(f, {
727
- orientation: "vertical",
728
- className: "mx-2 data-[orientation=vertical]:h-4"
729
- })]
730
- }),
731
- /* @__PURE__ */ z("div", {
732
- className: "min-w-0 flex-1",
733
- children: l && !v ? /* @__PURE__ */ z(G, {
734
- to: l,
735
- className: "group inline-flex",
736
- children: w
737
- }) : w
738
- }),
739
- /* @__PURE__ */ B("div", {
740
- className: "flex items-center gap-2",
741
- children: [S.length > 0 && /* @__PURE__ */ B(n, { children: [/* @__PURE__ */ z(e, {
742
- asChild: !0,
743
- children: /* @__PURE__ */ B(s, {
744
- variant: "outline",
745
- size: "sm",
746
- className: "gap-1.5",
747
- children: [/* @__PURE__ */ z(H, { className: "size-4" }), /* @__PURE__ */ z("span", {
748
- className: "hidden sm:inline",
749
- children: x("common.actions", { defaultValue: "Actions" })
750
- })]
751
- })
752
- }), /* @__PURE__ */ z(o, {
753
- align: "end",
754
- children: S.map((e) => {
755
- let t = e.icon ?? U;
756
- return /* @__PURE__ */ B(r, {
757
- disabled: e.disabled,
758
- onClick: () => {
759
- e.href && b(e.href), e.onClick && e.onClick();
760
- },
761
- children: [/* @__PURE__ */ z(t, { className: "size-4 mr-2" }), e.label]
762
- }, e.label);
763
- })
764
- })] }), p !== void 0 && d !== void 0 && h !== void 0 && /* @__PURE__ */ z(I, {
765
- feature: i,
766
- name: a,
767
- onDelete: d,
768
- open: p,
769
- setOpen: h
770
- })]
771
- })
772
- ]
773
- }), /* @__PURE__ */ z(f, { className: "mt-3" })]
774
- });
775
- }, { Action: $ });
776
- //#endregion
777
- export { oe as BlankSlate, I as DialogDelete, se as GradientButtonLink, Me as GridList, Q as InternalSidebar, ce as LoadProvider, Ie as NavMain, Le as NavUser, Be as Page, Re as PageContent, ze as PageHeader, We as StickyPageHeader, Ke as SubPage, qe as SubPageHeader };
2
+ import { n as e, r as t, t as n } from "./loading-provider-ClDkFPuv.js";
3
+ export { t as DialogDelete, e as GradientButtonLink, n as LoadProvider };