@konstructio/ui 0.1.2-alpha.3 → 0.1.2-alpha.4
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/components/Dropdown/Dropdown.js +36 -24
- package/dist/components/Dropdown/Dropdown.variants.js +25 -7
- package/dist/components/Dropdown/components/List/List.js +56 -44
- package/dist/components/Dropdown/components/List/List.variants.js +9 -7
- package/dist/components/Dropdown/components/ListItem/ListItem.js +47 -24
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
- package/dist/components/Dropdown/components/Wrapper.js +141 -106
- package/dist/components/Dropdown/contexts/dropdown.context.js +9 -8
- package/dist/components/Dropdown/contexts/dropdown.provider.js +20 -19
- package/dist/components/Dropdown/hooks/useDropdown.js +26 -27
- package/dist/components/Dropdown/hooks/useNavigationList.js +33 -29
- package/dist/components/Tabs/Tabs.variants.js +45 -24
- package/dist/components/Tabs/components/Trigger.js +8 -7
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
- package/dist/index.d.ts +6 -2
- package/dist/package.json +13 -13
- package/dist/styles.css +1 -1
- package/package.json +13 -13
- package/dist/chevron-up-RLP4nX7V.js +0 -54
|
@@ -1,30 +1,42 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { DropdownProvider as
|
|
4
|
-
import { Wrapper as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
{
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { DropdownProvider as c } from "./contexts/dropdown.provider.js";
|
|
4
|
+
import { Wrapper as x } from "./components/Wrapper.js";
|
|
5
|
+
const N = n(
|
|
6
|
+
({
|
|
8
7
|
onChange: r,
|
|
9
8
|
onBlur: l,
|
|
10
9
|
value: a,
|
|
10
|
+
error: s,
|
|
11
|
+
helperText: e,
|
|
11
12
|
name: o,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
highlightSearch: i,
|
|
14
|
+
...d
|
|
15
|
+
}, m) => /* @__PURE__ */ t(
|
|
16
|
+
c,
|
|
17
|
+
{
|
|
18
|
+
highlightSearch: i,
|
|
19
|
+
name: o,
|
|
20
|
+
value: a,
|
|
21
|
+
onBlur: l,
|
|
22
|
+
onChange: r,
|
|
23
|
+
children: /* @__PURE__ */ p("div", { className: "relative w-full", children: [
|
|
24
|
+
/* @__PURE__ */ t(
|
|
25
|
+
x,
|
|
26
|
+
{
|
|
27
|
+
name: o,
|
|
28
|
+
error: s,
|
|
29
|
+
ref: m,
|
|
30
|
+
onBlur: l,
|
|
31
|
+
...d
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
s ? /* @__PURE__ */ t("span", { className: "text-xs text-red-700", children: s }) : null,
|
|
35
|
+
!s && e ? /* @__PURE__ */ t("span", { className: "text-xs text-slate-600", children: e }) : null
|
|
36
|
+
] })
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
);
|
|
28
40
|
export {
|
|
29
|
-
|
|
41
|
+
N as Dropdown
|
|
30
42
|
};
|
|
@@ -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: {
|
|
@@ -38,14 +41,29 @@ const a = r(
|
|
|
38
41
|
hasError: !1
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
|
-
), t =
|
|
44
|
+
), t = e([
|
|
45
|
+
"flex-1",
|
|
46
|
+
"bg-transparent",
|
|
47
|
+
"border-none",
|
|
48
|
+
"outline-none",
|
|
49
|
+
"text-zinc-700",
|
|
50
|
+
"text-sm",
|
|
51
|
+
"capitalize",
|
|
52
|
+
"placeholder:text-sm",
|
|
53
|
+
"placeholder:normal-case",
|
|
54
|
+
"placeholder:select-none",
|
|
55
|
+
"dark:placeholder:text-slate-400",
|
|
56
|
+
"dark:text-slate-50"
|
|
57
|
+
]), n = e([
|
|
42
58
|
"mb-1",
|
|
43
59
|
"cursor-pointer",
|
|
44
|
-
"text-
|
|
60
|
+
"text-sm",
|
|
45
61
|
"leading-[20px]",
|
|
46
|
-
"tracking-[0.1px]"
|
|
62
|
+
"tracking-[0.1px]",
|
|
63
|
+
"dark:text-slate-50"
|
|
47
64
|
]);
|
|
48
65
|
export {
|
|
49
66
|
a as dropdownVariants,
|
|
50
|
-
t as
|
|
67
|
+
t as inputVariants,
|
|
68
|
+
n as labelVariants
|
|
51
69
|
};
|
|
@@ -1,64 +1,76 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useNavigationUlList as
|
|
5
|
-
import { ListItem as
|
|
6
|
-
import { listVariants as
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { jsx as l, jsxs as x, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as k, useRef as C, useImperativeHandle as y } from "react";
|
|
3
|
+
import { cn as o } from "../../../../utils/index.js";
|
|
4
|
+
import { useNavigationUlList as R } from "../../hooks/useNavigationList.js";
|
|
5
|
+
import { ListItem as a } from "../ListItem/ListItem.js";
|
|
6
|
+
import { listVariants as j } from "./List.variants.js";
|
|
7
|
+
import { S as I } from "../../../../index-DQH6odE9.js";
|
|
8
|
+
import { useDropdownContext as O } from "../../contexts/dropdown.hook.js";
|
|
9
|
+
const z = k(
|
|
9
10
|
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
additionalOptions: m,
|
|
12
|
+
className: f,
|
|
13
|
+
inputRef: p,
|
|
14
|
+
isLoading: u,
|
|
15
|
+
itemClassName: s,
|
|
16
|
+
name: d,
|
|
17
|
+
options: n,
|
|
18
|
+
searchable: i = !1,
|
|
19
|
+
wrapperInputRef: g,
|
|
20
|
+
wrapperRef: b
|
|
21
|
+
}, h) => {
|
|
22
|
+
const t = C(null), { isOpen: v, searchTerm: L } = O();
|
|
23
|
+
y(h, () => t.current, [t]), R({
|
|
24
|
+
ulRef: t,
|
|
25
|
+
wrapperRef: b,
|
|
26
|
+
wrapperInputRef: g,
|
|
27
|
+
inputRef: p,
|
|
28
|
+
searchable: i
|
|
29
|
+
});
|
|
30
|
+
const c = i ? n.filter((e) => {
|
|
31
|
+
const r = L.toLowerCase();
|
|
32
|
+
return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(r);
|
|
33
|
+
}) : n, w = c.length === 0;
|
|
34
|
+
return /* @__PURE__ */ l(
|
|
26
35
|
"ul",
|
|
27
36
|
{
|
|
28
|
-
ref:
|
|
29
|
-
title:
|
|
37
|
+
ref: t,
|
|
38
|
+
title: d,
|
|
30
39
|
role: "listbox",
|
|
31
|
-
className:
|
|
32
|
-
"data-state":
|
|
33
|
-
children:
|
|
34
|
-
|
|
40
|
+
className: o(j({ className: f })),
|
|
41
|
+
"data-state": v ? "open" : "closed",
|
|
42
|
+
children: u ? /* @__PURE__ */ l(
|
|
43
|
+
a,
|
|
35
44
|
{
|
|
36
|
-
className: o,
|
|
45
|
+
className: o("select-none", s),
|
|
37
46
|
isClickable: !1,
|
|
38
47
|
value: "Loading...",
|
|
39
48
|
label: "Loading..."
|
|
40
49
|
}
|
|
41
|
-
) :
|
|
42
|
-
|
|
50
|
+
) : w ? /* @__PURE__ */ l(
|
|
51
|
+
a,
|
|
43
52
|
{
|
|
44
|
-
className: o,
|
|
53
|
+
className: o("select-none", s),
|
|
45
54
|
isClickable: !1,
|
|
46
55
|
value: "No options",
|
|
47
56
|
label: "No options"
|
|
48
57
|
}
|
|
49
|
-
) :
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
) : /* @__PURE__ */ x(N, { children: [
|
|
59
|
+
c.map((e) => /* @__PURE__ */ l(
|
|
60
|
+
a,
|
|
61
|
+
{
|
|
62
|
+
className: o("select-none", s),
|
|
63
|
+
isClickable: !0,
|
|
64
|
+
...e
|
|
65
|
+
},
|
|
66
|
+
e.value
|
|
67
|
+
)),
|
|
68
|
+
m?.map((e, r) => /* @__PURE__ */ l("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ l(I, { 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 }) }, r))
|
|
69
|
+
] })
|
|
58
70
|
}
|
|
59
71
|
);
|
|
60
72
|
}
|
|
61
73
|
);
|
|
62
74
|
export {
|
|
63
|
-
|
|
75
|
+
z as List
|
|
64
76
|
};
|
|
@@ -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,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef as u, useCallback as
|
|
3
|
-
import { Typography as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { listItemVariants as
|
|
6
|
-
import { useDropdownContext as
|
|
7
|
-
const
|
|
8
|
-
isClickable:
|
|
9
|
-
className:
|
|
1
|
+
import { jsx as o, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useCallback as l } from "react";
|
|
3
|
+
import { Typography as b } from "../../../Typography/Typography.js";
|
|
4
|
+
import { cn as w } from "../../../../utils/index.js";
|
|
5
|
+
import { listItemVariants as y } from "./ListItem.variants.js";
|
|
6
|
+
import { useDropdownContext as k } from "../../contexts/dropdown.hook.js";
|
|
7
|
+
const D = ({
|
|
8
|
+
isClickable: f,
|
|
9
|
+
className: p,
|
|
10
10
|
...t
|
|
11
11
|
}) => {
|
|
12
|
-
const { setValue:
|
|
12
|
+
const { searchTerm: r, highlightSearchEnabled: i, setValue: c, toggleOpen: m } = k(), d = u(null), a = l(
|
|
13
13
|
(e) => {
|
|
14
|
-
|
|
14
|
+
c(e.value), m(!1);
|
|
15
15
|
},
|
|
16
|
-
[
|
|
17
|
-
),
|
|
18
|
-
(e,
|
|
19
|
-
e.key === "Enter" && (e.stopPropagation(),
|
|
16
|
+
[c, m]
|
|
17
|
+
), h = l(
|
|
18
|
+
(e, s) => {
|
|
19
|
+
e.key === "Enter" && (e.stopPropagation(), a(s));
|
|
20
20
|
},
|
|
21
|
-
[
|
|
21
|
+
[a]
|
|
22
|
+
), g = l(
|
|
23
|
+
(e) => {
|
|
24
|
+
if (typeof e != "string")
|
|
25
|
+
return e;
|
|
26
|
+
const s = i && r.length > 0 ? e.split(new RegExp(`(${r})`, "gi")).map((n) => n.toLowerCase() === r.toLowerCase() ? /* @__PURE__ */ o(
|
|
27
|
+
"mark",
|
|
28
|
+
{
|
|
29
|
+
className: "bg-transparent font-semibold text-slate-800 dark:text-slate-50",
|
|
30
|
+
children: n
|
|
31
|
+
},
|
|
32
|
+
n
|
|
33
|
+
) : n) : [e];
|
|
34
|
+
return /* @__PURE__ */ o(
|
|
35
|
+
b,
|
|
36
|
+
{
|
|
37
|
+
variant: "body2",
|
|
38
|
+
className: "text-zinc-700 dark:text-slate-50",
|
|
39
|
+
children: s
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
[i, r]
|
|
22
44
|
);
|
|
23
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ x(
|
|
24
46
|
"li",
|
|
25
47
|
{
|
|
26
|
-
ref:
|
|
48
|
+
ref: d,
|
|
27
49
|
role: "option",
|
|
28
|
-
|
|
50
|
+
"data-action": "false",
|
|
51
|
+
className: w(y({ className: p })),
|
|
29
52
|
tabIndex: 0,
|
|
30
53
|
onClick: (e) => {
|
|
31
|
-
|
|
54
|
+
f && (a(t), e.stopPropagation());
|
|
32
55
|
},
|
|
33
|
-
onKeyDown: (e) =>
|
|
56
|
+
onKeyDown: (e) => h(e, t),
|
|
34
57
|
children: [
|
|
35
|
-
t.leftIcon ? /* @__PURE__ */
|
|
36
|
-
|
|
58
|
+
t.leftIcon ? /* @__PURE__ */ o("span", { className: "w-4 h-4 flex justify-center items-center", children: t.leftIcon }) : null,
|
|
59
|
+
g(t.label)
|
|
37
60
|
]
|
|
38
61
|
}
|
|
39
62
|
);
|
|
40
63
|
};
|
|
41
64
|
export {
|
|
42
|
-
|
|
65
|
+
D as ListItem
|
|
43
66
|
};
|
|
@@ -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
|
};
|