@mci-ui/mci-ui 0.0.94 → 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.
- package/dist/assets/png/empty.png.js +4 -0
- package/dist/index.css +1 -1
- package/dist/index.js +54 -50
- package/dist/shared/lib/uploadLanguage.js +6 -3
- package/dist/shared/ui/MciModal/MciModal.js +1 -1
- package/dist/shared/ui/mciAccordion/MciAccordion.js +4 -4
- package/dist/shared/ui/mciButton/MciButton.js +12 -10
- package/dist/shared/ui/mciCollapse/MciCollapse.js +1 -1
- package/dist/shared/ui/mciDrawer/MciDrawer.js +1 -1
- package/dist/shared/ui/mciEmpty/MciEmpty.js +41 -0
- package/dist/shared/ui/mciInput/MciInput.js +32 -32
- package/dist/shared/ui/mciPagination/MciPagination.js +32 -32
- package/dist/shared/ui/mciPhone/MciPhone.js +23 -23
- package/dist/shared/ui/mciPicker/MciPicker.js +2 -2
- package/dist/shared/ui/mciTable/MciTable.js +317 -165
- package/dist/shared/ui/mciTable/MciTableClamp2.js +5 -5
- package/dist/shared/ui/mciTabs/FilledTabs.js +38 -36
- package/dist/shared/ui/mciTabs/OutlinedTabs.js +28 -24
- package/dist/shared/ui/mciTabs/TabCountBadge.js +19 -0
- package/dist/shared/ui/mciTag/MciTag.js +17 -17
- package/dist/shared/ui/mciTextarea/MciTextarea.js +5 -5
- package/dist/shared/ui/mciTimePicker/MciTimePicker.js +205 -194
- package/dist/shared/ui/mciUpload/MciUpload.js +102 -352
- package/dist/shared/ui/mciUpload/MciUploadButton.js +143 -0
- package/dist/shared/ui/mciUpload/MciUploadFileList.js +167 -0
- package/dist/shared/ui/mciUpload/mci-upload.theme.js +103 -0
- package/dist/shared/ui/mciUpload/mci-upload.utils.js +90 -41
- package/dist/shared/ui/mciUpload/useMciUpload.js +183 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/shared/lib/uploadLanguage.d.ts +2 -0
- package/dist/types/shared/types/ui/empty.types.d.ts +11 -0
- package/dist/types/shared/types/ui/index.d.ts +2 -1
- package/dist/types/shared/types/ui/tabs.types.d.ts +1 -0
- package/dist/types/shared/types/ui/time-picker.types.d.ts +2 -0
- package/dist/types/shared/types/ui/upload.types.d.ts +25 -1
- package/dist/types/shared/ui/mciEmpty/MciEmpty.d.ts +2 -0
- package/dist/types/shared/ui/mciTabs/TabCountBadge.d.ts +5 -0
- package/dist/types/shared/ui/mciUpload/MciUploadButton.d.ts +4 -0
- package/dist/types/shared/ui/mciUpload/MciUploadFileList.d.ts +18 -0
- package/dist/types/shared/ui/mciUpload/mci-upload.theme.d.ts +101 -0
- package/dist/types/shared/ui/mciUpload/mci-upload.utils.d.ts +7 -0
- package/dist/types/shared/ui/mciUpload/useMciUpload.d.ts +131 -0
- package/package.json +1 -1
|
@@ -22,9 +22,9 @@ function m({
|
|
|
22
22
|
}
|
|
23
23
|
m.displayName = "AccordionContent";
|
|
24
24
|
function f({ children: t, defaultValue: o = !1, icon: n, darkMode: e = !1, className: g }) {
|
|
25
|
-
const [i, x] = _(o), h = C(null), s = E(), w = () => x((
|
|
25
|
+
const [i, x] = _(o), h = C(null), s = E(), w = () => x((v) => !v), c = p(t, "AccordionTitle", b), d = p(t, "AccordionContent", m), N = l.isValidElement(c) ? l.cloneElement(c, {
|
|
26
26
|
darkMode: e
|
|
27
|
-
}) : c,
|
|
27
|
+
}) : c, y = l.isValidElement(d) ? l.cloneElement(d, {
|
|
28
28
|
darkMode: e
|
|
29
29
|
}) : d;
|
|
30
30
|
return /* @__PURE__ */ u(
|
|
@@ -44,7 +44,7 @@ function f({ children: t, defaultValue: o = !1, icon: n, darkMode: e = !1, class
|
|
|
44
44
|
"aria-expanded": i,
|
|
45
45
|
"aria-controls": s,
|
|
46
46
|
className: r(
|
|
47
|
-
"group flex w-full items-center justify-between gap-2 p-5 transition-all duration-300
|
|
47
|
+
"group flex w-full cursor-pointer items-center justify-between gap-2 p-5 transition-all duration-300",
|
|
48
48
|
e ? [
|
|
49
49
|
"bg-neutral-300/70 hover:bg-neutral-200/80",
|
|
50
50
|
i ? "border-b border-neutral-200 shadow-[inset_0_-1px_0_rgba(255,255,255,0.02)]" : "border-b border-transparent"
|
|
@@ -91,7 +91,7 @@ function f({ children: t, defaultValue: o = !1, icon: n, darkMode: e = !1, class
|
|
|
91
91
|
"min-h-0 overflow-hidden",
|
|
92
92
|
e ? "bg-[#22242A]" : "bg-white"
|
|
93
93
|
),
|
|
94
|
-
children:
|
|
94
|
+
children: y
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as w, jsx as
|
|
1
|
+
import { jsxs as w, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cn as y } from "../../lib/utils.js";
|
|
3
3
|
import { Star2 as p } from "@solar-icons/react";
|
|
4
4
|
const m = {
|
|
@@ -48,35 +48,37 @@ function S({
|
|
|
48
48
|
children: n,
|
|
49
49
|
text: c,
|
|
50
50
|
icon: r,
|
|
51
|
-
iconPosition:
|
|
51
|
+
iconPosition: l = "left",
|
|
52
52
|
size: i = "base",
|
|
53
53
|
variant: e = "primary",
|
|
54
54
|
color: b = "orange",
|
|
55
|
-
darkMode:
|
|
55
|
+
darkMode: s = !1,
|
|
56
56
|
loading: o = !1,
|
|
57
57
|
disabled: u = !1,
|
|
58
58
|
className: d,
|
|
59
59
|
type: f = "button",
|
|
60
60
|
...v
|
|
61
61
|
}) {
|
|
62
|
-
const
|
|
62
|
+
const g = n ?? c, h = e === "primary" || e === "secondary" || e === "outline" ? s ? T[b][e] : N[b][e] : s ? A[e] : _[e], t = u || o, x = t ? e === "outline" ? "border border-slate-200 bg-transparent text-slate-400 cursor-not-allowed hover:border-slate-200 hover:bg-transparent hover:text-slate-400 active:border-slate-200 active:bg-transparent active:text-slate-400 focus:border-slate-200 focus:bg-transparent focus:text-slate-400 focus:ring-0 focus:shadow-none" : "bg-slate-200 text-slate-400 cursor-not-allowed hover:bg-slate-200 hover:text-slate-400 active:bg-slate-200 active:text-slate-400 focus:bg-slate-200 focus:text-slate-400 focus:ring-0 focus:shadow-none" : h;
|
|
63
63
|
return /* @__PURE__ */ w(
|
|
64
64
|
"button",
|
|
65
65
|
{
|
|
66
66
|
...v,
|
|
67
67
|
type: f,
|
|
68
|
-
disabled:
|
|
68
|
+
disabled: t,
|
|
69
69
|
className: y(
|
|
70
|
-
"inline-flex w-fit shrink-0 items-center justify-center whitespace-nowrap text-center font-medium transition-all duration-200
|
|
70
|
+
"inline-flex w-fit shrink-0 items-center justify-center whitespace-nowrap text-center font-medium transition-all duration-200",
|
|
71
|
+
!t && "cursor-pointer",
|
|
72
|
+
t && "cursor-not-allowed",
|
|
71
73
|
m[i],
|
|
72
74
|
x,
|
|
73
75
|
d
|
|
74
76
|
),
|
|
75
77
|
children: [
|
|
76
|
-
r &&
|
|
77
|
-
|
|
78
|
-
r &&
|
|
79
|
-
o && /* @__PURE__ */
|
|
78
|
+
r && l === "left" && !o && /* @__PURE__ */ a("span", { className: "flex items-center", children: r }),
|
|
79
|
+
g && /* @__PURE__ */ a("span", { className: "whitespace-nowrap", children: g }),
|
|
80
|
+
r && l === "right" && !o && /* @__PURE__ */ a("span", { className: "flex items-center", children: r }),
|
|
81
|
+
o && /* @__PURE__ */ a(p, { weight: "Linear", size: 20, className: "animate-spin" })
|
|
80
82
|
]
|
|
81
83
|
}
|
|
82
84
|
);
|
|
@@ -36,7 +36,7 @@ function R({
|
|
|
36
36
|
{
|
|
37
37
|
onClick: () => d(!r),
|
|
38
38
|
className: t(
|
|
39
|
-
"group flex w-full items-center justify-between p-5 transition-all duration-300
|
|
39
|
+
"group flex w-full cursor-pointer items-center justify-between p-5 transition-all duration-300",
|
|
40
40
|
m
|
|
41
41
|
),
|
|
42
42
|
children: [
|
|
@@ -106,7 +106,7 @@ function T({
|
|
|
106
106
|
className: s(
|
|
107
107
|
t ? "bg-neutral-300 text-slate-50" : "bg-slate-100 text-black",
|
|
108
108
|
t ? f.darkClose : f.close,
|
|
109
|
-
"
|
|
109
|
+
"flex h-11 w-11 cursor-pointer items-center justify-center rounded-xl transition group active:scale-95 sm:h-12 sm:w-12"
|
|
110
110
|
),
|
|
111
111
|
children: /* @__PURE__ */ r(
|
|
112
112
|
X,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import p from "../../../assets/png/empty.png.js";
|
|
3
|
+
import { cn as e } from "../../lib/utils.js";
|
|
4
|
+
const u = {
|
|
5
|
+
uz: {
|
|
6
|
+
title: "Ma'lumot topilmadi",
|
|
7
|
+
description: `Hozircha bu bo'limda ma'lumot mavjud emas.
|
|
8
|
+
Qidiruv so'zini o'zgartiring yoki yangi ma'lumot qo'shing`
|
|
9
|
+
},
|
|
10
|
+
ru: {
|
|
11
|
+
title: "Данные не найдены",
|
|
12
|
+
description: `В этом разделе пока нет данных.
|
|
13
|
+
Измените поисковый запрос или добавьте новые данные`
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
function b({
|
|
17
|
+
className: n,
|
|
18
|
+
image: i,
|
|
19
|
+
imageClassName: s,
|
|
20
|
+
imageSrc: c,
|
|
21
|
+
locale: l = "uz",
|
|
22
|
+
title: m,
|
|
23
|
+
description: a
|
|
24
|
+
}) {
|
|
25
|
+
const o = u[l], r = a ?? o.description;
|
|
26
|
+
return /* @__PURE__ */ d("div", { className: e("flex flex-col items-center justify-center text-center", n), children: [
|
|
27
|
+
i ? /* @__PURE__ */ t("div", { className: e("mb-4 shrink-0", s), children: i }) : /* @__PURE__ */ t(
|
|
28
|
+
"img",
|
|
29
|
+
{
|
|
30
|
+
src: c ?? p,
|
|
31
|
+
alt: "",
|
|
32
|
+
className: e("mb-4 h-auto w-40 shrink-0", s)
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ t("h4", { className: "text-h4 font-semibold text-black", children: m ?? o.title }),
|
|
36
|
+
r && /* @__PURE__ */ t("p", { className: "mt-2 whitespace-pre-line text-base text-slate-700", children: r })
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
b as default
|
|
41
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as p, jsx as l, Fragment as z } from "react/jsx-runtime";
|
|
2
2
|
import { EyeClosed as ee, Eye as te } from "@solar-icons/react";
|
|
3
3
|
import { forwardRef as le, useState as v, useMemo as h } from "react";
|
|
4
|
-
import
|
|
4
|
+
import se from "../../../assets/icons/close.svg.js";
|
|
5
5
|
import { cn as e } from "../../lib/utils.js";
|
|
6
|
-
import { getInputSizes as
|
|
6
|
+
import { getInputSizes as ne, getInputStateStyles as ae, getInputIconColor as re, getInputRightPaddingClass as ce } from "./mci-input.utils.js";
|
|
7
7
|
const ie = le(
|
|
8
8
|
({
|
|
9
9
|
label: C,
|
|
@@ -31,19 +31,19 @@ const ie = le(
|
|
|
31
31
|
...L
|
|
32
32
|
}, O) => {
|
|
33
33
|
const [g, S] = v(!1), [Q, W] = v(""), [R, T] = v(!1), B = N ?? Q, o = w === "password", b = H && !!B && !f, y = c && u === "left", j = c && u === "right" || r || o, U = j || b, V = h(() => {
|
|
34
|
-
let
|
|
35
|
-
return b && (
|
|
36
|
-
}, [b, o, r, c, u]), X = (
|
|
37
|
-
S(!0), _?.(
|
|
38
|
-
}, Y = (
|
|
39
|
-
S(!1), D?.(
|
|
40
|
-
}, Z = (
|
|
41
|
-
let m =
|
|
42
|
-
w === "number" && x && m.length > x && (m = m.slice(0, x),
|
|
43
|
-
}, $ = () => T((
|
|
34
|
+
let n = 0;
|
|
35
|
+
return b && (n += 1), o ? (n += 1, r && (n += 1), n) : (r && (n += 1), c && u === "right" && (n += 1), n);
|
|
36
|
+
}, [b, o, r, c, u]), X = (n) => {
|
|
37
|
+
S(!0), _?.(n);
|
|
38
|
+
}, Y = (n) => {
|
|
39
|
+
S(!1), D?.(n);
|
|
40
|
+
}, Z = (n) => {
|
|
41
|
+
let m = n.target.value;
|
|
42
|
+
w === "number" && x && m.length > x && (m = m.slice(0, x), n.target.value = m), N === void 0 && W(m), P?.(n);
|
|
43
|
+
}, $ = () => T((n) => !n), q = () => {
|
|
44
44
|
N === void 0 && W(""), G?.();
|
|
45
|
-
},
|
|
46
|
-
() =>
|
|
45
|
+
}, s = h(
|
|
46
|
+
() => ne(!!y, !!j),
|
|
47
47
|
[y, j]
|
|
48
48
|
), k = h(() => ae(i, a), [i, a]), d = h(
|
|
49
49
|
() => re(f, i, g, a),
|
|
@@ -60,7 +60,7 @@ const ie = le(
|
|
|
60
60
|
className: e(
|
|
61
61
|
"mb-2 block text-base font-medium",
|
|
62
62
|
i ? a ? "text-red-500" : "text-red-600" : a ? "text-neutral-50" : "text-slate-700",
|
|
63
|
-
|
|
63
|
+
s[t].labelFont
|
|
64
64
|
),
|
|
65
65
|
children: [
|
|
66
66
|
C,
|
|
@@ -86,13 +86,13 @@ const ie = le(
|
|
|
86
86
|
placeholder: E,
|
|
87
87
|
step: J,
|
|
88
88
|
className: e(
|
|
89
|
-
"w-full border font-normal transition-all duration-300 ease-in-out outline-none",
|
|
89
|
+
"w-full border font-normal transition-all duration-300 ease-in-out outline-none cursor-text",
|
|
90
90
|
t === "base" ? "rounded-xl" : "rounded-lg",
|
|
91
91
|
a ? "text-neutral-50 placeholder:text-neutral-100 disabled:cursor-not-allowed disabled:border-neutral-200 disabled:bg-neutral-300 disabled:text-neutral-100/50 disabled:placeholder:text-neutral-100/50" : "bg-white disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
|
|
92
92
|
a && g && !f && "text-white",
|
|
93
93
|
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
s[t].input,
|
|
95
|
+
s[t].padding,
|
|
96
96
|
M,
|
|
97
97
|
k
|
|
98
98
|
),
|
|
@@ -105,14 +105,14 @@ const ie = le(
|
|
|
105
105
|
className: e(
|
|
106
106
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center",
|
|
107
107
|
"transition-all duration-300",
|
|
108
|
-
|
|
108
|
+
s[t].leftIcon,
|
|
109
109
|
d
|
|
110
110
|
),
|
|
111
111
|
children: /* @__PURE__ */ l(
|
|
112
112
|
"div",
|
|
113
113
|
{
|
|
114
|
-
className: e("flex items-center justify-center",
|
|
115
|
-
children: /* @__PURE__ */ l("span", { className: e("flex items-center justify-center",
|
|
114
|
+
className: e("flex items-center justify-center", s[t].iconWrapper),
|
|
115
|
+
children: /* @__PURE__ */ l("span", { className: e("flex items-center justify-center", s[t].icon), children: c })
|
|
116
116
|
}
|
|
117
117
|
)
|
|
118
118
|
}
|
|
@@ -123,7 +123,7 @@ const ie = le(
|
|
|
123
123
|
className: e(
|
|
124
124
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center gap-2",
|
|
125
125
|
"transition-all duration-300",
|
|
126
|
-
|
|
126
|
+
s[t].rightIcon
|
|
127
127
|
),
|
|
128
128
|
children: [
|
|
129
129
|
b && /* @__PURE__ */ l(
|
|
@@ -133,22 +133,22 @@ const ie = le(
|
|
|
133
133
|
onClick: q,
|
|
134
134
|
className: e(
|
|
135
135
|
"flex cursor-pointer items-center justify-center",
|
|
136
|
-
|
|
136
|
+
s[t].iconWrapper,
|
|
137
137
|
a ? "text-neutral-100 hover:text-white" : "text-slate-base hover:text-black"
|
|
138
138
|
),
|
|
139
|
-
children: /* @__PURE__ */ l("span", { className: e("flex items-center justify-center",
|
|
139
|
+
children: /* @__PURE__ */ l("span", { className: e("flex items-center justify-center", s[t].icon), children: /* @__PURE__ */ l(se, { className: e("h-full w-full") }) })
|
|
140
140
|
}
|
|
141
141
|
),
|
|
142
142
|
r && !o && /* @__PURE__ */ l(
|
|
143
143
|
"div",
|
|
144
144
|
{
|
|
145
|
-
className: e("flex items-center justify-center",
|
|
145
|
+
className: e("flex items-center justify-center", s[t].iconWrapper),
|
|
146
146
|
children: /* @__PURE__ */ l(
|
|
147
147
|
"span",
|
|
148
148
|
{
|
|
149
149
|
className: e(
|
|
150
150
|
"flex items-center justify-center",
|
|
151
|
-
|
|
151
|
+
s[t].icon,
|
|
152
152
|
d
|
|
153
153
|
),
|
|
154
154
|
children: r
|
|
@@ -162,14 +162,14 @@ const ie = le(
|
|
|
162
162
|
{
|
|
163
163
|
className: e(
|
|
164
164
|
"flex items-center justify-center",
|
|
165
|
-
|
|
165
|
+
s[t].iconWrapper
|
|
166
166
|
),
|
|
167
167
|
children: /* @__PURE__ */ l(
|
|
168
168
|
"span",
|
|
169
169
|
{
|
|
170
170
|
className: e(
|
|
171
171
|
"flex items-center justify-center",
|
|
172
|
-
|
|
172
|
+
s[t].icon,
|
|
173
173
|
d
|
|
174
174
|
),
|
|
175
175
|
children: r
|
|
@@ -184,13 +184,13 @@ const ie = le(
|
|
|
184
184
|
onClick: $,
|
|
185
185
|
className: e(
|
|
186
186
|
"flex cursor-pointer items-center justify-center",
|
|
187
|
-
|
|
187
|
+
s[t].iconWrapper,
|
|
188
188
|
d
|
|
189
189
|
),
|
|
190
190
|
children: /* @__PURE__ */ l(
|
|
191
191
|
"span",
|
|
192
192
|
{
|
|
193
|
-
className: e("flex items-center justify-center",
|
|
193
|
+
className: e("flex items-center justify-center", s[t].icon),
|
|
194
194
|
children: R ? /* @__PURE__ */ l(ee, { weight: "Linear", className: e("h-full w-full") }) : /* @__PURE__ */ l(te, { weight: "Linear", className: e("h-full w-full") })
|
|
195
195
|
}
|
|
196
196
|
)
|
|
@@ -200,13 +200,13 @@ const ie = le(
|
|
|
200
200
|
c && u === "right" && !o && /* @__PURE__ */ l(
|
|
201
201
|
"div",
|
|
202
202
|
{
|
|
203
|
-
className: e("flex items-center justify-center",
|
|
203
|
+
className: e("flex items-center justify-center", s[t].iconWrapper),
|
|
204
204
|
children: /* @__PURE__ */ l(
|
|
205
205
|
"span",
|
|
206
206
|
{
|
|
207
207
|
className: e(
|
|
208
208
|
"flex items-center justify-center",
|
|
209
|
-
|
|
209
|
+
s[t].icon,
|
|
210
210
|
d
|
|
211
211
|
),
|
|
212
212
|
children: c
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { AltArrowDown as
|
|
3
|
-
import { useMemo as
|
|
2
|
+
import { AltArrowDown as E, AltArrowLeft as P, MenuDots as T, AltArrowRight as F } from "@solar-icons/react";
|
|
3
|
+
import { useMemo as _ } from "react";
|
|
4
4
|
import { cn as r } from "../../lib/utils.js";
|
|
5
|
-
import { createPageRange as
|
|
6
|
-
const
|
|
5
|
+
import { createPageRange as G } from "./mci-pagination.utils.js";
|
|
6
|
+
const O = {
|
|
7
7
|
medium: "h-9 text-sm",
|
|
8
8
|
large: "h-10 text-base"
|
|
9
|
-
},
|
|
9
|
+
}, R = {
|
|
10
10
|
yellow: {
|
|
11
11
|
active: "bg-yellow-500 text-white border-yellow-500",
|
|
12
12
|
inactive: "bg-slate-100 border-slate-200 text-black hover:bg-slate-200",
|
|
@@ -38,26 +38,26 @@ const _ = {
|
|
|
38
38
|
darkArrow: "text-neutral-50"
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
function
|
|
41
|
+
function J({
|
|
42
42
|
totalItems: c,
|
|
43
43
|
currentPage: m,
|
|
44
44
|
perPage: b,
|
|
45
45
|
onPageChange: u,
|
|
46
46
|
onPerPageChange: h,
|
|
47
|
-
siblingCount:
|
|
48
|
-
perPageOptions:
|
|
49
|
-
showPerPage:
|
|
50
|
-
variant:
|
|
51
|
-
size:
|
|
47
|
+
siblingCount: g = 1,
|
|
48
|
+
perPageOptions: y = [10, 30, 50, 100],
|
|
49
|
+
showPerPage: C = !0,
|
|
50
|
+
variant: I = "orange",
|
|
51
|
+
size: x = "large",
|
|
52
52
|
darkMode: e = !1,
|
|
53
|
-
paginationClassName:
|
|
53
|
+
paginationClassName: j
|
|
54
54
|
}) {
|
|
55
|
-
const w = Number.isFinite(c) && c > 0 ? c : 0, v = Number.isFinite(b) && b > 0 ? b : 10,
|
|
56
|
-
return
|
|
55
|
+
const w = Number.isFinite(c) && c > 0 ? c : 0, v = Number.isFinite(b) && b > 0 ? b : 10, i = Math.max(1, Math.ceil(w / v)), D = Number.isFinite(m) ? m : 1, l = Math.min(Math.max(1, D), i), f = C && typeof h == "function", p = i > 1, S = _(() => G(l, g, i), [l, g, i]), s = O[x], n = R[I ?? "yellow"], L = e ? n.darkActive : n.active, z = e ? n.darkInactive : n.inactive, N = e ? n.darkDisabled : n.disabled, A = e ? n.darkArrow : n.arrow;
|
|
56
|
+
return w === 0 || !f && !p ? null : /* @__PURE__ */ o("div", { className: r(
|
|
57
57
|
"flex items-center justify-between gap-4 w-full",
|
|
58
|
-
|
|
58
|
+
j
|
|
59
59
|
), children: [
|
|
60
|
-
|
|
60
|
+
f && /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
61
61
|
/* @__PURE__ */ t(
|
|
62
62
|
"span",
|
|
63
63
|
{
|
|
@@ -73,18 +73,18 @@ function P({
|
|
|
73
73
|
"select",
|
|
74
74
|
{
|
|
75
75
|
value: v,
|
|
76
|
-
onChange: (a) => h(Number(a.target.value)),
|
|
76
|
+
onChange: (a) => h?.(Number(a.target.value)),
|
|
77
77
|
className: r(
|
|
78
78
|
"appearance-none rounded-lg border pl-3 pr-8 text-base font-medium focus:outline-none cursor-pointer",
|
|
79
79
|
e ? "border-neutral-200 bg-neutral-300 text-white" : "border-slate-200 bg-white text-black",
|
|
80
|
-
|
|
80
|
+
x === "large" ? "h-10" : "h-9"
|
|
81
81
|
),
|
|
82
82
|
"aria-label": "Количество строк на странице",
|
|
83
|
-
children:
|
|
83
|
+
children: y.map((a) => /* @__PURE__ */ t("option", { value: a, children: a }, a))
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
/* @__PURE__ */ t(
|
|
87
|
-
|
|
87
|
+
E,
|
|
88
88
|
{
|
|
89
89
|
className: r(
|
|
90
90
|
"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",
|
|
@@ -96,7 +96,7 @@ function P({
|
|
|
96
96
|
)
|
|
97
97
|
] })
|
|
98
98
|
] }),
|
|
99
|
-
/* @__PURE__ */ o("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
|
|
99
|
+
p && /* @__PURE__ */ o("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
|
|
100
100
|
/* @__PURE__ */ t(
|
|
101
101
|
"button",
|
|
102
102
|
{
|
|
@@ -107,12 +107,12 @@ function P({
|
|
|
107
107
|
"flex items-center justify-center rounded-lg border transition-all min-w-10",
|
|
108
108
|
e ? "bg-neutral-300 border-neutral-200" : "bg-slate-100",
|
|
109
109
|
s,
|
|
110
|
-
l === 1 ? r("cursor-not-allowed opacity-50",
|
|
110
|
+
l === 1 ? r("cursor-not-allowed opacity-50", N) : r("cursor-pointer", A, e ? "hover:bg-neutral-200" : "border-slate-200")
|
|
111
111
|
),
|
|
112
|
-
children: /* @__PURE__ */ t(
|
|
112
|
+
children: /* @__PURE__ */ t(P, { weight: "Linear", size: 20 })
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children:
|
|
115
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: S.map((a, k) => {
|
|
116
116
|
if (a === "...")
|
|
117
117
|
return /* @__PURE__ */ t(
|
|
118
118
|
"span",
|
|
@@ -123,9 +123,9 @@ function P({
|
|
|
123
123
|
s
|
|
124
124
|
),
|
|
125
125
|
"aria-hidden": "true",
|
|
126
|
-
children: /* @__PURE__ */ t(
|
|
126
|
+
children: /* @__PURE__ */ t(T, { weight: "Bold", size: 20 })
|
|
127
127
|
},
|
|
128
|
-
|
|
128
|
+
k
|
|
129
129
|
);
|
|
130
130
|
const d = a === l;
|
|
131
131
|
return /* @__PURE__ */ t(
|
|
@@ -135,13 +135,13 @@ function P({
|
|
|
135
135
|
"aria-label": `Страница ${a}${d ? ", текущая" : ""}`,
|
|
136
136
|
"aria-current": d ? "page" : void 0,
|
|
137
137
|
className: r(
|
|
138
|
-
"flex items-center justify-center rounded-lg border font-medium transition-all
|
|
138
|
+
"flex cursor-pointer items-center justify-center rounded-lg border font-medium transition-all min-w-10 px-2",
|
|
139
139
|
s,
|
|
140
|
-
d ?
|
|
140
|
+
d ? L : z
|
|
141
141
|
),
|
|
142
142
|
children: a
|
|
143
143
|
},
|
|
144
|
-
|
|
144
|
+
k
|
|
145
145
|
);
|
|
146
146
|
}) }),
|
|
147
147
|
/* @__PURE__ */ t(
|
|
@@ -154,14 +154,14 @@ function P({
|
|
|
154
154
|
"flex items-center justify-center rounded-lg border transition-all min-w-10",
|
|
155
155
|
e ? "bg-neutral-300 border-neutral-200" : "bg-slate-100",
|
|
156
156
|
s,
|
|
157
|
-
l === i ? r("cursor-not-allowed opacity-50",
|
|
157
|
+
l === i ? r("cursor-not-allowed opacity-50", N) : r("cursor-pointer", A, e ? "hover:bg-neutral-200" : "border-slate-200")
|
|
158
158
|
),
|
|
159
|
-
children: /* @__PURE__ */ t(
|
|
159
|
+
children: /* @__PURE__ */ t(F, { size: 20, weight: "Linear" })
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
] })
|
|
163
163
|
] });
|
|
164
164
|
}
|
|
165
165
|
export {
|
|
166
|
-
|
|
166
|
+
J as default
|
|
167
167
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as I, useState as L, useMemo as h } from "react";
|
|
3
3
|
import { cn as n } from "../../lib/utils.js";
|
|
4
4
|
import { Phone as V } from "@solar-icons/react";
|
|
@@ -10,64 +10,64 @@ const W = I(
|
|
|
10
10
|
size: u = "base",
|
|
11
11
|
darkMode: e = !1,
|
|
12
12
|
error: t,
|
|
13
|
-
disabled:
|
|
13
|
+
disabled: a = !1,
|
|
14
14
|
required: b = !1,
|
|
15
|
-
value:
|
|
16
|
-
onChange:
|
|
15
|
+
value: i = "",
|
|
16
|
+
onChange: r,
|
|
17
17
|
onFocus: g,
|
|
18
18
|
onBlur: N,
|
|
19
19
|
className: P,
|
|
20
20
|
name: _,
|
|
21
21
|
showIcon: m = !1
|
|
22
22
|
}, w) => {
|
|
23
|
-
const [
|
|
23
|
+
const [o, f] = L(!1), y = (B) => {
|
|
24
24
|
const x = B.target.value;
|
|
25
25
|
if (x.length < 5) {
|
|
26
|
-
|
|
26
|
+
r?.("+998");
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
const E = R(x);
|
|
30
|
-
|
|
30
|
+
r?.(E);
|
|
31
31
|
}, S = () => {
|
|
32
|
-
f(!0), (!
|
|
32
|
+
f(!0), (!i || i === "") && r?.("+998"), g?.();
|
|
33
33
|
}, F = () => {
|
|
34
34
|
f(!1), N?.();
|
|
35
35
|
}, l = z[u], j = m ? l.iconPadding : l.defaultPadding, v = h(() => H(t, e), [t, e]), C = h(
|
|
36
|
-
() => O(
|
|
37
|
-
[t,
|
|
36
|
+
() => O(a, t, o, e),
|
|
37
|
+
[t, o, a, e]
|
|
38
38
|
);
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
d && /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ c("div", { className: n("w-full", P), children: [
|
|
40
|
+
d && /* @__PURE__ */ c("label", { className: n(
|
|
41
41
|
"mb-2 block font-medium transition-colors duration-200",
|
|
42
|
-
t ? e ? "text-red-500" : "text-red-600" : e ? "text-neutral-50" :
|
|
42
|
+
t ? e ? "text-red-500" : "text-red-600" : e ? "text-neutral-50" : o ? "text-blue-600" : "text-slate-700",
|
|
43
43
|
l.labelFont
|
|
44
44
|
), children: [
|
|
45
45
|
d,
|
|
46
|
-
b && /* @__PURE__ */
|
|
46
|
+
b && /* @__PURE__ */ s("span", { className: "text-red-600 ml-1", children: "*" })
|
|
47
47
|
] }),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
m && /* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ c("div", { className: "relative flex items-center", children: [
|
|
49
|
+
m && /* @__PURE__ */ s("div", { className: n(
|
|
50
50
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center transition-all duration-300",
|
|
51
51
|
l.iconLeft,
|
|
52
52
|
C
|
|
53
|
-
), children: /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
53
|
+
), children: /* @__PURE__ */ s("div", { className: n("flex items-center justify-center", l.iconWrapper), children: /* @__PURE__ */ s(V, { className: n(l.iconSize), weight: "Linear" }) }) }),
|
|
54
|
+
/* @__PURE__ */ s(
|
|
55
55
|
"input",
|
|
56
56
|
{
|
|
57
57
|
ref: w,
|
|
58
58
|
name: _,
|
|
59
59
|
type: "tel",
|
|
60
|
-
value:
|
|
60
|
+
value: i,
|
|
61
61
|
onChange: y,
|
|
62
62
|
onFocus: S,
|
|
63
63
|
onBlur: F,
|
|
64
|
-
disabled:
|
|
64
|
+
disabled: a,
|
|
65
65
|
placeholder: p,
|
|
66
66
|
className: n(
|
|
67
|
-
"w-full border font-normal transition-all duration-300 outline-none",
|
|
67
|
+
"w-full border font-normal transition-all duration-300 outline-none cursor-text",
|
|
68
68
|
u === "base" ? "rounded-xl" : "rounded-lg",
|
|
69
69
|
e ? "text-neutral-50 placeholder:text-neutral-100 disabled:cursor-not-allowed disabled:border-neutral-200 disabled:bg-neutral-300 disabled:text-neutral-100/50 disabled:placeholder:text-neutral-100/50" : "bg-white disabled:bg-slate-100 disabled:text-slate-400 disabled:cursor-not-allowed",
|
|
70
|
-
e &&
|
|
70
|
+
e && o && !a && "text-white",
|
|
71
71
|
l.input,
|
|
72
72
|
j,
|
|
73
73
|
v
|
|
@@ -75,7 +75,7 @@ const W = I(
|
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] }),
|
|
78
|
-
t && /* @__PURE__ */
|
|
78
|
+
t && /* @__PURE__ */ s("p", { className: n(
|
|
79
79
|
"mt-2 animate-slide-up text-sm font-normal",
|
|
80
80
|
e ? "text-red-500" : "text-red-600"
|
|
81
81
|
), children: t })
|
|
@@ -314,7 +314,7 @@ const Ze = $e(
|
|
|
314
314
|
}
|
|
315
315
|
)
|
|
316
316
|
] }),
|
|
317
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2", children: H.monthsShort.map((e, t) => /* @__PURE__ */ r("button", { type: "button", onClick: () => Fe(t), className: a("py-3 rounded-lg text-sm font-semibold transition-colors
|
|
317
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2", children: H.monthsShort.map((e, t) => /* @__PURE__ */ r("button", { type: "button", onClick: () => Fe(t), className: a("cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", m.getMonth() === t ? "bg-blue-600 text-white" : l ? "text-neutral-50 hover:bg-neutral-300 hover:text-white" : "text-slate-600 hover:bg-blue-50"), children: e }, e)) })
|
|
318
318
|
] }), Ee = () => {
|
|
319
319
|
const e = Math.floor(m.getFullYear() / 12) * 12 + we * 12, t = Array.from({ length: 12 }, (n, i) => e + i);
|
|
320
320
|
return /* @__PURE__ */ h("div", { className: "w-[300px] p-3", children: [
|
|
@@ -349,7 +349,7 @@ const Ze = $e(
|
|
|
349
349
|
}
|
|
350
350
|
)
|
|
351
351
|
] }),
|
|
352
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2", children: t.map((n) => /* @__PURE__ */ r("button", { type: "button", onClick: () => Ye(n), className: a("py-3 rounded-lg text-sm font-semibold transition-colors
|
|
352
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2", children: t.map((n) => /* @__PURE__ */ r("button", { type: "button", onClick: () => Ye(n), className: a("cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", m.getFullYear() === n ? "bg-blue-600 text-white" : l ? "text-neutral-50 hover:bg-neutral-300 hover:text-white" : "text-slate-600 hover:bg-blue-50"), children: n }, n)) })
|
|
353
353
|
] });
|
|
354
354
|
}, ce = /* @__PURE__ */ r(
|
|
355
355
|
"div",
|