@mci-ui/mci-ui 0.0.86 → 0.0.88

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