@yimingliao/cms 0.0.130 → 0.0.132

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 (119) hide show
  1. package/dist/export/client/index.js +8 -7
  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/admin-initializer.js +1 -0
  6. package/dist/src/client/interfaces/components/shadcn/avatar.js +5 -4
  7. package/dist/src/client/interfaces/components/shadcn/button.js +3 -2
  8. package/dist/src/client/interfaces/components/shadcn/card.js +9 -8
  9. package/dist/src/client/interfaces/components/shadcn/collapsible.js +4 -3
  10. package/dist/src/client/interfaces/components/shadcn/dropdown-menu.js +36 -29
  11. package/dist/src/client/interfaces/components/shadcn/input-group.js +8 -7
  12. package/dist/src/client/interfaces/components/shadcn/input.js +3 -2
  13. package/dist/src/client/interfaces/components/shadcn/label.js +3 -2
  14. package/dist/src/client/interfaces/components/shadcn/pagination.js +21 -18
  15. package/dist/src/client/interfaces/components/shadcn/select.js +47 -40
  16. package/dist/src/client/interfaces/components/shadcn/separator.js +3 -2
  17. package/dist/src/client/interfaces/components/shadcn/sheet.js +36 -27
  18. package/dist/src/client/interfaces/components/shadcn/sidebar.js +120 -105
  19. package/dist/src/client/interfaces/components/shadcn/skeleton.js +2 -1
  20. package/dist/src/client/interfaces/components/shadcn/spinner.js +2 -1
  21. package/dist/src/client/interfaces/components/shadcn/textarea.js +3 -2
  22. package/dist/src/client/interfaces/components/shadcn/tooltip.js +13 -10
  23. package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +35 -23
  24. package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +21 -14
  25. package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +35 -26
  26. package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header-title.js +10 -1
  27. package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +22 -15
  28. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +2 -1
  29. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch.js +19 -14
  30. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +2 -1
  31. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +2 -1
  32. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/index.js +34 -29
  33. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/show.js +43 -37
  34. package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/trash.js +24 -18
  35. package/dist/src/client/interfaces/components/ui/buttons/button.js +9 -4
  36. package/dist/src/client/interfaces/components/ui/buttons/return-button.js +6 -4
  37. package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +9 -6
  38. package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list-content.js +15 -8
  39. package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list.js +22 -17
  40. package/dist/src/client/interfaces/components/ui/form/containers/fields-container.js +5 -4
  41. package/dist/src/client/interfaces/components/ui/form/containers/main-fields.js +5 -4
  42. package/dist/src/client/interfaces/components/ui/form/containers/side-fields.js +5 -4
  43. package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-display.js +81 -57
  44. package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-input.js +115 -91
  45. package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +4 -3
  46. package/dist/src/client/interfaces/components/ui/form/field-body.js +32 -28
  47. package/dist/src/client/interfaces/components/ui/form/field.js +12 -1
  48. package/dist/src/client/interfaces/components/ui/form/form.js +3 -1
  49. package/dist/src/client/interfaces/components/ui/form/index-field.js +50 -42
  50. package/dist/src/client/interfaces/components/ui/form/slug-field.js +46 -38
  51. package/dist/src/client/interfaces/components/ui/inputs/array-input.js +64 -52
  52. package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +42 -38
  53. package/dist/src/client/interfaces/components/ui/inputs/input.js +21 -17
  54. package/dist/src/client/interfaces/components/ui/inputs/password-input.js +7 -5
  55. package/dist/src/client/interfaces/components/ui/inputs/search-input.js +7 -5
  56. package/dist/src/client/interfaces/components/ui/inputs/select.js +20 -13
  57. package/dist/src/client/interfaces/components/ui/inputs/textarea.js +4 -2
  58. package/dist/src/client/interfaces/components/ui/layouts/content-container.js +6 -4
  59. package/dist/src/client/interfaces/components/ui/layouts/layout-skeleton.js +21 -7
  60. package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +8 -1
  61. package/dist/src/client/interfaces/components/ui/layouts/navbar/nav-user.js +60 -34
  62. package/dist/src/client/interfaces/components/ui/layouts/navbar/navbar.js +39 -26
  63. package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +7 -2
  64. package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +22 -1
  65. package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +43 -27
  66. package/dist/src/client/interfaces/pages/auth/change-password/page.js +148 -0
  67. package/dist/src/client/interfaces/pages/auth/email-unverified/page.js +102 -0
  68. package/dist/src/client/interfaces/pages/auth/forgot-password/page.js +98 -0
  69. package/dist/src/client/interfaces/pages/auth/reset-password/page.js +120 -0
  70. package/dist/src/client/interfaces/pages/auth/sign-in/page.js +108 -0
  71. package/dist/src/client/interfaces/pages/auth/{verify-email.js → verify-email/page.js} +8 -7
  72. package/dist/types/src/client/interfaces/components/admin-initializer.d.ts.map +1 -1
  73. package/dist/types/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.d.ts.map +1 -1
  74. package/dist/types/src/client/interfaces/components/ui/blocks/page-header/page-header.d.ts.map +1 -1
  75. package/dist/types/src/client/interfaces/components/ui/buttons/button.d.ts.map +1 -1
  76. package/dist/types/src/client/interfaces/components/ui/buttons/return-button.d.ts.map +1 -1
  77. package/dist/types/src/client/interfaces/components/ui/features/expandable-list/expandable-list-content.d.ts.map +1 -1
  78. package/dist/types/src/client/interfaces/components/ui/form/control-fields/control-fields-display.d.ts.map +1 -1
  79. package/dist/types/src/client/interfaces/components/ui/form/control-fields/control-fields-input.d.ts.map +1 -1
  80. package/dist/types/src/client/interfaces/components/ui/form/field-body.d.ts.map +1 -1
  81. package/dist/types/src/client/interfaces/components/ui/form/form.d.ts.map +1 -1
  82. package/dist/types/src/client/interfaces/components/ui/form/index-field.d.ts.map +1 -1
  83. package/dist/types/src/client/interfaces/components/ui/form/slug-field.d.ts.map +1 -1
  84. package/dist/types/src/client/interfaces/components/ui/inputs/array-input.d.ts.map +1 -1
  85. package/dist/types/src/client/interfaces/components/ui/inputs/checkbox.d.ts.map +1 -1
  86. package/dist/types/src/client/interfaces/components/ui/inputs/input.d.ts.map +1 -1
  87. package/dist/types/src/client/interfaces/components/ui/inputs/password-input.d.ts.map +1 -1
  88. package/dist/types/src/client/interfaces/components/ui/inputs/search-input.d.ts.map +1 -1
  89. package/dist/types/src/client/interfaces/components/ui/inputs/select.d.ts.map +1 -1
  90. package/dist/types/src/client/interfaces/components/ui/inputs/textarea.d.ts.map +1 -1
  91. package/dist/types/src/client/interfaces/components/ui/layouts/content-container.d.ts.map +1 -1
  92. package/dist/types/src/client/interfaces/components/ui/layouts/layout-skeleton.d.ts.map +1 -1
  93. package/dist/types/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.d.ts.map +1 -1
  94. package/dist/types/src/client/interfaces/pages/auth/{change-password.d.ts → change-password/page.d.ts} +3 -3
  95. package/dist/types/src/client/interfaces/pages/auth/change-password/page.d.ts.map +1 -0
  96. package/dist/types/src/client/interfaces/pages/auth/{email-unverified.d.ts → email-unverified/page.d.ts} +3 -3
  97. package/dist/types/src/client/interfaces/pages/auth/email-unverified/page.d.ts.map +1 -0
  98. package/dist/types/src/client/interfaces/pages/auth/{forgot-password.d.ts → forgot-password/page.d.ts} +3 -3
  99. package/dist/types/src/client/interfaces/pages/auth/forgot-password/page.d.ts.map +1 -0
  100. package/dist/types/src/client/interfaces/pages/auth/index.d.ts +6 -6
  101. package/dist/types/src/client/interfaces/pages/auth/index.d.ts.map +1 -1
  102. package/dist/types/src/client/interfaces/pages/auth/{reset-password.d.ts → reset-password/page.d.ts} +3 -3
  103. package/dist/types/src/client/interfaces/pages/auth/reset-password/page.d.ts.map +1 -0
  104. package/dist/types/src/client/interfaces/pages/auth/{sign-in.d.ts → sign-in/page.d.ts} +3 -3
  105. package/dist/types/src/client/interfaces/pages/auth/sign-in/page.d.ts.map +1 -0
  106. package/dist/types/src/client/interfaces/pages/auth/{verify-email.d.ts → verify-email/page.d.ts} +3 -3
  107. package/dist/types/src/client/interfaces/pages/auth/verify-email/page.d.ts.map +1 -0
  108. package/package.json +1 -1
  109. package/dist/src/client/interfaces/pages/auth/change-password.js +0 -137
  110. package/dist/src/client/interfaces/pages/auth/email-unverified.js +0 -84
  111. package/dist/src/client/interfaces/pages/auth/forgot-password.js +0 -83
  112. package/dist/src/client/interfaces/pages/auth/reset-password.js +0 -111
  113. package/dist/src/client/interfaces/pages/auth/sign-in.js +0 -99
  114. package/dist/types/src/client/interfaces/pages/auth/change-password.d.ts.map +0 -1
  115. package/dist/types/src/client/interfaces/pages/auth/email-unverified.d.ts.map +0 -1
  116. package/dist/types/src/client/interfaces/pages/auth/forgot-password.d.ts.map +0 -1
  117. package/dist/types/src/client/interfaces/pages/auth/reset-password.d.ts.map +0 -1
  118. package/dist/types/src/client/interfaces/pages/auth/sign-in.d.ts.map +0 -1
  119. package/dist/types/src/client/interfaces/pages/auth/verify-email.d.ts.map +0 -1
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import '@radix-ui/react-avatar';
3
4
  import 'react';
4
5
  import 'ua-parser-js';
@@ -53,32 +54,40 @@ function Pagination({
53
54
  }
54
55
  const isAtFirstPage = page === 1;
55
56
  const isAtLastPage = page === totalPages;
56
- return /* @__PURE__ */ React.createElement(Pagination$1, { className: "flex-1" }, /* @__PURE__ */ React.createElement(PaginationContent, null, /* @__PURE__ */ React.createElement(PaginationItem, null, /* @__PURE__ */ React.createElement(PaginationPrevious, { disabled: isAtFirstPage, onClick: handlePrev })), /* @__PURE__ */ React.createElement(PaginationItem, null, /* @__PURE__ */ React.createElement(
57
- PaginationLink,
58
- {
59
- isActive: page === 1,
60
- disabled: isAtFirstPage,
61
- onClick: () => setPage(1)
62
- },
63
- "1"
64
- )), startPage > 2 && /* @__PURE__ */ React.createElement(PaginationItem, null, /* @__PURE__ */ React.createElement(PaginationEllipsis, null)), pages.map((p) => {
65
- const isThisPage = page === p;
66
- return /* @__PURE__ */ React.createElement(PaginationItem, { key: p }, /* @__PURE__ */ React.createElement(PaginationLink, { isActive: isThisPage, onClick: () => setPage(p) }, p));
67
- }), endPage < totalPages - 1 && /* @__PURE__ */ React.createElement(PaginationItem, null, /* @__PURE__ */ React.createElement(PaginationEllipsis, null)), totalPages > 1 && /* @__PURE__ */ React.createElement(PaginationItem, null, /* @__PURE__ */ React.createElement(
68
- PaginationLink,
69
- {
70
- isActive: page === totalPages,
71
- disabled: isAtLastPage,
72
- onClick: () => setPage(totalPages)
73
- },
74
- totalPages
75
- )), /* @__PURE__ */ React.createElement(PaginationItem, null, /* @__PURE__ */ React.createElement(
76
- PaginationNext,
77
- {
78
- disabled: isAtLastPage || totalPages <= 1,
79
- onClick: handleNext
80
- }
81
- ))));
57
+ return /* @__PURE__ */ jsx(Pagination$1, { className: "flex-1", children: /* @__PURE__ */ jsxs(PaginationContent, { children: [
58
+ /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationPrevious, { disabled: isAtFirstPage, onClick: handlePrev }) }),
59
+ /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
60
+ PaginationLink,
61
+ {
62
+ isActive: page === 1,
63
+ disabled: isAtFirstPage,
64
+ onClick: () => setPage(1),
65
+ children: "1"
66
+ }
67
+ ) }),
68
+ startPage > 2 && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }),
69
+ pages.map((p) => {
70
+ const isThisPage = page === p;
71
+ return /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationLink, { isActive: isThisPage, onClick: () => setPage(p), children: p }) }, p);
72
+ }),
73
+ endPage < totalPages - 1 && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }),
74
+ totalPages > 1 && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
75
+ PaginationLink,
76
+ {
77
+ isActive: page === totalPages,
78
+ disabled: isAtLastPage,
79
+ onClick: () => setPage(totalPages),
80
+ children: totalPages
81
+ }
82
+ ) }),
83
+ /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
84
+ PaginationNext,
85
+ {
86
+ disabled: isAtLastPage || totalPages <= 1,
87
+ onClick: handleNext
88
+ }
89
+ ) })
90
+ ] }) });
82
91
  }
83
92
 
84
93
  export { Pagination };
@@ -1,3 +1,4 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { createElement } from 'react';
2
3
  import 'ua-parser-js';
3
4
  import { cn } from '../../../../../applications/shadcn/utils.js';
@@ -11,7 +12,15 @@ function PageHeaderTitle({
11
12
  leftChildren,
12
13
  className
13
14
  }) {
14
- return /* @__PURE__ */ React.createElement("div", { className: cn("flex items-center gap-3", className) }, leftChildren, icon && createElement(icon), /* @__PURE__ */ React.createElement("div", { className: "flex-center w-fit gap-3 whitespace-nowrap" }, subtitle && /* @__PURE__ */ React.createElement("p", { className: "text-muted-foreground" }, subtitle), /* @__PURE__ */ React.createElement("p", { className: "scroll-m-20 text-xl font-semibold tracking-tight" }, title)), children);
15
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-3", className), children: [
16
+ leftChildren,
17
+ icon && createElement(icon),
18
+ /* @__PURE__ */ jsxs("div", { className: "flex-center w-fit gap-3 whitespace-nowrap", children: [
19
+ subtitle && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: subtitle }),
20
+ /* @__PURE__ */ jsx("p", { className: "scroll-m-20 text-xl font-semibold tracking-tight", children: title })
21
+ ] }),
22
+ children
23
+ ] });
15
24
  }
16
25
 
17
26
  export { PageHeaderTitle };
@@ -1,3 +1,5 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
3
  import { useTranslator } from 'intor/react';
2
4
  import { Files } from 'lucide-react';
3
5
  import 'react';
@@ -43,24 +45,29 @@ function PageHeader(props) {
43
45
  const left = props.leftChildren ?? preset.left;
44
46
  const resolvedTitleProps = { ...preset.titleProps, ...props.titleProps };
45
47
  const right = props.rightChildren ?? preset.right;
46
- return /* @__PURE__ */ React.createElement("div", { style: { height: PAGE_HEADER_HEIGHT } }, /* @__PURE__ */ React.createElement(
47
- "div",
48
- {
49
- className: cn(
50
- "relative h-full px-6",
51
- "flex items-center justify-between gap-3"
52
- )
53
- },
54
- !isDefault && left && /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-3" }, left),
55
- /* @__PURE__ */ React.createElement(
56
- PageHeaderTitle,
48
+ return /* @__PURE__ */ jsxs("div", { style: { height: PAGE_HEADER_HEIGHT }, children: [
49
+ /* @__PURE__ */ jsxs(
50
+ "div",
57
51
  {
58
- className: cn(!isDefault && "absolute left-1/2 -translate-x-1/2"),
59
- ...resolvedTitleProps
52
+ className: cn(
53
+ "relative h-full px-6",
54
+ "flex items-center justify-between gap-3"
55
+ ),
56
+ children: [
57
+ !isDefault && left && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: left }),
58
+ /* @__PURE__ */ jsx(
59
+ PageHeaderTitle,
60
+ {
61
+ className: cn(!isDefault && "absolute left-1/2 -translate-x-1/2"),
62
+ ...resolvedTitleProps
63
+ }
64
+ ),
65
+ right && /* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center gap-3", children: right })
66
+ ]
60
67
  }
61
68
  ),
62
- right && /* @__PURE__ */ React.createElement("div", { className: "ml-auto flex items-center gap-3" }, right)
63
- ), /* @__PURE__ */ React.createElement(Separator, null));
69
+ /* @__PURE__ */ jsx(Separator, {})
70
+ ] });
64
71
  }
65
72
 
66
73
  export { PageHeader };
@@ -1,3 +1,4 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
1
2
  import { FilePlus } from 'lucide-react';
2
3
  import 'next/navigation';
3
4
  import 'react';
@@ -20,7 +21,7 @@ import { ReturnButton } from '../../../buttons/return-button.js';
20
21
  function createBatchCreatePreset(ctx) {
21
22
  const { props, t } = ctx;
22
23
  return {
23
- left: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReturnButton, { useConfirm: true, replaceParent: true, ...props.returnButtonProps })),
24
+ left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, replaceParent: true, ...props.returnButtonProps }) }),
24
25
  titleProps: {
25
26
  icon: FilePlus,
26
27
  subtitle: t("ui.page-header.batch-create.subtitle.text")
@@ -1,3 +1,4 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
2
  import { FilePen, CopyCheck, CopyX, FileX, FilePlus } from 'lucide-react';
2
3
  import { Button } from '../../../buttons/button.js';
3
4
  import { ReturnButton } from '../../../buttons/return-button.js';
@@ -5,29 +6,33 @@ import { ReturnButton } from '../../../buttons/return-button.js';
5
6
  function createBatchPreset(ctx) {
6
7
  const { props, t } = ctx;
7
8
  return {
8
- left: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReturnButton, { pushToParent: true, ...props.returnButtonProps }, t("ui.button.exit-batch-mode.text"))),
9
+ left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true, ...props.returnButtonProps, children: t("ui.button.exit-batch-mode.text") }) }),
9
10
  titleProps: {
10
11
  icon: FilePen,
11
12
  subtitle: t("ui.page-header.batch.subtitle.text"),
12
- children: /* @__PURE__ */ React.createElement(
13
+ children: /* @__PURE__ */ jsx(
13
14
  Button,
14
15
  {
15
16
  variant: "success",
16
17
  href: props.batchCreateButtonHref,
17
- icon: FilePlus
18
- },
19
- t("ui.button.batch-create.text")
18
+ icon: FilePlus,
19
+ children: t("ui.button.batch-create.text")
20
+ }
20
21
  )
21
22
  },
22
- right: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button, { size: "icon", variant: "outline", onClick: props.selectAllFn }, /* @__PURE__ */ React.createElement(CopyCheck, null)), /* @__PURE__ */ React.createElement(Button, { size: "icon", variant: "outline", onClick: props.cancelAllFn }, /* @__PURE__ */ React.createElement(CopyX, null)), /* @__PURE__ */ React.createElement(
23
- Button,
24
- {
25
- ...props.destroyButtonProps,
26
- variant: "destructive",
27
- icon: FileX
28
- },
29
- t("ui.button.destroy.text")
30
- ))
23
+ right: /* @__PURE__ */ jsxs(Fragment, { children: [
24
+ /* @__PURE__ */ jsx(Button, { size: "icon", variant: "outline", onClick: props.selectAllFn, children: /* @__PURE__ */ jsx(CopyCheck, {}) }),
25
+ /* @__PURE__ */ jsx(Button, { size: "icon", variant: "outline", onClick: props.cancelAllFn, children: /* @__PURE__ */ jsx(CopyX, {}) }),
26
+ /* @__PURE__ */ jsx(
27
+ Button,
28
+ {
29
+ ...props.destroyButtonProps,
30
+ variant: "destructive",
31
+ icon: FileX,
32
+ children: t("ui.button.destroy.text")
33
+ }
34
+ )
35
+ ] })
31
36
  };
32
37
  }
33
38
 
@@ -1,3 +1,4 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
1
2
  import { FilePlus } from 'lucide-react';
2
3
  import 'next/navigation';
3
4
  import 'react';
@@ -20,7 +21,7 @@ import { ReturnButton } from '../../../buttons/return-button.js';
20
21
  function createCreatePreset(ctx) {
21
22
  const { props, t } = ctx;
22
23
  return {
23
- left: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReturnButton, { useConfirm: true, replaceParent: true, ...props.returnButtonProps })),
24
+ left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, replaceParent: true, ...props.returnButtonProps }) }),
24
25
  titleProps: {
25
26
  icon: FilePlus,
26
27
  subtitle: t("ui.page-header.create.subtitle.text")
@@ -1,3 +1,4 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
1
2
  import { FilePen } from 'lucide-react';
2
3
  import 'next/navigation';
3
4
  import 'react';
@@ -20,7 +21,7 @@ import { ReturnButton } from '../../../buttons/return-button.js';
20
21
  function createEditPreset(ctx) {
21
22
  const { props, t } = ctx;
22
23
  return {
23
- left: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReturnButton, { useConfirm: true, replaceParent: true, ...props.returnButtonProps })),
24
+ left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, replaceParent: true, ...props.returnButtonProps }) }),
24
25
  titleProps: {
25
26
  icon: FilePen,
26
27
  subtitle: t("ui.page-header.edit.subtitle.text")
@@ -1,3 +1,4 @@
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
1
2
  import { Files, FileStack, FolderCog, FileSpreadsheet, FilePlus } from 'lucide-react';
2
3
  import { Button } from '../../../buttons/button.js';
3
4
  import { ReturnButton } from '../../../buttons/return-button.js';
@@ -5,38 +6,42 @@ import { ReturnButton } from '../../../buttons/return-button.js';
5
6
  function createIndexPreset(ctx) {
6
7
  const { props, t } = ctx;
7
8
  return {
8
- left: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReturnButton, { pushToParent: true, ...props.returnButtonProps })),
9
+ left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true, ...props.returnButtonProps }) }),
9
10
  titleProps: {
10
11
  icon: Files,
11
- children: /* @__PURE__ */ React.createElement(React.Fragment, null, props.settingButtonProps && props.showTopicSettingButton && /* @__PURE__ */ React.createElement(
12
- Button,
13
- {
14
- ...props.settingButtonProps,
15
- variant: "outline",
16
- icon: FolderCog,
17
- isDisabled: props.settingButtonProps.isDisabled ?? props.isDisabled
18
- },
19
- `${t("ui.button.setting.text")} ${t("resources.topic.text")}`
20
- ), props.createCategoryButtonProps && /* @__PURE__ */ React.createElement(
21
- Button,
22
- {
23
- ...props.createCategoryButtonProps,
24
- variant: "success",
25
- icon: FileSpreadsheet,
26
- isDisabled: props.createCategoryButtonProps.isDisabled ?? props.isDisabled
27
- },
28
- t("ui.button.create.text")
29
- ), props.createButtonProps && /* @__PURE__ */ React.createElement(
30
- Button,
31
- {
32
- variant: "success",
33
- icon: FilePlus,
34
- ...props.createButtonProps
35
- },
36
- t("ui.button.create.text")
37
- ))
12
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
13
+ props.settingButtonProps && props.showTopicSettingButton && /* @__PURE__ */ jsx(
14
+ Button,
15
+ {
16
+ ...props.settingButtonProps,
17
+ variant: "outline",
18
+ icon: FolderCog,
19
+ isDisabled: props.settingButtonProps.isDisabled ?? props.isDisabled,
20
+ children: `${t("ui.button.setting.text")} ${t("resources.topic.text")}`
21
+ }
22
+ ),
23
+ props.createCategoryButtonProps && /* @__PURE__ */ jsx(
24
+ Button,
25
+ {
26
+ ...props.createCategoryButtonProps,
27
+ variant: "success",
28
+ icon: FileSpreadsheet,
29
+ isDisabled: props.createCategoryButtonProps.isDisabled ?? props.isDisabled,
30
+ children: t("ui.button.create.text")
31
+ }
32
+ ),
33
+ props.createButtonProps && /* @__PURE__ */ jsx(
34
+ Button,
35
+ {
36
+ variant: "success",
37
+ icon: FilePlus,
38
+ ...props.createButtonProps,
39
+ children: t("ui.button.create.text")
40
+ }
41
+ )
42
+ ] })
38
43
  },
39
- right: props.batchButtonProps && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button, { variant: "outline", icon: FileStack, ...props.batchButtonProps }, /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, t("ui.button.batch.text"))))
44
+ right: props.batchButtonProps && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Button, { variant: "outline", icon: FileStack, ...props.batchButtonProps, children: /* @__PURE__ */ jsx("span", { className: "text-sm", children: t("ui.button.batch.text") }) }) })
40
45
  };
41
46
  }
42
47
 
@@ -1,3 +1,4 @@
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
1
2
  import { File, FileStack, FolderSearch, FilePen, FileX, Lock } from 'lucide-react';
2
3
  import 'react';
3
4
  import 'ua-parser-js';
@@ -9,46 +10,51 @@ import { ReturnButton } from '../../../buttons/return-button.js';
9
10
  function createShowPreset(ctx) {
10
11
  const { props, t } = ctx;
11
12
  return {
12
- left: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReturnButton, { pushToParent: true, ...props.returnButtonProps })),
13
+ left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true, ...props.returnButtonProps }) }),
13
14
  titleProps: {
14
15
  icon: File,
15
- children: !props.isNotFound && /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-3" }, props.showButtonProps && /* @__PURE__ */ React.createElement(
16
- Button,
17
- {
18
- ...props.showButtonProps,
19
- variant: "outline",
20
- icon: FolderSearch,
21
- isDisabled: props.showButtonProps.isDisabled || props.isDisabled
22
- },
23
- `${t("ui.button.show.text")} ${t("resources.related.text")}`
24
- ), props.editButtonProps && /* @__PURE__ */ React.createElement(
25
- Button,
26
- {
27
- ...props.editButtonProps,
28
- variant: "warning",
29
- icon: FilePen,
30
- isDisabled: props.editButtonProps.isDisabled || props.isDisabled
31
- },
32
- t("ui.button.edit.text")
33
- ), props.destroyButtonProps && /* @__PURE__ */ React.createElement(
34
- Button,
35
- {
36
- ...props.destroyButtonProps,
37
- variant: "destructive",
38
- icon: FileX,
39
- isDisabled: props.destroyButtonProps.isDisabled || props.isDisabled
40
- },
41
- t("ui.button.destroy.text")
42
- ), /* @__PURE__ */ React.createElement(
43
- Lock,
44
- {
45
- className: cn(
46
- props.isLocked && !props.isDisabled ? "opacity-100" : "opacity-0"
47
- )
48
- }
49
- ))
16
+ children: !props.isNotFound && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
17
+ props.showButtonProps && /* @__PURE__ */ jsx(
18
+ Button,
19
+ {
20
+ ...props.showButtonProps,
21
+ variant: "outline",
22
+ icon: FolderSearch,
23
+ isDisabled: props.showButtonProps.isDisabled || props.isDisabled,
24
+ children: `${t("ui.button.show.text")} ${t("resources.related.text")}`
25
+ }
26
+ ),
27
+ props.editButtonProps && /* @__PURE__ */ jsx(
28
+ Button,
29
+ {
30
+ ...props.editButtonProps,
31
+ variant: "warning",
32
+ icon: FilePen,
33
+ isDisabled: props.editButtonProps.isDisabled || props.isDisabled,
34
+ children: t("ui.button.edit.text")
35
+ }
36
+ ),
37
+ props.destroyButtonProps && /* @__PURE__ */ jsx(
38
+ Button,
39
+ {
40
+ ...props.destroyButtonProps,
41
+ variant: "destructive",
42
+ icon: FileX,
43
+ isDisabled: props.destroyButtonProps.isDisabled || props.isDisabled,
44
+ children: t("ui.button.destroy.text")
45
+ }
46
+ ),
47
+ /* @__PURE__ */ jsx(
48
+ Lock,
49
+ {
50
+ className: cn(
51
+ props.isLocked && !props.isDisabled ? "opacity-100" : "opacity-0"
52
+ )
53
+ }
54
+ )
55
+ ] })
50
56
  },
51
- right: props.batchButtonProps && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button, { variant: "outline", icon: FileStack, ...props.batchButtonProps }, /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, t("ui.button.batch.text"))))
57
+ right: props.batchButtonProps && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Button, { variant: "outline", icon: FileStack, ...props.batchButtonProps, children: /* @__PURE__ */ jsx("span", { className: "text-sm", children: t("ui.button.batch.text") }) }) })
52
58
  };
53
59
  }
54
60
 
@@ -1,3 +1,4 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
2
  import { Trash2, CopyCheck, CopyX, FileSymlink, FileX } from 'lucide-react';
2
3
  import { Button } from '../../../buttons/button.js';
3
4
  import { ReturnButton } from '../../../buttons/return-button.js';
@@ -5,28 +6,33 @@ import { ReturnButton } from '../../../buttons/return-button.js';
5
6
  function createTrashPreset(ctx) {
6
7
  const { props, t } = ctx;
7
8
  return {
8
- left: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ReturnButton, { pushToParent: true, ...props.returnButtonProps })),
9
+ left: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true, ...props.returnButtonProps }) }),
9
10
  titleProps: {
10
11
  icon: Trash2,
11
12
  title: t("main.trash.text")
12
13
  },
13
- right: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button, { size: "icon", variant: "outline", onClick: props.selectAllFn }, /* @__PURE__ */ React.createElement(CopyCheck, null)), /* @__PURE__ */ React.createElement(Button, { size: "icon", variant: "outline", onClick: props.cancelAllFn }, /* @__PURE__ */ React.createElement(CopyX, null)), /* @__PURE__ */ React.createElement(
14
- Button,
15
- {
16
- ...props.restoreButtonProps,
17
- variant: "success",
18
- icon: FileSymlink
19
- },
20
- t("ui.button.restore.text")
21
- ), /* @__PURE__ */ React.createElement(
22
- Button,
23
- {
24
- ...props.destroyButtonProps,
25
- variant: "destructive",
26
- icon: FileX
27
- },
28
- t("ui.button.destroy.text")
29
- ))
14
+ right: /* @__PURE__ */ jsxs(Fragment, { children: [
15
+ /* @__PURE__ */ jsx(Button, { size: "icon", variant: "outline", onClick: props.selectAllFn, children: /* @__PURE__ */ jsx(CopyCheck, {}) }),
16
+ /* @__PURE__ */ jsx(Button, { size: "icon", variant: "outline", onClick: props.cancelAllFn, children: /* @__PURE__ */ jsx(CopyX, {}) }),
17
+ /* @__PURE__ */ jsx(
18
+ Button,
19
+ {
20
+ ...props.restoreButtonProps,
21
+ variant: "success",
22
+ icon: FileSymlink,
23
+ children: t("ui.button.restore.text")
24
+ }
25
+ ),
26
+ /* @__PURE__ */ jsx(
27
+ Button,
28
+ {
29
+ ...props.destroyButtonProps,
30
+ variant: "destructive",
31
+ icon: FileX,
32
+ children: t("ui.button.destroy.text")
33
+ }
34
+ )
35
+ ] })
30
36
  };
31
37
  }
32
38
 
@@ -1,3 +1,5 @@
1
+ "use client";
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
3
  import { useRouter } from 'next/navigation';
2
4
  import { createElement } from 'react';
3
5
  import '@radix-ui/react-avatar';
@@ -37,15 +39,18 @@ function Button({
37
39
  router.push(href);
38
40
  }
39
41
  };
40
- return /* @__PURE__ */ React.createElement(
42
+ return /* @__PURE__ */ jsx(
41
43
  Button$1,
42
44
  {
43
45
  type: props.type ?? "button",
44
46
  disabled: isDisabled || isLoading,
45
47
  onClick: props.onClick ?? handleClick,
46
- ...props
47
- },
48
- isLoading ? /* @__PURE__ */ React.createElement(Spinner, null) : /* @__PURE__ */ React.createElement(React.Fragment, null, icon && createElement(icon), children)
48
+ ...props,
49
+ children: isLoading ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
50
+ icon && createElement(icon),
51
+ children
52
+ ] })
53
+ }
49
54
  );
50
55
  }
51
56
 
@@ -1,3 +1,5 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
1
3
  import { useTranslator } from 'intor/react';
2
4
  import { Undo2 } from 'lucide-react';
3
5
  import { useRouter } from 'next/navigation';
@@ -42,7 +44,7 @@ function ReturnButton({
42
44
  }
43
45
  router.back();
44
46
  };
45
- return /* @__PURE__ */ React.createElement(
47
+ return /* @__PURE__ */ jsx(
46
48
  Button,
47
49
  {
48
50
  variant: "outline",
@@ -50,9 +52,9 @@ function ReturnButton({
50
52
  icon: useIcon ? icon || Undo2 : void 0,
51
53
  onClick: handelClick,
52
54
  className,
53
- ...props
54
- },
55
- children ?? t("ui.button.return.text")
55
+ ...props,
56
+ children: children ?? t("ui.button.return.text")
57
+ }
56
58
  );
57
59
  }
58
60
 
@@ -1,3 +1,4 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { CirclePlus, CircleMinus } from 'lucide-react';
2
3
  import 'react';
3
4
  import 'ua-parser-js';
@@ -16,7 +17,7 @@ import '../../../shadcn/sidebar.js';
16
17
  import '@radix-ui/react-tooltip';
17
18
 
18
19
  function ExpandBar({ isExpand }) {
19
- return /* @__PURE__ */ React.createElement(
20
+ return /* @__PURE__ */ jsxs(
20
21
  "div",
21
22
  {
22
23
  className: cn(
@@ -24,11 +25,13 @@ function ExpandBar({ isExpand }) {
24
25
  "flex-center gap-1",
25
26
  "opacity-50 group-hover:opacity-100",
26
27
  "transition"
27
- )
28
- },
29
- /* @__PURE__ */ React.createElement(Separator, { className: "my-3 flex-1" }),
30
- !isExpand ? /* @__PURE__ */ React.createElement(CirclePlus, { className: "text-base-content size-5 min-w-5" }) : /* @__PURE__ */ React.createElement(CircleMinus, { className: "text-base-content size-5 min-w-5" }),
31
- /* @__PURE__ */ React.createElement(Separator, { className: "my-3 flex-1" })
28
+ ),
29
+ children: [
30
+ /* @__PURE__ */ jsx(Separator, { className: "my-3 flex-1" }),
31
+ !isExpand ? /* @__PURE__ */ jsx(CirclePlus, { className: "text-base-content size-5 min-w-5" }) : /* @__PURE__ */ jsx(CircleMinus, { className: "text-base-content size-5 min-w-5" }),
32
+ /* @__PURE__ */ jsx(Separator, { className: "my-3 flex-1" })
33
+ ]
34
+ }
32
35
  );
33
36
  }
34
37
 
@@ -1,3 +1,5 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
3
  import { useRef, useEffect } from 'react';
2
4
  import 'ua-parser-js';
3
5
  import { cn } from '../../../../../applications/shadcn/utils.js';
@@ -25,17 +27,22 @@ function ExpandableListContent({
25
27
  }
26
28
  el.style.maxHeight = isExpand ? `${height}px` : `${COLLAPSED_HEIGHT}px`;
27
29
  }, [isExpand, isDisabled, items.length, children, onOverflowChange]);
28
- return /* @__PURE__ */ React.createElement(
30
+ return /* @__PURE__ */ jsxs(
29
31
  "div",
30
32
  {
31
33
  ref: containerRef,
32
- className: cn("overflow-hidden", "flex flex-wrap gap-1", "duration-150")
33
- },
34
- children,
35
- items.map((eachItem, idx) => {
36
- const matched = isUnique && eachItem === item;
37
- return /* @__PURE__ */ React.createElement("span", { key: `${eachItem}-${idx}` }, /* @__PURE__ */ React.createElement("span", { className: cn(matched && "text-error") }, eachItem), idx !== items.length - 1 && ",");
38
- })
34
+ className: cn("overflow-hidden", "flex flex-wrap gap-1", "duration-150"),
35
+ children: [
36
+ children,
37
+ items.map((eachItem, idx) => {
38
+ const matched = isUnique && eachItem === item;
39
+ return /* @__PURE__ */ jsxs("span", { children: [
40
+ /* @__PURE__ */ jsx("span", { className: cn(matched && "text-error"), children: eachItem }),
41
+ idx !== items.length - 1 && ","
42
+ ] }, `${eachItem}-${idx}`);
43
+ })
44
+ ]
45
+ }
39
46
  );
40
47
  }
41
48