@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,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,4 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { useTranslator } from 'intor/react';
2
3
  import { Files } from 'lucide-react';
3
4
  import 'react';
@@ -43,24 +44,29 @@ function PageHeader(props) {
43
44
  const left = props.leftChildren ?? preset.left;
44
45
  const resolvedTitleProps = { ...preset.titleProps, ...props.titleProps };
45
46
  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,
47
+ return /* @__PURE__ */ jsxs("div", { style: { height: PAGE_HEADER_HEIGHT }, children: [
48
+ /* @__PURE__ */ jsxs(
49
+ "div",
57
50
  {
58
- className: cn(!isDefault && "absolute left-1/2 -translate-x-1/2"),
59
- ...resolvedTitleProps
51
+ className: cn(
52
+ "relative h-full px-6",
53
+ "flex items-center justify-between gap-3"
54
+ ),
55
+ children: [
56
+ !isDefault && left && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: left }),
57
+ /* @__PURE__ */ jsx(
58
+ PageHeaderTitle,
59
+ {
60
+ className: cn(!isDefault && "absolute left-1/2 -translate-x-1/2"),
61
+ ...resolvedTitleProps
62
+ }
63
+ ),
64
+ right && /* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center gap-3", children: right })
65
+ ]
60
66
  }
61
67
  ),
62
- right && /* @__PURE__ */ React.createElement("div", { className: "ml-auto flex items-center gap-3" }, right)
63
- ), /* @__PURE__ */ React.createElement(Separator, null));
68
+ /* @__PURE__ */ jsx(Separator, {})
69
+ ] });
64
70
  }
65
71
 
66
72
  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,4 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
2
  import { useRouter } from 'next/navigation';
2
3
  import { createElement } from 'react';
3
4
  import '@radix-ui/react-avatar';
@@ -37,15 +38,18 @@ function Button({
37
38
  router.push(href);
38
39
  }
39
40
  };
40
- return /* @__PURE__ */ React.createElement(
41
+ return /* @__PURE__ */ jsx(
41
42
  Button$1,
42
43
  {
43
44
  type: props.type ?? "button",
44
45
  disabled: isDisabled || isLoading,
45
46
  onClick: props.onClick ?? handleClick,
46
- ...props
47
- },
48
- isLoading ? /* @__PURE__ */ React.createElement(Spinner, null) : /* @__PURE__ */ React.createElement(React.Fragment, null, icon && createElement(icon), children)
47
+ ...props,
48
+ children: isLoading ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
49
+ icon && createElement(icon),
50
+ children
51
+ ] })
52
+ }
49
53
  );
50
54
  }
51
55
 
@@ -1,3 +1,4 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { useTranslator } from 'intor/react';
2
3
  import { Undo2 } from 'lucide-react';
3
4
  import { useRouter } from 'next/navigation';
@@ -42,7 +43,7 @@ function ReturnButton({
42
43
  }
43
44
  router.back();
44
45
  };
45
- return /* @__PURE__ */ React.createElement(
46
+ return /* @__PURE__ */ jsx(
46
47
  Button,
47
48
  {
48
49
  variant: "outline",
@@ -50,9 +51,9 @@ function ReturnButton({
50
51
  icon: useIcon ? icon || Undo2 : void 0,
51
52
  onClick: handelClick,
52
53
  className,
53
- ...props
54
- },
55
- children ?? t("ui.button.return.text")
54
+ ...props,
55
+ children: children ?? t("ui.button.return.text")
56
+ }
56
57
  );
57
58
  }
58
59
 
@@ -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,4 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { useRef, useEffect } from 'react';
2
3
  import 'ua-parser-js';
3
4
  import { cn } from '../../../../../applications/shadcn/utils.js';
@@ -25,17 +26,22 @@ function ExpandableListContent({
25
26
  }
26
27
  el.style.maxHeight = isExpand ? `${height}px` : `${COLLAPSED_HEIGHT}px`;
27
28
  }, [isExpand, isDisabled, items.length, children, onOverflowChange]);
28
- return /* @__PURE__ */ React.createElement(
29
+ return /* @__PURE__ */ jsxs(
29
30
  "div",
30
31
  {
31
32
  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
- })
33
+ className: cn("overflow-hidden", "flex flex-wrap gap-1", "duration-150"),
34
+ children: [
35
+ children,
36
+ items.map((eachItem, idx) => {
37
+ const matched = isUnique && eachItem === item;
38
+ return /* @__PURE__ */ jsxs("span", { children: [
39
+ /* @__PURE__ */ jsx("span", { className: cn(matched && "text-error"), children: eachItem }),
40
+ idx !== items.length - 1 && ","
41
+ ] }, `${eachItem}-${idx}`);
42
+ })
43
+ ]
44
+ }
39
45
  );
40
46
  }
41
47