@mci-ui/mci-ui 0.0.85 → 0.0.87
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/index.css +1 -1
- package/dist/shared/ui/MciModal/MciModal.js +107 -59
- package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +23 -21
- package/dist/shared/ui/mciButton/MciButton.js +47 -32
- package/dist/shared/ui/mciCheck/MciCheck.js +116 -92
- package/dist/shared/ui/mciCollapse/MciCollapse.js +86 -54
- package/dist/shared/ui/mciDrawer/MciDrawer.js +70 -52
- package/dist/shared/ui/mciInput/MciInput.js +143 -130
- package/dist/shared/ui/mciInput/mci-input.utils.js +10 -10
- package/dist/shared/ui/mciPagination/MciPagination.js +85 -63
- package/dist/shared/ui/mciPhone/MciPhone.js +59 -54
- package/dist/shared/ui/mciPhone/mci-phone.utils.js +10 -10
- package/dist/shared/ui/mciPicker/MciPicker.js +349 -181
- package/dist/shared/ui/mciSelect/MciSelect.js +150 -131
- package/dist/shared/ui/mciSelect/mci-select.utils.js +12 -12
- package/dist/shared/ui/mciSkeleton/MciSkeleton.js +16 -14
- package/dist/shared/ui/mciTable/MciTable.js +165 -126
- package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +125 -104
- package/dist/shared/ui/mciTabs/MciTabs.js +52 -45
- package/dist/shared/ui/mciTag/MciTag.js +27 -18
- package/dist/shared/ui/mciTextarea/MciTextarea.js +47 -35
- package/dist/shared/ui/mciToast/MciToast.js +118 -72
- package/dist/shared/ui/mciToast/mci-toast.utils.js +40 -12
- package/dist/shared/ui/mciToggle/MciToggle.js +58 -36
- package/dist/shared/ui/mciTooltip/MciTooltip.js +2 -2
- package/dist/shared/ui/mciUpload/MciUpload.js +172 -149
- package/dist/types/shared/types/mci-table.types.d.ts +2 -0
- package/dist/types/shared/types/ui/breadcrumb.types.d.ts +1 -0
- package/dist/types/shared/types/ui/button.types.d.ts +3 -7
- package/dist/types/shared/types/ui/check.types.d.ts +4 -9
- package/dist/types/shared/types/ui/collapse.types.d.ts +1 -0
- package/dist/types/shared/types/ui/drawer.types.d.ts +1 -0
- package/dist/types/shared/types/ui/input.types.d.ts +4 -15
- package/dist/types/shared/types/ui/modal.types.d.ts +1 -0
- package/dist/types/shared/types/ui/pagination.types.d.ts +1 -0
- package/dist/types/shared/types/ui/phone.types.d.ts +1 -0
- package/dist/types/shared/types/ui/picker.types.d.ts +1 -0
- package/dist/types/shared/types/ui/select.types.d.ts +1 -0
- package/dist/types/shared/types/ui/skeleton.types.d.ts +1 -0
- package/dist/types/shared/types/ui/tabs.types.d.ts +1 -0
- package/dist/types/shared/types/ui/tag.types.d.ts +1 -0
- package/dist/types/shared/types/ui/textarea.types.d.ts +3 -7
- package/dist/types/shared/types/ui/toast.types.d.ts +1 -0
- package/dist/types/shared/types/ui/toggle.types.d.ts +3 -2
- package/dist/types/shared/types/ui/upload.types.d.ts +1 -0
- package/dist/types/shared/ui/MciModal/MciModal.d.ts +1 -1
- package/dist/types/shared/ui/mciBreadcrumb/MciBreadcrumb.d.ts +1 -1
- package/dist/types/shared/ui/mciButton/MciButton.d.ts +1 -1
- package/dist/types/shared/ui/mciCollapse/MciCollapse.d.ts +1 -1
- package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -1
- package/dist/types/shared/ui/mciInput/MciInput.d.ts +13 -2
- package/dist/types/shared/ui/mciInput/mci-input.utils.d.ts +2 -2
- package/dist/types/shared/ui/mciPagination/MciPagination.d.ts +1 -1
- package/dist/types/shared/ui/mciPhone/mci-phone.utils.d.ts +2 -2
- package/dist/types/shared/ui/mciSelect/mci-select.utils.d.ts +2 -2
- package/dist/types/shared/ui/mciSkeleton/MciSkeleton.d.ts +1 -1
- package/dist/types/shared/ui/mciTable/MciTable.d.ts +1 -1
- package/dist/types/shared/ui/mciTable/MciTableColumnsPanel.d.ts +4 -2
- package/dist/types/shared/ui/mciTabs/MciTabs.d.ts +1 -1
- package/dist/types/shared/ui/mciTag/MciTag.d.ts +1 -1
- package/dist/types/shared/ui/mciTextarea/MciTextarea.d.ts +7 -2
- package/dist/types/shared/ui/mciToast/mci-toast.utils.d.ts +32 -4
- package/dist/types/shared/ui/mciToggle/MciToggle.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,226 +1,245 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { AltArrowDown as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { useClickOutside as
|
|
6
|
-
import { getFilteredOptions as
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as _, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { AltArrowDown as st } from "@solar-icons/react";
|
|
3
|
+
import ot from "../../../assets/icons/close.svg.js";
|
|
4
|
+
import { forwardRef as ct, useState as w, useRef as G, useMemo as O, useCallback as h, useEffect as J } from "react";
|
|
5
|
+
import { useClickOutside as it, useEscapeKey as ut, cn as s } from "../../lib/utils.js";
|
|
6
|
+
import { getFilteredOptions as ft, getSelectStateStyles as mt, getSelectIconColor as ht, SELECT_SIZES as pt } from "./mci-select.utils.js";
|
|
7
|
+
const xt = ct(
|
|
8
8
|
({
|
|
9
|
-
label:
|
|
10
|
-
placeholder:
|
|
11
|
-
options:
|
|
12
|
-
icon:
|
|
13
|
-
iconPosition:
|
|
14
|
-
size:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
label: U,
|
|
10
|
+
placeholder: A = "Выберите...",
|
|
11
|
+
options: L = [],
|
|
12
|
+
icon: v,
|
|
13
|
+
iconPosition: R = "left",
|
|
14
|
+
size: l = "base",
|
|
15
|
+
darkMode: e = !1,
|
|
16
|
+
error: o,
|
|
17
|
+
disabled: r = !1,
|
|
18
|
+
required: Q = !1,
|
|
19
|
+
value: m,
|
|
20
|
+
onChange: b,
|
|
21
|
+
onFocus: W,
|
|
22
|
+
onBlur: y,
|
|
23
|
+
className: X,
|
|
24
|
+
clearable: Y = !1,
|
|
25
|
+
searchable: p = !1,
|
|
26
|
+
onSearch: N,
|
|
27
|
+
name: k
|
|
28
|
+
}, z) => {
|
|
29
|
+
const [n, S] = w(!1), [i, F] = w(!1), [M, $] = w(""), [T, x] = w(""), [C, u] = w(-1), H = G(null), K = G(null), d = m !== void 0 ? m : M, Z = L.find((t) => t.value === d), E = d !== "" && d !== void 0, D = Y && E && !r, I = !!(v && R === "right"), c = pt[l], tt = O(() => I && D ? l === "sm" || l === "md" ? "pr-16" : "pr-20" : I || D ? l === "sm" ? "pr-11" : l === "md" ? "pr-12" : "pr-14" : l === "sm" ? "pr-8" : l === "md" ? "pr-9" : "pr-10", [I, D, l]), f = O(() => ft(L, T, p, !!N), [L, T, p, N]), q = h(() => {
|
|
30
|
+
S(!1), F(!1), x(""), u(-1), y?.();
|
|
31
|
+
}, [y]), { handleClick: V } = it(H, q), { handleEscape: j } = ut(q);
|
|
32
|
+
J(() => {
|
|
32
33
|
if (n)
|
|
33
|
-
return document.addEventListener("mousedown",
|
|
34
|
-
document.removeEventListener("mousedown",
|
|
34
|
+
return document.addEventListener("mousedown", V), document.addEventListener("keydown", j), () => {
|
|
35
|
+
document.removeEventListener("mousedown", V), document.removeEventListener("keydown", j);
|
|
35
36
|
};
|
|
36
|
-
}, [n,
|
|
37
|
-
n &&
|
|
38
|
-
}, [n,
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
(
|
|
43
|
-
|
|
37
|
+
}, [n, V, j]), J(() => {
|
|
38
|
+
n && p && K.current && K.current.focus();
|
|
39
|
+
}, [n, p]);
|
|
40
|
+
const et = h(() => {
|
|
41
|
+
r || (S((t) => !t), n ? (x(""), u(-1)) : (F(!0), W?.()));
|
|
42
|
+
}, [r, n, W]), P = h(
|
|
43
|
+
(t) => {
|
|
44
|
+
m === void 0 && $(t), b?.(t), S(!1), F(!1), x(""), u(-1), y?.();
|
|
44
45
|
},
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
(
|
|
48
|
-
if (!
|
|
49
|
-
if (!n && (
|
|
50
|
-
|
|
46
|
+
[m, b, y]
|
|
47
|
+
), nt = h(
|
|
48
|
+
(t) => {
|
|
49
|
+
if (!r) {
|
|
50
|
+
if (!n && (t.key === "ArrowDown" || t.key === "ArrowUp" || t.key === "Enter")) {
|
|
51
|
+
t.preventDefault(), S(!0);
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
54
|
if (n)
|
|
54
|
-
switch (
|
|
55
|
+
switch (t.key) {
|
|
55
56
|
case "ArrowDown":
|
|
56
|
-
|
|
57
|
-
(
|
|
57
|
+
t.preventDefault(), u(
|
|
58
|
+
(g) => g < f.length - 1 ? g + 1 : 0
|
|
58
59
|
);
|
|
59
60
|
break;
|
|
60
61
|
case "ArrowUp":
|
|
61
|
-
|
|
62
|
-
(
|
|
62
|
+
t.preventDefault(), u(
|
|
63
|
+
(g) => g > 0 ? g - 1 : f.length - 1
|
|
63
64
|
);
|
|
64
65
|
break;
|
|
65
66
|
case "Enter":
|
|
66
|
-
|
|
67
|
+
t.preventDefault(), C >= 0 && f[C] && P(f[C].value);
|
|
67
68
|
break;
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
},
|
|
71
|
-
[n,
|
|
72
|
-
),
|
|
73
|
-
(
|
|
74
|
-
|
|
72
|
+
[n, f, C, r, P]
|
|
73
|
+
), rt = h(
|
|
74
|
+
(t) => {
|
|
75
|
+
t.stopPropagation(), !r && (m === void 0 && $(""), b?.(""), x(""), u(-1));
|
|
75
76
|
},
|
|
76
|
-
[
|
|
77
|
-
),
|
|
78
|
-
(
|
|
79
|
-
|
|
77
|
+
[m, b, r]
|
|
78
|
+
), lt = h(
|
|
79
|
+
(t) => {
|
|
80
|
+
x(t), N?.(t), u(0);
|
|
80
81
|
},
|
|
81
|
-
[
|
|
82
|
-
),
|
|
83
|
-
() =>
|
|
84
|
-
[
|
|
82
|
+
[N]
|
|
83
|
+
), at = O(
|
|
84
|
+
() => mt(r, o, e),
|
|
85
|
+
[o, r, e]
|
|
86
|
+
), B = O(
|
|
87
|
+
() => ht(r, o, n, i, e),
|
|
88
|
+
[r, o, n, i, e]
|
|
85
89
|
);
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
|
|
90
|
+
return /* @__PURE__ */ _("div", { className: s("w-full", X), ref: z, children: [
|
|
91
|
+
U && /* @__PURE__ */ _(
|
|
88
92
|
"label",
|
|
89
93
|
{
|
|
90
|
-
htmlFor:
|
|
91
|
-
className:
|
|
94
|
+
htmlFor: k,
|
|
95
|
+
className: s(
|
|
92
96
|
"mb-2 block text-base font-medium",
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
o ? e ? "text-red-500" : "text-red-600" : e ? "text-neutral-50" : "text-slate-700",
|
|
98
|
+
c.label
|
|
95
99
|
),
|
|
96
100
|
children: [
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
U,
|
|
102
|
+
Q && /* @__PURE__ */ a("span", { className: "ml-1 text-red-600", children: "*" })
|
|
99
103
|
]
|
|
100
104
|
}
|
|
101
105
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ _(
|
|
103
107
|
"div",
|
|
104
108
|
{
|
|
105
|
-
ref:
|
|
109
|
+
ref: H,
|
|
106
110
|
className: "relative",
|
|
107
|
-
onKeyDown:
|
|
111
|
+
onKeyDown: nt,
|
|
108
112
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ _(
|
|
110
114
|
"div",
|
|
111
115
|
{
|
|
112
116
|
role: "combobox",
|
|
113
117
|
"aria-expanded": n,
|
|
114
118
|
"aria-haspopup": "listbox",
|
|
115
|
-
"aria-controls": `${
|
|
116
|
-
"aria-disabled":
|
|
117
|
-
tabIndex:
|
|
118
|
-
onClick:
|
|
119
|
-
className:
|
|
119
|
+
"aria-controls": `${k}-listbox`,
|
|
120
|
+
"aria-disabled": r,
|
|
121
|
+
tabIndex: r ? -1 : 0,
|
|
122
|
+
onClick: et,
|
|
123
|
+
className: s(
|
|
120
124
|
"flex w-full items-center border font-normal transition-all duration-300 ease-in-out",
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
!
|
|
125
|
+
l === "base" ? "rounded-xl" : "rounded-lg",
|
|
126
|
+
c.container,
|
|
127
|
+
v && R === "left" ? c.iconPaddingLeft : c.padding,
|
|
128
|
+
tt,
|
|
129
|
+
at,
|
|
130
|
+
e && !r && (i || n) && !o && "border-blue-500 shadow-[0_0_0_2px_var(--opacity-25,rgba(21,93,252,0.25))] text-white",
|
|
131
|
+
e && !r && (i || n) && o && "border-red-500 shadow-[0_0_0_2px_rgba(231,0,11,0.25)]",
|
|
132
|
+
!e && !r && i && "shadow-blue border-blue-600"
|
|
127
133
|
),
|
|
128
134
|
children: [
|
|
129
|
-
|
|
135
|
+
v && /* @__PURE__ */ a(
|
|
130
136
|
"div",
|
|
131
137
|
{
|
|
132
|
-
className:
|
|
138
|
+
className: s(
|
|
133
139
|
"absolute top-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-300",
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
R === "left" ? c.iconWrapper : c.rightIconWrapper,
|
|
141
|
+
B
|
|
136
142
|
),
|
|
137
|
-
children:
|
|
143
|
+
children: v
|
|
138
144
|
}
|
|
139
145
|
),
|
|
140
|
-
|
|
146
|
+
p && n ? /* @__PURE__ */ a(
|
|
141
147
|
"input",
|
|
142
148
|
{
|
|
143
|
-
ref:
|
|
149
|
+
ref: K,
|
|
144
150
|
type: "text",
|
|
145
151
|
value: T,
|
|
146
|
-
onChange: (
|
|
147
|
-
placeholder:
|
|
148
|
-
className:
|
|
149
|
-
|
|
152
|
+
onChange: (t) => lt(t.target.value),
|
|
153
|
+
placeholder: A,
|
|
154
|
+
className: s(
|
|
155
|
+
"w-full min-w-0 flex-1 bg-transparent outline-none",
|
|
156
|
+
e ? "text-white placeholder:text-neutral-100" : "text-black"
|
|
157
|
+
),
|
|
158
|
+
onClick: (t) => t.stopPropagation()
|
|
150
159
|
}
|
|
151
|
-
) : /* @__PURE__ */
|
|
160
|
+
) : /* @__PURE__ */ a(
|
|
152
161
|
"span",
|
|
153
162
|
{
|
|
154
|
-
title:
|
|
155
|
-
className:
|
|
163
|
+
title: Z?.label || A,
|
|
164
|
+
className: s(
|
|
156
165
|
"block min-w-0 flex-1 truncate select-none",
|
|
157
|
-
|
|
166
|
+
!E && !r && (e ? "text-neutral-100" : "text-slate-400"),
|
|
167
|
+
e && E && (i || n) && "text-white",
|
|
168
|
+
e && E && !i && !n && "text-neutral-50"
|
|
158
169
|
),
|
|
159
|
-
children:
|
|
170
|
+
children: Z?.label || A
|
|
160
171
|
}
|
|
161
172
|
),
|
|
162
|
-
|
|
173
|
+
D && /* @__PURE__ */ a(
|
|
163
174
|
"button",
|
|
164
175
|
{
|
|
165
176
|
type: "button",
|
|
166
|
-
onClick:
|
|
167
|
-
className:
|
|
168
|
-
"absolute top-1/2 -translate-y-1/2
|
|
169
|
-
|
|
177
|
+
onClick: rt,
|
|
178
|
+
className: s(
|
|
179
|
+
"absolute top-1/2 -translate-y-1/2 transition-colors cursor-pointer",
|
|
180
|
+
e ? "text-neutral-100 hover:text-white" : "text-slate-400 hover:text-black",
|
|
181
|
+
I ? l === "sm" ? "right-8" : l === "md" ? "right-9" : "right-10" : l === "sm" ? "right-7" : l === "md" ? "right-8" : "right-9"
|
|
170
182
|
),
|
|
171
183
|
"aria-label": "Очистить",
|
|
172
|
-
children: /* @__PURE__ */
|
|
184
|
+
children: /* @__PURE__ */ a(ot, { className: c.iconSize })
|
|
173
185
|
}
|
|
174
186
|
),
|
|
175
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ a(
|
|
176
188
|
"div",
|
|
177
189
|
{
|
|
178
|
-
className:
|
|
190
|
+
className: s(
|
|
179
191
|
"absolute top-1/2 -translate-y-1/2 pointer-events-none transition-all duration-300",
|
|
180
|
-
|
|
192
|
+
l === "sm" ? "right-2" : "right-3",
|
|
181
193
|
n && "rotate-180",
|
|
182
|
-
|
|
194
|
+
B
|
|
183
195
|
),
|
|
184
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ a(st, { className: c.iconSize })
|
|
185
197
|
}
|
|
186
198
|
)
|
|
187
199
|
]
|
|
188
200
|
}
|
|
189
201
|
),
|
|
190
|
-
n && !
|
|
202
|
+
n && !r && /* @__PURE__ */ a(
|
|
191
203
|
"div",
|
|
192
204
|
{
|
|
193
|
-
id: `${
|
|
205
|
+
id: `${k}-listbox`,
|
|
194
206
|
role: "listbox",
|
|
195
|
-
className:
|
|
196
|
-
"absolute z-50 mt-1 max-h-60 w-full overflow-y-auto rounded-lg border
|
|
197
|
-
|
|
207
|
+
className: s(
|
|
208
|
+
"absolute z-50 mt-1 max-h-60 w-full overflow-y-auto rounded-lg border p-1 shadow-md",
|
|
209
|
+
e ? "border-neutral-200 bg-[#1F2025] text-neutral-50" : "border-slate-200 bg-white text-black",
|
|
210
|
+
c.dropdown
|
|
198
211
|
),
|
|
199
|
-
children:
|
|
212
|
+
children: f.length === 0 ? /* @__PURE__ */ a("div", { className: s(
|
|
213
|
+
"px-3 py-2 text-center text-base font-normal",
|
|
214
|
+
e ? "text-neutral-100" : "text-slate-500"
|
|
215
|
+
), children: "Ничего не найдено" }) : f.map((t) => /* @__PURE__ */ a(
|
|
200
216
|
"div",
|
|
201
217
|
{
|
|
202
218
|
role: "option",
|
|
203
|
-
"aria-selected":
|
|
204
|
-
onClick: () =>
|
|
205
|
-
title:
|
|
206
|
-
className:
|
|
207
|
-
"cursor-pointer truncate px-3 py-2 font-normal transition-colors
|
|
208
|
-
|
|
219
|
+
"aria-selected": d === t.value,
|
|
220
|
+
onClick: () => P(t.value),
|
|
221
|
+
title: t.label,
|
|
222
|
+
className: s(
|
|
223
|
+
"cursor-pointer truncate rounded-sm px-3 py-2 font-normal transition-colors",
|
|
224
|
+
d === t.value ? e ? "bg-neutral-300 text-white" : "bg-slate-100" : e ? "hover:bg-neutral-300 hover:text-white" : "hover:bg-slate-100"
|
|
209
225
|
),
|
|
210
|
-
children:
|
|
226
|
+
children: t.label
|
|
211
227
|
},
|
|
212
|
-
|
|
228
|
+
t.value
|
|
213
229
|
))
|
|
214
230
|
}
|
|
215
231
|
)
|
|
216
232
|
]
|
|
217
233
|
}
|
|
218
234
|
),
|
|
219
|
-
|
|
235
|
+
o && /* @__PURE__ */ a("p", { className: s(
|
|
236
|
+
"mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal",
|
|
237
|
+
e ? "text-red-500" : "text-red-600"
|
|
238
|
+
), children: o })
|
|
220
239
|
] });
|
|
221
240
|
}
|
|
222
241
|
);
|
|
223
|
-
|
|
242
|
+
xt.displayName = "MciSelect";
|
|
224
243
|
export {
|
|
225
|
-
|
|
244
|
+
xt as default
|
|
226
245
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i = {
|
|
2
2
|
sm: {
|
|
3
3
|
container: "h-9 text-sm",
|
|
4
4
|
padding: "px-2",
|
|
@@ -33,20 +33,20 @@ const a = {
|
|
|
33
33
|
dropdown: "text-base"
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
function
|
|
36
|
+
function l(e, t, r, n) {
|
|
37
37
|
if (!r || n) return e;
|
|
38
|
-
const
|
|
39
|
-
return e.filter((
|
|
38
|
+
const o = t.toLowerCase();
|
|
39
|
+
return e.filter((a) => a.label.toLowerCase().includes(o));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return e ? "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" : t ? "border-red-600 focus:border-red-600 shadow-red bg-white" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white";
|
|
41
|
+
function d(e, t, r = !1) {
|
|
42
|
+
return r ? e ? "border-neutral-200 bg-neutral-300 text-neutral-100/50 cursor-not-allowed" : t ? "border-red-500 bg-transparent text-neutral-50 hover:border-red-500" : "border-neutral-200 bg-transparent text-neutral-50 hover:border-neutral-100" : e ? "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" : t ? "border-red-600 focus:border-red-600 shadow-red bg-white" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white";
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return e ? "text-slate-400" : t ? "text-red-600" : r || n ? "text-black" : "text-slate-400";
|
|
44
|
+
function u(e, t, r, n, o = !1) {
|
|
45
|
+
return o ? e ? "text-neutral-100/50" : t ? "text-red-500" : r || n ? "text-white" : "text-neutral-100" : e ? "text-slate-400" : t ? "text-red-600" : r || n ? "text-black" : "text-slate-400";
|
|
46
46
|
}
|
|
47
47
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
i as SELECT_SIZES,
|
|
49
|
+
l as getFilteredOptions,
|
|
50
|
+
u as getSelectIconColor,
|
|
51
|
+
d as getSelectStateStyles
|
|
52
52
|
};
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
function
|
|
4
|
-
className:
|
|
5
|
-
variant:
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { cn as t } from "../../lib/utils.js";
|
|
3
|
+
function a({
|
|
4
|
+
className: o,
|
|
5
|
+
variant: l = "default",
|
|
6
6
|
width: e = "100%",
|
|
7
|
-
height: r = "1rem"
|
|
7
|
+
height: r = "1rem",
|
|
8
|
+
darkMode: s = !1
|
|
8
9
|
}) {
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ m(
|
|
10
11
|
"div",
|
|
11
12
|
{
|
|
12
|
-
className:
|
|
13
|
-
"relative overflow-hidden
|
|
13
|
+
className: t(
|
|
14
|
+
"relative overflow-hidden",
|
|
15
|
+
s ? "bg-slate-700" : "bg-slate-200",
|
|
14
16
|
"rounded-lg",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
l === "circle" && "rounded-full",
|
|
18
|
+
l === "rounded" && "rounded-md",
|
|
19
|
+
o
|
|
18
20
|
),
|
|
19
21
|
style: {
|
|
20
22
|
width: typeof e == "number" ? `${e}px` : e,
|
|
21
23
|
height: typeof r == "number" ? `${r}px` : r
|
|
22
24
|
},
|
|
23
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ m("div", { className: s ? "shimmer-mask-dark absolute inset-0" : "shimmer-mask absolute inset-0" })
|
|
24
26
|
}
|
|
25
27
|
);
|
|
26
28
|
}
|
|
27
29
|
export {
|
|
28
|
-
|
|
30
|
+
a as default
|
|
29
31
|
};
|