@konstructio/ui 0.1.2-alpha.44 → 0.1.2-alpha.46
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/AlertDialog/AlertDialog.js +39 -37
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +23 -26
- package/dist/components/Badge/Badge.variants.js +1 -1
- package/dist/components/Button/Button.variants.js +108 -98
- package/dist/components/Checkbox/Checkbox.js +104 -100
- package/dist/components/Checkbox/Checkbox.variants.js +30 -7
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +9 -10
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
- package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -32
- package/dist/components/Filter/events/index.js +3 -3
- package/dist/components/ImageUpload/ImageUpload.js +221 -0
- package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
- package/dist/components/Input/Input.variants.js +10 -2
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +4 -4
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +16 -7
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +92 -74
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +53 -29
- package/dist/components/PhoneNumberInput/components/Wrapper.js +139 -120
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +3 -3
- package/dist/components/{Dropdown → Select}/components/List/List.js +48 -43
- package/dist/components/{Dropdown → Select}/components/List/List.variants.js +8 -5
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.js +20 -20
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +3 -2
- package/dist/components/{Dropdown → Select}/components/Wrapper.js +70 -70
- package/dist/components/Select/contexts/index.js +6 -0
- package/dist/components/{Dropdown/contexts/dropdown.context.js → Select/contexts/select.context.js} +2 -2
- package/dist/components/Select/contexts/select.hook.js +11 -0
- package/dist/components/Select/contexts/select.provider.js +58 -0
- package/dist/components/{Dropdown → Select}/hooks/useNavigationList.js +3 -3
- package/dist/components/{Dropdown/hooks/useDropdown.js → Select/hooks/useSelect.js} +33 -33
- package/dist/components/Switch/Switch.js +153 -125
- package/dist/components/Switch/Switch.variants.js +15 -6
- package/dist/components/Typography/Typography.js +25 -27
- package/dist/components/Typography/Typography.variants.js +2 -2
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +14 -14
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +10 -10
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/index.js +77 -74
- package/dist/{index-CPU02rhe.js → index-D6KzX_ef.js} +13 -12
- package/dist/index.d.ts +106 -60
- package/dist/index.js +109 -106
- package/dist/package.json +4 -4
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +6 -5
- package/dist/ui/theme.css +27 -0
- package/dist/x-BXShoIAM.js +8 -0
- package/package.json +4 -4
- package/dist/components/Dropdown/Dropdown.js +0 -48
- package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
- package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -58
- package/dist/components/Dropdown/contexts/index.js +0 -6
- /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
- /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
- /package/dist/components/{Dropdown → Select}/constants/index.js +0 -0
- /package/dist/components/{Dropdown → Select}/constants/pagination.js +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import { useState as e, useRef as f, useCallback as T, useEffect as p } from "react";
|
|
3
|
+
import { SelectContext as N } from "./select.context.js";
|
|
4
|
+
import { useToggle as O } from "../../../hooks/useToggle.js";
|
|
5
|
+
const c = 1, R = 300, V = ({
|
|
6
|
+
children: C,
|
|
7
|
+
value: E,
|
|
8
|
+
name: i,
|
|
9
|
+
highlightSearch: S = !1,
|
|
10
|
+
options: n,
|
|
11
|
+
onChange: a,
|
|
12
|
+
onBlur: u
|
|
13
|
+
}) => {
|
|
14
|
+
const [d, l] = e(n), v = f(S), [F, g] = O(!1), [P, I] = e(""), [b, x] = e(!0), [A, o] = e(!0), [_, s] = e(c), [y, h] = e(!1), t = f(void 0), D = T(
|
|
15
|
+
(r, m) => {
|
|
16
|
+
m?.current && (m.current.value = r), t.current && clearTimeout(t.current), h(!0), o(!0), s(c), a?.({ target: { value: r, name: i ?? "" } }), u?.(), t.current = setTimeout(() => {
|
|
17
|
+
h(!1);
|
|
18
|
+
}, R);
|
|
19
|
+
},
|
|
20
|
+
[a, i, u]
|
|
21
|
+
), G = T(
|
|
22
|
+
(r) => {
|
|
23
|
+
g(r), o(!0), s(c);
|
|
24
|
+
},
|
|
25
|
+
[g]
|
|
26
|
+
);
|
|
27
|
+
return p(() => {
|
|
28
|
+
l(n);
|
|
29
|
+
}, [n.length]), p(() => () => {
|
|
30
|
+
t.current && clearTimeout(t.current);
|
|
31
|
+
}, []), /* @__PURE__ */ L(
|
|
32
|
+
N.Provider,
|
|
33
|
+
{
|
|
34
|
+
value: {
|
|
35
|
+
highlightSearchEnabled: v.current,
|
|
36
|
+
isOpen: F,
|
|
37
|
+
searchTerm: P,
|
|
38
|
+
value: E,
|
|
39
|
+
canFilter: b,
|
|
40
|
+
canContinueFetching: A,
|
|
41
|
+
page: _,
|
|
42
|
+
options: d,
|
|
43
|
+
isTyping: y,
|
|
44
|
+
setOptions: l,
|
|
45
|
+
setPage: s,
|
|
46
|
+
setCanContinueFetching: o,
|
|
47
|
+
setCanFilter: x,
|
|
48
|
+
setSearchTerm: I,
|
|
49
|
+
setValue: D,
|
|
50
|
+
toggleOpen: G
|
|
51
|
+
},
|
|
52
|
+
children: C
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
V as SelectProvider
|
|
58
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef as g, useEffect as a } from "react";
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
2
|
+
import { useSelectContext as k } from "../contexts/select.hook.js";
|
|
3
|
+
const d = ({
|
|
4
4
|
searchable: o,
|
|
5
5
|
ulRef: n,
|
|
6
6
|
wrapperInputRef: e,
|
|
@@ -46,5 +46,5 @@ const A = ({
|
|
|
46
46
|
}, [s]);
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
d as useNavigationUlList
|
|
50
50
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { useRef as m, useEffect as c, useCallback as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
1
|
+
import { useRef as m, useEffect as c, useCallback as w } from "react";
|
|
2
|
+
import { useSelectContext as L } from "../contexts/select.hook.js";
|
|
3
|
+
const y = ({
|
|
4
4
|
ulRef: f,
|
|
5
|
-
inputRef:
|
|
6
|
-
disabled:
|
|
5
|
+
inputRef: r,
|
|
6
|
+
disabled: E,
|
|
7
7
|
internalValue: u,
|
|
8
8
|
onBlur: g
|
|
9
9
|
}) => {
|
|
10
|
-
const
|
|
10
|
+
const t = m(null), a = m(null), { value: i, setSearchTerm: v, setCanFilter: d, toggleOpen: n } = L();
|
|
11
11
|
c(() => {
|
|
12
|
-
const e = new AbortController(),
|
|
12
|
+
const e = new AbortController(), s = (l) => {
|
|
13
13
|
l.key === "Escape" && n(!1);
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, o = (l) => {
|
|
15
|
+
t.current?.contains(l.target) || n(!1);
|
|
16
16
|
};
|
|
17
|
-
return document.addEventListener("keydown",
|
|
17
|
+
return document.addEventListener("keydown", s, {
|
|
18
18
|
signal: e.signal
|
|
19
|
-
}), document.addEventListener("mousedown",
|
|
19
|
+
}), document.addEventListener("mousedown", o, {
|
|
20
20
|
signal: e.signal
|
|
21
21
|
}), document.addEventListener(
|
|
22
22
|
"visibilitychange",
|
|
@@ -29,20 +29,20 @@ const p = ({
|
|
|
29
29
|
), a.current?.addEventListener(
|
|
30
30
|
"focusin",
|
|
31
31
|
(l) => {
|
|
32
|
-
!
|
|
32
|
+
!E && l.target?.matches(":focus-visible") && n(!0);
|
|
33
33
|
},
|
|
34
34
|
{ signal: e.signal }
|
|
35
35
|
), () => {
|
|
36
36
|
e.abort();
|
|
37
37
|
};
|
|
38
|
-
}, [n,
|
|
38
|
+
}, [n, t]), c(() => {
|
|
39
39
|
const e = new AbortController();
|
|
40
40
|
return a.current?.addEventListener(
|
|
41
41
|
"keydown",
|
|
42
|
-
(
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
|
|
42
|
+
(s) => {
|
|
43
|
+
if (s.key === "ArrowDown") {
|
|
44
|
+
const o = f.current?.querySelector("li");
|
|
45
|
+
o && o.focus();
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
{ signal: e.signal }
|
|
@@ -51,13 +51,13 @@ const p = ({
|
|
|
51
51
|
};
|
|
52
52
|
}, [a, f]), c(() => {
|
|
53
53
|
const e = new AbortController();
|
|
54
|
-
return
|
|
54
|
+
return r?.current?.addEventListener(
|
|
55
55
|
"focusin",
|
|
56
56
|
() => {
|
|
57
57
|
v(u?.value ?? ""), d(!1);
|
|
58
58
|
},
|
|
59
59
|
{ signal: e.signal }
|
|
60
|
-
),
|
|
60
|
+
), r?.current?.addEventListener(
|
|
61
61
|
"focusout",
|
|
62
62
|
() => {
|
|
63
63
|
d(!0);
|
|
@@ -69,35 +69,35 @@ const p = ({
|
|
|
69
69
|
d(!1);
|
|
70
70
|
},
|
|
71
71
|
{ signal: e.signal }
|
|
72
|
-
),
|
|
72
|
+
), t.current?.addEventListener(
|
|
73
73
|
"focusout",
|
|
74
|
-
(
|
|
75
|
-
|
|
74
|
+
(s) => {
|
|
75
|
+
t.current?.contains(s.relatedTarget) || n(!1);
|
|
76
76
|
},
|
|
77
77
|
{ signal: e.signal }
|
|
78
78
|
), () => {
|
|
79
79
|
e.abort();
|
|
80
80
|
};
|
|
81
81
|
}, [i]), c(() => {
|
|
82
|
-
|
|
82
|
+
r?.current && (r.current.value = i && u?.value || "");
|
|
83
83
|
}, [u, i]), c(() => {
|
|
84
84
|
const e = new AbortController();
|
|
85
|
-
return
|
|
86
|
-
const
|
|
87
|
-
(!
|
|
85
|
+
return t.current?.addEventListener("focusout", (s) => {
|
|
86
|
+
const o = s.relatedTarget;
|
|
87
|
+
(!o || !t.current?.contains(o)) && (r?.current?.value || g?.());
|
|
88
88
|
}), () => {
|
|
89
89
|
e.abort();
|
|
90
90
|
};
|
|
91
|
-
}, [n,
|
|
92
|
-
const
|
|
93
|
-
n(!0), requestAnimationFrame(() =>
|
|
94
|
-
}, [
|
|
91
|
+
}, [n, t, v, g, i]);
|
|
92
|
+
const b = w(() => {
|
|
93
|
+
n(!0), requestAnimationFrame(() => r?.current?.focus());
|
|
94
|
+
}, [r, n]);
|
|
95
95
|
return {
|
|
96
|
-
wrapperRef:
|
|
96
|
+
wrapperRef: t,
|
|
97
97
|
wrapperInputRef: a,
|
|
98
|
-
handleOpen:
|
|
98
|
+
handleOpen: b
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
101
|
export {
|
|
102
|
-
|
|
102
|
+
y as useSelect
|
|
103
103
|
};
|
|
@@ -1,115 +1,116 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { a as
|
|
1
|
+
import { jsxs as y, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { forwardRef as M, useRef as $, useId as j, useImperativeHandle as z, useEffect as A } from "react";
|
|
4
|
+
import { a as U, c as q, P as N, b as F } from "../../index-DKfEnhKr.js";
|
|
5
5
|
import { u as P } from "../../index-DLcqcWxM.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { u as L } from "../../index-BZPx6jYI.js";
|
|
7
|
+
import { u as O } from "../../index-DtEcCIrM.js";
|
|
8
|
+
import { Typography as R } from "../Typography/Typography.js";
|
|
9
|
+
import { cn as C } from "../../utils/index.js";
|
|
10
|
+
import { thumbVariants as V, switchVariants as D } from "./Switch.variants.js";
|
|
11
|
+
var k = "Switch", [W, ne] = q(k), [X, G] = W(k), g = p.forwardRef(
|
|
12
|
+
(o, d) => {
|
|
12
13
|
const {
|
|
13
|
-
__scopeSwitch:
|
|
14
|
-
name:
|
|
15
|
-
checked:
|
|
16
|
-
defaultChecked:
|
|
17
|
-
required:
|
|
18
|
-
disabled:
|
|
19
|
-
value:
|
|
20
|
-
onCheckedChange:
|
|
21
|
-
form:
|
|
22
|
-
...
|
|
23
|
-
} =
|
|
24
|
-
prop:
|
|
25
|
-
defaultProp:
|
|
26
|
-
onChange:
|
|
27
|
-
caller:
|
|
14
|
+
__scopeSwitch: e,
|
|
15
|
+
name: c,
|
|
16
|
+
checked: t,
|
|
17
|
+
defaultChecked: S,
|
|
18
|
+
required: r,
|
|
19
|
+
disabled: n,
|
|
20
|
+
value: a = "on",
|
|
21
|
+
onCheckedChange: v,
|
|
22
|
+
form: i,
|
|
23
|
+
...u
|
|
24
|
+
} = o, [f, m] = p.useState(null), s = P(d, (x) => m(x)), h = p.useRef(!1), b = f ? i || !!f.closest("form") : !0, [w, T] = U({
|
|
25
|
+
prop: t,
|
|
26
|
+
defaultProp: S ?? !1,
|
|
27
|
+
onChange: v,
|
|
28
|
+
caller: k
|
|
28
29
|
});
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ y(X, { scope: e, checked: w, disabled: n, children: [
|
|
31
|
+
/* @__PURE__ */ l(
|
|
31
32
|
N.button,
|
|
32
33
|
{
|
|
33
34
|
type: "button",
|
|
34
35
|
role: "switch",
|
|
35
|
-
"aria-checked":
|
|
36
|
-
"aria-required":
|
|
37
|
-
"data-state":
|
|
38
|
-
"data-disabled":
|
|
39
|
-
disabled:
|
|
40
|
-
value:
|
|
41
|
-
...
|
|
42
|
-
ref:
|
|
43
|
-
onClick:
|
|
44
|
-
|
|
36
|
+
"aria-checked": w,
|
|
37
|
+
"aria-required": r,
|
|
38
|
+
"data-state": B(w),
|
|
39
|
+
"data-disabled": n ? "" : void 0,
|
|
40
|
+
disabled: n,
|
|
41
|
+
value: a,
|
|
42
|
+
...u,
|
|
43
|
+
ref: s,
|
|
44
|
+
onClick: F(o.onClick, (x) => {
|
|
45
|
+
T((H) => !H), b && (h.current = x.isPropagationStopped(), h.current || x.stopPropagation());
|
|
45
46
|
})
|
|
46
47
|
}
|
|
47
48
|
),
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
b && /* @__PURE__ */ l(
|
|
50
|
+
I,
|
|
50
51
|
{
|
|
51
|
-
control:
|
|
52
|
-
bubbles: !
|
|
53
|
-
name:
|
|
54
|
-
value:
|
|
55
|
-
checked:
|
|
56
|
-
required:
|
|
57
|
-
disabled:
|
|
58
|
-
form:
|
|
52
|
+
control: f,
|
|
53
|
+
bubbles: !h.current,
|
|
54
|
+
name: c,
|
|
55
|
+
value: a,
|
|
56
|
+
checked: w,
|
|
57
|
+
required: r,
|
|
58
|
+
disabled: n,
|
|
59
|
+
form: i,
|
|
59
60
|
style: { transform: "translateX(-100%)" }
|
|
60
61
|
}
|
|
61
62
|
)
|
|
62
63
|
] });
|
|
63
64
|
}
|
|
64
65
|
);
|
|
65
|
-
|
|
66
|
-
var
|
|
67
|
-
(
|
|
68
|
-
const { __scopeSwitch:
|
|
69
|
-
return /* @__PURE__ */
|
|
66
|
+
g.displayName = k;
|
|
67
|
+
var E = "SwitchThumb", _ = p.forwardRef(
|
|
68
|
+
(o, d) => {
|
|
69
|
+
const { __scopeSwitch: e, ...c } = o, t = G(E, e);
|
|
70
|
+
return /* @__PURE__ */ l(
|
|
70
71
|
N.span,
|
|
71
72
|
{
|
|
72
|
-
"data-state":
|
|
73
|
-
"data-disabled":
|
|
74
|
-
...
|
|
75
|
-
ref:
|
|
73
|
+
"data-state": B(t.checked),
|
|
74
|
+
"data-disabled": t.disabled ? "" : void 0,
|
|
75
|
+
...c,
|
|
76
|
+
ref: d
|
|
76
77
|
}
|
|
77
78
|
);
|
|
78
79
|
}
|
|
79
80
|
);
|
|
80
|
-
|
|
81
|
-
var
|
|
81
|
+
_.displayName = E;
|
|
82
|
+
var J = "SwitchBubbleInput", I = p.forwardRef(
|
|
82
83
|
({
|
|
83
|
-
__scopeSwitch:
|
|
84
|
-
control:
|
|
85
|
-
checked:
|
|
86
|
-
bubbles:
|
|
87
|
-
...
|
|
88
|
-
},
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
93
|
-
const
|
|
94
|
-
|
|
84
|
+
__scopeSwitch: o,
|
|
85
|
+
control: d,
|
|
86
|
+
checked: e,
|
|
87
|
+
bubbles: c = !0,
|
|
88
|
+
...t
|
|
89
|
+
}, S) => {
|
|
90
|
+
const r = p.useRef(null), n = P(r, S), a = L(e), v = O(d);
|
|
91
|
+
return p.useEffect(() => {
|
|
92
|
+
const i = r.current;
|
|
93
|
+
if (!i) return;
|
|
94
|
+
const u = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(
|
|
95
|
+
u,
|
|
95
96
|
"checked"
|
|
96
97
|
).set;
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
|
|
98
|
+
if (a !== e && m) {
|
|
99
|
+
const s = new Event("click", { bubbles: c });
|
|
100
|
+
m.call(i, e), i.dispatchEvent(s);
|
|
100
101
|
}
|
|
101
|
-
}, [
|
|
102
|
+
}, [a, e, c]), /* @__PURE__ */ l(
|
|
102
103
|
"input",
|
|
103
104
|
{
|
|
104
105
|
type: "checkbox",
|
|
105
106
|
"aria-hidden": !0,
|
|
106
|
-
defaultChecked:
|
|
107
|
-
...
|
|
107
|
+
defaultChecked: e,
|
|
108
|
+
...t,
|
|
108
109
|
tabIndex: -1,
|
|
109
|
-
ref:
|
|
110
|
+
ref: n,
|
|
110
111
|
style: {
|
|
111
|
-
...
|
|
112
|
-
...
|
|
112
|
+
...t.style,
|
|
113
|
+
...v,
|
|
113
114
|
position: "absolute",
|
|
114
115
|
pointerEvents: "none",
|
|
115
116
|
opacity: 0,
|
|
@@ -119,72 +120,99 @@ var G = "SwitchBubbleInput", _ = h.forwardRef(
|
|
|
119
120
|
);
|
|
120
121
|
}
|
|
121
122
|
);
|
|
122
|
-
|
|
123
|
-
function
|
|
124
|
-
return
|
|
123
|
+
I.displayName = J;
|
|
124
|
+
function B(o) {
|
|
125
|
+
return o ? "checked" : "unchecked";
|
|
125
126
|
}
|
|
126
|
-
var
|
|
127
|
-
const
|
|
127
|
+
var K = g, Q = _;
|
|
128
|
+
const ie = M(
|
|
128
129
|
({
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
130
|
+
alignment: o = "horizontal",
|
|
131
|
+
className: d,
|
|
132
|
+
defaultChecked: e,
|
|
133
|
+
disabled: c = !1,
|
|
134
|
+
helperText: t,
|
|
135
|
+
helperTextClassName: S,
|
|
136
|
+
label: r,
|
|
137
|
+
labelClassName: n,
|
|
138
|
+
name: a,
|
|
139
|
+
theme: v,
|
|
140
|
+
thumbClassName: i,
|
|
141
|
+
value: u,
|
|
142
|
+
onChange: f
|
|
143
|
+
}, m) => {
|
|
144
|
+
const s = $(null), h = j(), b = a ? `${h}-${a}` : h;
|
|
145
|
+
return z(m, () => s.current, [s]), A(() => {
|
|
146
|
+
s.current && (s.current.value = `${u}`);
|
|
147
|
+
}, [u]), /* @__PURE__ */ y(
|
|
144
148
|
"div",
|
|
145
149
|
{
|
|
146
|
-
className:
|
|
147
|
-
"w-full
|
|
148
|
-
|
|
150
|
+
className: C(
|
|
151
|
+
"w-full",
|
|
152
|
+
"flex",
|
|
153
|
+
"gap-3",
|
|
154
|
+
o === "vertical" ? "flex-col" : "flex-row"
|
|
149
155
|
),
|
|
150
|
-
"data-theme":
|
|
156
|
+
"data-theme": v,
|
|
151
157
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
|
|
158
|
+
/* @__PURE__ */ l(
|
|
159
|
+
K,
|
|
154
160
|
{
|
|
155
|
-
id:
|
|
156
|
-
defaultChecked:
|
|
157
|
-
checked:
|
|
158
|
-
onCheckedChange: (w) =>
|
|
159
|
-
className:
|
|
160
|
-
"aria-label":
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
id: b,
|
|
162
|
+
defaultChecked: e,
|
|
163
|
+
checked: u,
|
|
164
|
+
onCheckedChange: (w) => f?.(w),
|
|
165
|
+
className: C(D({ className: d })),
|
|
166
|
+
"aria-label": r,
|
|
167
|
+
disabled: c,
|
|
168
|
+
children: /* @__PURE__ */ l(
|
|
169
|
+
Q,
|
|
163
170
|
{
|
|
164
|
-
className:
|
|
165
|
-
className:
|
|
171
|
+
className: V({
|
|
172
|
+
className: i
|
|
166
173
|
})
|
|
167
174
|
}
|
|
168
175
|
)
|
|
169
176
|
}
|
|
170
177
|
),
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
r ? /* @__PURE__ */ y(
|
|
179
|
+
R,
|
|
173
180
|
{
|
|
174
|
-
|
|
175
|
-
|
|
181
|
+
component: "label",
|
|
182
|
+
className: C(
|
|
183
|
+
"flex",
|
|
184
|
+
"flex-col",
|
|
185
|
+
"text-sm",
|
|
186
|
+
"dark:text-white",
|
|
187
|
+
"select-none",
|
|
188
|
+
n
|
|
189
|
+
),
|
|
190
|
+
htmlFor: b,
|
|
176
191
|
style: { paddingRight: 15 },
|
|
177
192
|
children: [
|
|
178
|
-
|
|
179
|
-
|
|
193
|
+
r,
|
|
194
|
+
t ? /* @__PURE__ */ l(
|
|
195
|
+
R,
|
|
196
|
+
{
|
|
197
|
+
component: "span",
|
|
198
|
+
className: C(
|
|
199
|
+
"text-xs",
|
|
200
|
+
"select-none",
|
|
201
|
+
"text-slate-600",
|
|
202
|
+
"dark:text-metal-400",
|
|
203
|
+
S
|
|
204
|
+
),
|
|
205
|
+
children: t
|
|
206
|
+
}
|
|
207
|
+
) : null
|
|
180
208
|
]
|
|
181
209
|
}
|
|
182
210
|
) : null,
|
|
183
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ l(
|
|
184
212
|
"input",
|
|
185
213
|
{
|
|
186
|
-
ref:
|
|
187
|
-
name:
|
|
214
|
+
ref: s,
|
|
215
|
+
name: a,
|
|
188
216
|
type: "text",
|
|
189
217
|
className: "hidden",
|
|
190
218
|
"aria-hidden": "true"
|
|
@@ -196,5 +224,5 @@ const ce = H(
|
|
|
196
224
|
}
|
|
197
225
|
);
|
|
198
226
|
export {
|
|
199
|
-
|
|
227
|
+
ie as Switch
|
|
200
228
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as a } from "../../index-D29mdTf5.js";
|
|
2
|
-
const
|
|
2
|
+
const t = a([
|
|
3
3
|
"w-10",
|
|
4
4
|
"h-5",
|
|
5
5
|
"flex",
|
|
@@ -8,14 +8,23 @@ const r = a([
|
|
|
8
8
|
"shadow",
|
|
9
9
|
"focus:shadow-md",
|
|
10
10
|
"data-[state=unchecked]:bg-gray-300",
|
|
11
|
-
"dark:data-[state=unchecked]:bg-
|
|
11
|
+
"dark:data-[state=unchecked]:bg-metal-600",
|
|
12
12
|
"transition-all",
|
|
13
13
|
"delay-10",
|
|
14
14
|
"duration-250",
|
|
15
15
|
"cursor-pointer",
|
|
16
16
|
"bg-aurora-500",
|
|
17
|
-
"kubefirst:bg-kubefirst-primary"
|
|
18
|
-
]
|
|
17
|
+
"kubefirst:bg-kubefirst-primary",
|
|
18
|
+
"[&+label,&+span]:cursor-pointer",
|
|
19
|
+
"disabled:[&+label,&+span,&]:cursor-not-allowed",
|
|
20
|
+
"disabled:bg-gray-200",
|
|
21
|
+
"disabled:data-[state=unchecked]:[&>span]:bg-white",
|
|
22
|
+
"disabled:data-[state=unchecked]:bg-gray-200",
|
|
23
|
+
"dark:disabled:bg-metal-700",
|
|
24
|
+
"dark:disabled:data-[state=unchecked]:[&>span]:bg-metal-600",
|
|
25
|
+
"dark:disabled:data-[state=unchecked]:bg-metal-700",
|
|
26
|
+
"dark:disabled:[&>span]:bg-metal-600"
|
|
27
|
+
]), d = a([
|
|
19
28
|
"block",
|
|
20
29
|
"w-4",
|
|
21
30
|
"h-4",
|
|
@@ -31,6 +40,6 @@ const r = a([
|
|
|
31
40
|
"duration-300"
|
|
32
41
|
]);
|
|
33
42
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
t as switchVariants,
|
|
44
|
+
d as thumbVariants
|
|
36
45
|
};
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { typographyVariants as
|
|
5
|
-
const d =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
27
|
-
d.displayName = "Typography";
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y } from "react";
|
|
3
|
+
import { cn as c } from "../../utils/index.js";
|
|
4
|
+
import { typographyVariants as f } from "./Typography.variants.js";
|
|
5
|
+
const d = y(({ className: o, theme: r, children: p, variant: t, component: e, ...m }, a) => {
|
|
6
|
+
const s = e ?? (t?.includes("h") ? t : "p");
|
|
7
|
+
return /* @__PURE__ */ n(
|
|
8
|
+
s,
|
|
9
|
+
{
|
|
10
|
+
ref: a,
|
|
11
|
+
"data-theme": r,
|
|
12
|
+
className: c(
|
|
13
|
+
"text-slate-800",
|
|
14
|
+
"dark:text-metal-50",
|
|
15
|
+
f({
|
|
16
|
+
className: o,
|
|
17
|
+
variant: t
|
|
18
|
+
})
|
|
19
|
+
),
|
|
20
|
+
...m,
|
|
21
|
+
children: p
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
d.displayName = "KonstructTypography";
|
|
28
26
|
export {
|
|
29
27
|
d as Typography
|
|
30
28
|
};
|
|
@@ -3,7 +3,7 @@ const a = t([], {
|
|
|
3
3
|
variants: {
|
|
4
4
|
variant: {
|
|
5
5
|
h1: ["text-[57px]", "leading-16"],
|
|
6
|
-
h2: ["text-[45px]", "leading-
|
|
6
|
+
h2: ["text-[45px]", "leading-13"],
|
|
7
7
|
h3: ["text-4xl", "leading-11"],
|
|
8
8
|
h4: ["text-[32px]", "leading-10"],
|
|
9
9
|
h5: ["text-[28px]", "leading-9"],
|
|
@@ -40,7 +40,7 @@ const a = t([], {
|
|
|
40
40
|
body1: ["text-base", "leading-6", "tracking-[0.5px]"],
|
|
41
41
|
body2: ["text-sm", "leading-5", "tracking-[0.25px]"],
|
|
42
42
|
body3: ["text-xs", "leading-4", "tracking-[0.4px]"],
|
|
43
|
-
tooltip: ["text-sm", "leading-
|
|
43
|
+
tooltip: ["text-sm", "leading-5.5"]
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
defaultVariants: {
|