@cryptlex/web-components 1.3.4 → 1.3.5
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/components/data-table/column-picker.es.js +12 -11
- package/dist/components/data-table/column-picker.es.js.map +1 -1
- package/dist/components/data-table/data-table.es.js +34 -31
- package/dist/components/data-table/data-table.es.js.map +1 -1
- package/dist/components/data-table/table-actions.es.js +8 -8
- package/dist/components/data-table/table-actions.es.js.map +1 -1
- package/dist/components/data-table/table-content.es.js +21 -17
- package/dist/components/data-table/table-content.es.js.map +1 -1
- package/dist/components/key-value-card/key-value-card.es.js +85 -0
- package/dist/components/key-value-card/key-value-card.es.js.map +1 -0
- package/dist/components/sidebar/app-layout.es.js +12 -22
- package/dist/components/sidebar/app-layout.es.js.map +1 -1
- package/dist/components/sidebar/nav-main.es.js +44 -42
- package/dist/components/sidebar/nav-main.es.js.map +1 -1
- package/dist/components/static-data-table/data-table.es.js +6 -6
- package/dist/components/static-data-table/data-table.es.js.map +1 -1
- package/dist/components/ui/button.es.js +10 -9
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/chart.es.js +9 -9
- package/dist/components/ui/copy-button.es.js +72 -0
- package/dist/components/ui/copy-button.es.js.map +1 -0
- package/dist/components/ui/drawer.es.js +18 -21
- package/dist/components/ui/drawer.es.js.map +1 -1
- package/dist/components/ui/link-button.es.js +22 -0
- package/dist/components/ui/link-button.es.js.map +1 -0
- package/dist/components/ui/mutli-select.es.js +20 -18
- package/dist/components/ui/mutli-select.es.js.map +1 -1
- package/dist/components/ui/pagination.es.js +20 -20
- package/dist/components/ui/select.es.js +13 -13
- package/dist/components/ui/select.es.js.map +1 -1
- package/dist/components/ui/table.es.js +19 -19
- package/dist/components/ui/table.es.js.map +1 -1
- package/dist/index.es.d.ts +43 -15
- package/dist/index.es.js +225 -221
- package/dist/index.es.js.map +1 -1
- package/dist/utils/index.es.js +19 -14
- package/dist/utils/index.es.js.map +1 -1
- package/package.json +4 -3
- package/tailwind.preset.ts +55 -47
- package/dist/components/info-card/info-card.es.js +0 -71
- package/dist/components/info-card/info-card.es.js.map +0 -1
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { SideBar as p } from "./sidebar.es.js";
|
|
3
|
-
import { SidebarProvider as
|
|
3
|
+
import { SidebarProvider as c, SidebarTrigger as a } from "../ui/sidebar.es.js";
|
|
4
4
|
import "../ui/accordion.es.js";
|
|
5
|
-
import { Avatar as
|
|
5
|
+
import { Avatar as l, AvatarImage as n, AvatarFallback as d } from "../ui/avatar.es.js";
|
|
6
6
|
import "../ui/badge.es.js";
|
|
7
7
|
import "../ui/breadcrumb.es.js";
|
|
8
|
-
import { Button as
|
|
8
|
+
import { Button as h } from "../ui/button.es.js";
|
|
9
9
|
import "../ui/calendar.es.js";
|
|
10
10
|
import "../ui/card.es.js";
|
|
11
11
|
import "../ui/chart.es.js";
|
|
12
12
|
import "../ui/checkbox.es.js";
|
|
13
13
|
import "@radix-ui/react-collapsible";
|
|
14
14
|
import "../ui/command.es.js";
|
|
15
|
+
import { LogOut as f } from "lucide-react";
|
|
16
|
+
import "react";
|
|
15
17
|
import "../ui/dialog.es.js";
|
|
16
18
|
import "../ui/drawer.es.js";
|
|
17
|
-
import { DropdownMenu as
|
|
19
|
+
import { DropdownMenu as s, DropdownMenuTrigger as v, DropdownMenuContent as g, DropdownMenuItem as N } from "../ui/dropdown-menu.es.js";
|
|
18
20
|
import "../ui/form.es.js";
|
|
19
21
|
import "../ui/input.es.js";
|
|
20
22
|
import "../ui/input-otp.es.js";
|
|
21
23
|
import "../ui/label.es.js";
|
|
22
24
|
import { logout as x } from "../../utils/index.es.js";
|
|
23
|
-
import {
|
|
25
|
+
import { Outlet as w } from "@tanstack/react-router";
|
|
24
26
|
import "../ui/mutli-select.es.js";
|
|
25
27
|
import "../ui/navigation-menu.es.js";
|
|
26
28
|
import "../ui/pagination.es.js";
|
|
27
29
|
import "../ui/password-input.es.js";
|
|
28
30
|
import "../ui/popover.es.js";
|
|
29
31
|
import "../ui/radio-group.es.js";
|
|
30
|
-
import "react";
|
|
31
32
|
import "../ui/select.es.js";
|
|
32
33
|
import "../ui/separator.es.js";
|
|
33
34
|
import "../ui/sheet.es.js";
|
|
@@ -35,27 +36,16 @@ import "sonner";
|
|
|
35
36
|
import "../ui/table.es.js";
|
|
36
37
|
import "../ui/tabs.es.js";
|
|
37
38
|
import "../ui/tooltip.es.js";
|
|
38
|
-
import { Outlet as w } from "@tanstack/react-router";
|
|
39
39
|
function mr({ data: e, user: o }) {
|
|
40
40
|
var i, m;
|
|
41
41
|
return /* @__PURE__ */ t("div", { className: "h-screen", children: [
|
|
42
|
-
/* @__PURE__ */ t(
|
|
42
|
+
/* @__PURE__ */ t(c, { children: [
|
|
43
43
|
/* @__PURE__ */ r(p, { data: e }),
|
|
44
44
|
/* @__PURE__ */ t("div", { className: "flex flex-col h-screen w-full overflow-auto", children: [
|
|
45
45
|
/* @__PURE__ */ t("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__ */
|
|
47
|
-
|
|
48
|
-
/* @__PURE__ */ r(
|
|
49
|
-
"img",
|
|
50
|
-
{
|
|
51
|
-
src: "https://assets.cryptlex.com/images/logos/cryptlex-logo.svg",
|
|
52
|
-
alt: "logo",
|
|
53
|
-
className: "m-0"
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
] }),
|
|
57
|
-
/* @__PURE__ */ t(h, { children: [
|
|
58
|
-
/* @__PURE__ */ r(f, { asChild: !0, children: /* @__PURE__ */ r("div", { className: "cursor-pointer", children: /* @__PURE__ */ t(a, { className: "justify-center items-center", children: [
|
|
46
|
+
/* @__PURE__ */ r("div", { className: "flex gap-1 items-center", children: /* @__PURE__ */ r(a, {}) }),
|
|
47
|
+
/* @__PURE__ */ t(s, { children: [
|
|
48
|
+
/* @__PURE__ */ r(v, { asChild: !0, children: /* @__PURE__ */ r("div", { className: "cursor-pointer", children: /* @__PURE__ */ t(l, { className: "justify-center items-center", children: [
|
|
59
49
|
/* @__PURE__ */ r(
|
|
60
50
|
n,
|
|
61
51
|
{
|
|
@@ -68,7 +58,7 @@ function mr({ data: e, user: o }) {
|
|
|
68
58
|
(m = o == null ? void 0 : o.lastName) == null ? void 0 : m.charAt(0)
|
|
69
59
|
] })
|
|
70
60
|
] }) }) }),
|
|
71
|
-
/* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(
|
|
61
|
+
/* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(N, { children: /* @__PURE__ */ r(h, { icon: f, onClick: () => x(), children: "Log Out" }) }) })
|
|
72
62
|
] })
|
|
73
63
|
] }),
|
|
74
64
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ r(w, {}) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-layout.es.js","sources":["../../../lib/components/sidebar/app-layout.tsx"],"sourcesContent":["import 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 Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n logout,\n} from '@/index';\nimport { Outlet } from '@tanstack/react-router';\nimport { LogOut } 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-screen\">\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 {/* //TODO: Will be replaced with dynamic url */}\n <img\n src=\"https://assets.cryptlex.com/images/logos/cryptlex-logo.svg\"\n alt=\"logo\"\n className=\"m-0\"\n
|
|
1
|
+
{"version":3,"file":"app-layout.es.js","sources":["../../../lib/components/sidebar/app-layout.tsx"],"sourcesContent":["import 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 Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n logout,\n} from '@/index';\nimport { Outlet } from '@tanstack/react-router';\nimport { LogOut } 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-screen\">\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 {/* //TODO: Improve position for this and Will be replaced with dynamic url */}\n {/* <img\n src=\"https://assets.cryptlex.com/images/logos/cryptlex-logo.svg\"\n alt=\"logo\"\n className=\"m-0\"\n /> */}\n </div>\n\n {/* User Dropdown */}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <div className=\"cursor-pointer\">\n {/* //TODO: Image url to be replaced by the dynamic url from /account/config */}\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 className=\"uppercase\">\n {user?.firstName?.charAt(0)}\n {user?.lastName?.charAt(0)}\n </AvatarFallback>\n </Avatar>\n </div>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent>\n <DropdownMenuItem>\n <Button icon={LogOut} onClick={() => logout()}>\n Log Out\n </Button>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </header>\n\n {/* Scrollable Content */}\n <div className=\"flex-1 overflow-auto p-4\">\n <Outlet />\n </div>\n </div>\n </SidebarProvider>{' '}\n </div>\n );\n}\n"],"names":["AppLayout","data","user","jsxs","SidebarProvider","jsx","SideBar","SidebarTrigger","DropdownMenu","DropdownMenuTrigger","Avatar","AvatarImage","AvatarFallback","_a","_b","DropdownMenuContent","DropdownMenuItem","Button","LogOut","logout","Outlet"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,SAASA,GAAU,EAAE,MAAAC,GAAM,MAAAC,KAAwB;;AAEtD,SAAA,gBAAAC,EAAC,OAAI,EAAA,WAAU,YACb,UAAA;AAAA,IAAA,gBAAAA,EAACC,GAEC,EAAA,UAAA;AAAA,MAAA,gBAAAC,EAACC,KAAQ,MAAAL,GAAY;AAAA,MAGrB,gBAAAE,EAAC,OAAI,EAAA,WAAU,+CAEb,UAAA;AAAA,QAAC,gBAAAA,EAAA,UAAA,EAAO,WAAU,0FAEhB,UAAA;AAAA,UAAA,gBAAAE,EAAC,OAAI,EAAA,WAAU,2BACb,UAAA,gBAAAA,EAACE,IAAe,CAAA,GAOlB;AAAA,4BAGCC,GACC,EAAA,UAAA;AAAA,YAAC,gBAAAH,EAAAI,GAAA,EAAoB,SAAO,IAC1B,UAAC,gBAAAJ,EAAA,OAAA,EAAI,WAAU,kBAEb,UAAA,gBAAAF,EAACO,GAAO,EAAA,WAAU,gCAChB,UAAA;AAAA,cAAA,gBAAAL;AAAA,gBAACM;AAAA,gBAAA;AAAA,kBACC,MAAKT,KAAA,gBAAAA,EAAM,YAAW;AAAA,kBACtB,KAAI;AAAA,gBAAA;AAAA,cACN;AAAA,cACA,gBAAAC,EAACS,GAAe,EAAA,WAAU,aACvB,UAAA;AAAA,iBAAMC,IAAAX,KAAA,gBAAAA,EAAA,cAAA,gBAAAW,EAAW,OAAO;AAAA,iBACxBC,IAAAZ,KAAA,gBAAAA,EAAM,aAAN,gBAAAY,EAAgB,OAAO;AAAA,cAAC,EAC3B,CAAA;AAAA,YAAA,EACF,CAAA,EACF,CAAA,GACF;AAAA,YAEC,gBAAAT,EAAAU,GAAA,EACC,UAAC,gBAAAV,EAAAW,GAAA,EACC,4BAACC,GAAO,EAAA,MAAMC,GAAQ,SAAS,MAAMC,EAAA,GAAU,UAAA,UAAA,CAE/C,GACF,EACF,CAAA;AAAA,UAAA,EACF,CAAA;AAAA,QAAA,GACF;AAAA,0BAGC,OAAI,EAAA,WAAU,4BACb,UAAA,gBAAAd,EAACe,KAAO,EACV,CAAA;AAAA,MAAA,EACF,CAAA;AAAA,IAAA,GACF;AAAA,IAAmB;AAAA,EAAA,GACrB;AAEJ;"}
|
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Collapsible as
|
|
3
|
-
import { useSidebar as g, SidebarGroup as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { ChevronRight as
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { Collapsible as p, CollapsibleTrigger as u, CollapsibleContent as b } from "../ui/collapsible.es.js";
|
|
3
|
+
import { useSidebar as g, SidebarGroup as f, SidebarMenu as S, SidebarMenuItem as o, SidebarMenuButton as i, SidebarMenuSub as C, SidebarMenuSubItem as N, SidebarMenuSubButton as v } from "../ui/sidebar.es.js";
|
|
4
|
+
import { Link as c } from "@tanstack/react-router";
|
|
5
|
+
import { ChevronRight as x } from "lucide-react";
|
|
6
6
|
import { useState as M } from "react";
|
|
7
|
-
function
|
|
8
|
-
const { setOpen:
|
|
9
|
-
|
|
7
|
+
function P({ items: d }) {
|
|
8
|
+
const { setOpen: s } = g(), [a, t] = M(null), h = (l) => {
|
|
9
|
+
t((n) => n === l ? null : l);
|
|
10
10
|
};
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
(
|
|
13
|
-
|
|
11
|
+
return /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(S, { className: "flex gap-2 ", children: d.map(
|
|
12
|
+
(l) => l.children && l.display && l.children.length > 0 ? /* @__PURE__ */ e(
|
|
13
|
+
p,
|
|
14
14
|
{
|
|
15
15
|
asChild: !0,
|
|
16
|
-
open: a ===
|
|
16
|
+
open: a === l.label,
|
|
17
17
|
className: "group/collapsible",
|
|
18
18
|
children: /* @__PURE__ */ r(o, { children: [
|
|
19
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ e(u, { asChild: !0, children: /* @__PURE__ */ r(
|
|
20
20
|
i,
|
|
21
21
|
{
|
|
22
|
-
tooltip:
|
|
22
|
+
tooltip: l.label,
|
|
23
23
|
onClick: () => {
|
|
24
|
-
|
|
24
|
+
s(!0), h(l.label);
|
|
25
25
|
},
|
|
26
26
|
className: "hover:bg-neutral-5",
|
|
27
27
|
children: [
|
|
28
|
-
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
28
|
+
l.icon && /* @__PURE__ */ e(l.icon, {}),
|
|
29
|
+
/* @__PURE__ */ e("span", { children: l.label }),
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
x,
|
|
32
32
|
{
|
|
33
|
-
className: `ml-auto transition-transform duration-200 ${a ===
|
|
33
|
+
className: `ml-auto transition-transform duration-200 ${a === l.label ? "rotate-90" : ""}`
|
|
34
34
|
}
|
|
35
35
|
)
|
|
36
36
|
]
|
|
37
37
|
}
|
|
38
38
|
) }),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
/* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(C, { children: l.children.map(
|
|
40
|
+
(n) => n.display && /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ r(
|
|
41
|
+
c,
|
|
42
|
+
{
|
|
43
|
+
activeProps: {
|
|
44
|
+
className: "bg-neutral-4 font-bold"
|
|
45
|
+
},
|
|
46
|
+
className: "text-neutral-10 no-underline hover:bg-neutral-5",
|
|
47
|
+
to: n.path,
|
|
48
|
+
children: [
|
|
49
|
+
n.icon && /* @__PURE__ */ e(n.icon, {}),
|
|
50
|
+
/* @__PURE__ */ e("span", { children: n.label })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
) }) }, n.label)
|
|
54
|
+
) }) })
|
|
53
55
|
] })
|
|
54
56
|
},
|
|
55
|
-
|
|
56
|
-
) : /* @__PURE__ */
|
|
57
|
-
|
|
57
|
+
l.label
|
|
58
|
+
) : l.display && /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(i, { asChild: !0, tooltip: l.label, children: /* @__PURE__ */ r(
|
|
59
|
+
c,
|
|
58
60
|
{
|
|
59
61
|
activeProps: {
|
|
60
62
|
className: "bg-neutral-4 font-bold"
|
|
61
63
|
// Add active styling here
|
|
62
64
|
},
|
|
63
65
|
className: "no-underline text-neutral-10 flex items-center hover:bg-neutral-5",
|
|
64
|
-
to:
|
|
66
|
+
to: l.path,
|
|
65
67
|
children: [
|
|
66
|
-
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
+
l.icon && /* @__PURE__ */ e(l.icon, {}),
|
|
69
|
+
/* @__PURE__ */ e("span", { children: l.label })
|
|
68
70
|
]
|
|
69
71
|
}
|
|
70
|
-
) }) },
|
|
72
|
+
) }) }, l.label)
|
|
71
73
|
) }) });
|
|
72
74
|
}
|
|
73
75
|
export {
|
|
74
|
-
|
|
76
|
+
P as NavMain
|
|
75
77
|
};
|
|
76
78
|
//# 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 } from '@tanstack/react-router';\nimport { ChevronRight, type LucideIcon } from 'lucide-react';\nimport { useState } from 'react';\n\nexport type NavItem = {\n path: string;\n label: string;\n display: boolean;\n icon: LucideIcon;\n
|
|
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 } from '@tanstack/react-router';\nimport { ChevronRight, type LucideIcon } from 'lucide-react';\nimport { 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); // Tracks the currently open item\n\n const handleToggle = (title: string) => {\n setOpenItem((prev) => (prev === title ? null : title)); // Toggle the open state\n };\n\n return (\n <SidebarGroup>\n <SidebarMenu className=\"flex gap-2 \">\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}\n className=\"group/collapsible\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton\n tooltip={item.label}\n onClick={() => {\n setOpen(true);\n handleToggle(item.label);\n }}\n className=\"hover:bg-neutral-5\"\n >\n {item.icon && <item.icon />}\n <span>{item.label}</span>\n <ChevronRight\n className={`ml-auto transition-transform duration-200 ${\n openItem === item.label ? 'rotate-90' : ''\n }`}\n />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n {item.children.map(\n (subItem) =>\n subItem.display && (\n <SidebarMenuSubItem key={subItem.label}>\n <SidebarMenuSubButton asChild>\n <Link\n activeProps={{\n className: 'bg-neutral-4 font-bold',\n }}\n className=\"text-neutral-10 no-underline hover:bg-neutral-5\"\n to={subItem.path}\n >\n {subItem.icon && <subItem.icon />}\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 activeProps={{\n className: 'bg-neutral-4 font-bold', // Add active styling here\n }}\n className=\"no-underline text-neutral-10 flex items-center hover:bg-neutral-5\"\n to={item.path}\n >\n {item.icon && <item.icon />}\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","handleToggle","title","prev","SidebarGroup","jsx","SidebarMenu","item","Collapsible","SidebarMenuItem","CollapsibleTrigger","jsxs","SidebarMenuButton","ChevronRight","CollapsibleContent","SidebarMenuSub","subItem","SidebarMenuSubItem","SidebarMenuSubButton","Link"],"mappings":";;;;;;AAuBgB,SAAAA,EAAQ,EAAE,OAAAC,KAA+B;AACjD,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAW,GACzB,CAACC,GAAUC,CAAW,IAAIC,EAAwB,IAAI,GAEtDC,IAAe,CAACC,MAAkB;AACtC,IAAAH,EAAY,CAACI,MAAUA,MAASD,IAAQ,OAAOA,CAAM;AAAA,EACvD;AAEA,2BACGE,GACC,EAAA,UAAA,gBAAAC,EAACC,GAAY,EAAA,WAAU,eACpB,UAAMX,EAAA;AAAA,IAAI,CAACY,MACVA,EAAK,YAAYA,EAAK,WAAWA,EAAK,SAAS,SAAS,IACtD,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QAEC,SAAO;AAAA,QACP,MAAMV,MAAaS,EAAK;AAAA,QACxB,WAAU;AAAA,QAEV,4BAACE,GACC,EAAA,UAAA;AAAA,UAAC,gBAAAJ,EAAAK,GAAA,EAAmB,SAAO,IACzB,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,SAASL,EAAK;AAAA,cACd,SAAS,MAAM;AACb,gBAAAX,EAAQ,EAAI,GACZK,EAAaM,EAAK,KAAK;AAAA,cACzB;AAAA,cACA,WAAU;AAAA,cAET,UAAA;AAAA,gBAAAA,EAAK,QAAQ,gBAAAF,EAACE,EAAK,MAAL,CAAA,CAAU;AAAA,gBACzB,gBAAAF,EAAC,QAAM,EAAA,UAAAE,EAAK,MAAM,CAAA;AAAA,gBAClB,gBAAAF;AAAA,kBAACQ;AAAA,kBAAA;AAAA,oBACC,WAAW,6CACTf,MAAaS,EAAK,QAAQ,cAAc,EAC1C;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA,GAEJ;AAAA,UACC,gBAAAF,EAAAS,GAAA,EACC,UAAC,gBAAAT,EAAAU,GAAA,EACE,YAAK,SAAS;AAAA,YACb,CAACC,MACCA,EAAQ,6BACLC,GACC,EAAA,UAAA,gBAAAZ,EAACa,GAAqB,EAAA,SAAO,IAC3B,UAAA,gBAAAP;AAAA,cAACQ;AAAA,cAAA;AAAA,gBACC,aAAa;AAAA,kBACX,WAAW;AAAA,gBACb;AAAA,gBACA,WAAU;AAAA,gBACV,IAAIH,EAAQ;AAAA,gBAEX,UAAA;AAAA,kBAAAA,EAAQ,QAAQ,gBAAAX,EAACW,EAAQ,MAAR,CAAA,CAAa;AAAA,kBAC/B,gBAAAX,EAAC,QAAM,EAAA,UAAAW,EAAQ,MAAM,CAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA,GAEzB,EAZuB,GAAAA,EAAQ,KAajC;AAAA,aAGR,EACF,CAAA;AAAA,QAAA,EACF,CAAA;AAAA,MAAA;AAAA,MA/CKT,EAAK;AAAA,IAAA,IAkDZA,EAAK,WACF,gBAAAF,EAAAI,GAAA,EACC,UAAC,gBAAAJ,EAAAO,GAAA,EAAkB,SAAO,IAAC,SAASL,EAAK,OACvC,UAAA,gBAAAI;AAAA,MAACQ;AAAA,MAAA;AAAA,QACC,aAAa;AAAA,UACX,WAAW;AAAA;AAAA,QACb;AAAA,QACA,WAAU;AAAA,QACV,IAAIZ,EAAK;AAAA,QAER,UAAA;AAAA,UAAAA,EAAK,QAAQ,gBAAAF,EAACE,EAAK,MAAL,CAAA,CAAU;AAAA,UACzB,gBAAAF,EAAC,QAAM,EAAA,UAAAE,EAAK,MAAM,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEtB,EAZoB,GAAAA,EAAK,KAa3B;AAAA,KAIR,EACF,CAAA;AAEJ;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Badge as s } from "../ui/badge.es.js";
|
|
3
|
+
import { Table as x, TableHeader as f, TableRow as p, TableCell as a, TableBody as g } from "../ui/table.es.js";
|
|
4
4
|
import { getResourceDisplayName as u, getValueFromData as v } from "../data-table/table-utils/constants.es.js";
|
|
5
5
|
function b({ accessors: d, data: m, affectedData: t }) {
|
|
6
|
-
return /* @__PURE__ */ e("div", { className: "relative overflow-hidden border max-h-[50vh]", children: /* @__PURE__ */ e("div", { className: "overflow-y-auto max-h-[50vh]", children: /* @__PURE__ */ n(
|
|
7
|
-
/* @__PURE__ */ e(
|
|
6
|
+
return /* @__PURE__ */ e("div", { className: "relative overflow-hidden border max-h-[50vh]", children: /* @__PURE__ */ e("div", { className: "overflow-y-auto max-h-[50vh]", children: /* @__PURE__ */ n(x, { children: [
|
|
7
|
+
/* @__PURE__ */ e(f, { className: "text-left align-middle uppercase sticky top-0 z-10 bg-card", children: /* @__PURE__ */ n(p, { children: [
|
|
8
8
|
d.map((r) => /* @__PURE__ */ e(
|
|
9
9
|
a,
|
|
10
10
|
{
|
|
@@ -15,10 +15,10 @@ function b({ accessors: d, data: m, affectedData: t }) {
|
|
|
15
15
|
)),
|
|
16
16
|
t && /* @__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(g, { children: m.map((r, o) => /* @__PURE__ */ n(p, { children: [
|
|
19
19
|
d.map((l) => {
|
|
20
20
|
const c = r[l];
|
|
21
|
-
return Array.isArray(c) ? /* @__PURE__ */ e(a, { className: "flex gap-4", children: c.map((i, h) => /* @__PURE__ */ e(
|
|
21
|
+
return Array.isArray(c) ? /* @__PURE__ */ e(a, { className: "flex gap-4", children: c.map((i, h) => /* @__PURE__ */ e(s, { children: (i == null ? void 0 : i.name) || i }, h)) }, String(l)) : /* @__PURE__ */ e(a, { children: v(r, l) }, String(l));
|
|
22
22
|
}),
|
|
23
23
|
t && /* @__PURE__ */ e(a, { children: t.includes(r) ? /* @__PURE__ */ e("span", { className: "text-success-10", children: "✔" }) : /* @__PURE__ */ e("span", { className: "text-destructive", children: "✖" }) })
|
|
24
24
|
] }, o)) })
|
|
@@ -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 { Table, TableBody, TableCell, TableHeader, TableRow } from '@/components/ui/table';\
|
|
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 <div className=\"relative overflow-hidden border max-h-[50vh]\">\n <div className=\"overflow-y-auto max-h-[50vh]\">\n <Table>\n <TableHeader className=\"text-left align-middle uppercase 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-10\">✔</span>\n ) : (\n <span className=\"text-destructive\">✖</span>\n )}\n </TableCell>\n )}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n </div>\n );\n}\n"],"names":["StaticDataTable","accessors","data","affectedData","jsx","jsxs","Table","TableHeader","TableRow","accessor","TableCell","getResourceDisplayName","TableBody","item","index","value","subItem","subIndex","Badge","getValueFromData"],"mappings":";;;;AAWO,SAASA,EAAmB,EAAE,WAAAC,GAAW,MAAAC,GAAM,cAAAC,KAAyC;AAE3F,SAAA,gBAAAC,EAAC,SAAI,WAAU,gDACb,4BAAC,OAAI,EAAA,WAAU,gCACb,UAAA,gBAAAC,EAACC,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAF,EAACG,GAAY,EAAA,WAAU,8DACrB,UAAA,gBAAAF,EAACG,GACE,EAAA,UAAA;AAAA,MAAUP,EAAA,IAAI,CAACQ,MACd,gBAAAL;AAAA,QAACM;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,gBAAAC,EAACM,GAAU,EAAA,WAAU,oFAAmF,UAExG,WAAA,CAAA;AAAA,IAAA,EAAA,CAEJ,EACF,CAAA;AAAA,IACA,gBAAAN,EAACQ,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,gBAAAL,EAACM,KAAkC,UAAiBS,EAAAN,GAAMJ,CAAQ,EAAlD,GAAA,OAAOA,CAAQ,CAAqC;AAAA,MAAA,CAEvE;AAAA,MACAN,KACE,gBAAAC,EAAAM,GAAA,EACE,YAAa,SAASG,CAAI,IACxB,gBAAAT,EAAA,QAAA,EAAK,WAAU,mBAAkB,eAAC,IAEnC,gBAAAA,EAAC,UAAK,WAAU,oBAAmB,cAAC,CAAA,EAExC,CAAA;AAAA,IAAA,EAzBW,GAAAU,CA2Bf,CACD,EACH,CAAA;AAAA,EAAA,EACF,CAAA,EACF,CAAA,GACF;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Slottable as
|
|
2
|
+
import { Slottable as v, Slot as g } from "@radix-ui/react-slot";
|
|
3
3
|
import { cva as b } from "class-variance-authority";
|
|
4
4
|
import * as p from "react";
|
|
5
5
|
import { cn as h } from "../../utils/index.es.js";
|
|
@@ -29,18 +29,19 @@ const y = b(
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
), w = p.forwardRef(
|
|
32
|
-
({ className:
|
|
33
|
-
const
|
|
32
|
+
({ className: n, variant: i, size: s, loading: r, disabled: a, asChild: d = !1, icon: c, children: o, ...u }, f) => {
|
|
33
|
+
const l = d ? g : "button", t = c;
|
|
34
34
|
return /* @__PURE__ */ m(
|
|
35
|
-
|
|
35
|
+
l,
|
|
36
36
|
{
|
|
37
|
-
className: h(y({ variant:
|
|
38
|
-
ref:
|
|
39
|
-
disabled:
|
|
37
|
+
className: h(y({ variant: i, size: s, className: n })),
|
|
38
|
+
ref: f,
|
|
39
|
+
disabled: r || a,
|
|
40
40
|
...u,
|
|
41
41
|
children: [
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
r ? /* @__PURE__ */ e(x, { className: "h-4 w-4" }) : t ? /* @__PURE__ */ e(t, { className: "h-4 w-4" }) : null,
|
|
43
|
+
" ",
|
|
44
|
+
/* @__PURE__ */ e(v, { children: o && /* @__PURE__ */ e("div", { className: r || t ? "ml-2" : "", children: o }) })
|
|
44
45
|
]
|
|
45
46
|
}
|
|
46
47
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.es.js","sources":["../../../lib/components/ui/button.tsx"],"sourcesContent":["import { Slot, Slottable } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/utils';\nimport { LucideIcon } from 'lucide-react';\nimport { Loader } from './loader';\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center no-underline whitespace-nowrap rounded-lg text-body font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90 hover:text-destructive-foreground',\n outline:\n 'border border-input text-accent bg-background hover:bg-accent hover:text-accent-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground hover:text-secondary-foreground hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-10 px-4 py-2',\n sm: 'h-9 rounded-md px-3',\n lg: 'h-11 rounded-md px-8',\n icon: 'h-6 rounded-md px-2',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n loading?: boolean;\n icon?: LucideIcon;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, variant, size, loading, disabled, asChild = false, icon, children, ...props },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button';\n const Icon = icon;\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={loading || disabled}\n {...props}\n >\n {/*
|
|
1
|
+
{"version":3,"file":"button.es.js","sources":["../../../lib/components/ui/button.tsx"],"sourcesContent":["import { Slot, Slottable } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/utils';\nimport { LucideIcon } from 'lucide-react';\nimport { Loader } from './loader';\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center no-underline whitespace-nowrap rounded-lg text-body font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90 hover:text-destructive-foreground',\n outline:\n 'border border-input text-accent bg-background hover:bg-accent hover:text-accent-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground hover:text-secondary-foreground hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-10 px-4 py-2',\n sm: 'h-9 rounded-md px-3',\n lg: 'h-11 rounded-md px-8',\n icon: 'h-6 rounded-md px-2',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n loading?: boolean;\n icon?: LucideIcon;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, variant, size, loading, disabled, asChild = false, icon, children, ...props },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button';\n const Icon = icon;\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={loading || disabled}\n {...props}\n >\n {/* Show loader when loading, otherwise show icon if present */}\n {loading ? <Loader className=\"h-4 w-4\" /> : Icon ? <Icon className=\"h-4 w-4\" /> : null}\n {/* Show children with appropriate spacing */}{' '}\n {/* https://www.radix-ui.com/primitives/docs/utilities/slot */}\n <Slottable>\n {children && <div className={loading || Icon ? 'ml-2' : ''}>{children}</div>}\n </Slottable>\n </Comp>\n );\n },\n);\n\nButton.displayName = 'Button'; // Set display name for better debugging\n\nexport { Button, buttonVariants };\n"],"names":["buttonVariants","cva","Button","React","className","variant","size","loading","disabled","asChild","icon","children","props","ref","Comp","Slot","Icon","jsxs","cn","jsx","Loader","Slottable"],"mappings":";;;;;;AAQA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,GAUMC,IAASC,EAAM;AAAA,EACnB,CACE,EAAE,WAAAC,GAAW,SAAAC,GAAS,MAAAC,GAAM,SAAAC,GAAS,UAAAC,GAAU,SAAAC,IAAU,IAAO,MAAAC,GAAM,UAAAC,GAAU,GAAGC,EAAA,GACnFC,MACG;AACG,UAAAC,IAAOL,IAAUM,IAAO,UACxBC,IAAON;AAGX,WAAA,gBAAAO;AAAA,MAACH;AAAA,MAAA;AAAA,QACC,WAAWI,EAAGlB,EAAe,EAAE,SAAAK,GAAS,MAAAC,GAAM,WAAAF,EAAA,CAAW,CAAC;AAAA,QAC1D,KAAAS;AAAA,QACA,UAAUN,KAAWC;AAAA,QACpB,GAAGI;AAAA,QAGH,UAAA;AAAA,UAAUL,IAAA,gBAAAY,EAACC,GAAO,EAAA,WAAU,UAAU,CAAA,IAAKJ,IAAQ,gBAAAG,EAAAH,GAAA,EAAK,WAAU,UAAA,CAAU,IAAK;AAAA,UACnC;AAAA,UAE/C,gBAAAG,EAACE,GACE,EAAA,UAAAV,KAAa,gBAAAQ,EAAA,OAAA,EAAI,WAAWZ,KAAWS,IAAO,SAAS,IAAK,UAAAL,EAAS,CAAA,EACxE,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;AAEAT,EAAO,cAAc;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as s, jsxs as
|
|
2
|
+
import { jsx as s, jsxs as m, Fragment as P } from "react/jsx-runtime";
|
|
3
3
|
import * as g from "react";
|
|
4
4
|
import * as C from "recharts";
|
|
5
5
|
import { cn as i } from "../../utils/index.es.js";
|
|
@@ -12,7 +12,7 @@ function $() {
|
|
|
12
12
|
}
|
|
13
13
|
const S = g.forwardRef(({ id: c, className: e, children: t, config: n, ...o }, f) => {
|
|
14
14
|
const l = g.useId(), a = `chart-${c || l.replace(/:/g, "")}`;
|
|
15
|
-
return /* @__PURE__ */ s(j.Provider, { value: { config: n }, children: /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ s(j.Provider, { value: { config: n }, children: /* @__PURE__ */ m(
|
|
16
16
|
"div",
|
|
17
17
|
{
|
|
18
18
|
"data-chart": a,
|
|
@@ -72,13 +72,13 @@ ${t.map(([f, l]) => {
|
|
|
72
72
|
var p;
|
|
73
73
|
if (o || !(e != null && e.length))
|
|
74
74
|
return null;
|
|
75
|
-
const [r] = e, w = `${_ || r.dataKey || r.name || "value"}`,
|
|
75
|
+
const [r] = e, w = `${_ || r.dataKey || r.name || "value"}`, v = k(b, r, w), d = !_ && typeof l == "string" ? ((p = b[l]) == null ? void 0 : p.label) || l : v == null ? void 0 : v.label;
|
|
76
76
|
return a ? /* @__PURE__ */ s("div", { className: i("font-medium", h), children: a(d, e) }) : d ? /* @__PURE__ */ s("div", { className: i("font-medium", h), children: d }) : null;
|
|
77
77
|
}, [l, a, e, o, h, b, _]);
|
|
78
78
|
if (!c || !(e != null && e.length))
|
|
79
79
|
return null;
|
|
80
80
|
const x = e.length === 1 && n !== "dot";
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ m(
|
|
82
82
|
"div",
|
|
83
83
|
{
|
|
84
84
|
ref: T,
|
|
@@ -89,7 +89,7 @@ ${t.map(([f, l]) => {
|
|
|
89
89
|
children: [
|
|
90
90
|
x ? null : N,
|
|
91
91
|
/* @__PURE__ */ s("div", { className: "grid gap-1.5", children: e.map((r, w) => {
|
|
92
|
-
const
|
|
92
|
+
const v = `${R || r.name || r.dataKey || "value"}`, d = k(b, r, v), p = L || r.payload.fill || r.color;
|
|
93
93
|
return /* @__PURE__ */ s(
|
|
94
94
|
"div",
|
|
95
95
|
{
|
|
@@ -97,7 +97,7 @@ ${t.map(([f, l]) => {
|
|
|
97
97
|
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
98
98
|
n === "dot" && "items-center"
|
|
99
99
|
),
|
|
100
|
-
children: u && (r == null ? void 0 : r.value) !== void 0 && r.name ? u(r.value, r.name, r, w, r.payload) : /* @__PURE__ */
|
|
100
|
+
children: u && (r == null ? void 0 : r.value) !== void 0 && r.name ? u(r.value, r.name, r, w, r.payload) : /* @__PURE__ */ m(P, { children: [
|
|
101
101
|
d != null && d.icon ? /* @__PURE__ */ s(d.icon, {}) : !f && /* @__PURE__ */ s(
|
|
102
102
|
"div",
|
|
103
103
|
{
|
|
@@ -116,7 +116,7 @@ ${t.map(([f, l]) => {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ m(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
122
122
|
className: i(
|
|
@@ -124,7 +124,7 @@ ${t.map(([f, l]) => {
|
|
|
124
124
|
x ? "items-end" : "items-center"
|
|
125
125
|
),
|
|
126
126
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ m("div", { className: "grid gap-1.5", children: [
|
|
128
128
|
x ? N : null,
|
|
129
129
|
/* @__PURE__ */ s("span", { className: "text-muted-foreground", children: (d == null ? void 0 : d.label) || r.name })
|
|
130
130
|
] }),
|
|
@@ -156,7 +156,7 @@ const y = C.Legend, M = g.forwardRef(({ className: c, hideIcon: e = !1, payload:
|
|
|
156
156
|
),
|
|
157
157
|
children: t.map((a) => {
|
|
158
158
|
const h = `${o || a.dataKey || "value"}`, u = k(l, a, h);
|
|
159
|
-
return /* @__PURE__ */
|
|
159
|
+
return /* @__PURE__ */ m(
|
|
160
160
|
"div",
|
|
161
161
|
{
|
|
162
162
|
className: i(
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
3
|
+
import "./accordion.es.js";
|
|
4
|
+
import "./avatar.es.js";
|
|
5
|
+
import "./badge.es.js";
|
|
6
|
+
import "./breadcrumb.es.js";
|
|
7
|
+
import { Button as a } from "./button.es.js";
|
|
8
|
+
import "./calendar.es.js";
|
|
9
|
+
import "./card.es.js";
|
|
10
|
+
import "./chart.es.js";
|
|
11
|
+
import "./checkbox.es.js";
|
|
12
|
+
import "@radix-ui/react-collapsible";
|
|
13
|
+
import "./command.es.js";
|
|
14
|
+
import { CheckCheck as n, Copy as d } from "lucide-react";
|
|
15
|
+
import { useState as s } from "react";
|
|
16
|
+
import "./dialog.es.js";
|
|
17
|
+
import "./drawer.es.js";
|
|
18
|
+
import "./dropdown-menu.es.js";
|
|
19
|
+
import "./form.es.js";
|
|
20
|
+
import "./input.es.js";
|
|
21
|
+
import "./input-otp.es.js";
|
|
22
|
+
import "./label.es.js";
|
|
23
|
+
import "@tanstack/react-router";
|
|
24
|
+
import "./mutli-select.es.js";
|
|
25
|
+
import "./navigation-menu.es.js";
|
|
26
|
+
import "./pagination.es.js";
|
|
27
|
+
import "./password-input.es.js";
|
|
28
|
+
import "./popover.es.js";
|
|
29
|
+
import "./radio-group.es.js";
|
|
30
|
+
import "./select.es.js";
|
|
31
|
+
import "./separator.es.js";
|
|
32
|
+
import "./sheet.es.js";
|
|
33
|
+
import "./sidebar.es.js";
|
|
34
|
+
import "sonner";
|
|
35
|
+
import "./table.es.js";
|
|
36
|
+
import "./tabs.es.js";
|
|
37
|
+
import { TooltipProvider as h, Tooltip as f, TooltipTrigger as u, TooltipContent as T } from "./tooltip.es.js";
|
|
38
|
+
function oo({
|
|
39
|
+
value: t,
|
|
40
|
+
display: e,
|
|
41
|
+
tooltipMessage: c = "Copy to clipboard",
|
|
42
|
+
onCopy: i
|
|
43
|
+
}) {
|
|
44
|
+
const [r, p] = s(!1);
|
|
45
|
+
return /* @__PURE__ */ o(h, { children: /* @__PURE__ */ m(f, { delayDuration: 0, children: [
|
|
46
|
+
/* @__PURE__ */ m("div", { className: "flex gap-1 align-middle ", children: [
|
|
47
|
+
/* @__PURE__ */ o("span", { children: e ?? t }),
|
|
48
|
+
/* @__PURE__ */ o(u, { asChild: !0, children: /* @__PURE__ */ o(
|
|
49
|
+
a,
|
|
50
|
+
{
|
|
51
|
+
onClick: async () => {
|
|
52
|
+
try {
|
|
53
|
+
await navigator.clipboard.writeText(t), p(!0), i == null || i(), setTimeout(() => {
|
|
54
|
+
p(!1);
|
|
55
|
+
}, 1e4);
|
|
56
|
+
} catch (l) {
|
|
57
|
+
console.error("Failed to copy text:", l);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
variant: "ghost",
|
|
61
|
+
size: "icon",
|
|
62
|
+
icon: r ? n : d
|
|
63
|
+
}
|
|
64
|
+
) })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ o(T, { children: r ? "Copied!" : c })
|
|
67
|
+
] }) });
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
oo as CopyButton
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=copy-button.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-button.es.js","sources":["../../../lib/components/ui/copy-button.tsx"],"sourcesContent":["'use client';\nimport { Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/index';\nimport { CheckCheck, Copy } from 'lucide-react';\nimport { useState } from 'react';\n\ninterface CopyProps {\n value: string;\n display?: string;\n tooltipMessage?: string;\n className?: string;\n size?: number;\n onCopy?: () => void;\n}\n\nexport function CopyButton({\n value,\n display,\n tooltipMessage = 'Copy to clipboard',\n onCopy,\n}: CopyProps) {\n const [copied, setCopied] = useState(false);\n\n const copyToClipboard = async () => {\n try {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n onCopy?.();\n\n setTimeout(() => {\n setCopied(false);\n }, 10000);\n } catch (err) {\n console.error('Failed to copy text:', err);\n }\n };\n\n return (\n <TooltipProvider>\n <Tooltip delayDuration={0}>\n <div className=\"flex gap-1 align-middle \">\n <span>{display ?? value}</span>\n <TooltipTrigger asChild>\n <Button\n onClick={copyToClipboard}\n variant=\"ghost\"\n size=\"icon\"\n icon={copied ? CheckCheck : Copy}\n ></Button>\n </TooltipTrigger>\n </div>\n\n <TooltipContent>{copied ? 'Copied!' : tooltipMessage}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n}\n"],"names":["CopyButton","value","display","tooltipMessage","onCopy","copied","setCopied","useState","jsx","TooltipProvider","jsxs","Tooltip","TooltipTrigger","Button","err","CheckCheck","Copy","TooltipContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,SAASA,GAAW;AAAA,EACzB,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,QAAAC;AACF,GAAc;AACZ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK;AAgB1C,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAC,EAAAC,GAAA,EAAQ,eAAe,GACtB,UAAA;AAAA,IAAC,gBAAAD,EAAA,OAAA,EAAI,WAAU,4BACb,UAAA;AAAA,MAAC,gBAAAF,EAAA,QAAA,EAAM,eAAWP,EAAM,CAAA;AAAA,MACxB,gBAAAO,EAACI,GAAe,EAAA,SAAO,IACrB,UAAA,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UACC,SArBY,YAAY;AAC9B,gBAAA;AACI,oBAAA,UAAU,UAAU,UAAUZ,CAAK,GACzCK,EAAU,EAAI,GACLF,KAAA,QAAAA,KAET,WAAW,MAAM;AACf,gBAAAE,EAAU,EAAK;AAAA,iBACd,GAAK;AAAA,qBACDQ,GAAK;AACJ,sBAAA,MAAM,wBAAwBA,CAAG;AAAA,YAAA;AAAA,UAE7C;AAAA,UAUY,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,MAAMT,IAASU,IAAaC;AAAA,QAAA;AAAA,MAAA,EAEhC,CAAA;AAAA,IAAA,GACF;AAAA,IAEC,gBAAAR,EAAAS,GAAA,EAAgB,UAASZ,IAAA,YAAYF,EAAe,CAAA;AAAA,EAAA,EAAA,CACvD,EACF,CAAA;AAEJ;"}
|