@yimingliao/cms 0.0.130 → 0.0.131
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/export/client/index.js +2 -1
- package/dist/src/client/infrastructure/contexts/admin.js +5 -4
- package/dist/src/client/infrastructure/contexts/theme.js +5 -5
- package/dist/src/client/infrastructure/toast/error-display.js +15 -3
- package/dist/src/client/interfaces/components/shadcn/avatar.js +5 -4
- package/dist/src/client/interfaces/components/shadcn/button.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/card.js +9 -8
- package/dist/src/client/interfaces/components/shadcn/collapsible.js +4 -3
- package/dist/src/client/interfaces/components/shadcn/dropdown-menu.js +36 -29
- package/dist/src/client/interfaces/components/shadcn/input-group.js +8 -7
- package/dist/src/client/interfaces/components/shadcn/input.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/label.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/pagination.js +21 -18
- package/dist/src/client/interfaces/components/shadcn/select.js +47 -40
- package/dist/src/client/interfaces/components/shadcn/separator.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/sheet.js +36 -27
- package/dist/src/client/interfaces/components/shadcn/sidebar.js +120 -105
- package/dist/src/client/interfaces/components/shadcn/skeleton.js +2 -1
- package/dist/src/client/interfaces/components/shadcn/spinner.js +2 -1
- package/dist/src/client/interfaces/components/shadcn/textarea.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/tooltip.js +13 -10
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +35 -23
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +20 -14
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +35 -26
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header-title.js +10 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +21 -15
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch.js +19 -14
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/index.js +34 -29
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/show.js +43 -37
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/trash.js +24 -18
- package/dist/src/client/interfaces/components/ui/buttons/button.js +8 -4
- package/dist/src/client/interfaces/components/ui/buttons/return-button.js +5 -4
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +9 -6
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list-content.js +14 -8
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list.js +22 -17
- package/dist/src/client/interfaces/components/ui/form/containers/fields-container.js +5 -4
- package/dist/src/client/interfaces/components/ui/form/containers/main-fields.js +5 -4
- package/dist/src/client/interfaces/components/ui/form/containers/side-fields.js +5 -4
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-display.js +80 -57
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-input.js +114 -91
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +4 -3
- package/dist/src/client/interfaces/components/ui/form/field-body.js +31 -28
- package/dist/src/client/interfaces/components/ui/form/field.js +12 -1
- package/dist/src/client/interfaces/components/ui/form/form.js +2 -1
- package/dist/src/client/interfaces/components/ui/form/index-field.js +49 -42
- package/dist/src/client/interfaces/components/ui/form/slug-field.js +45 -38
- package/dist/src/client/interfaces/components/ui/inputs/array-input.js +63 -52
- package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +41 -38
- package/dist/src/client/interfaces/components/ui/inputs/input.js +20 -17
- package/dist/src/client/interfaces/components/ui/inputs/password-input.js +6 -5
- package/dist/src/client/interfaces/components/ui/inputs/search-input.js +6 -5
- package/dist/src/client/interfaces/components/ui/inputs/select.js +19 -13
- package/dist/src/client/interfaces/components/ui/inputs/textarea.js +3 -2
- package/dist/src/client/interfaces/components/ui/layouts/content-container.js +5 -4
- package/dist/src/client/interfaces/components/ui/layouts/layout-skeleton.js +20 -7
- package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +8 -1
- package/dist/src/client/interfaces/components/ui/layouts/navbar/nav-user.js +60 -34
- package/dist/src/client/interfaces/components/ui/layouts/navbar/navbar.js +39 -26
- package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +6 -2
- package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +22 -1
- package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +43 -27
- package/dist/src/client/interfaces/pages/auth/change-password.js +81 -70
- package/dist/src/client/interfaces/pages/auth/email-unverified.js +39 -21
- package/dist/src/client/interfaces/pages/auth/forgot-password.js +41 -26
- package/dist/src/client/interfaces/pages/auth/reset-password.js +60 -51
- package/dist/src/client/interfaces/pages/auth/sign-in.js +46 -37
- package/dist/src/client/interfaces/pages/auth/verify-email.js +2 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { SIDEBAR_WIDTH } from '../../../styles/constants.js';
|
|
2
3
|
import '@radix-ui/react-avatar';
|
|
3
4
|
import 'react';
|
|
@@ -20,13 +21,25 @@ import '@radix-ui/react-tooltip';
|
|
|
20
21
|
|
|
21
22
|
function LayoutSkeleton() {
|
|
22
23
|
const { open } = useSidebar();
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-1", children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Sidebar, { className: "top-(--header-height) h-[calc(100svh-var(--header-height))]!", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 p-3", children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }),
|
|
27
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }),
|
|
28
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }),
|
|
29
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
|
|
30
|
+
] }) }),
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
SidebarInset,
|
|
33
|
+
{
|
|
34
|
+
style: { width: open ? `calc(100% - ${SIDEBAR_WIDTH})` : "100%" },
|
|
35
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 p-6", children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-96" }),
|
|
37
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-72" }),
|
|
38
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-64" })
|
|
39
|
+
] })
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
] });
|
|
30
43
|
}
|
|
31
44
|
|
|
32
45
|
export { LayoutSkeleton };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Link } from 'intor/next';
|
|
3
4
|
import { Languages } from 'lucide-react';
|
|
4
5
|
import '@radix-ui/react-avatar';
|
|
@@ -27,7 +28,13 @@ function createI18nSelector({
|
|
|
27
28
|
}) {
|
|
28
29
|
return function I18nSelector() {
|
|
29
30
|
if (!enabled) return null;
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
32
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "icon", children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Languages, {}),
|
|
34
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Switch Languages" })
|
|
35
|
+
] }) }),
|
|
36
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", children: locales.map((locale) => /* @__PURE__ */ jsx(Link, { locale, children: /* @__PURE__ */ jsx(DropdownMenuItem, { children: localeDisplay[locale] }) }, locale)) })
|
|
37
|
+
] });
|
|
31
38
|
};
|
|
32
39
|
}
|
|
33
40
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import { useTranslator } from 'intor/react';
|
|
3
4
|
import { UserCircle, ChevronsUpDown, PenLine } from 'lucide-react';
|
|
4
5
|
import Link from 'next/link';
|
|
@@ -35,45 +36,70 @@ function NavUser({
|
|
|
35
36
|
const { t, locale } = useTranslator();
|
|
36
37
|
const { name } = findTranslation(admin?.translations, locale);
|
|
37
38
|
if (isLoading)
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", disabled: true, className: "w-64", children: /* @__PURE__ */ jsx(Spinner, {}) });
|
|
39
40
|
if (!admin)
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
size: "lg",
|
|
45
|
-
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
46
|
-
disabled: isLoading
|
|
47
|
-
},
|
|
48
|
-
/* @__PURE__ */ React.createElement(Avatar, { className: "h-8 w-8 rounded-lg" }, admin.avatarImage?.key && /* @__PURE__ */ React.createElement(
|
|
49
|
-
AvatarImage,
|
|
41
|
+
return /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", disabled: true, className: "w-64", children: /* @__PURE__ */ jsx(UserCircle, { className: "size-4" }) });
|
|
42
|
+
return /* @__PURE__ */ jsx(SidebarMenu, { className: "w-64", children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
44
|
+
SidebarMenuButton,
|
|
50
45
|
{
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
size: "lg",
|
|
47
|
+
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
48
|
+
disabled: isLoading,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsxs(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
51
|
+
admin.avatarImage?.key && /* @__PURE__ */ jsx(
|
|
52
|
+
AvatarImage,
|
|
53
|
+
{
|
|
54
|
+
src: joinUrl(storageUrl, admin.avatarImage?.key),
|
|
55
|
+
alt: name ?? ""
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ jsx(AvatarFallback, { className: "rounded-lg" })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-medium", children: name }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs", children: admin.email })
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-auto size-4" })
|
|
65
|
+
]
|
|
53
66
|
}
|
|
54
|
-
)
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
)), /* @__PURE__ */ React.createElement(
|
|
58
|
-
DropdownMenuContent,
|
|
59
|
-
{
|
|
60
|
-
className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
|
|
61
|
-
side: "bottom",
|
|
62
|
-
align: "end",
|
|
63
|
-
sideOffset: 4
|
|
64
|
-
},
|
|
65
|
-
/* @__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-lg" }, admin.avatarImage?.key && /* @__PURE__ */ React.createElement(
|
|
66
|
-
AvatarImage,
|
|
67
|
+
) }),
|
|
68
|
+
/* @__PURE__ */ jsxs(
|
|
69
|
+
DropdownMenuContent,
|
|
67
70
|
{
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
|
|
72
|
+
side: "bottom",
|
|
73
|
+
align: "end",
|
|
74
|
+
sideOffset: 4,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
|
|
77
|
+
/* @__PURE__ */ jsxs(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
78
|
+
admin.avatarImage?.key && /* @__PURE__ */ jsx(
|
|
79
|
+
AvatarImage,
|
|
80
|
+
{
|
|
81
|
+
src: joinUrl(storageUrl, admin.avatarImage?.key),
|
|
82
|
+
alt: name ?? ""
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ jsx(AvatarFallback, { className: "rounded-lg" })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ jsxs("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-medium", children: name }),
|
|
89
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs", children: admin.email })
|
|
90
|
+
] })
|
|
91
|
+
] }) }),
|
|
92
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
93
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(Link, { href: PATHS.auth.changePassword.path, children: /* @__PURE__ */ jsxs(DropdownMenuItem, { children: [
|
|
94
|
+
/* @__PURE__ */ jsx(PenLine, {}),
|
|
95
|
+
t("auth.change-password.text")
|
|
96
|
+
] }) }) }),
|
|
97
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
98
|
+
SignOutButton
|
|
99
|
+
]
|
|
70
100
|
}
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */ React.createElement(DropdownMenuGroup, null, /* @__PURE__ */ React.createElement(Link, { href: PATHS.auth.changePassword.path }, /* @__PURE__ */ React.createElement(DropdownMenuItem, null, /* @__PURE__ */ React.createElement(PenLine, null), t("auth.change-password.text")))),
|
|
74
|
-
/* @__PURE__ */ React.createElement(DropdownMenuSeparator, null),
|
|
75
|
-
SignOutButton
|
|
76
|
-
))));
|
|
101
|
+
)
|
|
102
|
+
] }) }) });
|
|
77
103
|
}
|
|
78
104
|
|
|
79
105
|
export { NavUser };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import { useTranslator } from 'intor/react';
|
|
3
4
|
import { SidebarIcon, House, SquareArrowOutUpRight } from 'lucide-react';
|
|
4
5
|
import { PATHS } from '../../../../../../constants/paths/index.js';
|
|
@@ -38,32 +39,44 @@ function createNavbar({
|
|
|
38
39
|
const { toggleSidebar } = useSidebar();
|
|
39
40
|
const { admin, isLoading } = useAdmin();
|
|
40
41
|
const { t } = useTranslator();
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
42
|
+
return /* @__PURE__ */ jsx("header", { className: "bg-background sticky top-0 z-50 flex w-full items-center border-b", children: /* @__PURE__ */ jsxs("div", { className: "flex h-(--header-height) w-full items-center gap-2 px-2", children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
Button,
|
|
45
|
+
{
|
|
46
|
+
className: "h-8 w-8",
|
|
47
|
+
variant: "ghost",
|
|
48
|
+
size: "icon",
|
|
49
|
+
onClick: toggleSidebar,
|
|
50
|
+
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mr-1 h-4" }),
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
55
|
+
Button,
|
|
56
|
+
{
|
|
57
|
+
variant: "outline",
|
|
58
|
+
size: "icon",
|
|
59
|
+
href: PATHS.main.dashboard.path,
|
|
60
|
+
children: /* @__PURE__ */ jsx(House, {})
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", href: webUrl, openNewTab: true, children: [
|
|
64
|
+
/* @__PURE__ */ jsx(SquareArrowOutUpRight, {}),
|
|
65
|
+
t("ui.layout.navbar.website-homepage.text")
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: "ml-auto" }),
|
|
68
|
+
/* @__PURE__ */ jsx(I18nSelector, {}),
|
|
69
|
+
/* @__PURE__ */ jsx(ThemeSelector, {}),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
NavUser,
|
|
72
|
+
{
|
|
73
|
+
storageUrl,
|
|
74
|
+
SignOutButton: /* @__PURE__ */ jsx(SignOutButton, {}),
|
|
75
|
+
admin,
|
|
76
|
+
isLoading
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] }) });
|
|
67
80
|
};
|
|
68
81
|
}
|
|
69
82
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { useTranslator } from 'intor/react';
|
|
2
3
|
import { LogOut } from 'lucide-react';
|
|
3
4
|
import { useRouter } from 'next/navigation';
|
|
@@ -44,8 +45,11 @@ function createSignOutButton({
|
|
|
44
45
|
if (!isConfirm(t)) return;
|
|
45
46
|
void execute();
|
|
46
47
|
};
|
|
47
|
-
const buttonText = isRedirecting ? /* @__PURE__ */
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
const buttonText = isRedirecting ? /* @__PURE__ */ jsx(Spinner, {}) : t("auth.sign-out.text");
|
|
49
|
+
return /* @__PURE__ */ jsx("button", { onClick: handleSignOut, className: "w-full", children: /* @__PURE__ */ jsxs(DropdownMenuItem, { variant: "destructive", children: [
|
|
50
|
+
/* @__PURE__ */ jsx(LogOut, {}),
|
|
51
|
+
buttonText
|
|
52
|
+
] }) });
|
|
49
53
|
};
|
|
50
54
|
}
|
|
51
55
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { useTranslator } from 'intor/react';
|
|
3
4
|
import { Sun, Moon, TvMinimal } from 'lucide-react';
|
|
4
5
|
import { useTheme } from 'next-themes';
|
|
@@ -23,7 +24,27 @@ import { Button } from '../../buttons/button.js';
|
|
|
23
24
|
function ThemeSelector() {
|
|
24
25
|
const { setTheme } = useTheme();
|
|
25
26
|
const { t } = useTranslator();
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "icon", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Sun, { className: "h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" }),
|
|
30
|
+
/* @__PURE__ */ jsx(Moon, { className: "absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" }),
|
|
31
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Select theme" })
|
|
32
|
+
] }) }),
|
|
33
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
|
|
34
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => setTheme("light"), children: [
|
|
35
|
+
/* @__PURE__ */ jsx(Sun, {}),
|
|
36
|
+
t("ui.layout.navbar.theme.light.text")
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => setTheme("dark"), children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Moon, {}),
|
|
40
|
+
t("ui.layout.navbar.theme.dark.text")
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => setTheme("system"), children: [
|
|
43
|
+
/* @__PURE__ */ jsx(TvMinimal, {}),
|
|
44
|
+
t("ui.layout.navbar.theme.system.text")
|
|
45
|
+
] })
|
|
46
|
+
] })
|
|
47
|
+
] });
|
|
27
48
|
}
|
|
28
49
|
|
|
29
50
|
export { ThemeSelector };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
3
|
import { ChevronRight } from 'lucide-react';
|
|
3
4
|
import Link from 'next/link';
|
|
4
5
|
import { usePathname } from 'next/navigation';
|
|
@@ -41,42 +42,57 @@ function NavMain({ items }) {
|
|
|
41
42
|
).map((item) => item.title || "");
|
|
42
43
|
queueMicrotask(() => setOpenItems(matched));
|
|
43
44
|
}, [parsedPathname, items]);
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ jsx(SidebarGroup, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: items.map((item, index) => {
|
|
45
46
|
const isOpen = openItems.includes(item.title || "");
|
|
46
47
|
const parsedUrl = getMainPath(item.url || "");
|
|
47
48
|
const isCurrentPath = item.url ? isSegmentMatch(parsedPathname, parsedUrl) : false;
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
49
50
|
Collapsible,
|
|
50
51
|
{
|
|
51
|
-
key: index,
|
|
52
52
|
asChild: true,
|
|
53
53
|
open: isOpen,
|
|
54
|
-
onOpenChange: (open) => toggleItem(item.title || "", open)
|
|
54
|
+
onOpenChange: (open) => toggleItem(item.title || "", open),
|
|
55
|
+
children: /* @__PURE__ */ jsxs(SidebarMenuItem, { className: "[&>button]:top-2 [&>button]:size-6", children: [
|
|
56
|
+
!item.isSeparator ? /* @__PURE__ */ jsx(
|
|
57
|
+
SidebarMenuButton,
|
|
58
|
+
{
|
|
59
|
+
asChild: true,
|
|
60
|
+
size: "md",
|
|
61
|
+
isActive: isCurrentPath,
|
|
62
|
+
children: /* @__PURE__ */ jsxs(Link, { href: item.url || "", children: [
|
|
63
|
+
item.icon && /* @__PURE__ */ jsx(item.icon, {}),
|
|
64
|
+
/* @__PURE__ */ jsx("span", { children: item.title })
|
|
65
|
+
] })
|
|
66
|
+
}
|
|
67
|
+
) : /* @__PURE__ */ jsx(Separator, {}),
|
|
68
|
+
item.items?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(SidebarMenuAction, { className: "data-[state=open]:rotate-90", children: [
|
|
70
|
+
/* @__PURE__ */ jsx(ChevronRight, {}),
|
|
71
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle" })
|
|
72
|
+
] }) }),
|
|
73
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.items?.map((subItem, index2) => {
|
|
74
|
+
const parsedPathname2 = getMainPath(pathname);
|
|
75
|
+
const parsedUrl2 = getMainPath(subItem.url || "");
|
|
76
|
+
const isCurrentPath2 = subItem.url ? isSegmentMatch(parsedPathname2, parsedUrl2) : false;
|
|
77
|
+
return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: !subItem.isSeparator ? /* @__PURE__ */ jsx(
|
|
78
|
+
SidebarMenuSubButton,
|
|
79
|
+
{
|
|
80
|
+
asChild: true,
|
|
81
|
+
size: "lg",
|
|
82
|
+
isActive: isCurrentPath2,
|
|
83
|
+
children: /* @__PURE__ */ jsxs(Link, { href: subItem.url || "", children: [
|
|
84
|
+
subItem.icon && /* @__PURE__ */ jsx(subItem.icon, {}),
|
|
85
|
+
/* @__PURE__ */ jsx("span", { children: subItem.title })
|
|
86
|
+
] })
|
|
87
|
+
}
|
|
88
|
+
) : /* @__PURE__ */ jsx(Separator, {}) }, index2);
|
|
89
|
+
}) }) })
|
|
90
|
+
] }) : null
|
|
91
|
+
] })
|
|
55
92
|
},
|
|
56
|
-
|
|
57
|
-
SidebarMenuButton,
|
|
58
|
-
{
|
|
59
|
-
asChild: true,
|
|
60
|
-
size: "md",
|
|
61
|
-
isActive: isCurrentPath
|
|
62
|
-
},
|
|
63
|
-
/* @__PURE__ */ React.createElement(Link, { href: item.url || "" }, item.icon && /* @__PURE__ */ React.createElement(item.icon, null), /* @__PURE__ */ React.createElement("span", null, item.title))
|
|
64
|
-
) : /* @__PURE__ */ React.createElement(Separator, null), item.items?.length ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CollapsibleTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(SidebarMenuAction, { className: "data-[state=open]:rotate-90" }, /* @__PURE__ */ React.createElement(ChevronRight, null), /* @__PURE__ */ React.createElement("span", { className: "sr-only" }, "Toggle"))), /* @__PURE__ */ React.createElement(CollapsibleContent, null, /* @__PURE__ */ React.createElement(SidebarMenuSub, null, item.items?.map((subItem, index2) => {
|
|
65
|
-
const parsedPathname2 = getMainPath(pathname);
|
|
66
|
-
const parsedUrl2 = getMainPath(subItem.url || "");
|
|
67
|
-
const isCurrentPath2 = subItem.url ? isSegmentMatch(parsedPathname2, parsedUrl2) : false;
|
|
68
|
-
return /* @__PURE__ */ React.createElement(SidebarMenuSubItem, { key: index2 }, !subItem.isSeparator ? /* @__PURE__ */ React.createElement(
|
|
69
|
-
SidebarMenuSubButton,
|
|
70
|
-
{
|
|
71
|
-
asChild: true,
|
|
72
|
-
size: "lg",
|
|
73
|
-
isActive: isCurrentPath2
|
|
74
|
-
},
|
|
75
|
-
/* @__PURE__ */ React.createElement(Link, { href: subItem.url || "" }, subItem.icon && /* @__PURE__ */ React.createElement(subItem.icon, null), /* @__PURE__ */ React.createElement("span", null, subItem.title))
|
|
76
|
-
) : /* @__PURE__ */ React.createElement(Separator, null));
|
|
77
|
-
})))) : null)
|
|
93
|
+
index
|
|
78
94
|
);
|
|
79
|
-
})));
|
|
95
|
+
}) }) });
|
|
80
96
|
}
|
|
81
97
|
|
|
82
98
|
export { NavMain };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { useTranslator } from 'intor/react';
|
|
2
3
|
import Link from 'next/link';
|
|
3
4
|
import { useRouter } from 'next/navigation';
|
|
@@ -53,83 +54,93 @@ function createChangePasswordPage({
|
|
|
53
54
|
}),
|
|
54
55
|
{ onSuccess: () => router.push(PATHS.main.dashboard.path) }
|
|
55
56
|
);
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ jsx(
|
|
57
58
|
Form,
|
|
58
59
|
{
|
|
59
60
|
className: "mx-auto w-96",
|
|
60
61
|
style: { marginTop: "56px" },
|
|
61
|
-
onSubmit: () => void execute()
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
onSubmit: () => void execute(),
|
|
63
|
+
children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
64
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "mx-auto", children: t("auth.change-password.text") }) }),
|
|
65
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "relative flex flex-col gap-6", children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
Field,
|
|
68
|
+
{
|
|
69
|
+
htmlFor: "password",
|
|
70
|
+
label: t("auth.change-password.password.text"),
|
|
71
|
+
children: /* @__PURE__ */ jsx(
|
|
72
|
+
PasswordInput,
|
|
73
|
+
{
|
|
74
|
+
id: "password",
|
|
75
|
+
placeholder: t(
|
|
76
|
+
"auth.change-password.password.placeholder.text"
|
|
77
|
+
),
|
|
78
|
+
fieldName: "password",
|
|
79
|
+
value: formData.password,
|
|
80
|
+
setFormData,
|
|
81
|
+
isDisabled: isRedirecting,
|
|
82
|
+
isError: errors.includes("password")
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
}
|
|
75
86
|
),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
Field,
|
|
89
|
+
{
|
|
90
|
+
htmlFor: "newPassword",
|
|
91
|
+
label: t("auth.change-password.new-password.text"),
|
|
92
|
+
children: /* @__PURE__ */ jsx(
|
|
93
|
+
PasswordInput,
|
|
94
|
+
{
|
|
95
|
+
id: "newPassword",
|
|
96
|
+
placeholder: t(
|
|
97
|
+
"auth.change-password.new-password.placeholder.text"
|
|
98
|
+
),
|
|
99
|
+
fieldName: "newPassword",
|
|
100
|
+
value: formData.newPassword,
|
|
101
|
+
setFormData,
|
|
102
|
+
isDisabled: isRedirecting,
|
|
103
|
+
isError: errors.includes("newPassword")
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
}
|
|
95
107
|
),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
/* @__PURE__ */ jsx(
|
|
109
|
+
Field,
|
|
110
|
+
{
|
|
111
|
+
htmlFor: "newPasswordConfirm",
|
|
112
|
+
label: t("auth.change-password.new-password-confirm.text"),
|
|
113
|
+
children: /* @__PURE__ */ jsx(
|
|
114
|
+
PasswordInput,
|
|
115
|
+
{
|
|
116
|
+
id: "newPasswordConfirm",
|
|
117
|
+
placeholder: t(
|
|
118
|
+
"auth.change-password.new-password-confirm.placeholder.text"
|
|
119
|
+
),
|
|
120
|
+
fieldName: "newPasswordConfirm",
|
|
121
|
+
value: formData.newPasswordConfirm,
|
|
122
|
+
setFormData,
|
|
123
|
+
isDisabled: isRedirecting,
|
|
124
|
+
isError: errors.includes("newPasswordConfirm")
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
115
128
|
),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
/* @__PURE__ */ React.createElement(Link, { href: PATHS.main.dashboard.path }, t("auth.change-password.anchor.text"))
|
|
132
|
-
), /* @__PURE__ */ React.createElement(Button, { type: "submit", isLoading: isRedirecting }, t("auth.change-password.button.text")), " "))
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
Button,
|
|
131
|
+
{
|
|
132
|
+
size: "xs",
|
|
133
|
+
variant: "link",
|
|
134
|
+
className: "w-fit",
|
|
135
|
+
isDisabled: isRedirecting,
|
|
136
|
+
children: /* @__PURE__ */ jsx(Link, { href: PATHS.main.dashboard.path, children: t("auth.change-password.anchor.text") })
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", isLoading: isRedirecting, children: t("auth.change-password.button.text") }),
|
|
140
|
+
" "
|
|
141
|
+
] })
|
|
142
|
+
] })
|
|
143
|
+
}
|
|
133
144
|
);
|
|
134
145
|
};
|
|
135
146
|
}
|