@kopexa/sight 17.12.1 → 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,213 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/components/dialog/namespace.ts
|
|
22
|
+
var namespace_exports = {};
|
|
23
|
+
__export(namespace_exports, {
|
|
24
|
+
Body: () => DialogBody,
|
|
25
|
+
Close: () => DialogClose,
|
|
26
|
+
CloseTrigger: () => DialogCloseTrigger,
|
|
27
|
+
Content: () => DialogContent,
|
|
28
|
+
Description: () => DialogDescription,
|
|
29
|
+
Footer: () => DialogFooter,
|
|
30
|
+
Header: () => DialogHeader,
|
|
31
|
+
Overlay: () => DialogOverlay,
|
|
32
|
+
Portal: () => DialogPortal,
|
|
33
|
+
Root: () => DialogRoot,
|
|
34
|
+
Title: () => DialogTitle,
|
|
35
|
+
Trigger: () => DialogTrigger
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(namespace_exports);
|
|
38
|
+
|
|
39
|
+
// src/components/dialog/dialog.tsx
|
|
40
|
+
var import_dialog = require("@base-ui/react/dialog");
|
|
41
|
+
var import_icons = require("@kopexa/icons");
|
|
42
|
+
var import_react_utils = require("@kopexa/react-utils");
|
|
43
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
44
|
+
var import_theme = require("@kopexa/theme");
|
|
45
|
+
var import_use_controllable_state = require("@kopexa/use-controllable-state");
|
|
46
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
|
+
var [DialogProvider, useDialogContext] = (0, import_react_utils.createContext)();
|
|
48
|
+
var DialogRoot = (props) => {
|
|
49
|
+
const {
|
|
50
|
+
open: openProp,
|
|
51
|
+
onOpenChange,
|
|
52
|
+
size,
|
|
53
|
+
radius,
|
|
54
|
+
placement,
|
|
55
|
+
scrollBehavior,
|
|
56
|
+
...restProps
|
|
57
|
+
} = props;
|
|
58
|
+
const [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
59
|
+
value: openProp,
|
|
60
|
+
onChange: onOpenChange,
|
|
61
|
+
defaultValue: false
|
|
62
|
+
});
|
|
63
|
+
const styles = (0, import_theme.dialog)({ size, radius, placement, scrollBehavior });
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogProvider, { value: { styles, open, placement, size, radius }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
|
+
import_dialog.Dialog.Root,
|
|
66
|
+
{
|
|
67
|
+
"data-slot": "dialog",
|
|
68
|
+
open,
|
|
69
|
+
onOpenChange: (open2) => setOpen(open2),
|
|
70
|
+
...restProps
|
|
71
|
+
}
|
|
72
|
+
) });
|
|
73
|
+
};
|
|
74
|
+
function DialogTrigger({ ...props }) {
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
76
|
+
}
|
|
77
|
+
function DialogPortal({ ...props }) {
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Portal, { "data-slot": "dialog-portal", ...props });
|
|
79
|
+
}
|
|
80
|
+
function DialogClose({ ...props }) {
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Close, { "data-slot": "dialog-close", ...props });
|
|
82
|
+
}
|
|
83
|
+
function DialogOverlay({ className, ...props }) {
|
|
84
|
+
const { styles } = useDialogContext();
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
|
+
import_dialog.Dialog.Backdrop,
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "dialog-overlay",
|
|
89
|
+
className: (0, import_shared_utils.cn)(styles.overlay(), className),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function DialogContent({
|
|
95
|
+
className,
|
|
96
|
+
children,
|
|
97
|
+
showCloseButton = true,
|
|
98
|
+
...props
|
|
99
|
+
}) {
|
|
100
|
+
const { styles } = useDialogContext();
|
|
101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlay, {}),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
104
|
+
import_dialog.Dialog.Popup,
|
|
105
|
+
{
|
|
106
|
+
"data-slot": "dialog-content",
|
|
107
|
+
className: (0, import_shared_utils.cn)(styles.content(), className),
|
|
108
|
+
...props,
|
|
109
|
+
children: [
|
|
110
|
+
children,
|
|
111
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
112
|
+
import_dialog.Dialog.Close,
|
|
113
|
+
{
|
|
114
|
+
"data-slot": "dialog-close",
|
|
115
|
+
className: styles.close(),
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseIcon, {}),
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Close" })
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
function DialogHeader({ className, ...props }) {
|
|
128
|
+
const { styles } = useDialogContext();
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
"data-slot": "dialog-header",
|
|
133
|
+
className: styles.header({ className }),
|
|
134
|
+
...props
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
function DialogFooter({ className, ...props }) {
|
|
139
|
+
const { styles } = useDialogContext();
|
|
140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
"data-slot": "dialog-footer",
|
|
144
|
+
className: styles.footer({ className }),
|
|
145
|
+
...props
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function DialogBody({ className, ...props }) {
|
|
150
|
+
const { styles } = useDialogContext();
|
|
151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
"data-slot": "dialog-body",
|
|
155
|
+
className: styles.body({ className }),
|
|
156
|
+
...props
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
function DialogTitle({ className, ...props }) {
|
|
161
|
+
const { styles } = useDialogContext();
|
|
162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
+
import_dialog.Dialog.Title,
|
|
164
|
+
{
|
|
165
|
+
"data-slot": "dialog-title",
|
|
166
|
+
className: (0, import_shared_utils.cn)(styles.title(), className),
|
|
167
|
+
...props
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
function DialogDescription({
|
|
172
|
+
className,
|
|
173
|
+
...props
|
|
174
|
+
}) {
|
|
175
|
+
const { styles } = useDialogContext();
|
|
176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
177
|
+
import_dialog.Dialog.Description,
|
|
178
|
+
{
|
|
179
|
+
"data-slot": "dialog-description",
|
|
180
|
+
className: (0, import_shared_utils.cn)(styles.description(), className),
|
|
181
|
+
...props
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
function DialogCloseTrigger({
|
|
186
|
+
className,
|
|
187
|
+
...props
|
|
188
|
+
}) {
|
|
189
|
+
const { styles } = useDialogContext();
|
|
190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
191
|
+
import_dialog.Dialog.Close,
|
|
192
|
+
{
|
|
193
|
+
"data-slot": "dialog-close-trigger",
|
|
194
|
+
className: (0, import_shared_utils.cn)(styles.closeTrigger(), className),
|
|
195
|
+
...props
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
200
|
+
0 && (module.exports = {
|
|
201
|
+
Body,
|
|
202
|
+
Close,
|
|
203
|
+
CloseTrigger,
|
|
204
|
+
Content,
|
|
205
|
+
Description,
|
|
206
|
+
Footer,
|
|
207
|
+
Header,
|
|
208
|
+
Overlay,
|
|
209
|
+
Portal,
|
|
210
|
+
Root,
|
|
211
|
+
Title,
|
|
212
|
+
Trigger
|
|
213
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
DialogBody,
|
|
4
|
+
DialogClose,
|
|
5
|
+
DialogCloseTrigger,
|
|
6
|
+
DialogContent,
|
|
7
|
+
DialogDescription,
|
|
8
|
+
DialogFooter,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogOverlay,
|
|
11
|
+
DialogPortal,
|
|
12
|
+
DialogRoot,
|
|
13
|
+
DialogTitle,
|
|
14
|
+
DialogTrigger
|
|
15
|
+
} from "../../chunk-SHETEVHO.mjs";
|
|
16
|
+
export {
|
|
17
|
+
DialogBody as Body,
|
|
18
|
+
DialogClose as Close,
|
|
19
|
+
DialogCloseTrigger as CloseTrigger,
|
|
20
|
+
DialogContent as Content,
|
|
21
|
+
DialogDescription as Description,
|
|
22
|
+
DialogFooter as Footer,
|
|
23
|
+
DialogHeader as Header,
|
|
24
|
+
DialogOverlay as Overlay,
|
|
25
|
+
DialogPortal as Portal,
|
|
26
|
+
DialogRoot as Root,
|
|
27
|
+
DialogTitle as Title,
|
|
28
|
+
DialogTrigger as Trigger
|
|
29
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/components/dialog/transition.ts
|
|
22
|
+
var transition_exports = {};
|
|
23
|
+
__export(transition_exports, {
|
|
24
|
+
scaleInOut: () => scaleInOut
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(transition_exports);
|
|
27
|
+
|
|
28
|
+
// ../../utilities/motion-utils/src/transition-utils.ts
|
|
29
|
+
var TRANSITION_EASINGS = {
|
|
30
|
+
ease: [0.36, 0.66, 0.4, 1],
|
|
31
|
+
easeIn: [0.4, 0, 1, 1],
|
|
32
|
+
easeOut: [0, 0, 0.2, 1],
|
|
33
|
+
easeInOut: [0.4, 0, 0.2, 1],
|
|
34
|
+
spring: [0.155, 1.105, 0.295, 1.12],
|
|
35
|
+
springOut: [0.57, -0.15, 0.62, 0.07],
|
|
36
|
+
softSpring: [0.16, 1.11, 0.3, 1.02]
|
|
37
|
+
};
|
|
38
|
+
var TRANSITION_DEFAULTS = {
|
|
39
|
+
enter: {
|
|
40
|
+
duration: 0.2,
|
|
41
|
+
ease: TRANSITION_EASINGS.easeOut
|
|
42
|
+
},
|
|
43
|
+
exit: {
|
|
44
|
+
duration: 0.1,
|
|
45
|
+
ease: TRANSITION_EASINGS.easeIn
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var TRANSITION_VARIANTS = {
|
|
49
|
+
fade: {
|
|
50
|
+
enter: {
|
|
51
|
+
opacity: 1,
|
|
52
|
+
transition: {
|
|
53
|
+
duration: 0.4,
|
|
54
|
+
ease: TRANSITION_EASINGS.ease
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
exit: {
|
|
58
|
+
opacity: 0,
|
|
59
|
+
transition: {
|
|
60
|
+
duration: 0.3,
|
|
61
|
+
ease: TRANSITION_EASINGS.ease
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
scaleSpringOpacity: {
|
|
66
|
+
initial: {
|
|
67
|
+
opacity: 0,
|
|
68
|
+
transform: "scale(0.8)"
|
|
69
|
+
},
|
|
70
|
+
enter: {
|
|
71
|
+
opacity: 1,
|
|
72
|
+
transform: "scale(1)",
|
|
73
|
+
transition: {
|
|
74
|
+
type: "spring",
|
|
75
|
+
bounce: 0,
|
|
76
|
+
duration: 0.3
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
exit: {
|
|
80
|
+
opacity: 0,
|
|
81
|
+
transform: "scale(0.96)",
|
|
82
|
+
transition: {
|
|
83
|
+
ease: TRANSITION_EASINGS.easeOut,
|
|
84
|
+
bounce: 0,
|
|
85
|
+
duration: 0.15
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
scale: {
|
|
90
|
+
enter: { scale: 1 },
|
|
91
|
+
exit: { scale: 0.95 }
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/components/dialog/transition.ts
|
|
96
|
+
var scaleInOut = {
|
|
97
|
+
enter: {
|
|
98
|
+
scale: "var(--scale-enter)",
|
|
99
|
+
y: "var(--slide-enter)",
|
|
100
|
+
opacity: 1,
|
|
101
|
+
willChange: "auto",
|
|
102
|
+
transition: {
|
|
103
|
+
scale: {
|
|
104
|
+
duration: 0.4,
|
|
105
|
+
ease: TRANSITION_EASINGS.ease
|
|
106
|
+
},
|
|
107
|
+
opacity: {
|
|
108
|
+
duration: 0.4,
|
|
109
|
+
ease: TRANSITION_EASINGS.ease
|
|
110
|
+
},
|
|
111
|
+
y: {
|
|
112
|
+
type: "spring",
|
|
113
|
+
bounce: 0,
|
|
114
|
+
duration: 0.6
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
exit: {
|
|
119
|
+
scale: "var(--scale-exit)",
|
|
120
|
+
y: "var(--slide-exit)",
|
|
121
|
+
opacity: 0,
|
|
122
|
+
willChange: "transform",
|
|
123
|
+
transition: {
|
|
124
|
+
duration: 0.3,
|
|
125
|
+
ease: TRANSITION_EASINGS.ease
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
130
|
+
0 && (module.exports = {
|
|
131
|
+
scaleInOut
|
|
132
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// ../../utilities/motion-utils/src/transition-utils.ts
|
|
4
|
+
var TRANSITION_EASINGS = {
|
|
5
|
+
ease: [0.36, 0.66, 0.4, 1],
|
|
6
|
+
easeIn: [0.4, 0, 1, 1],
|
|
7
|
+
easeOut: [0, 0, 0.2, 1],
|
|
8
|
+
easeInOut: [0.4, 0, 0.2, 1],
|
|
9
|
+
spring: [0.155, 1.105, 0.295, 1.12],
|
|
10
|
+
springOut: [0.57, -0.15, 0.62, 0.07],
|
|
11
|
+
softSpring: [0.16, 1.11, 0.3, 1.02]
|
|
12
|
+
};
|
|
13
|
+
var TRANSITION_DEFAULTS = {
|
|
14
|
+
enter: {
|
|
15
|
+
duration: 0.2,
|
|
16
|
+
ease: TRANSITION_EASINGS.easeOut
|
|
17
|
+
},
|
|
18
|
+
exit: {
|
|
19
|
+
duration: 0.1,
|
|
20
|
+
ease: TRANSITION_EASINGS.easeIn
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var TRANSITION_VARIANTS = {
|
|
24
|
+
fade: {
|
|
25
|
+
enter: {
|
|
26
|
+
opacity: 1,
|
|
27
|
+
transition: {
|
|
28
|
+
duration: 0.4,
|
|
29
|
+
ease: TRANSITION_EASINGS.ease
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
exit: {
|
|
33
|
+
opacity: 0,
|
|
34
|
+
transition: {
|
|
35
|
+
duration: 0.3,
|
|
36
|
+
ease: TRANSITION_EASINGS.ease
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
scaleSpringOpacity: {
|
|
41
|
+
initial: {
|
|
42
|
+
opacity: 0,
|
|
43
|
+
transform: "scale(0.8)"
|
|
44
|
+
},
|
|
45
|
+
enter: {
|
|
46
|
+
opacity: 1,
|
|
47
|
+
transform: "scale(1)",
|
|
48
|
+
transition: {
|
|
49
|
+
type: "spring",
|
|
50
|
+
bounce: 0,
|
|
51
|
+
duration: 0.3
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
exit: {
|
|
55
|
+
opacity: 0,
|
|
56
|
+
transform: "scale(0.96)",
|
|
57
|
+
transition: {
|
|
58
|
+
ease: TRANSITION_EASINGS.easeOut,
|
|
59
|
+
bounce: 0,
|
|
60
|
+
duration: 0.15
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
scale: {
|
|
65
|
+
enter: { scale: 1 },
|
|
66
|
+
exit: { scale: 0.95 }
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// src/components/dialog/transition.ts
|
|
71
|
+
var scaleInOut = {
|
|
72
|
+
enter: {
|
|
73
|
+
scale: "var(--scale-enter)",
|
|
74
|
+
y: "var(--slide-enter)",
|
|
75
|
+
opacity: 1,
|
|
76
|
+
willChange: "auto",
|
|
77
|
+
transition: {
|
|
78
|
+
scale: {
|
|
79
|
+
duration: 0.4,
|
|
80
|
+
ease: TRANSITION_EASINGS.ease
|
|
81
|
+
},
|
|
82
|
+
opacity: {
|
|
83
|
+
duration: 0.4,
|
|
84
|
+
ease: TRANSITION_EASINGS.ease
|
|
85
|
+
},
|
|
86
|
+
y: {
|
|
87
|
+
type: "spring",
|
|
88
|
+
bounce: 0,
|
|
89
|
+
duration: 0.6
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
exit: {
|
|
94
|
+
scale: "var(--scale-exit)",
|
|
95
|
+
y: "var(--slide-exit)",
|
|
96
|
+
opacity: 0,
|
|
97
|
+
willChange: "transform",
|
|
98
|
+
transition: {
|
|
99
|
+
duration: 0.3,
|
|
100
|
+
ease: TRANSITION_EASINGS.ease
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
scaleInOut
|
|
106
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { AvatarUploadVariants } from '@kopexa/theme';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
import { FileWithPreview } from '../../hooks/use-file-upload/index.mjs';
|
|
5
|
+
|
|
6
|
+
interface AvatarUploadBaseProps {
|
|
7
|
+
/**
|
|
8
|
+
* Maximum allowed file size in bytes.
|
|
9
|
+
* @default 2MB.
|
|
10
|
+
*/
|
|
11
|
+
maxSize?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Additional CSS class names applied to the root element.
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Callback fired when the selected file changes (after upload or removal).
|
|
18
|
+
* Provides the FileWithPreview object or null if cleared.
|
|
19
|
+
*/
|
|
20
|
+
onFileChange?: (file: FileWithPreview | null) => void;
|
|
21
|
+
/**
|
|
22
|
+
* URL for a default/fallback avatar image shown when no file is uploaded.
|
|
23
|
+
*/
|
|
24
|
+
defaultAvatar?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Accepted file types for the upload input (e.g. ".png,.jpg").
|
|
27
|
+
* @default ".png,.jpg"
|
|
28
|
+
*/
|
|
29
|
+
accept?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Enables the image crop dialog if the selected file is an image.
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
cropperEnabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Aspect ratio for the ImageCrop component (e.g. 1 for square cropping).
|
|
37
|
+
* @default 1
|
|
38
|
+
*/
|
|
39
|
+
cropAspect?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Maximum image size forwarded to the ImageCrop component (in bytes).
|
|
42
|
+
* Defaults to the same as maxSize (2MB).
|
|
43
|
+
*/
|
|
44
|
+
cropMaxImageSize?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Callback fired after cropping is completed.
|
|
47
|
+
* Provides the newly created cropped File object.
|
|
48
|
+
*/
|
|
49
|
+
onCroppedFile?: (file: File) => void;
|
|
50
|
+
}
|
|
51
|
+
type AvatarUploadProps = ComponentProps<"div"> & AvatarUploadVariants & AvatarUploadBaseProps;
|
|
52
|
+
declare const AvatarUpload: (props: AvatarUploadProps) => react_jsx_runtime.JSX.Element;
|
|
53
|
+
|
|
54
|
+
export { AvatarUpload, type AvatarUploadProps };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { AvatarUploadVariants } from '@kopexa/theme';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
import { FileWithPreview } from '../../hooks/use-file-upload/index.js';
|
|
5
|
+
|
|
6
|
+
interface AvatarUploadBaseProps {
|
|
7
|
+
/**
|
|
8
|
+
* Maximum allowed file size in bytes.
|
|
9
|
+
* @default 2MB.
|
|
10
|
+
*/
|
|
11
|
+
maxSize?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Additional CSS class names applied to the root element.
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Callback fired when the selected file changes (after upload or removal).
|
|
18
|
+
* Provides the FileWithPreview object or null if cleared.
|
|
19
|
+
*/
|
|
20
|
+
onFileChange?: (file: FileWithPreview | null) => void;
|
|
21
|
+
/**
|
|
22
|
+
* URL for a default/fallback avatar image shown when no file is uploaded.
|
|
23
|
+
*/
|
|
24
|
+
defaultAvatar?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Accepted file types for the upload input (e.g. ".png,.jpg").
|
|
27
|
+
* @default ".png,.jpg"
|
|
28
|
+
*/
|
|
29
|
+
accept?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Enables the image crop dialog if the selected file is an image.
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
cropperEnabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Aspect ratio for the ImageCrop component (e.g. 1 for square cropping).
|
|
37
|
+
* @default 1
|
|
38
|
+
*/
|
|
39
|
+
cropAspect?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Maximum image size forwarded to the ImageCrop component (in bytes).
|
|
42
|
+
* Defaults to the same as maxSize (2MB).
|
|
43
|
+
*/
|
|
44
|
+
cropMaxImageSize?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Callback fired after cropping is completed.
|
|
47
|
+
* Provides the newly created cropped File object.
|
|
48
|
+
*/
|
|
49
|
+
onCroppedFile?: (file: File) => void;
|
|
50
|
+
}
|
|
51
|
+
type AvatarUploadProps = ComponentProps<"div"> & AvatarUploadVariants & AvatarUploadBaseProps;
|
|
52
|
+
declare const AvatarUpload: (props: AvatarUploadProps) => react_jsx_runtime.JSX.Element;
|
|
53
|
+
|
|
54
|
+
export { AvatarUpload, type AvatarUploadProps };
|