@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.
Files changed (71) hide show
  1. package/dist/export/client/index.js +2 -1
  2. package/dist/src/client/infrastructure/contexts/admin.js +5 -4
  3. package/dist/src/client/infrastructure/contexts/theme.js +5 -5
  4. package/dist/src/client/infrastructure/toast/error-display.js +15 -3
  5. package/dist/src/client/interfaces/components/shadcn/avatar.js +5 -4
  6. package/dist/src/client/interfaces/components/shadcn/button.js +3 -2
  7. package/dist/src/client/interfaces/components/shadcn/card.js +9 -8
  8. package/dist/src/client/interfaces/components/shadcn/collapsible.js +4 -3
  9. package/dist/src/client/interfaces/components/shadcn/dropdown-menu.js +36 -29
  10. package/dist/src/client/interfaces/components/shadcn/input-group.js +8 -7
  11. package/dist/src/client/interfaces/components/shadcn/input.js +3 -2
  12. package/dist/src/client/interfaces/components/shadcn/label.js +3 -2
  13. package/dist/src/client/interfaces/components/shadcn/pagination.js +21 -18
  14. package/dist/src/client/interfaces/components/shadcn/select.js +47 -40
  15. package/dist/src/client/interfaces/components/shadcn/separator.js +3 -2
  16. package/dist/src/client/interfaces/components/shadcn/sheet.js +36 -27
  17. package/dist/src/client/interfaces/components/shadcn/sidebar.js +120 -105
  18. package/dist/src/client/interfaces/components/shadcn/skeleton.js +2 -1
  19. package/dist/src/client/interfaces/components/shadcn/spinner.js +2 -1
  20. package/dist/src/client/interfaces/components/shadcn/textarea.js +3 -2
  21. package/dist/src/client/interfaces/components/shadcn/tooltip.js +13 -10
  22. package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +35 -23
  23. package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +20 -14
  24. package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +35 -26
  25. package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header-title.js +10 -1
  26. package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +21 -15
  27. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +2 -1
  28. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch.js +19 -14
  29. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +2 -1
  30. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +2 -1
  31. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/index.js +34 -29
  32. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/show.js +43 -37
  33. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/trash.js +24 -18
  34. package/dist/src/client/interfaces/components/ui/buttons/button.js +8 -4
  35. package/dist/src/client/interfaces/components/ui/buttons/return-button.js +5 -4
  36. package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +9 -6
  37. package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list-content.js +14 -8
  38. package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list.js +22 -17
  39. package/dist/src/client/interfaces/components/ui/form/containers/fields-container.js +5 -4
  40. package/dist/src/client/interfaces/components/ui/form/containers/main-fields.js +5 -4
  41. package/dist/src/client/interfaces/components/ui/form/containers/side-fields.js +5 -4
  42. package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-display.js +80 -57
  43. package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-input.js +114 -91
  44. package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +4 -3
  45. package/dist/src/client/interfaces/components/ui/form/field-body.js +31 -28
  46. package/dist/src/client/interfaces/components/ui/form/field.js +12 -1
  47. package/dist/src/client/interfaces/components/ui/form/form.js +2 -1
  48. package/dist/src/client/interfaces/components/ui/form/index-field.js +49 -42
  49. package/dist/src/client/interfaces/components/ui/form/slug-field.js +45 -38
  50. package/dist/src/client/interfaces/components/ui/inputs/array-input.js +63 -52
  51. package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +41 -38
  52. package/dist/src/client/interfaces/components/ui/inputs/input.js +20 -17
  53. package/dist/src/client/interfaces/components/ui/inputs/password-input.js +6 -5
  54. package/dist/src/client/interfaces/components/ui/inputs/search-input.js +6 -5
  55. package/dist/src/client/interfaces/components/ui/inputs/select.js +19 -13
  56. package/dist/src/client/interfaces/components/ui/inputs/textarea.js +3 -2
  57. package/dist/src/client/interfaces/components/ui/layouts/content-container.js +5 -4
  58. package/dist/src/client/interfaces/components/ui/layouts/layout-skeleton.js +20 -7
  59. package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +8 -1
  60. package/dist/src/client/interfaces/components/ui/layouts/navbar/nav-user.js +60 -34
  61. package/dist/src/client/interfaces/components/ui/layouts/navbar/navbar.js +39 -26
  62. package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +6 -2
  63. package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +22 -1
  64. package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +43 -27
  65. package/dist/src/client/interfaces/pages/auth/change-password.js +81 -70
  66. package/dist/src/client/interfaces/pages/auth/email-unverified.js +39 -21
  67. package/dist/src/client/interfaces/pages/auth/forgot-password.js +41 -26
  68. package/dist/src/client/interfaces/pages/auth/reset-password.js +60 -51
  69. package/dist/src/client/interfaces/pages/auth/sign-in.js +46 -37
  70. package/dist/src/client/interfaces/pages/auth/verify-email.js +2 -1
  71. 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__ */ React.createElement("div", { className: "flex flex-1" }, /* @__PURE__ */ React.createElement(Sidebar, { className: "top-(--header-height) h-[calc(100svh-var(--header-height))]!" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-2 p-3" }, /* @__PURE__ */ React.createElement(Skeleton, { className: "h-10 w-full" }), /* @__PURE__ */ React.createElement(Skeleton, { className: "h-10 w-full" }), /* @__PURE__ */ React.createElement(Skeleton, { className: "h-10 w-full" }), /* @__PURE__ */ React.createElement(Skeleton, { className: "h-10 w-full" }))), /* @__PURE__ */ React.createElement(
24
- SidebarInset,
25
- {
26
- style: { width: open ? `calc(100% - ${SIDEBAR_WIDTH})` : "100%" }
27
- },
28
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4 p-6" }, /* @__PURE__ */ React.createElement(Skeleton, { className: "h-6 w-96" }), /* @__PURE__ */ React.createElement(Skeleton, { className: "h-6 w-72" }), /* @__PURE__ */ React.createElement(Skeleton, { className: "h-6 w-64" }))
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__ */ React.createElement(DropdownMenu, null, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(Button, { variant: "outline", size: "icon" }, /* @__PURE__ */ React.createElement(Languages, null), /* @__PURE__ */ React.createElement("span", { className: "sr-only" }, "Switch Languages"))), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end" }, locales.map((locale) => /* @__PURE__ */ React.createElement(Link, { key: locale, locale }, /* @__PURE__ */ React.createElement(DropdownMenuItem, null, localeDisplay[locale])))));
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__ */ React.createElement(Button, { variant: "outline", size: "icon", disabled: true, className: "w-64" }, /* @__PURE__ */ React.createElement(Spinner, null));
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__ */ React.createElement(Button, { variant: "outline", size: "icon", disabled: true, className: "w-64" }, /* @__PURE__ */ React.createElement(UserCircle, { className: "size-4" }));
41
- return /* @__PURE__ */ React.createElement(SidebarMenu, { className: "w-64" }, /* @__PURE__ */ React.createElement(SidebarMenuItem, null, /* @__PURE__ */ React.createElement(DropdownMenu, null, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
42
- SidebarMenuButton,
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
- src: joinUrl(storageUrl, admin.avatarImage?.key),
52
- alt: name ?? ""
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
- ), /* @__PURE__ */ React.createElement(AvatarFallback, { className: "rounded-lg" })),
55
- /* @__PURE__ */ React.createElement("div", { className: "grid flex-1 text-left text-sm leading-tight" }, /* @__PURE__ */ React.createElement("span", { className: "truncate font-medium" }, name), /* @__PURE__ */ React.createElement("span", { className: "truncate text-xs" }, admin.email)),
56
- /* @__PURE__ */ React.createElement(ChevronsUpDown, { className: "ml-auto size-4" })
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
- src: joinUrl(storageUrl, admin.avatarImage?.key),
69
- alt: name ?? ""
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
- ), /* @__PURE__ */ React.createElement(AvatarFallback, { className: "rounded-lg" })), /* @__PURE__ */ React.createElement("div", { className: "grid flex-1 text-left text-sm leading-tight" }, /* @__PURE__ */ React.createElement("span", { className: "truncate font-medium" }, name), /* @__PURE__ */ React.createElement("span", { className: "truncate text-xs" }, admin.email)))),
72
- /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null),
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__ */ React.createElement("header", { className: "bg-background sticky top-0 z-50 flex w-full items-center border-b" }, /* @__PURE__ */ React.createElement("div", { className: "flex h-(--header-height) w-full items-center gap-2 px-2" }, /* @__PURE__ */ React.createElement(
42
- Button,
43
- {
44
- className: "h-8 w-8",
45
- variant: "ghost",
46
- size: "icon",
47
- onClick: toggleSidebar
48
- },
49
- /* @__PURE__ */ React.createElement(SidebarIcon, null)
50
- ), /* @__PURE__ */ React.createElement(Separator, { orientation: "vertical", className: "mr-1 h-4" }), /* @__PURE__ */ React.createElement(
51
- Button,
52
- {
53
- variant: "outline",
54
- size: "icon",
55
- href: PATHS.main.dashboard.path
56
- },
57
- /* @__PURE__ */ React.createElement(House, null)
58
- ), /* @__PURE__ */ React.createElement(Button, { variant: "outline", href: webUrl, openNewTab: true }, /* @__PURE__ */ React.createElement(SquareArrowOutUpRight, null), t("ui.layout.navbar.website-homepage.text")), /* @__PURE__ */ React.createElement("div", { className: "ml-auto" }), /* @__PURE__ */ React.createElement(I18nSelector, null), /* @__PURE__ */ React.createElement(ThemeSelector, null), /* @__PURE__ */ React.createElement(
59
- NavUser,
60
- {
61
- storageUrl,
62
- SignOutButton: /* @__PURE__ */ React.createElement(SignOutButton, null),
63
- admin,
64
- isLoading
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__ */ React.createElement(Spinner, null) : t("auth.sign-out.text");
48
- return /* @__PURE__ */ React.createElement("button", { onClick: handleSignOut, className: "w-full" }, /* @__PURE__ */ React.createElement(DropdownMenuItem, { variant: "destructive" }, /* @__PURE__ */ React.createElement(LogOut, null), buttonText));
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__ */ React.createElement(DropdownMenu, null, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(Button, { variant: "outline", size: "icon" }, /* @__PURE__ */ React.createElement(Sun, { className: "h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" }), /* @__PURE__ */ React.createElement(Moon, { className: "absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" }), /* @__PURE__ */ React.createElement("span", { className: "sr-only" }, "Select theme"))), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end" }, /* @__PURE__ */ React.createElement(DropdownMenuItem, { onClick: () => setTheme("light") }, /* @__PURE__ */ React.createElement(Sun, null), t("ui.layout.navbar.theme.light.text")), /* @__PURE__ */ React.createElement(DropdownMenuItem, { onClick: () => setTheme("dark") }, /* @__PURE__ */ React.createElement(Moon, null), t("ui.layout.navbar.theme.dark.text")), /* @__PURE__ */ React.createElement(DropdownMenuItem, { onClick: () => setTheme("system") }, /* @__PURE__ */ React.createElement(TvMinimal, null), t("ui.layout.navbar.theme.system.text"))));
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__ */ React.createElement(SidebarGroup, null, /* @__PURE__ */ React.createElement(SidebarMenu, null, items.map((item, index) => {
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__ */ React.createElement(
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
- /* @__PURE__ */ React.createElement(SidebarMenuItem, { className: "[&>button]:top-2 [&>button]:size-6" }, !item.isSeparator ? /* @__PURE__ */ React.createElement(
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__ */ React.createElement(
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
- /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, null, /* @__PURE__ */ React.createElement(CardTitle, { className: "mx-auto" }, t("auth.change-password.text"))), /* @__PURE__ */ React.createElement(CardContent, { className: "relative flex flex-col gap-6" }, /* @__PURE__ */ React.createElement(
64
- Field,
65
- {
66
- htmlFor: "password",
67
- label: t("auth.change-password.password.text")
68
- },
69
- /* @__PURE__ */ React.createElement(
70
- PasswordInput,
71
- {
72
- id: "password",
73
- placeholder: t(
74
- "auth.change-password.password.placeholder.text"
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
- fieldName: "password",
77
- value: formData.password,
78
- setFormData,
79
- isDisabled: isRedirecting,
80
- isError: errors.includes("password")
81
- }
82
- )
83
- ), /* @__PURE__ */ React.createElement(
84
- Field,
85
- {
86
- htmlFor: "newPassword",
87
- label: t("auth.change-password.new-password.text")
88
- },
89
- /* @__PURE__ */ React.createElement(
90
- PasswordInput,
91
- {
92
- id: "newPassword",
93
- placeholder: t(
94
- "auth.change-password.new-password.placeholder.text"
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
- fieldName: "newPassword",
97
- value: formData.newPassword,
98
- setFormData,
99
- isDisabled: isRedirecting,
100
- isError: errors.includes("newPassword")
101
- }
102
- )
103
- ), /* @__PURE__ */ React.createElement(
104
- Field,
105
- {
106
- htmlFor: "newPasswordConfirm",
107
- label: t("auth.change-password.new-password-confirm.text")
108
- },
109
- /* @__PURE__ */ React.createElement(
110
- PasswordInput,
111
- {
112
- id: "newPasswordConfirm",
113
- placeholder: t(
114
- "auth.change-password.new-password-confirm.placeholder.text"
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
- fieldName: "newPasswordConfirm",
117
- value: formData.newPasswordConfirm,
118
- setFormData,
119
- isDisabled: isRedirecting,
120
- isError: errors.includes("newPasswordConfirm")
121
- }
122
- )
123
- ), /* @__PURE__ */ React.createElement(
124
- Button,
125
- {
126
- size: "xs",
127
- variant: "link",
128
- className: "w-fit",
129
- isDisabled: isRedirecting
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
  }