@arch-cadre/panel 0.0.1
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/actions/actions.cjs +18 -0
- package/dist/actions/actions.d.ts +4 -0
- package/dist/actions/actions.mjs +10 -0
- package/dist/actions/index.cjs +27 -0
- package/dist/actions/index.d.ts +2 -0
- package/dist/actions/index.mjs +2 -0
- package/dist/actions/manager.cjs +138 -0
- package/dist/actions/manager.d.ts +14 -0
- package/dist/actions/manager.mjs +135 -0
- package/dist/actions/profile.cjs +169 -0
- package/dist/actions/profile.d.ts +8 -0
- package/dist/actions/profile.mjs +135 -0
- package/dist/actions/settings.cjs +26 -0
- package/dist/actions/settings.d.ts +7 -0
- package/dist/actions/settings.mjs +20 -0
- package/dist/index.cjs +29 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +25 -0
- package/dist/intl.d.ts +9 -0
- package/dist/navigation.cjs +38 -0
- package/dist/navigation.d.ts +2 -0
- package/dist/navigation.mjs +39 -0
- package/dist/routes.cjs +71 -0
- package/dist/routes.d.ts +4 -0
- package/dist/routes.mjs +71 -0
- package/dist/types.cjs +1 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.mjs +0 -0
- package/dist/ui/[...catchAll]/page.cjs +127 -0
- package/dist/ui/[...catchAll]/page.d.ts +13 -0
- package/dist/ui/[...catchAll]/page.mjs +88 -0
- package/dist/ui/components/app-content.cjs +49 -0
- package/dist/ui/components/app-content.d.ts +6 -0
- package/dist/ui/components/app-content.mjs +34 -0
- package/dist/ui/components/app-header.cjs +55 -0
- package/dist/ui/components/app-header.d.ts +6 -0
- package/dist/ui/components/app-header.mjs +45 -0
- package/dist/ui/components/app-sidebar.cjs +133 -0
- package/dist/ui/components/app-sidebar.d.ts +17 -0
- package/dist/ui/components/app-sidebar.mjs +142 -0
- package/dist/ui/components/app-user.cjs +102 -0
- package/dist/ui/components/app-user.d.ts +2 -0
- package/dist/ui/components/app-user.mjs +92 -0
- package/dist/ui/components/breadcrumb-slot.cjs +35 -0
- package/dist/ui/components/breadcrumb-slot.d.ts +2 -0
- package/dist/ui/components/breadcrumb-slot.mjs +31 -0
- package/dist/ui/components/manager/module-card.cjs +213 -0
- package/dist/ui/components/manager/module-card.d.ts +12 -0
- package/dist/ui/components/manager/module-card.mjs +197 -0
- package/dist/ui/components/manager/module-list.cjs +52 -0
- package/dist/ui/components/manager/module-list.d.ts +4 -0
- package/dist/ui/components/manager/module-list.mjs +16 -0
- package/dist/ui/components/manager/module-upload.cjs +81 -0
- package/dist/ui/components/manager/module-upload.d.ts +2 -0
- package/dist/ui/components/manager/module-upload.mjs +68 -0
- package/dist/ui/components/profile/components.cjs +239 -0
- package/dist/ui/components/profile/components.d.ts +8 -0
- package/dist/ui/components/profile/components.mjs +219 -0
- package/dist/ui/components/profile/link.cjs +25 -0
- package/dist/ui/components/profile/link.d.ts +1 -0
- package/dist/ui/components/profile/link.mjs +13 -0
- package/dist/ui/components/profile/page.cjs +41 -0
- package/dist/ui/components/profile/page.d.ts +1 -0
- package/dist/ui/components/profile/page.mjs +21 -0
- package/dist/ui/components/sidebar-slot.cjs +49 -0
- package/dist/ui/components/sidebar-slot.d.ts +2 -0
- package/dist/ui/components/sidebar-slot.mjs +33 -0
- package/dist/ui/dashboard/page.cjs +31 -0
- package/dist/ui/dashboard/page.d.ts +2 -0
- package/dist/ui/dashboard/page.mjs +9 -0
- package/dist/ui/error.cjs +50 -0
- package/dist/ui/error.d.ts +7 -0
- package/dist/ui/error.mjs +35 -0
- package/dist/ui/layout.cjs +48 -0
- package/dist/ui/layout.d.ts +4 -0
- package/dist/ui/layout.mjs +35 -0
- package/dist/ui/modules/docs/page.cjs +98 -0
- package/dist/ui/modules/docs/page.d.ts +6 -0
- package/dist/ui/modules/docs/page.mjs +46 -0
- package/dist/ui/modules/page.cjs +30 -0
- package/dist/ui/modules/page.d.ts +2 -0
- package/dist/ui/modules/page.mjs +10 -0
- package/dist/ui/page.cjs +18 -0
- package/dist/ui/page.d.ts +1 -0
- package/dist/ui/page.mjs +9 -0
- package/dist/ui/router.cjs +61 -0
- package/dist/ui/router.d.ts +5 -0
- package/dist/ui/router.mjs +51 -0
- package/dist/ui/settings/page.cjs +61 -0
- package/dist/ui/settings/page.d.ts +2 -0
- package/dist/ui/settings/page.mjs +22 -0
- package/dist/ui/settings-page.cjs +76 -0
- package/dist/ui/settings-page.d.ts +2 -0
- package/dist/ui/settings-page.mjs +57 -0
- package/locales/en/global.json +80 -0
- package/manifest.json +11 -0
- package/package.json +67 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ScrollArea } from "@arch-cadre/ui/components/scroll-area";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { AppHeader } from "./app-header.mjs";
|
|
6
|
+
export function AppContent({
|
|
7
|
+
children,
|
|
8
|
+
breadcrumbs
|
|
9
|
+
}) {
|
|
10
|
+
const [isScrolled, setIsScrolled] = useState(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const onScroll = () => setIsScrolled(window.scrollY > 64);
|
|
13
|
+
onScroll();
|
|
14
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
15
|
+
return () => window.removeEventListener("scroll", onScroll);
|
|
16
|
+
}, []);
|
|
17
|
+
const setScrolled = (e) => {
|
|
18
|
+
const scrollTop = e.currentTarget.scrollTop;
|
|
19
|
+
if (scrollTop > 20) {
|
|
20
|
+
setIsScrolled(true);
|
|
21
|
+
} else {
|
|
22
|
+
setIsScrolled(false);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ React.createElement("main", { className: "bg-sidebar h-svh overflow-hidden lg:p-2 w-full" }, /* @__PURE__ */ React.createElement("div", { className: "lg:border squircle overflow-hidden flex flex-col items-center justify-start h-full w-full bg-background" }, /* @__PURE__ */ React.createElement(AppHeader, { isScrolled, breadcrumbs }), /* @__PURE__ */ React.createElement(
|
|
26
|
+
ScrollArea,
|
|
27
|
+
{
|
|
28
|
+
onScroll: (e) => setScrolled(e),
|
|
29
|
+
className: "h-[calc(100svh-56px-var(--header-height))] w-full flex-1",
|
|
30
|
+
orientation: "vertical"
|
|
31
|
+
},
|
|
32
|
+
/* @__PURE__ */ React.createElement("div", { className: "min-h-[calc(100svh-56px-var(--header-height))] p-4" }, children)
|
|
33
|
+
)));
|
|
34
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AppHeader = AppHeader;
|
|
8
|
+
var _ui = require("@arch-cadre/ui");
|
|
9
|
+
var _logo = require("@arch-cadre/ui/brand/logo");
|
|
10
|
+
var _button = require("@arch-cadre/ui/components/button");
|
|
11
|
+
var _separator = require("@arch-cadre/ui/components/separator");
|
|
12
|
+
var _sidebar = require("@arch-cadre/ui/components/sidebar");
|
|
13
|
+
var _utils = require("@arch-cadre/ui/lib/utils");
|
|
14
|
+
var _react = require("@iconify/react");
|
|
15
|
+
var _link = _interopRequireDefault(require("next/link"));
|
|
16
|
+
var React = _interopRequireWildcard(require("react"));
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
function AppHeader({
|
|
21
|
+
breadcrumbs,
|
|
22
|
+
isScrolled
|
|
23
|
+
}) {
|
|
24
|
+
const {
|
|
25
|
+
toggleSidebar
|
|
26
|
+
} = (0, _sidebar.useSidebar)();
|
|
27
|
+
return /* @__PURE__ */React.createElement("header", {
|
|
28
|
+
className: (0, _utils.cn)("sticky top-0 z-50", "flex w-full items-center h-(--header-height)", "transition-all", isScrolled ? "bg-background shadow-xs " : "")
|
|
29
|
+
}, /* @__PURE__ */React.createElement("div", {
|
|
30
|
+
className: "flex h-[var(--header-height)] w-full items-center"
|
|
31
|
+
}, /* @__PURE__ */React.createElement("div", {
|
|
32
|
+
className: "-mr-px flex shrink-0 items-center gap-2 px-4"
|
|
33
|
+
}, /* @__PURE__ */React.createElement(_button.Button, {
|
|
34
|
+
className: "h-8 w-8 cursor-pointer",
|
|
35
|
+
variant: "ghost",
|
|
36
|
+
size: "icon",
|
|
37
|
+
onClick: toggleSidebar,
|
|
38
|
+
type: "button"
|
|
39
|
+
}, /* @__PURE__ */React.createElement(_react.Icon, {
|
|
40
|
+
icon: "solar:sidebar-minimalistic-broken"
|
|
41
|
+
}))), /* @__PURE__ */React.createElement(_separator.Separator, {
|
|
42
|
+
orientation: "vertical",
|
|
43
|
+
className: "mr-2 h-4"
|
|
44
|
+
}), /* @__PURE__ */React.createElement("div", {
|
|
45
|
+
className: "flex flex-1 items-center gap-2 px-4"
|
|
46
|
+
}, /* @__PURE__ */React.createElement(_link.default, {
|
|
47
|
+
href: "/app",
|
|
48
|
+
className: "md:hidden items-center gap-x-2 mr-4 md:mr-0 flex"
|
|
49
|
+
}, /* @__PURE__ */React.createElement(_logo.Logo, {
|
|
50
|
+
className: "h-auto w-[134px]",
|
|
51
|
+
"aria-hidden": true
|
|
52
|
+
})), breadcrumbs, /* @__PURE__ */React.createElement("div", {
|
|
53
|
+
className: "ml-auto w-auto flex gap-x-3"
|
|
54
|
+
}, /* @__PURE__ */React.createElement(_ui.LanguageSwitcher, null)))));
|
|
55
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { LanguageSwitcher } from "@arch-cadre/ui";
|
|
3
|
+
import { Logo } from "@arch-cadre/ui/brand/logo";
|
|
4
|
+
import { Button } from "@arch-cadre/ui/components/button";
|
|
5
|
+
import { Separator } from "@arch-cadre/ui/components/separator";
|
|
6
|
+
import { useSidebar } from "@arch-cadre/ui/components/sidebar";
|
|
7
|
+
import { cn } from "@arch-cadre/ui/lib/utils";
|
|
8
|
+
import { Icon } from "@iconify/react";
|
|
9
|
+
import Link from "next/link";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
export function AppHeader({
|
|
12
|
+
breadcrumbs,
|
|
13
|
+
isScrolled
|
|
14
|
+
}) {
|
|
15
|
+
const { toggleSidebar } = useSidebar();
|
|
16
|
+
return /* @__PURE__ */ React.createElement(
|
|
17
|
+
"header",
|
|
18
|
+
{
|
|
19
|
+
className: cn(
|
|
20
|
+
"sticky top-0 z-50",
|
|
21
|
+
"flex w-full items-center h-(--header-height)",
|
|
22
|
+
"transition-all",
|
|
23
|
+
isScrolled ? "bg-background shadow-xs " : ""
|
|
24
|
+
)
|
|
25
|
+
},
|
|
26
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex h-[var(--header-height)] w-full items-center" }, /* @__PURE__ */ React.createElement("div", { className: "-mr-px flex shrink-0 items-center gap-2 px-4" }, /* @__PURE__ */ React.createElement(
|
|
27
|
+
Button,
|
|
28
|
+
{
|
|
29
|
+
className: "h-8 w-8 cursor-pointer",
|
|
30
|
+
variant: "ghost",
|
|
31
|
+
size: "icon",
|
|
32
|
+
onClick: toggleSidebar,
|
|
33
|
+
type: "button"
|
|
34
|
+
},
|
|
35
|
+
/* @__PURE__ */ React.createElement(Icon, { icon: "solar:sidebar-minimalistic-broken" })
|
|
36
|
+
)), /* @__PURE__ */ React.createElement(Separator, { orientation: "vertical", className: "mr-2 h-4" }), /* @__PURE__ */ React.createElement("div", { className: "flex flex-1 items-center gap-2 px-4" }, /* @__PURE__ */ React.createElement(
|
|
37
|
+
Link,
|
|
38
|
+
{
|
|
39
|
+
href: "/app",
|
|
40
|
+
className: "md:hidden items-center gap-x-2 mr-4 md:mr-0 flex"
|
|
41
|
+
},
|
|
42
|
+
/* @__PURE__ */ React.createElement(Logo, { className: "h-auto w-[134px]", "aria-hidden": true })
|
|
43
|
+
), breadcrumbs, /* @__PURE__ */ React.createElement("div", { className: "ml-auto w-auto flex gap-x-3" }, /* @__PURE__ */ React.createElement(LanguageSwitcher, null))))
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AppSidebar = AppSidebar;
|
|
8
|
+
var _intl = require("@arch-cadre/intl");
|
|
9
|
+
var _logo = require("@arch-cadre/ui/brand/logo");
|
|
10
|
+
var _collapsible = require("@arch-cadre/ui/components/collapsible");
|
|
11
|
+
var _scrollArea = require("@arch-cadre/ui/components/scroll-area");
|
|
12
|
+
var _sidebar = require("@arch-cadre/ui/components/sidebar");
|
|
13
|
+
var _utils = require("@arch-cadre/ui/lib/utils");
|
|
14
|
+
var _react = require("@iconify/react");
|
|
15
|
+
var _lucideReact = require("lucide-react");
|
|
16
|
+
var _link = _interopRequireDefault(require("next/link"));
|
|
17
|
+
var _navigation = require("next/navigation");
|
|
18
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
19
|
+
var React = _react2;
|
|
20
|
+
var _appUser = require("./app-user.cjs");
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
+
function AppSidebar({
|
|
25
|
+
isMain,
|
|
26
|
+
data,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
29
|
+
const {
|
|
30
|
+
open,
|
|
31
|
+
setOpenMobile,
|
|
32
|
+
isMobile
|
|
33
|
+
} = (0, _sidebar.useSidebar)();
|
|
34
|
+
const {
|
|
35
|
+
t
|
|
36
|
+
} = (0, _intl.useTranslation)();
|
|
37
|
+
const pathname = (0, _navigation.usePathname)();
|
|
38
|
+
const [scrolled, setScrolledState] = (0, _react2.useState)(false);
|
|
39
|
+
const matchPath = path => {
|
|
40
|
+
return path === pathname;
|
|
41
|
+
};
|
|
42
|
+
const matchPaths = path => {
|
|
43
|
+
return path === pathname || path.length > 1 && pathname.startsWith(path);
|
|
44
|
+
};
|
|
45
|
+
(0, _react2.useEffect)(() => {
|
|
46
|
+
if (isMobile && open) {
|
|
47
|
+
setOpenMobile(false);
|
|
48
|
+
}
|
|
49
|
+
}, [pathname]);
|
|
50
|
+
const setScrolled = e => {
|
|
51
|
+
const scrollTop = e.currentTarget.scrollTop;
|
|
52
|
+
if (scrollTop > 20) {
|
|
53
|
+
setScrolledState(true);
|
|
54
|
+
} else {
|
|
55
|
+
setScrolledState(false);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */React.createElement(_sidebar.Sidebar, {
|
|
59
|
+
className: "lg:border-r-0!",
|
|
60
|
+
collapsible: "offcanvas",
|
|
61
|
+
...props
|
|
62
|
+
}, /* @__PURE__ */React.createElement(_sidebar.SidebarHeader, {
|
|
63
|
+
className: "hidden md:flex h-[var(--header-height)] py-0"
|
|
64
|
+
}, /* @__PURE__ */React.createElement("div", {
|
|
65
|
+
className: "flex shrink-0 items-center px-4 h-[var(--header-height)] w-[var(--sidebar-width)] "
|
|
66
|
+
}, /* @__PURE__ */React.createElement(_link.default, {
|
|
67
|
+
href: "/kryo",
|
|
68
|
+
className: "items-center flex"
|
|
69
|
+
}, /* @__PURE__ */React.createElement(_logo.Logo, {
|
|
70
|
+
className: "h-auto w-[134px]",
|
|
71
|
+
"aria-hidden": true
|
|
72
|
+
})))), /* @__PURE__ */React.createElement(_sidebar.SidebarHeader, {
|
|
73
|
+
className: (0, _utils.cn)("px-2", scrolled ? "border-b border-border/50 shadow-[0_20px_20px_0px_rgb(246_246_246/90%)]" : "")
|
|
74
|
+
}, isMain ? null : /* @__PURE__ */React.createElement(_sidebar.SidebarMenuItem, null, /* @__PURE__ */React.createElement(_sidebar.SidebarMenuButton, {
|
|
75
|
+
asChild: true
|
|
76
|
+
}, /* @__PURE__ */React.createElement(_link.default, {
|
|
77
|
+
href: "/kryo"
|
|
78
|
+
}, /* @__PURE__ */React.createElement("span", {
|
|
79
|
+
className: "size-8 p-1 flex items-center justify-center rounded-lg bg-sidebar-accent backdrop-blur text-sidebar-accent-foreground"
|
|
80
|
+
}, /* @__PURE__ */React.createElement(_react.Icon, {
|
|
81
|
+
className: "size-4",
|
|
82
|
+
icon: "solar:arrow-left-broken"
|
|
83
|
+
})), /* @__PURE__ */React.createElement("span", null, t("Back to Dashboard")))))), /* @__PURE__ */React.createElement(_sidebar.SidebarContent, null, /* @__PURE__ */React.createElement(_scrollArea.ScrollArea, {
|
|
84
|
+
orientation: "vertical",
|
|
85
|
+
className: "h-full",
|
|
86
|
+
onScroll: e => setScrolled(e)
|
|
87
|
+
}, data.map(group => /* @__PURE__ */React.createElement(_sidebar.SidebarGroup, {
|
|
88
|
+
key: group.title,
|
|
89
|
+
className: "group-data-[collapsible=icon]:hidden py-0"
|
|
90
|
+
}, /* @__PURE__ */React.createElement(_sidebar.SidebarGroupLabel, null, t(group.title)), group.items.map(item => /* @__PURE__ */React.createElement(_sidebar.SidebarMenu, {
|
|
91
|
+
key: item.url
|
|
92
|
+
}, item.items && item.items.length > 0 ? /* @__PURE__ */React.createElement(_collapsible.Collapsible, {
|
|
93
|
+
key: item.url,
|
|
94
|
+
asChild: true,
|
|
95
|
+
defaultOpen: matchPaths(item.url),
|
|
96
|
+
className: "group/collapsible"
|
|
97
|
+
}, /* @__PURE__ */React.createElement(_sidebar.SidebarMenuItem, null, /* @__PURE__ */React.createElement(_collapsible.CollapsibleTrigger, {
|
|
98
|
+
asChild: true
|
|
99
|
+
}, /* @__PURE__ */React.createElement(_sidebar.SidebarMenuButton, {
|
|
100
|
+
className: "squircle",
|
|
101
|
+
isActive: matchPaths(item.url),
|
|
102
|
+
tooltip: t(item.title)
|
|
103
|
+
}, /* @__PURE__ */React.createElement("span", {
|
|
104
|
+
className: "size-8 p-1 flex items-center justify-center rounded-lg bg-sidebar-accent backdrop-blur text-sidebar-accent-foreground"
|
|
105
|
+
}, item.icon && /* @__PURE__ */React.createElement(_react.Icon, {
|
|
106
|
+
className: "size-4",
|
|
107
|
+
icon: item.icon
|
|
108
|
+
})), /* @__PURE__ */React.createElement("span", null, t(item.title)), /* @__PURE__ */React.createElement(_lucideReact.ChevronRight, {
|
|
109
|
+
className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"
|
|
110
|
+
}))), /* @__PURE__ */React.createElement(_collapsible.CollapsibleContent, null, /* @__PURE__ */React.createElement(_sidebar.SidebarMenuSub, null, item.items?.map(subItem => /* @__PURE__ */React.createElement(_sidebar.SidebarMenuSubItem, {
|
|
111
|
+
key: subItem.url
|
|
112
|
+
}, /* @__PURE__ */React.createElement(_sidebar.SidebarMenuSubButton, {
|
|
113
|
+
isActive: matchPath(subItem.url),
|
|
114
|
+
asChild: true
|
|
115
|
+
}, /* @__PURE__ */React.createElement(_link.default, {
|
|
116
|
+
href: subItem.url
|
|
117
|
+
}, /* @__PURE__ */React.createElement("span", null, t(subItem.title)))))))))) : /* @__PURE__ */React.createElement(_sidebar.SidebarMenuItem, {
|
|
118
|
+
key: item.url
|
|
119
|
+
}, /* @__PURE__ */React.createElement(_sidebar.SidebarMenuButton, {
|
|
120
|
+
className: "squircle",
|
|
121
|
+
asChild: true,
|
|
122
|
+
isActive: matchPath(item.url)
|
|
123
|
+
}, /* @__PURE__ */React.createElement(_link.default, {
|
|
124
|
+
href: item.url
|
|
125
|
+
}, /* @__PURE__ */React.createElement("span", {
|
|
126
|
+
className: "size-8 p-1 flex items-center justify-center rounded-lg bg-sidebar-accent backdrop-blur text-sidebar-accent-foreground"
|
|
127
|
+
}, item.icon && /* @__PURE__ */React.createElement(_react.Icon, {
|
|
128
|
+
className: "size-4",
|
|
129
|
+
icon: item.icon
|
|
130
|
+
})), /* @__PURE__ */React.createElement("span", null, t(item.title))))))))))), /* @__PURE__ */React.createElement(_sidebar.SidebarFooter, {
|
|
131
|
+
className: (0, _utils.cn)("px-2", scrolled ? "border-t border-border/50 shadow-[0_-20px_20px_0px_rgb(246_246_246/90%)]" : "")
|
|
132
|
+
}, /* @__PURE__ */React.createElement(_appUser.AppUser, null)));
|
|
133
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Sidebar } from "@arch-cadre/ui/components/sidebar";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type SidebarItem = {
|
|
4
|
+
id?: string;
|
|
5
|
+
title: string;
|
|
6
|
+
url: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
items?: SidebarItem[];
|
|
9
|
+
};
|
|
10
|
+
export type SidebarGroupType = {
|
|
11
|
+
title: string;
|
|
12
|
+
items: SidebarItem[];
|
|
13
|
+
};
|
|
14
|
+
export declare function AppSidebar({ isMain, data, ...props }: React.ComponentProps<typeof Sidebar> & {
|
|
15
|
+
isMain: boolean;
|
|
16
|
+
data: SidebarGroupType[];
|
|
17
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useTranslation } from "@arch-cadre/intl";
|
|
3
|
+
import { Logo } from "@arch-cadre/ui/brand/logo";
|
|
4
|
+
import {
|
|
5
|
+
Collapsible,
|
|
6
|
+
CollapsibleContent,
|
|
7
|
+
CollapsibleTrigger
|
|
8
|
+
} from "@arch-cadre/ui/components/collapsible";
|
|
9
|
+
import { ScrollArea } from "@arch-cadre/ui/components/scroll-area";
|
|
10
|
+
import {
|
|
11
|
+
Sidebar,
|
|
12
|
+
SidebarContent,
|
|
13
|
+
SidebarFooter,
|
|
14
|
+
SidebarGroup,
|
|
15
|
+
SidebarGroupLabel,
|
|
16
|
+
SidebarHeader,
|
|
17
|
+
SidebarMenu,
|
|
18
|
+
SidebarMenuButton,
|
|
19
|
+
SidebarMenuItem,
|
|
20
|
+
SidebarMenuSub,
|
|
21
|
+
SidebarMenuSubButton,
|
|
22
|
+
SidebarMenuSubItem,
|
|
23
|
+
useSidebar
|
|
24
|
+
} from "@arch-cadre/ui/components/sidebar";
|
|
25
|
+
import { cn } from "@arch-cadre/ui/lib/utils";
|
|
26
|
+
import { Icon } from "@iconify/react";
|
|
27
|
+
import { ChevronRight } from "lucide-react";
|
|
28
|
+
import Link from "next/link";
|
|
29
|
+
import { usePathname } from "next/navigation";
|
|
30
|
+
import * as React from "react";
|
|
31
|
+
import { useEffect, useState } from "react";
|
|
32
|
+
import { AppUser } from "./app-user.mjs";
|
|
33
|
+
export function AppSidebar({
|
|
34
|
+
isMain,
|
|
35
|
+
data,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
const { open, setOpenMobile, isMobile } = useSidebar();
|
|
39
|
+
const { t } = useTranslation();
|
|
40
|
+
const pathname = usePathname();
|
|
41
|
+
const [scrolled, setScrolledState] = useState(false);
|
|
42
|
+
const matchPath = (path) => {
|
|
43
|
+
return path === pathname;
|
|
44
|
+
};
|
|
45
|
+
const matchPaths = (path) => {
|
|
46
|
+
return path === pathname || path.length > 1 && pathname.startsWith(path);
|
|
47
|
+
};
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (isMobile && open) {
|
|
50
|
+
setOpenMobile(false);
|
|
51
|
+
}
|
|
52
|
+
}, [pathname]);
|
|
53
|
+
const setScrolled = (e) => {
|
|
54
|
+
const scrollTop = e.currentTarget.scrollTop;
|
|
55
|
+
if (scrollTop > 20) {
|
|
56
|
+
setScrolledState(true);
|
|
57
|
+
} else {
|
|
58
|
+
setScrolledState(false);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
return /* @__PURE__ */ React.createElement(Sidebar, { className: "lg:border-r-0!", collapsible: "offcanvas", ...props }, /* @__PURE__ */ React.createElement(SidebarHeader, { className: "hidden md:flex h-[var(--header-height)] py-0" }, /* @__PURE__ */ React.createElement("div", { className: "flex shrink-0 items-center px-4 h-[var(--header-height)] w-[var(--sidebar-width)] " }, /* @__PURE__ */ React.createElement(Link, { href: "/kryo", className: "items-center flex" }, /* @__PURE__ */ React.createElement(Logo, { className: "h-auto w-[134px]", "aria-hidden": true })))), /* @__PURE__ */ React.createElement(
|
|
62
|
+
SidebarHeader,
|
|
63
|
+
{
|
|
64
|
+
className: cn(
|
|
65
|
+
"px-2",
|
|
66
|
+
scrolled ? "border-b border-border/50 shadow-[0_20px_20px_0px_rgb(246_246_246/90%)]" : ""
|
|
67
|
+
)
|
|
68
|
+
},
|
|
69
|
+
isMain ? null : /* @__PURE__ */ React.createElement(SidebarMenuItem, null, /* @__PURE__ */ React.createElement(SidebarMenuButton, { asChild: true }, /* @__PURE__ */ React.createElement(Link, { href: "/kryo" }, /* @__PURE__ */ React.createElement("span", { className: "size-8 p-1 flex items-center justify-center rounded-lg bg-sidebar-accent backdrop-blur text-sidebar-accent-foreground" }, /* @__PURE__ */ React.createElement(Icon, { className: "size-4", icon: "solar:arrow-left-broken" })), /* @__PURE__ */ React.createElement("span", null, t("Back to Dashboard")))))
|
|
70
|
+
), /* @__PURE__ */ React.createElement(SidebarContent, null, /* @__PURE__ */ React.createElement(
|
|
71
|
+
ScrollArea,
|
|
72
|
+
{
|
|
73
|
+
orientation: "vertical",
|
|
74
|
+
className: "h-full",
|
|
75
|
+
onScroll: (e) => setScrolled(e)
|
|
76
|
+
},
|
|
77
|
+
data.map((group) => /* @__PURE__ */ React.createElement(
|
|
78
|
+
SidebarGroup,
|
|
79
|
+
{
|
|
80
|
+
key: group.title,
|
|
81
|
+
className: "group-data-[collapsible=icon]:hidden py-0"
|
|
82
|
+
},
|
|
83
|
+
/* @__PURE__ */ React.createElement(SidebarGroupLabel, null, t(group.title)),
|
|
84
|
+
group.items.map((item) => /* @__PURE__ */ React.createElement(SidebarMenu, { key: item.url }, item.items && item.items.length > 0 ? /* @__PURE__ */ React.createElement(
|
|
85
|
+
Collapsible,
|
|
86
|
+
{
|
|
87
|
+
key: item.url,
|
|
88
|
+
asChild: true,
|
|
89
|
+
defaultOpen: matchPaths(item.url),
|
|
90
|
+
className: "group/collapsible"
|
|
91
|
+
},
|
|
92
|
+
/* @__PURE__ */ React.createElement(SidebarMenuItem, null, /* @__PURE__ */ React.createElement(CollapsibleTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
93
|
+
SidebarMenuButton,
|
|
94
|
+
{
|
|
95
|
+
className: "squircle",
|
|
96
|
+
isActive: matchPaths(item.url),
|
|
97
|
+
tooltip: t(item.title)
|
|
98
|
+
},
|
|
99
|
+
/* @__PURE__ */ React.createElement("span", { className: "size-8 p-1 flex items-center justify-center rounded-lg bg-sidebar-accent backdrop-blur text-sidebar-accent-foreground" }, item.icon && /* @__PURE__ */ React.createElement(
|
|
100
|
+
Icon,
|
|
101
|
+
{
|
|
102
|
+
className: "size-4",
|
|
103
|
+
icon: item.icon
|
|
104
|
+
}
|
|
105
|
+
)),
|
|
106
|
+
/* @__PURE__ */ React.createElement("span", null, t(item.title)),
|
|
107
|
+
/* @__PURE__ */ React.createElement(ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
108
|
+
)), /* @__PURE__ */ React.createElement(CollapsibleContent, null, /* @__PURE__ */ React.createElement(SidebarMenuSub, null, item.items?.map((subItem) => /* @__PURE__ */ React.createElement(SidebarMenuSubItem, { key: subItem.url }, /* @__PURE__ */ React.createElement(
|
|
109
|
+
SidebarMenuSubButton,
|
|
110
|
+
{
|
|
111
|
+
isActive: matchPath(subItem.url),
|
|
112
|
+
asChild: true
|
|
113
|
+
},
|
|
114
|
+
/* @__PURE__ */ React.createElement(Link, { href: subItem.url }, /* @__PURE__ */ React.createElement("span", null, t(subItem.title)))
|
|
115
|
+
))))))
|
|
116
|
+
) : /* @__PURE__ */ React.createElement(SidebarMenuItem, { key: item.url }, /* @__PURE__ */ React.createElement(
|
|
117
|
+
SidebarMenuButton,
|
|
118
|
+
{
|
|
119
|
+
className: "squircle",
|
|
120
|
+
asChild: true,
|
|
121
|
+
isActive: matchPath(item.url)
|
|
122
|
+
},
|
|
123
|
+
/* @__PURE__ */ React.createElement(Link, { href: item.url }, /* @__PURE__ */ React.createElement("span", { className: "size-8 p-1 flex items-center justify-center rounded-lg bg-sidebar-accent backdrop-blur text-sidebar-accent-foreground" }, item.icon && /* @__PURE__ */ React.createElement(
|
|
124
|
+
Icon,
|
|
125
|
+
{
|
|
126
|
+
className: "size-4",
|
|
127
|
+
icon: item.icon
|
|
128
|
+
}
|
|
129
|
+
)), /* @__PURE__ */ React.createElement("span", null, t(item.title)))
|
|
130
|
+
))))
|
|
131
|
+
))
|
|
132
|
+
)), /* @__PURE__ */ React.createElement(
|
|
133
|
+
SidebarFooter,
|
|
134
|
+
{
|
|
135
|
+
className: cn(
|
|
136
|
+
"px-2",
|
|
137
|
+
scrolled ? "border-t border-border/50 shadow-[0_-20px_20px_0px_rgb(246_246_246/90%)]" : ""
|
|
138
|
+
)
|
|
139
|
+
},
|
|
140
|
+
/* @__PURE__ */ React.createElement(AppUser, null)
|
|
141
|
+
));
|
|
142
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AppUser = AppUser;
|
|
8
|
+
var _intl = require("@arch-cadre/intl");
|
|
9
|
+
var _modules = require("@arch-cadre/modules");
|
|
10
|
+
var _avatar = require("@arch-cadre/ui/components/avatar");
|
|
11
|
+
var _dropdownMenu = require("@arch-cadre/ui/components/dropdown-menu");
|
|
12
|
+
var _sidebar = require("@arch-cadre/ui/components/sidebar");
|
|
13
|
+
var _useMobile = require("@arch-cadre/ui/hooks/use-mobile");
|
|
14
|
+
var _useUser = require("@arch-cadre/ui/hooks/use-user");
|
|
15
|
+
var _utils = require("@arch-cadre/ui/lib/utils");
|
|
16
|
+
var _react = require("@iconify/react");
|
|
17
|
+
var React = _interopRequireWildcard(require("react"));
|
|
18
|
+
var _sonner = require("sonner");
|
|
19
|
+
var _index = require("../../actions/index.cjs");
|
|
20
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
|
+
function AppUser() {
|
|
23
|
+
const {
|
|
24
|
+
user,
|
|
25
|
+
isLoading,
|
|
26
|
+
signOut
|
|
27
|
+
} = (0, _useUser.useUser)();
|
|
28
|
+
const isMobile = (0, _useMobile.useIsMobile)();
|
|
29
|
+
const {
|
|
30
|
+
t
|
|
31
|
+
} = (0, _intl.useTranslation)();
|
|
32
|
+
if (!user) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const handleSignOut = async () => {
|
|
36
|
+
_sonner.toast.promise(async () => {
|
|
37
|
+
await (0, _index.logoutAction)();
|
|
38
|
+
}, {
|
|
39
|
+
loading: t("Please wait..."),
|
|
40
|
+
success: t("Logout successful!"),
|
|
41
|
+
error: t("error_occurred")
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */React.createElement(_sidebar.SidebarMenu, null, /* @__PURE__ */React.createElement(_sidebar.SidebarMenuItem, null, /* @__PURE__ */React.createElement(_dropdownMenu.DropdownMenu, null, /* @__PURE__ */React.createElement(_dropdownMenu.DropdownMenuTrigger, {
|
|
45
|
+
asChild: true
|
|
46
|
+
}, /* @__PURE__ */React.createElement(_sidebar.SidebarMenuButton, {
|
|
47
|
+
size: "lg",
|
|
48
|
+
className: (0, _utils.cn)(isLoading && "opacity-50", "cursor-pointer data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground")
|
|
49
|
+
}, /* @__PURE__ */React.createElement(_avatar.Avatar, {
|
|
50
|
+
className: "h-8 w-8 rounded-full"
|
|
51
|
+
}, /* @__PURE__ */React.createElement(_avatar.AvatarImage, {
|
|
52
|
+
src: user.image ?? void 0,
|
|
53
|
+
alt: user.name
|
|
54
|
+
}), /* @__PURE__ */React.createElement(_avatar.AvatarFallback, {
|
|
55
|
+
className: "rounded-full"
|
|
56
|
+
}, user.name.charAt(0).toUpperCase())), /* @__PURE__ */React.createElement("div", {
|
|
57
|
+
className: "grid flex-1 text-left text-sm leading-tight"
|
|
58
|
+
}, /* @__PURE__ */React.createElement("span", {
|
|
59
|
+
className: "truncate font-medium"
|
|
60
|
+
}, user.name), /* @__PURE__ */React.createElement("span", {
|
|
61
|
+
className: "truncate text-xs"
|
|
62
|
+
}, user.email)), /* @__PURE__ */React.createElement(_react.Icon, {
|
|
63
|
+
icon: "solar:menu-dots-broken",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
className: "mr-1 size-4 rotate-90"
|
|
66
|
+
}))), /* @__PURE__ */React.createElement(_dropdownMenu.DropdownMenuContent, {
|
|
67
|
+
className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
|
|
68
|
+
side: isMobile ? "bottom" : "top",
|
|
69
|
+
align: "end",
|
|
70
|
+
sideOffset: 4
|
|
71
|
+
}, /* @__PURE__ */React.createElement(_dropdownMenu.DropdownMenuLabel, {
|
|
72
|
+
className: "p-0 font-normal"
|
|
73
|
+
}, /* @__PURE__ */React.createElement("div", {
|
|
74
|
+
className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm"
|
|
75
|
+
}, /* @__PURE__ */React.createElement(_avatar.Avatar, {
|
|
76
|
+
className: "h-8 w-8 rounded-full"
|
|
77
|
+
}, /* @__PURE__ */React.createElement(_avatar.AvatarImage, {
|
|
78
|
+
src: user.image ?? void 0,
|
|
79
|
+
alt: user.name
|
|
80
|
+
}), /* @__PURE__ */React.createElement(_avatar.AvatarFallback, {
|
|
81
|
+
className: "rounded-full"
|
|
82
|
+
}, user.name.charAt(0).toUpperCase())), /* @__PURE__ */React.createElement("div", {
|
|
83
|
+
className: "grid flex-1 text-left text-sm leading-tight"
|
|
84
|
+
}, /* @__PURE__ */React.createElement("span", {
|
|
85
|
+
className: "truncate font-medium"
|
|
86
|
+
}, user.name), /* @__PURE__ */React.createElement("span", {
|
|
87
|
+
className: "truncate text-xs"
|
|
88
|
+
}, user.email)))), /* @__PURE__ */React.createElement(_modules.ExtensionPointClient, {
|
|
89
|
+
module: "panel",
|
|
90
|
+
point: "app-user:extra-link"
|
|
91
|
+
}), /* @__PURE__ */React.createElement(_dropdownMenu.DropdownMenuSeparator, null), /* @__PURE__ */React.createElement("button", {
|
|
92
|
+
type: "button",
|
|
93
|
+
onClick: () => {
|
|
94
|
+
handleSignOut();
|
|
95
|
+
},
|
|
96
|
+
className: "w-full"
|
|
97
|
+
}, /* @__PURE__ */React.createElement(_dropdownMenu.DropdownMenuItem, {
|
|
98
|
+
className: "cursor-pointer "
|
|
99
|
+
}, /* @__PURE__ */React.createElement(_react.Icon, {
|
|
100
|
+
icon: "solar:logout-broken"
|
|
101
|
+
}), t("Logout")))))));
|
|
102
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useTranslation } from "@arch-cadre/intl";
|
|
3
|
+
import {
|
|
4
|
+
ExtensionPointClient
|
|
5
|
+
} from "@arch-cadre/modules";
|
|
6
|
+
import {
|
|
7
|
+
Avatar,
|
|
8
|
+
AvatarFallback,
|
|
9
|
+
AvatarImage
|
|
10
|
+
} from "@arch-cadre/ui/components/avatar";
|
|
11
|
+
import {
|
|
12
|
+
DropdownMenu,
|
|
13
|
+
DropdownMenuContent,
|
|
14
|
+
DropdownMenuItem,
|
|
15
|
+
DropdownMenuLabel,
|
|
16
|
+
DropdownMenuSeparator,
|
|
17
|
+
DropdownMenuTrigger
|
|
18
|
+
} from "@arch-cadre/ui/components/dropdown-menu";
|
|
19
|
+
import {
|
|
20
|
+
SidebarMenu,
|
|
21
|
+
SidebarMenuButton,
|
|
22
|
+
SidebarMenuItem
|
|
23
|
+
} from "@arch-cadre/ui/components/sidebar";
|
|
24
|
+
import { useIsMobile } from "@arch-cadre/ui/hooks/use-mobile";
|
|
25
|
+
import { useUser } from "@arch-cadre/ui/hooks/use-user";
|
|
26
|
+
import { cn } from "@arch-cadre/ui/lib/utils";
|
|
27
|
+
import { Icon } from "@iconify/react";
|
|
28
|
+
import * as React from "react";
|
|
29
|
+
import { toast } from "sonner";
|
|
30
|
+
import { logoutAction } from "../../actions/index.mjs";
|
|
31
|
+
export function AppUser() {
|
|
32
|
+
const { user, isLoading, signOut } = useUser();
|
|
33
|
+
const isMobile = useIsMobile();
|
|
34
|
+
const { t } = useTranslation();
|
|
35
|
+
if (!user) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const handleSignOut = async () => {
|
|
39
|
+
toast.promise(
|
|
40
|
+
async () => {
|
|
41
|
+
await logoutAction();
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
loading: t("Please wait..."),
|
|
45
|
+
success: t("Logout successful!"),
|
|
46
|
+
error: t("error_occurred")
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ React.createElement(SidebarMenu, null, /* @__PURE__ */ React.createElement(SidebarMenuItem, null, /* @__PURE__ */ React.createElement(DropdownMenu, null, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
|
|
51
|
+
SidebarMenuButton,
|
|
52
|
+
{
|
|
53
|
+
size: "lg",
|
|
54
|
+
className: cn(
|
|
55
|
+
isLoading && "opacity-50",
|
|
56
|
+
"cursor-pointer data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
|
|
57
|
+
)
|
|
58
|
+
},
|
|
59
|
+
/* @__PURE__ */ React.createElement(Avatar, { className: "h-8 w-8 rounded-full" }, /* @__PURE__ */ React.createElement(AvatarImage, { src: user.image ?? void 0, alt: user.name }), /* @__PURE__ */ React.createElement(AvatarFallback, { className: "rounded-full" }, user.name.charAt(0).toUpperCase())),
|
|
60
|
+
/* @__PURE__ */ React.createElement("div", { className: "grid flex-1 text-left text-sm leading-tight" }, /* @__PURE__ */ React.createElement("span", { className: "truncate font-medium" }, user.name), /* @__PURE__ */ React.createElement("span", { className: "truncate text-xs" }, user.email)),
|
|
61
|
+
/* @__PURE__ */ React.createElement(
|
|
62
|
+
Icon,
|
|
63
|
+
{
|
|
64
|
+
icon: "solar:menu-dots-broken",
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
className: "mr-1 size-4 rotate-90"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
)), /* @__PURE__ */ React.createElement(
|
|
70
|
+
DropdownMenuContent,
|
|
71
|
+
{
|
|
72
|
+
className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
|
|
73
|
+
side: isMobile ? "bottom" : "top",
|
|
74
|
+
align: "end",
|
|
75
|
+
sideOffset: 4
|
|
76
|
+
},
|
|
77
|
+
/* @__PURE__ */ React.createElement(DropdownMenuLabel, { className: "p-0 font-normal" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm" }, /* @__PURE__ */ React.createElement(Avatar, { className: "h-8 w-8 rounded-full" }, /* @__PURE__ */ React.createElement(AvatarImage, { src: user.image ?? void 0, alt: user.name }), /* @__PURE__ */ React.createElement(AvatarFallback, { className: "rounded-full" }, user.name.charAt(0).toUpperCase())), /* @__PURE__ */ React.createElement("div", { className: "grid flex-1 text-left text-sm leading-tight" }, /* @__PURE__ */ React.createElement("span", { className: "truncate font-medium" }, user.name), /* @__PURE__ */ React.createElement("span", { className: "truncate text-xs" }, user.email)))),
|
|
78
|
+
/* @__PURE__ */ React.createElement(ExtensionPointClient, { module: "panel", point: "app-user:extra-link" }),
|
|
79
|
+
/* @__PURE__ */ React.createElement(DropdownMenuSeparator, null),
|
|
80
|
+
/* @__PURE__ */ React.createElement(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
type: "button",
|
|
84
|
+
onClick: () => {
|
|
85
|
+
handleSignOut();
|
|
86
|
+
},
|
|
87
|
+
className: "w-full"
|
|
88
|
+
},
|
|
89
|
+
/* @__PURE__ */ React.createElement(DropdownMenuItem, { className: "cursor-pointer " }, /* @__PURE__ */ React.createElement(Icon, { icon: "solar:logout-broken" }), t("Logout"))
|
|
90
|
+
)
|
|
91
|
+
))));
|
|
92
|
+
}
|