@konstructio/ui 0.1.0-alpha.2 → 0.1.0-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/{Combination-b348x__d.js → Combination-Cvr3uETz.js} +102 -102
- package/dist/DatePicker.css +1 -0
- package/dist/{Modal-i7eolhYH.js → Modal-DXYBiafI.js} +3 -3
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +55 -41
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +14 -14
- package/dist/components/Badge/Badge.variants.js +18 -17
- package/dist/components/Breadcrumb/Breadcrumb.js +43 -52
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +10 -41
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -23
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +43 -56
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +30 -26
- package/dist/components/Button/Button.variants.js +115 -28
- package/dist/components/Checkbox/Checkbox.js +297 -187
- package/dist/components/Checkbox/Checkbox.variants.js +12 -15
- 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 +1 -1
- 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 +1 -1
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +2711 -0
- package/dist/components/Datepicker/DatePicker.variants.js +5 -0
- package/dist/components/Dropdown/components/List/List.js +49 -17
- package/dist/components/Dropdown/components/ListItem/ListItem.js +21 -17
- package/dist/components/Dropdown/components/Wrapper.js +64 -59
- package/dist/components/Dropdown/contexts/dropdown.hook.js +5 -3
- package/dist/components/Input/Input.js +106 -137
- package/dist/components/Input/Input.variants.js +15 -13
- package/dist/components/Loading/Loading.js +2 -2
- 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 +1 -1
- package/dist/components/Radio/Radio.variants.js +14 -12
- 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 +141 -126
- package/dist/components/Tabs/Tabs.js +24 -0
- package/dist/components/Tabs/Tabs.variants.js +58 -0
- package/dist/components/Tabs/components/Content.js +19 -0
- package/dist/components/Tabs/components/List.js +20 -0
- package/dist/components/Tabs/components/Trigger.js +26 -0
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TimePicker/TimePicker.js +8 -0
- package/dist/components/TimePicker/TimePicker.variants.js +62 -0
- package/dist/components/TimePicker/components/HoursList/HoursList.js +93 -0
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +68 -0
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +60 -0
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +102 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +51 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +16 -0
- package/dist/components/TimePicker/components/index.js +4 -0
- package/dist/components/TimePicker/contexts/index.js +8 -0
- package/dist/components/TimePicker/contexts/time-picker.context.js +22 -0
- package/dist/components/TimePicker/contexts/time-picker.hook.js +13 -0
- package/dist/components/TimePicker/contexts/time-picker.provider.js +46 -0
- package/dist/components/TimePicker/utils/index.js +6 -0
- package/dist/components/Toast/Toast.js +37 -35
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.js +14 -16
- package/dist/components/index.js +72 -66
- package/dist/createLucideIcon-vyksFS6P.js +94 -0
- package/dist/index--EmNlyHx.js +31 -0
- package/dist/{index-DvFiic6N.js → index-1RDo-S_f.js} +96 -102
- package/dist/{index-Bk324h27.js → index-B5MIi2tR.js} +6 -5
- package/dist/{index-g-TFwd6Y.js → index-BCGvACM9.js} +2 -1
- package/dist/{index-Bry5AFQ2.js → index-Bc1LNrRD.js} +1 -1
- package/dist/index-BdMNhZnh.js +9 -0
- package/dist/{index-AM3avohj.js → index-BuxebbOg.js} +3 -3
- package/dist/index-BvCZBMfr.js +432 -0
- package/dist/index-Cq1I1cG9.js +129 -0
- package/dist/index-Cs8Lv8Wj.js +13 -0
- package/dist/index-CvfCCTEO.js +323 -0
- package/dist/{index-dRxIWVBr.js → index-Cz09twLl.js} +6 -5
- package/dist/{index-YaQrdkGE.js → index-DNRcvRTB.js} +31 -30
- package/dist/{index-G_6jG4Qc.js → index-Dm-ooN_M.js} +18 -18
- package/dist/index-DwYXX2sM.js +13 -0
- package/dist/{index-D9BbbgUq.js → index-rUBNhTeF.js} +2 -2
- package/dist/index.d.ts +75 -13
- package/dist/index.js +78 -72
- package/dist/package.json +37 -34
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +263 -0
- package/dist/ui/kubefirst-theme.css +1 -1
- package/dist/ui/theme.css +11 -0
- package/dist/useBreadcrumb-DMERrNkJ.js +1280 -0
- package/dist/utils/index.js +3 -3
- package/package.json +37 -34
- package/dist/createLucideIcon-CoF3ywd5.js +0 -89
- package/dist/index-BOx5P4tS.js +0 -423
- package/dist/index-CWKdynYu.js +0 -32
- package/dist/index-bYyfdsls.js +0 -118
- package/dist/useBreadcrumb-BsIeMoR1.js +0 -1279
|
@@ -1,27 +1,59 @@
|
|
|
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 { useDropdownContext as
|
|
8
|
-
const
|
|
9
|
-
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d, useRef as b, useImperativeHandle as v } from "react";
|
|
3
|
+
import { cn as x } from "../../../../utils/index.js";
|
|
4
|
+
import { useNavigationUlList as L } from "../../hooks/useNavigationList.js";
|
|
5
|
+
import { ListItem as r } from "../ListItem/ListItem.js";
|
|
6
|
+
import { listVariants as N } from "./List.variants.js";
|
|
7
|
+
import { useDropdownContext as g } from "../../contexts/dropdown.hook.js";
|
|
8
|
+
const y = d(
|
|
9
|
+
({
|
|
10
|
+
className: s,
|
|
11
|
+
isLoading: a,
|
|
12
|
+
itemClassName: o,
|
|
13
|
+
name: n,
|
|
14
|
+
options: t,
|
|
15
|
+
wrapperInputRef: m,
|
|
16
|
+
wrapperRef: f
|
|
17
|
+
}, c) => {
|
|
18
|
+
const e = b(null), { isOpen: p } = g();
|
|
19
|
+
v(c, () => e.current, [e]), L({ ulRef: e, wrapperRef: f, wrapperInputRef: m });
|
|
20
|
+
const u = t.length === 0;
|
|
21
|
+
return /* @__PURE__ */ l(
|
|
14
22
|
"ul",
|
|
15
23
|
{
|
|
16
24
|
ref: e,
|
|
17
|
-
title:
|
|
25
|
+
title: n,
|
|
18
26
|
role: "listbox",
|
|
19
|
-
className:
|
|
20
|
-
children:
|
|
27
|
+
className: x(N({ className: s }), p ? "flex" : "hidden"),
|
|
28
|
+
children: a ? /* @__PURE__ */ l(
|
|
29
|
+
r,
|
|
30
|
+
{
|
|
31
|
+
className: o,
|
|
32
|
+
isClickable: !1,
|
|
33
|
+
value: "Loading...",
|
|
34
|
+
label: "Loading..."
|
|
35
|
+
}
|
|
36
|
+
) : u ? /* @__PURE__ */ l(
|
|
37
|
+
r,
|
|
38
|
+
{
|
|
39
|
+
className: o,
|
|
40
|
+
isClickable: !1,
|
|
41
|
+
value: "No options",
|
|
42
|
+
label: "No options"
|
|
43
|
+
}
|
|
44
|
+
) : t.map((i) => /* @__PURE__ */ l(
|
|
45
|
+
r,
|
|
46
|
+
{
|
|
47
|
+
className: o,
|
|
48
|
+
isClickable: !0,
|
|
49
|
+
...i
|
|
50
|
+
},
|
|
51
|
+
i.value
|
|
52
|
+
))
|
|
21
53
|
}
|
|
22
54
|
);
|
|
23
55
|
}
|
|
24
56
|
);
|
|
25
57
|
export {
|
|
26
|
-
|
|
58
|
+
y as List
|
|
27
59
|
};
|
|
@@ -1,37 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useDropdownContext as
|
|
7
|
-
const
|
|
8
|
-
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useCallback as s } from "react";
|
|
3
|
+
import { Typography as d } from "../../../Typography/Typography.js";
|
|
4
|
+
import { cn as h } from "../../../../utils/index.js";
|
|
5
|
+
import { listItemVariants as x } from "./ListItem.variants.js";
|
|
6
|
+
import { useDropdownContext as y } from "../../contexts/dropdown.hook.js";
|
|
7
|
+
const j = ({
|
|
8
|
+
isClickable: a,
|
|
9
|
+
className: c,
|
|
10
|
+
...e
|
|
11
|
+
}) => {
|
|
12
|
+
const { setValue: n, toggleOpen: r } = y(), i = u(null), l = s(
|
|
9
13
|
(t) => {
|
|
10
14
|
n(t.value), r(!1);
|
|
11
15
|
},
|
|
12
16
|
[n, r]
|
|
13
|
-
),
|
|
14
|
-
(t,
|
|
15
|
-
t.key === "Enter" && l(
|
|
17
|
+
), m = s(
|
|
18
|
+
(t, f) => {
|
|
19
|
+
t.key === "Enter" && l(f);
|
|
16
20
|
},
|
|
17
21
|
[l]
|
|
18
22
|
);
|
|
19
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ p(
|
|
20
24
|
"li",
|
|
21
25
|
{
|
|
22
|
-
ref:
|
|
26
|
+
ref: i,
|
|
23
27
|
role: "option",
|
|
24
|
-
className:
|
|
28
|
+
className: h(x({ className: c })),
|
|
25
29
|
tabIndex: 0,
|
|
26
30
|
onClick: () => a && l(e),
|
|
27
|
-
onKeyDown: (t) =>
|
|
31
|
+
onKeyDown: (t) => m(t, e),
|
|
28
32
|
children: [
|
|
29
33
|
e.leftIcon ? /* @__PURE__ */ o("span", { className: "w-4 h-4 flex justify-center items-center", children: e.leftIcon }) : null,
|
|
30
|
-
/* @__PURE__ */ o(
|
|
34
|
+
/* @__PURE__ */ o(d, { variant: "body2", className: "text-zinc-700", children: e.label })
|
|
31
35
|
]
|
|
32
36
|
}
|
|
33
37
|
);
|
|
34
38
|
};
|
|
35
39
|
export {
|
|
36
|
-
|
|
40
|
+
j as ListItem
|
|
37
41
|
};
|
|
@@ -1,76 +1,79 @@
|
|
|
1
1
|
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Loading as
|
|
2
|
+
import { forwardRef as M, useId as U, useRef as R, useImperativeHandle as W, useMemo as B, useEffect as d } from "react";
|
|
3
|
+
import { Loading as G } from "../../Loading/Loading.js";
|
|
4
4
|
import { Typography as O } from "../../Typography/Typography.js";
|
|
5
5
|
import { cn as p } from "../../../utils/index.js";
|
|
6
|
-
import { labelVariants as
|
|
7
|
-
import { useDropdown as
|
|
8
|
-
import { List as
|
|
9
|
-
import { C as
|
|
10
|
-
import { useDropdownContext as
|
|
11
|
-
const
|
|
6
|
+
import { labelVariants as J, dropdownVariants as K } from "../Dropdown.variants.js";
|
|
7
|
+
import { useDropdown as P } from "../hooks/useDropdown.js";
|
|
8
|
+
import { List as Q } from "./List/List.js";
|
|
9
|
+
import { C as S } from "../../../chevron-up-DgLBQCKD.js";
|
|
10
|
+
import { useDropdownContext as X } from "../contexts/dropdown.hook.js";
|
|
11
|
+
const oe = M(
|
|
12
12
|
({
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
className: z,
|
|
14
|
+
defaultValue: m,
|
|
15
|
+
isLoading: u,
|
|
16
|
+
label: x,
|
|
15
17
|
labelClassName: j,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
listClassName: E,
|
|
19
|
+
listItemClassName: L,
|
|
20
|
+
name: l,
|
|
18
21
|
options: n,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
const v =
|
|
24
|
-
|
|
25
|
-
const e =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, [e, t]),
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
31
|
-
|
|
22
|
+
placeholder: k,
|
|
23
|
+
required: h,
|
|
24
|
+
theme: D
|
|
25
|
+
}, F) => {
|
|
26
|
+
const v = U(), o = R(null), b = R(null), { wrapperRef: s, wrapperInputRef: N, handleOpen: T, handleOpenIfClosed: $ } = P({ ulRef: b }), { isOpen: w, toggleOpen: g, value: t, setValue: C } = X(), c = l ? `${v}-${l}` : v;
|
|
27
|
+
W(F, () => o.current, [o]);
|
|
28
|
+
const e = B(() => n.find(({ value: a }) => a === t), [n, t]);
|
|
29
|
+
d(() => {
|
|
30
|
+
o.current && (o.current.value = t ? e == null ? void 0 : e.value : "");
|
|
31
|
+
}, [e, t]), d(() => {
|
|
32
|
+
if (m && !t) {
|
|
33
|
+
const a = n && n.find((i) => i.value === m);
|
|
34
|
+
a && C(a.value);
|
|
32
35
|
}
|
|
33
|
-
}, [
|
|
36
|
+
}, [m, n, C, t]), d(() => {
|
|
34
37
|
var i;
|
|
35
|
-
const
|
|
36
|
-
return (i =
|
|
37
|
-
var
|
|
38
|
-
const
|
|
39
|
-
(!
|
|
38
|
+
const a = new AbortController();
|
|
39
|
+
return (i = s.current) == null || i.addEventListener("focusout", (H) => {
|
|
40
|
+
var y;
|
|
41
|
+
const I = H.relatedTarget;
|
|
42
|
+
(!I || !((y = s.current) != null && y.contains(I))) && g(!1);
|
|
40
43
|
}), () => {
|
|
41
|
-
|
|
44
|
+
a.abort();
|
|
42
45
|
};
|
|
43
|
-
}, [g,
|
|
44
|
-
const
|
|
46
|
+
}, [g, s]);
|
|
47
|
+
const A = () => e != null && e.leftIcon ? /* @__PURE__ */ r("span", { className: "w-4 h-4 flex justify-center items-center", children: e.leftIcon }) : null;
|
|
45
48
|
return /* @__PURE__ */ f(
|
|
46
49
|
"div",
|
|
47
50
|
{
|
|
48
|
-
ref:
|
|
51
|
+
ref: s,
|
|
49
52
|
className: "flex flex-col w-full relative",
|
|
50
|
-
"data-theme":
|
|
53
|
+
"data-theme": D,
|
|
51
54
|
children: [
|
|
52
|
-
|
|
55
|
+
x ? /* @__PURE__ */ f(
|
|
53
56
|
"label",
|
|
54
57
|
{
|
|
55
58
|
id: c,
|
|
56
|
-
className: p(
|
|
59
|
+
className: p(J({ className: j })),
|
|
57
60
|
htmlFor: c,
|
|
58
|
-
onClick:
|
|
61
|
+
onClick: $,
|
|
59
62
|
children: [
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
x,
|
|
64
|
+
h ? /* @__PURE__ */ r("span", { className: "text-red-500 ml-1", children: "*" }) : null
|
|
62
65
|
]
|
|
63
66
|
}
|
|
64
67
|
) : null,
|
|
65
68
|
/* @__PURE__ */ f(
|
|
66
69
|
"div",
|
|
67
70
|
{
|
|
68
|
-
ref:
|
|
71
|
+
ref: N,
|
|
69
72
|
id: c,
|
|
70
|
-
className: p(
|
|
73
|
+
className: p(K({ className: z })),
|
|
71
74
|
role: "combobox",
|
|
72
|
-
onClick:
|
|
73
|
-
"aria-expanded":
|
|
75
|
+
onClick: T,
|
|
76
|
+
"aria-expanded": w,
|
|
74
77
|
tabIndex: 0,
|
|
75
78
|
"aria-labelledby": c,
|
|
76
79
|
children: [
|
|
@@ -80,7 +83,7 @@ const re = $(
|
|
|
80
83
|
variant: "body2",
|
|
81
84
|
className: "flex gap-3 items-center text-zinc-700 text-base",
|
|
82
85
|
children: [
|
|
83
|
-
|
|
86
|
+
A(),
|
|
84
87
|
e == null ? void 0 : e.label
|
|
85
88
|
]
|
|
86
89
|
}
|
|
@@ -89,15 +92,15 @@ const re = $(
|
|
|
89
92
|
{
|
|
90
93
|
variant: "body2",
|
|
91
94
|
className: "flex gap-3 items-center text-zinc-700 text-base",
|
|
92
|
-
children:
|
|
95
|
+
children: k
|
|
93
96
|
}
|
|
94
97
|
),
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
u ? /* @__PURE__ */ r(G, { className: "w-4 h-4 text-zinc-500" }) : /* @__PURE__ */ r(
|
|
99
|
+
S,
|
|
97
100
|
{
|
|
98
101
|
className: p(
|
|
99
102
|
"w-4 h-4 text-zinc-500 transition-all duration-50",
|
|
100
|
-
|
|
103
|
+
w ? "rotate-0" : "rotate-180"
|
|
101
104
|
)
|
|
102
105
|
}
|
|
103
106
|
)
|
|
@@ -107,23 +110,25 @@ const re = $(
|
|
|
107
110
|
/* @__PURE__ */ r(
|
|
108
111
|
"input",
|
|
109
112
|
{
|
|
110
|
-
ref:
|
|
113
|
+
ref: o,
|
|
111
114
|
type: "text",
|
|
112
|
-
name:
|
|
115
|
+
name: l,
|
|
113
116
|
className: "hidden",
|
|
114
117
|
"aria-hidden": "true",
|
|
115
|
-
required:
|
|
118
|
+
required: h
|
|
116
119
|
}
|
|
117
120
|
),
|
|
118
121
|
/* @__PURE__ */ r(
|
|
119
|
-
|
|
122
|
+
Q,
|
|
120
123
|
{
|
|
121
124
|
ref: b,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
className: E,
|
|
126
|
+
itemClassName: L,
|
|
127
|
+
name: l,
|
|
128
|
+
wrapperRef: s,
|
|
129
|
+
wrapperInputRef: N,
|
|
125
130
|
options: n,
|
|
126
|
-
isLoading: !!
|
|
131
|
+
isLoading: !!u
|
|
127
132
|
}
|
|
128
133
|
)
|
|
129
134
|
]
|
|
@@ -132,5 +137,5 @@ const re = $(
|
|
|
132
137
|
}
|
|
133
138
|
);
|
|
134
139
|
export {
|
|
135
|
-
|
|
140
|
+
oe as Wrapper
|
|
136
141
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { useContext as t } from "react";
|
|
2
2
|
import { DropdownContext as r } from "./dropdown.context.js";
|
|
3
|
-
const
|
|
3
|
+
const p = () => {
|
|
4
4
|
const o = t(r);
|
|
5
5
|
if (!o)
|
|
6
|
-
throw new Error(
|
|
6
|
+
throw new Error(
|
|
7
|
+
"useDropdownContext must be used within a DropdownProvider"
|
|
8
|
+
);
|
|
7
9
|
return o;
|
|
8
10
|
};
|
|
9
11
|
export {
|
|
10
|
-
|
|
12
|
+
p as useDropdownContext
|
|
11
13
|
};
|