@mci-ui/mci-ui 0.0.93 → 0.0.95

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 (43) hide show
  1. package/dist/assets/png/empty.png.js +4 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.js +54 -50
  4. package/dist/shared/lib/uploadLanguage.js +6 -3
  5. package/dist/shared/ui/MciModal/MciModal.js +1 -1
  6. package/dist/shared/ui/mciAccordion/MciAccordion.js +4 -4
  7. package/dist/shared/ui/mciButton/MciButton.js +12 -10
  8. package/dist/shared/ui/mciCollapse/MciCollapse.js +1 -1
  9. package/dist/shared/ui/mciDrawer/MciDrawer.js +1 -1
  10. package/dist/shared/ui/mciEmpty/MciEmpty.js +41 -0
  11. package/dist/shared/ui/mciInput/MciInput.js +32 -32
  12. package/dist/shared/ui/mciPagination/MciPagination.js +32 -32
  13. package/dist/shared/ui/mciPhone/MciPhone.js +23 -23
  14. package/dist/shared/ui/mciPicker/MciPicker.js +2 -2
  15. package/dist/shared/ui/mciTable/MciTable.js +317 -165
  16. package/dist/shared/ui/mciTable/MciTableClamp2.js +5 -5
  17. package/dist/shared/ui/mciTabs/FilledTabs.js +38 -36
  18. package/dist/shared/ui/mciTabs/OutlinedTabs.js +28 -24
  19. package/dist/shared/ui/mciTabs/TabCountBadge.js +19 -0
  20. package/dist/shared/ui/mciTag/MciTag.js +17 -17
  21. package/dist/shared/ui/mciTextarea/MciTextarea.js +5 -5
  22. package/dist/shared/ui/mciTimePicker/MciTimePicker.js +368 -217
  23. package/dist/shared/ui/mciUpload/MciUpload.js +102 -352
  24. package/dist/shared/ui/mciUpload/MciUploadButton.js +143 -0
  25. package/dist/shared/ui/mciUpload/MciUploadFileList.js +167 -0
  26. package/dist/shared/ui/mciUpload/mci-upload.theme.js +103 -0
  27. package/dist/shared/ui/mciUpload/mci-upload.utils.js +90 -41
  28. package/dist/shared/ui/mciUpload/useMciUpload.js +183 -0
  29. package/dist/types/index.d.ts +4 -0
  30. package/dist/types/shared/lib/uploadLanguage.d.ts +2 -0
  31. package/dist/types/shared/types/ui/empty.types.d.ts +11 -0
  32. package/dist/types/shared/types/ui/index.d.ts +2 -1
  33. package/dist/types/shared/types/ui/tabs.types.d.ts +1 -0
  34. package/dist/types/shared/types/ui/time-picker.types.d.ts +7 -1
  35. package/dist/types/shared/types/ui/upload.types.d.ts +25 -1
  36. package/dist/types/shared/ui/mciEmpty/MciEmpty.d.ts +2 -0
  37. package/dist/types/shared/ui/mciTabs/TabCountBadge.d.ts +5 -0
  38. package/dist/types/shared/ui/mciUpload/MciUploadButton.d.ts +4 -0
  39. package/dist/types/shared/ui/mciUpload/MciUploadFileList.d.ts +18 -0
  40. package/dist/types/shared/ui/mciUpload/mci-upload.theme.d.ts +101 -0
  41. package/dist/types/shared/ui/mciUpload/mci-upload.utils.d.ts +7 -0
  42. package/dist/types/shared/ui/mciUpload/useMciUpload.d.ts +131 -0
  43. package/package.json +1 -1
@@ -1,264 +1,415 @@
1
- import { jsx as i, jsxs as I } from "react/jsx-runtime";
2
- import { ClockCircle as he } from "@solar-icons/react";
3
- import { forwardRef as fe, useState as g, useRef as pe, useMemo as ge, useCallback as d, useEffect as $ } from "react";
4
- import { useClickOutside as de, useEscapeKey as be, cn as u } from "../../lib/utils.js";
5
- import xe from "../mciInput/MciInput.js";
6
- const m = (o) => o.toString().padStart(2, "0"), ve = (o, l) => `${m(o)}:${m(l)}`, b = (o, l, e) => o === "minute" ? m(e) : ve(l, e), E = (o, l) => {
7
- if (!o) return null;
8
- const e = o.replace(/\D/g, "");
9
- if (l === "minute") {
10
- if (e.length < 1 || e.length > 2) return null;
11
- const s = Number.parseInt(e, 10);
12
- return s < 0 || s > 59 ? null : { hours: 0, minutes: s };
1
+ import { jsx as l, jsxs as k } from "react/jsx-runtime";
2
+ import { ClockCircle as De } from "@solar-icons/react";
3
+ import { forwardRef as Me, useState as x, useRef as Pe, useMemo as Se, useCallback as C, useEffect as F } from "react";
4
+ import { useClickOutside as Te, useEscapeKey as Ee, cn as p } from "../../lib/utils.js";
5
+ import Oe from "../mciInput/MciInput.js";
6
+ const c = (u) => u.toString().padStart(2, "0"), E = 31, te = {
7
+ en: {
8
+ day: "Day",
9
+ hour: "Hour",
10
+ minute: "Minute",
11
+ ok: "OK",
12
+ timePlaceholder: "Hour:minute",
13
+ durationPlaceholder: "Days, hours, minutes",
14
+ units: { day: "day", hour: "hr", minute: "min" }
15
+ },
16
+ uz: {
17
+ day: "Kun",
18
+ hour: "Soat",
19
+ minute: "Minut",
20
+ ok: "OK",
21
+ timePlaceholder: "Soat:minut",
22
+ durationPlaceholder: "Kun, soat, minut",
23
+ units: { day: "kunda", hour: "soat", minute: "min" }
24
+ },
25
+ ru: {
26
+ day: "День",
27
+ hour: "Час",
28
+ minute: "Минута",
29
+ ok: "OK",
30
+ timePlaceholder: "Часы:минуты",
31
+ durationPlaceholder: "Дни, часы, минуты",
32
+ units: { day: "дн", hour: "ч", minute: "мин" }
33
+ }
34
+ }, Le = {
35
+ blue: {
36
+ button: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-[rgba(21,93,252,0.25)]",
37
+ darkButton: "bg-blue-500 text-black hover:bg-blue-400 focus:ring-blue-500/35",
38
+ step: "text-blue-600 hover:bg-blue-50",
39
+ darkStep: "text-blue-300 hover:bg-blue-500/10",
40
+ input: "focus:border-blue-500 focus:ring-blue-500/20"
41
+ },
42
+ yellow: {
43
+ button: "bg-yellow-500 text-white hover:bg-yellow-600 focus:ring-yellow-300",
44
+ darkButton: "bg-yellow-400 text-slate-950 hover:bg-yellow-300 focus:ring-yellow-300/40",
45
+ step: "text-yellow-600 hover:bg-yellow-50",
46
+ darkStep: "text-yellow-300 hover:bg-yellow-500/10",
47
+ input: "focus:border-yellow-500 focus:ring-yellow-500/20"
48
+ },
49
+ orange: {
50
+ button: "bg-orange-600 text-white hover:bg-orange-700 focus:ring-[rgba(227,98,12,0.25)]",
51
+ darkButton: "bg-orange-500 text-black hover:bg-orange-400 focus:ring-[rgba(227,98,12,0.25)]",
52
+ step: "text-orange-600 hover:bg-orange-50",
53
+ darkStep: "text-orange-300 hover:bg-orange-500/10",
54
+ input: "focus:border-orange-500 focus:ring-orange-500/20"
55
+ }
56
+ }, Be = (u, i) => `${c(u)}:${c(i)}`, ze = (u, i, e, o, r = "text") => {
57
+ if (r === "dot")
58
+ return `${c(u)}.${c(i)}.${c(e)}`;
59
+ const { units: s } = te[o];
60
+ return `${c(u)} ${s.day} ${c(i)} ${s.hour} ${c(e)} ${s.minute}`;
61
+ }, Re = (u, i, e, o, r, s = "text") => u === "duration" ? ze(i, e, o, r, s) : Be(e, o), A = (u, i, e, o, r, s = "text") => u === "duration" && i === 0 && e === 0 && o === 0 ? null : Re(u, i, e, o, r, s), ee = (u, i, e, o, r, s = "text") => A(u, i, e, o, r, s) ?? "", V = (u, i) => {
62
+ if (!u) return null;
63
+ const e = u.replace(/\D/g, "");
64
+ if (i === "duration") {
65
+ if (e.length !== 6) return null;
66
+ const s = Number.parseInt(e.slice(0, 2), 10), $ = Number.parseInt(e.slice(2, 4), 10), D = Number.parseInt(e.slice(4, 6), 10);
67
+ return s < 0 || s > E || $ < 0 || $ > 23 || D < 0 || D > 59 ? null : { days: s, hours: $, minutes: D };
13
68
  }
14
69
  if (e.length !== 4) return null;
15
- const x = Number.parseInt(e.slice(0, 2), 10), v = Number.parseInt(e.slice(2, 4), 10);
16
- return x < 0 || x > 23 || v < 0 || v > 59 ? null : { hours: x, minutes: v };
17
- }, Ne = (o, l) => {
18
- const e = o.replace(/\D/g, "").slice(0, l === "minute" ? 2 : 4);
19
- return l === "minute" ? e : e.length > 2 ? `${e.slice(0, 2)}:${e.slice(2)}` : e;
20
- }, we = fe(
70
+ const o = Number.parseInt(e.slice(0, 2), 10), r = Number.parseInt(e.slice(2, 4), 10);
71
+ return o < 0 || o > 23 || r < 0 || r > 59 ? null : { days: 0, hours: o, minutes: r };
72
+ }, Ve = (u, i, e, o = "text") => {
73
+ const r = u.replace(/\D/g, "").slice(0, i === "duration" ? 6 : 4);
74
+ if (i === "duration") {
75
+ if (o === "dot")
76
+ return r.length > 4 ? `${r.slice(0, 2)}.${r.slice(2, 4)}.${r.slice(4)}` : r.length > 2 ? `${r.slice(0, 2)}.${r.slice(2)}` : r;
77
+ const { units: s } = te[e];
78
+ return r.length > 4 ? `${r.slice(0, 2)} ${s.day} ${r.slice(2, 4)} ${s.hour} ${r.slice(4)}` : r.length > 2 ? `${r.slice(0, 2)} ${s.day} ${r.slice(2)}` : r;
79
+ }
80
+ return r.length > 2 ? `${r.slice(0, 2)}:${r.slice(2)}` : r;
81
+ }, Ae = Me(
21
82
  ({
22
- value: o,
23
- onChange: l,
83
+ value: u,
84
+ onChange: i,
24
85
  mode: e = "time",
25
- placeholder: x,
26
- label: v,
27
- darkMode: s = !1,
28
- disabled: C = !1,
29
- required: U = !1,
30
- className: X,
31
- error: Y,
32
- showClear: Z = !0,
33
- allowManualInput: y = !0,
34
- iconPosition: j = "left",
35
- size: _ = "base",
36
- minuteStep: ee = 1,
37
- align: F = "auto"
38
- }, te) => {
39
- const [a, L] = g(!1), [ne, re] = g(null), [A, f] = g(""), [M, K] = g(!1), [z, W] = g(F), [H, N] = g("00"), [P, w] = g("00"), D = pe(null), T = o !== void 0 ? o : ne, c = ge(() => E(T, e), [T, e]), q = Math.min(Math.max(Math.floor(ee) || 1, 1), 59), se = x ?? (e === "minute" ? "mm" : "HH:mm"), p = d(
40
- (t) => {
41
- o === void 0 && re(t), l?.(t);
86
+ durationFormat: o = "text",
87
+ variant: r = "orange",
88
+ locale: s = "en",
89
+ placeholder: $,
90
+ label: D,
91
+ darkMode: b = !1,
92
+ disabled: O = !1,
93
+ required: ce = !1,
94
+ className: he,
95
+ error: de,
96
+ showClear: me = !0,
97
+ allowManualInput: L = !0,
98
+ iconPosition: ne = "left",
99
+ size: fe = "base",
100
+ minuteStep: ge = 1,
101
+ align: K = "auto"
102
+ }, pe) => {
103
+ const [d, _] = x(!1), [be, ye] = x(null), [re, y] = x(""), [H, se] = x(!1), [j, oe] = x(K), [W, M] = x("00"), [U, P] = x("00"), [X, S] = x("00"), B = Pe(null), z = u !== void 0 ? u : be, h = Se(() => V(z, e), [z, e]), ue = Math.min(Math.max(Math.floor(ge) || 1, 1), 59), v = te[s], T = Le[r], xe = $ ?? (e === "duration" ? v.durationPlaceholder : v.timePlaceholder), N = C(
104
+ (n) => {
105
+ u === void 0 && ye(n), i?.(n);
42
106
  },
43
- [l, o]
44
- ), G = d(() => {
45
- const t = E(T, e);
46
- N(m(t?.hours ?? 0)), w(m(t?.minutes ?? 0));
47
- }, [T, e]), V = d(() => {
48
- C || (G(), L(!0));
49
- }, [C, G]), k = d(() => {
50
- L(!1), f(
51
- c ? b(e, c.hours, c.minutes) : ""
107
+ [i, u]
108
+ ), ie = C(() => {
109
+ const n = V(z, e);
110
+ M(c(n?.days ?? 0)), P(c(n?.hours ?? 0)), S(c(n?.minutes ?? 0));
111
+ }, [z, e]), Y = C(() => {
112
+ O || (ie(), _(!0));
113
+ }, [O, ie]), R = C(() => {
114
+ _(!1), y(
115
+ h ? ee(
116
+ e,
117
+ h.days,
118
+ h.hours,
119
+ h.minutes,
120
+ s,
121
+ o
122
+ ) : ""
52
123
  );
53
- }, [c, e]), oe = d(
54
- (t) => {
55
- t.preventDefault(), t.stopPropagation(), a ? k() : V();
124
+ }, [h, o, s, e]), Ne = C(
125
+ (n) => {
126
+ n.preventDefault(), n.stopPropagation(), d ? R() : Y();
56
127
  },
57
- [k, a, V]
58
- ), { handleClick: R } = de(D, k), { handleEscape: B } = be(k);
59
- $(() => {
60
- !a && !M && f(
61
- c ? b(e, c.hours, c.minutes) : ""
128
+ [R, d, Y]
129
+ ), { handleClick: q } = Te(B, R), { handleEscape: G } = Ee(R);
130
+ F(() => {
131
+ !d && !H && y(
132
+ h ? ee(
133
+ e,
134
+ h.days,
135
+ h.hours,
136
+ h.minutes,
137
+ s,
138
+ o
139
+ ) : ""
62
140
  );
63
- }, [c, M, a, e]), $(() => {
64
- if (a && F === "auto" && D.current) {
65
- const t = D.current.getBoundingClientRect(), r = window.innerWidth - t.right, n = t.left;
66
- r < 260 && n > 260 ? W("right") : W("left");
141
+ }, [h, o, H, d, s, e]), F(() => {
142
+ if (d && K === "auto" && B.current) {
143
+ const n = B.current.getBoundingClientRect(), a = window.innerWidth - n.right, t = n.left, f = e === "duration" ? 316 : 220;
144
+ a < f && t > f ? oe("right") : oe("left");
67
145
  }
68
- }, [F, a]), $(() => {
69
- if (a)
70
- return document.addEventListener("mousedown", R), document.addEventListener("keydown", B), () => {
71
- document.removeEventListener("mousedown", R), document.removeEventListener("keydown", B);
146
+ }, [K, d, e]), F(() => {
147
+ if (d)
148
+ return document.addEventListener("mousedown", q), document.addEventListener("keydown", G), () => {
149
+ document.removeEventListener("mousedown", q), document.removeEventListener("keydown", G);
72
150
  };
73
- }, [R, B, a]);
74
- const ie = () => {
75
- K(!0), y || V();
76
- }, ue = () => {
77
- if (K(!1), !y) return;
78
- const t = A.trim();
79
- if (!t) {
80
- p(null);
151
+ }, [q, G, d]);
152
+ const ve = () => {
153
+ se(!0), L || Y();
154
+ }, Ie = () => {
155
+ if (se(!1), !L) return;
156
+ const n = re.trim();
157
+ if (!n) {
158
+ N(null);
81
159
  return;
82
160
  }
83
- const r = E(t, e);
84
- if (r) {
85
- const n = b(e, r.hours, r.minutes);
86
- p(n), f(n);
161
+ const a = V(n, e);
162
+ if (a) {
163
+ const t = A(
164
+ e,
165
+ a.days,
166
+ a.hours,
167
+ a.minutes,
168
+ s,
169
+ o
170
+ );
171
+ N(t), y(t ?? "");
87
172
  return;
88
173
  }
89
- f(
90
- c ? b(e, c.hours, c.minutes) : ""
174
+ y(
175
+ h ? ee(
176
+ e,
177
+ h.days,
178
+ h.hours,
179
+ h.minutes,
180
+ s,
181
+ o
182
+ ) : ""
91
183
  );
92
- }, le = (t) => {
93
- if (!y) return;
94
- const r = Ne(t.target.value, e), n = r.replace(/\D/g, "");
95
- if (e === "minute") {
96
- if (n.length >= 2 && Number.parseInt(n, 10) > 59) return;
97
- } else if (n.length >= 1 && Number.parseInt(n[0] ?? "0", 10) > 2 || n.length >= 2 && Number.parseInt(n.slice(0, 2), 10) > 23 || n.length >= 3 && Number.parseInt(n[2] ?? "0", 10) > 5 || n.length >= 4 && Number.parseInt(n.slice(2, 4), 10) > 59) return;
98
- if (f(r), e === "minute" && r.length === 2 || r.length === 5) {
99
- const h = E(r, e);
100
- h && p(b(e, h.hours, h.minutes));
101
- } else r === "" && p(null);
102
- }, ce = d(() => {
103
- p(null), f(""), N("00"), w("00");
104
- }, [p]), J = (t, r) => {
105
- const n = r.replace(/\D/g, "").slice(0, 2);
106
- t === "hours" && n.length === 2 && Number.parseInt(n, 10) > 23 || t === "minutes" && n.length === 2 && Number.parseInt(n, 10) > 59 || (t === "hours" ? N(n) : w(n));
107
- }, O = (t, r) => {
108
- if (t === "hours") {
109
- const me = (Number.parseInt(H || "0", 10) + r + 24) % 24;
110
- N(m(me));
184
+ }, we = (n) => {
185
+ if (!L) return;
186
+ const a = Ve(n.target.value, e, s, o), t = a.replace(/\D/g, "");
187
+ if (e === "duration") {
188
+ if (t.length >= 1 && Number.parseInt(t[0] ?? "0", 10) > 3 || t.length >= 2 && Number.parseInt(t.slice(0, 2), 10) > E || t.length >= 3 && Number.parseInt(t[2] ?? "0", 10) > 2 || t.length >= 4 && Number.parseInt(t.slice(2, 4), 10) > 23 || t.length >= 5 && Number.parseInt(t[4] ?? "0", 10) > 5 || t.length >= 6 && Number.parseInt(t.slice(4, 6), 10) > 59)
189
+ return;
190
+ } else if (t.length >= 1 && Number.parseInt(t[0] ?? "0", 10) > 2 || t.length >= 2 && Number.parseInt(t.slice(0, 2), 10) > 23 || t.length >= 3 && Number.parseInt(t[2] ?? "0", 10) > 5 || t.length >= 4 && Number.parseInt(t.slice(2, 4), 10) > 59) return;
191
+ y(a);
192
+ const f = e === "duration" ? 6 : 4;
193
+ if (t.length === f) {
194
+ const m = V(a, e);
195
+ if (m) {
196
+ const g = A(
197
+ e,
198
+ m.days,
199
+ m.hours,
200
+ m.minutes,
201
+ s,
202
+ o
203
+ );
204
+ N(g), y(g ?? "");
205
+ }
206
+ } else a === "" && N(null);
207
+ }, ke = C(() => {
208
+ N(null), y(""), M("00"), P("00"), S("00");
209
+ }, [N]), J = (n, a) => {
210
+ const t = a.replace(/\D/g, "").slice(0, 2);
211
+ n === "days" && t.length === 2 && Number.parseInt(t, 10) > E || n === "hours" && t.length === 2 && Number.parseInt(t, 10) > 23 || n === "minutes" && t.length === 2 && Number.parseInt(t, 10) > 59 || (n === "days" ? M(t) : n === "hours" ? P(t) : S(t));
212
+ }, I = (n, a) => {
213
+ if (n === "days") {
214
+ const m = Number.parseInt(W || "0", 10), g = Math.min(Math.max(m + a, 0), E);
215
+ M(c(g));
111
216
  return;
112
217
  }
113
- const h = (Number.parseInt(P || "0", 10) + r + 60) % 60;
114
- w(m(h));
115
- }, ae = () => {
116
- const t = Number.parseInt(H || "0", 10), r = Number.parseInt(P || "0", 10), n = Math.min(Math.max(t, 0), 23), h = Math.min(Math.max(r, 0), 59), S = b(e, n, h);
117
- p(S), f(S), N(m(n)), w(m(h)), L(!1);
118
- }, Q = /* @__PURE__ */ i(
218
+ if (n === "hours") {
219
+ const g = (Number.parseInt(U || "0", 10) + a + 24) % 24;
220
+ P(c(g));
221
+ return;
222
+ }
223
+ const f = (Number.parseInt(X || "0", 10) + a + 60) % 60;
224
+ S(c(f));
225
+ }, Ce = () => {
226
+ const n = Number.parseInt(W || "0", 10), a = Number.parseInt(U || "0", 10), t = Number.parseInt(X || "0", 10), f = Math.min(Math.max(n, 0), E), m = Math.min(Math.max(a, 0), 23), g = Math.min(Math.max(t, 0), 59), le = A(
227
+ e,
228
+ f,
229
+ m,
230
+ g,
231
+ s,
232
+ o
233
+ );
234
+ N(le), y(le ?? ""), M(c(f)), P(c(m)), S(c(g)), _(!1);
235
+ }, Q = p(
236
+ "mb-1 block text-center text-[11px] font-semibold leading-4",
237
+ b ? "text-neutral-100" : "text-slate-500"
238
+ ), w = p(
239
+ "h-6 w-full cursor-pointer rounded-md text-base font-semibold leading-none transition-colors",
240
+ b ? T.darkStep : T.step
241
+ ), Z = p(
242
+ "h-8 w-full rounded-md border px-1 text-center text-sm font-semibold outline-none transition-colors focus:ring-2",
243
+ b ? "border-neutral-300 bg-[#1F2025]" : "border-slate-200 bg-white",
244
+ T.input
245
+ ), $e = p(
246
+ "mt-2 h-8 w-full cursor-pointer rounded-md text-sm font-semibold transition-colors focus:ring-2",
247
+ b ? T.darkButton : T.button
248
+ ), ae = /* @__PURE__ */ l(
119
249
  "div",
120
250
  {
121
- onClick: oe,
122
- className: u(
251
+ onClick: Ne,
252
+ className: p(
123
253
  "flex cursor-pointer items-center justify-center rounded-md p-1 transition-colors",
124
- C ? "pointer-events-none opacity-50" : s ? "hover:bg-neutral-300 active:bg-neutral-200" : "hover:bg-slate-100 active:bg-slate-200"
254
+ O ? "pointer-events-none opacity-50" : b ? "hover:bg-neutral-300 active:bg-neutral-200" : "hover:bg-slate-100 active:bg-slate-200"
125
255
  ),
126
- children: /* @__PURE__ */ i(
127
- he,
256
+ children: /* @__PURE__ */ l(
257
+ De,
128
258
  {
129
259
  weight: "Linear",
130
260
  size: 20,
131
- className: u(
132
- s ? a || M ? "text-white" : "text-neutral-100" : "text-slate-400"
261
+ className: p(
262
+ b ? d || H ? "text-white" : "text-neutral-100" : "text-slate-400"
133
263
  )
134
264
  }
135
265
  )
136
266
  }
137
267
  );
138
- return /* @__PURE__ */ I("div", { ref: D, className: u("relative w-full group", X), children: [
139
- /* @__PURE__ */ i("div", { ref: te, children: /* @__PURE__ */ i(
140
- xe,
268
+ return /* @__PURE__ */ k("div", { ref: B, className: p("relative w-full group", he), children: [
269
+ /* @__PURE__ */ l("div", { ref: pe, children: /* @__PURE__ */ l(
270
+ Oe,
141
271
  {
142
- label: v,
143
- placeholder: se,
144
- value: A,
145
- onChange: le,
146
- icon: j === "left" ? Q : void 0,
147
- rightIcon: j === "right" ? Q : void 0,
148
- disabled: C,
149
- required: U,
150
- error: Y,
151
- darkMode: s,
152
- size: _,
153
- maxLength: e === "minute" ? 2 : 5,
154
- onFocus: ie,
155
- onBlur: ue,
156
- readOnly: !y,
157
- showClearButton: Z,
158
- onClear: ce
272
+ label: D,
273
+ placeholder: xe,
274
+ value: re,
275
+ onChange: we,
276
+ icon: ne === "left" ? ae : void 0,
277
+ rightIcon: ne === "right" ? ae : void 0,
278
+ disabled: O,
279
+ required: ce,
280
+ error: de,
281
+ darkMode: b,
282
+ size: fe,
283
+ maxLength: e === "duration" ? 24 : 5,
284
+ onFocus: ve,
285
+ onBlur: Ie,
286
+ readOnly: !L,
287
+ showClearButton: me,
288
+ onClear: ke
159
289
  }
160
290
  ) }),
161
- a && /* @__PURE__ */ I(
291
+ d && /* @__PURE__ */ k(
162
292
  "div",
163
293
  {
164
- className: u(
165
- "absolute top-[calc(100%+4px)] z-100 rounded-xl border p-3 shadow-xl",
294
+ className: p(
295
+ "absolute top-[calc(100%+4px)] z-100 rounded-lg border p-2.5 shadow-xl",
166
296
  "animate-in fade-in zoom-in-95 duration-200",
167
- e === "minute" ? "w-[168px]" : "w-60",
168
- s ? "border-neutral-200 bg-[#1F2025] text-neutral-50" : "border-slate-200 bg-white text-slate-700",
169
- z === "right" && "right-0 origin-top-right",
170
- z === "left" && "left-0 origin-top-left",
171
- z === "center" && "left-1/2 -translate-x-1/2 origin-top"
297
+ e === "duration" ? "w-[300px]" : "w-52",
298
+ b ? "border-neutral-200 bg-[#1F2025] text-neutral-50" : "border-slate-200 bg-white text-slate-700",
299
+ j === "right" && "right-0 origin-top-right",
300
+ j === "left" && "left-0 origin-top-left",
301
+ j === "center" && "left-1/2 -translate-x-1/2 origin-top"
172
302
  ),
173
- onMouseDown: (t) => t.stopPropagation(),
303
+ onMouseDown: (n) => n.stopPropagation(),
174
304
  children: [
175
- /* @__PURE__ */ I("div", { className: u("grid gap-3", e === "minute" ? "grid-cols-1" : "grid-cols-2"), children: [
176
- e === "time" && /* @__PURE__ */ I("div", { children: [
177
- /* @__PURE__ */ i("span", { className: u("mb-2 block text-center text-xs font-semibold", s ? "text-neutral-100" : "text-slate-500"), children: "Hour" }),
178
- /* @__PURE__ */ i(
179
- "button",
180
- {
181
- type: "button",
182
- onClick: () => O("hours", 1),
183
- className: u(
184
- "mb-1 h-8 w-full rounded-md text-lg leading-none transition-colors hover:cursor-pointer",
185
- s ? "hover:bg-neutral-300" : "hover:bg-slate-100"
186
- ),
187
- children: "+"
188
- }
305
+ /* @__PURE__ */ k(
306
+ "div",
307
+ {
308
+ className: p(
309
+ "grid gap-2",
310
+ e === "duration" ? "grid-cols-3" : "grid-cols-2"
189
311
  ),
190
- /* @__PURE__ */ i(
191
- "input",
192
- {
193
- value: H,
194
- onChange: (t) => J("hours", t.target.value),
195
- className: u(
196
- "h-10 w-full rounded-md border px-2 text-center text-base font-semibold outline-none",
197
- s ? "border-neutral-300 bg-[#1F2025]" : "border-slate-200 bg-white"
312
+ children: [
313
+ e === "duration" && /* @__PURE__ */ k("div", { className: "space-y-1", children: [
314
+ /* @__PURE__ */ l("span", { className: Q, children: v.day }),
315
+ /* @__PURE__ */ l(
316
+ "button",
317
+ {
318
+ type: "button",
319
+ onClick: () => I("days", 1),
320
+ className: w,
321
+ children: "+"
322
+ }
198
323
  ),
199
- inputMode: "numeric"
200
- }
201
- ),
202
- /* @__PURE__ */ i(
203
- "button",
204
- {
205
- type: "button",
206
- onClick: () => O("hours", -1),
207
- className: u(
208
- "mt-1 h-8 w-full rounded-md text-lg leading-none transition-colors hover:cursor-pointer",
209
- s ? "hover:bg-neutral-300" : "hover:bg-slate-100"
324
+ /* @__PURE__ */ l(
325
+ "input",
326
+ {
327
+ value: W,
328
+ onChange: (n) => J("days", n.target.value),
329
+ className: Z,
330
+ inputMode: "numeric"
331
+ }
210
332
  ),
211
- children: "-"
212
- }
213
- )
214
- ] }),
215
- /* @__PURE__ */ I("div", { children: [
216
- /* @__PURE__ */ i("span", { className: u("mb-2 block text-center text-xs font-semibold", s ? "text-neutral-100" : "text-slate-500"), children: "Minute" }),
217
- /* @__PURE__ */ i(
218
- "button",
219
- {
220
- type: "button",
221
- onClick: () => O("minutes", q),
222
- className: u(
223
- "mb-1 h-8 w-full rounded-md text-lg leading-none transition-colors hover:cursor-pointer",
224
- s ? "hover:bg-neutral-300" : "hover:bg-slate-100"
333
+ /* @__PURE__ */ l(
334
+ "button",
335
+ {
336
+ type: "button",
337
+ onClick: () => I("days", -1),
338
+ className: w,
339
+ children: "-"
340
+ }
341
+ )
342
+ ] }),
343
+ /* @__PURE__ */ k("div", { className: "space-y-1", children: [
344
+ /* @__PURE__ */ l("span", { className: Q, children: v.hour }),
345
+ /* @__PURE__ */ l(
346
+ "button",
347
+ {
348
+ type: "button",
349
+ onClick: () => I("hours", 1),
350
+ className: w,
351
+ children: "+"
352
+ }
225
353
  ),
226
- children: "+"
227
- }
228
- ),
229
- /* @__PURE__ */ i(
230
- "input",
231
- {
232
- value: P,
233
- onChange: (t) => J("minutes", t.target.value),
234
- className: u(
235
- "h-10 w-full rounded-md border px-2 text-center text-base font-semibold outline-none",
236
- s ? "border-neutral-300 bg-[#1F2025]" : "border-slate-200 bg-white"
354
+ /* @__PURE__ */ l(
355
+ "input",
356
+ {
357
+ value: U,
358
+ onChange: (n) => J("hours", n.target.value),
359
+ className: Z,
360
+ inputMode: "numeric"
361
+ }
237
362
  ),
238
- inputMode: "numeric"
239
- }
240
- ),
241
- /* @__PURE__ */ i(
242
- "button",
243
- {
244
- type: "button",
245
- onClick: () => O("minutes", -q),
246
- className: u(
247
- "mt-1 h-8 w-full rounded-md text-lg leading-none transition-colors hover:cursor-pointer",
248
- s ? "hover:bg-neutral-300" : "hover:bg-slate-100"
363
+ /* @__PURE__ */ l(
364
+ "button",
365
+ {
366
+ type: "button",
367
+ onClick: () => I("hours", -1),
368
+ className: w,
369
+ children: "-"
370
+ }
371
+ )
372
+ ] }),
373
+ /* @__PURE__ */ k("div", { className: "space-y-1", children: [
374
+ /* @__PURE__ */ l("span", { className: Q, children: v.minute }),
375
+ /* @__PURE__ */ l(
376
+ "button",
377
+ {
378
+ type: "button",
379
+ onClick: () => I("minutes", ue),
380
+ className: w,
381
+ children: "+"
382
+ }
383
+ ),
384
+ /* @__PURE__ */ l(
385
+ "input",
386
+ {
387
+ value: X,
388
+ onChange: (n) => J("minutes", n.target.value),
389
+ className: Z,
390
+ inputMode: "numeric"
391
+ }
249
392
  ),
250
- children: "-"
251
- }
252
- )
253
- ] })
254
- ] }),
255
- /* @__PURE__ */ i(
393
+ /* @__PURE__ */ l(
394
+ "button",
395
+ {
396
+ type: "button",
397
+ onClick: () => I("minutes", -ue),
398
+ className: w,
399
+ children: "-"
400
+ }
401
+ )
402
+ ] })
403
+ ]
404
+ }
405
+ ),
406
+ /* @__PURE__ */ l(
256
407
  "button",
257
408
  {
258
409
  type: "button",
259
- onClick: ae,
260
- className: "mt-3 h-9 w-full rounded-md bg-blue-600 text-sm font-semibold text-white transition-colors hover:bg-blue-700 hover:cursor-pointer",
261
- children: "OK"
410
+ onClick: Ce,
411
+ className: $e,
412
+ children: v.ok
262
413
  }
263
414
  )
264
415
  ]
@@ -267,7 +418,7 @@ const m = (o) => o.toString().padStart(2, "0"), ve = (o, l) => `${m(o)}:${m(l)}`
267
418
  ] });
268
419
  }
269
420
  );
270
- we.displayName = "MciTimePicker";
421
+ Ae.displayName = "MciTimePicker";
271
422
  export {
272
- we as default
423
+ Ae as default
273
424
  };