@cryptlex/web-components 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -13
- package/dist/components/data-table/column-picker.es.js +3 -4
- package/dist/components/data-table/column-picker.es.js.map +1 -1
- package/dist/components/data-table/data-table.es.js +75 -76
- package/dist/components/data-table/data-table.es.js.map +1 -1
- package/dist/components/data-table/page-size.es.js +5 -5
- package/dist/components/data-table/page-size.es.js.map +1 -1
- package/dist/components/data-table/paginator.es.js +25 -31
- package/dist/components/data-table/paginator.es.js.map +1 -1
- package/dist/components/data-table/table-actions.es.js +26 -27
- package/dist/components/data-table/table-actions.es.js.map +1 -1
- package/dist/components/data-table/table-content.es.js +31 -25
- package/dist/components/data-table/table-content.es.js.map +1 -1
- package/dist/components/data-table/table-filter.es.js +42 -45
- package/dist/components/data-table/table-filter.es.js.map +1 -1
- package/dist/components/key-value-card/key-value-card.es.js +17 -14
- package/dist/components/key-value-card/key-value-card.es.js.map +1 -1
- package/dist/components/sidebar/app-layout.es.js +11 -15
- package/dist/components/sidebar/app-layout.es.js.map +1 -1
- package/dist/components/sidebar/breadcrumb.es.js +2 -3
- package/dist/components/sidebar/breadcrumb.es.js.map +1 -1
- package/dist/components/sidebar/nav-main.es.js +18 -18
- package/dist/components/sidebar/nav-main.es.js.map +1 -1
- package/dist/components/static-data-table/data-table.es.js +14 -14
- package/dist/components/static-data-table/data-table.es.js.map +1 -1
- package/dist/components/ui/accordion.es.js +9 -9
- package/dist/components/ui/accordion.es.js.map +1 -1
- package/dist/components/ui/avatar.es.js +16 -16
- package/dist/components/ui/avatar.es.js.map +1 -1
- package/dist/components/ui/badge.es.js +5 -24
- package/dist/components/ui/badge.es.js.map +1 -1
- package/dist/components/ui/breadcrumb.es.js +10 -10
- package/dist/components/ui/breadcrumb.es.js.map +1 -1
- package/dist/components/ui/button.es.js +17 -18
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/calendar.es.js +8 -8
- package/dist/components/ui/calendar.es.js.map +1 -1
- package/dist/components/ui/card.es.js +21 -21
- package/dist/components/ui/card.es.js.map +1 -1
- package/dist/components/ui/chart.es.js +76 -102
- package/dist/components/ui/chart.es.js.map +1 -1
- package/dist/components/ui/checkbox.es.js +13 -19
- package/dist/components/ui/checkbox.es.js.map +1 -1
- package/dist/components/ui/command.es.js +4 -4
- package/dist/components/ui/command.es.js.map +1 -1
- package/dist/components/ui/copy-button.es.js +20 -34
- package/dist/components/ui/copy-button.es.js.map +1 -1
- package/dist/components/ui/dialog.es.js +32 -32
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/components/ui/drawer.es.js +2 -2
- package/dist/components/ui/drawer.es.js.map +1 -1
- package/dist/components/ui/dropdown-menu.es.js +74 -82
- package/dist/components/ui/dropdown-menu.es.js.map +1 -1
- package/dist/components/ui/input-otp.es.js +17 -17
- package/dist/components/ui/input-otp.es.js.map +1 -1
- package/dist/components/ui/input.es.js +7 -7
- package/dist/components/ui/input.es.js.map +1 -1
- package/dist/components/ui/link-button.es.js +6 -6
- package/dist/components/ui/link-button.es.js.map +1 -1
- package/dist/components/ui/mutli-select.es.js +52 -52
- package/dist/components/ui/mutli-select.es.js.map +1 -1
- package/dist/components/ui/navigation-menu.es.js +34 -34
- package/dist/components/ui/navigation-menu.es.js.map +1 -1
- package/dist/components/ui/pagination.es.js +38 -38
- package/dist/components/ui/pagination.es.js.map +1 -1
- package/dist/components/ui/password-input.es.js +13 -13
- package/dist/components/ui/password-input.es.js.map +1 -1
- package/dist/components/ui/radio-group.es.js +11 -11
- package/dist/components/ui/radio-group.es.js.map +1 -1
- package/dist/components/ui/search-input.es.js +11 -11
- package/dist/components/ui/search-input.es.js.map +1 -1
- package/dist/components/ui/select.es.js +31 -49
- package/dist/components/ui/select.es.js.map +1 -1
- package/dist/components/ui/sheet.es.js +17 -17
- package/dist/components/ui/sheet.es.js.map +1 -1
- package/dist/components/ui/sidebar.es.js +2 -3
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/components/ui/table-page-layout.es.js +2 -2
- package/dist/components/ui/table-page-layout.es.js.map +1 -1
- package/dist/components/ui/table.es.js +33 -33
- package/dist/components/ui/table.es.js.map +1 -1
- package/dist/components/ui/tabs.es.js +2 -2
- package/dist/components/ui/tabs.es.js.map +1 -1
- package/dist/components/ui/tooltip.es.js +8 -8
- package/dist/components/ui/tooltip.es.js.map +1 -1
- package/dist/index.es.d.ts +20 -48
- package/dist/index.es.js +253 -257
- package/dist/utils/index.es.js.map +1 -1
- package/lib/index.css +24 -5
- package/lib/tailwind.preset.css +50 -38
- package/lib/tokens.css +0 -9
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { Badge as c } from "../ui/badge.es.js";
|
|
3
3
|
import "../ui/accordion.es.js";
|
|
4
4
|
import "../ui/avatar.es.js";
|
|
@@ -10,7 +10,7 @@ import "../ui/chart.es.js";
|
|
|
10
10
|
import "../ui/checkbox.es.js";
|
|
11
11
|
import "@radix-ui/react-collapsible";
|
|
12
12
|
import "../ui/command.es.js";
|
|
13
|
-
import { CopyButton as
|
|
13
|
+
import { CopyButton as x } from "../ui/copy-button.es.js";
|
|
14
14
|
import "../ui/dialog.es.js";
|
|
15
15
|
import "../ui/drawer.es.js";
|
|
16
16
|
import "../ui/dropdown-menu.es.js";
|
|
@@ -18,7 +18,7 @@ import "../ui/form.es.js";
|
|
|
18
18
|
import "../ui/input.es.js";
|
|
19
19
|
import "../ui/input-otp.es.js";
|
|
20
20
|
import "../ui/label.es.js";
|
|
21
|
-
import { Link as
|
|
21
|
+
import { Link as u } from "@tanstack/react-router";
|
|
22
22
|
import "lucide-react";
|
|
23
23
|
import "../ui/mutli-select.es.js";
|
|
24
24
|
import "../ui/navigation-menu.es.js";
|
|
@@ -37,37 +37,40 @@ import "../ui/table.es.js";
|
|
|
37
37
|
import "../ui/tabs.es.js";
|
|
38
38
|
import "../ui/tooltip.es.js";
|
|
39
39
|
import { FormatDate as w } from "../data-table/table-utils/date.es.js";
|
|
40
|
-
const ir = ({ data:
|
|
40
|
+
const ir = ({ data: n, label: m, fields: s }) => {
|
|
41
41
|
const a = (p, r) => {
|
|
42
42
|
if (p.transform)
|
|
43
43
|
return p.transform(r);
|
|
44
|
-
if (
|
|
44
|
+
if (r == null)
|
|
45
45
|
return "-";
|
|
46
46
|
switch (p.type) {
|
|
47
47
|
case "link":
|
|
48
|
-
return /* @__PURE__ */ t(
|
|
48
|
+
return /* @__PURE__ */ t(u, { to: r, children: r });
|
|
49
49
|
case "copyButton":
|
|
50
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ e("span", { className: "flex items-center gap-2", children: [
|
|
51
|
+
r,
|
|
52
|
+
/* @__PURE__ */ t(x, { value: r })
|
|
53
|
+
] });
|
|
51
54
|
case "date":
|
|
52
55
|
return /* @__PURE__ */ t("span", { children: w(r) });
|
|
53
56
|
case "yesno":
|
|
54
57
|
return /* @__PURE__ */ t("span", { children: r ? "Yes" : "No" });
|
|
55
58
|
case "badge":
|
|
56
|
-
return /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: Array.isArray(r) ? r.map((o, i) => /* @__PURE__ */ t(c, {
|
|
59
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: Array.isArray(r) ? r.map((o, i) => /* @__PURE__ */ t(c, { children: typeof o == "object" ? (o == null ? void 0 : o.name) || (o == null ? void 0 : o.id) : o }, i)) : r });
|
|
57
60
|
case "boolean":
|
|
58
61
|
return /* @__PURE__ */ t("span", { children: r.toString() });
|
|
59
62
|
default:
|
|
60
63
|
return /* @__PURE__ */ t("span", { children: r });
|
|
61
64
|
}
|
|
62
65
|
};
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(f, { children:
|
|
65
|
-
/* @__PURE__ */ t(h, { children: /* @__PURE__ */ t("div", { className: "flex flex-col gap-2", children:
|
|
66
|
+
return /* @__PURE__ */ e(l, { children: [
|
|
67
|
+
/* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(f, { children: m }) }),
|
|
68
|
+
/* @__PURE__ */ t(h, { children: /* @__PURE__ */ t("div", { className: "flex flex-col gap-2", children: n ? s.map((p) => {
|
|
66
69
|
const r = p.accessor ? p.accessor.split(".").reduce(
|
|
67
70
|
(o, i) => o && i in o ? o[i] : void 0,
|
|
68
|
-
|
|
71
|
+
n
|
|
69
72
|
) : null;
|
|
70
|
-
return /* @__PURE__ */
|
|
73
|
+
return /* @__PURE__ */ e(
|
|
71
74
|
"div",
|
|
72
75
|
{
|
|
73
76
|
className: "flex w-full flex-col md:flex-row justify-between first:pt-0 last:pb-0",
|
|
@@ -78,7 +81,7 @@ const ir = ({ data: e, label: s, fields: n }) => {
|
|
|
78
81
|
},
|
|
79
82
|
p.display
|
|
80
83
|
);
|
|
81
|
-
}) :
|
|
84
|
+
}) : s.map((p, r) => /* @__PURE__ */ t(y, { className: "h-12 w-full" }, r)) }) })
|
|
82
85
|
] });
|
|
83
86
|
};
|
|
84
87
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value-card.es.js","sources":["../../../lib/components/key-value-card/key-value-card.tsx"],"sourcesContent":["import { Badge } from '@/components/ui/badge';\nimport {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n CopyButton,\n FormatDate,\n Skeleton,\n} from '@/index';\nimport { Link } from '@tanstack/react-router';\n\n// Utility type to handle nested keys (dot notation) in any object\ntype NestedKeyOf<T> = T extends object\n ? {\n
|
|
1
|
+
{"version":3,"file":"key-value-card.es.js","sources":["../../../lib/components/key-value-card/key-value-card.tsx"],"sourcesContent":["import { Badge } from '@/components/ui/badge';\nimport {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n CopyButton,\n FormatDate,\n Skeleton,\n} from '@/index';\nimport { Link } from '@tanstack/react-router';\n\n// Utility type to handle nested keys (dot notation) in any object\ntype NestedKeyOf<T> = T extends object\n ? {\n [K in keyof T]: K extends string | number\n ? `${K & string}` | `${K & string}.${NestedKeyOf<T[K]>}`\n : never;\n }[keyof T]\n : never;\n\n// DisplayField type that works with nested keys\nexport type DisplayField<T> = {\n display: string;\n accessor: NestedKeyOf<T>;\n type?: 'text' | 'badge' | 'boolean' | 'date' | 'yesno' | 'copyButton' | 'link'; // Field types\n transform?: (value: any) => React.ReactNode;\n};\n\nexport interface KeyValueCardProps<T> {\n data: T; // Ensure data is of type T\n label: string;\n fields: DisplayField<T>[];\n className?: string;\n}\n\nexport const KeyValueCard = <T extends {}>({ data, label, fields }: KeyValueCardProps<T>) => {\n const renderValue = (field: DisplayField<T>, value: any) => {\n if (field.transform) {\n return field.transform(value);\n }\n if (value === undefined || value === null) {\n return '-';\n }\n switch (field.type) {\n case 'link':\n return <Link to={value}>{value}</Link>;\n case 'copyButton':\n return <span className='flex items-center gap-2'>{value}<CopyButton value={value} /></span>;\n case 'date':\n return <span>{FormatDate(value)}</span>;\n case 'yesno':\n return <span>{value ? 'Yes' : 'No'}</span>;\n case 'badge':\n return (\n <div className=\"flex flex-wrap gap-1\">\n {Array.isArray(value)\n ? value.map((item, index) => (\n <Badge key={index}>\n {typeof item === 'object' ? item?.name || item?.id : item}\n </Badge>\n ))\n : value}\n </div>\n );\n\n case 'boolean':\n return <span>{value.toString()}</span>;\n default:\n return <span>{value}</span>;\n }\n };\n\n return (\n <Card>\n <CardHeader>\n <CardTitle>{label}</CardTitle>\n </CardHeader>\n <CardContent>\n <div className=\"flex flex-col gap-2\">\n {data\n ? fields.map((field) => {\n // TODO: improve this\n const value = field.accessor\n ? field.accessor\n .split('.')\n .reduce(\n (obj, key) => (obj && key in obj ? obj[key] : undefined),\n data as Record<string, any>,\n )\n : null;\n\n return (\n <div\n key={field.display}\n className=\"flex w-full flex-col md:flex-row justify-between first:pt-0 last:pb-0\"\n >\n <p className=\"text-sm flex w-full justify-start col-span-1\">{field.display}</p>\n <div className=\"text-sm flex w-full justify-start text-wrap break-all\">\n {renderValue(field, value)}\n </div>\n </div>\n );\n })\n : fields.map((_, index) => <Skeleton key={index} className=\"h-12 w-full\" />)}\n </div>\n </CardContent>\n </Card>\n );\n};\n"],"names":["KeyValueCard","data","label","fields","renderValue","field","value","jsx","Link","jsxs","CopyButton","FormatDate","item","index","Badge","Card","CardHeader","CardTitle","CardContent","obj","key","_","Skeleton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,MAAMA,KAAe,CAAe,EAAE,MAAAC,GAAM,OAAAC,GAAO,QAAAC,QAAmC;AACrF,QAAAC,IAAc,CAACC,GAAwBC,MAAe;AAC1D,QAAID,EAAM;AACD,aAAAA,EAAM,UAAUC,CAAK;AAE1B,QAAuBA,KAAU;AAC5B,aAAA;AAET,YAAQD,EAAM,MAAM;AAAA,MAClB,KAAK;AACH,eAAQ,gBAAAE,EAAAC,GAAA,EAAK,IAAIF,GAAQ,UAAMA,GAAA;AAAA,MACjC,KAAK;AACI,eAAA,gBAAAG,EAAC,QAAK,EAAA,WAAU,2BAA2B,UAAA;AAAA,UAAAH;AAAA,UAAM,gBAAAC,EAACG,KAAW,OAAAJ,EAAc,CAAA;AAAA,QAAA,GAAE;AAAA,MACtF,KAAK;AACH,eAAQ,gBAAAC,EAAA,QAAA,EAAM,UAAWI,EAAAL,CAAK,GAAE;AAAA,MAClC,KAAK;AACH,eAAQ,gBAAAC,EAAA,QAAA,EAAM,UAAQD,IAAA,QAAQ,MAAK;AAAA,MACrC,KAAK;AAED,eAAA,gBAAAC,EAAC,OAAI,EAAA,WAAU,wBACZ,UAAA,MAAM,QAAQD,CAAK,IAChBA,EAAM,IAAI,CAACM,GAAMC,wBAChBC,GACE,EAAA,UAAA,OAAOF,KAAS,YAAWA,KAAA,gBAAAA,EAAM,UAAQA,KAAA,gBAAAA,EAAM,MAAKA,EAD3C,GAAAC,CAEZ,CACD,IACCP,EACN,CAAA;AAAA,MAGJ,KAAK;AACH,eAAQ,gBAAAC,EAAA,QAAA,EAAM,UAAMD,EAAA,SAAA,GAAW;AAAA,MACjC;AACS,eAAA,gBAAAC,EAAC,UAAM,UAAMD,EAAA,CAAA;AAAA,IAAA;AAAA,EAE1B;AAEA,2BACGS,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAR,EAACS,GACC,EAAA,UAAA,gBAAAT,EAACU,GAAW,EAAA,UAAAf,EAAM,CAAA,GACpB;AAAA,IACA,gBAAAK,EAACW,GACC,EAAA,UAAA,gBAAAX,EAAC,OAAI,EAAA,WAAU,uBACZ,UACGN,IAAAE,EAAO,IAAI,CAACE,MAAU;AAEtB,YAAMC,IAAQD,EAAM,WAChBA,EAAM,SACL,MAAM,GAAG,EACT;AAAA,QACC,CAACc,GAAKC,MAASD,KAAOC,KAAOD,IAAMA,EAAIC,CAAG,IAAI;AAAA,QAC9CnB;AAAA,MAAA,IAEF;AAGF,aAAA,gBAAAQ;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UAEV,UAAA;AAAA,YAAA,gBAAAF,EAAC,KAAE,EAAA,WAAU,gDAAgD,UAAAF,EAAM,SAAQ;AAAA,8BAC1E,OAAI,EAAA,WAAU,yDACZ,UAAYD,EAAAC,GAAOC,CAAK,EAC3B,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QANKD,EAAM;AAAA,MAOb;AAAA,IAEH,CAAA,IACCF,EAAO,IAAI,CAACkB,GAAGR,MAAW,gBAAAN,EAAAe,GAAA,EAAqB,WAAU,cAAA,GAAjBT,CAA+B,CAAE,EAC/E,CAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { BreadCrumbs as p } from "./breadcrumb.es.js";
|
|
3
3
|
import { SideBar as l } from "./sidebar.es.js";
|
|
4
|
-
import { SidebarProvider as
|
|
4
|
+
import { SidebarProvider as c, SidebarTrigger as a } from "../ui/sidebar.es.js";
|
|
5
5
|
import "../ui/accordion.es.js";
|
|
6
6
|
import { Avatar as n, AvatarImage as d, AvatarFallback as f } from "../ui/avatar.es.js";
|
|
7
|
-
import "
|
|
7
|
+
import { logout as h } from "../../utils/index.es.js";
|
|
8
8
|
import "../ui/breadcrumb.es.js";
|
|
9
9
|
import "../ui/button.es.js";
|
|
10
10
|
import "../ui/calendar.es.js";
|
|
@@ -13,16 +13,15 @@ import "../ui/chart.es.js";
|
|
|
13
13
|
import "../ui/checkbox.es.js";
|
|
14
14
|
import "@radix-ui/react-collapsible";
|
|
15
15
|
import "../ui/command.es.js";
|
|
16
|
-
import {
|
|
16
|
+
import { LogOutIcon as s } from "lucide-react";
|
|
17
17
|
import "react";
|
|
18
18
|
import "../ui/dialog.es.js";
|
|
19
19
|
import "../ui/drawer.es.js";
|
|
20
|
-
import { DropdownMenu as
|
|
20
|
+
import { DropdownMenu as v, DropdownMenuTrigger as x, DropdownMenuContent as g, DropdownMenuItem as N } from "../ui/dropdown-menu.es.js";
|
|
21
21
|
import "../ui/form.es.js";
|
|
22
22
|
import "../ui/input.es.js";
|
|
23
23
|
import "../ui/input-otp.es.js";
|
|
24
24
|
import "../ui/label.es.js";
|
|
25
|
-
import { logout as N } from "../../utils/index.es.js";
|
|
26
25
|
import { Outlet as b } from "@tanstack/react-router";
|
|
27
26
|
import "../ui/mutli-select.es.js";
|
|
28
27
|
import "../ui/navigation-menu.es.js";
|
|
@@ -37,15 +36,15 @@ import "sonner";
|
|
|
37
36
|
import "../ui/table.es.js";
|
|
38
37
|
import "../ui/tabs.es.js";
|
|
39
38
|
import "../ui/tooltip.es.js";
|
|
40
|
-
function
|
|
39
|
+
function mr({ data: e, user: o }) {
|
|
41
40
|
var t, m;
|
|
42
|
-
return /* @__PURE__ */ r("div", { className: "h-dvh flex", children: /* @__PURE__ */ i(
|
|
41
|
+
return /* @__PURE__ */ r("div", { className: "h-dvh flex", children: /* @__PURE__ */ i(c, { children: [
|
|
43
42
|
/* @__PURE__ */ r(l, { data: e }),
|
|
44
43
|
/* @__PURE__ */ i("div", { className: "flex flex-col h-screen w-full overflow-auto", children: [
|
|
45
44
|
/* @__PURE__ */ i("header", { className: "h-[7vh] sticky top-0 bg-card flex items-center justify-between p-4 pl-0 border-b z-10", children: [
|
|
46
|
-
/* @__PURE__ */ r("div", { className: "flex gap-1 items-center", children: /* @__PURE__ */ r(
|
|
47
|
-
/* @__PURE__ */ i(
|
|
48
|
-
/* @__PURE__ */ r(
|
|
45
|
+
/* @__PURE__ */ r("div", { className: "flex gap-1 items-center", children: /* @__PURE__ */ r(a, {}) }),
|
|
46
|
+
/* @__PURE__ */ i(v, { children: [
|
|
47
|
+
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r("div", { className: "cursor-pointer", children: /* @__PURE__ */ i(n, { className: "justify-center items-center", children: [
|
|
49
48
|
/* @__PURE__ */ r(
|
|
50
49
|
d,
|
|
51
50
|
{
|
|
@@ -58,10 +57,7 @@ function er({ data: e, user: o }) {
|
|
|
58
57
|
(m = o == null ? void 0 : o.lastName) == null ? void 0 : m.charAt(0)
|
|
59
58
|
] })
|
|
60
59
|
] }) }) }),
|
|
61
|
-
/* @__PURE__ */ r(
|
|
62
|
-
/* @__PURE__ */ r(h, {}),
|
|
63
|
-
" Logout"
|
|
64
|
-
] }) })
|
|
60
|
+
/* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(N, { icon: s, onClick: () => h(), children: "Logout" }) })
|
|
65
61
|
] })
|
|
66
62
|
] }),
|
|
67
63
|
/* @__PURE__ */ i("div", { className: "flex-1 flex flex-col overflow-auto", children: [
|
|
@@ -72,6 +68,6 @@ function er({ data: e, user: o }) {
|
|
|
72
68
|
] }) });
|
|
73
69
|
}
|
|
74
70
|
export {
|
|
75
|
-
|
|
71
|
+
mr as AppLayout
|
|
76
72
|
};
|
|
77
73
|
//# sourceMappingURL=app-layout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-layout.es.js","sources":["../../../lib/components/sidebar/app-layout.tsx"],"sourcesContent":["import { BreadCrumbs } from '@/components/sidebar/breadcrumb';\nimport type { NavItem } from '@/components/sidebar/nav-main';\nimport { SideBar } from '@/components/sidebar/sidebar';\nimport { SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n logout,\n} from '@/index';\nimport { Outlet } from '@tanstack/react-router';\nimport {
|
|
1
|
+
{"version":3,"file":"app-layout.es.js","sources":["../../../lib/components/sidebar/app-layout.tsx"],"sourcesContent":["import { BreadCrumbs } from '@/components/sidebar/breadcrumb';\nimport type { NavItem } from '@/components/sidebar/nav-main';\nimport { SideBar } from '@/components/sidebar/sidebar';\nimport { SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n logout,\n} from '@/index';\nimport { Outlet } from '@tanstack/react-router';\nimport { LogOutIcon } from 'lucide-react';\n\nexport interface AppLayoutProps {\n data: NavItem[]; // Navigation items\n user?: {\n firstName?: string;\n lastName?: string;\n logoUrl?: string;\n }; // Optional user information\n}\n\nexport function AppLayout({ data, user }: AppLayoutProps) {\n return (\n <div className=\"h-dvh flex\">\n <SidebarProvider>\n {/* Sidebar */}\n <SideBar data={data} />\n\n {/* Main Content */}\n <div className=\"flex flex-col h-screen w-full overflow-auto\">\n {/* Header */}\n <header className=\"h-[7vh] sticky top-0 bg-card flex items-center justify-between p-4 pl-0 border-b z-10\">\n {/* Sidebar Trigger */}\n <div className=\"flex gap-1 items-center\">\n <SidebarTrigger />\n </div>\n\n {/* User Dropdown */}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <div className=\"cursor-pointer\">\n <Avatar className=\"justify-center items-center\">\n <AvatarImage\n src={user?.logoUrl ?? 'https://app.dev.cryptlex.com/favicon.ico'}\n alt=\"icon\"\n />\n <AvatarFallback>\n {user?.firstName?.charAt(0)}\n {user?.lastName?.charAt(0)}\n </AvatarFallback>\n </Avatar>\n </div>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent>\n <DropdownMenuItem icon={LogOutIcon} onClick={() => logout()}>Logout</DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </header>\n\n {/* Scrollable Content */}\n <div className=\"flex-1 flex flex-col overflow-auto\">\n <div className=\"p-4 pb-0\">\n <BreadCrumbs />\n </div>\n <div className=\"flex-1 p-4 pt-2\">\n <Outlet />\n </div>\n </div>\n </div>\n </SidebarProvider>\n </div>\n );\n}\n"],"names":["AppLayout","data","user","jsx","SidebarProvider","SideBar","jsxs","SidebarTrigger","DropdownMenu","DropdownMenuTrigger","Avatar","AvatarImage","AvatarFallback","_a","_b","DropdownMenuContent","DropdownMenuItem","LogOutIcon","logout","BreadCrumbs","Outlet"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,SAASA,GAAU,EAAE,MAAAC,GAAM,MAAAC,KAAwB;;AACxD,SACG,gBAAAC,EAAA,OAAA,EAAI,WAAU,cACb,4BAACC,GAEC,EAAA,UAAA;AAAA,IAAA,gBAAAD,EAACE,KAAQ,MAAAJ,GAAY;AAAA,IAGrB,gBAAAK,EAAC,OAAI,EAAA,WAAU,+CAEb,UAAA;AAAA,MAAC,gBAAAA,EAAA,UAAA,EAAO,WAAU,yFAEhB,UAAA;AAAA,QAAA,gBAAAH,EAAC,OAAI,EAAA,WAAU,2BACb,UAAA,gBAAAA,EAACI,IAAe,CAAA,GAClB;AAAA,0BAGCC,GACC,EAAA,UAAA;AAAA,UAAC,gBAAAL,EAAAM,GAAA,EAAoB,SAAO,IAC1B,UAAC,gBAAAN,EAAA,OAAA,EAAI,WAAU,kBACb,UAAA,gBAAAG,EAACI,GAAO,EAAA,WAAU,+BAChB,UAAA;AAAA,YAAA,gBAAAP;AAAA,cAACQ;AAAA,cAAA;AAAA,gBACC,MAAKT,KAAA,gBAAAA,EAAM,YAAW;AAAA,gBACtB,KAAI;AAAA,cAAA;AAAA,YACN;AAAA,8BACCU,GACE,EAAA,UAAA;AAAA,eAAMC,IAAAX,KAAA,gBAAAA,EAAA,cAAA,gBAAAW,EAAW,OAAO;AAAA,eACxBC,IAAAZ,KAAA,gBAAAA,EAAM,aAAN,gBAAAY,EAAgB,OAAO;AAAA,YAAC,EAC3B,CAAA;AAAA,UAAA,EACF,CAAA,EACF,CAAA,GACF;AAAA,UAEA,gBAAAX,EAACY,GACC,EAAA,UAAA,gBAAAZ,EAACa,GAAiB,EAAA,MAAMC,GAAY,SAAS,MAAMC,EAAA,GAAU,UAAA,SAAM,CAAA,EACrE,CAAA;AAAA,QAAA,EACF,CAAA;AAAA,MAAA,GACF;AAAA,MAGA,gBAAAZ,EAAC,OAAI,EAAA,WAAU,sCACb,UAAA;AAAA,QAAA,gBAAAH,EAAC,OAAI,EAAA,WAAU,YACb,UAAA,gBAAAA,EAACgB,IAAY,CAAA,GACf;AAAA,0BACC,OAAI,EAAA,WAAU,mBACb,UAAA,gBAAAhB,EAACiB,KAAO,EACV,CAAA;AAAA,MAAA,EACF,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,EAAA,CACF,EACF,CAAA;AAEJ;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import "../ui/accordion.es.js";
|
|
3
3
|
import "../ui/avatar.es.js";
|
|
4
|
-
import "../ui/badge.es.js";
|
|
5
4
|
import { Breadcrumb as s, BreadcrumbList as u, BreadcrumbItem as d, BreadcrumbLink as c, BreadcrumbSeparator as h } from "../ui/breadcrumb.es.js";
|
|
6
5
|
import "../ui/button.es.js";
|
|
7
6
|
import "../ui/calendar.es.js";
|
|
@@ -41,7 +40,7 @@ function B() {
|
|
|
41
40
|
return r.push({ name: p, path: `${n}/${p}` }), r;
|
|
42
41
|
}, []) };
|
|
43
42
|
}
|
|
44
|
-
function
|
|
43
|
+
function Z({}) {
|
|
45
44
|
const { breadcrumb_routes: i } = B();
|
|
46
45
|
return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(u, { children: i.map((o, m) => {
|
|
47
46
|
const r = m === i.length - 1;
|
|
@@ -52,7 +51,7 @@ function rr({}) {
|
|
|
52
51
|
}) }) });
|
|
53
52
|
}
|
|
54
53
|
export {
|
|
55
|
-
|
|
54
|
+
Z as BreadCrumbs,
|
|
56
55
|
B as useBreadCrumbs
|
|
57
56
|
};
|
|
58
57
|
//# sourceMappingURL=breadcrumb.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.es.js","sources":["../../../lib/components/sidebar/breadcrumb.tsx"],"sourcesContent":["import {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbSeparator,\n} from '@/index';\nimport { Link, useLocation } from '@tanstack/react-router';\nimport React from 'react';\nexport function useBreadCrumbs() {\n const current = useLocation();\n\n const routeHistory = current.pathname.split('/').filter((x) => x && x.length > 0);\n\n const breadcrumb_routes = routeHistory.reduce((acc: { name: string; path: string }[], route) => {\n const prev_path = acc[acc.length - 1]?.path ?? '';\n acc.push({ name: route, path: `${prev_path}/${route}` });\n return acc;\n }, []);\n return { breadcrumb_routes };\n}\n\ninterface BreadCrumbsProps {}\n\nexport function BreadCrumbs({}: BreadCrumbsProps) {\n const { breadcrumb_routes } = useBreadCrumbs();\n\n return (\n <Breadcrumb>\n <BreadcrumbList>\n {breadcrumb_routes.map((crumb, index) => {\n const isLast = index === breadcrumb_routes.length - 1;\n return (\n <React.Fragment key={crumb.path}>\n <BreadcrumbItem>\n {isLast ? (\n crumb.name.split('-').join(' ')\n ) : (\n <BreadcrumbLink asChild>\n <Link to={crumb.path}>{crumb.name.split('-').join(' ')}</Link>\n </BreadcrumbLink>\n )}\n </BreadcrumbItem>\n {!isLast && <BreadcrumbSeparator />}\n </React.Fragment>\n );\n })}\n </BreadcrumbList>\n </Breadcrumb>\n );\n}\n"],"names":["useBreadCrumbs","useLocation","x","acc","route","prev_path","_a","BreadCrumbs","breadcrumb_routes","jsx","Breadcrumb","BreadcrumbList","crumb","index","isLast","jsxs","React","BreadcrumbItem","BreadcrumbLink","Link","BreadcrumbSeparator"],"mappings":"
|
|
1
|
+
{"version":3,"file":"breadcrumb.es.js","sources":["../../../lib/components/sidebar/breadcrumb.tsx"],"sourcesContent":["import {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbSeparator,\n} from '@/index';\nimport { Link, useLocation } from '@tanstack/react-router';\nimport React from 'react';\nexport function useBreadCrumbs() {\n const current = useLocation();\n\n const routeHistory = current.pathname.split('/').filter((x) => x && x.length > 0);\n\n const breadcrumb_routes = routeHistory.reduce((acc: { name: string; path: string }[], route) => {\n const prev_path = acc[acc.length - 1]?.path ?? '';\n acc.push({ name: route, path: `${prev_path}/${route}` });\n return acc;\n }, []);\n return { breadcrumb_routes };\n}\n\ninterface BreadCrumbsProps {}\n\nexport function BreadCrumbs({}: BreadCrumbsProps) {\n const { breadcrumb_routes } = useBreadCrumbs();\n\n return (\n <Breadcrumb>\n <BreadcrumbList>\n {breadcrumb_routes.map((crumb, index) => {\n const isLast = index === breadcrumb_routes.length - 1;\n return (\n <React.Fragment key={crumb.path}>\n <BreadcrumbItem>\n {isLast ? (\n crumb.name.split('-').join(' ')\n ) : (\n <BreadcrumbLink asChild>\n <Link to={crumb.path}>{crumb.name.split('-').join(' ')}</Link>\n </BreadcrumbLink>\n )}\n </BreadcrumbItem>\n {!isLast && <BreadcrumbSeparator />}\n </React.Fragment>\n );\n })}\n </BreadcrumbList>\n </Breadcrumb>\n );\n}\n"],"names":["useBreadCrumbs","useLocation","x","acc","route","prev_path","_a","BreadCrumbs","breadcrumb_routes","jsx","Breadcrumb","BreadcrumbList","crumb","index","isLast","jsxs","React","BreadcrumbItem","BreadcrumbLink","Link","BreadcrumbSeparator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,SAASA,IAAiB;AAU/B,SAAO,EAAE,mBATOC,EAAY,EAEC,SAAS,MAAM,GAAG,EAAE,OAAO,CAACC,MAAMA,KAAKA,EAAE,SAAS,CAAC,EAEzC,OAAO,CAACC,GAAuCC,MAAU;;AAC9F,UAAMC,MAAYC,IAAAH,EAAIA,EAAI,SAAS,CAAC,MAAlB,gBAAAG,EAAqB,SAAQ;AAC3C,WAAAH,EAAA,KAAK,EAAE,MAAMC,GAAO,MAAM,GAAGC,CAAS,IAAID,CAAK,GAAA,CAAI,GAChDD;AAAA,EACT,GAAG,EAAE,EACsB;AAC7B;AAIgB,SAAAI,EAAY,CAAA,GAAsB;AAC1C,QAAA,EAAE,mBAAAC,EAAkB,IAAIR,EAAe;AAG3C,SAAA,gBAAAS,EAACC,KACC,UAAC,gBAAAD,EAAAE,GAAA,EACE,YAAkB,IAAI,CAACC,GAAOC,MAAU;AACjC,UAAAC,IAASD,MAAUL,EAAkB,SAAS;AAElD,WAAA,gBAAAO,EAACC,EAAM,UAAN,EACC,UAAA;AAAA,MAAA,gBAAAP,EAACQ,GACE,EAAA,UAAAH,IACCF,EAAM,KAAK,MAAM,GAAG,EAAE,KAAK,GAAG,IAE7B,gBAAAH,EAAAS,GAAA,EAAe,SAAO,IACrB,UAAC,gBAAAT,EAAAU,GAAA,EAAK,IAAIP,EAAM,MAAO,UAAAA,EAAM,KAAK,MAAM,GAAG,EAAE,KAAK,GAAG,EAAE,CAAA,EACzD,CAAA,GAEJ;AAAA,MACC,CAACE,KAAU,gBAAAL,EAACW,GAAoB,CAAA,CAAA;AAAA,IAAA,EAAA,GAVdR,EAAM,IAW3B;AAAA,EAAA,CAEH,GACH,EACF,CAAA;AAEJ;"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { Collapsible as S, CollapsibleTrigger as x, CollapsibleContent as C } from "../ui/collapsible.es.js";
|
|
3
|
-
import { useSidebar as v, SidebarGroup as m, SidebarMenu as M, SidebarMenuItem as p, SidebarMenuButton as u, SidebarMenuSub as
|
|
3
|
+
import { useSidebar as v, SidebarGroup as m, SidebarMenu as M, SidebarMenuItem as p, SidebarMenuButton as u, SidebarMenuSub as y, SidebarMenuSubItem as z, SidebarMenuSubButton as P } from "../ui/sidebar.es.js";
|
|
4
4
|
import { useMatches as k, Link as b } from "@tanstack/react-router";
|
|
5
|
-
import { ChevronRight as
|
|
6
|
-
import { useState as
|
|
7
|
-
function
|
|
8
|
-
const { setOpen: f } = v(), [
|
|
9
|
-
|
|
5
|
+
import { ChevronRight as w } from "lucide-react";
|
|
6
|
+
import { useState as $, useEffect as j } from "react";
|
|
7
|
+
function W({ items: i }) {
|
|
8
|
+
const { setOpen: f } = v(), [d, h] = $(null), s = k(), o = s.length > 0 ? s[s.length - 1].pathname : "", n = (l) => l.children ? l.children.some((a) => o.startsWith(a.path)) : !1, g = (l) => o.startsWith(l.path) || n(l);
|
|
9
|
+
j(() => {
|
|
10
10
|
i.forEach((l) => {
|
|
11
|
-
n(l) &&
|
|
11
|
+
n(l) && h(l.label);
|
|
12
12
|
});
|
|
13
13
|
}, [o]);
|
|
14
14
|
const N = (l) => {
|
|
15
|
-
|
|
15
|
+
h((a) => a === l ? null : l);
|
|
16
16
|
}, c = `
|
|
17
17
|
w-full rounded-md px-2 py-1.5
|
|
18
18
|
transition-colors duration-200
|
|
@@ -26,7 +26,7 @@ function G({ items: i }) {
|
|
|
26
26
|
S,
|
|
27
27
|
{
|
|
28
28
|
asChild: !0,
|
|
29
|
-
open:
|
|
29
|
+
open: d === l.label || n(l),
|
|
30
30
|
className: "group/collapsible w-full",
|
|
31
31
|
children: /* @__PURE__ */ r(p, { children: [
|
|
32
32
|
/* @__PURE__ */ e(x, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -36,21 +36,21 @@ function G({ items: i }) {
|
|
|
36
36
|
onClick: () => {
|
|
37
37
|
f(!0), N(l.label);
|
|
38
38
|
},
|
|
39
|
-
className:
|
|
39
|
+
className: `cursor-pointer ${c} ${g(l) ? t : ""}`,
|
|
40
40
|
children: [
|
|
41
|
-
l.icon && /* @__PURE__ */ e(l.icon, { className: "
|
|
41
|
+
l.icon && /* @__PURE__ */ e(l.icon, { className: "size-4" }),
|
|
42
42
|
/* @__PURE__ */ e("span", { className: "flex-1", children: l.label }),
|
|
43
43
|
/* @__PURE__ */ e(
|
|
44
|
-
|
|
44
|
+
w,
|
|
45
45
|
{
|
|
46
|
-
className: `
|
|
46
|
+
className: `size-4 transition-transform duration-200 ${d === l.label || n(l) ? "rotate-90" : ""}`
|
|
47
47
|
}
|
|
48
48
|
)
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
) }),
|
|
52
|
-
/* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(
|
|
53
|
-
(a) => a.display && /* @__PURE__ */ e(
|
|
52
|
+
/* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(y, { className: "w-full flex flex-col gap-1", children: l.children.map(
|
|
53
|
+
(a) => a.display && /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ r(
|
|
54
54
|
b,
|
|
55
55
|
{
|
|
56
56
|
to: a.path,
|
|
@@ -59,7 +59,7 @@ function G({ items: i }) {
|
|
|
59
59
|
className: t
|
|
60
60
|
},
|
|
61
61
|
children: [
|
|
62
|
-
a.icon && /* @__PURE__ */ e(a.icon, { className: "
|
|
62
|
+
a.icon && /* @__PURE__ */ e(a.icon, { className: "size-4" }),
|
|
63
63
|
/* @__PURE__ */ e("span", { children: a.label })
|
|
64
64
|
]
|
|
65
65
|
}
|
|
@@ -77,7 +77,7 @@ function G({ items: i }) {
|
|
|
77
77
|
className: t
|
|
78
78
|
},
|
|
79
79
|
children: [
|
|
80
|
-
l.icon && /* @__PURE__ */ e(l.icon, { className: "
|
|
80
|
+
l.icon && /* @__PURE__ */ e(l.icon, { className: "size-4" }),
|
|
81
81
|
/* @__PURE__ */ e("span", { children: l.label })
|
|
82
82
|
]
|
|
83
83
|
}
|
|
@@ -85,6 +85,6 @@ function G({ items: i }) {
|
|
|
85
85
|
) }) });
|
|
86
86
|
}
|
|
87
87
|
export {
|
|
88
|
-
|
|
88
|
+
W as NavMain
|
|
89
89
|
};
|
|
90
90
|
//# sourceMappingURL=nav-main.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-main.es.js","sources":["../../../lib/components/sidebar/nav-main.tsx"],"sourcesContent":["import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';\nimport {\n SidebarGroup,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n useSidebar,\n} from '@/components/ui/sidebar';\nimport { Link, useMatches } from '@tanstack/react-router';\nimport { ChevronRight, type LucideIcon } from 'lucide-react';\nimport { useEffect, useState } from 'react';\n\nexport type NavItem = {\n path: string;\n label: string;\n display: boolean;\n icon: LucideIcon;\n children?: { path: string; label: string; icon: LucideIcon; display: boolean }[];\n};\n\nexport function NavMain({ items }: { items: NavItem[] }) {\n const { setOpen } = useSidebar();\n const [openItem, setOpenItem] = useState<string | null>(null);\n const matches = useMatches();\n const currentPath = matches.length > 0 ? matches[matches.length - 1].pathname : '';\n\n const isChildActive = (item: NavItem) => {\n if (!item.children) return false;\n return item.children.some((child) => currentPath.startsWith(child.path));\n };\n\n const isParentActive = (item: NavItem) => {\n return currentPath.startsWith(item.path) || isChildActive(item);\n };\n\n // Set initial open state based on active paths\n useEffect(() => {\n items.forEach((item) => {\n if (isChildActive(item)) {\n setOpenItem(item.label);\n }\n });\n }, [currentPath]); // Re-run when path changes\n\n const handleToggle = (title: string) => {\n setOpenItem((prev) => (prev === title ? null : title));\n };\n\n const commonLinkStyles = `\n w-full rounded-md px-2 py-1.5\n transition-colors duration-200\n hover:bg-neutral-4 focus-visible:bg-neutral-4\n text-neutral-10 hover:text-neutral-10\n no-underline\n flex items-center gap-2\n `;\n\n const activeStyles = `bg-neutral-4 font-bold`;\n\n return (\n <SidebarGroup>\n <SidebarMenu className=\"flex flex-col gap-1\">\n {items.map((item) =>\n item.children && item.display && item.children.length > 0 ? (\n <Collapsible\n key={item.label}\n asChild\n open={openItem === item.label || isChildActive(item)}\n className=\"group/collapsible w-full\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton\n tooltip={item.label}\n onClick={() => {\n setOpen(true);\n handleToggle(item.label);\n }}\n className={
|
|
1
|
+
{"version":3,"file":"nav-main.es.js","sources":["../../../lib/components/sidebar/nav-main.tsx"],"sourcesContent":["import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';\nimport {\n SidebarGroup,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n useSidebar,\n} from '@/components/ui/sidebar';\nimport { Link, useMatches } from '@tanstack/react-router';\nimport { ChevronRight, type LucideIcon } from 'lucide-react';\nimport { useEffect, useState } from 'react';\n\nexport type NavItem = {\n path: string;\n label: string;\n display: boolean;\n icon: LucideIcon;\n children?: { path: string; label: string; icon: LucideIcon; display: boolean }[];\n};\n\nexport function NavMain({ items }: { items: NavItem[] }) {\n const { setOpen } = useSidebar();\n const [openItem, setOpenItem] = useState<string | null>(null);\n const matches = useMatches();\n const currentPath = matches.length > 0 ? matches[matches.length - 1].pathname : '';\n\n const isChildActive = (item: NavItem) => {\n if (!item.children) return false;\n return item.children.some((child) => currentPath.startsWith(child.path));\n };\n\n const isParentActive = (item: NavItem) => {\n return currentPath.startsWith(item.path) || isChildActive(item);\n };\n\n // Set initial open state based on active paths\n useEffect(() => {\n items.forEach((item) => {\n if (isChildActive(item)) {\n setOpenItem(item.label);\n }\n });\n }, [currentPath]); // Re-run when path changes\n\n const handleToggle = (title: string) => {\n setOpenItem((prev) => (prev === title ? null : title));\n };\n\n const commonLinkStyles = `\n w-full rounded-md px-2 py-1.5\n transition-colors duration-200\n hover:bg-neutral-4 focus-visible:bg-neutral-4\n text-neutral-10 hover:text-neutral-10\n no-underline\n flex items-center gap-2\n `;\n\n const activeStyles = `bg-neutral-4 font-bold`;\n\n return (\n <SidebarGroup>\n <SidebarMenu className=\"flex flex-col gap-1\">\n {items.map((item) =>\n item.children && item.display && item.children.length > 0 ? (\n <Collapsible\n key={item.label}\n asChild\n open={openItem === item.label || isChildActive(item)}\n className=\"group/collapsible w-full\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton\n tooltip={item.label}\n onClick={() => {\n setOpen(true);\n handleToggle(item.label);\n }}\n className={`cursor-pointer ${commonLinkStyles} ${isParentActive(item) ? activeStyles : ''}`}\n >\n {item.icon && <item.icon className=\"size-4\" />}\n <span className=\"flex-1\">{item.label}</span>\n <ChevronRight\n className={`size-4 transition-transform duration-200 ${openItem === item.label || isChildActive(item) ? 'rotate-90' : ''\n }`}\n />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub className=\"w-full flex flex-col gap-1\">\n {item.children.map(\n (subItem) =>\n subItem.display && (\n <SidebarMenuSubItem key={subItem.label}>\n <SidebarMenuSubButton asChild>\n <Link\n to={subItem.path}\n className={commonLinkStyles}\n activeProps={{\n className: activeStyles,\n }}\n >\n {subItem.icon && <subItem.icon className=\"size-4\" />}\n <span>{subItem.label}</span>\n </Link>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ),\n )}\n </SidebarMenuSub>\n </CollapsibleContent>\n </SidebarMenuItem>\n </Collapsible>\n ) : (\n item.display && (\n <SidebarMenuItem key={item.label}>\n <SidebarMenuButton asChild tooltip={item.label}>\n <Link\n to={item.path}\n className={commonLinkStyles}\n activeProps={{\n className: activeStyles,\n }}\n >\n {item.icon && <item.icon className=\"size-4\" />}\n <span>{item.label}</span>\n </Link>\n </SidebarMenuButton>\n </SidebarMenuItem>\n )\n ),\n )}\n </SidebarMenu>\n </SidebarGroup>\n );\n}\n"],"names":["NavMain","items","setOpen","useSidebar","openItem","setOpenItem","useState","matches","useMatches","currentPath","isChildActive","item","child","isParentActive","useEffect","handleToggle","title","prev","commonLinkStyles","activeStyles","SidebarGroup","jsx","SidebarMenu","Collapsible","SidebarMenuItem","CollapsibleTrigger","jsxs","SidebarMenuButton","ChevronRight","CollapsibleContent","SidebarMenuSub","subItem","SidebarMenuSubItem","SidebarMenuSubButton","Link"],"mappings":"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"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Badge as
|
|
3
|
-
import { Table as
|
|
4
|
-
import { getResourceDisplayName as u, getValueFromData as
|
|
5
|
-
function b({ accessors: d, data: o, affectedData:
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */ e(
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as h } from "../ui/badge.es.js";
|
|
3
|
+
import { Table as g, TableHeader as x, TableRow as c, TableCell as a, TableBody as f } from "../ui/table.es.js";
|
|
4
|
+
import { getResourceDisplayName as u, getValueFromData as y } from "../data-table/table-utils/constants.es.js";
|
|
5
|
+
function b({ accessors: d, data: o, affectedData: n }) {
|
|
6
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
7
|
+
/* @__PURE__ */ e(x, { className: "text-left align-middle sticky top-0 z-10 bg-card", children: /* @__PURE__ */ i(c, { children: [
|
|
8
8
|
d.map((r) => /* @__PURE__ */ e(
|
|
9
9
|
a,
|
|
10
10
|
{
|
|
@@ -13,16 +13,16 @@ function b({ accessors: d, data: o, affectedData: t }) {
|
|
|
13
13
|
},
|
|
14
14
|
String(r)
|
|
15
15
|
)),
|
|
16
|
-
|
|
16
|
+
n && /* @__PURE__ */ e(a, { className: "px-4 py-2 text-left text-sm font-medium cursor-pointer whitespace-nowrap bg-card", children: "Affected" })
|
|
17
17
|
] }) }),
|
|
18
|
-
/* @__PURE__ */ e(
|
|
18
|
+
/* @__PURE__ */ e(f, { children: o.map((r, m) => /* @__PURE__ */ i(c, { children: [
|
|
19
19
|
d.map((l) => {
|
|
20
|
-
const
|
|
21
|
-
return Array.isArray(
|
|
20
|
+
const p = r[l];
|
|
21
|
+
return Array.isArray(p) ? /* @__PURE__ */ e(a, { className: "flex gap-4", children: p.map((t, s) => /* @__PURE__ */ e(h, { children: (t == null ? void 0 : t.name) || t }, s)) }, String(l)) : /* @__PURE__ */ e(a, { children: y(r, l) }, String(l));
|
|
22
22
|
}),
|
|
23
|
-
|
|
24
|
-
] },
|
|
25
|
-
] })
|
|
23
|
+
n && /* @__PURE__ */ e(a, { children: n.includes(r) ? /* @__PURE__ */ e("span", { className: "text-success-foreground", children: "✔" }) : /* @__PURE__ */ e("span", { className: "text-destructive-foreground", children: "✖" }) })
|
|
24
|
+
] }, m)) })
|
|
25
|
+
] });
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
28
|
b as StaticDataTable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.es.js","sources":["../../../lib/components/static-data-table/data-table.tsx"],"sourcesContent":["import { getResourceDisplayName, getValueFromData } from '@/components/data-table';\nimport { Badge } from '@/components/ui/badge';\nimport { Table, TableBody, TableCell, TableHeader, TableRow } from '@/components/ui/table';\n\n\nexport interface StaticDataTableProps<T> {\n accessors: (keyof T)[];\n data: T[];\n affectedData?: T[];\n}\n\nexport function StaticDataTable<T>({ accessors, data, affectedData }: StaticDataTableProps<T>) {\n return (\n <
|
|
1
|
+
{"version":3,"file":"data-table.es.js","sources":["../../../lib/components/static-data-table/data-table.tsx"],"sourcesContent":["import { getResourceDisplayName, getValueFromData } from '@/components/data-table';\nimport { Badge } from '@/components/ui/badge';\nimport { Table, TableBody, TableCell, TableHeader, TableRow } from '@/components/ui/table';\n\n\nexport interface StaticDataTableProps<T> {\n accessors: (keyof T)[];\n data: T[];\n affectedData?: T[];\n}\n\nexport function StaticDataTable<T>({ accessors, data, affectedData }: StaticDataTableProps<T>) {\n return (\n <Table>\n <TableHeader className=\"text-left align-middle sticky top-0 z-10 bg-card\">\n <TableRow>\n {accessors.map((accessor) => (\n <TableCell\n key={String(accessor)}\n className=\"px-4 py-2 text-left text-sm font-medium cursor-pointer whitespace-nowrap bg-card\"\n >\n {getResourceDisplayName(String(accessor), 'admin-portal')}\n </TableCell>\n ))}\n {affectedData && (\n <TableCell className=\"px-4 py-2 text-left text-sm font-medium cursor-pointer whitespace-nowrap bg-card\">\n Affected\n </TableCell>\n )}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.map((item, index) => (\n <TableRow key={index}>\n {accessors.map((accessor) => {\n const value = item[accessor];\n // Handle arrays (e.g., userGroups) with badges\n if (Array.isArray(value)) {\n return (\n <TableCell key={String(accessor)} className=\"flex gap-4\">\n {value.map((subItem, subIndex) => (\n <Badge key={subIndex}>{subItem?.name || subItem}</Badge>\n ))}\n </TableCell>\n );\n }\n // Handle other data types\n return (\n <TableCell key={String(accessor)}>{getValueFromData(item, accessor)}</TableCell>\n );\n })}\n {affectedData && (\n <TableCell>\n {affectedData.includes(item) ? (\n <span className=\"text-success-foreground\">✔</span>\n ) : (\n <span className=\"text-destructive-foreground\">✖</span>\n )}\n </TableCell>\n )}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n}\n"],"names":["StaticDataTable","accessors","data","affectedData","Table","jsx","TableHeader","jsxs","TableRow","accessor","TableCell","getResourceDisplayName","TableBody","item","index","value","subItem","subIndex","Badge","getValueFromData"],"mappings":";;;;AAWO,SAASA,EAAmB,EAAE,WAAAC,GAAW,MAAAC,GAAM,cAAAC,KAAyC;AAC7F,2BACGC,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAY,EAAA,WAAU,oDACrB,UAAA,gBAAAC,EAACC,GACE,EAAA,UAAA;AAAA,MAAUP,EAAA,IAAI,CAACQ,MACd,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UAEC,WAAU;AAAA,UAET,UAAuBC,EAAA,OAAOF,CAAQ,GAAG,cAAc;AAAA,QAAA;AAAA,QAHnD,OAAOA,CAAQ;AAAA,MAAA,CAKvB;AAAA,MACAN,KACC,gBAAAE,EAACK,GAAU,EAAA,WAAU,oFAAmF,UAExG,WAAA,CAAA;AAAA,IAAA,EAAA,CAEJ,EACF,CAAA;AAAA,IACA,gBAAAL,EAACO,KACE,UAAKV,EAAA,IAAI,CAACW,GAAMC,wBACdN,GACE,EAAA,UAAA;AAAA,MAAUP,EAAA,IAAI,CAACQ,MAAa;AACrB,cAAAM,IAAQF,EAAKJ,CAAQ;AAEvB,eAAA,MAAM,QAAQM,CAAK,sBAElBL,GAAiC,EAAA,WAAU,cACzC,UAAMK,EAAA,IAAI,CAACC,GAASC,wBAClBC,GAAsB,EAAA,WAAAF,KAAA,gBAAAA,EAAS,SAAQA,EAA5B,GAAAC,CAAoC,CACjD,EAHa,GAAA,OAAOR,CAAQ,CAI/B,IAKF,gBAAAJ,EAACK,KAAkC,UAAiBS,EAAAN,GAAMJ,CAAQ,EAAlD,GAAA,OAAOA,CAAQ,CAAqC;AAAA,MAAA,CAEvE;AAAA,MACAN,KACE,gBAAAE,EAAAK,GAAA,EACE,YAAa,SAASG,CAAI,IACxB,gBAAAR,EAAA,QAAA,EAAK,WAAU,2BAA0B,eAAC,IAE3C,gBAAAA,EAAC,UAAK,WAAU,+BAA8B,cAAC,CAAA,EAEnD,CAAA;AAAA,IAAA,EAzBW,GAAAS,CA2Bf,CACD,EACH,CAAA;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { cn as i } from "../../utils/index.es.js";
|
|
3
3
|
import * as e from "@radix-ui/react-accordion";
|
|
4
|
-
import { cn as s } from "../../utils/index.es.js";
|
|
5
4
|
import { ChevronDownIcon as c } from "@radix-ui/react-icons";
|
|
6
|
-
|
|
5
|
+
import * as s from "react";
|
|
6
|
+
const y = e.Root, m = s.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
|
|
7
7
|
e.Item,
|
|
8
8
|
{
|
|
9
9
|
ref: r,
|
|
10
|
-
className:
|
|
10
|
+
className: i("border-b", o),
|
|
11
11
|
...t
|
|
12
12
|
}
|
|
13
13
|
));
|
|
14
14
|
m.displayName = "AccordionItem";
|
|
15
|
-
const l =
|
|
15
|
+
const l = s.forwardRef(({ className: o, children: t, ...r }, n) => /* @__PURE__ */ a(e.Header, { className: "flex", children: /* @__PURE__ */ d(
|
|
16
16
|
e.Trigger,
|
|
17
17
|
{
|
|
18
18
|
ref: n,
|
|
19
|
-
className:
|
|
19
|
+
className: i(
|
|
20
20
|
"flex flex-1 items-center justify-between py-4 text-body font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",
|
|
21
21
|
o
|
|
22
22
|
),
|
|
23
23
|
...r,
|
|
24
24
|
children: [
|
|
25
25
|
t,
|
|
26
|
-
/* @__PURE__ */ a(c, { className: "
|
|
26
|
+
/* @__PURE__ */ a(c, { className: "size-icon shrink-0 text-muted-foreground transition-transform duration-200" })
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
29
|
) }));
|
|
30
30
|
l.displayName = e.Trigger.displayName;
|
|
31
|
-
const f =
|
|
31
|
+
const f = s.forwardRef(({ className: o, children: t, ...r }, n) => /* @__PURE__ */ a(
|
|
32
32
|
e.Content,
|
|
33
33
|
{
|
|
34
34
|
ref: n,
|
|
35
35
|
className: "overflow-hidden text-body data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
36
36
|
...r,
|
|
37
|
-
children: /* @__PURE__ */ a("div", { className:
|
|
37
|
+
children: /* @__PURE__ */ a("div", { className: i("pb-4 pt-0", o), children: t })
|
|
38
38
|
}
|
|
39
39
|
));
|
|
40
40
|
f.displayName = e.Content.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.es.js","sources":["../../../lib/components/ui/accordion.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"accordion.es.js","sources":["../../../lib/components/ui/accordion.tsx"],"sourcesContent":["import { cn } from \"@/utils\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\"\nimport * as React from \"react\"\n\nconst Accordion = AccordionPrimitive.Root\n\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\"border-b\", className)}\n {...props}\n />\n))\nAccordionItem.displayName = \"AccordionItem\"\n\nconst AccordionTrigger = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 text-body font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"size-icon shrink-0 text-muted-foreground transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n))\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-body data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n))\nAccordionContent.displayName = AccordionPrimitive.Content.displayName\n\nexport { Accordion, AccordionContent, AccordionItem, AccordionTrigger }\n\n"],"names":["Accordion","AccordionPrimitive","AccordionItem","React","className","props","ref","jsx","cn","AccordionTrigger","children","jsxs","ChevronDownIcon","AccordionContent"],"mappings":";;;;;AAKA,MAAMA,IAAYC,EAAmB,MAE/BC,IAAgBC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAACN,EAAmB;AAAA,EAAnB;AAAA,IACC,KAAAK;AAAA,IACA,WAAWE,EAAG,YAAYJ,CAAS;AAAA,IAClC,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAc,cAAc;AAE5B,MAAMO,IAAmBN,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,UAAAM,GAAU,GAAGL,EAAM,GAAGC,MACnC,gBAAAC,EAAAN,EAAmB,QAAnB,EAA0B,WAAU,QACnC,UAAA,gBAAAU;AAAA,EAACV,EAAmB;AAAA,EAAnB;AAAA,IACC,KAAAK;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IACF;AAAA,IACC,GAAGC;AAAA,IAEH,UAAA;AAAA,MAAAK;AAAA,MACD,gBAAAH,EAACK,GAAgB,EAAA,WAAU,6EAA6E,CAAA;AAAA,IAAA;AAAA,EAAA;AAC1G,GACF,CACD;AACDH,EAAiB,cAAcR,EAAmB,QAAQ;AAEpD,MAAAY,IAAmBV,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,UAAAM,GAAU,GAAGL,KAASC,MACpC,gBAAAC;AAAA,EAACN,EAAmB;AAAA,EAAnB;AAAA,IACC,KAAAK;AAAA,IACA,WAAU;AAAA,IACT,GAAGD;AAAA,IAEJ,4BAAC,OAAI,EAAA,WAAWG,EAAG,aAAaJ,CAAS,GAAI,UAAAM,EAAS,CAAA;AAAA,EAAA;AACxD,CACD;AACDG,EAAiB,cAAcZ,EAAmB,QAAQ;"}
|
|
@@ -3,39 +3,39 @@ import { jsx as s } from "react/jsx-runtime";
|
|
|
3
3
|
import * as a from "@radix-ui/react-avatar";
|
|
4
4
|
import * as t from "react";
|
|
5
5
|
import { cn as m } from "../../utils/index.es.js";
|
|
6
|
-
const o = t.forwardRef(({ className: e, ...
|
|
6
|
+
const o = t.forwardRef(({ className: e, ...r }, l) => /* @__PURE__ */ s(
|
|
7
7
|
a.Root,
|
|
8
8
|
{
|
|
9
|
-
ref:
|
|
10
|
-
className: m("relative flex
|
|
11
|
-
...
|
|
9
|
+
ref: l,
|
|
10
|
+
className: m("relative flex size-10 shrink-0 overflow-hidden rounded-full", e),
|
|
11
|
+
...r
|
|
12
12
|
}
|
|
13
13
|
));
|
|
14
14
|
o.displayName = a.Root.displayName;
|
|
15
|
-
const
|
|
15
|
+
const i = t.forwardRef(({ className: e, ...r }, l) => /* @__PURE__ */ s(
|
|
16
16
|
a.Image,
|
|
17
17
|
{
|
|
18
|
-
ref:
|
|
19
|
-
className: m("aspect-square
|
|
20
|
-
...
|
|
18
|
+
ref: l,
|
|
19
|
+
className: m("aspect-square size-full", e),
|
|
20
|
+
...r
|
|
21
21
|
}
|
|
22
22
|
));
|
|
23
|
-
|
|
24
|
-
const
|
|
23
|
+
i.displayName = a.Image.displayName;
|
|
24
|
+
const f = t.forwardRef(({ className: e, ...r }, l) => /* @__PURE__ */ s(
|
|
25
25
|
a.Fallback,
|
|
26
26
|
{
|
|
27
|
-
ref:
|
|
27
|
+
ref: l,
|
|
28
28
|
className: m(
|
|
29
|
-
"flex
|
|
29
|
+
"flex size-full items-center justify-center uppercase rounded-full bg-muted",
|
|
30
30
|
e
|
|
31
31
|
),
|
|
32
|
-
...
|
|
32
|
+
...r
|
|
33
33
|
}
|
|
34
34
|
));
|
|
35
|
-
|
|
35
|
+
f.displayName = a.Fallback.displayName;
|
|
36
36
|
export {
|
|
37
37
|
o as Avatar,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
f as AvatarFallback,
|
|
39
|
+
i as AvatarImage
|
|
40
40
|
};
|
|
41
41
|
//# sourceMappingURL=avatar.es.js.map
|