@mci-ui/mci-ui 0.0.87 → 0.0.89
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/index.css +1 -1
- package/dist/shared/ui/MciModal/MciModal.js +30 -28
- package/dist/shared/ui/mciAccordion/MciAccordion.js +97 -64
- package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +45 -25
- package/dist/shared/ui/mciButton/MciButton.js +39 -31
- package/dist/shared/ui/mciCheck/MciCheck.js +86 -76
- package/dist/shared/ui/mciDrawer/MciDrawer.js +78 -54
- package/dist/shared/ui/mciInput/MciInput.js +39 -40
- package/dist/shared/ui/mciLoader/MciLoader.js +14 -14
- package/dist/shared/ui/mciPagination/MciPagination.js +28 -18
- package/dist/shared/ui/mciPicker/MciPicker.js +53 -53
- package/dist/shared/ui/mciSelect/MciSelect.js +42 -41
- package/dist/shared/ui/mciTable/MciTable.js +97 -90
- package/dist/shared/ui/mciTable/MciTableClamp2.js +4 -3
- package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +100 -79
- package/dist/shared/ui/mciTabs/MciTabs.js +66 -55
- package/dist/shared/ui/mciToggle/MciToggle.js +51 -43
- package/dist/shared/ui/mciUpload/MciUpload.js +129 -107
- package/dist/types/shared/types/mci-table.types.d.ts +2 -0
- package/dist/types/shared/types/ui/accordion.types.d.ts +1 -0
- package/dist/types/shared/types/ui/breadcrumb.types.d.ts +1 -1
- package/dist/types/shared/types/ui/button.types.d.ts +1 -1
- package/dist/types/shared/types/ui/check.types.d.ts +1 -1
- package/dist/types/shared/types/ui/drawer.types.d.ts +2 -0
- package/dist/types/shared/types/ui/loader.types.d.ts +1 -1
- package/dist/types/shared/types/ui/pagination.types.d.ts +1 -1
- package/dist/types/shared/types/ui/toggle.types.d.ts +1 -1
- package/dist/types/shared/types/ui/upload.types.d.ts +1 -1
- package/dist/types/shared/ui/mciAccordion/MciAccordion.d.ts +5 -3
- package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -1
- package/dist/types/shared/ui/mciTable/MciTable.d.ts +1 -1
- package/dist/types/shared/ui/mciTable/MciTableColumnsPanel.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Upload as le, File as
|
|
1
|
+
import { jsxs as o, jsx as t, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { Upload as le, File as oe, Star2 as se, Eye as ne } from "@solar-icons/react";
|
|
3
3
|
import ae from "../../../assets/icons/close.svg.js";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as O, useRef as C, useMemo as T, useCallback as c, useEffect as ie } from "react";
|
|
5
5
|
import { uploadLanguages as ce } from "../../lib/uploadLanguage.js";
|
|
6
|
-
import { cn as
|
|
7
|
-
import { buildSecureAccept as de, getAllowedFormatsHint as
|
|
8
|
-
const
|
|
6
|
+
import { cn as s } from "../../lib/utils.js";
|
|
7
|
+
import { buildSecureAccept as de, getAllowedFormatsHint as ge, validateFileSize as ue, validateFileType as be, createPreview as pe, getFileIcon as me, formatFileSize as he } from "./mci-upload.utils.js";
|
|
8
|
+
const xe = {
|
|
9
9
|
blue: {
|
|
10
10
|
dropBorder: "border-blue-200 hover:border-blue-300",
|
|
11
11
|
dropBg: "bg-blue-50/40 hover:bg-blue-50/60",
|
|
@@ -18,17 +18,28 @@ const fe = {
|
|
|
18
18
|
fileIconDoc: "bg-green-50 text-green-600"
|
|
19
19
|
},
|
|
20
20
|
yellow: {
|
|
21
|
-
dropBorder: "border-yellow-
|
|
22
|
-
dropBg: "bg-yellow-50/
|
|
23
|
-
dropActive: "border-yellow-500 bg-yellow-
|
|
24
|
-
iconWrap: "text-yellow-
|
|
21
|
+
dropBorder: "border-yellow-300 hover:border-yellow-400",
|
|
22
|
+
dropBg: "bg-yellow-50/60 hover:bg-yellow-100/60",
|
|
23
|
+
dropActive: "border-yellow-500 bg-yellow-100/80",
|
|
24
|
+
iconWrap: "text-yellow-600",
|
|
25
25
|
title: "text-yellow-700",
|
|
26
26
|
hint: "text-slate-500",
|
|
27
|
-
progressFill: "bg-yellow-
|
|
27
|
+
progressFill: "bg-yellow-500",
|
|
28
28
|
fileIconImg: "bg-blue-50 text-blue-600",
|
|
29
29
|
fileIconDoc: "bg-green-50 text-green-600"
|
|
30
|
+
},
|
|
31
|
+
orange: {
|
|
32
|
+
dropBorder: "border-orange-200 hover:border-orange-300",
|
|
33
|
+
dropBg: "bg-orange-50/40 hover:bg-orange-50/60",
|
|
34
|
+
dropActive: "border-orange-600 bg-orange-50",
|
|
35
|
+
iconWrap: "text-orange-600",
|
|
36
|
+
title: "text-orange-600",
|
|
37
|
+
hint: "text-slate-500",
|
|
38
|
+
progressFill: "bg-orange-600",
|
|
39
|
+
fileIconImg: "bg-orange-50 text-orange-600",
|
|
40
|
+
fileIconDoc: "bg-green-50 text-green-600"
|
|
30
41
|
}
|
|
31
|
-
},
|
|
42
|
+
}, fe = {
|
|
32
43
|
blue: {
|
|
33
44
|
dropBorder: "border-blue-800 hover:border-blue-700",
|
|
34
45
|
dropBg: "bg-blue-950/40 hover:bg-blue-950/60",
|
|
@@ -41,137 +52,148 @@ const fe = {
|
|
|
41
52
|
fileIconDoc: "bg-green-950 text-green-400"
|
|
42
53
|
},
|
|
43
54
|
yellow: {
|
|
44
|
-
dropBorder: "border-yellow-
|
|
45
|
-
dropBg: "bg-yellow-950/
|
|
46
|
-
dropActive: "border-yellow-
|
|
47
|
-
iconWrap: "text-yellow-
|
|
48
|
-
title: "text-yellow-
|
|
55
|
+
dropBorder: "border-yellow-700 hover:border-yellow-600",
|
|
56
|
+
dropBg: "bg-yellow-950/45 hover:bg-yellow-950/65",
|
|
57
|
+
dropActive: "border-yellow-500 bg-yellow-950/70",
|
|
58
|
+
iconWrap: "text-yellow-300",
|
|
59
|
+
title: "text-yellow-300",
|
|
49
60
|
hint: "text-slate-400",
|
|
50
|
-
progressFill: "bg-yellow-
|
|
61
|
+
progressFill: "bg-yellow-400",
|
|
51
62
|
fileIconImg: "bg-blue-950 text-blue-400",
|
|
52
63
|
fileIconDoc: "bg-green-950 text-green-400"
|
|
64
|
+
},
|
|
65
|
+
orange: {
|
|
66
|
+
dropBorder: "border-orange-800 hover:border-orange-700",
|
|
67
|
+
dropBg: "bg-orange-950/40 hover:bg-orange-950/60",
|
|
68
|
+
dropActive: "border-orange-600 bg-orange-950/60",
|
|
69
|
+
iconWrap: "text-orange-400",
|
|
70
|
+
title: "text-orange-400",
|
|
71
|
+
hint: "text-slate-400",
|
|
72
|
+
progressFill: "bg-orange-600",
|
|
73
|
+
fileIconImg: "bg-orange-950 text-orange-400",
|
|
74
|
+
fileIconDoc: "bg-green-950 text-green-400"
|
|
53
75
|
}
|
|
54
|
-
},
|
|
76
|
+
}, Be = ({
|
|
55
77
|
multiple: y = !1,
|
|
56
78
|
accept: h = "*/*",
|
|
57
79
|
maxSize: N = 10,
|
|
58
80
|
maxFiles: D = 5,
|
|
59
|
-
disabled:
|
|
81
|
+
disabled: g = !1,
|
|
60
82
|
label: W,
|
|
61
|
-
required:
|
|
83
|
+
required: H = !1,
|
|
62
84
|
error: F,
|
|
63
|
-
className:
|
|
64
|
-
onFilesChange:
|
|
85
|
+
className: z,
|
|
86
|
+
onFilesChange: x,
|
|
65
87
|
onUpload: w,
|
|
66
88
|
showPreview: _ = !0,
|
|
67
89
|
locale: q = "uz",
|
|
68
90
|
showFileTypeIcon: K = !0,
|
|
69
|
-
variant: R = "
|
|
91
|
+
variant: R = "orange",
|
|
70
92
|
customValidator: U,
|
|
71
93
|
darkMode: i = !1
|
|
72
94
|
}) => {
|
|
73
|
-
const [
|
|
95
|
+
const [b, f] = O([]), [$, L] = O(!1), [I, P] = O(!1), A = C(null), n = ce[q], u = T(() => i ? fe[R] : xe[R], [R, i]), G = T(() => de(h), [h]), J = T(() => ge(h), [h]), v = C(/* @__PURE__ */ new Map()), B = c((e) => {
|
|
74
96
|
const l = v.current.get(e);
|
|
75
97
|
l && (URL.revokeObjectURL(l), v.current.delete(e));
|
|
76
|
-
}, []),
|
|
98
|
+
}, []), j = c(() => {
|
|
77
99
|
for (const e of v.current.values())
|
|
78
100
|
URL.revokeObjectURL(e);
|
|
79
101
|
v.current.clear();
|
|
80
102
|
}, []);
|
|
81
103
|
ie(() => () => {
|
|
82
|
-
|
|
83
|
-
}, [
|
|
104
|
+
j();
|
|
105
|
+
}, [j]);
|
|
84
106
|
const Q = c((e) => {
|
|
85
107
|
let l = v.current.get(e.id);
|
|
86
|
-
l || (l = URL.createObjectURL(e.file), v.current.set(e.id, l), setTimeout(() =>
|
|
87
|
-
}, [
|
|
108
|
+
l || (l = URL.createObjectURL(e.file), v.current.set(e.id, l), setTimeout(() => B(e.id), 5 * 6e4)), window.open(l, "_blank", "noopener,noreferrer");
|
|
109
|
+
}, [B]), E = c(
|
|
88
110
|
async (e) => {
|
|
89
111
|
const l = Array.from(e), d = [];
|
|
90
112
|
for (const r of l) {
|
|
91
|
-
if (
|
|
113
|
+
if (b.length + d.length >= D) {
|
|
92
114
|
alert(n.maxFilesError(D));
|
|
93
115
|
break;
|
|
94
116
|
}
|
|
95
|
-
if (!
|
|
117
|
+
if (!ue(r, N)) {
|
|
96
118
|
alert(n.fileSizeError(r.name, N));
|
|
97
119
|
continue;
|
|
98
120
|
}
|
|
99
|
-
const a =
|
|
121
|
+
const a = be(r, h);
|
|
100
122
|
if (!a.isValid) {
|
|
101
123
|
a.reason === "blocked" ? alert(n.blockedFileTypeError(r.name)) : alert(n.fileTypeError(r.name));
|
|
102
124
|
continue;
|
|
103
125
|
}
|
|
104
126
|
if (U) {
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
alert(
|
|
127
|
+
const S = U(r);
|
|
128
|
+
if (S) {
|
|
129
|
+
alert(S);
|
|
108
130
|
continue;
|
|
109
131
|
}
|
|
110
132
|
}
|
|
111
|
-
const
|
|
133
|
+
const p = await pe(r), m = w ? "uploading" : "success", re = w ? 0 : 100;
|
|
112
134
|
d.push({
|
|
113
135
|
id: Math.random().toString(36).substr(2, 9),
|
|
114
136
|
file: r,
|
|
115
|
-
preview:
|
|
137
|
+
preview: p,
|
|
116
138
|
progress: re,
|
|
117
|
-
status:
|
|
139
|
+
status: m
|
|
118
140
|
});
|
|
119
141
|
}
|
|
120
142
|
if (d.length > 0) {
|
|
121
|
-
const r = y ? [...
|
|
122
|
-
if (
|
|
123
|
-
|
|
143
|
+
const r = y ? [...b, ...d] : d;
|
|
144
|
+
if (f(r), x?.(r.map((a) => a.file)), w) {
|
|
145
|
+
P(!0);
|
|
124
146
|
try {
|
|
125
|
-
const a = r.map((
|
|
126
|
-
...
|
|
127
|
-
progress: Math.min(100, (
|
|
147
|
+
const a = r.map((p, m) => ({
|
|
148
|
+
...p,
|
|
149
|
+
progress: Math.min(100, (m + 1) / r.length * 100)
|
|
128
150
|
}));
|
|
129
|
-
|
|
130
|
-
(
|
|
131
|
-
...
|
|
151
|
+
f(a), await w(a), f(
|
|
152
|
+
(p) => p.map((m) => ({
|
|
153
|
+
...m,
|
|
132
154
|
status: "success",
|
|
133
155
|
progress: 100
|
|
134
156
|
}))
|
|
135
157
|
);
|
|
136
158
|
} catch (a) {
|
|
137
|
-
|
|
138
|
-
(
|
|
139
|
-
...
|
|
159
|
+
f(
|
|
160
|
+
(p) => p.map((m) => ({
|
|
161
|
+
...m,
|
|
140
162
|
status: "error",
|
|
141
163
|
error: a instanceof Error ? a.message : n.uploadFailed
|
|
142
164
|
}))
|
|
143
165
|
);
|
|
144
166
|
} finally {
|
|
145
|
-
|
|
167
|
+
P(!1);
|
|
146
168
|
}
|
|
147
169
|
}
|
|
148
170
|
}
|
|
149
171
|
},
|
|
150
172
|
[
|
|
151
|
-
|
|
173
|
+
b,
|
|
152
174
|
D,
|
|
153
175
|
U,
|
|
154
176
|
n,
|
|
155
177
|
h,
|
|
156
178
|
N,
|
|
157
179
|
y,
|
|
158
|
-
|
|
180
|
+
x,
|
|
159
181
|
w
|
|
160
182
|
]
|
|
161
183
|
), V = c(
|
|
162
184
|
(e) => {
|
|
163
|
-
e.preventDefault(),
|
|
185
|
+
e.preventDefault(), g || L(!0);
|
|
164
186
|
},
|
|
165
|
-
[
|
|
187
|
+
[g]
|
|
166
188
|
), X = c((e) => {
|
|
167
189
|
e.preventDefault(), L(!1);
|
|
168
190
|
}, []), Y = c(
|
|
169
191
|
(e) => {
|
|
170
|
-
if (e.preventDefault(), L(!1),
|
|
192
|
+
if (e.preventDefault(), L(!1), g) return;
|
|
171
193
|
const l = e.dataTransfer.files;
|
|
172
194
|
l.length > 0 && E(l);
|
|
173
195
|
},
|
|
174
|
-
[
|
|
196
|
+
[g, E]
|
|
175
197
|
), Z = c(
|
|
176
198
|
(e) => {
|
|
177
199
|
const l = e.target.files;
|
|
@@ -180,40 +202,40 @@ const fe = {
|
|
|
180
202
|
[E]
|
|
181
203
|
), M = c(
|
|
182
204
|
(e) => {
|
|
183
|
-
|
|
205
|
+
B(e), f((l) => {
|
|
184
206
|
const d = l.filter((r) => r.id !== e);
|
|
185
|
-
return
|
|
207
|
+
return x?.(d.map((r) => r.file)), d;
|
|
186
208
|
});
|
|
187
209
|
},
|
|
188
|
-
[
|
|
210
|
+
[x, B]
|
|
189
211
|
), ee = c(() => {
|
|
190
|
-
|
|
191
|
-
}, [
|
|
212
|
+
j(), f([]), x?.([]);
|
|
213
|
+
}, [x, j]), te = c(() => {
|
|
192
214
|
A.current?.click();
|
|
193
215
|
}, []);
|
|
194
|
-
return /* @__PURE__ */
|
|
195
|
-
W && /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ o("div", { className: s("w-full", z), children: [
|
|
217
|
+
W && /* @__PURE__ */ o(
|
|
196
218
|
"label",
|
|
197
219
|
{
|
|
198
|
-
className:
|
|
220
|
+
className: s(
|
|
199
221
|
"mb-2 block text-base font-medium",
|
|
200
222
|
F ? "text-red-600" : i ? "text-slate-300" : "text-slate-700"
|
|
201
223
|
),
|
|
202
224
|
children: [
|
|
203
225
|
W,
|
|
204
|
-
|
|
226
|
+
H && /* @__PURE__ */ t("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
|
|
205
227
|
]
|
|
206
228
|
}
|
|
207
229
|
),
|
|
208
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ o(
|
|
209
231
|
"div",
|
|
210
232
|
{
|
|
211
|
-
className:
|
|
233
|
+
className: s(
|
|
212
234
|
"group relative flex min-h-[180px] w-full cursor-pointer items-center justify-center rounded-2xl border border-dashed p-6 text-center transition-all duration-300",
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
$ &&
|
|
216
|
-
|
|
235
|
+
u.dropBorder,
|
|
236
|
+
u.dropBg,
|
|
237
|
+
$ && u.dropActive,
|
|
238
|
+
g && "cursor-not-allowed opacity-60",
|
|
217
239
|
F && (i ? "border-red-500 bg-red-950/30" : "border-red-600 bg-red-50/30")
|
|
218
240
|
),
|
|
219
241
|
onDragOver: V,
|
|
@@ -229,53 +251,53 @@ const fe = {
|
|
|
229
251
|
multiple: y,
|
|
230
252
|
accept: G,
|
|
231
253
|
onChange: Z,
|
|
232
|
-
disabled:
|
|
254
|
+
disabled: g,
|
|
233
255
|
className: "hidden"
|
|
234
256
|
}
|
|
235
257
|
),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */ t("div", { className:
|
|
238
|
-
/* @__PURE__ */ t("p", { className:
|
|
239
|
-
/* @__PURE__ */ t("p", { className:
|
|
258
|
+
/* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-3", children: [
|
|
259
|
+
/* @__PURE__ */ t("div", { className: s("flex h-12 w-12 items-center justify-center rounded-xl", u.iconWrap), children: /* @__PURE__ */ t(le, { size: 20 }) }),
|
|
260
|
+
/* @__PURE__ */ t("p", { className: s("text-base font-medium", u.title), children: n.dropHereTitle }),
|
|
261
|
+
/* @__PURE__ */ t("p", { className: s("text-sm font-normal", u.hint), children: n.fileRequirements(y, D, N, J) })
|
|
240
262
|
] })
|
|
241
263
|
]
|
|
242
264
|
}
|
|
243
265
|
),
|
|
244
|
-
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
266
|
+
b.length > 0 && /* @__PURE__ */ o("div", { className: "mt-4 space-y-3", children: [
|
|
267
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
268
|
+
/* @__PURE__ */ o("span", { className: s("text-sm font-medium", i ? "text-slate-300" : "text-slate-700"), children: [
|
|
247
269
|
n.selectedFiles,
|
|
248
270
|
" (",
|
|
249
|
-
|
|
271
|
+
b.length,
|
|
250
272
|
")"
|
|
251
273
|
] }),
|
|
252
|
-
|
|
274
|
+
b.length > 1 && /* @__PURE__ */ t(
|
|
253
275
|
"button",
|
|
254
276
|
{
|
|
255
277
|
type: "button",
|
|
256
278
|
onClick: ee,
|
|
257
|
-
disabled:
|
|
258
|
-
className: "text-sm font-medium text-red-600 disabled:opacity-50",
|
|
279
|
+
disabled: g || I,
|
|
280
|
+
className: "cursor-pointer text-sm font-medium text-red-600 disabled:cursor-not-allowed disabled:opacity-50",
|
|
259
281
|
children: n.clearAll
|
|
260
282
|
}
|
|
261
283
|
)
|
|
262
284
|
] }),
|
|
263
|
-
/* @__PURE__ */ t("div", { className: "space-y-3", children:
|
|
264
|
-
const d = !!e.preview ?
|
|
265
|
-
return /* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ t("div", { className: "space-y-3", children: b.map((e) => {
|
|
286
|
+
const d = !!e.preview ? u.fileIconImg : u.fileIconDoc, r = g || I || e.status === "uploading";
|
|
287
|
+
return /* @__PURE__ */ o(
|
|
266
288
|
"div",
|
|
267
289
|
{
|
|
268
|
-
className:
|
|
290
|
+
className: s(
|
|
269
291
|
"flex items-center justify-between rounded-2xl border p-4",
|
|
270
292
|
i ? "border-neutral-700" : "border-slate-200",
|
|
271
293
|
e.status === "error" && (i ? "border-red-500" : "border-red-600")
|
|
272
294
|
),
|
|
273
295
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-4", children: [
|
|
275
297
|
/* @__PURE__ */ t(
|
|
276
298
|
"div",
|
|
277
299
|
{
|
|
278
|
-
className:
|
|
300
|
+
className: s(
|
|
279
301
|
"flex h-14 w-14 items-center justify-center rounded-2xl",
|
|
280
302
|
d
|
|
281
303
|
),
|
|
@@ -286,31 +308,31 @@ const fe = {
|
|
|
286
308
|
alt: e.file.name,
|
|
287
309
|
className: "h-10 w-10 rounded-xl object-cover"
|
|
288
310
|
}
|
|
289
|
-
) : K ?
|
|
311
|
+
) : K ? me(e.file) : /* @__PURE__ */ t(oe, { className: "h-6 w-6 text-slate-500" })
|
|
290
312
|
}
|
|
291
313
|
),
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
/* @__PURE__ */ t("p", { className:
|
|
294
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ o("div", { className: "min-w-0", children: [
|
|
315
|
+
/* @__PURE__ */ t("p", { className: s("truncate text-lg font-semibold", i ? "text-slate-100" : "text-primary"), children: e.file.name }),
|
|
316
|
+
/* @__PURE__ */ o("div", { className: s("mt-1 flex flex-wrap items-center gap-2 text-sm", i ? "text-slate-400" : "text-slate-500"), children: [
|
|
295
317
|
/* @__PURE__ */ t("span", { children: he(e.file.size) }),
|
|
296
|
-
e.status === "uploading" && /* @__PURE__ */
|
|
318
|
+
e.status === "uploading" && /* @__PURE__ */ o(k, { children: [
|
|
297
319
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */ t(
|
|
320
|
+
/* @__PURE__ */ o("span", { className: "inline-flex items-center", children: [
|
|
321
|
+
/* @__PURE__ */ t(se, { className: "mr-1 h-5 w-5 animate-spin" }),
|
|
300
322
|
n.uploading
|
|
301
323
|
] })
|
|
302
324
|
] }),
|
|
303
|
-
e.status === "success" && /* @__PURE__ */
|
|
325
|
+
e.status === "success" && /* @__PURE__ */ o(k, { children: [
|
|
304
326
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
305
327
|
/* @__PURE__ */ t("span", { className: "font-normal text-green-600", children: n.success })
|
|
306
328
|
] })
|
|
307
329
|
] }),
|
|
308
|
-
e.status === "uploading" && /* @__PURE__ */ t("div", { className:
|
|
330
|
+
e.status === "uploading" && /* @__PURE__ */ t("div", { className: s("mt-2 h-1.5 w-full rounded-full", i ? "bg-neutral-700" : "bg-slate-200"), children: /* @__PURE__ */ t(
|
|
309
331
|
"div",
|
|
310
332
|
{
|
|
311
|
-
className:
|
|
333
|
+
className: s(
|
|
312
334
|
"h-1.5 rounded-full transition-all duration-300",
|
|
313
|
-
|
|
335
|
+
u.progressFill
|
|
314
336
|
),
|
|
315
337
|
style: { width: `${e.progress}%` }
|
|
316
338
|
}
|
|
@@ -318,7 +340,7 @@ const fe = {
|
|
|
318
340
|
e.status === "error" && e.error && /* @__PURE__ */ t("p", { className: "mt-2 text-sm font-normal text-red-600", children: e.error })
|
|
319
341
|
] })
|
|
320
342
|
] }),
|
|
321
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
322
344
|
/* @__PURE__ */ t(
|
|
323
345
|
"button",
|
|
324
346
|
{
|
|
@@ -327,7 +349,7 @@ const fe = {
|
|
|
327
349
|
a.stopPropagation(), r || Q(e);
|
|
328
350
|
},
|
|
329
351
|
disabled: r,
|
|
330
|
-
className:
|
|
352
|
+
className: s("rounded-xl p-2 hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed", i ? "hover:bg-neutral-800" : "hover:bg-slate-100"),
|
|
331
353
|
title: n.preview,
|
|
332
354
|
children: /* @__PURE__ */ t(ne, { size: 20, className: "text-slate-400" })
|
|
333
355
|
}
|
|
@@ -339,8 +361,8 @@ const fe = {
|
|
|
339
361
|
onClick: (a) => {
|
|
340
362
|
a.stopPropagation(), M(e.id);
|
|
341
363
|
},
|
|
342
|
-
disabled:
|
|
343
|
-
className:
|
|
364
|
+
disabled: g || I,
|
|
365
|
+
className: s("rounded-xl p-2 hover:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50", i ? "text-slate-400 hover:bg-neutral-800" : "text-slate-base hover:bg-slate-100"),
|
|
344
366
|
title: n.remove,
|
|
345
367
|
children: /* @__PURE__ */ t(ae, { className: "h-6 w-6" })
|
|
346
368
|
}
|
|
@@ -356,5 +378,5 @@ const fe = {
|
|
|
356
378
|
] });
|
|
357
379
|
};
|
|
358
380
|
export {
|
|
359
|
-
|
|
381
|
+
Be as default
|
|
360
382
|
};
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export type Align = 'left' | 'center' | 'right';
|
|
3
3
|
export type ColumnKey<T> = Extract<keyof T, string>;
|
|
4
4
|
export type MciTablePanelLocale = 'ru' | 'uz';
|
|
5
|
+
export type MciTableVariant = 'blue' | 'yellow' | 'orange';
|
|
5
6
|
export type MciTableColumn<T> = {
|
|
6
7
|
key: ColumnKey<T>;
|
|
7
8
|
title: string;
|
|
@@ -40,6 +41,7 @@ export interface MciTableProps<T extends Record<string, unknown>> {
|
|
|
40
41
|
skeletonRows?: number;
|
|
41
42
|
noDataText?: string;
|
|
42
43
|
darkMode?: boolean;
|
|
44
|
+
variant?: MciTableVariant;
|
|
43
45
|
sort?: MciTableSort<T> | null;
|
|
44
46
|
onSortChange?: (sort: MciTableSort<T> | null) => void;
|
|
45
47
|
className?: string;
|
|
@@ -5,7 +5,7 @@ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'>
|
|
|
5
5
|
iconPosition?: 'left' | 'right';
|
|
6
6
|
size?: 'sm' | 'md' | 'base';
|
|
7
7
|
variant?: 'primary' | 'secondary' | 'outline' | 'danger' | 'tertiary';
|
|
8
|
-
color?: 'blue' | 'yellow';
|
|
8
|
+
color?: 'blue' | 'yellow' | 'orange';
|
|
9
9
|
darkMode?: boolean;
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
};
|
|
@@ -10,8 +10,10 @@ export interface DrawerProps {
|
|
|
10
10
|
showCloseButton?: boolean;
|
|
11
11
|
drawerClassName?: string;
|
|
12
12
|
contentClassName?: string;
|
|
13
|
+
footerClassName?: string;
|
|
13
14
|
closeOnOverlayClick?: boolean;
|
|
14
15
|
closeOnEscape?: boolean;
|
|
15
16
|
width?: string | number;
|
|
16
17
|
darkMode?: boolean;
|
|
18
|
+
variant?: 'blue' | 'yellow' | 'orange';
|
|
17
19
|
}
|
|
@@ -7,7 +7,7 @@ export interface PaginationProps {
|
|
|
7
7
|
siblingCount?: number;
|
|
8
8
|
perPageOptions?: number[];
|
|
9
9
|
showPerPage?: boolean;
|
|
10
|
-
variant?: 'yellow' | 'blue';
|
|
10
|
+
variant?: 'yellow' | 'blue' | 'orange';
|
|
11
11
|
size?: 'medium' | 'large';
|
|
12
12
|
darkMode?: boolean;
|
|
13
13
|
paginationClassName?: string;
|
|
@@ -2,7 +2,7 @@ import { ButtonHTMLAttributes } from 'react';
|
|
|
2
2
|
export type ToggleProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'type' | 'className' | 'onChange'> & {
|
|
3
3
|
checked?: boolean;
|
|
4
4
|
onChange?: (checked: boolean) => void;
|
|
5
|
-
variant?: 'blue' | 'yellow';
|
|
5
|
+
variant?: 'blue' | 'yellow' | 'orange';
|
|
6
6
|
darkMode?: boolean;
|
|
7
7
|
label?: string;
|
|
8
8
|
supportText?: string;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { AccordionProps } from '../../types/ui/accordion.types';
|
|
3
|
-
declare function AccordionTitle({ children, className, }: {
|
|
3
|
+
declare function AccordionTitle({ children, className, darkMode, }: {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
className?: string;
|
|
6
|
+
darkMode?: boolean;
|
|
6
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
declare namespace AccordionTitle {
|
|
8
9
|
var displayName: string;
|
|
9
10
|
}
|
|
10
|
-
declare function AccordionContent({ children, className, }: {
|
|
11
|
+
declare function AccordionContent({ children, className, darkMode, }: {
|
|
11
12
|
children: React.ReactNode;
|
|
12
13
|
className?: string;
|
|
14
|
+
darkMode?: boolean;
|
|
13
15
|
}): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
declare namespace AccordionContent {
|
|
15
17
|
var displayName: string;
|
|
16
18
|
}
|
|
17
|
-
declare function MciAccordion({ children, defaultValue, icon, className }: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function MciAccordion({ children, defaultValue, icon, darkMode, className }: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
declare namespace MciAccordion {
|
|
19
21
|
var Title: typeof AccordionTitle;
|
|
20
22
|
var Content: typeof AccordionContent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DrawerProps } from '../../types/ui/drawer.types';
|
|
2
|
-
export default function MciDrawer({ isOpen, onClose, position, children, footer, title, description, showCloseButton, drawerClassName, contentClassName, closeOnOverlayClick, closeOnEscape, width, darkMode, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciDrawer({ isOpen, onClose, position, children, footer, title, description, showCloseButton, drawerClassName, contentClassName, footerClassName, closeOnOverlayClick, closeOnEscape, width, darkMode, variant, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MciTableProps } from '../../types/mci-table.types.ts';
|
|
2
|
-
export default function MciTable<T extends Record<string, unknown>>({ columns, data, loading, skeletonRows, noDataText, sort: externalSort, onSortChange, className, headerClassName, bodyClassName, darkMode, rowKey, rowSelection, }: MciTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MciTable<T extends Record<string, unknown>>({ columns, data, loading, skeletonRows, noDataText, sort: externalSort, onSortChange, className, headerClassName, bodyClassName, darkMode, variant, rowKey, rowSelection, }: MciTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnKey, MciTableColumn, MciTablePanelLocale } from '../../types/mci-table.types.ts';
|
|
1
|
+
import { ColumnKey, MciTableColumn, MciTablePanelLocale, MciTableVariant } from '../../types/mci-table.types.ts';
|
|
2
2
|
type DropPosition = 'before' | 'after';
|
|
3
3
|
type Props<T extends Record<string, unknown>> = {
|
|
4
4
|
open: boolean;
|
|
@@ -11,6 +11,7 @@ type Props<T extends Record<string, unknown>> = {
|
|
|
11
11
|
minVisible?: number;
|
|
12
12
|
locale?: MciTablePanelLocale;
|
|
13
13
|
darkMode?: boolean;
|
|
14
|
+
variant?: MciTableVariant;
|
|
14
15
|
};
|
|
15
|
-
export default function MciTableColumnsPanel<T extends Record<string, unknown>>({ open, onClose, columns, hidden, onToggle, onMove, onMoveByKey, minVisible, locale, darkMode, }: Props<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export default function MciTableColumnsPanel<T extends Record<string, unknown>>({ open, onClose, columns, hidden, onToggle, onMove, onMoveByKey, minVisible, locale, darkMode, variant, }: Props<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
16
17
|
export {};
|