@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 { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { Archive } from 'lucide-react';
3
4
  import { useState } from 'react';
4
5
  import 'ua-parser-js';
@@ -15,7 +16,7 @@ function ExpandableList({
15
16
  }) {
16
17
  const [isExpand, setIsExpand] = useState(false);
17
18
  const [isListOverFlow, setIsListOverFlow] = useState(false);
18
- return /* @__PURE__ */ React.createElement(
19
+ return /* @__PURE__ */ jsxs(
19
20
  "button",
20
21
  {
21
22
  type: "button",
@@ -26,22 +27,26 @@ function ExpandableList({
26
27
  className: cn(
27
28
  "group flex w-full flex-col gap-1 text-xs text-gray-400",
28
29
  !isListOverFlow && "pointer-events-none"
29
- )
30
- },
31
- /* @__PURE__ */ React.createElement(
32
- ExpandableListContent,
33
- {
34
- item,
35
- items,
36
- isExpand,
37
- isDisabled,
38
- isUnique,
39
- onOverflowChange: setIsListOverFlow
40
- },
41
- /* @__PURE__ */ React.createElement(Archive, { className: "size-4" }),
42
- /* @__PURE__ */ React.createElement("span", null, ":")
43
- ),
44
- isListOverFlow && /* @__PURE__ */ React.createElement(ExpandBar, { isExpand })
30
+ ),
31
+ children: [
32
+ /* @__PURE__ */ jsxs(
33
+ ExpandableListContent,
34
+ {
35
+ item,
36
+ items,
37
+ isExpand,
38
+ isDisabled,
39
+ isUnique,
40
+ onOverflowChange: setIsListOverFlow,
41
+ children: [
42
+ /* @__PURE__ */ jsx(Archive, { className: "size-4" }),
43
+ /* @__PURE__ */ jsx("span", { children: ":" })
44
+ ]
45
+ }
46
+ ),
47
+ isListOverFlow && /* @__PURE__ */ jsx(ExpandBar, { isExpand })
48
+ ]
49
+ }
45
50
  );
46
51
  }
47
52
 
@@ -1,3 +1,4 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import 'react';
2
3
  import 'ua-parser-js';
3
4
  import { cn } from '../../../../../applications/shadcn/utils.js';
@@ -9,14 +10,14 @@ function FieldsContainer({
9
10
  children,
10
11
  ...props
11
12
  }) {
12
- return /* @__PURE__ */ React.createElement(
13
+ return /* @__PURE__ */ jsx(
13
14
  "div",
14
15
  {
15
16
  className: cn("relative flex w-full", className),
16
17
  style: { gap: FORM_MIDDLE_GAP_WIDTH },
17
- ...props
18
- },
19
- children
18
+ ...props,
19
+ children
20
+ }
20
21
  );
21
22
  }
22
23
 
@@ -1,3 +1,4 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import 'react';
2
3
  import 'ua-parser-js';
3
4
  import { cn } from '../../../../../applications/shadcn/utils.js';
@@ -10,14 +11,14 @@ function MainFields({
10
11
  ...props
11
12
  }) {
12
13
  const sideWidth = FORM_SIDE_FIELDS_WIDTH + FORM_MIDDLE_GAP_WIDTH;
13
- return /* @__PURE__ */ React.createElement(
14
+ return /* @__PURE__ */ jsx(
14
15
  "div",
15
16
  {
16
17
  className: cn("relative", "flex flex-1 flex-col gap-6", className),
17
18
  style: { maxWidth: `calc(100% - ${sideWidth}px)` },
18
- ...props
19
- },
20
- children
19
+ ...props,
20
+ children
21
+ }
21
22
  );
22
23
  }
23
24
 
@@ -1,3 +1,4 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import 'react';
2
3
  import 'ua-parser-js';
3
4
  import { cn } from '../../../../../applications/shadcn/utils.js';
@@ -9,14 +10,14 @@ function SideFields({
9
10
  children,
10
11
  ...props
11
12
  }) {
12
- return /* @__PURE__ */ React.createElement(
13
+ return /* @__PURE__ */ jsx(
13
14
  "div",
14
15
  {
15
16
  className: cn("relative", "min-h-full", className),
16
17
  style: { width: `${FORM_SIDE_FIELDS_WIDTH}px` },
17
- ...props
18
- },
19
- /* @__PURE__ */ React.createElement("div", { className: cn("sticky top-24", "flex flex-col gap-6") }, children)
18
+ ...props,
19
+ children: /* @__PURE__ */ jsx("div", { className: cn("sticky top-24", "flex flex-col gap-6"), children })
20
+ }
20
21
  );
21
22
  }
22
23
 
@@ -1,3 +1,5 @@
1
+ "use client";
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
3
  import { useTranslator } from 'intor/react';
2
4
  import { Eye, Binary, MapPinCheckInside, Star, House } from 'lucide-react';
3
5
  import 'react';
@@ -34,71 +36,93 @@ function ControlFieldsDisplay({
34
36
  const notBuiltInFields = fields.filter(
35
37
  ({ key }) => !BUILT_IN_FIELDS.some((b) => b.key == key)
36
38
  );
37
- return /* @__PURE__ */ React.createElement(React.Fragment, null, fields.find((f) => f.key === "isActive") && /* @__PURE__ */ React.createElement(
38
- Field,
39
- {
40
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, /* @__PURE__ */ React.createElement(Eye, { className: "size-5" }), t("ui.field.control-fields.is-active.text"))
41
- },
42
- /* @__PURE__ */ React.createElement(
43
- Checkbox,
39
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
40
+ fields.find((f) => f.key === "isActive") && /* @__PURE__ */ jsx(
41
+ Field,
44
42
  {
45
- fieldName: "isActive",
46
- formData,
47
- isLoading,
48
- isDisplay: true
43
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
44
+ /* @__PURE__ */ jsx(Eye, { className: "size-5" }),
45
+ t("ui.field.control-fields.is-active.text")
46
+ ] }),
47
+ children: /* @__PURE__ */ jsx(
48
+ Checkbox,
49
+ {
50
+ fieldName: "isActive",
51
+ formData,
52
+ isLoading,
53
+ isDisplay: true
54
+ }
55
+ )
49
56
  }
50
- )
51
- ), fields.find((f) => f.key === "index") && /* @__PURE__ */ React.createElement(
52
- Field,
53
- {
54
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, /* @__PURE__ */ React.createElement(Binary, { className: "size-5" }), t("ui.field.control-fields.index.text"))
55
- },
56
- /* @__PURE__ */ React.createElement(IndexField, { formData, isLoading, isDisplay: true })
57
- ), fields.find((f) => f.key === "slug") && /* @__PURE__ */ React.createElement(
58
- Field,
59
- {
60
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, /* @__PURE__ */ React.createElement(MapPinCheckInside, { className: "size-5" }), t("ui.field.control-fields.slug.text"))
61
- },
62
- /* @__PURE__ */ React.createElement(SlugField, { formData, isLoading, isDisplay: true })
63
- ), fields.find((f) => f.key === "isFeatured") && /* @__PURE__ */ React.createElement(
64
- Field,
65
- {
66
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, /* @__PURE__ */ React.createElement(Star, { className: "size-5" }), t("ui.field.control-fields.is-featured.text"))
67
- },
68
- /* @__PURE__ */ React.createElement(
69
- Checkbox,
57
+ ),
58
+ fields.find((f) => f.key === "index") && /* @__PURE__ */ jsx(
59
+ Field,
70
60
  {
71
- fieldName: "isFeatured",
72
- formData,
73
- isLoading,
74
- isDisplay: true
61
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
62
+ /* @__PURE__ */ jsx(Binary, { className: "size-5" }),
63
+ t("ui.field.control-fields.index.text")
64
+ ] }),
65
+ children: /* @__PURE__ */ jsx(IndexField, { formData, isLoading, isDisplay: true })
75
66
  }
76
- )
77
- ), fields.find((f) => f.key === "isShownOnHome") && /* @__PURE__ */ React.createElement(
78
- Field,
79
- {
80
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, /* @__PURE__ */ React.createElement(House, { className: "size-5" }), t("ui.field.control-fields.is-shown-on-home.text"))
81
- },
82
- /* @__PURE__ */ React.createElement(
83
- Checkbox,
67
+ ),
68
+ fields.find((f) => f.key === "slug") && /* @__PURE__ */ jsx(
69
+ Field,
84
70
  {
85
- fieldName: "isShownOnHome",
86
- formData,
87
- isLoading,
88
- isDisplay: true
71
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
72
+ /* @__PURE__ */ jsx(MapPinCheckInside, { className: "size-5" }),
73
+ t("ui.field.control-fields.slug.text")
74
+ ] }),
75
+ children: /* @__PURE__ */ jsx(SlugField, { formData, isLoading, isDisplay: true })
89
76
  }
90
- )
91
- ), notBuiltInFields.map(({ key, label }) => {
92
- return /* @__PURE__ */ React.createElement(Field, { key, label }, /* @__PURE__ */ React.createElement(
93
- Checkbox,
77
+ ),
78
+ fields.find((f) => f.key === "isFeatured") && /* @__PURE__ */ jsx(
79
+ Field,
94
80
  {
95
- fieldName: key,
96
- formData,
97
- isLoading,
98
- isDisplay: true
81
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
82
+ /* @__PURE__ */ jsx(Star, { className: "size-5" }),
83
+ t("ui.field.control-fields.is-featured.text")
84
+ ] }),
85
+ children: /* @__PURE__ */ jsx(
86
+ Checkbox,
87
+ {
88
+ fieldName: "isFeatured",
89
+ formData,
90
+ isLoading,
91
+ isDisplay: true
92
+ }
93
+ )
99
94
  }
100
- ));
101
- }));
95
+ ),
96
+ fields.find((f) => f.key === "isShownOnHome") && /* @__PURE__ */ jsx(
97
+ Field,
98
+ {
99
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
100
+ /* @__PURE__ */ jsx(House, { className: "size-5" }),
101
+ t("ui.field.control-fields.is-shown-on-home.text")
102
+ ] }),
103
+ children: /* @__PURE__ */ jsx(
104
+ Checkbox,
105
+ {
106
+ fieldName: "isShownOnHome",
107
+ formData,
108
+ isLoading,
109
+ isDisplay: true
110
+ }
111
+ )
112
+ }
113
+ ),
114
+ notBuiltInFields.map(({ key, label }) => {
115
+ return /* @__PURE__ */ jsx(Field, { label, children: /* @__PURE__ */ jsx(
116
+ Checkbox,
117
+ {
118
+ fieldName: key,
119
+ formData,
120
+ isLoading,
121
+ isDisplay: true
122
+ }
123
+ ) }, key);
124
+ })
125
+ ] });
102
126
  }
103
127
 
104
128
  export { ControlFieldsDisplay };
@@ -1,3 +1,5 @@
1
+ "use client";
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
3
  import { useTranslator } from 'intor/react';
2
4
  import { Eye, EyeOff, Binary, MapPinCheckInside, Star, House } from 'lucide-react';
3
5
  import 'react';
@@ -44,107 +46,129 @@ function ControlFieldsInput({
44
46
  const notBuiltInFields = fields.filter(
45
47
  ({ key }) => !BUILT_IN_FIELDS.some((b) => b.key == key)
46
48
  );
47
- return /* @__PURE__ */ React.createElement(React.Fragment, null, fields.find((f) => f.key === "isActive") && /* @__PURE__ */ React.createElement(
48
- Field,
49
- {
50
- htmlFor: "isActive",
51
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, formData["isActive"] ? /* @__PURE__ */ React.createElement(Eye, { className: "size-5" }) : /* @__PURE__ */ React.createElement(EyeOff, { className: "size-5" }), t("ui.field.control-fields.is-active.text"))
52
- },
53
- /* @__PURE__ */ React.createElement(
54
- Checkbox,
49
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
50
+ fields.find((f) => f.key === "isActive") && /* @__PURE__ */ jsx(
51
+ Field,
55
52
  {
56
- id: "isActive",
57
- fieldName: "isActive",
58
- formData,
59
- setFormData,
60
- isLoading,
61
- isDisabled
53
+ htmlFor: "isActive",
54
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
55
+ formData["isActive"] ? /* @__PURE__ */ jsx(Eye, { className: "size-5" }) : /* @__PURE__ */ jsx(EyeOff, { className: "size-5" }),
56
+ t("ui.field.control-fields.is-active.text")
57
+ ] }),
58
+ children: /* @__PURE__ */ jsx(
59
+ Checkbox,
60
+ {
61
+ id: "isActive",
62
+ fieldName: "isActive",
63
+ formData,
64
+ setFormData,
65
+ isLoading,
66
+ isDisabled
67
+ }
68
+ )
62
69
  }
63
- )
64
- ), fields.find((f) => f.key === "index") && /* @__PURE__ */ React.createElement(
65
- Field,
66
- {
67
- htmlFor: "index",
68
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, /* @__PURE__ */ React.createElement(Binary, { className: "size-5" }), t("ui.field.control-fields.index.text"))
69
- },
70
- /* @__PURE__ */ React.createElement(
71
- IndexField,
70
+ ),
71
+ fields.find((f) => f.key === "index") && /* @__PURE__ */ jsx(
72
+ Field,
72
73
  {
73
- id: "index",
74
- formData,
75
- setFormData,
76
- isLoading,
77
- isDisabled,
78
- existingIndexes,
79
- availableIndex,
80
- isError: errors?.includes("index")
74
+ htmlFor: "index",
75
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
76
+ /* @__PURE__ */ jsx(Binary, { className: "size-5" }),
77
+ t("ui.field.control-fields.index.text")
78
+ ] }),
79
+ children: /* @__PURE__ */ jsx(
80
+ IndexField,
81
+ {
82
+ id: "index",
83
+ formData,
84
+ setFormData,
85
+ isLoading,
86
+ isDisabled,
87
+ existingIndexes,
88
+ availableIndex,
89
+ isError: errors?.includes("index")
90
+ }
91
+ )
81
92
  }
82
- )
83
- ), fields.find((f) => f.key === "slug") && /* @__PURE__ */ React.createElement(
84
- Field,
85
- {
86
- htmlFor: "slug",
87
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, /* @__PURE__ */ React.createElement(MapPinCheckInside, { className: "size-5" }), t("ui.field.control-fields.slug.text"))
88
- },
89
- /* @__PURE__ */ React.createElement(
90
- SlugField,
93
+ ),
94
+ fields.find((f) => f.key === "slug") && /* @__PURE__ */ jsx(
95
+ Field,
91
96
  {
92
- id: "slug",
93
- formData,
94
- setFormData,
95
- isLoading,
96
- isDisabled,
97
- existingSlugs,
98
- isError: errors?.includes("slug")
97
+ htmlFor: "slug",
98
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
99
+ /* @__PURE__ */ jsx(MapPinCheckInside, { className: "size-5" }),
100
+ t("ui.field.control-fields.slug.text")
101
+ ] }),
102
+ children: /* @__PURE__ */ jsx(
103
+ SlugField,
104
+ {
105
+ id: "slug",
106
+ formData,
107
+ setFormData,
108
+ isLoading,
109
+ isDisabled,
110
+ existingSlugs,
111
+ isError: errors?.includes("slug")
112
+ }
113
+ )
99
114
  }
100
- )
101
- ), fields.find((f) => f.key === "isFeatured") && /* @__PURE__ */ React.createElement(
102
- Field,
103
- {
104
- htmlFor: "isFeatured",
105
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, /* @__PURE__ */ React.createElement(Star, { className: "size-5" }), t("ui.field.control-fields.is-featured.text"))
106
- },
107
- /* @__PURE__ */ React.createElement(
108
- Checkbox,
115
+ ),
116
+ fields.find((f) => f.key === "isFeatured") && /* @__PURE__ */ jsx(
117
+ Field,
109
118
  {
110
- id: "isFeatured",
111
- fieldName: "isFeatured",
112
- formData,
113
- setFormData,
114
- isLoading,
115
- isDisabled
119
+ htmlFor: "isFeatured",
120
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
121
+ /* @__PURE__ */ jsx(Star, { className: "size-5" }),
122
+ t("ui.field.control-fields.is-featured.text")
123
+ ] }),
124
+ children: /* @__PURE__ */ jsx(
125
+ Checkbox,
126
+ {
127
+ id: "isFeatured",
128
+ fieldName: "isFeatured",
129
+ formData,
130
+ setFormData,
131
+ isLoading,
132
+ isDisabled
133
+ }
134
+ )
116
135
  }
117
- )
118
- ), fields.find((f) => f.key === "isShownOnHome") && /* @__PURE__ */ React.createElement(
119
- Field,
120
- {
121
- htmlFor: "isShownOnHome",
122
- label: /* @__PURE__ */ React.createElement("span", { className: "flex-center gap-2" }, /* @__PURE__ */ React.createElement(House, { className: "size-5" }), t("ui.field.control-fields.is-shown-on-home.text"))
123
- },
124
- /* @__PURE__ */ React.createElement(
125
- Checkbox,
136
+ ),
137
+ fields.find((f) => f.key === "isShownOnHome") && /* @__PURE__ */ jsx(
138
+ Field,
126
139
  {
127
- id: "isShownOnHome",
128
- fieldName: "isShownOnHome",
129
- formData,
130
- setFormData,
131
- isLoading,
132
- isDisabled
140
+ htmlFor: "isShownOnHome",
141
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
142
+ /* @__PURE__ */ jsx(House, { className: "size-5" }),
143
+ t("ui.field.control-fields.is-shown-on-home.text")
144
+ ] }),
145
+ children: /* @__PURE__ */ jsx(
146
+ Checkbox,
147
+ {
148
+ id: "isShownOnHome",
149
+ fieldName: "isShownOnHome",
150
+ formData,
151
+ setFormData,
152
+ isLoading,
153
+ isDisabled
154
+ }
155
+ )
133
156
  }
134
- )
135
- ), notBuiltInFields.map(({ key, label }) => {
136
- return /* @__PURE__ */ React.createElement(Field, { key, htmlFor: key, label }, /* @__PURE__ */ React.createElement(
137
- Checkbox,
138
- {
139
- id: key,
140
- fieldName: key,
141
- formData,
142
- setFormData,
143
- isLoading,
144
- isDisabled
145
- }
146
- ));
147
- }));
157
+ ),
158
+ notBuiltInFields.map(({ key, label }) => {
159
+ return /* @__PURE__ */ jsx(Field, { htmlFor: key, label, children: /* @__PURE__ */ jsx(
160
+ Checkbox,
161
+ {
162
+ id: key,
163
+ fieldName: key,
164
+ formData,
165
+ setFormData,
166
+ isLoading,
167
+ isDisabled
168
+ }
169
+ ) }, key);
170
+ })
171
+ ] });
148
172
  }
149
173
 
150
174
  export { ControlFieldsInput };
@@ -1,3 +1,4 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import 'react';
2
3
  import 'ua-parser-js';
3
4
  import { cn } from '../../../../../applications/shadcn/utils.js';
@@ -33,7 +34,7 @@ function ControlFields({
33
34
  ...props
34
35
  }) {
35
36
  if (fields.length === 0) return null;
36
- return /* @__PURE__ */ React.createElement(Card, { className: cn("flex flex-col gap-6", "bg-base-100 p-4"), ...props }, !isDisplay ? /* @__PURE__ */ React.createElement(
37
+ return /* @__PURE__ */ jsx(Card, { className: cn("flex flex-col gap-6", "bg-base-100 p-4"), ...props, children: !isDisplay ? /* @__PURE__ */ jsx(
37
38
  ControlFieldsInput,
38
39
  {
39
40
  fields,
@@ -44,14 +45,14 @@ function ControlFields({
44
45
  isDisabled,
45
46
  errors
46
47
  }
47
- ) : /* @__PURE__ */ React.createElement(
48
+ ) : /* @__PURE__ */ jsx(
48
49
  ControlFieldsDisplay,
49
50
  {
50
51
  fields,
51
52
  formData,
52
53
  isLoading
53
54
  }
54
- ));
55
+ ) });
55
56
  }
56
57
 
57
58
  export { ControlFields };
@@ -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 'react';
3
5
  import 'ua-parser-js';
@@ -30,7 +32,7 @@ function FieldBody({
30
32
  ...props
31
33
  }) {
32
34
  const { t } = useTranslator();
33
- return /* @__PURE__ */ React.createElement(
35
+ return /* @__PURE__ */ jsxs(
34
36
  "div",
35
37
  {
36
38
  className: cn(
@@ -40,34 +42,36 @@ function FieldBody({
40
42
  "flex items-center",
41
43
  "text-sm"
42
44
  ),
43
- ...props
44
- },
45
- /* @__PURE__ */ React.createElement(
46
- "div",
47
- {
48
- className: cn(
49
- "absolute size-full",
50
- "dark:bg-input/30 bg-foreground/2 rounded-md",
51
- backgroundClassName
45
+ ...props,
46
+ children: [
47
+ /* @__PURE__ */ jsx(
48
+ "div",
49
+ {
50
+ className: cn(
51
+ "absolute size-full",
52
+ "dark:bg-input/30 bg-foreground/2 rounded-md",
53
+ backgroundClassName
54
+ )
55
+ }
56
+ ),
57
+ isLoading && /* @__PURE__ */ jsx("div", { className: "px-3", children: /* @__PURE__ */ jsx(Spinner, {}) }),
58
+ !isLoading && (!children || isEmpty) && /* @__PURE__ */ jsx("div", { className: "flex-center h-9 px-3 opacity-50", children: /* @__PURE__ */ jsx("p", { className: "opacity-50", children: t("ui.no-data.text") }) }),
59
+ !isLoading && children && !isEmpty && /* @__PURE__ */ jsx(
60
+ "div",
61
+ {
62
+ className: cn(
63
+ "relative size-full",
64
+ "flex items-center gap-3",
65
+ "px-3 py-2",
66
+ "break-all",
67
+ (isDisabled || isLoading) && "opacity-50",
68
+ childrenClassName
69
+ ),
70
+ children
71
+ }
52
72
  )
53
- }
54
- ),
55
- isLoading && /* @__PURE__ */ React.createElement("div", { className: "px-3" }, /* @__PURE__ */ React.createElement(Spinner, null)),
56
- !isLoading && (!children || isEmpty) && /* @__PURE__ */ React.createElement("div", { className: "flex-center h-9 px-3 opacity-50" }, /* @__PURE__ */ React.createElement("p", { className: "opacity-50" }, t("ui.no-data.text"))),
57
- !isLoading && children && !isEmpty && /* @__PURE__ */ React.createElement(
58
- "div",
59
- {
60
- className: cn(
61
- "relative size-full",
62
- "flex items-center gap-3",
63
- "px-3 py-2",
64
- "break-all",
65
- (isDisabled || isLoading) && "opacity-50",
66
- childrenClassName
67
- )
68
- },
69
- children
70
- )
73
+ ]
74
+ }
71
75
  );
72
76
  }
73
77
 
@@ -1,3 +1,4 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { Asterisk } from 'lucide-react';
2
3
  import '@radix-ui/react-avatar';
3
4
  import 'react';
@@ -24,7 +25,17 @@ function Field({
24
25
  children,
25
26
  ...props
26
27
  }) {
27
- return /* @__PURE__ */ React.createElement("div", { className: "grid w-full items-center gap-3" }, /* @__PURE__ */ React.createElement("span", { className: "flex gap-2" }, /* @__PURE__ */ React.createElement(Label, { className: "flex gap-1 truncate", ...props }, label, isRequired && /* @__PURE__ */ React.createElement(Asterisk, { className: "text-destructive size-3" }), hint && /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground ml-2 text-xs" }, hint)), /* @__PURE__ */ React.createElement("span", null, labelChildren)), children);
28
+ return /* @__PURE__ */ jsxs("div", { className: "grid w-full items-center gap-3", children: [
29
+ /* @__PURE__ */ jsxs("span", { className: "flex gap-2", children: [
30
+ /* @__PURE__ */ jsxs(Label, { className: "flex gap-1 truncate", ...props, children: [
31
+ label,
32
+ isRequired && /* @__PURE__ */ jsx(Asterisk, { className: "text-destructive size-3" }),
33
+ hint && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground ml-2 text-xs", children: hint })
34
+ ] }),
35
+ /* @__PURE__ */ jsx("span", { children: labelChildren })
36
+ ] }),
37
+ children
38
+ ] });
28
39
  }
29
40
 
30
41
  export { Field };
@@ -1,3 +1,5 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
1
3
  import 'react';
2
4
  import 'ua-parser-js';
3
5
  import { cn } from '../../../../applications/shadcn/utils.js';
@@ -13,7 +15,7 @@ function Form({
13
15
  e.preventDefault();
14
16
  void onSubmit(e);
15
17
  };
16
- return /* @__PURE__ */ React.createElement("form", { className: cn(className), onSubmit: handleSubmit, ...props });
18
+ return /* @__PURE__ */ jsx("form", { className: cn(className), onSubmit: handleSubmit, ...props });
17
19
  }
18
20
 
19
21
  export { Form };