@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 { 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,4 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
2
  import { useTranslator } from 'intor/react';
2
3
  import { Eye, Binary, MapPinCheckInside, Star, House } from 'lucide-react';
3
4
  import 'react';
@@ -34,71 +35,93 @@ function ControlFieldsDisplay({
34
35
  const notBuiltInFields = fields.filter(
35
36
  ({ key }) => !BUILT_IN_FIELDS.some((b) => b.key == key)
36
37
  );
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,
38
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
39
+ fields.find((f) => f.key === "isActive") && /* @__PURE__ */ jsx(
40
+ Field,
44
41
  {
45
- fieldName: "isActive",
46
- formData,
47
- isLoading,
48
- isDisplay: true
42
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
43
+ /* @__PURE__ */ jsx(Eye, { className: "size-5" }),
44
+ t("ui.field.control-fields.is-active.text")
45
+ ] }),
46
+ children: /* @__PURE__ */ jsx(
47
+ Checkbox,
48
+ {
49
+ fieldName: "isActive",
50
+ formData,
51
+ isLoading,
52
+ isDisplay: true
53
+ }
54
+ )
49
55
  }
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,
56
+ ),
57
+ fields.find((f) => f.key === "index") && /* @__PURE__ */ jsx(
58
+ Field,
70
59
  {
71
- fieldName: "isFeatured",
72
- formData,
73
- isLoading,
74
- isDisplay: true
60
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
61
+ /* @__PURE__ */ jsx(Binary, { className: "size-5" }),
62
+ t("ui.field.control-fields.index.text")
63
+ ] }),
64
+ children: /* @__PURE__ */ jsx(IndexField, { formData, isLoading, isDisplay: true })
75
65
  }
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,
66
+ ),
67
+ fields.find((f) => f.key === "slug") && /* @__PURE__ */ jsx(
68
+ Field,
84
69
  {
85
- fieldName: "isShownOnHome",
86
- formData,
87
- isLoading,
88
- isDisplay: true
70
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
71
+ /* @__PURE__ */ jsx(MapPinCheckInside, { className: "size-5" }),
72
+ t("ui.field.control-fields.slug.text")
73
+ ] }),
74
+ children: /* @__PURE__ */ jsx(SlugField, { formData, isLoading, isDisplay: true })
89
75
  }
90
- )
91
- ), notBuiltInFields.map(({ key, label }) => {
92
- return /* @__PURE__ */ React.createElement(Field, { key, label }, /* @__PURE__ */ React.createElement(
93
- Checkbox,
76
+ ),
77
+ fields.find((f) => f.key === "isFeatured") && /* @__PURE__ */ jsx(
78
+ Field,
94
79
  {
95
- fieldName: key,
96
- formData,
97
- isLoading,
98
- isDisplay: true
80
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
81
+ /* @__PURE__ */ jsx(Star, { className: "size-5" }),
82
+ t("ui.field.control-fields.is-featured.text")
83
+ ] }),
84
+ children: /* @__PURE__ */ jsx(
85
+ Checkbox,
86
+ {
87
+ fieldName: "isFeatured",
88
+ formData,
89
+ isLoading,
90
+ isDisplay: true
91
+ }
92
+ )
99
93
  }
100
- ));
101
- }));
94
+ ),
95
+ fields.find((f) => f.key === "isShownOnHome") && /* @__PURE__ */ jsx(
96
+ Field,
97
+ {
98
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
99
+ /* @__PURE__ */ jsx(House, { className: "size-5" }),
100
+ t("ui.field.control-fields.is-shown-on-home.text")
101
+ ] }),
102
+ children: /* @__PURE__ */ jsx(
103
+ Checkbox,
104
+ {
105
+ fieldName: "isShownOnHome",
106
+ formData,
107
+ isLoading,
108
+ isDisplay: true
109
+ }
110
+ )
111
+ }
112
+ ),
113
+ notBuiltInFields.map(({ key, label }) => {
114
+ return /* @__PURE__ */ jsx(Field, { label, children: /* @__PURE__ */ jsx(
115
+ Checkbox,
116
+ {
117
+ fieldName: key,
118
+ formData,
119
+ isLoading,
120
+ isDisplay: true
121
+ }
122
+ ) }, key);
123
+ })
124
+ ] });
102
125
  }
103
126
 
104
127
  export { ControlFieldsDisplay };
@@ -1,3 +1,4 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
2
  import { useTranslator } from 'intor/react';
2
3
  import { Eye, EyeOff, Binary, MapPinCheckInside, Star, House } from 'lucide-react';
3
4
  import 'react';
@@ -44,107 +45,129 @@ function ControlFieldsInput({
44
45
  const notBuiltInFields = fields.filter(
45
46
  ({ key }) => !BUILT_IN_FIELDS.some((b) => b.key == key)
46
47
  );
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,
48
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
49
+ fields.find((f) => f.key === "isActive") && /* @__PURE__ */ jsx(
50
+ Field,
55
51
  {
56
- id: "isActive",
57
- fieldName: "isActive",
58
- formData,
59
- setFormData,
60
- isLoading,
61
- isDisabled
52
+ htmlFor: "isActive",
53
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
54
+ formData["isActive"] ? /* @__PURE__ */ jsx(Eye, { className: "size-5" }) : /* @__PURE__ */ jsx(EyeOff, { className: "size-5" }),
55
+ t("ui.field.control-fields.is-active.text")
56
+ ] }),
57
+ children: /* @__PURE__ */ jsx(
58
+ Checkbox,
59
+ {
60
+ id: "isActive",
61
+ fieldName: "isActive",
62
+ formData,
63
+ setFormData,
64
+ isLoading,
65
+ isDisabled
66
+ }
67
+ )
62
68
  }
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,
69
+ ),
70
+ fields.find((f) => f.key === "index") && /* @__PURE__ */ jsx(
71
+ Field,
72
72
  {
73
- id: "index",
74
- formData,
75
- setFormData,
76
- isLoading,
77
- isDisabled,
78
- existingIndexes,
79
- availableIndex,
80
- isError: errors?.includes("index")
73
+ htmlFor: "index",
74
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
75
+ /* @__PURE__ */ jsx(Binary, { className: "size-5" }),
76
+ t("ui.field.control-fields.index.text")
77
+ ] }),
78
+ children: /* @__PURE__ */ jsx(
79
+ IndexField,
80
+ {
81
+ id: "index",
82
+ formData,
83
+ setFormData,
84
+ isLoading,
85
+ isDisabled,
86
+ existingIndexes,
87
+ availableIndex,
88
+ isError: errors?.includes("index")
89
+ }
90
+ )
81
91
  }
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,
92
+ ),
93
+ fields.find((f) => f.key === "slug") && /* @__PURE__ */ jsx(
94
+ Field,
91
95
  {
92
- id: "slug",
93
- formData,
94
- setFormData,
95
- isLoading,
96
- isDisabled,
97
- existingSlugs,
98
- isError: errors?.includes("slug")
96
+ htmlFor: "slug",
97
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
98
+ /* @__PURE__ */ jsx(MapPinCheckInside, { className: "size-5" }),
99
+ t("ui.field.control-fields.slug.text")
100
+ ] }),
101
+ children: /* @__PURE__ */ jsx(
102
+ SlugField,
103
+ {
104
+ id: "slug",
105
+ formData,
106
+ setFormData,
107
+ isLoading,
108
+ isDisabled,
109
+ existingSlugs,
110
+ isError: errors?.includes("slug")
111
+ }
112
+ )
99
113
  }
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,
114
+ ),
115
+ fields.find((f) => f.key === "isFeatured") && /* @__PURE__ */ jsx(
116
+ Field,
109
117
  {
110
- id: "isFeatured",
111
- fieldName: "isFeatured",
112
- formData,
113
- setFormData,
114
- isLoading,
115
- isDisabled
118
+ htmlFor: "isFeatured",
119
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
120
+ /* @__PURE__ */ jsx(Star, { className: "size-5" }),
121
+ t("ui.field.control-fields.is-featured.text")
122
+ ] }),
123
+ children: /* @__PURE__ */ jsx(
124
+ Checkbox,
125
+ {
126
+ id: "isFeatured",
127
+ fieldName: "isFeatured",
128
+ formData,
129
+ setFormData,
130
+ isLoading,
131
+ isDisabled
132
+ }
133
+ )
116
134
  }
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,
135
+ ),
136
+ fields.find((f) => f.key === "isShownOnHome") && /* @__PURE__ */ jsx(
137
+ Field,
126
138
  {
127
- id: "isShownOnHome",
128
- fieldName: "isShownOnHome",
129
- formData,
130
- setFormData,
131
- isLoading,
132
- isDisabled
139
+ htmlFor: "isShownOnHome",
140
+ label: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
141
+ /* @__PURE__ */ jsx(House, { className: "size-5" }),
142
+ t("ui.field.control-fields.is-shown-on-home.text")
143
+ ] }),
144
+ children: /* @__PURE__ */ jsx(
145
+ Checkbox,
146
+ {
147
+ id: "isShownOnHome",
148
+ fieldName: "isShownOnHome",
149
+ formData,
150
+ setFormData,
151
+ isLoading,
152
+ isDisabled
153
+ }
154
+ )
133
155
  }
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
- }));
156
+ ),
157
+ notBuiltInFields.map(({ key, label }) => {
158
+ return /* @__PURE__ */ jsx(Field, { htmlFor: key, label, children: /* @__PURE__ */ jsx(
159
+ Checkbox,
160
+ {
161
+ id: key,
162
+ fieldName: key,
163
+ formData,
164
+ setFormData,
165
+ isLoading,
166
+ isDisabled
167
+ }
168
+ ) }, key);
169
+ })
170
+ ] });
148
171
  }
149
172
 
150
173
  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,4 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { useTranslator } from 'intor/react';
2
3
  import 'react';
3
4
  import 'ua-parser-js';
@@ -30,7 +31,7 @@ function FieldBody({
30
31
  ...props
31
32
  }) {
32
33
  const { t } = useTranslator();
33
- return /* @__PURE__ */ React.createElement(
34
+ return /* @__PURE__ */ jsxs(
34
35
  "div",
35
36
  {
36
37
  className: cn(
@@ -40,34 +41,36 @@ function FieldBody({
40
41
  "flex items-center",
41
42
  "text-sm"
42
43
  ),
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
44
+ ...props,
45
+ children: [
46
+ /* @__PURE__ */ jsx(
47
+ "div",
48
+ {
49
+ className: cn(
50
+ "absolute size-full",
51
+ "dark:bg-input/30 bg-foreground/2 rounded-md",
52
+ backgroundClassName
53
+ )
54
+ }
55
+ ),
56
+ isLoading && /* @__PURE__ */ jsx("div", { className: "px-3", children: /* @__PURE__ */ jsx(Spinner, {}) }),
57
+ !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") }) }),
58
+ !isLoading && children && !isEmpty && /* @__PURE__ */ jsx(
59
+ "div",
60
+ {
61
+ className: cn(
62
+ "relative size-full",
63
+ "flex items-center gap-3",
64
+ "px-3 py-2",
65
+ "break-all",
66
+ (isDisabled || isLoading) && "opacity-50",
67
+ childrenClassName
68
+ ),
69
+ children
70
+ }
52
71
  )
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
- )
72
+ ]
73
+ }
71
74
  );
72
75
  }
73
76
 
@@ -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,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';
@@ -13,7 +14,7 @@ function Form({
13
14
  e.preventDefault();
14
15
  void onSubmit(e);
15
16
  };
16
- return /* @__PURE__ */ React.createElement("form", { className: cn(className), onSubmit: handleSubmit, ...props });
17
+ return /* @__PURE__ */ jsx("form", { className: cn(className), onSubmit: handleSubmit, ...props });
17
18
  }
18
19
 
19
20
  export { Form };