@yimingliao/cms 0.0.129 → 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.
- package/dist/export/client/index.js +2 -1
- package/dist/export/server/index.js +0 -6
- package/dist/export/server/r2/index.js +0 -19
- package/dist/export/server/sftp/index.js +0 -18
- package/dist/src/client/infrastructure/contexts/admin.js +5 -4
- package/dist/src/client/infrastructure/contexts/theme.js +5 -5
- package/dist/src/client/infrastructure/toast/error-display.js +15 -3
- package/dist/src/client/interfaces/components/shadcn/avatar.js +5 -4
- package/dist/src/client/interfaces/components/shadcn/button.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/card.js +9 -8
- package/dist/src/client/interfaces/components/shadcn/collapsible.js +4 -3
- package/dist/src/client/interfaces/components/shadcn/dropdown-menu.js +36 -29
- package/dist/src/client/interfaces/components/shadcn/input-group.js +8 -7
- package/dist/src/client/interfaces/components/shadcn/input.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/label.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/pagination.js +21 -18
- package/dist/src/client/interfaces/components/shadcn/select.js +47 -40
- package/dist/src/client/interfaces/components/shadcn/separator.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/sheet.js +36 -27
- package/dist/src/client/interfaces/components/shadcn/sidebar.js +120 -105
- package/dist/src/client/interfaces/components/shadcn/skeleton.js +2 -1
- package/dist/src/client/interfaces/components/shadcn/spinner.js +2 -1
- package/dist/src/client/interfaces/components/shadcn/textarea.js +3 -2
- package/dist/src/client/interfaces/components/shadcn/tooltip.js +13 -10
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/list-cards-container.js +35 -23
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/page-size-selector.js +20 -14
- package/dist/src/client/interfaces/components/ui/blocks/list-cards-container/pagination.js +35 -26
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header-title.js +10 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/page-header.js +21 -15
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch-create.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/batch.js +19 -14
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/create.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/edit.js +2 -1
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/index.js +34 -29
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/show.js +43 -37
- package/dist/src/client/interfaces/components/ui/blocks/page-header/presets/trash.js +24 -18
- package/dist/src/client/interfaces/components/ui/buttons/button.js +8 -4
- package/dist/src/client/interfaces/components/ui/buttons/return-button.js +5 -4
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expand-bar.js +9 -6
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list-content.js +14 -8
- package/dist/src/client/interfaces/components/ui/features/expandable-list/expandable-list.js +22 -17
- package/dist/src/client/interfaces/components/ui/form/containers/fields-container.js +5 -4
- package/dist/src/client/interfaces/components/ui/form/containers/main-fields.js +5 -4
- package/dist/src/client/interfaces/components/ui/form/containers/side-fields.js +5 -4
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-display.js +80 -57
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields-input.js +114 -91
- package/dist/src/client/interfaces/components/ui/form/control-fields/control-fields.js +4 -3
- package/dist/src/client/interfaces/components/ui/form/field-body.js +31 -28
- package/dist/src/client/interfaces/components/ui/form/field.js +12 -1
- package/dist/src/client/interfaces/components/ui/form/form.js +2 -1
- package/dist/src/client/interfaces/components/ui/form/index-field.js +49 -42
- package/dist/src/client/interfaces/components/ui/form/slug-field.js +45 -38
- package/dist/src/client/interfaces/components/ui/inputs/array-input.js +63 -52
- package/dist/src/client/interfaces/components/ui/inputs/checkbox.js +41 -38
- package/dist/src/client/interfaces/components/ui/inputs/input.js +20 -17
- package/dist/src/client/interfaces/components/ui/inputs/password-input.js +6 -5
- package/dist/src/client/interfaces/components/ui/inputs/search-input.js +6 -5
- package/dist/src/client/interfaces/components/ui/inputs/select.js +19 -13
- package/dist/src/client/interfaces/components/ui/inputs/textarea.js +3 -2
- package/dist/src/client/interfaces/components/ui/layouts/content-container.js +5 -4
- package/dist/src/client/interfaces/components/ui/layouts/layout-skeleton.js +20 -7
- package/dist/src/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +8 -1
- package/dist/src/client/interfaces/components/ui/layouts/navbar/nav-user.js +60 -34
- package/dist/src/client/interfaces/components/ui/layouts/navbar/navbar.js +39 -26
- package/dist/src/client/interfaces/components/ui/layouts/navbar/sign-out-button.js +6 -2
- package/dist/src/client/interfaces/components/ui/layouts/navbar/theme-selector.js +22 -1
- package/dist/src/client/interfaces/components/ui/layouts/sidebar/nav-main.js +43 -27
- package/dist/src/client/interfaces/pages/auth/change-password.js +81 -70
- package/dist/src/client/interfaces/pages/auth/email-unverified.js +39 -21
- package/dist/src/client/interfaces/pages/auth/forgot-password.js +41 -26
- package/dist/src/client/interfaces/pages/auth/reset-password.js +60 -51
- package/dist/src/client/interfaces/pages/auth/sign-in.js +46 -37
- package/dist/src/client/interfaces/pages/auth/verify-email.js +2 -1
- package/dist/types/export/server/r2/index.d.ts +1 -1
- package/dist/types/export/server/r2/index.d.ts.map +1 -1
- package/dist/types/export/server/sftp/index.d.ts +1 -1
- package/dist/types/export/server/sftp/index.d.ts.map +1 -1
- package/dist/types/src/server/index.d.ts +1 -1
- package/dist/types/src/server/index.d.ts.map +1 -1
- package/dist/types/src/server/infrastructure/index.d.ts +1 -1
- package/dist/types/src/server/infrastructure/index.d.ts.map +1 -1
- package/dist/types/src/server/infrastructure/storage/index.d.ts +0 -2
- package/dist/types/src/server/infrastructure/storage/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import 'mime-types';
|
|
2
3
|
import { ensureArray } from '../../../../../shared/utils/ensure-array.js';
|
|
3
4
|
import 'react';
|
|
@@ -44,49 +45,55 @@ function IndexField({
|
|
|
44
45
|
if (!setFormData) return;
|
|
45
46
|
setFormData((p) => ({ ...p, index: availableIndex }));
|
|
46
47
|
};
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
id: isIndexActive ? id : void 0,
|
|
62
|
-
fieldName: "index",
|
|
63
|
-
value: index || 1,
|
|
64
|
-
setFormData,
|
|
65
|
-
type: "number",
|
|
66
|
-
min: 1,
|
|
67
|
-
required: isIndexActive,
|
|
68
|
-
isDisabled: !isIndexActive || isDisabled,
|
|
69
|
-
className: cn(!isIndexActive && "text-transparent"),
|
|
70
|
-
inputGroupClassName: cn(
|
|
71
|
-
isIndexActive ? "opacity-100" : "opacity-50 cursor-not-allowed"
|
|
48
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
Checkbox,
|
|
52
|
+
{
|
|
53
|
+
id: isIndexActive ? void 0 : id,
|
|
54
|
+
fieldName: "isIndexActive",
|
|
55
|
+
formData,
|
|
56
|
+
setFormData,
|
|
57
|
+
isLoading,
|
|
58
|
+
isDisabled,
|
|
59
|
+
onClick: toggleCheckbox
|
|
60
|
+
}
|
|
72
61
|
),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
62
|
+
!isDisplay ? /* @__PURE__ */ jsx(
|
|
63
|
+
Input,
|
|
64
|
+
{
|
|
65
|
+
id: isIndexActive ? id : void 0,
|
|
66
|
+
fieldName: "index",
|
|
67
|
+
value: index || 1,
|
|
68
|
+
setFormData,
|
|
69
|
+
type: "number",
|
|
70
|
+
min: 1,
|
|
71
|
+
required: isIndexActive,
|
|
72
|
+
isDisabled: !isIndexActive || isDisabled,
|
|
73
|
+
className: cn(!isIndexActive && "text-transparent"),
|
|
74
|
+
inputGroupClassName: cn(
|
|
75
|
+
isIndexActive ? "opacity-100" : "opacity-50 cursor-not-allowed"
|
|
76
|
+
),
|
|
77
|
+
isError
|
|
78
|
+
}
|
|
79
|
+
) : /* @__PURE__ */ jsx(
|
|
80
|
+
FieldBody,
|
|
81
|
+
{
|
|
82
|
+
isEmpty: !isIndexActive,
|
|
83
|
+
backgroundClassName: "!bg-base-200",
|
|
84
|
+
children: index
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] }),
|
|
88
|
+
!isDisplay && /* @__PURE__ */ jsx("div", { className: "mx-2", children: /* @__PURE__ */ jsx(
|
|
89
|
+
ExpandableList,
|
|
90
|
+
{
|
|
91
|
+
isDisabled: !isIndexActive,
|
|
92
|
+
item: index,
|
|
93
|
+
items: ensureArray(existingIndexes)
|
|
94
|
+
}
|
|
95
|
+
) })
|
|
96
|
+
] });
|
|
90
97
|
}
|
|
91
98
|
|
|
92
99
|
export { IndexField };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import 'mime-types';
|
|
2
3
|
import { ensureArray } from '../../../../../shared/utils/ensure-array.js';
|
|
3
4
|
import 'react';
|
|
@@ -43,45 +44,51 @@ function SlugField({
|
|
|
43
44
|
if (!setFormData) return;
|
|
44
45
|
setFormData((p) => ({ ...p, slug: null }));
|
|
45
46
|
};
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
id: isSlugActive ? id : void 0,
|
|
62
|
-
fieldName: "slug",
|
|
63
|
-
value: slug,
|
|
64
|
-
setFormData,
|
|
65
|
-
required: isSlugActive,
|
|
66
|
-
isDisabled: !isSlugActive || isDisabled,
|
|
67
|
-
onKeyDown: (e) => {
|
|
68
|
-
if (e.key === "Enter") return e.preventDefault();
|
|
69
|
-
},
|
|
70
|
-
className: cn(
|
|
71
|
-
"resize-none break-all",
|
|
72
|
-
!isSlugActive && "text-transparent"
|
|
47
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
Checkbox,
|
|
51
|
+
{
|
|
52
|
+
id: isSlugActive ? void 0 : id,
|
|
53
|
+
fieldName: "isSlugActive",
|
|
54
|
+
formData,
|
|
55
|
+
setFormData,
|
|
56
|
+
isLoading,
|
|
57
|
+
isDisabled,
|
|
58
|
+
onClick: toggleCheckbox,
|
|
59
|
+
className: "mt-2"
|
|
60
|
+
}
|
|
73
61
|
),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
62
|
+
!isDisplay ? /* @__PURE__ */ jsx(
|
|
63
|
+
Textarea,
|
|
64
|
+
{
|
|
65
|
+
id: isSlugActive ? id : void 0,
|
|
66
|
+
fieldName: "slug",
|
|
67
|
+
value: slug,
|
|
68
|
+
setFormData,
|
|
69
|
+
required: isSlugActive,
|
|
70
|
+
isDisabled: !isSlugActive || isDisabled,
|
|
71
|
+
onKeyDown: (e) => {
|
|
72
|
+
if (e.key === "Enter") return e.preventDefault();
|
|
73
|
+
},
|
|
74
|
+
className: cn(
|
|
75
|
+
"resize-none break-all",
|
|
76
|
+
!isSlugActive && "text-transparent"
|
|
77
|
+
),
|
|
78
|
+
isError: isUnavailable || isError
|
|
79
|
+
}
|
|
80
|
+
) : /* @__PURE__ */ jsx(FieldBody, { isEmpty: !isSlugActive, backgroundClassName: "!bg-base-200", children: slug })
|
|
81
|
+
] }),
|
|
82
|
+
!isDisplay && /* @__PURE__ */ jsx("div", { className: "mx-2", children: /* @__PURE__ */ jsx(
|
|
83
|
+
ExpandableList,
|
|
84
|
+
{
|
|
85
|
+
isDisabled: !isSlugActive,
|
|
86
|
+
isUnique: true,
|
|
87
|
+
item: slug,
|
|
88
|
+
items: ensureArray(existingSlugs)
|
|
89
|
+
}
|
|
90
|
+
) })
|
|
91
|
+
] });
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
export { SlugField };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { CircleX, CirclePlus } from 'lucide-react';
|
|
2
3
|
import 'react';
|
|
3
4
|
import 'ua-parser-js';
|
|
@@ -38,60 +39,70 @@ function ArrayInput({
|
|
|
38
39
|
const errorIndexes = new Set(
|
|
39
40
|
errors.filter((e) => e.startsWith(fieldName ?? "")).map((e) => e.split(".").pop()).map(Number)
|
|
40
41
|
);
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children: values.map((value, index) => {
|
|
42
43
|
const isError = errorIndexes.has(index);
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
e.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
type: "button",
|
|
69
|
-
size: "icon-sm",
|
|
70
|
-
className: "rounded-sm",
|
|
71
|
-
onClick: () => {
|
|
72
|
-
if (!setFormData || !fieldName) return;
|
|
73
|
-
const copy = values.filter((_, i) => i !== index);
|
|
74
|
-
setFormData((p) => ({ ...p, [fieldName]: copy }));
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
/* @__PURE__ */ React.createElement(CircleX, { className: "text-destructive" })
|
|
78
|
-
), /* @__PURE__ */ React.createElement(
|
|
79
|
-
Button,
|
|
80
|
-
{
|
|
81
|
-
variant: "outline",
|
|
82
|
-
type: "button",
|
|
83
|
-
size: "icon-sm",
|
|
84
|
-
className: "rounded-sm",
|
|
85
|
-
onClick: () => {
|
|
86
|
-
if (!setFormData || !fieldName) return;
|
|
87
|
-
const copy = [...values];
|
|
88
|
-
copy.splice(index + 1, 0, "");
|
|
89
|
-
setFormData((p) => ({ ...p, [fieldName]: copy }));
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-center absolute top-0 left-0 z-10 h-full", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-10 pl-0.5 text-center text-sm opacity-50", children: Array.isArray(rawValue) && rawValue.length === 0 ? "0" : index + 1 }),
|
|
47
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical" })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
Textarea,
|
|
51
|
+
{
|
|
52
|
+
disabled: isDisabled,
|
|
53
|
+
placeholder: isLoading ? "" : placeholder,
|
|
54
|
+
value,
|
|
55
|
+
onChange: (e) => {
|
|
56
|
+
if (!setFormData || !fieldName) return;
|
|
57
|
+
const copy = [...values];
|
|
58
|
+
copy[index] = e.target.value;
|
|
59
|
+
setFormData((p) => ({ ...p, [fieldName]: copy }));
|
|
60
|
+
},
|
|
61
|
+
onKeyDown: (e) => {
|
|
62
|
+
if (e.key === "Enter" && !isResizable) {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
isError,
|
|
67
|
+
className: cn("pr-20 pl-13", !isResizable && "resize-none"),
|
|
68
|
+
...props
|
|
90
69
|
}
|
|
91
|
-
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
|
|
94
|
-
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-center absolute top-1 right-1 gap-1", children: [
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
Button,
|
|
74
|
+
{
|
|
75
|
+
variant: "outline",
|
|
76
|
+
type: "button",
|
|
77
|
+
size: "icon-sm",
|
|
78
|
+
className: "rounded-sm",
|
|
79
|
+
onClick: () => {
|
|
80
|
+
if (!setFormData || !fieldName) return;
|
|
81
|
+
const copy = values.filter((_, i) => i !== index);
|
|
82
|
+
setFormData((p) => ({ ...p, [fieldName]: copy }));
|
|
83
|
+
},
|
|
84
|
+
children: /* @__PURE__ */ jsx(CircleX, { className: "text-destructive" })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
Button,
|
|
89
|
+
{
|
|
90
|
+
variant: "outline",
|
|
91
|
+
type: "button",
|
|
92
|
+
size: "icon-sm",
|
|
93
|
+
className: "rounded-sm",
|
|
94
|
+
onClick: () => {
|
|
95
|
+
if (!setFormData || !fieldName) return;
|
|
96
|
+
const copy = [...values];
|
|
97
|
+
copy.splice(index + 1, 0, "");
|
|
98
|
+
setFormData((p) => ({ ...p, [fieldName]: copy }));
|
|
99
|
+
},
|
|
100
|
+
children: /* @__PURE__ */ jsx(CirclePlus, { className: "text-success" })
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] })
|
|
104
|
+
] }, index);
|
|
105
|
+
}) });
|
|
95
106
|
}
|
|
96
107
|
|
|
97
108
|
export { ArrayInput };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import 'react';
|
|
2
3
|
import 'ua-parser-js';
|
|
3
4
|
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
@@ -31,7 +32,7 @@ function Checkbox({
|
|
|
31
32
|
}) {
|
|
32
33
|
isDisabled = isDisabled || isLoading || isDisplay;
|
|
33
34
|
const isChecked = !!formData?.[fieldName ?? ""];
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ jsxs(
|
|
35
36
|
"div",
|
|
36
37
|
{
|
|
37
38
|
className: cn(
|
|
@@ -44,44 +45,46 @@ function Checkbox({
|
|
|
44
45
|
"shadow-inner",
|
|
45
46
|
!isChecked || isLoading ? "bg-secondary" : "bg-success",
|
|
46
47
|
"transition"
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
),
|
|
64
|
-
isLoading && /* @__PURE__ */ React.createElement("span", { className: "absolute top-1 left-1" }, /* @__PURE__ */ React.createElement(Spinner, null)),
|
|
65
|
-
/* @__PURE__ */ React.createElement(
|
|
66
|
-
"input",
|
|
67
|
-
{
|
|
68
|
-
type: "checkbox",
|
|
69
|
-
onChange: (e) => {
|
|
70
|
-
if (!setFormData || !fieldName) return;
|
|
71
|
-
setFormData((p) => ({ ...p, [fieldName]: e.target.checked }));
|
|
72
|
-
},
|
|
73
|
-
checked: isChecked,
|
|
74
|
-
disabled: isDisabled,
|
|
75
|
-
className: cn(
|
|
76
|
-
"absolute top-0 left-0",
|
|
77
|
-
"h-full w-full",
|
|
78
|
-
"rounded-full",
|
|
79
|
-
"opacity-0",
|
|
80
|
-
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
48
|
+
),
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: cn(
|
|
54
|
+
"size-4",
|
|
55
|
+
"rounded-full",
|
|
56
|
+
"bg-white",
|
|
57
|
+
"shadow",
|
|
58
|
+
isChecked && "translate-x-6",
|
|
59
|
+
isLoading && "opacity-0",
|
|
60
|
+
!isDisabled && "group-hover:scale-95 group-active:scale-90",
|
|
61
|
+
"duration-200"
|
|
62
|
+
)
|
|
63
|
+
}
|
|
81
64
|
),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
65
|
+
isLoading && /* @__PURE__ */ jsx("span", { className: "absolute top-1 left-1", children: /* @__PURE__ */ jsx(Spinner, {}) }),
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
"input",
|
|
68
|
+
{
|
|
69
|
+
type: "checkbox",
|
|
70
|
+
onChange: (e) => {
|
|
71
|
+
if (!setFormData || !fieldName) return;
|
|
72
|
+
setFormData((p) => ({ ...p, [fieldName]: e.target.checked }));
|
|
73
|
+
},
|
|
74
|
+
checked: isChecked,
|
|
75
|
+
disabled: isDisabled,
|
|
76
|
+
className: cn(
|
|
77
|
+
"absolute top-0 left-0",
|
|
78
|
+
"h-full w-full",
|
|
79
|
+
"rounded-full",
|
|
80
|
+
"opacity-0",
|
|
81
|
+
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
82
|
+
),
|
|
83
|
+
...props
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
]
|
|
87
|
+
}
|
|
85
88
|
);
|
|
86
89
|
}
|
|
87
90
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import 'react';
|
|
2
3
|
import 'ua-parser-js';
|
|
3
4
|
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
@@ -30,26 +31,28 @@ function Input({
|
|
|
30
31
|
children,
|
|
31
32
|
...props
|
|
32
33
|
}) {
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ jsxs(
|
|
34
35
|
InputGroup,
|
|
35
36
|
{
|
|
36
37
|
"data-disabled": isDisabled || isLoading,
|
|
37
|
-
className: cn("h-10", inputGroupClassName)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
className: cn("h-10", inputGroupClassName),
|
|
39
|
+
children: [
|
|
40
|
+
isLoading ? /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(Spinner, {}) }) : /* @__PURE__ */ jsx(
|
|
41
|
+
InputGroupInput,
|
|
42
|
+
{
|
|
43
|
+
disabled: isDisabled || isLoading,
|
|
44
|
+
"aria-invalid": isError,
|
|
45
|
+
onChange: (e) => {
|
|
46
|
+
if (!setFormData || !fieldName) return;
|
|
47
|
+
setFormData((p) => ({ ...p, [fieldName]: e.target.value }));
|
|
48
|
+
},
|
|
49
|
+
className: cn("h-10", className),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
children
|
|
54
|
+
]
|
|
55
|
+
}
|
|
53
56
|
);
|
|
54
57
|
}
|
|
55
58
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { Eye, EyeOff } from 'lucide-react';
|
|
2
3
|
import { useState } from 'react';
|
|
3
4
|
import '@radix-ui/react-avatar';
|
|
@@ -21,16 +22,16 @@ function PasswordInput({
|
|
|
21
22
|
...props
|
|
22
23
|
}) {
|
|
23
24
|
const [showPassword, setShowPassword] = useState(false);
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ jsx(Input, { type: showPassword ? "text" : "password", ...props, children: /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(
|
|
25
26
|
InputGroupButton,
|
|
26
27
|
{
|
|
27
28
|
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
28
29
|
title: showPassword ? "Hide password" : "Show password",
|
|
29
30
|
size: "icon-xs",
|
|
30
|
-
onClick: () => setShowPassword((prev) => !prev)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)));
|
|
31
|
+
onClick: () => setShowPassword((prev) => !prev),
|
|
32
|
+
children: showPassword ? /* @__PURE__ */ jsx(Eye, {}) : /* @__PURE__ */ jsx(EyeOff, {})
|
|
33
|
+
}
|
|
34
|
+
) }) });
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export { PasswordInput };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useTranslator } from 'intor/react';
|
|
2
3
|
import { Search } from 'lucide-react';
|
|
3
4
|
import { useRef, useState } from 'react';
|
|
@@ -38,7 +39,7 @@ function SearchInput({
|
|
|
38
39
|
setInputValue(e.target.value);
|
|
39
40
|
if (!isComposingRef.current) setSearchString(e.target.value);
|
|
40
41
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ jsx("div", { className: "relative size-full", children: /* @__PURE__ */ jsx(
|
|
42
43
|
Input,
|
|
43
44
|
{
|
|
44
45
|
isDisabled,
|
|
@@ -49,10 +50,10 @@ function SearchInput({
|
|
|
49
50
|
onCompositionStart: () => isComposingRef.current = true,
|
|
50
51
|
onCompositionEnd: handleCompositionEnd,
|
|
51
52
|
className: "w-full pr-9",
|
|
52
|
-
...props
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
));
|
|
53
|
+
...props,
|
|
54
|
+
children: /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: isLoading ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(Search, {}) })
|
|
55
|
+
}
|
|
56
|
+
) });
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
export { SearchInput };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import 'react';
|
|
2
3
|
import 'ua-parser-js';
|
|
3
4
|
import { cn } from '../../../../applications/shadcn/utils.js';
|
|
@@ -29,7 +30,7 @@ function Select({
|
|
|
29
30
|
children,
|
|
30
31
|
...props
|
|
31
32
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ jsxs(
|
|
33
34
|
Select$1,
|
|
34
35
|
{
|
|
35
36
|
onValueChange: (value) => {
|
|
@@ -37,17 +38,22 @@ function Select({
|
|
|
37
38
|
setFormData((p) => ({ ...p, [fieldName]: value }));
|
|
38
39
|
},
|
|
39
40
|
disabled: isDisabled || isLoading,
|
|
40
|
-
...props
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
...props,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
SelectTrigger,
|
|
45
|
+
{
|
|
46
|
+
className: cn("w-full", className),
|
|
47
|
+
disabled: isDisabled || isLoading,
|
|
48
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder })
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(SelectContent, { children: /* @__PURE__ */ jsxs(SelectGroup, { children: [
|
|
52
|
+
label && /* @__PURE__ */ jsx(SelectLabel, { children: label }),
|
|
53
|
+
children
|
|
54
|
+
] }) })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
51
57
|
);
|
|
52
58
|
}
|
|
53
59
|
function Option({
|
|
@@ -55,7 +61,7 @@ function Option({
|
|
|
55
61
|
isDisabled = false,
|
|
56
62
|
children
|
|
57
63
|
}) {
|
|
58
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ jsx(SelectItem, { value, disabled: isDisabled, children });
|
|
59
65
|
}
|
|
60
66
|
|
|
61
67
|
export { Option, Select };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import { useRef, useEffect } from 'react';
|
|
2
3
|
import '@radix-ui/react-avatar';
|
|
3
4
|
import 'ua-parser-js';
|
|
@@ -39,7 +40,7 @@ function Textarea({
|
|
|
39
40
|
if (!textareaRef.current) return;
|
|
40
41
|
resetHeight(textareaRef.current);
|
|
41
42
|
}, [props.value, isLoading]);
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ jsx(Fragment, { children: isLoading ? /* @__PURE__ */ jsx(InputGroup, { "data-disabled": isDisabled, className: "h-10", children: /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(Spinner, {}) }) }) : /* @__PURE__ */ jsx(
|
|
43
44
|
Textarea$1,
|
|
44
45
|
{
|
|
45
46
|
ref: textareaRef,
|
|
@@ -53,7 +54,7 @@ function Textarea({
|
|
|
53
54
|
},
|
|
54
55
|
...props
|
|
55
56
|
}
|
|
56
|
-
));
|
|
57
|
+
) });
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
export { Textarea };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { useTranslator } from 'intor/react';
|
|
2
3
|
import 'react';
|
|
3
4
|
import 'ua-parser-js';
|
|
@@ -14,7 +15,7 @@ function ContentContainer({
|
|
|
14
15
|
}) {
|
|
15
16
|
const { t } = useTranslator();
|
|
16
17
|
const ABOVE_HEIGHT = NAVBAR_HEIGHT + PAGE_HEADER_HEIGHT;
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
18
19
|
"div",
|
|
19
20
|
{
|
|
20
21
|
style: {
|
|
@@ -27,9 +28,9 @@ function ContentContainer({
|
|
|
27
28
|
"px-6 pt-6",
|
|
28
29
|
isFixHeight ? "pb-6" : "flex-1 pb-64"
|
|
29
30
|
),
|
|
30
|
-
...props
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
...props,
|
|
32
|
+
children: isNotFound ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: t("ui.no-data.text") }) : children
|
|
33
|
+
}
|
|
33
34
|
);
|
|
34
35
|
}
|
|
35
36
|
|