@konstructio/ui 0.1.2-alpha.13 → 0.1.2-alpha.15
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/{chevron-down-Cx07rtLP.js → chevron-down-J5nS1Tu0.js} +2 -2
- package/dist/{chevron-right-DCDOrc04.js → chevron-right-DeMVrnIg.js} +3 -3
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Button/Button.variants.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1 -1
- package/dist/components/Dropdown/Dropdown.variants.js +9 -4
- package/dist/components/Dropdown/components/List/List.js +55 -51
- package/dist/components/Dropdown/components/ListItem/ListItem.js +58 -36
- package/dist/components/Dropdown/components/Wrapper.js +128 -118
- package/dist/components/Dropdown/hooks/useDropdown.js +16 -12
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/PieChart/PieChart.js +460 -461
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +2 -2
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +1 -1
- package/dist/{createLucideIcon-DnY-81vT.js → createLucideIcon-DGhJ8Z4k.js} +4 -4
- package/dist/index.d.ts +4 -0
- package/dist/package.json +9 -9
- package/dist/styles.css +1 -1
- package/package.json +9 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as o } from "./createLucideIcon-
|
|
1
|
+
import { c as o } from "./createLucideIcon-DGhJ8Z4k.js";
|
|
2
2
|
/**
|
|
3
|
-
* @license lucide-react v0.
|
|
3
|
+
* @license lucide-react v0.548.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { c as o } from "./createLucideIcon-
|
|
1
|
+
import { c as o } from "./createLucideIcon-DGhJ8Z4k.js";
|
|
2
2
|
/**
|
|
3
|
-
* @license lucide-react v0.
|
|
3
|
+
* @license lucide-react v0.548.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
const e = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], n = o("chevron-left", e);
|
|
9
9
|
/**
|
|
10
|
-
* @license lucide-react v0.
|
|
10
|
+
* @license lucide-react v0.548.0 - ISC
|
|
11
11
|
*
|
|
12
12
|
* This source code is licensed under the ISC license.
|
|
13
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -3,9 +3,9 @@ import { useRef as h, useState as g, useCallback as v, useEffect as w } from "re
|
|
|
3
3
|
import { cn as m } from "../../utils/index.js";
|
|
4
4
|
import { buttonDismissVariants as x, badgeVariants as y } from "./Badge.variants.js";
|
|
5
5
|
import { S as M } from "../../index-DQH6odE9.js";
|
|
6
|
-
import { c as N } from "../../createLucideIcon-
|
|
6
|
+
import { c as N } from "../../createLucideIcon-DGhJ8Z4k.js";
|
|
7
7
|
/**
|
|
8
|
-
* @license lucide-react v0.
|
|
8
|
+
* @license lucide-react v0.548.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -2,7 +2,7 @@ import { jsx as Ee } from "react/jsx-runtime";
|
|
|
2
2
|
import d, { createContext as sn, useContext as an, useCallback as j, useRef as ke, useLayoutEffect as cn, useState as De, useEffect as un, useMemo as Pe } from "react";
|
|
3
3
|
import { cn as ue } from "../../utils/index.js";
|
|
4
4
|
import { datePickerVariants as fn } from "./DatePicker.variants.js";
|
|
5
|
-
import { C as ln, a as dn } from "../../chevron-right-
|
|
5
|
+
import { C as ln, a as dn } from "../../chevron-right-DeMVrnIg.js";
|
|
6
6
|
import '../../DatePicker.css';function hn(e, t, n = "long") {
|
|
7
7
|
return new Intl.DateTimeFormat("en-US", {
|
|
8
8
|
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
@@ -35,10 +35,15 @@ const a = e(
|
|
|
35
35
|
"kubefirst:text-red-600"
|
|
36
36
|
],
|
|
37
37
|
false: ""
|
|
38
|
+
},
|
|
39
|
+
disabled: {
|
|
40
|
+
true: ["cursor-default", "bg-gray-100", "dark:bg-slate-700/80"],
|
|
41
|
+
false: []
|
|
38
42
|
}
|
|
39
43
|
},
|
|
40
44
|
defaultVariants: {
|
|
41
|
-
hasError: !1
|
|
45
|
+
hasError: !1,
|
|
46
|
+
disabled: !1
|
|
42
47
|
}
|
|
43
48
|
}
|
|
44
49
|
), t = e([
|
|
@@ -54,16 +59,16 @@ const a = e(
|
|
|
54
59
|
"placeholder:select-none",
|
|
55
60
|
"dark:placeholder:text-slate-400",
|
|
56
61
|
"dark:text-slate-50"
|
|
57
|
-
]),
|
|
62
|
+
]), d = e([
|
|
58
63
|
"mb-1",
|
|
59
64
|
"cursor-pointer",
|
|
60
65
|
"text-sm",
|
|
61
|
-
"leading-
|
|
66
|
+
"leading-5",
|
|
62
67
|
"tracking-[0.1px]",
|
|
63
68
|
"dark:text-slate-50"
|
|
64
69
|
]);
|
|
65
70
|
export {
|
|
66
71
|
a as dropdownVariants,
|
|
67
72
|
t as inputVariants,
|
|
68
|
-
|
|
73
|
+
d as labelVariants
|
|
69
74
|
};
|
|
@@ -1,79 +1,83 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as l, jsxs as w, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y, useRef as j, useImperativeHandle as C } from "react";
|
|
3
3
|
import { cn as t } from "../../../../utils/index.js";
|
|
4
|
-
import { useNavigationUlList as
|
|
5
|
-
import { ListItem as
|
|
6
|
-
import { listVariants as
|
|
7
|
-
import { S as
|
|
8
|
-
import { useDropdownContext as
|
|
9
|
-
const
|
|
4
|
+
import { useNavigationUlList as O } from "../../hooks/useNavigationList.js";
|
|
5
|
+
import { ListItem as i } from "../ListItem/ListItem.js";
|
|
6
|
+
import { listVariants as D } from "./List.variants.js";
|
|
7
|
+
import { S as E } from "../../../../index-DQH6odE9.js";
|
|
8
|
+
import { useDropdownContext as F } from "../../contexts/dropdown.hook.js";
|
|
9
|
+
const I = y(
|
|
10
10
|
({
|
|
11
|
-
additionalOptions:
|
|
12
|
-
className:
|
|
13
|
-
inputRef:
|
|
14
|
-
isLoading:
|
|
15
|
-
itemClassName:
|
|
16
|
-
name:
|
|
17
|
-
options:
|
|
18
|
-
searchable:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
additionalOptions: p,
|
|
12
|
+
className: u,
|
|
13
|
+
inputRef: r,
|
|
14
|
+
isLoading: d,
|
|
15
|
+
itemClassName: s,
|
|
16
|
+
name: g,
|
|
17
|
+
options: c,
|
|
18
|
+
searchable: m = !1,
|
|
19
|
+
listItemSecondRowClassName: a,
|
|
20
|
+
wrapperInputRef: b,
|
|
21
|
+
wrapperRef: h
|
|
22
|
+
}, v) => {
|
|
23
|
+
const o = j(null), { isOpen: L, searchTerm: x } = F();
|
|
24
|
+
C(v, () => o.current, [o]), O({
|
|
25
|
+
ulRef: o,
|
|
26
|
+
wrapperRef: h,
|
|
27
|
+
wrapperInputRef: b,
|
|
28
|
+
inputRef: r,
|
|
29
|
+
searchable: m
|
|
29
30
|
});
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(
|
|
33
|
-
}) :
|
|
31
|
+
const f = m ? c.filter((e) => {
|
|
32
|
+
const n = x.toLowerCase();
|
|
33
|
+
return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(n);
|
|
34
|
+
}) : c, k = f.length === 0;
|
|
34
35
|
return /* @__PURE__ */ l(
|
|
35
36
|
"ul",
|
|
36
37
|
{
|
|
37
|
-
ref:
|
|
38
|
-
title:
|
|
38
|
+
ref: o,
|
|
39
|
+
title: g,
|
|
39
40
|
role: "listbox",
|
|
40
|
-
className: t(
|
|
41
|
-
"data-state":
|
|
42
|
-
children:
|
|
43
|
-
|
|
41
|
+
className: t(D({ className: u })),
|
|
42
|
+
"data-state": L ? "open" : "closed",
|
|
43
|
+
children: d ? /* @__PURE__ */ l(
|
|
44
|
+
i,
|
|
44
45
|
{
|
|
45
|
-
className: t("select-none",
|
|
46
|
+
className: t("select-none", s),
|
|
46
47
|
isClickable: !1,
|
|
47
|
-
inputRef:
|
|
48
|
+
inputRef: r,
|
|
48
49
|
value: "Loading...",
|
|
49
|
-
label: "Loading..."
|
|
50
|
+
label: "Loading...",
|
|
51
|
+
listItemSecondRowClassName: a
|
|
50
52
|
}
|
|
51
|
-
) :
|
|
52
|
-
|
|
53
|
+
) : k ? /* @__PURE__ */ l(
|
|
54
|
+
i,
|
|
53
55
|
{
|
|
54
|
-
className: t("select-none",
|
|
56
|
+
className: t("select-none", s),
|
|
55
57
|
isClickable: !1,
|
|
56
|
-
inputRef:
|
|
58
|
+
inputRef: r,
|
|
57
59
|
value: "No options",
|
|
58
|
-
label: "No options"
|
|
60
|
+
label: "No options",
|
|
61
|
+
listItemSecondRowClassName: a
|
|
59
62
|
}
|
|
60
|
-
) : /* @__PURE__ */
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
) : /* @__PURE__ */ w(N, { children: [
|
|
64
|
+
f.map((e) => /* @__PURE__ */ l(
|
|
65
|
+
i,
|
|
63
66
|
{
|
|
64
|
-
className: t("select-none",
|
|
67
|
+
className: t("select-none", s),
|
|
65
68
|
isClickable: !0,
|
|
66
|
-
inputRef:
|
|
69
|
+
inputRef: r,
|
|
70
|
+
listItemSecondRowClassName: a,
|
|
67
71
|
...e
|
|
68
72
|
},
|
|
69
73
|
e.value
|
|
70
74
|
)),
|
|
71
|
-
|
|
75
|
+
p?.map((e, n) => /* @__PURE__ */ l("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ l(E, { 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 }) }, n))
|
|
72
76
|
] })
|
|
73
77
|
}
|
|
74
78
|
);
|
|
75
79
|
}
|
|
76
80
|
);
|
|
77
81
|
export {
|
|
78
|
-
|
|
82
|
+
I as List
|
|
79
83
|
};
|
|
@@ -1,67 +1,89 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Typography as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { listItemVariants as
|
|
6
|
-
import { useDropdownContext as
|
|
7
|
-
const
|
|
8
|
-
isClickable:
|
|
9
|
-
className:
|
|
10
|
-
inputRef:
|
|
1
|
+
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as w, useCallback as o } from "react";
|
|
3
|
+
import { Typography as C } from "../../../Typography/Typography.js";
|
|
4
|
+
import { cn as i } from "../../../../utils/index.js";
|
|
5
|
+
import { listItemVariants as L } from "./ListItem.variants.js";
|
|
6
|
+
import { useDropdownContext as I } from "../../contexts/dropdown.hook.js";
|
|
7
|
+
const K = ({
|
|
8
|
+
isClickable: p,
|
|
9
|
+
className: h,
|
|
10
|
+
inputRef: b,
|
|
11
|
+
listItemSecondRowClassName: x,
|
|
11
12
|
...t
|
|
12
13
|
}) => {
|
|
13
|
-
const { searchTerm:
|
|
14
|
+
const { searchTerm: a, highlightSearchEnabled: c, setValue: m, toggleOpen: f } = I(), g = w(null), n = o(
|
|
14
15
|
(e) => {
|
|
15
|
-
|
|
16
|
+
m(e.value, b), f(!1);
|
|
16
17
|
},
|
|
17
|
-
[
|
|
18
|
-
),
|
|
19
|
-
(e,
|
|
20
|
-
e.key === "Enter" && (e.stopPropagation(),
|
|
18
|
+
[m, f]
|
|
19
|
+
), u = o(
|
|
20
|
+
(e, r) => {
|
|
21
|
+
e.key === "Enter" && (e.stopPropagation(), n(r));
|
|
21
22
|
},
|
|
22
|
-
[
|
|
23
|
-
),
|
|
24
|
-
(e) => {
|
|
23
|
+
[n]
|
|
24
|
+
), k = o(
|
|
25
|
+
(e, r) => {
|
|
25
26
|
if (typeof e != "string")
|
|
26
27
|
return e;
|
|
27
|
-
const
|
|
28
|
+
const y = c && a.length > 0 ? e.split(new RegExp(`(${a})`, "gi")).map((s) => s.toLowerCase() === a.toLowerCase() ? /* @__PURE__ */ l(
|
|
28
29
|
"mark",
|
|
29
30
|
{
|
|
30
31
|
className: "bg-transparent font-semibold text-slate-800 dark:text-slate-50",
|
|
31
|
-
children:
|
|
32
|
+
children: s
|
|
32
33
|
},
|
|
33
|
-
|
|
34
|
-
) :
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
34
|
+
s
|
|
35
|
+
) : s) : [e];
|
|
36
|
+
return /* @__PURE__ */ d(
|
|
37
|
+
C,
|
|
37
38
|
{
|
|
38
39
|
variant: "body2",
|
|
39
|
-
className: "text-zinc-700 dark:text-slate-50",
|
|
40
|
-
children:
|
|
40
|
+
className: "text-zinc-700 dark:text-slate-50 font-medium",
|
|
41
|
+
children: [
|
|
42
|
+
y,
|
|
43
|
+
r ? /* @__PURE__ */ l(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
className: i(
|
|
47
|
+
"block font-normal text-sm text-slate-800 dark:text-slate-50",
|
|
48
|
+
x
|
|
49
|
+
),
|
|
50
|
+
children: r
|
|
51
|
+
}
|
|
52
|
+
) : null
|
|
53
|
+
]
|
|
41
54
|
}
|
|
42
55
|
);
|
|
43
56
|
},
|
|
44
|
-
[
|
|
57
|
+
[c, a]
|
|
45
58
|
);
|
|
46
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ d(
|
|
47
60
|
"li",
|
|
48
61
|
{
|
|
49
|
-
ref:
|
|
62
|
+
ref: g,
|
|
50
63
|
role: "option",
|
|
51
64
|
"data-action": "false",
|
|
52
|
-
className:
|
|
65
|
+
className: i(L({ className: h })),
|
|
53
66
|
tabIndex: 0,
|
|
54
67
|
onClick: (e) => {
|
|
55
|
-
|
|
68
|
+
p && (n(t), e.stopPropagation());
|
|
56
69
|
},
|
|
57
|
-
onKeyDown: (e) =>
|
|
70
|
+
onKeyDown: (e) => u(e, t),
|
|
58
71
|
children: [
|
|
59
|
-
t.leftIcon ? /* @__PURE__ */
|
|
60
|
-
|
|
72
|
+
t.leftIcon ? /* @__PURE__ */ l(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
className: i("w-4 h-4 flex justify-center", {
|
|
76
|
+
"items-center": !t.subLabel,
|
|
77
|
+
"items-baseline -translate-y-2": !!t.subLabel
|
|
78
|
+
}),
|
|
79
|
+
children: t.leftIcon
|
|
80
|
+
}
|
|
81
|
+
) : null,
|
|
82
|
+
k(t.label, t.subLabel)
|
|
61
83
|
]
|
|
62
84
|
}
|
|
63
85
|
);
|
|
64
86
|
};
|
|
65
87
|
export {
|
|
66
|
-
|
|
88
|
+
K as ListItem
|
|
67
89
|
};
|