@konstructio/ui 0.1.2-alpha.41 → 0.1.2-alpha.44
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/{Modal-CtAG97Ts.js → Modal-CjC-CIJ8.js} +2 -2
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/{chevron-up-CRyLc5Ml.js → chevron-up-DEfvgPCw.js} +1 -1
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +75 -49
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +31 -30
- package/dist/components/Badge/Badge.variants.js +53 -16
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Card/Card.variants.js +4 -5
- package/dist/components/Checkbox/Checkbox.js +4 -4
- package/dist/components/Checkbox/Checkbox.variants.js +5 -1
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1231 -1047
- package/dist/components/Dropdown/Dropdown.js +13 -13
- package/dist/components/Dropdown/Dropdown.variants.js +7 -6
- package/dist/components/Dropdown/components/List/List.js +42 -20
- package/dist/components/Dropdown/components/List/List.variants.js +5 -5
- package/dist/components/Dropdown/components/ListItem/ListItem.js +20 -20
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +2 -2
- package/dist/components/Dropdown/components/Wrapper.js +60 -46
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.variants.js +6 -5
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +73 -46
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
- package/dist/components/Filter/components/ResetButton/ResetButton.js +28 -14
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.variants.js +2 -2
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +358 -315
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PhoneNumberInput/components/Wrapper.js +58 -58
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +2 -2
- package/dist/components/PhoneNumberInput/utils/index.js +1 -1
- package/dist/components/PieChart/PieChart.js +4 -4
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +2 -2
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +3 -2
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/TimePicker/TimePicker.js +1 -1
- package/dist/components/TimePicker/TimePicker.variants.js +20 -13
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +23 -16
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
- package/dist/components/Toast/Toast.js +8 -8
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.js +11 -9
- package/dist/components/VirtualizedTable/VirtualizedTable.js +58 -54
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +58 -26
- package/dist/components/VirtualizedTable/components/Body/Body.js +72 -46
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +80 -77
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +37 -40
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +19 -18
- package/dist/components/VirtualizedTable/components/Header/Header.js +49 -31
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +36 -23
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +74 -35
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{index-mPY_8Y5v.js → index-AV6ZtGhy.js} +1 -1
- package/dist/{index-CigKKiZS.js → index-BG8O18ZY.js} +5 -3
- package/dist/{index-DrWQH0QF.js → index-BKjcReYh.js} +2 -2
- package/dist/{index--V_ZsiQe.js → index-BOE_3f_Z.js} +4 -4
- package/dist/{index-Dbt2vBmS.js → index-BlSRBdPy.js} +1 -1
- package/dist/{index-C3tHPg8y.js → index-BmVmDQGH.js} +2 -2
- package/dist/{index-BtQfgaSF.js → index-BvoZGpli.js} +2 -2
- package/dist/{index-2hB40Iuc.js → index-Byr10W8m.js} +6 -6
- package/dist/index-CPU02rhe.js +134 -0
- package/dist/{index-Ds6U2x4Z.js → index-CeZcoQDw.js} +11 -11
- package/dist/{index-CdwPV0FE.js → index-D9SSJ6om.js} +3 -3
- package/dist/{index-CIAmiWcw.js → index-DKfEnhKr.js} +2 -2
- package/dist/{index-CSFe9uC5.js → index-DMb4KD0b.js} +1 -1
- package/dist/{index-ohdbKsws.js → index-DtEcCIrM.js} +1 -1
- package/dist/{index-BbQkJE5L.js → index-Dy59FQl5.js} +1 -1
- package/dist/{index-DpW9ExsS.js → index-gSPwC-1I.js} +3 -3
- package/dist/{index-DH2Fnov1.js → index-vcSp8YRZ.js} +4 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/{libphonenumber-_7ZyKWA7.js → libphonenumber-FTwQ9nyV.js} +11 -11
- package/dist/package.json +21 -21
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +11 -10
- package/dist/{x-DPU9OdYH.js → x-Eoa9FJjA.js} +1 -1
- package/package.json +21 -21
- package/dist/chevron-left-C4LEg1fH.js +0 -7
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
- package/dist/index-C65LtGuU.js +0 -137
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as w } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as h } from "react";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as r } from "../../utils/index.js";
|
|
4
4
|
import { DropdownProvider as v } from "./contexts/dropdown.provider.js";
|
|
5
5
|
import { Wrapper as N } from "./components/Wrapper.js";
|
|
6
6
|
const W = h(
|
|
7
7
|
({
|
|
8
8
|
error: t,
|
|
9
|
-
errorClassName:
|
|
10
|
-
helperText:
|
|
11
|
-
helperTextClassName:
|
|
9
|
+
errorClassName: e,
|
|
10
|
+
helperText: s,
|
|
11
|
+
helperTextClassName: i,
|
|
12
12
|
highlightSearch: a,
|
|
13
13
|
mainWrapperClassName: p,
|
|
14
14
|
name: l,
|
|
15
15
|
value: d,
|
|
16
16
|
options: n,
|
|
17
17
|
onChange: c,
|
|
18
|
-
onBlur:
|
|
18
|
+
onBlur: m,
|
|
19
19
|
...f
|
|
20
|
-
}, x) => /* @__PURE__ */
|
|
20
|
+
}, x) => /* @__PURE__ */ o(
|
|
21
21
|
v,
|
|
22
22
|
{
|
|
23
23
|
highlightSearch: a,
|
|
24
24
|
name: l,
|
|
25
25
|
value: d,
|
|
26
26
|
options: n,
|
|
27
|
-
onBlur:
|
|
27
|
+
onBlur: m,
|
|
28
28
|
onChange: c,
|
|
29
|
-
children: /* @__PURE__ */ w("div", { className:
|
|
30
|
-
/* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ w("div", { className: r("relative w-full", p), children: [
|
|
30
|
+
/* @__PURE__ */ o(
|
|
31
31
|
N,
|
|
32
32
|
{
|
|
33
33
|
error: t,
|
|
34
34
|
name: l,
|
|
35
35
|
ref: x,
|
|
36
|
-
onBlur:
|
|
36
|
+
onBlur: m,
|
|
37
37
|
...f
|
|
38
38
|
}
|
|
39
39
|
),
|
|
40
|
-
t ? /* @__PURE__ */
|
|
41
|
-
!t &&
|
|
40
|
+
t ? /* @__PURE__ */ o("span", { className: r("text-xs text-red-700", e), children: t }) : null,
|
|
41
|
+
!t && s ? /* @__PURE__ */ o("span", { className: r("text-xs text-metal-600", i), children: s }) : null
|
|
42
42
|
] })
|
|
43
43
|
}
|
|
44
44
|
)
|
|
@@ -22,8 +22,9 @@ const a = e(
|
|
|
22
22
|
"aria-expanded:text-aurora-500",
|
|
23
23
|
"kubefirst:aria-expanded:border-kubefirst-primary",
|
|
24
24
|
"kubefirst:aria-expanded:text-kubefirst-secondary",
|
|
25
|
-
"dark:border-
|
|
26
|
-
"dark:focus-visible:bg-
|
|
25
|
+
"dark:border-metal-700",
|
|
26
|
+
"dark:focus-visible:bg-metal-800",
|
|
27
|
+
"dark:bg-metal-800"
|
|
27
28
|
],
|
|
28
29
|
{
|
|
29
30
|
variants: {
|
|
@@ -37,7 +38,7 @@ const a = e(
|
|
|
37
38
|
false: ""
|
|
38
39
|
},
|
|
39
40
|
disabled: {
|
|
40
|
-
true: ["cursor-default", "bg-gray-100", "dark:bg-
|
|
41
|
+
true: ["cursor-default", "bg-gray-100", "dark:bg-metal-700/80"],
|
|
41
42
|
false: []
|
|
42
43
|
}
|
|
43
44
|
},
|
|
@@ -57,15 +58,15 @@ const a = e(
|
|
|
57
58
|
"placeholder:text-sm",
|
|
58
59
|
"placeholder:normal-case",
|
|
59
60
|
"placeholder:select-none",
|
|
60
|
-
"dark:placeholder:text-
|
|
61
|
-
"dark:text-
|
|
61
|
+
"dark:placeholder:text-metal-400",
|
|
62
|
+
"dark:text-metal-50"
|
|
62
63
|
]), d = e([
|
|
63
64
|
"mb-1",
|
|
64
65
|
"cursor-pointer",
|
|
65
66
|
"text-sm",
|
|
66
67
|
"leading-5",
|
|
67
68
|
"tracking-[0.1px]",
|
|
68
|
-
"dark:text-
|
|
69
|
+
"dark:text-metal-50"
|
|
69
70
|
]);
|
|
70
71
|
export {
|
|
71
72
|
a as dropdownVariants,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as V, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { S as Z } from "../../../../index-
|
|
2
|
+
import { S as Z } from "../../../../index-BvoZGpli.js";
|
|
3
3
|
import { d as B } from "../../../../debounce-BFejQm9P.js";
|
|
4
4
|
import { forwardRef as G, useRef as C, useState as J, useImperativeHandle as K, useMemo as M, useEffect as Q } from "react";
|
|
5
5
|
import { Loading as R } from "../../../Loading/Loading.js";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as s } from "../../../../utils/index.js";
|
|
7
7
|
import { useNavigationUlList as W } from "../../hooks/useNavigationList.js";
|
|
8
8
|
import { ListItem as b } from "../ListItem/ListItem.js";
|
|
9
9
|
import { listVariants as X } from "./List.variants.js";
|
|
@@ -24,11 +24,11 @@ const fe = G(
|
|
|
24
24
|
onFetchMoreOptions: f,
|
|
25
25
|
noOptionsText: L
|
|
26
26
|
}, O) => {
|
|
27
|
-
const
|
|
27
|
+
const n = C(null), m = C(null), [p, w] = J(!1), {
|
|
28
28
|
isOpen: P,
|
|
29
29
|
searchTerm: g,
|
|
30
30
|
canFilter: S,
|
|
31
|
-
canContinueFetching:
|
|
31
|
+
canContinueFetching: a,
|
|
32
32
|
page: d,
|
|
33
33
|
options: x,
|
|
34
34
|
isTyping: k,
|
|
@@ -36,31 +36,31 @@ const fe = G(
|
|
|
36
36
|
setPage: D,
|
|
37
37
|
setCanContinueFetching: U
|
|
38
38
|
} = $();
|
|
39
|
-
K(O, () =>
|
|
39
|
+
K(O, () => n.current, [n]);
|
|
40
40
|
const h = y && S ? x.filter((e) => {
|
|
41
41
|
const t = g.toLowerCase();
|
|
42
42
|
return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(t);
|
|
43
43
|
}) : x;
|
|
44
44
|
W({
|
|
45
|
-
ulRef:
|
|
45
|
+
ulRef: n,
|
|
46
46
|
wrapperInputRef: j,
|
|
47
47
|
searchable: y,
|
|
48
48
|
filteredOptions: h
|
|
49
49
|
});
|
|
50
50
|
const _ = h.filter(
|
|
51
|
-
(e, t,
|
|
51
|
+
(e, t, o) => t === o.findIndex((v) => v.value === e.value)
|
|
52
52
|
), q = h.length === 0, z = M(
|
|
53
53
|
() => B(async (e) => {
|
|
54
54
|
const [t] = e;
|
|
55
|
-
if (t.isIntersecting && !p && f &&
|
|
55
|
+
if (t.isIntersecting && !p && f && a)
|
|
56
56
|
try {
|
|
57
57
|
w(!0);
|
|
58
|
-
const
|
|
59
|
-
page:
|
|
58
|
+
const o = d + 1, { data: v, hasMore: A } = await f({
|
|
59
|
+
page: o,
|
|
60
60
|
pageSize: Y,
|
|
61
61
|
termOfSearch: g
|
|
62
62
|
});
|
|
63
|
-
D(
|
|
63
|
+
D(o), U(A), T((H) => [...H, ...v]);
|
|
64
64
|
} catch {
|
|
65
65
|
console.error("Error fetching more options");
|
|
66
66
|
} finally {
|
|
@@ -70,7 +70,7 @@ const fe = G(
|
|
|
70
70
|
[p, f, g, d]
|
|
71
71
|
);
|
|
72
72
|
return Q(() => {
|
|
73
|
-
if (u &&
|
|
73
|
+
if (u && a && m.current && !k) {
|
|
74
74
|
const e = new IntersectionObserver(z, {
|
|
75
75
|
threshold: 0.1
|
|
76
76
|
});
|
|
@@ -78,23 +78,23 @@ const fe = G(
|
|
|
78
78
|
}
|
|
79
79
|
}, [
|
|
80
80
|
u,
|
|
81
|
-
|
|
81
|
+
a,
|
|
82
82
|
p,
|
|
83
83
|
k,
|
|
84
84
|
d
|
|
85
85
|
]), /* @__PURE__ */ V(
|
|
86
86
|
"ul",
|
|
87
87
|
{
|
|
88
|
-
ref:
|
|
88
|
+
ref: n,
|
|
89
89
|
title: I,
|
|
90
90
|
role: "listbox",
|
|
91
|
-
className:
|
|
91
|
+
className: s(X({ className: N })),
|
|
92
92
|
"data-state": P ? "open" : "closed",
|
|
93
93
|
children: [
|
|
94
94
|
E ? /* @__PURE__ */ r(
|
|
95
95
|
b,
|
|
96
96
|
{
|
|
97
|
-
className:
|
|
97
|
+
className: s("select-none", l),
|
|
98
98
|
isClickable: !1,
|
|
99
99
|
inputRef: i,
|
|
100
100
|
value: "Loading...",
|
|
@@ -105,7 +105,7 @@ const fe = G(
|
|
|
105
105
|
b,
|
|
106
106
|
{
|
|
107
107
|
isEmpty: !0,
|
|
108
|
-
className:
|
|
108
|
+
className: s("select-none", l),
|
|
109
109
|
isClickable: !1,
|
|
110
110
|
inputRef: i,
|
|
111
111
|
value: L ?? "",
|
|
@@ -115,7 +115,7 @@ const fe = G(
|
|
|
115
115
|
) : _.map((e) => /* @__PURE__ */ r(
|
|
116
116
|
b,
|
|
117
117
|
{
|
|
118
|
-
className:
|
|
118
|
+
className: s("select-none", l),
|
|
119
119
|
isClickable: !0,
|
|
120
120
|
inputRef: i,
|
|
121
121
|
listItemSecondRowClassName: c,
|
|
@@ -123,7 +123,7 @@ const fe = G(
|
|
|
123
123
|
},
|
|
124
124
|
e.value
|
|
125
125
|
)),
|
|
126
|
-
u &&
|
|
126
|
+
u && a && /* @__PURE__ */ r(
|
|
127
127
|
"li",
|
|
128
128
|
{
|
|
129
129
|
ref: m,
|
|
@@ -134,7 +134,29 @@ const fe = G(
|
|
|
134
134
|
children: /* @__PURE__ */ r(R, { className: "w-4 h-4 text-aurora-500 select-none" })
|
|
135
135
|
}
|
|
136
136
|
),
|
|
137
|
-
F?.map((e, t) => /* @__PURE__ */ r("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ r(
|
|
137
|
+
F?.map((e, t) => /* @__PURE__ */ r("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ r(
|
|
138
|
+
Z,
|
|
139
|
+
{
|
|
140
|
+
className: s(
|
|
141
|
+
"flex",
|
|
142
|
+
"p-2",
|
|
143
|
+
"w-full",
|
|
144
|
+
"h-full",
|
|
145
|
+
"gap-1",
|
|
146
|
+
"items-center",
|
|
147
|
+
"text-sm",
|
|
148
|
+
"[&>svg]:w-3.5",
|
|
149
|
+
"[&>svg]:h-3.5",
|
|
150
|
+
"[&>svg]:shrink-0",
|
|
151
|
+
"cursor-pointer",
|
|
152
|
+
"select-none",
|
|
153
|
+
"hover:bg-gray-50",
|
|
154
|
+
"hover:dark:bg-metal-700",
|
|
155
|
+
"focus:outline-0"
|
|
156
|
+
),
|
|
157
|
+
children: e
|
|
158
|
+
}
|
|
159
|
+
) }, t))
|
|
138
160
|
]
|
|
139
161
|
}
|
|
140
162
|
);
|
|
@@ -11,17 +11,17 @@ const t = o([
|
|
|
11
11
|
"top-full",
|
|
12
12
|
"w-full",
|
|
13
13
|
"z-10",
|
|
14
|
-
"max-h-
|
|
14
|
+
"max-h-46.25",
|
|
15
15
|
"overflow-y-auto",
|
|
16
16
|
"border-gray-200",
|
|
17
17
|
"text-zinc-700",
|
|
18
18
|
"animate-in",
|
|
19
19
|
"fade-in-50",
|
|
20
20
|
"zoom-in-95",
|
|
21
|
-
"duration-
|
|
22
|
-
"dark:bg-
|
|
23
|
-
"dark:border-
|
|
24
|
-
"dark:text-
|
|
21
|
+
"duration-200",
|
|
22
|
+
"dark:bg-metal-800",
|
|
23
|
+
"dark:border-metal-700",
|
|
24
|
+
"dark:text-metal-50"
|
|
25
25
|
]);
|
|
26
26
|
export {
|
|
27
27
|
t as listVariants
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as I, useCallback as u } from "react";
|
|
3
3
|
import { cn as l } from "../../../../utils/index.js";
|
|
4
4
|
import { Typography as y } from "../../../Typography/Typography.js";
|
|
5
5
|
import { listItemVariants as L } from "./ListItem.variants.js";
|
|
6
6
|
import { useDropdownContext as V } from "../../contexts/dropdown.hook.js";
|
|
7
|
-
function j(c,
|
|
8
|
-
const i =
|
|
9
|
-
return c.split(o).map((a, t) => a.toLowerCase() ===
|
|
7
|
+
function j(c, r) {
|
|
8
|
+
const i = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(`(${i})`, "gi");
|
|
9
|
+
return c.split(o).map((a, t) => a.toLowerCase() === r.toLowerCase() ? /* @__PURE__ */ n(
|
|
10
10
|
"mark",
|
|
11
11
|
{
|
|
12
|
-
className: "bg-transparent font-semibold text-
|
|
12
|
+
className: "bg-transparent font-semibold text-metal-800 dark:text-metal-50",
|
|
13
13
|
children: a
|
|
14
14
|
},
|
|
15
15
|
t
|
|
16
|
-
) : /* @__PURE__ */
|
|
16
|
+
) : /* @__PURE__ */ n("span", { children: a }, t));
|
|
17
17
|
}
|
|
18
18
|
const K = ({
|
|
19
19
|
isEmpty: c,
|
|
20
|
-
isClickable:
|
|
20
|
+
isClickable: r,
|
|
21
21
|
className: i,
|
|
22
22
|
inputRef: o,
|
|
23
23
|
listItemSecondRowClassName: a,
|
|
@@ -29,18 +29,18 @@ const K = ({
|
|
|
29
29
|
},
|
|
30
30
|
[p, x]
|
|
31
31
|
), w = u(
|
|
32
|
-
(e,
|
|
33
|
-
e.key === "Enter" && (e.stopPropagation(), f(
|
|
32
|
+
(e, s) => {
|
|
33
|
+
e.key === "Enter" && (e.stopPropagation(), f(s));
|
|
34
34
|
},
|
|
35
35
|
[f]
|
|
36
36
|
), N = u(
|
|
37
|
-
({ label: e, rightComponent:
|
|
37
|
+
({ label: e, rightComponent: s, subLabel: g, rightComponentClassName: C }) => {
|
|
38
38
|
if (c)
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ n(
|
|
40
40
|
y,
|
|
41
41
|
{
|
|
42
42
|
variant: "body2",
|
|
43
|
-
className: "text-zinc-800 dark:text-
|
|
43
|
+
className: "text-zinc-800 dark:text-metal-50 italic",
|
|
44
44
|
children: e
|
|
45
45
|
}
|
|
46
46
|
);
|
|
@@ -51,24 +51,24 @@ const K = ({
|
|
|
51
51
|
y,
|
|
52
52
|
{
|
|
53
53
|
variant: "body2",
|
|
54
|
-
className: "text-zinc-700 dark:text-
|
|
54
|
+
className: "text-zinc-700 dark:text-metal-50 font-medium",
|
|
55
55
|
children: [
|
|
56
|
-
|
|
56
|
+
s ? /* @__PURE__ */ d(
|
|
57
57
|
"span",
|
|
58
58
|
{
|
|
59
59
|
className: l("flex gap-2 items-center", C),
|
|
60
60
|
children: [
|
|
61
61
|
k,
|
|
62
62
|
" ",
|
|
63
|
-
|
|
63
|
+
s
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
66
|
) : k,
|
|
67
|
-
g ? /* @__PURE__ */
|
|
67
|
+
g ? /* @__PURE__ */ n(
|
|
68
68
|
"span",
|
|
69
69
|
{
|
|
70
70
|
className: l(
|
|
71
|
-
"block font-normal text-sm text-
|
|
71
|
+
"block font-normal text-sm text-metal-800 dark:text-metal-50",
|
|
72
72
|
a
|
|
73
73
|
),
|
|
74
74
|
children: g
|
|
@@ -89,18 +89,18 @@ const K = ({
|
|
|
89
89
|
className: l(L({ className: i })),
|
|
90
90
|
tabIndex: 0,
|
|
91
91
|
onClick: (e) => {
|
|
92
|
-
|
|
92
|
+
r && (f(t), e.stopPropagation());
|
|
93
93
|
},
|
|
94
94
|
onKeyDown: (e) => w(e, t),
|
|
95
95
|
children: [
|
|
96
|
-
t.leftIcon ? /* @__PURE__ */
|
|
96
|
+
t.leftIcon ? /* @__PURE__ */ n(
|
|
97
97
|
"span",
|
|
98
98
|
{
|
|
99
99
|
className: l(
|
|
100
100
|
"w-4 h-4 flex justify-center",
|
|
101
101
|
{
|
|
102
102
|
"items-center": !t.subLabel,
|
|
103
|
-
"items-baseline -
|
|
103
|
+
"items-baseline -tranmetal-y-2": !!t.subLabel
|
|
104
104
|
},
|
|
105
105
|
t.leftIconClassName
|
|
106
106
|
),
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as Z, useId as ee, useRef as C, useMemo as te, useImperativeHandle as ae, useEffect as re } from "react";
|
|
3
3
|
import { S as ne } from "../../../loader-juvMSJ9L.js";
|
|
4
|
-
import { Typography as
|
|
4
|
+
import { Typography as oe } from "../../Typography/Typography.js";
|
|
5
5
|
import { cn as o } from "../../../utils/index.js";
|
|
6
|
-
import { labelVariants as
|
|
6
|
+
import { labelVariants as le, inputVariants as se, dropdownVariants as ie } from "../Dropdown.variants.js";
|
|
7
7
|
import { useDropdown as ce } from "../hooks/useDropdown.js";
|
|
8
|
-
import { List as
|
|
9
|
-
import { c as
|
|
10
|
-
import { C as
|
|
8
|
+
import { List as me } from "./List/List.js";
|
|
9
|
+
import { c as pe } from "../../../createLucideIcon-D4r5Phnh.js";
|
|
10
|
+
import { C as ue } from "../../../chevron-up-DrQr2Fwd.js";
|
|
11
11
|
import { useDropdownContext as fe } from "../contexts/dropdown.hook.js";
|
|
12
12
|
const de = [
|
|
13
13
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
14
14
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
15
|
-
], xe =
|
|
15
|
+
], xe = pe("search", de), je = Z(
|
|
16
16
|
({
|
|
17
17
|
additionalOptions: b,
|
|
18
18
|
className: z,
|
|
@@ -41,49 +41,49 @@ const de = [
|
|
|
41
41
|
noOptionsText: U,
|
|
42
42
|
...y
|
|
43
43
|
}, q) => {
|
|
44
|
-
const I = ee(),
|
|
44
|
+
const I = ee(), s = C(null), L = C(null), A = C(0), {
|
|
45
45
|
isOpen: i,
|
|
46
46
|
searchTerm: B,
|
|
47
|
-
value:
|
|
47
|
+
value: l,
|
|
48
48
|
options: n,
|
|
49
49
|
setValue: c,
|
|
50
50
|
setSearchTerm: G,
|
|
51
51
|
setCanFilter: J,
|
|
52
52
|
toggleOpen: K
|
|
53
|
-
} = fe(), e = te(() => n.find(({ value: a }) => a ===
|
|
53
|
+
} = fe(), e = te(() => n.find(({ value: a }) => a === l), [n, l]), { wrapperRef: Q, wrapperInputRef: V, handleOpen: j } = ce({
|
|
54
54
|
ulRef: L,
|
|
55
|
-
inputRef:
|
|
55
|
+
inputRef: s,
|
|
56
56
|
disabled: t,
|
|
57
57
|
internalValue: e,
|
|
58
58
|
onBlur: H
|
|
59
|
-
}),
|
|
60
|
-
ae(q, () =>
|
|
61
|
-
if (x && !
|
|
62
|
-
const a = n && n.find((
|
|
59
|
+
}), m = d ? `${I}-${d}` : I;
|
|
60
|
+
ae(q, () => s.current, [s]), re(() => {
|
|
61
|
+
if (x && !l) {
|
|
62
|
+
const a = n && n.find((p) => p.value === x);
|
|
63
63
|
a && c(a.value);
|
|
64
64
|
}
|
|
65
|
-
}, [x, n, c,
|
|
65
|
+
}, [x, n, c, l]);
|
|
66
66
|
const X = (a) => {
|
|
67
|
-
const
|
|
68
|
-
J(!0), c(""), G(
|
|
67
|
+
const p = a.target.value;
|
|
68
|
+
J(!0), c(""), G(p ?? ""), P?.(p);
|
|
69
69
|
const O = n.find(
|
|
70
|
-
(Y) => Y.value.toLocaleLowerCase() ===
|
|
70
|
+
(Y) => Y.value.toLocaleLowerCase() === p.toLocaleLowerCase()
|
|
71
71
|
);
|
|
72
72
|
c(O ? O.value : e?.value ?? "");
|
|
73
73
|
};
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ u(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
77
|
ref: Q,
|
|
78
78
|
className: o("flex flex-col w-full relative", W),
|
|
79
79
|
"data-theme": M,
|
|
80
80
|
children: [
|
|
81
|
-
v ? /* @__PURE__ */
|
|
81
|
+
v ? /* @__PURE__ */ u(
|
|
82
82
|
"label",
|
|
83
83
|
{
|
|
84
|
-
id:
|
|
85
|
-
className: o(
|
|
86
|
-
htmlFor:
|
|
84
|
+
id: m,
|
|
85
|
+
className: o(le({ className: S })),
|
|
86
|
+
htmlFor: m,
|
|
87
87
|
onClick: () => !t && j(),
|
|
88
88
|
children: [
|
|
89
89
|
v,
|
|
@@ -91,11 +91,11 @@ const de = [
|
|
|
91
91
|
]
|
|
92
92
|
}
|
|
93
93
|
) : null,
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ u(
|
|
95
95
|
"div",
|
|
96
96
|
{
|
|
97
97
|
ref: V,
|
|
98
|
-
id:
|
|
98
|
+
id: m,
|
|
99
99
|
className: o(
|
|
100
100
|
ie({ className: z, hasError: !!f, disabled: t })
|
|
101
101
|
),
|
|
@@ -103,26 +103,40 @@ const de = [
|
|
|
103
103
|
onClick: () => !t && K(!i),
|
|
104
104
|
"aria-expanded": i,
|
|
105
105
|
tabIndex: A.current,
|
|
106
|
-
"aria-labelledby":
|
|
106
|
+
"aria-labelledby": m,
|
|
107
107
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
e?.leftIcon && !N && /* @__PURE__ */ r("span", { className: "w-4 h-4 flex justify-center items-center dark:text-
|
|
110
|
-
N && /* @__PURE__ */ r(
|
|
108
|
+
/* @__PURE__ */ u("div", { className: "flex gap-2.5 items-center flex-1", children: [
|
|
109
|
+
e?.leftIcon && !N && /* @__PURE__ */ r("span", { className: "w-4 h-4 flex justify-center items-center dark:text-metal-50", children: e.leftIcon }),
|
|
110
|
+
N && /* @__PURE__ */ r(
|
|
111
|
+
xe,
|
|
112
|
+
{
|
|
113
|
+
className: o(
|
|
114
|
+
"w-4",
|
|
115
|
+
"h-4",
|
|
116
|
+
"text-zinc-500",
|
|
117
|
+
"select-none",
|
|
118
|
+
"transition-colors",
|
|
119
|
+
"duration-300",
|
|
120
|
+
"dark:text-metal-300",
|
|
121
|
+
"dark:group-focus-within:text-metal-50"
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
),
|
|
111
125
|
k ? /* @__PURE__ */ r(
|
|
112
126
|
"input",
|
|
113
127
|
{
|
|
114
128
|
type: "text",
|
|
115
|
-
value: i ? B : e?.label ??
|
|
129
|
+
value: i ? B : e?.label ?? l ?? "",
|
|
116
130
|
onChange: X,
|
|
117
131
|
placeholder: w,
|
|
118
|
-
className: o(
|
|
132
|
+
className: o(se({ className: F }), {
|
|
119
133
|
"text-red-700 placeholder:text-red-700": !!f
|
|
120
134
|
}),
|
|
121
135
|
onClick: (a) => {
|
|
122
136
|
a.stopPropagation(), t || j();
|
|
123
137
|
},
|
|
124
138
|
"aria-label": v || w,
|
|
125
|
-
"aria-labelledby":
|
|
139
|
+
"aria-labelledby": m,
|
|
126
140
|
required: h,
|
|
127
141
|
autoComplete: "off",
|
|
128
142
|
autoCapitalize: "words",
|
|
@@ -130,17 +144,17 @@ const de = [
|
|
|
130
144
|
tabIndex: -1,
|
|
131
145
|
...y
|
|
132
146
|
}
|
|
133
|
-
) : /* @__PURE__ */
|
|
134
|
-
|
|
147
|
+
) : /* @__PURE__ */ u(
|
|
148
|
+
oe,
|
|
135
149
|
{
|
|
136
150
|
variant: "body2",
|
|
137
151
|
className: o(
|
|
138
|
-
"flex-1 text-zinc-400 text-sm dark:text-
|
|
152
|
+
"flex-1 text-zinc-400 text-sm dark:text-metal-400 flex gap-2 items-center",
|
|
139
153
|
{
|
|
140
154
|
"text-red-700": !!f,
|
|
141
155
|
"select-none": !e,
|
|
142
|
-
"text-
|
|
143
|
-
"text-
|
|
156
|
+
"text-metal-800 dark:text-metal-50": e,
|
|
157
|
+
"text-metal-400/50 dark:text-metal-50/50": t
|
|
144
158
|
},
|
|
145
159
|
e?.wrapperClassNameOnSelectedValue
|
|
146
160
|
),
|
|
@@ -152,16 +166,16 @@ const de = [
|
|
|
152
166
|
}
|
|
153
167
|
)
|
|
154
168
|
] }),
|
|
155
|
-
g ? /* @__PURE__ */ r(ne, { className: "w-4 h-4 text-
|
|
156
|
-
|
|
169
|
+
g ? /* @__PURE__ */ r(ne, { className: "w-4 h-4 text-metal-400 animate-spin select-none" }) : !N && /* @__PURE__ */ r(
|
|
170
|
+
ue,
|
|
157
171
|
{
|
|
158
172
|
"data-state": i ? "open" : "closed",
|
|
159
173
|
className: o(
|
|
160
|
-
"w-4 h-4 text-zinc-500 transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 select-none dark:group-focus-within:text-
|
|
174
|
+
"w-4 h-4 text-zinc-500 transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 select-none dark:group-focus-within:text-metal-50",
|
|
161
175
|
R,
|
|
162
176
|
{
|
|
163
177
|
"text-red-700": !!f,
|
|
164
|
-
"text-
|
|
178
|
+
"text-metal-400/50 dark:group-focus-within:text-zinc-500": t
|
|
165
179
|
}
|
|
166
180
|
)
|
|
167
181
|
}
|
|
@@ -172,19 +186,19 @@ const de = [
|
|
|
172
186
|
/* @__PURE__ */ r(
|
|
173
187
|
"input",
|
|
174
188
|
{
|
|
175
|
-
ref:
|
|
189
|
+
ref: s,
|
|
176
190
|
type: "text",
|
|
177
191
|
name: d,
|
|
178
192
|
className: "hidden",
|
|
179
193
|
"aria-hidden": "true",
|
|
180
194
|
required: h,
|
|
181
195
|
inert: !0,
|
|
182
|
-
defaultValue: e?.value ??
|
|
196
|
+
defaultValue: e?.value ?? l ?? void 0,
|
|
183
197
|
...y
|
|
184
198
|
}
|
|
185
199
|
),
|
|
186
200
|
i && /* @__PURE__ */ r(
|
|
187
|
-
|
|
201
|
+
me,
|
|
188
202
|
{
|
|
189
203
|
ref: L,
|
|
190
204
|
additionalOptions: b,
|
|
@@ -192,7 +206,7 @@ const de = [
|
|
|
192
206
|
itemClassName: D,
|
|
193
207
|
name: d,
|
|
194
208
|
wrapperInputRef: V,
|
|
195
|
-
inputRef:
|
|
209
|
+
inputRef: s,
|
|
196
210
|
options: n,
|
|
197
211
|
isLoading: !!g,
|
|
198
212
|
searchable: k,
|
|
@@ -2,7 +2,7 @@ import { jsxs as h, jsx as p } from "react/jsx-runtime";
|
|
|
2
2
|
import v, { forwardRef as x, useState as C, useRef as w, useCallback as b, useEffect as E } from "react";
|
|
3
3
|
import { cn as l } from "../../utils/index.js";
|
|
4
4
|
import { Button as P } from "../Button/Button.js";
|
|
5
|
-
import { P as c } from "../../index
|
|
5
|
+
import { P as c } from "../../index-BOE_3f_Z.js";
|
|
6
6
|
function m() {
|
|
7
7
|
return m = Object.assign || function(e) {
|
|
8
8
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { c as t } from "../../index-D29mdTf5.js";
|
|
2
|
-
const a = t(["flex", "gap-8", "items-center"]),
|
|
2
|
+
const a = t(["flex", "gap-8", "items-center"]), r = t([
|
|
3
3
|
"flex",
|
|
4
4
|
"items-center",
|
|
5
5
|
"gap-1",
|
|
6
6
|
"text-slate-500",
|
|
7
7
|
"cursor-pointer",
|
|
8
8
|
"text-sm",
|
|
9
|
-
"w-max"
|
|
10
|
-
|
|
9
|
+
"w-max",
|
|
10
|
+
"dark:text-metal-300"
|
|
11
|
+
]), n = t([
|
|
11
12
|
"text-slate-400",
|
|
12
13
|
"h-5",
|
|
13
14
|
"w-5",
|
|
@@ -16,7 +17,7 @@ const a = t(["flex", "gap-8", "items-center"]), n = t([
|
|
|
16
17
|
"ease-in-out"
|
|
17
18
|
]);
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
n as filterButtonIconVariants,
|
|
21
|
+
r as filterButtonVariants,
|
|
21
22
|
a as filterVariants
|
|
22
23
|
};
|