@konstructio/ui 0.1.2-alpha.3 → 0.1.2-alpha.31
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/DatePicker.css +1 -1
- package/dist/Modal-5xSxFoaD.js +99 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +30 -33
- package/dist/components/Badge/Badge.variants.js +8 -6
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +1 -1
- package/dist/components/Card/Card.variants.js +5 -9
- package/dist/components/Checkbox/Checkbox.js +6 -6
- 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 +1209 -1147
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +46 -28
- package/dist/components/Dropdown/Dropdown.variants.js +32 -9
- package/dist/components/Dropdown/components/List/List.js +133 -54
- package/dist/components/Dropdown/components/List/List.variants.js +9 -7
- package/dist/components/Dropdown/components/ListItem/ListItem.js +74 -24
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
- package/dist/components/Dropdown/components/Wrapper.js +144 -109
- package/dist/components/Dropdown/constants/index.js +4 -0
- package/dist/components/Dropdown/constants/pagination.js +4 -0
- package/dist/components/Dropdown/contexts/dropdown.context.js +26 -8
- package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -19
- package/dist/components/Dropdown/hooks/useDropdown.js +83 -39
- package/dist/components/Dropdown/hooks/useNavigationList.js +28 -36
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.variants.js +2 -2
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.variants.js +1 -1
- package/dist/components/Loading/Loading.js +1 -7
- package/dist/components/Modal/Modal.js +2 -2
- 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/NumberInput/NumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +45 -0
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +27 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +36 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -0
- package/dist/components/PhoneNumberInput/components/index.js +6 -0
- package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6139 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/PieChart/PieChart.js +647 -664
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +8 -8
- package/dist/components/Switch/Switch.variants.js +4 -4
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +45 -24
- 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 +9 -8
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
- package/dist/components/TimePicker/TimePicker.variants.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Toast/Toast.js +206 -181
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.variants.js +18 -23
- package/dist/components/VirtualizedTable/VirtualizedTable.js +119 -0
- package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
- package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
- package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
- package/dist/components/VirtualizedTable/assets/index.js +6 -0
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
- package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +88 -0
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
- package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +16 -0
- package/dist/components/VirtualizedTable/constants/index.js +5 -0
- package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
- package/dist/components/VirtualizedTable/contexts/index.js +8 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
- package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
- package/dist/components/index.js +79 -73
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/debounce-BFejQm9P.js +200 -0
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
- package/dist/index-2hB40Iuc.js +1873 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
- package/dist/index-BtQfgaSF.js +60 -0
- package/dist/index-C3tHPg8y.js +662 -0
- package/dist/index-CIAmiWcw.js +200 -0
- package/dist/index-CSFe9uC5.js +14 -0
- package/dist/index-CSWGJT-v.js +1722 -0
- package/dist/index-CigKKiZS.js +91 -0
- package/dist/index-DDByhzds.js +137 -0
- package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/index-Dbt2vBmS.js +136 -0
- package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
- package/dist/index-DrWQH0QF.js +55 -0
- package/dist/{index-D3xzCzcO.js → index-X4k_cU8k.js} +4 -4
- package/dist/index-kyuBfLcN.js +479 -0
- package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
- package/dist/index-ohdbKsws.js +27 -0
- package/dist/index.d.ts +184 -18
- package/dist/index.js +106 -98
- package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
- package/dist/package.json +46 -32
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +191 -167
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
- package/package.json +46 -32
- package/dist/Modal-V67Uz78z.js +0 -98
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chevron-down-BLZPftpV.js +0 -11
- package/dist/chevron-up-RLP4nX7V.js +0 -54
- package/dist/index-BXuxPoz7.js +0 -435
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-C9T9HQaa.js +0 -423
- package/dist/index-CZnD2QxM.js +0 -32
- package/dist/index-CrBonFvu.js +0 -144
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-Oq5GlCHP.js +0 -131
- package/dist/index-iXyXtdgP.js +0 -31
|
@@ -1,30 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { jsx as s, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h } from "react";
|
|
3
|
+
import { cn as o } from "../../utils/index.js";
|
|
4
|
+
import { DropdownProvider as v } from "./contexts/dropdown.provider.js";
|
|
5
|
+
import { Wrapper as N } from "./components/Wrapper.js";
|
|
6
|
+
const W = h(
|
|
7
|
+
({
|
|
8
|
+
error: t,
|
|
9
|
+
errorClassName: i,
|
|
10
|
+
helperText: r,
|
|
11
|
+
helperTextClassName: m,
|
|
12
|
+
highlightSearch: a,
|
|
13
|
+
mainWrapperClassName: p,
|
|
14
|
+
name: l,
|
|
15
|
+
value: d,
|
|
16
|
+
options: n,
|
|
17
|
+
onChange: c,
|
|
18
|
+
onBlur: e,
|
|
19
|
+
...f
|
|
20
|
+
}, x) => /* @__PURE__ */ s(
|
|
21
|
+
v,
|
|
22
|
+
{
|
|
23
|
+
highlightSearch: a,
|
|
24
|
+
name: l,
|
|
25
|
+
value: d,
|
|
26
|
+
options: n,
|
|
27
|
+
onBlur: e,
|
|
28
|
+
onChange: c,
|
|
29
|
+
children: /* @__PURE__ */ w("div", { className: o("relative w-full", p), children: [
|
|
30
|
+
/* @__PURE__ */ s(
|
|
31
|
+
N,
|
|
32
|
+
{
|
|
33
|
+
error: t,
|
|
34
|
+
name: l,
|
|
35
|
+
ref: x,
|
|
36
|
+
onBlur: e,
|
|
37
|
+
...f
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
t ? /* @__PURE__ */ s("span", { className: o("text-xs text-red-700", i), children: t }) : null,
|
|
41
|
+
!t && r ? /* @__PURE__ */ s("span", { className: o("text-xs text-slate-600", m), children: r }) : null
|
|
42
|
+
] })
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
);
|
|
28
46
|
export {
|
|
29
|
-
|
|
47
|
+
W as Dropdown
|
|
30
48
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
const a =
|
|
1
|
+
import { c as e } from "../../index-D29mdTf5.js";
|
|
2
|
+
const a = e(
|
|
3
3
|
[
|
|
4
|
+
"group",
|
|
4
5
|
"border",
|
|
5
6
|
"cursor-pointer",
|
|
6
7
|
"ease-in-out",
|
|
@@ -20,7 +21,9 @@ const a = r(
|
|
|
20
21
|
"aria-expanded:border-aurora-500",
|
|
21
22
|
"aria-expanded:text-aurora-500",
|
|
22
23
|
"kubefirst:aria-expanded:border-kubefirst-primary",
|
|
23
|
-
"kubefirst:aria-expanded:text-kubefirst-secondary"
|
|
24
|
+
"kubefirst:aria-expanded:text-kubefirst-secondary",
|
|
25
|
+
"dark:border-slate-600",
|
|
26
|
+
"dark:focus-visible:bg-slate-800"
|
|
24
27
|
],
|
|
25
28
|
{
|
|
26
29
|
variants: {
|
|
@@ -32,20 +35,40 @@ const a = r(
|
|
|
32
35
|
"kubefirst:text-red-600"
|
|
33
36
|
],
|
|
34
37
|
false: ""
|
|
38
|
+
},
|
|
39
|
+
disabled: {
|
|
40
|
+
true: ["cursor-default", "bg-gray-100", "dark:bg-slate-700/80"],
|
|
41
|
+
false: []
|
|
35
42
|
}
|
|
36
43
|
},
|
|
37
44
|
defaultVariants: {
|
|
38
|
-
hasError: !1
|
|
45
|
+
hasError: !1,
|
|
46
|
+
disabled: !1
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
|
-
), t =
|
|
49
|
+
), t = e([
|
|
50
|
+
"flex-1",
|
|
51
|
+
"bg-transparent",
|
|
52
|
+
"border-none",
|
|
53
|
+
"outline-none",
|
|
54
|
+
"text-zinc-700",
|
|
55
|
+
"text-sm",
|
|
56
|
+
"capitalize",
|
|
57
|
+
"placeholder:text-sm",
|
|
58
|
+
"placeholder:normal-case",
|
|
59
|
+
"placeholder:select-none",
|
|
60
|
+
"dark:placeholder:text-slate-400",
|
|
61
|
+
"dark:text-slate-50"
|
|
62
|
+
]), d = e([
|
|
42
63
|
"mb-1",
|
|
43
64
|
"cursor-pointer",
|
|
44
|
-
"text-
|
|
45
|
-
"leading-
|
|
46
|
-
"tracking-[0.1px]"
|
|
65
|
+
"text-sm",
|
|
66
|
+
"leading-5",
|
|
67
|
+
"tracking-[0.1px]",
|
|
68
|
+
"dark:text-slate-50"
|
|
47
69
|
]);
|
|
48
70
|
export {
|
|
49
71
|
a as dropdownVariants,
|
|
50
|
-
t as
|
|
72
|
+
t as inputVariants,
|
|
73
|
+
d as labelVariants
|
|
51
74
|
};
|
|
@@ -1,64 +1,143 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { jsxs as H, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { S as V } from "../../../../index-BtQfgaSF.js";
|
|
3
|
+
import { d as Z } from "../../../../debounce-BFejQm9P.js";
|
|
4
|
+
import { forwardRef as B, useRef as k, useState as G, useImperativeHandle as J, useMemo as K, useEffect as M } from "react";
|
|
5
|
+
import { Loading as Q } from "../../../Loading/Loading.js";
|
|
6
|
+
import { cn as a } from "../../../../utils/index.js";
|
|
7
|
+
import { useNavigationUlList as R } from "../../hooks/useNavigationList.js";
|
|
8
|
+
import { ListItem as b } from "../ListItem/ListItem.js";
|
|
9
|
+
import { listVariants as W } from "./List.variants.js";
|
|
10
|
+
import { DEFAULT_LIST_SIZE as X } from "../../constants/pagination.js";
|
|
11
|
+
import { useDropdownContext as Y } from "../../contexts/dropdown.hook.js";
|
|
12
|
+
const ue = B(
|
|
9
13
|
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
additionalOptions: C,
|
|
15
|
+
className: F,
|
|
16
|
+
inputRef: i,
|
|
17
|
+
isLoading: N,
|
|
18
|
+
itemClassName: l,
|
|
19
|
+
name: I,
|
|
20
|
+
searchable: L = !1,
|
|
21
|
+
listItemSecondRowClassName: c,
|
|
22
|
+
wrapperInputRef: O,
|
|
23
|
+
isInfiniteScrollEnabled: u,
|
|
24
|
+
onFetchMoreOptions: f
|
|
25
|
+
}, T) => {
|
|
26
|
+
const s = k(null), m = k(null), [p, x] = G(!1), {
|
|
27
|
+
isOpen: j,
|
|
28
|
+
searchTerm: g,
|
|
29
|
+
canFilter: E,
|
|
30
|
+
canContinueFetching: n,
|
|
31
|
+
page: d,
|
|
32
|
+
options: y,
|
|
33
|
+
isTyping: w,
|
|
34
|
+
setOptions: P,
|
|
35
|
+
setPage: S,
|
|
36
|
+
setCanContinueFetching: D
|
|
37
|
+
} = Y();
|
|
38
|
+
J(T, () => s.current, [s]);
|
|
39
|
+
const h = L && E ? y.filter((e) => {
|
|
40
|
+
const t = g.toLowerCase();
|
|
41
|
+
return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(t);
|
|
42
|
+
}) : y;
|
|
43
|
+
R({
|
|
44
|
+
ulRef: s,
|
|
45
|
+
wrapperInputRef: O,
|
|
46
|
+
searchable: L,
|
|
47
|
+
filteredOptions: h
|
|
48
|
+
});
|
|
49
|
+
const U = h.filter(
|
|
50
|
+
(e, t, r) => t === r.findIndex((v) => v.value === e.value)
|
|
51
|
+
), _ = h.length === 0, q = K(
|
|
52
|
+
() => Z(async (e) => {
|
|
53
|
+
const [t] = e;
|
|
54
|
+
if (t.isIntersecting && !p && f && n)
|
|
55
|
+
try {
|
|
56
|
+
x(!0);
|
|
57
|
+
const r = d + 1, { data: v, hasMore: z } = await f({
|
|
58
|
+
page: r,
|
|
59
|
+
pageSize: X,
|
|
60
|
+
termOfSearch: g
|
|
61
|
+
});
|
|
62
|
+
S(r), D(z), P((A) => [...A, ...v]);
|
|
63
|
+
} catch {
|
|
64
|
+
console.error("Error fetching more options");
|
|
65
|
+
} finally {
|
|
66
|
+
x(!1);
|
|
67
|
+
}
|
|
68
|
+
}, 100),
|
|
69
|
+
[p, f, g, d]
|
|
70
|
+
);
|
|
71
|
+
return M(() => {
|
|
72
|
+
if (u && n && m.current && !w) {
|
|
73
|
+
const e = new IntersectionObserver(q, {
|
|
74
|
+
threshold: 0.1
|
|
75
|
+
});
|
|
76
|
+
return e.observe(m.current), () => e.disconnect();
|
|
77
|
+
}
|
|
78
|
+
}, [
|
|
79
|
+
u,
|
|
80
|
+
n,
|
|
81
|
+
p,
|
|
82
|
+
w,
|
|
83
|
+
d
|
|
84
|
+
]), /* @__PURE__ */ H(
|
|
26
85
|
"ul",
|
|
27
86
|
{
|
|
28
|
-
ref:
|
|
29
|
-
title:
|
|
87
|
+
ref: s,
|
|
88
|
+
title: I,
|
|
30
89
|
role: "listbox",
|
|
31
|
-
className:
|
|
32
|
-
"data-state":
|
|
33
|
-
children:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
90
|
+
className: a(W({ className: F })),
|
|
91
|
+
"data-state": j ? "open" : "closed",
|
|
92
|
+
children: [
|
|
93
|
+
N ? /* @__PURE__ */ o(
|
|
94
|
+
b,
|
|
95
|
+
{
|
|
96
|
+
className: a("select-none", l),
|
|
97
|
+
isClickable: !1,
|
|
98
|
+
inputRef: i,
|
|
99
|
+
value: "Loading...",
|
|
100
|
+
label: "Loading...",
|
|
101
|
+
listItemSecondRowClassName: c
|
|
102
|
+
}
|
|
103
|
+
) : _ ? /* @__PURE__ */ o(
|
|
104
|
+
b,
|
|
105
|
+
{
|
|
106
|
+
className: a("select-none", l),
|
|
107
|
+
isClickable: !1,
|
|
108
|
+
inputRef: i,
|
|
109
|
+
value: "No options",
|
|
110
|
+
label: "No options",
|
|
111
|
+
listItemSecondRowClassName: c
|
|
112
|
+
}
|
|
113
|
+
) : U.map((e) => /* @__PURE__ */ o(
|
|
114
|
+
b,
|
|
115
|
+
{
|
|
116
|
+
className: a("select-none", l),
|
|
117
|
+
isClickable: !0,
|
|
118
|
+
inputRef: i,
|
|
119
|
+
listItemSecondRowClassName: c,
|
|
120
|
+
...e
|
|
121
|
+
},
|
|
122
|
+
e.value
|
|
123
|
+
)),
|
|
124
|
+
u && n && /* @__PURE__ */ o(
|
|
125
|
+
"li",
|
|
126
|
+
{
|
|
127
|
+
ref: m,
|
|
128
|
+
role: "option",
|
|
129
|
+
"data-action": "true",
|
|
130
|
+
className: "flex items-center justify-center py-3",
|
|
131
|
+
onClick: (e) => e.stopPropagation(),
|
|
132
|
+
children: /* @__PURE__ */ o(Q, { className: "w-4 h-4 text-aurora-500 select-none" })
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
C?.map((e, t) => /* @__PURE__ */ o("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ o(V, { className: "flex p-2 w-full h-full gap-1 items-center text-sm [&>svg]:w-3.5 [&>svg]:h-3.5 [&>svg]:shrink-0 cursor-pointer select-none hover:bg-gray-50 hover:dark:bg-slate-700 focus:outline-0", children: e }) }, t))
|
|
136
|
+
]
|
|
58
137
|
}
|
|
59
138
|
);
|
|
60
139
|
}
|
|
61
140
|
);
|
|
62
141
|
export {
|
|
63
|
-
|
|
142
|
+
ue as List
|
|
64
143
|
};
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { c as o } from "../../../../index-D29mdTf5.js";
|
|
2
|
-
const
|
|
2
|
+
const t = o([
|
|
3
3
|
"absolute",
|
|
4
4
|
"bg-white",
|
|
5
5
|
"border",
|
|
6
|
-
"duration-100",
|
|
7
|
-
"ease-in-out",
|
|
8
6
|
"flex-col",
|
|
9
7
|
"mt-1",
|
|
10
8
|
"overflow-hidden",
|
|
11
9
|
"rounded-md",
|
|
12
10
|
"shadow-2xs",
|
|
13
11
|
"top-full",
|
|
14
|
-
"transition-all",
|
|
15
12
|
"w-full",
|
|
16
13
|
"z-10",
|
|
17
14
|
"max-h-[185px]",
|
|
18
15
|
"overflow-y-auto",
|
|
19
16
|
"border-gray-200",
|
|
20
17
|
"text-zinc-700",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
18
|
+
"animate-in",
|
|
19
|
+
"fade-in-50",
|
|
20
|
+
"zoom-in-95",
|
|
21
|
+
"duration-[200ms]",
|
|
22
|
+
"dark:bg-slate-800",
|
|
23
|
+
"dark:border-slate-700",
|
|
24
|
+
"dark:text-slate-50"
|
|
23
25
|
]);
|
|
24
26
|
export {
|
|
25
|
-
|
|
27
|
+
t as listVariants
|
|
26
28
|
};
|
|
@@ -1,43 +1,93 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Typography as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { listItemVariants as
|
|
6
|
-
import { useDropdownContext as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as g, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as y, useCallback as m } from "react";
|
|
3
|
+
import { Typography as w } from "../../../Typography/Typography.js";
|
|
4
|
+
import { cn as f } from "../../../../utils/index.js";
|
|
5
|
+
import { listItemVariants as C } from "./ListItem.variants.js";
|
|
6
|
+
import { useDropdownContext as L } from "../../contexts/dropdown.hook.js";
|
|
7
|
+
function I(r, n) {
|
|
8
|
+
const o = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), c = new RegExp(`(${o})`, "gi");
|
|
9
|
+
return r.split(c).map((t, a) => t.toLowerCase() === n.toLowerCase() ? /* @__PURE__ */ l(
|
|
10
|
+
"mark",
|
|
11
|
+
{
|
|
12
|
+
className: "bg-transparent font-semibold text-slate-800 dark:text-slate-50",
|
|
13
|
+
children: t
|
|
14
|
+
},
|
|
15
|
+
a
|
|
16
|
+
) : /* @__PURE__ */ l("span", { children: t }, a));
|
|
17
|
+
}
|
|
18
|
+
const $ = ({
|
|
19
|
+
isClickable: r,
|
|
20
|
+
className: n,
|
|
21
|
+
inputRef: o,
|
|
22
|
+
listItemSecondRowClassName: c,
|
|
10
23
|
...t
|
|
11
24
|
}) => {
|
|
12
|
-
const { setValue:
|
|
25
|
+
const { searchTerm: a, highlightSearchEnabled: d, setValue: h, toggleOpen: u } = L(), p = y(null), i = m(
|
|
13
26
|
(e) => {
|
|
14
|
-
|
|
27
|
+
h(e.value, o), u(!1);
|
|
28
|
+
},
|
|
29
|
+
[h, u]
|
|
30
|
+
), x = m(
|
|
31
|
+
(e, s) => {
|
|
32
|
+
e.key === "Enter" && (e.stopPropagation(), i(s));
|
|
15
33
|
},
|
|
16
|
-
[
|
|
17
|
-
),
|
|
18
|
-
(e,
|
|
19
|
-
e
|
|
34
|
+
[i]
|
|
35
|
+
), b = m(
|
|
36
|
+
(e, s) => {
|
|
37
|
+
if (typeof e != "string")
|
|
38
|
+
return e;
|
|
39
|
+
const k = d && a.length > 0 ? I(e, a) : [e];
|
|
40
|
+
return /* @__PURE__ */ g(
|
|
41
|
+
w,
|
|
42
|
+
{
|
|
43
|
+
variant: "body2",
|
|
44
|
+
className: "text-zinc-700 dark:text-slate-50 font-medium",
|
|
45
|
+
children: [
|
|
46
|
+
k,
|
|
47
|
+
s ? /* @__PURE__ */ l(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
className: f(
|
|
51
|
+
"block font-normal text-sm text-slate-800 dark:text-slate-50",
|
|
52
|
+
c
|
|
53
|
+
),
|
|
54
|
+
children: s
|
|
55
|
+
}
|
|
56
|
+
) : null
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
20
60
|
},
|
|
21
|
-
[
|
|
61
|
+
[d, a]
|
|
22
62
|
);
|
|
23
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ g(
|
|
24
64
|
"li",
|
|
25
65
|
{
|
|
26
|
-
ref:
|
|
66
|
+
ref: p,
|
|
27
67
|
role: "option",
|
|
28
|
-
|
|
68
|
+
"data-action": "false",
|
|
69
|
+
className: f(C({ className: n })),
|
|
29
70
|
tabIndex: 0,
|
|
30
71
|
onClick: (e) => {
|
|
31
|
-
|
|
72
|
+
r && (i(t), e.stopPropagation());
|
|
32
73
|
},
|
|
33
|
-
onKeyDown: (e) =>
|
|
74
|
+
onKeyDown: (e) => x(e, t),
|
|
34
75
|
children: [
|
|
35
|
-
t.leftIcon ? /* @__PURE__ */
|
|
36
|
-
|
|
76
|
+
t.leftIcon ? /* @__PURE__ */ l(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
className: f("w-4 h-4 flex justify-center", {
|
|
80
|
+
"items-center": !t.subLabel,
|
|
81
|
+
"items-baseline -translate-y-2": !!t.subLabel
|
|
82
|
+
}),
|
|
83
|
+
children: t.leftIcon
|
|
84
|
+
}
|
|
85
|
+
) : null,
|
|
86
|
+
b(t.label, t.subLabel)
|
|
37
87
|
]
|
|
38
88
|
}
|
|
39
89
|
);
|
|
40
90
|
};
|
|
41
91
|
export {
|
|
42
|
-
|
|
92
|
+
$ as ListItem
|
|
43
93
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
const
|
|
1
|
+
import { c as r } from "../../../../index-D29mdTf5.js";
|
|
2
|
+
const t = r([
|
|
3
3
|
"cursor-pointer",
|
|
4
4
|
"py-2",
|
|
5
5
|
"px-2",
|
|
@@ -10,11 +10,13 @@ const i = o([
|
|
|
10
10
|
"flex",
|
|
11
11
|
"items-center",
|
|
12
12
|
"gap-3",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
13
|
+
"transition-bg",
|
|
14
|
+
"duration-250",
|
|
15
|
+
"hover:bg-gray-50",
|
|
16
|
+
"focus:bg-gray-50",
|
|
17
|
+
"dark:hover:bg-slate-700",
|
|
18
|
+
"dark:focus:bg-slate-700"
|
|
17
19
|
]);
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
t as listItemVariants
|
|
20
22
|
};
|