@mci-ui/mci-ui 0.0.84 → 0.0.85
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/assets/icons/check.svg.js +5 -0
- package/dist/assets/icons/close.svg.js +5 -0
- package/dist/assets/icons/loaderIcon.svg.js +5 -0
- package/dist/index.js +53 -0
- package/dist/shared/lib/hooks/useTableColumnSettings.js +132 -0
- package/dist/shared/lib/locales.js +101 -0
- package/dist/shared/lib/uploadLanguage.js +80 -0
- package/dist/shared/lib/utils.js +20 -0
- package/dist/shared/ui/MciModal/MciModal.js +97 -0
- package/dist/shared/ui/mciAccordion/MciAccordion.js +74 -0
- package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +39 -0
- package/dist/shared/ui/mciButton/MciButton.js +63 -0
- package/dist/shared/ui/mciCheck/MciCheck.js +170 -0
- package/dist/shared/ui/mciCollapse/MciCollapse.js +60 -0
- package/dist/shared/ui/mciDrawer/MciDrawer.js +108 -0
- package/dist/shared/ui/mciIdentityInput/MciIdentityInput.js +30 -0
- package/dist/shared/ui/mciIdentityInput/mci-identity-input.utils.js +32 -0
- package/dist/shared/ui/mciInput/MciInput.js +225 -0
- package/dist/shared/ui/mciInput/mci-input.utils.js +49 -0
- package/dist/shared/ui/mciLoader/MciLoader.js +38 -0
- package/dist/shared/ui/mciPagination/MciPagination.js +135 -0
- package/dist/shared/ui/mciPagination/mci-pagination.utils.js +12 -0
- package/dist/shared/ui/mciPhone/MciPhone.js +83 -0
- package/dist/shared/ui/mciPhone/mci-phone.utils.js +47 -0
- package/dist/shared/ui/mciPicker/MciPicker.js +256 -0
- package/dist/shared/ui/mciPicker/mci-picker.utils.js +62 -0
- package/dist/shared/ui/mciSelect/MciSelect.js +226 -0
- package/dist/shared/ui/mciSelect/mci-select.utils.js +52 -0
- package/dist/shared/ui/mciSkeleton/MciSkeleton.js +29 -0
- package/dist/shared/ui/mciTable/MciTable.js +153 -0
- package/dist/shared/ui/mciTable/MciTableClamp2.js +7 -0
- package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +184 -0
- package/dist/shared/ui/mciTable/mci-table.utils.js +14 -0
- package/dist/shared/ui/mciTabs/MciTabs.js +131 -0
- package/dist/shared/ui/mciTag/MciTag.js +46 -0
- package/dist/shared/ui/mciTextarea/MciTextarea.js +56 -0
- package/dist/shared/ui/mciToast/MciToast.js +106 -0
- package/dist/shared/ui/mciToast/mci-toast.utils.js +47 -0
- package/dist/shared/ui/mciToggle/MciToggle.js +77 -0
- package/dist/shared/ui/mciTooltip/MciTooltip.js +52 -0
- package/dist/shared/ui/mciUpload/MciUpload.js +337 -0
- package/dist/shared/ui/mciUpload/mci-upload.utils.js +186 -0
- package/package.json +15 -12
- package/dist/index.es.js +0 -3387
- package/dist/index.umd.js +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const o = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 11, height: 8, viewBox: "0 0 11 8", fill: "none", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M0.625 3.76944L3.76944 6.91389L10.0694 0.625", stroke: "currentColor", strokeWidth: 1.25, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
3
|
+
export {
|
|
4
|
+
o as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const o = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M7.75739 7.75735L16.2427 16.2426", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ e.createElement("path", { d: "M7.75733 16.2426L16.2426 7.75735", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
3
|
+
export {
|
|
4
|
+
o as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const C = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 177 177", fill: "none", ...t }, /* @__PURE__ */ e.createElement("path", { opacity: 0.083334, d: "M94.5 48.5C94.5 41.8726 91.8137 36.5 88.5 36.5C85.1863 36.5 82.5 41.8726 82.5 48.5C82.5 55.1274 85.1863 60.5 88.5 60.5C91.8137 60.5 94.5 55.1274 94.5 48.5Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.166667, d: "M113.697 56.8591C117.011 51.1196 117.371 45.1237 114.501 43.4668C111.631 41.8099 106.618 45.1196 103.305 50.8591C99.991 56.5986 99.6311 62.5946 102.501 64.2514C105.371 65.9083 110.383 62.5986 113.697 56.8591Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.25, d: "M126.141 73.696C131.88 70.3823 135.19 65.3696 133.533 62.4999C131.876 59.6301 125.88 59.99 120.141 63.3037C114.401 66.6174 111.092 71.6301 112.749 74.4999C114.405 77.3696 120.401 77.0097 126.141 73.696Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.333334, d: "M128.5 94.5C135.127 94.5 140.5 91.8137 140.5 88.5C140.5 85.1863 135.127 82.5 128.5 82.5C121.873 82.5 116.5 85.1863 116.5 88.5C116.5 91.8137 121.873 94.5 128.5 94.5Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.416667, d: "M120.141 113.696C125.88 117.01 131.876 117.37 133.533 114.5C135.19 111.63 131.88 106.617 126.141 103.304C120.401 99.99 114.405 99.6301 112.749 102.5C111.092 105.37 114.401 110.382 120.141 113.696Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.5, d: "M103.303 126.141C106.617 131.88 111.629 135.19 114.499 133.533C117.369 131.876 117.009 125.88 113.695 120.141C110.382 114.401 105.369 111.092 102.499 112.749C99.6294 114.405 99.9893 120.401 103.303 126.141Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.583334, d: "M82.5 128.5C82.5 135.127 85.1863 140.5 88.5 140.5C91.8137 140.5 94.5 135.127 94.5 128.5C94.5 121.873 91.8137 116.5 88.5 116.5C85.1863 116.5 82.5 121.873 82.5 128.5Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.666667, d: "M63.303 120.141C59.9893 125.88 59.6294 131.876 62.4992 133.533C65.3689 135.19 70.3816 131.88 73.6953 126.141C77.009 120.401 77.3689 114.405 74.4992 112.749C71.6294 111.092 66.6167 114.401 63.303 120.141Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.75, d: "M50.8591 103.304C45.1196 106.618 41.8099 111.63 43.4668 114.5C45.1237 117.37 51.1196 117.01 56.8591 113.696C62.5986 110.383 65.9083 105.37 64.2514 102.5C62.5946 99.6304 56.5986 99.9903 50.8591 103.304Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.833334, d: "M48.5 82.5C41.8726 82.5 36.5 85.1863 36.5 88.5C36.5 91.8137 41.8726 94.5 48.5 94.5C55.1274 94.5 60.5 91.8137 60.5 88.5C60.5 85.1863 55.1274 82.5 48.5 82.5Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { opacity: 0.916667, d: "M56.8591 63.304C51.1196 59.9903 45.1237 59.6304 43.4668 62.5001C41.8099 65.3699 45.1196 70.3826 50.8591 73.6963C56.5986 77.01 62.5946 77.3699 64.2514 74.5001C65.9083 71.6304 62.5986 66.6177 56.8591 63.304Z", fill: "currentColor" }), /* @__PURE__ */ e.createElement("path", { d: "M73.697 50.8591C70.3833 45.1196 65.3706 41.8099 62.5008 43.4668C59.6311 45.1237 59.991 51.1196 63.3047 56.8591C66.6184 62.5986 71.6311 65.9083 74.5008 64.2514C77.3706 62.5946 77.0107 56.5986 73.697 50.8591Z", fill: "currentColor" }));
|
|
3
|
+
export {
|
|
4
|
+
C as default
|
|
5
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { default as t } from "./shared/ui/mciBreadcrumb/MciBreadcrumb.js";
|
|
3
|
+
import { default as f } from "./shared/ui/mciButton/MciButton.js";
|
|
4
|
+
import { default as i } from "./shared/ui/mciCheck/MciCheck.js";
|
|
5
|
+
import { default as d } from "./shared/ui/mciCollapse/MciCollapse.js";
|
|
6
|
+
import { default as s } from "./shared/ui/mciAccordion/MciAccordion.js";
|
|
7
|
+
import { default as m } from "./shared/ui/mciDrawer/MciDrawer.js";
|
|
8
|
+
import { default as M } from "./shared/ui/mciInput/MciInput.js";
|
|
9
|
+
import { default as T } from "./shared/ui/mciPicker/MciPicker.js";
|
|
10
|
+
import { default as g } from "./shared/ui/mciSelect/MciSelect.js";
|
|
11
|
+
import { default as P } from "./shared/ui/mciTable/MciTable.js";
|
|
12
|
+
import { default as I } from "./shared/ui/mciUpload/MciUpload.js";
|
|
13
|
+
import { default as h } from "./shared/ui/MciModal/MciModal.js";
|
|
14
|
+
import { default as w } from "./shared/ui/mciPagination/MciPagination.js";
|
|
15
|
+
import { default as A } from "./shared/ui/mciSkeleton/MciSkeleton.js";
|
|
16
|
+
import { default as L } from "./shared/ui/mciTabs/MciTabs.js";
|
|
17
|
+
import { default as j } from "./shared/ui/mciTag/MciTag.js";
|
|
18
|
+
import { default as v } from "./shared/ui/mciTextarea/MciTextarea.js";
|
|
19
|
+
import { default as E } from "./shared/ui/mciToast/MciToast.js";
|
|
20
|
+
import { default as G } from "./shared/ui/mciTooltip/MciTooltip.js";
|
|
21
|
+
import { default as J } from "./shared/ui/mciToggle/MciToggle.js";
|
|
22
|
+
import { default as N } from "./shared/ui/mciLoader/MciLoader.js";
|
|
23
|
+
import { default as Q } from "./shared/ui/mciPhone/MciPhone.js";
|
|
24
|
+
import { default as V } from "./shared/ui/mciIdentityInput/MciIdentityInput.js";
|
|
25
|
+
import { default as X } from "./shared/ui/mciTable/MciTableColumnsPanel.js";
|
|
26
|
+
import { default as Z } from "./shared/lib/hooks/useTableColumnSettings.js";
|
|
27
|
+
export {
|
|
28
|
+
s as MciAccordion,
|
|
29
|
+
t as MciBreadcrumb,
|
|
30
|
+
f as MciButton,
|
|
31
|
+
i as MciCheck,
|
|
32
|
+
d as MciCollapse,
|
|
33
|
+
m as MciDrawer,
|
|
34
|
+
V as MciIdentityInput,
|
|
35
|
+
M as MciInput,
|
|
36
|
+
N as MciLoader,
|
|
37
|
+
h as MciModal,
|
|
38
|
+
w as MciPagination,
|
|
39
|
+
Q as MciPhone,
|
|
40
|
+
T as MciPicker,
|
|
41
|
+
g as MciSelect,
|
|
42
|
+
A as MciSkeleton,
|
|
43
|
+
P as MciTable,
|
|
44
|
+
X as MciTableColumnsPanel,
|
|
45
|
+
L as MciTabs,
|
|
46
|
+
j as MciTag,
|
|
47
|
+
v as MciTextarea,
|
|
48
|
+
E as MciToast,
|
|
49
|
+
J as MciToggle,
|
|
50
|
+
G as MciTooltip,
|
|
51
|
+
I as MciUpload,
|
|
52
|
+
Z as useTableColumnSettings
|
|
53
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { useMemo as m, useState as R, useEffect as p, useCallback as A } from "react";
|
|
2
|
+
const I = (d) => Array.isArray(d) && d.every((t) => typeof t == "string"), X = (d) => {
|
|
3
|
+
if (!d) return null;
|
|
4
|
+
try {
|
|
5
|
+
const t = JSON.parse(d);
|
|
6
|
+
if (typeof t != "object" || t === null) return null;
|
|
7
|
+
const s = t;
|
|
8
|
+
return !I(s.order) || !I(s.hidden) ? null : { order: s.order, hidden: s.hidden };
|
|
9
|
+
} catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
}, S = (d) => {
|
|
13
|
+
const t = /* @__PURE__ */ new Set(), s = [];
|
|
14
|
+
for (const l of d)
|
|
15
|
+
t.has(l) || (t.add(l), s.push(l));
|
|
16
|
+
return s;
|
|
17
|
+
}, q = (d) => new Set((d ?? []).map(String)), N = (d, t) => {
|
|
18
|
+
const s = t ? S(t.filter((l) => d.includes(l))) : [];
|
|
19
|
+
return S([...s, ...d]);
|
|
20
|
+
}, V = (d, t) => {
|
|
21
|
+
if (!t?.length) return [];
|
|
22
|
+
const s = q(t);
|
|
23
|
+
return d.filter((l) => !s.has(l));
|
|
24
|
+
}, B = (d, t) => Math.max(0, Math.min(d, t)), x = (d, t, s) => {
|
|
25
|
+
const l = new Set(t), b = S(d.filter((r) => l.has(r))), H = Math.max(0, t.length - s);
|
|
26
|
+
return b.slice(0, H);
|
|
27
|
+
};
|
|
28
|
+
function P(d) {
|
|
29
|
+
const { storageKey: t, columns: s, defaultVisibleKeys: l, defaultOrder: b, minVisible: H = 5 } = d, r = m(() => s.map((e) => String(e.key)), [s]), y = m(() => new Set(r), [r]), h = m(
|
|
30
|
+
() => B(H, r.length),
|
|
31
|
+
[r.length, H]
|
|
32
|
+
), [g, w] = R(() => {
|
|
33
|
+
const e = N(
|
|
34
|
+
r,
|
|
35
|
+
b?.map(String) ?? []
|
|
36
|
+
), i = V(
|
|
37
|
+
r,
|
|
38
|
+
l?.map(String) ?? []
|
|
39
|
+
);
|
|
40
|
+
if (typeof window > "u")
|
|
41
|
+
return {
|
|
42
|
+
order: e,
|
|
43
|
+
hidden: x(i, r, h)
|
|
44
|
+
};
|
|
45
|
+
const n = X(window.localStorage.getItem(t)), c = S((n?.order ?? []).filter((f) => y.has(f))), a = S([...c, ...e, ...r]), o = S((n?.hidden ?? []).filter((f) => y.has(f)));
|
|
46
|
+
return {
|
|
47
|
+
order: a,
|
|
48
|
+
hidden: x(n ? o : i, r, h)
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
p(() => {
|
|
52
|
+
if (!(typeof window > "u"))
|
|
53
|
+
try {
|
|
54
|
+
window.localStorage.setItem(t, JSON.stringify(g));
|
|
55
|
+
} catch {
|
|
56
|
+
}
|
|
57
|
+
}, [g, t]), p(() => {
|
|
58
|
+
w((e) => {
|
|
59
|
+
const i = S([
|
|
60
|
+
...e.order.filter((o) => y.has(o)),
|
|
61
|
+
...r.filter((o) => !e.order.includes(o))
|
|
62
|
+
]), n = x(e.hidden, r, h), c = i.length === e.order.length && i.every((o, u) => o === e.order[u]), a = n.length === e.hidden.length && n.every((o, u) => o === e.hidden[u]);
|
|
63
|
+
return c && a ? e : { order: i, hidden: n };
|
|
64
|
+
});
|
|
65
|
+
}, [r, y, h]);
|
|
66
|
+
const M = m(() => new Set(g.hidden), [g.hidden]), E = m(() => {
|
|
67
|
+
const e = /* @__PURE__ */ new Map();
|
|
68
|
+
return g.order.forEach((i, n) => e.set(i, n)), [...s].sort((i, n) => {
|
|
69
|
+
const c = e.get(String(i.key)) ?? Number.MAX_SAFE_INTEGER, a = e.get(String(n.key)) ?? Number.MAX_SAFE_INTEGER;
|
|
70
|
+
return c - a;
|
|
71
|
+
});
|
|
72
|
+
}, [s, g.order]), K = m(
|
|
73
|
+
() => E.filter((e) => !M.has(String(e.key))),
|
|
74
|
+
[E, M]
|
|
75
|
+
), k = m(
|
|
76
|
+
() => g.hidden.filter((e) => y.has(e)),
|
|
77
|
+
[g.hidden, y]
|
|
78
|
+
), T = r.length - k.length, _ = A((e) => {
|
|
79
|
+
const i = String(e);
|
|
80
|
+
w((n) => {
|
|
81
|
+
if (n.hidden.includes(i))
|
|
82
|
+
return { ...n, hidden: n.hidden.filter((u) => u !== i) };
|
|
83
|
+
if (r.length - n.hidden.length <= h) return n;
|
|
84
|
+
const o = x([...n.hidden, i], r, h);
|
|
85
|
+
return { ...n, hidden: o };
|
|
86
|
+
});
|
|
87
|
+
}, [r, h]), j = A((e, i) => {
|
|
88
|
+
w((n) => {
|
|
89
|
+
const c = n.order.slice();
|
|
90
|
+
if (e < 0 || i < 0 || e >= c.length || i >= c.length) return n;
|
|
91
|
+
const [a] = c.splice(e, 1);
|
|
92
|
+
return c.splice(i, 0, a), { ...n, order: c };
|
|
93
|
+
});
|
|
94
|
+
}, []), F = A((e, i, n = "before") => {
|
|
95
|
+
const c = String(e), a = String(i);
|
|
96
|
+
c !== a && w((o) => {
|
|
97
|
+
const u = o.order.slice(), f = u.indexOf(c), O = u.indexOf(a);
|
|
98
|
+
if (f < 0 || O < 0 || f === O) return o;
|
|
99
|
+
let C = n === "after" ? O + 1 : O;
|
|
100
|
+
if (f < C && (C -= 1), C === f) return o;
|
|
101
|
+
const [J] = u.splice(f, 1);
|
|
102
|
+
return u.splice(C, 0, J), { ...o, order: u };
|
|
103
|
+
});
|
|
104
|
+
}, []), G = A(() => {
|
|
105
|
+
w(() => {
|
|
106
|
+
const e = N(
|
|
107
|
+
r,
|
|
108
|
+
b?.map(String) ?? []
|
|
109
|
+
), i = V(
|
|
110
|
+
r,
|
|
111
|
+
l?.map(String) ?? []
|
|
112
|
+
);
|
|
113
|
+
return {
|
|
114
|
+
order: e,
|
|
115
|
+
hidden: x(i, r, h)
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
}, [r, b, l, h]);
|
|
119
|
+
return {
|
|
120
|
+
orderedAllColumns: E,
|
|
121
|
+
orderedColumns: K,
|
|
122
|
+
hiddenKeys: k,
|
|
123
|
+
visibleCount: T,
|
|
124
|
+
toggleColumn: _,
|
|
125
|
+
moveColumn: j,
|
|
126
|
+
moveColumnByKey: F,
|
|
127
|
+
reset: G
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export {
|
|
131
|
+
P as default
|
|
132
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
const a = {
|
|
2
|
+
uz: {
|
|
3
|
+
months: [
|
|
4
|
+
"Yanvar",
|
|
5
|
+
"Fevral",
|
|
6
|
+
"Mart",
|
|
7
|
+
"Aprel",
|
|
8
|
+
"May",
|
|
9
|
+
"Iyun",
|
|
10
|
+
"Iyul",
|
|
11
|
+
"Avgust",
|
|
12
|
+
"Sentabr",
|
|
13
|
+
"Oktabr",
|
|
14
|
+
"Noyabr",
|
|
15
|
+
"Dekabr"
|
|
16
|
+
],
|
|
17
|
+
monthsShort: [
|
|
18
|
+
"Yan",
|
|
19
|
+
"Fev",
|
|
20
|
+
"Mar",
|
|
21
|
+
"Apr",
|
|
22
|
+
"May",
|
|
23
|
+
"Iyn",
|
|
24
|
+
"Iyl",
|
|
25
|
+
"Avg",
|
|
26
|
+
"Sen",
|
|
27
|
+
"Okt",
|
|
28
|
+
"Noy",
|
|
29
|
+
"Dek"
|
|
30
|
+
],
|
|
31
|
+
weekdays: ["Yakshanba", "Dushanba", "Seshanba", "Chorshanba", "Payshanba", "Juma", "Shanba"],
|
|
32
|
+
weekdaysShort: ["Ya", "Du", "Se", "Ch", "Pa", "Ju", "Sh"]
|
|
33
|
+
},
|
|
34
|
+
ru: {
|
|
35
|
+
months: [
|
|
36
|
+
"Январь",
|
|
37
|
+
"Февраль",
|
|
38
|
+
"Март",
|
|
39
|
+
"Апрель",
|
|
40
|
+
"Май",
|
|
41
|
+
"Июнь",
|
|
42
|
+
"Июль",
|
|
43
|
+
"Август",
|
|
44
|
+
"Сентябрь",
|
|
45
|
+
"Октябрь",
|
|
46
|
+
"Ноябрь",
|
|
47
|
+
"Декабрь"
|
|
48
|
+
],
|
|
49
|
+
monthsShort: [
|
|
50
|
+
"Янв",
|
|
51
|
+
"Фев",
|
|
52
|
+
"Мар",
|
|
53
|
+
"Апр",
|
|
54
|
+
"Май",
|
|
55
|
+
"Июн",
|
|
56
|
+
"Июл",
|
|
57
|
+
"Авг",
|
|
58
|
+
"Сен",
|
|
59
|
+
"Окт",
|
|
60
|
+
"Ноя",
|
|
61
|
+
"Дек"
|
|
62
|
+
],
|
|
63
|
+
weekdays: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"],
|
|
64
|
+
weekdaysShort: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"]
|
|
65
|
+
},
|
|
66
|
+
en: {
|
|
67
|
+
months: [
|
|
68
|
+
"January",
|
|
69
|
+
"February",
|
|
70
|
+
"March",
|
|
71
|
+
"April",
|
|
72
|
+
"May",
|
|
73
|
+
"June",
|
|
74
|
+
"July",
|
|
75
|
+
"August",
|
|
76
|
+
"September",
|
|
77
|
+
"October",
|
|
78
|
+
"November",
|
|
79
|
+
"December"
|
|
80
|
+
],
|
|
81
|
+
monthsShort: [
|
|
82
|
+
"Jan",
|
|
83
|
+
"Feb",
|
|
84
|
+
"Mar",
|
|
85
|
+
"Apr",
|
|
86
|
+
"May",
|
|
87
|
+
"Jun",
|
|
88
|
+
"Jul",
|
|
89
|
+
"Aug",
|
|
90
|
+
"Sep",
|
|
91
|
+
"Oct",
|
|
92
|
+
"Nov",
|
|
93
|
+
"Dec"
|
|
94
|
+
],
|
|
95
|
+
weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
96
|
+
weekdaysShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
a as locales
|
|
101
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
uz: {
|
|
3
|
+
dragAndDrop: "Faylni bu yerga torting",
|
|
4
|
+
clickToUpload: "yoki bosib tanlang",
|
|
5
|
+
or: "yoki",
|
|
6
|
+
dropHereTitle: "Faylni shu yerga yuklang",
|
|
7
|
+
fileRequirements: (e, l, a, i) => `${e ? `Maksimum ${l} ta fayl` : "1 ta fayl"} • ${a}MB gacha • ${i !== "*/*" ? `Format: ${i}` : "Barcha formatlar"}`,
|
|
8
|
+
selectedFiles: "Tanlangan fayllar",
|
|
9
|
+
clearAll: "Barchasini o‘chirish",
|
|
10
|
+
uploading: "Yuklanmoqda...",
|
|
11
|
+
success: "Yuklandi",
|
|
12
|
+
error: "Xatolik",
|
|
13
|
+
preview: "Ko‘rish",
|
|
14
|
+
download: "Yuklab olish",
|
|
15
|
+
remove: "O‘chirish",
|
|
16
|
+
maxFilesError: (e) => `Maksimum ${e} ta fayl yuklash mumkin`,
|
|
17
|
+
fileSizeError: (e, l) => `"${e}" fayl hajmi ${l}MB dan kichik bo‘lishi kerak`,
|
|
18
|
+
fileTypeError: (e) => `"${e}" fayl turi qabul qilinmaydi`,
|
|
19
|
+
blockedFileTypeError: (e) => `"${e}" fayli xavfsizlik sabab bloklandi (arxiv yoki bajariladigan fayl)`,
|
|
20
|
+
uploadFailed: "Yuklash muvaffaqiyatsiz tugadi",
|
|
21
|
+
file: "Fayl",
|
|
22
|
+
image: "Rasm",
|
|
23
|
+
video: "Video",
|
|
24
|
+
audio: "Audio",
|
|
25
|
+
document: "Hujjat"
|
|
26
|
+
},
|
|
27
|
+
ru: {
|
|
28
|
+
dragAndDrop: "Перетащите файл сюда",
|
|
29
|
+
clickToUpload: "или выберите нажатием",
|
|
30
|
+
or: "или",
|
|
31
|
+
dropHereTitle: "Загрузите свой файл сюда",
|
|
32
|
+
fileRequirements: (e, l, a, i) => `${e ? `Максимум ${l} файлов` : "1 файл"} • До ${a}MB • ${i !== "*/*" ? `Формат: ${i}` : "Все форматы"}`,
|
|
33
|
+
selectedFiles: "Выбранные файлы",
|
|
34
|
+
clearAll: "Очистить все",
|
|
35
|
+
uploading: "Загружается...",
|
|
36
|
+
success: "Загружено",
|
|
37
|
+
error: "Ошибка",
|
|
38
|
+
preview: "Просмотр",
|
|
39
|
+
download: "Скачать",
|
|
40
|
+
remove: "Удалить",
|
|
41
|
+
maxFilesError: (e) => `Можно загрузить максимум ${e} файлов`,
|
|
42
|
+
fileSizeError: (e, l) => `Размер файла "${e}" должен быть меньше ${l}MB`,
|
|
43
|
+
fileTypeError: (e) => `Тип файла "${e}" не поддерживается`,
|
|
44
|
+
blockedFileTypeError: (e) => `Файл "${e}" заблокирован политикой безопасности (архив или исполняемый тип)`,
|
|
45
|
+
uploadFailed: "Не удалось загрузить файл",
|
|
46
|
+
file: "Файл",
|
|
47
|
+
image: "Изображение",
|
|
48
|
+
video: "Видео",
|
|
49
|
+
audio: "Аудио",
|
|
50
|
+
document: "Документ"
|
|
51
|
+
},
|
|
52
|
+
en: {
|
|
53
|
+
dragAndDrop: "Drag and drop a file here",
|
|
54
|
+
clickToUpload: "or click to select",
|
|
55
|
+
or: "or",
|
|
56
|
+
dropHereTitle: "Upload your file here",
|
|
57
|
+
fileRequirements: (e, l, a, i) => `${e ? `Up to ${l} files` : "1 file"} • Up to ${a}MB • ${i !== "*/*" ? `Format: ${i}` : "All formats"}`,
|
|
58
|
+
selectedFiles: "Selected files",
|
|
59
|
+
clearAll: "Clear all",
|
|
60
|
+
uploading: "Uploading...",
|
|
61
|
+
success: "Uploaded",
|
|
62
|
+
error: "Error",
|
|
63
|
+
preview: "Preview",
|
|
64
|
+
download: "Download",
|
|
65
|
+
remove: "Remove",
|
|
66
|
+
maxFilesError: (e) => `You can upload up to ${e} files`,
|
|
67
|
+
fileSizeError: (e, l) => `File "${e}" must be smaller than ${l}MB`,
|
|
68
|
+
fileTypeError: (e) => `File type "${e}" is not supported`,
|
|
69
|
+
blockedFileTypeError: (e) => `File "${e}" is blocked by security policy (archive or executable type)`,
|
|
70
|
+
uploadFailed: "Upload failed",
|
|
71
|
+
file: "File",
|
|
72
|
+
image: "Image",
|
|
73
|
+
video: "Video",
|
|
74
|
+
audio: "Audio",
|
|
75
|
+
document: "Document"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
export {
|
|
79
|
+
r as uploadLanguages
|
|
80
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { clsx as r } from "clsx";
|
|
2
|
+
import { twMerge as i } from "tailwind-merge";
|
|
3
|
+
function u(...e) {
|
|
4
|
+
return i(r(e));
|
|
5
|
+
}
|
|
6
|
+
function a(e) {
|
|
7
|
+
return { handleEscape: (t) => {
|
|
8
|
+
t.key === "Escape" && e();
|
|
9
|
+
} };
|
|
10
|
+
}
|
|
11
|
+
function l(e, n) {
|
|
12
|
+
return { handleClick: (c) => {
|
|
13
|
+
e.current && !e.current.contains(c.target) && n();
|
|
14
|
+
} };
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
u as cn,
|
|
18
|
+
l as useClickOutside,
|
|
19
|
+
a as useEscapeKey
|
|
20
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import k from "../../../assets/icons/close.svg.js";
|
|
3
|
+
import { useRef as E, useEffect as b } from "react";
|
|
4
|
+
import { useEscapeKey as j, useClickOutside as w, cn as n } from "../../lib/utils.js";
|
|
5
|
+
function z({
|
|
6
|
+
show: t,
|
|
7
|
+
setShow: s,
|
|
8
|
+
title: i,
|
|
9
|
+
description: r,
|
|
10
|
+
Header: c,
|
|
11
|
+
Body: m,
|
|
12
|
+
footer: u,
|
|
13
|
+
handleClickOutside: a = !1,
|
|
14
|
+
showCloseIcon: p = !0,
|
|
15
|
+
showHeader: x = !0,
|
|
16
|
+
overlayClassName: v,
|
|
17
|
+
containerClassName: h,
|
|
18
|
+
bodyClassName: y,
|
|
19
|
+
footerClassName: N
|
|
20
|
+
}) {
|
|
21
|
+
const f = E(null), { handleEscape: o } = j(() => s(!1));
|
|
22
|
+
b(() => (t ? (document.addEventListener("keydown", o), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => document.removeEventListener("keydown", o)), [t, o]);
|
|
23
|
+
const { handleClick: l } = w(f, () => {
|
|
24
|
+
a && s(!1);
|
|
25
|
+
});
|
|
26
|
+
b(() => (t && a && document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l)), [t, l, a]);
|
|
27
|
+
const g = x && !!(c || i || r);
|
|
28
|
+
return /* @__PURE__ */ e(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: n(
|
|
32
|
+
"bg-black/40 fixed inset-0 z-50 flex justify-center transition-all duration-500 ease-in-out",
|
|
33
|
+
"items-end sm:items-center",
|
|
34
|
+
t ? "opacity-100" : "pointer-events-none opacity-0",
|
|
35
|
+
v
|
|
36
|
+
),
|
|
37
|
+
children: /* @__PURE__ */ d(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref: f,
|
|
41
|
+
className: n(
|
|
42
|
+
"relative bg-white w-full",
|
|
43
|
+
"sm:max-w-[720px]",
|
|
44
|
+
"rounded-t-2xl sm:rounded-2xl",
|
|
45
|
+
"transition-all duration-500 ease-out",
|
|
46
|
+
t ? "scale-100 opacity-100" : "scale-95 opacity-0",
|
|
47
|
+
h
|
|
48
|
+
),
|
|
49
|
+
children: [
|
|
50
|
+
g && /* @__PURE__ */ d("div", { className: "border-b border-slate-200 flex items-start justify-between p-4 sm:p-6 mb-4", children: [
|
|
51
|
+
c || /* @__PURE__ */ d("div", { className: "block", children: [
|
|
52
|
+
/* @__PURE__ */ e("h2", { className: "text-h3 font-semibold text-black", children: i }),
|
|
53
|
+
r && /* @__PURE__ */ e("p", { className: "text-base text-slate-base font-normal mt-2", children: r })
|
|
54
|
+
] }),
|
|
55
|
+
p && /* @__PURE__ */ e(
|
|
56
|
+
"button",
|
|
57
|
+
{
|
|
58
|
+
onClick: () => s(!1),
|
|
59
|
+
className: "bg-slate-100 rounded-xl w-12 h-12 hover:cursor-pointer text-black transition flex items-center justify-center group",
|
|
60
|
+
"aria-label": "Close modal",
|
|
61
|
+
type: "button",
|
|
62
|
+
children: /* @__PURE__ */ e(k, { className: "h-6 w-6 transition-transform duration-300 group-hover:rotate-180" })
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] }),
|
|
66
|
+
m && /* @__PURE__ */ e(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: n(
|
|
70
|
+
"scrollbar-thin scrollbar-thumb-slate-200 overflow-y-auto",
|
|
71
|
+
"max-h-[70dvh] sm:max-h-96",
|
|
72
|
+
"px-4 sm:px-6 mb-2",
|
|
73
|
+
y
|
|
74
|
+
),
|
|
75
|
+
children: m
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
u && /* @__PURE__ */ e(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: n(
|
|
82
|
+
"flex items-center justify-end gap-3 border-t border-slate-200",
|
|
83
|
+
"p-4 sm:p-6",
|
|
84
|
+
N
|
|
85
|
+
),
|
|
86
|
+
children: u
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
z as default
|
|
97
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { AltArrowDown as h } from "@solar-icons/react";
|
|
3
|
+
import m, { useState as y, useRef as w, useId as x } from "react";
|
|
4
|
+
import { cn as n } from "../../lib/utils.js";
|
|
5
|
+
const A = (e) => e.type.displayName, f = (e, t, i) => m.Children.toArray(e).find(
|
|
6
|
+
(o) => m.isValidElement(o) && (A(o) === t || o.type === i)
|
|
7
|
+
) ?? null;
|
|
8
|
+
function d({
|
|
9
|
+
children: e,
|
|
10
|
+
className: t
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ r("div", { className: n("text-base font-medium text-black", t), children: e });
|
|
13
|
+
}
|
|
14
|
+
d.displayName = "AccordionTitle";
|
|
15
|
+
function c({
|
|
16
|
+
children: e,
|
|
17
|
+
className: t
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ r("div", { className: n("p-5 text-base", t), children: e });
|
|
20
|
+
}
|
|
21
|
+
c.displayName = "AccordionContent";
|
|
22
|
+
function u({ children: e, defaultValue: t = !1, icon: i, className: o }) {
|
|
23
|
+
const [a, p] = y(t), b = w(null), s = x(), N = () => p((g) => !g);
|
|
24
|
+
return /* @__PURE__ */ l("div", { className: n("overflow-hidden rounded-xl border border-slate-200", o), children: [
|
|
25
|
+
/* @__PURE__ */ l(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: N,
|
|
30
|
+
"aria-expanded": a,
|
|
31
|
+
"aria-controls": s,
|
|
32
|
+
className: n(
|
|
33
|
+
"flex w-full items-center justify-between gap-2 p-5 transition-all duration-300 hover:cursor-pointer",
|
|
34
|
+
a ? "border-b border-slate-200" : "border-b border-transparent"
|
|
35
|
+
),
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ l("div", { className: "flex w-full items-center gap-2", children: [
|
|
38
|
+
i && /* @__PURE__ */ r("span", { className: "shrink-0", children: i }),
|
|
39
|
+
f(e, "AccordionTitle", d)
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ r(
|
|
42
|
+
h,
|
|
43
|
+
{
|
|
44
|
+
weight: "Linear",
|
|
45
|
+
size: 20,
|
|
46
|
+
className: n(
|
|
47
|
+
"shrink-0 text-slate-400 transition-transform duration-300",
|
|
48
|
+
a && "rotate-180"
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ r(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
id: s,
|
|
59
|
+
role: "region",
|
|
60
|
+
"aria-labelledby": s,
|
|
61
|
+
className: n(
|
|
62
|
+
"grid transition-[grid-template-rows] duration-300 ease-out",
|
|
63
|
+
a ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
64
|
+
),
|
|
65
|
+
children: /* @__PURE__ */ r("div", { ref: b, className: "min-h-0 overflow-hidden", children: f(e, "AccordionContent", c) })
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
u.Title = d;
|
|
71
|
+
u.Content = c;
|
|
72
|
+
export {
|
|
73
|
+
u as default
|
|
74
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as l, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { AltArrowRight as h } from "@solar-icons/react";
|
|
3
|
+
import { cn as r } from "../../lib/utils.js";
|
|
4
|
+
function b({
|
|
5
|
+
items: a,
|
|
6
|
+
variant: o = "blue",
|
|
7
|
+
className: i
|
|
8
|
+
}) {
|
|
9
|
+
const n = o === "blue", m = n ? "hover:text-blue-600" : "hover:text-yellow-500", x = n ? "text-blue-600" : "text-yellow-500";
|
|
10
|
+
return /* @__PURE__ */ l("nav", { className: r("flex items-center", i), "aria-label": "Breadcrumb", children: a.map((e, s) => {
|
|
11
|
+
const c = s === a.length - 1;
|
|
12
|
+
return /* @__PURE__ */ t("div", { className: "flex items-center", children: [
|
|
13
|
+
c ? /* @__PURE__ */ t("span", { className: r("flex items-center gap-x-2 font-medium", x), children: [
|
|
14
|
+
e.icon,
|
|
15
|
+
/* @__PURE__ */ l("span", { children: e.label })
|
|
16
|
+
] }) : /* @__PURE__ */ t(
|
|
17
|
+
"a",
|
|
18
|
+
{
|
|
19
|
+
href: e.href ?? "#",
|
|
20
|
+
onClick: (f) => {
|
|
21
|
+
e.onClick && (f.preventDefault(), e.onClick());
|
|
22
|
+
},
|
|
23
|
+
className: r(
|
|
24
|
+
"flex items-center gap-x-2 transition-all text-sm font-normal text-slate-500",
|
|
25
|
+
m
|
|
26
|
+
),
|
|
27
|
+
children: [
|
|
28
|
+
e.icon,
|
|
29
|
+
/* @__PURE__ */ l("span", { children: e.label })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
!c && /* @__PURE__ */ l("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ l(h, { weight: "Linear", size: 20, className: "text-slate-500" }) })
|
|
34
|
+
] }, s);
|
|
35
|
+
}) });
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
b as default
|
|
39
|
+
};
|