@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,7 +1,8 @@
1
1
  "use client";
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import * as SelectPrimitive from '@radix-ui/react-select';
3
4
  import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
4
- import * as React from 'react';
5
+ import 'react';
5
6
  import 'ua-parser-js';
6
7
  import { cn } from '../../../applications/shadcn/utils.js';
7
8
  import 'next/navigation';
@@ -9,17 +10,17 @@ import 'next/navigation';
9
10
  function Select({
10
11
  ...props
11
12
  }) {
12
- return /* @__PURE__ */ React.createElement(SelectPrimitive.Root, { "data-slot": "select", ...props });
13
+ return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
13
14
  }
14
15
  function SelectGroup({
15
16
  ...props
16
17
  }) {
17
- return /* @__PURE__ */ React.createElement(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
18
+ return /* @__PURE__ */ jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
18
19
  }
19
20
  function SelectValue({
20
21
  ...props
21
22
  }) {
22
- return /* @__PURE__ */ React.createElement(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
23
+ return /* @__PURE__ */ jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
23
24
  }
24
25
  function SelectTrigger({
25
26
  className,
@@ -27,7 +28,7 @@ function SelectTrigger({
27
28
  children,
28
29
  ...props
29
30
  }) {
30
- return /* @__PURE__ */ React.createElement(
31
+ return /* @__PURE__ */ jsxs(
31
32
  SelectPrimitive.Trigger,
32
33
  {
33
34
  "data-slot": "select-trigger",
@@ -36,10 +37,12 @@ function SelectTrigger({
36
37
  "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
37
38
  className
38
39
  ),
39
- ...props
40
- },
41
- children,
42
- /* @__PURE__ */ React.createElement(SelectPrimitive.Icon, { asChild: true }, /* @__PURE__ */ React.createElement(ChevronDownIcon, { className: "size-4 opacity-50" }))
40
+ ...props,
41
+ children: [
42
+ children,
43
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })
44
+ ]
45
+ }
43
46
  );
44
47
  }
45
48
  function SelectContent({
@@ -49,7 +52,7 @@ function SelectContent({
49
52
  align = "center",
50
53
  ...props
51
54
  }) {
52
- return /* @__PURE__ */ React.createElement(SelectPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
55
+ return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
53
56
  SelectPrimitive.Content,
54
57
  {
55
58
  "data-slot": "select-content",
@@ -60,27 +63,29 @@ function SelectContent({
60
63
  ),
61
64
  position,
62
65
  align,
63
- ...props
64
- },
65
- /* @__PURE__ */ React.createElement(SelectScrollUpButton, null),
66
- /* @__PURE__ */ React.createElement(
67
- SelectPrimitive.Viewport,
68
- {
69
- className: cn(
70
- "p-1",
71
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
72
- )
73
- },
74
- children
75
- ),
76
- /* @__PURE__ */ React.createElement(SelectScrollDownButton, null)
77
- ));
66
+ ...props,
67
+ children: [
68
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
69
+ /* @__PURE__ */ jsx(
70
+ SelectPrimitive.Viewport,
71
+ {
72
+ className: cn(
73
+ "p-1",
74
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
75
+ ),
76
+ children
77
+ }
78
+ ),
79
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
80
+ ]
81
+ }
82
+ ) });
78
83
  }
79
84
  function SelectLabel({
80
85
  className,
81
86
  ...props
82
87
  }) {
83
- return /* @__PURE__ */ React.createElement(
88
+ return /* @__PURE__ */ jsx(
84
89
  SelectPrimitive.Label,
85
90
  {
86
91
  "data-slot": "select-label",
@@ -94,7 +99,7 @@ function SelectItem({
94
99
  children,
95
100
  ...props
96
101
  }) {
97
- return /* @__PURE__ */ React.createElement(
102
+ return /* @__PURE__ */ jsxs(
98
103
  SelectPrimitive.Item,
99
104
  {
100
105
  "data-slot": "select-item",
@@ -102,17 +107,19 @@ function SelectItem({
102
107
  "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
103
108
  className
104
109
  ),
105
- ...props
106
- },
107
- /* @__PURE__ */ React.createElement("span", { className: "absolute right-2 flex size-3.5 items-center justify-center" }, /* @__PURE__ */ React.createElement(SelectPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement(CheckIcon, { className: "size-4" }))),
108
- /* @__PURE__ */ React.createElement(SelectPrimitive.ItemText, null, children)
110
+ ...props,
111
+ children: [
112
+ /* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
113
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
114
+ ]
115
+ }
109
116
  );
110
117
  }
111
118
  function SelectSeparator({
112
119
  className,
113
120
  ...props
114
121
  }) {
115
- return /* @__PURE__ */ React.createElement(
122
+ return /* @__PURE__ */ jsx(
116
123
  SelectPrimitive.Separator,
117
124
  {
118
125
  "data-slot": "select-separator",
@@ -125,7 +132,7 @@ function SelectScrollUpButton({
125
132
  className,
126
133
  ...props
127
134
  }) {
128
- return /* @__PURE__ */ React.createElement(
135
+ return /* @__PURE__ */ jsx(
129
136
  SelectPrimitive.ScrollUpButton,
130
137
  {
131
138
  "data-slot": "select-scroll-up-button",
@@ -133,16 +140,16 @@ function SelectScrollUpButton({
133
140
  "flex cursor-default items-center justify-center py-1",
134
141
  className
135
142
  ),
136
- ...props
137
- },
138
- /* @__PURE__ */ React.createElement(ChevronUpIcon, { className: "size-4" })
143
+ ...props,
144
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
145
+ }
139
146
  );
140
147
  }
141
148
  function SelectScrollDownButton({
142
149
  className,
143
150
  ...props
144
151
  }) {
145
- return /* @__PURE__ */ React.createElement(
152
+ return /* @__PURE__ */ jsx(
146
153
  SelectPrimitive.ScrollDownButton,
147
154
  {
148
155
  "data-slot": "select-scroll-down-button",
@@ -150,9 +157,9 @@ function SelectScrollDownButton({
150
157
  "flex cursor-default items-center justify-center py-1",
151
158
  className
152
159
  ),
153
- ...props
154
- },
155
- /* @__PURE__ */ React.createElement(ChevronDownIcon, { className: "size-4" })
160
+ ...props,
161
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
162
+ }
156
163
  );
157
164
  }
158
165
 
@@ -1,6 +1,7 @@
1
1
  "use client";
2
+ import { jsx } from 'react/jsx-runtime';
2
3
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
3
- import * as React from 'react';
4
+ import 'react';
4
5
  import 'ua-parser-js';
5
6
  import { cn } from '../../../applications/shadcn/utils.js';
6
7
  import 'next/navigation';
@@ -11,7 +12,7 @@ function Separator({
11
12
  decorative = true,
12
13
  ...props
13
14
  }) {
14
- return /* @__PURE__ */ React.createElement(
15
+ return /* @__PURE__ */ jsx(
15
16
  SeparatorPrimitive.Root,
16
17
  {
17
18
  "data-slot": "separator",
@@ -1,34 +1,35 @@
1
1
  "use client";
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import * as SheetPrimitive from '@radix-ui/react-dialog';
3
4
  import { XIcon } from 'lucide-react';
4
- import * as React from 'react';
5
+ import 'react';
5
6
  import 'ua-parser-js';
6
7
  import { cn } from '../../../applications/shadcn/utils.js';
7
8
  import 'next/navigation';
8
9
 
9
10
  function Sheet({ ...props }) {
10
- return /* @__PURE__ */ React.createElement(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
11
+ return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
11
12
  }
12
13
  function SheetTrigger({
13
14
  ...props
14
15
  }) {
15
- return /* @__PURE__ */ React.createElement(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
16
+ return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
16
17
  }
17
18
  function SheetClose({
18
19
  ...props
19
20
  }) {
20
- return /* @__PURE__ */ React.createElement(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
21
+ return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
21
22
  }
22
23
  function SheetPortal({
23
24
  ...props
24
25
  }) {
25
- return /* @__PURE__ */ React.createElement(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
26
+ return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
26
27
  }
27
28
  function SheetOverlay({
28
29
  className,
29
30
  ...props
30
31
  }) {
31
- return /* @__PURE__ */ React.createElement(
32
+ return /* @__PURE__ */ jsx(
32
33
  SheetPrimitive.Overlay,
33
34
  {
34
35
  "data-slot": "sheet-overlay",
@@ -46,26 +47,34 @@ function SheetContent({
46
47
  side = "right",
47
48
  ...props
48
49
  }) {
49
- return /* @__PURE__ */ React.createElement(SheetPortal, null, /* @__PURE__ */ React.createElement(SheetOverlay, null), /* @__PURE__ */ React.createElement(
50
- SheetPrimitive.Content,
51
- {
52
- "data-slot": "sheet-content",
53
- className: cn(
54
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
55
- side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
56
- side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
57
- side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
58
- side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
59
- className
60
- ),
61
- ...props
62
- },
63
- children,
64
- /* @__PURE__ */ React.createElement(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none" }, /* @__PURE__ */ React.createElement(XIcon, { className: "size-4" }), /* @__PURE__ */ React.createElement("span", { className: "sr-only" }, "Close"))
65
- ));
50
+ return /* @__PURE__ */ jsxs(SheetPortal, { children: [
51
+ /* @__PURE__ */ jsx(SheetOverlay, {}),
52
+ /* @__PURE__ */ jsxs(
53
+ SheetPrimitive.Content,
54
+ {
55
+ "data-slot": "sheet-content",
56
+ className: cn(
57
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
58
+ side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
59
+ side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
60
+ side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
61
+ side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
62
+ className
63
+ ),
64
+ ...props,
65
+ children: [
66
+ children,
67
+ /* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
68
+ /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
69
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
70
+ ] })
71
+ ]
72
+ }
73
+ )
74
+ ] });
66
75
  }
67
76
  function SheetHeader({ className, ...props }) {
68
- return /* @__PURE__ */ React.createElement(
77
+ return /* @__PURE__ */ jsx(
69
78
  "div",
70
79
  {
71
80
  "data-slot": "sheet-header",
@@ -75,7 +84,7 @@ function SheetHeader({ className, ...props }) {
75
84
  );
76
85
  }
77
86
  function SheetFooter({ className, ...props }) {
78
- return /* @__PURE__ */ React.createElement(
87
+ return /* @__PURE__ */ jsx(
79
88
  "div",
80
89
  {
81
90
  "data-slot": "sheet-footer",
@@ -88,7 +97,7 @@ function SheetTitle({
88
97
  className,
89
98
  ...props
90
99
  }) {
91
- return /* @__PURE__ */ React.createElement(
100
+ return /* @__PURE__ */ jsx(
92
101
  SheetPrimitive.Title,
93
102
  {
94
103
  "data-slot": "sheet-title",
@@ -101,7 +110,7 @@ function SheetDescription({
101
110
  className,
102
111
  ...props
103
112
  }) {
104
- return /* @__PURE__ */ React.createElement(
113
+ return /* @__PURE__ */ jsx(
105
114
  SheetPrimitive.Description,
106
115
  {
107
116
  "data-slot": "sheet-description",