@mci-ui/mci-ui 0.0.88 → 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.
Files changed (29) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/shared/ui/MciModal/MciModal.js +30 -28
  3. package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +45 -25
  4. package/dist/shared/ui/mciButton/MciButton.js +39 -31
  5. package/dist/shared/ui/mciCheck/MciCheck.js +86 -76
  6. package/dist/shared/ui/mciDrawer/MciDrawer.js +78 -59
  7. package/dist/shared/ui/mciInput/MciInput.js +39 -40
  8. package/dist/shared/ui/mciLoader/MciLoader.js +14 -14
  9. package/dist/shared/ui/mciPagination/MciPagination.js +28 -18
  10. package/dist/shared/ui/mciPicker/MciPicker.js +53 -53
  11. package/dist/shared/ui/mciSelect/MciSelect.js +42 -41
  12. package/dist/shared/ui/mciTable/MciTable.js +97 -90
  13. package/dist/shared/ui/mciTable/MciTableClamp2.js +4 -3
  14. package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +100 -79
  15. package/dist/shared/ui/mciToggle/MciToggle.js +51 -43
  16. package/dist/shared/ui/mciUpload/MciUpload.js +129 -107
  17. package/dist/types/shared/types/mci-table.types.d.ts +2 -0
  18. package/dist/types/shared/types/ui/breadcrumb.types.d.ts +1 -1
  19. package/dist/types/shared/types/ui/button.types.d.ts +1 -1
  20. package/dist/types/shared/types/ui/check.types.d.ts +1 -1
  21. package/dist/types/shared/types/ui/drawer.types.d.ts +1 -0
  22. package/dist/types/shared/types/ui/loader.types.d.ts +1 -1
  23. package/dist/types/shared/types/ui/pagination.types.d.ts +1 -1
  24. package/dist/types/shared/types/ui/toggle.types.d.ts +1 -1
  25. package/dist/types/shared/types/ui/upload.types.d.ts +1 -1
  26. package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -1
  27. package/dist/types/shared/ui/mciTable/MciTable.d.ts +1 -1
  28. package/dist/types/shared/ui/mciTable/MciTableColumnsPanel.d.ts +3 -2
  29. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- import { jsxs as s, jsx as t, Fragment as C } from "react/jsx-runtime";
2
- import { Upload as le, File as se, Star2 as oe, Eye as ne } from "@solar-icons/react";
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 T, useRef as H, useMemo as P, useCallback as c, useEffect as ie } from "react";
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 o } from "../../lib/utils.js";
7
- import { buildSecureAccept as de, getAllowedFormatsHint as ue, validateFileSize as pe, validateFileType as me, createPreview as be, getFileIcon as ge, formatFileSize as he } from "./mci-upload.utils.js";
8
- const fe = {
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-200 hover:border-yellow-300",
22
- dropBg: "bg-yellow-50/40 hover:bg-yellow-50/60",
23
- dropActive: "border-yellow-500 bg-yellow-50",
24
- iconWrap: "text-yellow-700",
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-600",
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
- }, xe = {
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-800 hover:border-yellow-700",
45
- dropBg: "bg-yellow-950/40 hover:bg-yellow-950/60",
46
- dropActive: "border-yellow-600 bg-yellow-950/60",
47
- iconWrap: "text-yellow-400",
48
- title: "text-yellow-400",
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-500",
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
- }, je = ({
76
+ }, Be = ({
55
77
  multiple: y = !1,
56
78
  accept: h = "*/*",
57
79
  maxSize: N = 10,
58
80
  maxFiles: D = 5,
59
- disabled: u = !1,
81
+ disabled: g = !1,
60
82
  label: W,
61
- required: z = !1,
83
+ required: H = !1,
62
84
  error: F,
63
- className: I,
64
- onFilesChange: f,
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 = "yellow",
91
+ variant: R = "orange",
70
92
  customValidator: U,
71
93
  darkMode: i = !1
72
94
  }) => {
73
- const [m, x] = T([]), [$, L] = T(!1), [O, S] = T(!1), A = H(null), n = ce[q], p = P(() => i ? xe[R] : fe[R], [R, i]), G = P(() => de(h), [h]), J = P(() => ue(h), [h]), v = H(/* @__PURE__ */ new Map()), j = c((e) => {
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
- }, []), B = c(() => {
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
- B();
83
- }, [B]);
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(() => j(e.id), 5 * 6e4)), window.open(l, "_blank", "noopener,noreferrer");
87
- }, [j]), E = c(
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 (m.length + d.length >= D) {
113
+ if (b.length + d.length >= D) {
92
114
  alert(n.maxFilesError(D));
93
115
  break;
94
116
  }
95
- if (!pe(r, N)) {
117
+ if (!ue(r, N)) {
96
118
  alert(n.fileSizeError(r.name, N));
97
119
  continue;
98
120
  }
99
- const a = me(r, h);
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 k = U(r);
106
- if (k) {
107
- alert(k);
127
+ const S = U(r);
128
+ if (S) {
129
+ alert(S);
108
130
  continue;
109
131
  }
110
132
  }
111
- const b = await be(r), g = w ? "uploading" : "success", re = w ? 0 : 100;
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: b,
137
+ preview: p,
116
138
  progress: re,
117
- status: g
139
+ status: m
118
140
  });
119
141
  }
120
142
  if (d.length > 0) {
121
- const r = y ? [...m, ...d] : d;
122
- if (x(r), f?.(r.map((a) => a.file)), w) {
123
- S(!0);
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((b, g) => ({
126
- ...b,
127
- progress: Math.min(100, (g + 1) / r.length * 100)
147
+ const a = r.map((p, m) => ({
148
+ ...p,
149
+ progress: Math.min(100, (m + 1) / r.length * 100)
128
150
  }));
129
- x(a), await w(a), x(
130
- (b) => b.map((g) => ({
131
- ...g,
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
- x(
138
- (b) => b.map((g) => ({
139
- ...g,
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
- S(!1);
167
+ P(!1);
146
168
  }
147
169
  }
148
170
  }
149
171
  },
150
172
  [
151
- m,
173
+ b,
152
174
  D,
153
175
  U,
154
176
  n,
155
177
  h,
156
178
  N,
157
179
  y,
158
- f,
180
+ x,
159
181
  w
160
182
  ]
161
183
  ), V = c(
162
184
  (e) => {
163
- e.preventDefault(), u || L(!0);
185
+ e.preventDefault(), g || L(!0);
164
186
  },
165
- [u]
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), u) return;
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
- [u, E]
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
- j(e), x((l) => {
205
+ B(e), f((l) => {
184
206
  const d = l.filter((r) => r.id !== e);
185
- return f?.(d.map((r) => r.file)), d;
207
+ return x?.(d.map((r) => r.file)), d;
186
208
  });
187
209
  },
188
- [f, j]
210
+ [x, B]
189
211
  ), ee = c(() => {
190
- B(), x([]), f?.([]);
191
- }, [f, B]), te = c(() => {
212
+ j(), f([]), x?.([]);
213
+ }, [x, j]), te = c(() => {
192
214
  A.current?.click();
193
215
  }, []);
194
- return /* @__PURE__ */ s("div", { className: o("w-full", I), children: [
195
- W && /* @__PURE__ */ s(
216
+ return /* @__PURE__ */ o("div", { className: s("w-full", z), children: [
217
+ W && /* @__PURE__ */ o(
196
218
  "label",
197
219
  {
198
- className: o(
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
- z && /* @__PURE__ */ t("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
226
+ H && /* @__PURE__ */ t("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
205
227
  ]
206
228
  }
207
229
  ),
208
- /* @__PURE__ */ s(
230
+ /* @__PURE__ */ o(
209
231
  "div",
210
232
  {
211
- className: o(
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
- p.dropBorder,
214
- p.dropBg,
215
- $ && p.dropActive,
216
- u && "cursor-not-allowed opacity-60",
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: u,
254
+ disabled: g,
233
255
  className: "hidden"
234
256
  }
235
257
  ),
236
- /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-3", children: [
237
- /* @__PURE__ */ t("div", { className: o("flex h-12 w-12 items-center justify-center rounded-xl", p.iconWrap), children: /* @__PURE__ */ t(le, { size: 20 }) }),
238
- /* @__PURE__ */ t("p", { className: o("text-base font-medium", p.title), children: n.dropHereTitle }),
239
- /* @__PURE__ */ t("p", { className: o("text-sm font-normal", p.hint), children: n.fileRequirements(y, D, N, J) })
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
- m.length > 0 && /* @__PURE__ */ s("div", { className: "mt-4 space-y-3", children: [
245
- /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
246
- /* @__PURE__ */ s("span", { className: o("text-sm font-medium", i ? "text-slate-300" : "text-slate-700"), children: [
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
- m.length,
271
+ b.length,
250
272
  ")"
251
273
  ] }),
252
- m.length > 1 && /* @__PURE__ */ t(
274
+ b.length > 1 && /* @__PURE__ */ t(
253
275
  "button",
254
276
  {
255
277
  type: "button",
256
278
  onClick: ee,
257
- disabled: u || O,
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: m.map((e) => {
264
- const d = !!e.preview ? p.fileIconImg : p.fileIconDoc, r = u || O || e.status === "uploading";
265
- return /* @__PURE__ */ s(
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: o(
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__ */ s("div", { className: "flex min-w-0 items-center gap-4", children: [
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: o(
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 ? ge(e.file) : /* @__PURE__ */ t(se, { className: "h-6 w-6 text-slate-500" })
311
+ ) : K ? me(e.file) : /* @__PURE__ */ t(oe, { className: "h-6 w-6 text-slate-500" })
290
312
  }
291
313
  ),
292
- /* @__PURE__ */ s("div", { className: "min-w-0", children: [
293
- /* @__PURE__ */ t("p", { className: o("truncate text-lg font-semibold", i ? "text-slate-100" : "text-primary"), children: e.file.name }),
294
- /* @__PURE__ */ s("div", { className: o("mt-1 flex flex-wrap items-center gap-2 text-sm", i ? "text-slate-400" : "text-slate-500"), children: [
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__ */ s(C, { children: [
318
+ e.status === "uploading" && /* @__PURE__ */ o(k, { children: [
297
319
  /* @__PURE__ */ t("span", { children: "•" }),
298
- /* @__PURE__ */ s("span", { className: "inline-flex items-center", children: [
299
- /* @__PURE__ */ t(oe, { className: "mr-1 h-5 w-5 animate-spin" }),
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__ */ s(C, { children: [
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: o("mt-2 h-1.5 w-full rounded-full", i ? "bg-neutral-700" : "bg-slate-200"), children: /* @__PURE__ */ t(
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: o(
333
+ className: s(
312
334
  "h-1.5 rounded-full transition-all duration-300",
313
- p.progressFill
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__ */ s("div", { className: "flex items-center gap-2", children: [
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: o("rounded-xl p-2 hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed", i ? "hover:bg-neutral-800" : "hover:bg-slate-100"),
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: u || O,
343
- className: o("rounded-xl p-2 disabled:opacity-50 hover:cursor-pointer", i ? "text-slate-400 hover:bg-neutral-800" : "text-slate-base hover:bg-slate-100"),
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
- je as default
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 BreadcrumbItem = {
5
5
  onClick?: () => void;
6
6
  icon?: ReactNode;
7
7
  };
8
- export type Variant = 'blue' | 'yellow';
8
+ export type Variant = 'blue' | 'yellow' | 'orange';
9
9
  export type MciBreadcrumbProps = {
10
10
  items: BreadcrumbItem[];
11
11
  variant?: Variant;
@@ -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
  };
@@ -4,7 +4,7 @@ export type MciCheckProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' |
4
4
  label?: string;
5
5
  supportText?: string;
6
6
  error?: string;
7
- variant?: 'blue' | 'yellow';
7
+ variant?: 'blue' | 'yellow' | 'orange';
8
8
  darkMode?: boolean;
9
9
  className?: string;
10
10
  };
@@ -15,4 +15,5 @@ export interface DrawerProps {
15
15
  closeOnEscape?: boolean;
16
16
  width?: string | number;
17
17
  darkMode?: boolean;
18
+ variant?: 'blue' | 'yellow' | 'orange';
18
19
  }
@@ -4,5 +4,5 @@ export interface MciLoaderProps {
4
4
  iconClassName?: string;
5
5
  isLoading?: boolean;
6
6
  isFullPage?: boolean;
7
- variant?: 'yellow' | 'blue';
7
+ variant?: 'yellow' | 'blue' | 'orange';
8
8
  }
@@ -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;
@@ -23,6 +23,6 @@ export interface MciUploadProps {
23
23
  locale?: UploadLocale;
24
24
  showFileTypeIcon?: boolean;
25
25
  customValidator?: (file: File) => string | null;
26
- variant?: 'yellow' | 'blue';
26
+ variant?: 'yellow' | 'blue' | 'orange';
27
27
  darkMode?: boolean;
28
28
  }
@@ -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, footerClassName, 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 {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mci-ui/mci-ui",
3
3
  "private": false,
4
- "version": "0.0.88",
4
+ "version": "0.0.89",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",