@viglet/viglet-design-system 2026.3.8 → 2026.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{badge-locale-BxI9TwkE.js → badge-locale-CoEEv7s5.js} +98 -96
- package/dist/badge-locale-hQyWhAKe.cjs +7 -0
- package/dist/bento/bento-back-to-top.d.ts.map +1 -1
- package/dist/bento.cjs +1 -1
- package/dist/bento.es.js +56 -56
- package/dist/{breadcrumb.context-CGqjI0-U.js → breadcrumb.context-KQut7j8U.js} +30 -27
- package/dist/breadcrumb.context-Vwc3lAlf.cjs +1 -0
- package/dist/components/router/grid.list.d.ts.map +1 -1
- package/dist/components/router/sticky.page.header.d.ts.map +1 -1
- package/dist/components/router/sub.page.header.d.ts.map +1 -1
- package/dist/components/startup-first/startup-first.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/exports.json +1 -1
- package/dist/i18n/index.d.ts +28 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en/bento.json.d.ts +2 -1
- package/dist/i18n/locales/en/common.json.d.ts +10 -1
- package/dist/i18n/locales/en/dialog.json.d.ts +2 -1
- package/dist/i18n/locales/en/sidebar.json.d.ts +4 -1
- package/dist/i18n/locales/pt/bento.json.d.ts +2 -1
- package/dist/i18n/locales/pt/common.json.d.ts +10 -1
- package/dist/i18n/locales/pt/dialog.json.d.ts +2 -1
- package/dist/i18n/locales/pt/sidebar.json.d.ts +4 -1
- package/dist/{i18n-DuNITbWa.js → i18n-DD3rQOWi.js} +36 -8
- package/dist/i18n-DrBq-qJJ.cjs +1 -0
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.es.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +42 -33
- package/dist/{loading-provider-CMnOuvdR.js → loading-provider-BWWhhfEn.js} +12 -12
- package/dist/{loading-provider-1mgM91iY.cjs → loading-provider-CmeMqLGk.cjs} +1 -1
- package/dist/preset.css +3 -1
- package/dist/router.cjs +1 -1
- package/dist/router.es.js +134 -133
- package/dist/{user.context-r50nSWER.cjs → user.context-B9vIBzY5.cjs} +1 -1
- package/dist/{user.context-kPAqKN4o.js → user.context-D1PxP4D4.js} +16 -16
- package/dist/viglet-design-system.css +1 -1
- package/package.json +1 -1
- package/dist/badge-locale-sIsBdP_e.cjs +0 -7
- package/dist/breadcrumb.context-DYeZEC65.cjs +0 -1
- package/dist/i18n-DoNdMLEd.cjs +0 -1
package/dist/router.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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-
|
|
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
|
|
4
|
-
import { i as
|
|
5
|
-
import
|
|
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
6
|
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
9
|
import { Icon as he } from "@iconify/react";
|
|
10
10
|
import { NavLink as G, Outlet as K, useLocation as q, useNavigate as J } from "react-router-dom";
|
|
11
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";
|
|
@@ -17,11 +17,11 @@ function Y(e) {
|
|
|
17
17
|
//#region src/components/router/grid.list.tsx
|
|
18
18
|
var X = () => null;
|
|
19
19
|
X.displayName = "GridListNewButton";
|
|
20
|
-
var Z = () => null;
|
|
21
|
-
Z.displayName = "GridListAction";
|
|
22
20
|
var Te = () => null;
|
|
23
|
-
Te.displayName = "
|
|
24
|
-
var Ee =
|
|
21
|
+
Te.displayName = "GridListAction";
|
|
22
|
+
var Ee = () => null;
|
|
23
|
+
Ee.displayName = "GridListItemAction";
|
|
24
|
+
var De = [
|
|
25
25
|
"vg-accent-solid",
|
|
26
26
|
"from-emerald-500 to-teal-500",
|
|
27
27
|
"from-violet-500 to-purple-500",
|
|
@@ -31,15 +31,15 @@ var Ee = [
|
|
|
31
31
|
"from-fuchsia-500 to-pink-500",
|
|
32
32
|
"from-lime-500 to-emerald-500"
|
|
33
33
|
];
|
|
34
|
-
function
|
|
34
|
+
function Oe(e) {
|
|
35
35
|
let t = 0;
|
|
36
36
|
for (let n = 0; n < e.length; n++) t = (e.codePointAt(n) ?? 0) + ((t << 5) - t);
|
|
37
|
-
return
|
|
37
|
+
return De[Math.abs(t) % De.length];
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ke(e) {
|
|
40
40
|
return e.split(/[\s\-_]+/).filter(Boolean).slice(0, 2).map((e) => e[0].toUpperCase()).join("");
|
|
41
41
|
}
|
|
42
|
-
var
|
|
42
|
+
var Ae = {
|
|
43
43
|
columnFilteringFeature: ge,
|
|
44
44
|
globalFilteringFeature: xe,
|
|
45
45
|
rowPaginationFeature: Se,
|
|
@@ -48,7 +48,7 @@ var ke = {
|
|
|
48
48
|
filteredRowModel: ve(),
|
|
49
49
|
paginatedRowModel: ye(),
|
|
50
50
|
sortedRowModel: be()
|
|
51
|
-
},
|
|
51
|
+
}, je = [
|
|
52
52
|
{
|
|
53
53
|
accessorKey: "name",
|
|
54
54
|
header: "Name"
|
|
@@ -61,21 +61,20 @@ var ke = {
|
|
|
61
61
|
accessorKey: "url",
|
|
62
62
|
header: "URL"
|
|
63
63
|
}
|
|
64
|
-
],
|
|
65
|
-
let { t: c } =
|
|
66
|
-
|
|
67
|
-
if (
|
|
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
68
|
if (Y(e) === "GridListNewButton") {
|
|
69
69
|
let { to: t, label: n } = e.props;
|
|
70
70
|
d.push({
|
|
71
71
|
key: `new-${n}`,
|
|
72
72
|
render: () => /* @__PURE__ */ B(r, {
|
|
73
73
|
onClick: () => u(t),
|
|
74
|
-
children: [
|
|
75
|
-
|
|
76
|
-
"New "
|
|
77
|
-
|
|
78
|
-
]
|
|
74
|
+
children: [/* @__PURE__ */ z(U, { className: "size-4 mr-2" }), c("sidebar.new", {
|
|
75
|
+
feature: n,
|
|
76
|
+
defaultValue: "New {{feature}}"
|
|
77
|
+
})]
|
|
79
78
|
})
|
|
80
79
|
});
|
|
81
80
|
} else if (Y(e) === "GridListAction") {
|
|
@@ -96,13 +95,13 @@ var ke = {
|
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
97
|
});
|
|
99
|
-
let m = f.length > 0, g = f.filter((e) => e.position === "left"), b = f.filter((e) => e.position === "right"), [x, S] =
|
|
98
|
+
let m = f.length > 0, g = f.filter((e) => e.position === "left"), b = f.filter((e) => e.position === "right"), [x, S] = le({
|
|
100
99
|
pageIndex: 0,
|
|
101
100
|
pageSize: 12
|
|
102
|
-
}), [C, w] =
|
|
103
|
-
features:
|
|
101
|
+
}), [C, w] = L.useState([]), [T, E] = le(""), D = we({
|
|
102
|
+
features: Ae,
|
|
104
103
|
data: t,
|
|
105
|
-
columns:
|
|
104
|
+
columns: je,
|
|
106
105
|
onSortingChange: w,
|
|
107
106
|
state: {
|
|
108
107
|
globalFilter: T,
|
|
@@ -121,7 +120,7 @@ var ke = {
|
|
|
121
120
|
children: [
|
|
122
121
|
/* @__PURE__ */ B("div", {
|
|
123
122
|
className: "relative flex-1 max-w-sm",
|
|
124
|
-
children: [/* @__PURE__ */ z(
|
|
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, {
|
|
125
124
|
placeholder: c("forms.common.search"),
|
|
126
125
|
value: T ?? "",
|
|
127
126
|
onChange: (e) => E(e.target.value),
|
|
@@ -144,14 +143,14 @@ var ke = {
|
|
|
144
143
|
variant: "outline",
|
|
145
144
|
size: "sm",
|
|
146
145
|
className: "gap-1.5",
|
|
147
|
-
children: [/* @__PURE__ */ z(
|
|
146
|
+
children: [/* @__PURE__ */ z(H, { className: "size-4" }), /* @__PURE__ */ z("span", {
|
|
148
147
|
className: "hidden sm:inline",
|
|
149
148
|
children: c("forms.common.actions")
|
|
150
149
|
})]
|
|
151
150
|
})
|
|
152
151
|
}), /* @__PURE__ */ z(o, {
|
|
153
152
|
align: "end",
|
|
154
|
-
children: d.map((e) => /* @__PURE__ */ z(
|
|
153
|
+
children: d.map((e) => /* @__PURE__ */ z(L.Fragment, { children: e.render() }, e.key))
|
|
155
154
|
})] })
|
|
156
155
|
})
|
|
157
156
|
]
|
|
@@ -159,7 +158,7 @@ var ke = {
|
|
|
159
158
|
O.length > 0 ? /* @__PURE__ */ z("div", {
|
|
160
159
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",
|
|
161
160
|
children: O.map((e) => {
|
|
162
|
-
let t = e.getValue("name"), n = e.getValue("description"), r = e.getValue("url"), i = e.original.icon ?? void 0, a =
|
|
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, {
|
|
163
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)]",
|
|
164
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", {
|
|
165
164
|
className: "p-4 flex items-start gap-3",
|
|
@@ -220,7 +219,7 @@ var ke = {
|
|
|
220
219
|
className: "p-8",
|
|
221
220
|
children: /* @__PURE__ */ B("div", {
|
|
222
221
|
className: "text-center text-muted-foreground",
|
|
223
|
-
children: [/* @__PURE__ */ z(
|
|
222
|
+
children: [/* @__PURE__ */ z(W, { className: "h-8 w-8 mx-auto mb-2 opacity-40" }), /* @__PURE__ */ z("p", {
|
|
224
223
|
className: "text-sm",
|
|
225
224
|
children: c("forms.common.noResults")
|
|
226
225
|
})]
|
|
@@ -269,6 +268,7 @@ var ke = {
|
|
|
269
268
|
onClick: () => D.previousPage(),
|
|
270
269
|
disabled: !D.getCanPreviousPage(),
|
|
271
270
|
className: "h-8 w-8 p-0",
|
|
271
|
+
"aria-label": c("common.goToPreviousPage", { defaultValue: "Go to previous page" }),
|
|
272
272
|
children: /* @__PURE__ */ z("span", { children: "<" })
|
|
273
273
|
}), /* @__PURE__ */ z(s, {
|
|
274
274
|
variant: "outline",
|
|
@@ -276,6 +276,7 @@ var ke = {
|
|
|
276
276
|
onClick: () => D.nextPage(),
|
|
277
277
|
disabled: !D.getCanNextPage(),
|
|
278
278
|
className: "h-8 w-8 p-0",
|
|
279
|
+
"aria-label": c("common.goToNextPage", { defaultValue: "Go to next page" }),
|
|
279
280
|
children: /* @__PURE__ */ z("span", { children: ">" })
|
|
280
281
|
})]
|
|
281
282
|
})
|
|
@@ -285,37 +286,37 @@ var ke = {
|
|
|
285
286
|
});
|
|
286
287
|
}, {
|
|
287
288
|
NewButton: X,
|
|
288
|
-
Action:
|
|
289
|
-
ItemAction:
|
|
290
|
-
}),
|
|
289
|
+
Action: Te,
|
|
290
|
+
ItemAction: Ee
|
|
291
|
+
}), Ne = (e) => !e.url && (e.children?.length ?? 0) > 0, Pe = (e, t, n) => {
|
|
291
292
|
if (e.url) {
|
|
292
293
|
let r = (t ?? "") + e.url;
|
|
293
294
|
if (n === r || n.startsWith(r + "/")) return !0;
|
|
294
295
|
}
|
|
295
|
-
return e.children?.some((e) =>
|
|
296
|
-
},
|
|
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, {
|
|
297
298
|
tooltip: e.title,
|
|
298
|
-
isActive:
|
|
299
|
+
isActive: Pe(e, t, n),
|
|
299
300
|
asChild: !0,
|
|
300
301
|
children: /* @__PURE__ */ B(G, {
|
|
301
302
|
to: (t ?? "") + (e.url ?? ""),
|
|
302
303
|
onClick: i,
|
|
303
304
|
children: [e.icon && /* @__PURE__ */ z(e.icon, { className: "size-5!" }), /* @__PURE__ */ z("span", { children: e.title })]
|
|
304
305
|
})
|
|
305
|
-
}), !r && e.children && e.children.length > 0 && /* @__PURE__ */ z(
|
|
306
|
+
}), !r && e.children && e.children.length > 0 && /* @__PURE__ */ z(P, {
|
|
306
307
|
className: "ml-4",
|
|
307
|
-
children:
|
|
308
|
-
})] }, e.title)),
|
|
309
|
-
let { t: d } =
|
|
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;
|
|
310
311
|
return /* @__PURE__ */ B(S, {
|
|
311
312
|
collapsible: "icon",
|
|
312
313
|
variant: "inset",
|
|
313
314
|
position: "absolute",
|
|
314
315
|
children: [/* @__PURE__ */ z(D, {
|
|
315
316
|
className: "pb-3",
|
|
316
|
-
children: /* @__PURE__ */ z(
|
|
317
|
+
children: /* @__PURE__ */ z(P, { children: /* @__PURE__ */ B(g, {
|
|
317
318
|
className: "flex items-center",
|
|
318
|
-
children: [/* @__PURE__ */ z(
|
|
319
|
+
children: [/* @__PURE__ */ z(F, {
|
|
319
320
|
asChild: !0,
|
|
320
321
|
className: "data-[slot=sidebar-menu-button]:p-1.5!",
|
|
321
322
|
children: /* @__PURE__ */ B(G, {
|
|
@@ -336,7 +337,7 @@ var ke = {
|
|
|
336
337
|
size: "icon-sm",
|
|
337
338
|
onClick: c,
|
|
338
339
|
children: /* @__PURE__ */ z(fe, { className: "size-5!" })
|
|
339
|
-
}), !i && o && u && /* @__PURE__ */ z(
|
|
340
|
+
}), !i && o && u && /* @__PURE__ */ z(I, {
|
|
340
341
|
feature: t,
|
|
341
342
|
name: n,
|
|
342
343
|
onDelete: o,
|
|
@@ -345,32 +346,32 @@ var ke = {
|
|
|
345
346
|
})]
|
|
346
347
|
})]
|
|
347
348
|
}) })
|
|
348
|
-
}), /* @__PURE__ */ B(te, { children: [a?.counts && a.counts.length > 0 && /* @__PURE__ */ B(w, { children: [/* @__PURE__ */ z(A, { children: d("sidebar.indexing") }), /* @__PURE__ */ z(
|
|
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, {
|
|
349
350
|
className: "flex flex-col gap-2 pt-4",
|
|
350
|
-
children: /* @__PURE__ */ z(
|
|
351
|
-
tooltip: e.title + ": " +
|
|
351
|
+
children: /* @__PURE__ */ z(P, { children: a.counts.map((e) => /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ B(F, {
|
|
352
|
+
tooltip: e.title + ": " + Fe(e.count),
|
|
352
353
|
variant: "outline",
|
|
353
354
|
children: [e.icon && /* @__PURE__ */ z(e.icon, { className: "size-5!" }), /* @__PURE__ */ z("span", { children: e.title })]
|
|
354
|
-
}), !_ && /* @__PURE__ */ z(x, { children:
|
|
355
|
+
}), !_ && /* @__PURE__ */ z(x, { children: Fe(e.count) })] }, e.title)) })
|
|
355
356
|
})] }), (() => {
|
|
356
|
-
let e = a?.navMain ?? [], n = i ? e.filter((e) => e.showOnNew ?? e.url === "/detail") : e, o = n.filter((e) => !
|
|
357
|
-
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B(w, { children: [/* @__PURE__ */ z(A, { children: t }), /* @__PURE__ */ z(
|
|
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, {
|
|
358
359
|
className: "flex flex-col gap-2",
|
|
359
|
-
children: /* @__PURE__ */ z(
|
|
360
|
-
})] }), s.map((e) => /* @__PURE__ */ B(w, { children: [/* @__PURE__ */ z(A, { children: e.title }), /* @__PURE__ */ z(
|
|
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, {
|
|
361
362
|
className: "flex flex-col gap-2",
|
|
362
|
-
children: /* @__PURE__ */ z(
|
|
363
|
+
children: /* @__PURE__ */ z(P, { children: Z(e.children ?? [], r, f, _, v) })
|
|
363
364
|
})] }, e.title))] });
|
|
364
365
|
})()] })]
|
|
365
366
|
});
|
|
366
367
|
};
|
|
367
368
|
//#endregion
|
|
368
369
|
//#region src/components/router/nav-main.tsx
|
|
369
|
-
function
|
|
370
|
+
function Ie({ groups: e }) {
|
|
370
371
|
let t = q().pathname, { isMobile: n, setOpenMobile: r } = k();
|
|
371
|
-
return /* @__PURE__ */ z(R, { children: e.map((e) => /* @__PURE__ */ B(w, { children: [e.label && /* @__PURE__ */ z(A, { children: e.label }), /* @__PURE__ */ z(
|
|
372
|
+
return /* @__PURE__ */ z(R, { children: e.map((e) => /* @__PURE__ */ B(w, { children: [e.label && /* @__PURE__ */ z(A, { children: e.label }), /* @__PURE__ */ z(M, {
|
|
372
373
|
className: "flex flex-col gap-2",
|
|
373
|
-
children: /* @__PURE__ */ z(
|
|
374
|
+
children: /* @__PURE__ */ z(P, { children: e.items.map((e) => /* @__PURE__ */ z(g, { children: /* @__PURE__ */ z(F, {
|
|
374
375
|
tooltip: e.title,
|
|
375
376
|
isActive: t.startsWith(e.url),
|
|
376
377
|
asChild: !0,
|
|
@@ -384,27 +385,27 @@ function Fe({ groups: e }) {
|
|
|
384
385
|
}
|
|
385
386
|
//#endregion
|
|
386
387
|
//#region src/components/router/nav-user.tsx
|
|
387
|
-
function
|
|
388
|
-
let { t: d } =
|
|
388
|
+
function Le({ user: a, accountUrl: s, logoutUrl: l, onLogout: u }) {
|
|
389
|
+
let { t: d } = V(), { isMobile: f } = k(), p = () => {
|
|
389
390
|
u ? u() : l && (globalThis.location.href = l);
|
|
390
|
-
}, m =
|
|
391
|
+
}, m = L.useMemo(() => {
|
|
391
392
|
let e = a.firstName || "", t = a.lastName || "";
|
|
392
393
|
if (!e && !t) return " ";
|
|
393
394
|
let n = `${e} ${t}`.trim().split(" ").filter(Boolean);
|
|
394
395
|
return n.length === 1 ? n[0].charAt(0).toUpperCase() : n[0].charAt(0).toUpperCase() + (n.at(-1)?.charAt(0).toUpperCase() ?? "");
|
|
395
396
|
}, [a]), h = a?.avatarUrl || "";
|
|
396
|
-
return /* @__PURE__ */ z(
|
|
397
|
+
return /* @__PURE__ */ z(P, { children: /* @__PURE__ */ z(g, { children: /* @__PURE__ */ B(n, { children: [/* @__PURE__ */ z(e, {
|
|
397
398
|
asChild: !0,
|
|
398
|
-
children: /* @__PURE__ */ B(
|
|
399
|
+
children: /* @__PURE__ */ B(F, {
|
|
399
400
|
size: "lg",
|
|
400
401
|
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
401
402
|
children: [
|
|
402
|
-
/* @__PURE__ */ B(
|
|
403
|
+
/* @__PURE__ */ B(N, {
|
|
403
404
|
className: "h-8 w-8 rounded-lg",
|
|
404
405
|
children: [h && /* @__PURE__ */ z(O, {
|
|
405
406
|
src: h,
|
|
406
407
|
alt: a.username
|
|
407
|
-
}), /* @__PURE__ */ z(
|
|
408
|
+
}), /* @__PURE__ */ z(j, {
|
|
408
409
|
className: "rounded-lg",
|
|
409
410
|
children: m
|
|
410
411
|
})]
|
|
@@ -423,7 +424,7 @@ function Ie({ user: a, accountUrl: s, logoutUrl: l, onLogout: u }) {
|
|
|
423
424
|
children: a.email
|
|
424
425
|
})]
|
|
425
426
|
}),
|
|
426
|
-
/* @__PURE__ */ z(
|
|
427
|
+
/* @__PURE__ */ z(H, { className: "ml-auto size-4" })
|
|
427
428
|
]
|
|
428
429
|
})
|
|
429
430
|
}), /* @__PURE__ */ B(o, {
|
|
@@ -436,12 +437,12 @@ function Ie({ user: a, accountUrl: s, logoutUrl: l, onLogout: u }) {
|
|
|
436
437
|
className: "p-0 font-normal",
|
|
437
438
|
children: /* @__PURE__ */ B("div", {
|
|
438
439
|
className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm",
|
|
439
|
-
children: [/* @__PURE__ */ B(
|
|
440
|
+
children: [/* @__PURE__ */ B(N, {
|
|
440
441
|
className: "h-8 w-8 rounded-lg",
|
|
441
442
|
children: [h && /* @__PURE__ */ z(O, {
|
|
442
443
|
src: h,
|
|
443
444
|
alt: a.username
|
|
444
|
-
}), /* @__PURE__ */ z(
|
|
445
|
+
}), /* @__PURE__ */ z(j, {
|
|
445
446
|
className: "rounded-lg",
|
|
446
447
|
children: m
|
|
447
448
|
})]
|
|
@@ -477,7 +478,7 @@ function Ie({ user: a, accountUrl: s, logoutUrl: l, onLogout: u }) {
|
|
|
477
478
|
}
|
|
478
479
|
//#endregion
|
|
479
480
|
//#region src/components/router/page-content.tsx
|
|
480
|
-
var
|
|
481
|
+
var Re = () => /* @__PURE__ */ z("div", {
|
|
481
482
|
className: "flex flex-1 flex-col",
|
|
482
483
|
children: /* @__PURE__ */ z("div", {
|
|
483
484
|
className: "@container/main flex flex-1 flex-col gap-2",
|
|
@@ -486,8 +487,8 @@ var Le = () => /* @__PURE__ */ z("div", {
|
|
|
486
487
|
children: /* @__PURE__ */ z(K, {})
|
|
487
488
|
})
|
|
488
489
|
})
|
|
489
|
-
}),
|
|
490
|
-
let { items: i } =
|
|
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;
|
|
491
492
|
return /* @__PURE__ */ z("header", {
|
|
492
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)",
|
|
493
494
|
children: /* @__PURE__ */ B("div", {
|
|
@@ -503,7 +504,7 @@ var Le = () => /* @__PURE__ */ z("div", {
|
|
|
503
504
|
children: [e && /* @__PURE__ */ z("div", {
|
|
504
505
|
className: "flex h-8 w-8 items-center justify-center rounded-lg vg-accent-chip ring-1 mr-1",
|
|
505
506
|
children: /* @__PURE__ */ z(e, { className: "size-4.5! vg-accent-text" })
|
|
506
|
-
}), n ? /* @__PURE__ */ z(
|
|
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, {
|
|
507
508
|
asChild: !0,
|
|
508
509
|
children: /* @__PURE__ */ z(G, {
|
|
509
510
|
to: e.href,
|
|
@@ -551,24 +552,24 @@ var Le = () => /* @__PURE__ */ z("div", {
|
|
|
551
552
|
]
|
|
552
553
|
})
|
|
553
554
|
});
|
|
554
|
-
},
|
|
555
|
+
}, Be = ({ icon: e, title: t, urlBase: n }) => /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(ze, {
|
|
555
556
|
icon: e,
|
|
556
557
|
title: t,
|
|
557
558
|
urlBase: n
|
|
558
|
-
}), /* @__PURE__ */ z(
|
|
559
|
-
let i = m(), a = i?.isMobile ?? !1, o = i?.toggleSidebar ?? (() => {}), s = /* @__PURE__ */
|
|
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", {
|
|
560
571
|
className: "flex items-center gap-3",
|
|
561
|
-
children: [/* @__PURE__ */
|
|
562
|
-
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" : ""}`,
|
|
563
|
-
onClick: a ? o : void 0,
|
|
564
|
-
onKeyDown: a ? (e) => {
|
|
565
|
-
(e.key === "Enter" || e.key === " ") && o();
|
|
566
|
-
} : void 0,
|
|
567
|
-
tabIndex: a ? 0 : void 0,
|
|
568
|
-
role: a ? "button" : void 0,
|
|
569
|
-
title: a ? "Open navigation" : void 0,
|
|
570
|
-
children: /* @__PURE__ */ z(e, { className: "size-5! vg-accent-text" })
|
|
571
|
-
}), /* @__PURE__ */ B("div", {
|
|
572
|
+
children: [c, /* @__PURE__ */ B("div", {
|
|
572
573
|
className: "min-w-0",
|
|
573
574
|
children: [/* @__PURE__ */ z("h1", {
|
|
574
575
|
className: "text-base font-semibold leading-tight text-foreground truncate",
|
|
@@ -584,20 +585,20 @@ var Le = () => /* @__PURE__ */ z("div", {
|
|
|
584
585
|
children: /* @__PURE__ */ z(G, {
|
|
585
586
|
to: r,
|
|
586
587
|
className: "group inline-flex max-w-full",
|
|
587
|
-
children:
|
|
588
|
+
children: l
|
|
588
589
|
})
|
|
589
590
|
}) : /* @__PURE__ */ z("div", {
|
|
590
591
|
className: "min-w-0 flex-1",
|
|
591
|
-
children:
|
|
592
|
+
children: l
|
|
592
593
|
});
|
|
593
594
|
};
|
|
594
|
-
|
|
595
|
-
var
|
|
596
|
-
|
|
597
|
-
var
|
|
598
|
-
let a = J(), { t: c } =
|
|
599
|
-
|
|
600
|
-
|
|
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);
|
|
601
602
|
});
|
|
602
603
|
let d = i ?? c("common.actions");
|
|
603
604
|
return /* @__PURE__ */ B("div", {
|
|
@@ -608,7 +609,7 @@ var He = ({ children: t, menuLabel: i }) => {
|
|
|
608
609
|
variant: "outline",
|
|
609
610
|
size: "sm",
|
|
610
611
|
className: "gap-1.5",
|
|
611
|
-
children: [/* @__PURE__ */ z(
|
|
612
|
+
children: [/* @__PURE__ */ z(H, { className: "size-4" }), /* @__PURE__ */ z("span", {
|
|
612
613
|
className: "hidden sm:inline",
|
|
613
614
|
children: i
|
|
614
615
|
})]
|
|
@@ -617,12 +618,12 @@ var He = ({ children: t, menuLabel: i }) => {
|
|
|
617
618
|
size: "icon-sm",
|
|
618
619
|
"aria-label": d,
|
|
619
620
|
title: d,
|
|
620
|
-
children: /* @__PURE__ */ z(
|
|
621
|
+
children: /* @__PURE__ */ z(H, { className: "size-5!" })
|
|
621
622
|
})
|
|
622
623
|
}), /* @__PURE__ */ z(o, {
|
|
623
624
|
align: "end",
|
|
624
625
|
children: l.map((e) => {
|
|
625
|
-
let t = e.icon ??
|
|
626
|
+
let t = e.icon ?? U;
|
|
626
627
|
return /* @__PURE__ */ B(r, {
|
|
627
628
|
disabled: e.disabled,
|
|
628
629
|
onClick: () => {
|
|
@@ -634,8 +635,8 @@ var He = ({ children: t, menuLabel: i }) => {
|
|
|
634
635
|
})] })]
|
|
635
636
|
});
|
|
636
637
|
};
|
|
637
|
-
|
|
638
|
-
var
|
|
638
|
+
Ue.displayName = "StickyPageHeaderActions";
|
|
639
|
+
var We = Object.assign(({ children: e }) => /* @__PURE__ */ z("header", {
|
|
639
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",
|
|
640
641
|
children: /* @__PURE__ */ B("div", {
|
|
641
642
|
className: "flex w-full items-center gap-3 px-4 lg:px-6 py-3",
|
|
@@ -648,10 +649,10 @@ var Ue = Object.assign(({ children: e }) => /* @__PURE__ */ z("header", {
|
|
|
648
649
|
}), e]
|
|
649
650
|
})
|
|
650
651
|
}), {
|
|
651
|
-
Title:
|
|
652
|
-
Actions:
|
|
653
|
-
Action:
|
|
654
|
-
}),
|
|
652
|
+
Title: Ve,
|
|
653
|
+
Actions: Ue,
|
|
654
|
+
Action: He
|
|
655
|
+
}), Ge = {
|
|
655
656
|
comfortable: {
|
|
656
657
|
outer: "px-1 md:px-6 lg:px-8 py-1 md:py-4",
|
|
657
658
|
inset: "md:mr-1.5 md:my-1.5",
|
|
@@ -662,8 +663,8 @@ var Ue = Object.assign(({ children: e }) => /* @__PURE__ */ z("header", {
|
|
|
662
663
|
inset: "min-w-0 md:mx-1.5",
|
|
663
664
|
main: "pt-1 md:pt-2"
|
|
664
665
|
}
|
|
665
|
-
},
|
|
666
|
-
let r =
|
|
666
|
+
}, Ke = ({ outletContext: e, density: t = "comfortable", ...n }) => {
|
|
667
|
+
let r = Ge[t];
|
|
667
668
|
return /* @__PURE__ */ z("div", {
|
|
668
669
|
className: `w-full ${r.outer} min-h-[calc(100svh-10.5rem)]`,
|
|
669
670
|
children: /* @__PURE__ */ z("div", {
|
|
@@ -676,7 +677,7 @@ var Ue = Object.assign(({ children: e }) => /* @__PURE__ */ z("header", {
|
|
|
676
677
|
"--header-height": "calc(var(--spacing) * 12)",
|
|
677
678
|
minHeight: 0
|
|
678
679
|
},
|
|
679
|
-
children: [/* @__PURE__ */ z(
|
|
680
|
+
children: [/* @__PURE__ */ z(Q, { ...n }), /* @__PURE__ */ z(b, {
|
|
680
681
|
className: `${r.inset} md:rounded-xl md:border bg-background md:shadow-sm`,
|
|
681
682
|
children: /* @__PURE__ */ z("main", {
|
|
682
683
|
className: `flex flex-1 flex-col ${r.main} max-md:[&_.px-6]:px-2`,
|
|
@@ -686,25 +687,25 @@ var Ue = Object.assign(({ children: e }) => /* @__PURE__ */ z("header", {
|
|
|
686
687
|
})
|
|
687
688
|
})
|
|
688
689
|
});
|
|
689
|
-
},
|
|
690
|
-
|
|
690
|
+
}, $ = () => null;
|
|
691
|
+
$.displayName = "SubPageHeaderAction";
|
|
691
692
|
var qe = Object.assign(({ icon: t, feature: i, name: a, description: c, urlBase: l, onDelete: d, open: p, setOpen: h, children: g }) => {
|
|
692
|
-
let _ = m(), v = _?.isMobile ?? !1, y = _?.toggleSidebar ?? (() => {}), b = J(), x = [];
|
|
693
|
-
|
|
694
|
-
|
|
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);
|
|
695
696
|
});
|
|
696
|
-
let
|
|
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", {
|
|
697
707
|
className: "flex items-center gap-3",
|
|
698
|
-
children: [
|
|
699
|
-
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" : ""}`,
|
|
700
|
-
onClick: v ? y : void 0,
|
|
701
|
-
onKeyDown: v ? (e) => {
|
|
702
|
-
(e.key === "Enter" || e.key === " ") && y();
|
|
703
|
-
} : void 0,
|
|
704
|
-
tabIndex: v ? 0 : void 0,
|
|
705
|
-
title: v ? "Open navigation" : void 0,
|
|
706
|
-
children: /* @__PURE__ */ z(t, { className: "size-5! vg-accent-text" })
|
|
707
|
-
}), /* @__PURE__ */ B("div", {
|
|
708
|
+
children: [C, /* @__PURE__ */ B("div", {
|
|
708
709
|
className: "min-w-0",
|
|
709
710
|
children: [/* @__PURE__ */ z("h1", {
|
|
710
711
|
className: "text-base font-semibold leading-tight text-foreground",
|
|
@@ -732,26 +733,26 @@ var qe = Object.assign(({ icon: t, feature: i, name: a, description: c, urlBase:
|
|
|
732
733
|
children: l && !v ? /* @__PURE__ */ z(G, {
|
|
733
734
|
to: l,
|
|
734
735
|
className: "group inline-flex",
|
|
735
|
-
children:
|
|
736
|
-
}) :
|
|
736
|
+
children: w
|
|
737
|
+
}) : w
|
|
737
738
|
}),
|
|
738
739
|
/* @__PURE__ */ B("div", {
|
|
739
740
|
className: "flex items-center gap-2",
|
|
740
|
-
children: [
|
|
741
|
+
children: [S.length > 0 && /* @__PURE__ */ B(n, { children: [/* @__PURE__ */ z(e, {
|
|
741
742
|
asChild: !0,
|
|
742
743
|
children: /* @__PURE__ */ B(s, {
|
|
743
744
|
variant: "outline",
|
|
744
745
|
size: "sm",
|
|
745
746
|
className: "gap-1.5",
|
|
746
|
-
children: [/* @__PURE__ */ z(
|
|
747
|
+
children: [/* @__PURE__ */ z(H, { className: "size-4" }), /* @__PURE__ */ z("span", {
|
|
747
748
|
className: "hidden sm:inline",
|
|
748
|
-
children: "Actions"
|
|
749
|
+
children: x("common.actions", { defaultValue: "Actions" })
|
|
749
750
|
})]
|
|
750
751
|
})
|
|
751
752
|
}), /* @__PURE__ */ z(o, {
|
|
752
753
|
align: "end",
|
|
753
|
-
children:
|
|
754
|
-
let t = e.icon ??
|
|
754
|
+
children: S.map((e) => {
|
|
755
|
+
let t = e.icon ?? U;
|
|
755
756
|
return /* @__PURE__ */ B(r, {
|
|
756
757
|
disabled: e.disabled,
|
|
757
758
|
onClick: () => {
|
|
@@ -760,7 +761,7 @@ var qe = Object.assign(({ icon: t, feature: i, name: a, description: c, urlBase:
|
|
|
760
761
|
children: [/* @__PURE__ */ z(t, { className: "size-4 mr-2" }), e.label]
|
|
761
762
|
}, e.label);
|
|
762
763
|
})
|
|
763
|
-
})] }), p !== void 0 && d !== void 0 && h !== void 0 && /* @__PURE__ */ z(
|
|
764
|
+
})] }), p !== void 0 && d !== void 0 && h !== void 0 && /* @__PURE__ */ z(I, {
|
|
764
765
|
feature: i,
|
|
765
766
|
name: a,
|
|
766
767
|
onDelete: d,
|
|
@@ -771,6 +772,6 @@ var qe = Object.assign(({ icon: t, feature: i, name: a, description: c, urlBase:
|
|
|
771
772
|
]
|
|
772
773
|
}), /* @__PURE__ */ z(f, { className: "mt-3" })]
|
|
773
774
|
});
|
|
774
|
-
}, { Action:
|
|
775
|
+
}, { Action: $ });
|
|
775
776
|
//#endregion
|
|
776
|
-
export {
|
|
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 };
|