@kopexa/sight 17.12.0 → 17.13.0
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/chunk-5LLYOCGQ.mjs +153 -0
- package/dist/chunk-6IAHC3UK.mjs +1 -0
- package/dist/chunk-6XUZNN3X.mjs +1 -0
- package/dist/chunk-7KISSD3Q.mjs +1 -0
- package/dist/chunk-BJ7QPNKW.mjs +242 -0
- package/dist/chunk-CZNF6WPR.mjs +33 -0
- package/dist/chunk-DU3OVIBY.mjs +16 -0
- package/dist/chunk-DWZQIPCX.mjs +301 -0
- package/dist/chunk-EAJ3DTJ3.mjs +59 -0
- package/dist/chunk-FBTSAODG.mjs +25 -0
- package/dist/chunk-G57FFIKP.mjs +48 -0
- package/dist/chunk-GR3VEF4M.mjs +1 -0
- package/dist/chunk-HISY6ZIK.mjs +1 -0
- package/dist/chunk-HUHVPC6T.mjs +17 -0
- package/dist/chunk-HVOS7SXF.mjs +15 -0
- package/dist/chunk-PKG2E3MX.mjs +1 -0
- package/dist/chunk-POVIOFVF.mjs +18 -0
- package/dist/chunk-RK7G2GYB.mjs +45 -0
- package/dist/chunk-SHETEVHO.mjs +178 -0
- package/dist/chunk-UWC3Z7SY.mjs +1 -0
- package/dist/chunk-UWQG4HGJ.mjs +13 -0
- package/dist/chunk-XL2RCXMY.mjs +26 -0
- package/dist/chunk-XPDEN2RV.mjs +1 -0
- package/dist/components/blankstate/blankstate.d.mts +14 -0
- package/dist/components/blankstate/blankstate.d.ts +14 -0
- package/dist/components/blankstate/blankstate.js +69 -0
- package/dist/components/blankstate/blankstate.mjs +7 -0
- package/dist/components/blankstate/index.d.mts +4 -0
- package/dist/components/blankstate/index.d.ts +4 -0
- package/dist/components/blankstate/index.js +71 -0
- package/dist/components/blankstate/index.mjs +8 -0
- package/dist/components/code/code.d.mts +9 -0
- package/dist/components/code/code.d.ts +9 -0
- package/dist/components/code/code.js +49 -0
- package/dist/components/code/code.mjs +7 -0
- package/dist/components/code/index.d.mts +4 -0
- package/dist/components/code/index.d.ts +4 -0
- package/dist/components/code/index.js +51 -0
- package/dist/components/code/index.mjs +8 -0
- package/dist/components/dialog/dialog.d.mts +44 -0
- package/dist/components/dialog/dialog.d.ts +44 -0
- package/dist/components/dialog/dialog.js +213 -0
- package/dist/components/dialog/dialog.mjs +31 -0
- package/dist/components/dialog/index.d.mts +22 -0
- package/dist/components/dialog/index.d.ts +22 -0
- package/dist/components/dialog/index.js +232 -0
- package/dist/components/dialog/index.mjs +35 -0
- package/dist/components/dialog/namespace.d.mts +5 -0
- package/dist/components/dialog/namespace.d.ts +5 -0
- package/dist/components/dialog/namespace.js +213 -0
- package/dist/components/dialog/namespace.mjs +29 -0
- package/dist/components/dialog/transition.d.mts +5 -0
- package/dist/components/dialog/transition.d.ts +5 -0
- package/dist/components/dialog/transition.js +132 -0
- package/dist/components/dialog/transition.mjs +106 -0
- package/dist/components/file-upload/avatar-upload.d.mts +54 -0
- package/dist/components/file-upload/avatar-upload.d.ts +54 -0
- package/dist/components/file-upload/avatar-upload.js +841 -0
- package/dist/components/file-upload/avatar-upload.mjs +15 -0
- package/dist/components/file-upload/index.d.mts +5 -0
- package/dist/components/file-upload/index.d.ts +5 -0
- package/dist/components/file-upload/index.js +843 -0
- package/dist/components/file-upload/index.mjs +16 -0
- package/dist/components/file-upload/messages.d.mts +39 -0
- package/dist/components/file-upload/messages.d.ts +39 -0
- package/dist/components/file-upload/messages.js +68 -0
- package/dist/components/file-upload/messages.mjs +7 -0
- package/dist/components/file-upload/utils/data-url-to-file.d.mts +3 -0
- package/dist/components/file-upload/utils/data-url-to-file.d.ts +3 -0
- package/dist/components/file-upload/utils/data-url-to-file.js +38 -0
- package/dist/components/file-upload/utils/data-url-to-file.mjs +7 -0
- package/dist/components/file-upload/utils/format-accept-types.d.mts +8 -0
- package/dist/components/file-upload/utils/format-accept-types.d.ts +8 -0
- package/dist/components/file-upload/utils/format-accept-types.js +82 -0
- package/dist/components/file-upload/utils/format-accept-types.mjs +7 -0
- package/dist/components/file-upload/utils/is-image-like.d.mts +3 -0
- package/dist/components/file-upload/utils/is-image-like.d.ts +3 -0
- package/dist/components/file-upload/utils/is-image-like.js +36 -0
- package/dist/components/file-upload/utils/is-image-like.mjs +7 -0
- package/dist/components/index.d.mts +67 -0
- package/dist/components/index.d.ts +67 -0
- package/dist/components/index.js +1137 -0
- package/dist/components/index.mjs +92 -0
- package/dist/components/skeleton/index.d.mts +5 -0
- package/dist/components/skeleton/index.d.ts +5 -0
- package/dist/components/skeleton/index.js +53 -0
- package/dist/components/skeleton/index.mjs +12 -0
- package/dist/components/skeleton/skeleton-avatar.d.mts +9 -0
- package/dist/components/skeleton/skeleton-avatar.d.ts +9 -0
- package/dist/components/skeleton/skeleton-avatar.js +51 -0
- package/dist/components/skeleton/skeleton-avatar.mjs +8 -0
- package/dist/components/skeleton/skeleton.d.mts +7 -0
- package/dist/components/skeleton/skeleton.d.ts +7 -0
- package/dist/components/skeleton/skeleton.js +39 -0
- package/dist/components/skeleton/skeleton.mjs +7 -0
- package/dist/components/stat/index.d.mts +4 -0
- package/dist/components/stat/index.d.ts +4 -0
- package/dist/components/stat/index.js +186 -0
- package/dist/components/stat/index.mjs +24 -0
- package/dist/components/stat/stat.d.mts +36 -0
- package/dist/components/stat/stat.d.ts +36 -0
- package/dist/components/stat/stat.js +185 -0
- package/dist/components/stat/stat.mjs +24 -0
- package/dist/components/textarea/index.d.mts +4 -0
- package/dist/components/textarea/index.d.ts +4 -0
- package/dist/components/textarea/index.js +42 -0
- package/dist/components/textarea/index.mjs +8 -0
- package/dist/components/textarea/textarea.d.mts +8 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +40 -0
- package/dist/components/textarea/textarea.mjs +7 -0
- package/dist/hooks/index.d.mts +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +341 -0
- package/dist/hooks/index.mjs +9 -0
- package/dist/hooks/use-file-upload/index.d.mts +47 -0
- package/dist/hooks/use-file-upload/index.d.ts +47 -0
- package/dist/hooks/use-file-upload/index.js +340 -0
- package/dist/hooks/use-file-upload/index.mjs +9 -0
- package/dist/hooks/use-file-upload/messages.d.mts +19 -0
- package/dist/hooks/use-file-upload/messages.d.ts +19 -0
- package/dist/hooks/use-file-upload/messages.js +48 -0
- package/dist/hooks/use-file-upload/messages.mjs +7 -0
- package/dist/index.d.mts +14 -8
- package/dist/index.d.ts +14 -8
- package/dist/index.js +1108 -32
- package/dist/index.mjs +82 -18
- package/dist/index.ts.backup.d.mts +14 -8
- package/dist/index.ts.backup.d.ts +14 -8
- package/dist/index.ts.backup.js +1108 -32
- package/dist/index.ts.backup.mjs +82 -18
- package/package.json +60 -64
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/stat/stat.tsx
|
|
4
|
+
import { ArrowDown, ArrowUp } from "@kopexa/icons";
|
|
5
|
+
import { cn } from "@kopexa/shared-utils";
|
|
6
|
+
import { stat } from "@kopexa/theme";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function StatRoot({
|
|
9
|
+
className,
|
|
10
|
+
size,
|
|
11
|
+
trend,
|
|
12
|
+
children,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
const styles = stat({ size, trend });
|
|
16
|
+
return /* @__PURE__ */ jsx("dl", { "data-slot": "stat", className: cn(styles.root(), className), ...props, children });
|
|
17
|
+
}
|
|
18
|
+
function StatLabel({ className, children, ...props }) {
|
|
19
|
+
const styles = stat();
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"dt",
|
|
22
|
+
{
|
|
23
|
+
"data-slot": "stat-label",
|
|
24
|
+
className: cn(styles.label(), className),
|
|
25
|
+
...props,
|
|
26
|
+
children
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function StatValueText({
|
|
31
|
+
className,
|
|
32
|
+
size,
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
const styles = stat({ size });
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
"dd",
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "stat-value",
|
|
41
|
+
className: cn(styles.valueText(), className),
|
|
42
|
+
...props,
|
|
43
|
+
children
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function StatValueUnit({
|
|
48
|
+
className,
|
|
49
|
+
children,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
const styles = stat();
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
"data-slot": "stat-value-unit",
|
|
57
|
+
className: cn(styles.valueUnit(), className),
|
|
58
|
+
...props,
|
|
59
|
+
children
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function StatHelpText({
|
|
64
|
+
className,
|
|
65
|
+
children,
|
|
66
|
+
...props
|
|
67
|
+
}) {
|
|
68
|
+
const styles = stat();
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
"span",
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "stat-help-text",
|
|
73
|
+
className: cn(styles.helpText(), className),
|
|
74
|
+
...props,
|
|
75
|
+
children
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function StatUpIndicator({
|
|
80
|
+
className,
|
|
81
|
+
icon,
|
|
82
|
+
children,
|
|
83
|
+
...props
|
|
84
|
+
}) {
|
|
85
|
+
const styles = stat({ trend: "up" });
|
|
86
|
+
return /* @__PURE__ */ jsxs(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
"data-slot": "stat-indicator",
|
|
90
|
+
"data-type": "up",
|
|
91
|
+
className: cn(styles.indicator(), className),
|
|
92
|
+
...props,
|
|
93
|
+
children: [
|
|
94
|
+
icon != null ? icon : /* @__PURE__ */ jsx(ArrowUp, {}),
|
|
95
|
+
children
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
function StatDownIndicator({
|
|
101
|
+
className,
|
|
102
|
+
icon,
|
|
103
|
+
children,
|
|
104
|
+
...props
|
|
105
|
+
}) {
|
|
106
|
+
const styles = stat({ trend: "down" });
|
|
107
|
+
return /* @__PURE__ */ jsxs(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
"data-slot": "stat-indicator",
|
|
111
|
+
"data-type": "down",
|
|
112
|
+
className: cn(styles.indicator(), className),
|
|
113
|
+
...props,
|
|
114
|
+
children: [
|
|
115
|
+
icon != null ? icon : /* @__PURE__ */ jsx(ArrowDown, {}),
|
|
116
|
+
children
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
function StatGroup({ className, children, ...props }) {
|
|
122
|
+
return /* @__PURE__ */ jsx(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
"data-slot": "stat-group",
|
|
126
|
+
className: cn("flex flex-wrap justify-around gap-4", className),
|
|
127
|
+
...props,
|
|
128
|
+
children
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
var Stat = Object.assign(StatRoot, {
|
|
133
|
+
Root: StatRoot,
|
|
134
|
+
Label: StatLabel,
|
|
135
|
+
ValueText: StatValueText,
|
|
136
|
+
ValueUnit: StatValueUnit,
|
|
137
|
+
HelpText: StatHelpText,
|
|
138
|
+
UpIndicator: StatUpIndicator,
|
|
139
|
+
DownIndicator: StatDownIndicator,
|
|
140
|
+
Group: StatGroup
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
StatRoot,
|
|
145
|
+
StatLabel,
|
|
146
|
+
StatValueText,
|
|
147
|
+
StatValueUnit,
|
|
148
|
+
StatHelpText,
|
|
149
|
+
StatUpIndicator,
|
|
150
|
+
StatDownIndicator,
|
|
151
|
+
StatGroup,
|
|
152
|
+
Stat
|
|
153
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
dataUrlToFile
|
|
4
|
+
} from "./chunk-HVOS7SXF.mjs";
|
|
5
|
+
import {
|
|
6
|
+
formatAcceptedTypes
|
|
7
|
+
} from "./chunk-EAJ3DTJ3.mjs";
|
|
8
|
+
import {
|
|
9
|
+
isImageLike
|
|
10
|
+
} from "./chunk-UWQG4HGJ.mjs";
|
|
11
|
+
import {
|
|
12
|
+
Dialog
|
|
13
|
+
} from "./chunk-CZNF6WPR.mjs";
|
|
14
|
+
import {
|
|
15
|
+
messages
|
|
16
|
+
} from "./chunk-RK7G2GYB.mjs";
|
|
17
|
+
import {
|
|
18
|
+
useFileUpload
|
|
19
|
+
} from "./chunk-DWZQIPCX.mjs";
|
|
20
|
+
|
|
21
|
+
// src/components/file-upload/avatar-upload.tsx
|
|
22
|
+
import { Button, IconButton } from "@kopexa/button";
|
|
23
|
+
import { Callout } from "@kopexa/callout";
|
|
24
|
+
import { useSafeIntl } from "@kopexa/i18n";
|
|
25
|
+
import { CloseIcon, CropIcon, UserCircleIcon } from "@kopexa/icons";
|
|
26
|
+
import {
|
|
27
|
+
ImageCrop,
|
|
28
|
+
ImageCropApply,
|
|
29
|
+
ImageCropContent
|
|
30
|
+
} from "@kopexa/image-crop";
|
|
31
|
+
import { dataAttr, formatBytes } from "@kopexa/shared-utils";
|
|
32
|
+
import { avatarUpload } from "@kopexa/theme";
|
|
33
|
+
import { useCallback, useRef, useState } from "react";
|
|
34
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
35
|
+
var defaultMaxSize = 2 * 1024 * 1024;
|
|
36
|
+
var AvatarUpload = (props) => {
|
|
37
|
+
const {
|
|
38
|
+
maxSize = defaultMaxSize,
|
|
39
|
+
className,
|
|
40
|
+
onFileChange,
|
|
41
|
+
defaultAvatar,
|
|
42
|
+
orientation,
|
|
43
|
+
size,
|
|
44
|
+
shape,
|
|
45
|
+
accept = ".png,.jpg",
|
|
46
|
+
cropperEnabled = true,
|
|
47
|
+
cropAspect = 1,
|
|
48
|
+
cropMaxImageSize = defaultMaxSize,
|
|
49
|
+
onCroppedFile,
|
|
50
|
+
...rest
|
|
51
|
+
} = props;
|
|
52
|
+
const t = useSafeIntl();
|
|
53
|
+
const [cropOpen, setCropOpen] = useState(false);
|
|
54
|
+
const [cropSourceFile, setCropSourceFile] = useState(null);
|
|
55
|
+
const pendingOriginalId = useRef(null);
|
|
56
|
+
const [
|
|
57
|
+
{ files, isDragging, errors },
|
|
58
|
+
{
|
|
59
|
+
removeFile,
|
|
60
|
+
handleDragEnter,
|
|
61
|
+
handleDragLeave,
|
|
62
|
+
handleDragOver,
|
|
63
|
+
handleDrop,
|
|
64
|
+
openFileDialog,
|
|
65
|
+
getInputProps,
|
|
66
|
+
clearErrors,
|
|
67
|
+
addFiles
|
|
68
|
+
}
|
|
69
|
+
] = useFileUpload({
|
|
70
|
+
maxFiles: 1,
|
|
71
|
+
maxSize,
|
|
72
|
+
accept,
|
|
73
|
+
multiple: false,
|
|
74
|
+
onFilesChange: (files2) => {
|
|
75
|
+
onFileChange == null ? void 0 : onFileChange(files2[0] || null);
|
|
76
|
+
},
|
|
77
|
+
onFilesAdded: (added) => {
|
|
78
|
+
var _a;
|
|
79
|
+
if (!cropperEnabled) return;
|
|
80
|
+
const raw = (_a = added[0]) == null ? void 0 : _a.file;
|
|
81
|
+
if (raw instanceof File && isImageLike(raw)) {
|
|
82
|
+
pendingOriginalId.current = added[0].id;
|
|
83
|
+
setCropSourceFile(raw);
|
|
84
|
+
setCropOpen(true);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
const currentFile = files[0];
|
|
89
|
+
const previewUrl = (currentFile == null ? void 0 : currentFile.preview) || defaultAvatar;
|
|
90
|
+
const handleRemove = () => {
|
|
91
|
+
if (currentFile) {
|
|
92
|
+
removeFile(currentFile.id);
|
|
93
|
+
clearErrors();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const styles = avatarUpload({
|
|
97
|
+
size,
|
|
98
|
+
shape,
|
|
99
|
+
orientation
|
|
100
|
+
});
|
|
101
|
+
const typesLabel = formatAcceptedTypes(accept);
|
|
102
|
+
const handleCropCancel = useCallback(() => {
|
|
103
|
+
setCropOpen(false);
|
|
104
|
+
setCropSourceFile(null);
|
|
105
|
+
pendingOriginalId.current = null;
|
|
106
|
+
}, []);
|
|
107
|
+
const handleCropApply = useCallback(
|
|
108
|
+
async (croppedDataUrl) => {
|
|
109
|
+
if (!croppedDataUrl || !cropSourceFile) {
|
|
110
|
+
handleCropCancel();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const newFile = await dataUrlToFile(
|
|
114
|
+
croppedDataUrl,
|
|
115
|
+
cropSourceFile.name,
|
|
116
|
+
cropSourceFile.type
|
|
117
|
+
);
|
|
118
|
+
if (pendingOriginalId.current) {
|
|
119
|
+
removeFile(pendingOriginalId.current);
|
|
120
|
+
pendingOriginalId.current = null;
|
|
121
|
+
}
|
|
122
|
+
addFiles([newFile]);
|
|
123
|
+
onCroppedFile == null ? void 0 : onCroppedFile(newFile);
|
|
124
|
+
setCropOpen(false);
|
|
125
|
+
setCropSourceFile(null);
|
|
126
|
+
},
|
|
127
|
+
[cropSourceFile, addFiles, removeFile, onCroppedFile, handleCropCancel]
|
|
128
|
+
);
|
|
129
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
130
|
+
/* @__PURE__ */ jsxs(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
"data-slot": "avatar-upload",
|
|
134
|
+
className: styles.root({ className }),
|
|
135
|
+
...rest,
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ jsxs("div", { className: styles.previewAndText(), children: [
|
|
138
|
+
/* @__PURE__ */ jsxs("div", { className: styles.previewContainer(), children: [
|
|
139
|
+
/* @__PURE__ */ jsxs(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
type: "button",
|
|
143
|
+
"aria-label": previewUrl ? t.formatMessage(messages.change_avatar) : t.formatMessage(messages.upload_avatar),
|
|
144
|
+
"data-dragging": dataAttr(isDragging),
|
|
145
|
+
"data-hasimage": dataAttr(!!previewUrl),
|
|
146
|
+
className: styles.preview(),
|
|
147
|
+
onDragEnter: handleDragEnter,
|
|
148
|
+
onDragLeave: handleDragLeave,
|
|
149
|
+
onDragOver: handleDragOver,
|
|
150
|
+
onDrop: handleDrop,
|
|
151
|
+
onClick: openFileDialog,
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ jsx("input", { ...getInputProps(), className: "sr-only" }),
|
|
154
|
+
previewUrl ? /* @__PURE__ */ jsx(
|
|
155
|
+
"img",
|
|
156
|
+
{
|
|
157
|
+
src: previewUrl,
|
|
158
|
+
alt: "Avatar",
|
|
159
|
+
className: styles.previewImg()
|
|
160
|
+
}
|
|
161
|
+
) : /* @__PURE__ */ jsx("div", { className: styles.placeholderWrapper(), children: /* @__PURE__ */ jsx(UserCircleIcon, { className: styles.placeholder() }) })
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
currentFile && /* @__PURE__ */ jsx(
|
|
166
|
+
IconButton,
|
|
167
|
+
{
|
|
168
|
+
variant: "outline",
|
|
169
|
+
color: "default",
|
|
170
|
+
onClick: handleRemove,
|
|
171
|
+
size: "sm",
|
|
172
|
+
className: styles.removeButton(),
|
|
173
|
+
"aria-label": t.formatMessage(messages.remove_avatar),
|
|
174
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ jsxs("div", { className: styles.instructionsContainer(), children: [
|
|
179
|
+
/* @__PURE__ */ jsx("p", { className: styles.instructions(), children: currentFile ? t.formatMessage(messages.avatar_uploaded) : t.formatMessage(messages.upload_avatar) }),
|
|
180
|
+
/* @__PURE__ */ jsx("p", { className: styles.acceptedFiles(), children: t.formatMessage(messages.accepted_file_types, {
|
|
181
|
+
types: typesLabel || "-",
|
|
182
|
+
size: maxSize ? formatBytes(maxSize) : "none"
|
|
183
|
+
}) })
|
|
184
|
+
] })
|
|
185
|
+
] }),
|
|
186
|
+
errors.length > 0 && /* @__PURE__ */ jsx(Callout, { variant: "destructive", children: errors.map((error, index) => /* @__PURE__ */ jsx("p", { className: styles.errorItem(), children: error }, index.toString())) })
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
cropperEnabled && /* @__PURE__ */ jsx(
|
|
191
|
+
Dialog.Root,
|
|
192
|
+
{
|
|
193
|
+
open: cropOpen,
|
|
194
|
+
onOpenChange: (v) => !v ? handleCropCancel() : null,
|
|
195
|
+
size: "2xl",
|
|
196
|
+
children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
|
197
|
+
/* @__PURE__ */ jsx(Dialog.Header, { children: /* @__PURE__ */ jsx(Dialog.Title, { children: t.formatMessage(messages.change_avatar) }) }),
|
|
198
|
+
cropSourceFile && /* @__PURE__ */ jsxs(
|
|
199
|
+
ImageCrop,
|
|
200
|
+
{
|
|
201
|
+
aspect: cropAspect,
|
|
202
|
+
file: cropSourceFile,
|
|
203
|
+
maxImageSize: cropMaxImageSize,
|
|
204
|
+
onCrop: handleCropApply,
|
|
205
|
+
children: [
|
|
206
|
+
/* @__PURE__ */ jsx(Dialog.Body, { children: /* @__PURE__ */ jsx(ImageCropContent, { className: "max-w-md" }) }),
|
|
207
|
+
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
208
|
+
/* @__PURE__ */ jsx(
|
|
209
|
+
Dialog.CloseTrigger,
|
|
210
|
+
{
|
|
211
|
+
render: /* @__PURE__ */ jsx(
|
|
212
|
+
Button,
|
|
213
|
+
{
|
|
214
|
+
variant: "ghost",
|
|
215
|
+
color: "default",
|
|
216
|
+
startContent: /* @__PURE__ */ jsx(CloseIcon, {}),
|
|
217
|
+
children: t.formatMessage(messages.cancel)
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ jsx(
|
|
223
|
+
ImageCropApply,
|
|
224
|
+
{
|
|
225
|
+
color: "primary",
|
|
226
|
+
variant: "solid",
|
|
227
|
+
render: /* @__PURE__ */ jsx(Button, { startContent: /* @__PURE__ */ jsx(CropIcon, {}), children: t.formatMessage(messages.apply_crop) })
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
] })
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
] })
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
] });
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export {
|
|
241
|
+
AvatarUpload
|
|
242
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
DialogBody,
|
|
4
|
+
DialogCloseTrigger,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogDescription,
|
|
7
|
+
DialogFooter,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogOverlay,
|
|
10
|
+
DialogPortal,
|
|
11
|
+
DialogRoot,
|
|
12
|
+
DialogTitle,
|
|
13
|
+
DialogTrigger
|
|
14
|
+
} from "./chunk-SHETEVHO.mjs";
|
|
15
|
+
|
|
16
|
+
// src/components/dialog/index.ts
|
|
17
|
+
var Dialog = Object.assign(DialogRoot, {
|
|
18
|
+
Root: DialogRoot,
|
|
19
|
+
Body: DialogBody,
|
|
20
|
+
CloseTrigger: DialogCloseTrigger,
|
|
21
|
+
Content: DialogContent,
|
|
22
|
+
Description: DialogDescription,
|
|
23
|
+
Footer: DialogFooter,
|
|
24
|
+
Header: DialogHeader,
|
|
25
|
+
Overlay: DialogOverlay,
|
|
26
|
+
Portal: DialogPortal,
|
|
27
|
+
Title: DialogTitle,
|
|
28
|
+
Trigger: DialogTrigger
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
Dialog
|
|
33
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/skeleton/skeleton.tsx
|
|
4
|
+
import { skeleton } from "@kopexa/theme";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var Skeleton = (props) => {
|
|
7
|
+
const { className, children, ...rest } = props;
|
|
8
|
+
const styles = skeleton({
|
|
9
|
+
className
|
|
10
|
+
});
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: styles, ...rest, children });
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
Skeleton
|
|
16
|
+
};
|