@konstructio/ui 0.0.12-alpha.9 → 0.0.13-alpha.1
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/{Modal-B-E9uaA6.js → Modal-i7eolhYH.js} +311 -307
- package/dist/components/Alert/Alert.js +24 -29
- package/dist/components/Alert/Alert.variants.js +9 -15
- package/dist/components/AlertDialog/AlertDialog.js +59 -46
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +2 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +76 -72
- package/dist/components/Autocomplete/Autocomplete.variants.js +11 -20
- package/dist/components/Autocomplete/components/List/List.js +28 -30
- package/dist/components/Autocomplete/components/List/List.variants.js +34 -40
- package/dist/components/Breadcrumb/Breadcrumb.js +47 -56
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +6 -26
- package/dist/components/Breadcrumb/components/Item/Item.js +29 -41
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +2 -20
- package/dist/components/Button/Button.js +33 -37
- package/dist/components/Button/Button.variants.js +138 -195
- package/dist/components/Card/Card.js +32 -37
- package/dist/components/Card/Card.variants.js +18 -53
- package/dist/components/Checkbox/Checkbox.js +65 -68
- package/dist/components/Checkbox/Checkbox.variants.js +11 -35
- package/dist/components/Command/Command.js +33 -25
- package/dist/components/Command/Command.variants.js +47 -94
- 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 +8 -8
- package/dist/components/Divider/Divider.js +3 -2
- package/dist/components/Divider/Divider.variants.js +12 -9
- package/dist/components/Dropdown/Dropdown.js +6 -6
- package/dist/components/Dropdown/Dropdown.variants.js +31 -38
- package/dist/components/Dropdown/components/List/List.js +17 -15
- package/dist/components/Dropdown/components/List/List.variants.js +22 -32
- package/dist/components/Dropdown/components/ListItem/ListItem.js +20 -19
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +18 -30
- package/dist/components/Dropdown/components/Wrapper.js +127 -90
- package/dist/components/Dropdown/contexts/dropdown.context.js +1 -1
- package/dist/components/Dropdown/contexts/dropdown.provider.js +9 -9
- package/dist/components/Input/Input.js +37 -37
- package/dist/components/Input/Input.variants.js +8 -13
- package/dist/components/Loading/Loading.js +60 -58
- package/dist/components/Loading/Loading.variants.js +9 -15
- 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 +2 -2
- package/dist/components/Modal/components/Header/Header.js +3 -3
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -4
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +32 -46
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +93 -111
- package/dist/components/NumberInput/NumberInput.variants.js +30 -51
- package/dist/components/ProgressBar/ProgressBar.js +25 -29
- package/dist/components/ProgressBar/ProgressBar.variants.js +10 -31
- package/dist/components/Radio/Radio.js +45 -46
- package/dist/components/Radio/Radio.variants.js +4 -13
- package/dist/components/RadioCard/RadioCard.js +31 -37
- package/dist/components/RadioCard/RadioCard.variants.js +8 -17
- package/dist/components/RadioCardGroup/RadioCardGroup.js +22 -23
- package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +3 -9
- package/dist/components/RadioGroup/RadioGroup.js +30 -31
- package/dist/components/RadioGroup/RadioGroup.variants.js +2 -8
- package/dist/components/Range/Range.js +28 -34
- package/dist/components/Range/Range.variants.js +21 -53
- package/dist/components/Sidebar/Sidebar.js +12 -13
- package/dist/components/Sidebar/Sidebar.variants.js +30 -56
- package/dist/components/Sidebar/components/Footer/Footer.js +5 -17
- package/dist/components/Sidebar/components/Footer/Footer.variants.js +9 -16
- package/dist/components/Sidebar/components/Logo/Logo.js +5 -15
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +20 -36
- package/dist/components/Sidebar/components/Navigation/Navigation.js +15 -28
- package/dist/components/Sidebar/components/Navigation/Navigation.variants.js +3 -17
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +21 -34
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +2 -13
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +21 -27
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +7 -17
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +7 -19
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +6 -16
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +8 -21
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +11 -20
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +41 -44
- package/dist/components/Slider/Slider.js +26 -27
- package/dist/components/Slider/Slider.variants.js +22 -34
- package/dist/components/Switch/Switch.js +103 -106
- package/dist/components/Switch/Switch.variants.js +28 -53
- package/dist/components/Table/Table.js +27 -0
- package/dist/components/Table/Table.variants.js +40 -0
- package/dist/components/Table/components/Body.js +18 -0
- package/dist/components/Table/components/Filter.js +9 -0
- package/dist/components/Table/components/Head.js +18 -0
- package/dist/components/Table/components/Row.js +28 -0
- package/dist/components/Table/components/index.js +10 -0
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagSelect/TagSelect.variants.js +23 -55
- package/dist/components/TagSelect/components/Item/Item.js +12 -14
- package/dist/components/TagSelect/components/Item/Item.variants.js +11 -10
- package/dist/components/TagSelect/components/List/List.js +9 -10
- package/dist/components/TagSelect/components/List/List.variants.js +21 -35
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +46 -48
- package/dist/components/TextArea/TextArea.js +20 -23
- package/dist/components/TextArea/TextArea.variants.js +19 -31
- package/dist/components/Toast/Toast.js +110 -116
- package/dist/components/Toast/Toast.variants.js +42 -70
- package/dist/components/Tooltip/Tooltip.js +21 -27
- package/dist/components/Tooltip/Tooltip.variants.js +61 -62
- package/dist/components/Typography/Typography.js +23 -19
- package/dist/components/Typography/Typography.variants.js +1 -7
- package/dist/components/index.js +22 -20
- package/dist/contexts/theme.provider.js +37 -39
- package/dist/domain/theme.js +0 -0
- package/dist/index-AM3avohj.js +133 -0
- package/dist/{index-BzaHYXkt.js → index-BOx5P4tS.js} +5 -5
- package/dist/index-Bk324h27.js +82 -0
- package/dist/{index-4ecjw_Aj.js → index-Bry5AFQ2.js} +1 -1
- package/dist/{index-CbTU3cnP.js → index-CWKdynYu.js} +1 -1
- package/dist/index-D9BbbgUq.js +47 -0
- package/dist/{index-DyKo5ZJT.js → index-DvFiic6N.js} +45 -45
- package/dist/{index-Dj1pom3_.js → index-G_6jG4Qc.js} +2 -2
- package/dist/{index-D_76wh4w.js → index-YaQrdkGE.js} +3 -3
- package/dist/{index-Cva-e5M4.js → index-bYyfdsls.js} +9 -9
- package/dist/index-dRxIWVBr.js +313 -0
- package/dist/{index-D7QNmo_D.js → index-g-TFwd6Y.js} +41 -41
- package/dist/index.d.ts +115 -98
- package/dist/index.js +30 -30
- package/dist/package.json +37 -36
- package/dist/styles.css +1 -1
- package/dist/ui/kubefirst-theme.css +296 -0
- package/dist/ui/theme.css +6 -0
- package/dist/ui/utilities.css +165 -0
- package/dist/utils/index.js +675 -424
- package/package.json +37 -36
- package/dist/components/AlertDialog/AlertDialog.variants.js +0 -15
- package/dist/index-B_6_jmOO.js +0 -68
- package/dist/index-BbsJ0VIJ.js +0 -47
- package/dist/index-CzSBQN5S.js +0 -432
- package/dist/index-DUA6Y_AE.js +0 -126
- package/dist/plugins/index.js +0 -4
- package/dist/plugins/konstruct.js +0 -118
- package/dist/plugins/utils/animation.styles.js +0 -162
- package/dist/plugins/utils/colors.js +0 -331
- package/dist/plugins/utils/index.js +0 -7
|
@@ -1,81 +1,78 @@
|
|
|
1
|
-
import { Footer as
|
|
1
|
+
import { Footer as N } from "../Footer/Footer.js";
|
|
2
2
|
import { Logo as C } from "../Logo/Logo.js";
|
|
3
3
|
import { Navigation as D } from "../Navigation/Navigation.js";
|
|
4
4
|
import "../NavigationGroup/NavigationGroup.js";
|
|
5
5
|
import "../NavigationOption/NavigationOption.js";
|
|
6
6
|
import "../NavigationSeparator/NavigationSeparator.js";
|
|
7
7
|
import "../NavigationTitle/NavigationTitle.js";
|
|
8
|
-
import { jsxs as
|
|
9
|
-
import { useRef as d, useCallback as
|
|
10
|
-
import { cn as
|
|
11
|
-
import { dragVariants as j, wrapperSiderbarVariants as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
maxWith: a = 300,
|
|
8
|
+
import { jsxs as V, jsx as b } from "react/jsx-runtime";
|
|
9
|
+
import { useRef as d, useCallback as f, useMemo as s, Children as a, isValidElement as l } from "react";
|
|
10
|
+
import { cn as y } from "../../../../utils/index.js";
|
|
11
|
+
import { dragVariants as j, wrapperSiderbarVariants as x } from "../../Sidebar.variants.js";
|
|
12
|
+
const G = ({
|
|
13
|
+
canResize: g = !0,
|
|
14
|
+
children: v,
|
|
15
|
+
maxWith: i = 300,
|
|
17
16
|
minWith: m = 240,
|
|
18
|
-
theme:
|
|
19
|
-
wrapperClassName:
|
|
17
|
+
theme: L,
|
|
18
|
+
wrapperClassName: M
|
|
20
19
|
}) => {
|
|
21
|
-
const r = d(null), u = d(null),
|
|
20
|
+
const r = d(null), u = d(null), c = d(!1), n = f(
|
|
22
21
|
(e) => {
|
|
23
|
-
if (!
|
|
22
|
+
if (!c.current) {
|
|
24
23
|
r.current && (r.current.style.opacity = "0");
|
|
25
24
|
return;
|
|
26
25
|
}
|
|
27
26
|
let o = e.clientX;
|
|
28
|
-
o < m && (o = m), o >
|
|
27
|
+
o < m && (o = m), o > i && (o = i), u.current && r.current && (u.current.style.width = `${o}px`, r.current.classList.add("opacity-100"));
|
|
29
28
|
},
|
|
30
|
-
[
|
|
31
|
-
), p =
|
|
32
|
-
|
|
33
|
-
}, [n]),
|
|
29
|
+
[i, m]
|
|
30
|
+
), p = f(() => {
|
|
31
|
+
c.current = !1, r.current && r.current.classList.remove("opacity-100"), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", p);
|
|
32
|
+
}, [n]), w = f(
|
|
34
33
|
(e) => {
|
|
35
|
-
e.preventDefault(), e.stopPropagation(),
|
|
34
|
+
e.preventDefault(), e.stopPropagation(), c.current = !0, document.addEventListener("mousemove", n), document.addEventListener("mouseup", p);
|
|
36
35
|
},
|
|
37
36
|
[n, p]
|
|
38
37
|
), t = s(
|
|
39
|
-
() =>
|
|
40
|
-
[
|
|
41
|
-
),
|
|
42
|
-
() =>
|
|
43
|
-
(e) =>
|
|
38
|
+
() => a.toArray(v),
|
|
39
|
+
[v]
|
|
40
|
+
), E = s(
|
|
41
|
+
() => a.toArray(t).find(
|
|
42
|
+
(e) => l(e) && e.type === C
|
|
44
43
|
),
|
|
45
44
|
[t]
|
|
46
|
-
),
|
|
47
|
-
() =>
|
|
48
|
-
(e) =>
|
|
45
|
+
), R = s(
|
|
46
|
+
() => a.toArray(t).find(
|
|
47
|
+
(e) => l(e) && e.type === D
|
|
49
48
|
),
|
|
50
49
|
[t]
|
|
51
|
-
),
|
|
52
|
-
() =>
|
|
53
|
-
(e) =>
|
|
50
|
+
), A = s(
|
|
51
|
+
() => a.toArray(t).find(
|
|
52
|
+
(e) => l(e) && e.type === N
|
|
54
53
|
),
|
|
55
54
|
[t]
|
|
56
55
|
);
|
|
57
|
-
return
|
|
58
|
-
c && L(c);
|
|
59
|
-
}, [L, c]), /* @__PURE__ */ T(
|
|
56
|
+
return /* @__PURE__ */ V(
|
|
60
57
|
"aside",
|
|
61
58
|
{
|
|
62
59
|
ref: u,
|
|
63
|
-
className:
|
|
64
|
-
|
|
65
|
-
className:
|
|
66
|
-
theme: g
|
|
60
|
+
className: y(
|
|
61
|
+
x({
|
|
62
|
+
className: M
|
|
67
63
|
})
|
|
68
64
|
),
|
|
65
|
+
"data-theme": L,
|
|
69
66
|
children: [
|
|
70
|
-
|
|
67
|
+
E,
|
|
68
|
+
R,
|
|
71
69
|
A,
|
|
72
|
-
|
|
73
|
-
M && /* @__PURE__ */ V(
|
|
70
|
+
g && /* @__PURE__ */ b(
|
|
74
71
|
"div",
|
|
75
72
|
{
|
|
76
73
|
ref: r,
|
|
77
|
-
className:
|
|
78
|
-
onMouseDown:
|
|
74
|
+
className: y(j()),
|
|
75
|
+
onMouseDown: w
|
|
79
76
|
}
|
|
80
77
|
)
|
|
81
78
|
]
|
|
@@ -83,5 +80,5 @@ const K = ({
|
|
|
83
80
|
);
|
|
84
81
|
};
|
|
85
82
|
export {
|
|
86
|
-
|
|
83
|
+
G as Wrapper
|
|
87
84
|
};
|
|
@@ -1,44 +1,43 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
2
|
-
import { R as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { trackVariants as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
(N) => d(N),
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { R as x, T as N, b as v } from "../../index-BOx5P4tS.js";
|
|
3
|
+
import { forwardRef as V, useRef as b, useState as R, useImperativeHandle as g, useEffect as j, useCallback as k } from "react";
|
|
4
|
+
import { cn as r } from "../../utils/index.js";
|
|
5
|
+
import { trackVariants as w, thumbVariants as y, sliderVariants as C } from "./Slider.variants.js";
|
|
6
|
+
const q = V(
|
|
7
|
+
({ label: s, defaultValue: c = [0], name: i, theme: u, size: n, showValue: m, ...o }, f) => {
|
|
8
|
+
const e = b(null), [t, d] = R(c);
|
|
9
|
+
g(f, () => e.current, [e]), j(() => {
|
|
10
|
+
e.current && (e.current.value = t.toString());
|
|
11
|
+
}, [t]);
|
|
12
|
+
const h = k(
|
|
13
|
+
(p) => d(p),
|
|
15
14
|
[]
|
|
16
15
|
);
|
|
17
|
-
return /* @__PURE__ */ l("div", { className: "w-full relative flex flex-col gap-3", children: [
|
|
16
|
+
return /* @__PURE__ */ l("div", { className: "w-full relative flex flex-col gap-3", "data-theme": u, children: [
|
|
18
17
|
/* @__PURE__ */ l(
|
|
19
18
|
"div",
|
|
20
19
|
{
|
|
21
|
-
className:
|
|
20
|
+
className: r(
|
|
22
21
|
"flex items-center",
|
|
23
22
|
s ? "justify-between" : "justify-end"
|
|
24
23
|
),
|
|
25
24
|
children: [
|
|
26
|
-
s ? /* @__PURE__ */
|
|
27
|
-
|
|
25
|
+
s ? /* @__PURE__ */ a("label", { children: s }) : null,
|
|
26
|
+
m ? /* @__PURE__ */ a("span", { className: "text-xs", children: t }) : null
|
|
28
27
|
]
|
|
29
28
|
}
|
|
30
29
|
),
|
|
31
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ a("input", { ref: e, name: i, className: "hidden", type: "number" }),
|
|
32
31
|
/* @__PURE__ */ l(
|
|
33
|
-
|
|
32
|
+
x,
|
|
34
33
|
{
|
|
35
|
-
value:
|
|
36
|
-
className:
|
|
37
|
-
onValueChange:
|
|
38
|
-
...
|
|
34
|
+
value: t,
|
|
35
|
+
className: r(C()),
|
|
36
|
+
onValueChange: h,
|
|
37
|
+
...o,
|
|
39
38
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ a(N, { className: r(w({ size: n })) }),
|
|
40
|
+
/* @__PURE__ */ a(v, { className: r(y({ size: n })) })
|
|
42
41
|
]
|
|
43
42
|
}
|
|
44
43
|
)
|
|
@@ -46,5 +45,5 @@ const F = b(
|
|
|
46
45
|
}
|
|
47
46
|
);
|
|
48
47
|
export {
|
|
49
|
-
|
|
48
|
+
q as Slider
|
|
50
49
|
};
|
|
@@ -1,36 +1,30 @@
|
|
|
1
1
|
import { c as e } from "../../index-BNmRGtA6.js";
|
|
2
|
-
const
|
|
3
|
-
|
|
2
|
+
const s = e([
|
|
3
|
+
"relative",
|
|
4
|
+
"flex",
|
|
5
|
+
"items-center",
|
|
6
|
+
"w-full"
|
|
7
|
+
]), a = e(
|
|
8
|
+
[
|
|
9
|
+
"relative",
|
|
10
|
+
"flex-grow",
|
|
11
|
+
"rounded-full",
|
|
12
|
+
"bg-kubefirst-secondary",
|
|
13
|
+
"colony:bg-red-500"
|
|
14
|
+
],
|
|
4
15
|
{
|
|
5
16
|
variants: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
17
|
+
size: {
|
|
18
|
+
sm: ["h-1"],
|
|
19
|
+
md: ["h-2"],
|
|
20
|
+
lg: ["h-3"]
|
|
10
21
|
}
|
|
11
22
|
},
|
|
12
23
|
defaultVariants: {
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
), i = e(["relative", "flex-grow", "rounded-full"], {
|
|
17
|
-
variants: {
|
|
18
|
-
theme: {
|
|
19
|
-
kubefirst: ["bg-kubefirst-secondary"],
|
|
20
|
-
colony: ["bg-red-500"],
|
|
21
|
-
civo: ""
|
|
22
|
-
},
|
|
23
|
-
size: {
|
|
24
|
-
sm: ["h-1"],
|
|
25
|
-
md: ["h-2"],
|
|
26
|
-
lg: ["h-3"]
|
|
24
|
+
size: "md"
|
|
27
25
|
}
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
theme: "kubefirst",
|
|
31
|
-
size: "md"
|
|
32
26
|
}
|
|
33
|
-
|
|
27
|
+
), t = e(
|
|
34
28
|
[
|
|
35
29
|
"block",
|
|
36
30
|
"w-5",
|
|
@@ -45,11 +39,6 @@ const r = e(
|
|
|
45
39
|
],
|
|
46
40
|
{
|
|
47
41
|
variants: {
|
|
48
|
-
theme: {
|
|
49
|
-
kubefirst: "",
|
|
50
|
-
colony: "",
|
|
51
|
-
civo: ""
|
|
52
|
-
},
|
|
53
42
|
size: {
|
|
54
43
|
sm: ["w-5", "h-5"],
|
|
55
44
|
md: ["w-6", "h-6"],
|
|
@@ -57,13 +46,12 @@ const r = e(
|
|
|
57
46
|
}
|
|
58
47
|
},
|
|
59
48
|
defaultVariants: {
|
|
60
|
-
theme: "kubefirst",
|
|
61
49
|
size: "md"
|
|
62
50
|
}
|
|
63
51
|
}
|
|
64
52
|
);
|
|
65
53
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
s as sliderVariants,
|
|
55
|
+
t as thumbVariants,
|
|
56
|
+
a as trackVariants
|
|
69
57
|
};
|
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as _,
|
|
4
|
-
import { a as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import { P
|
|
8
|
-
import { cn as
|
|
9
|
-
import { thumbVariants as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(e, s) => {
|
|
1
|
+
import { jsxs as x, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import * as h from "react";
|
|
3
|
+
import { forwardRef as _, useRef as H, useId as M, useImperativeHandle as $, useEffect as j } from "react";
|
|
4
|
+
import { a as z, c as B, b as q } from "../../index-bYyfdsls.js";
|
|
5
|
+
import { u as A } from "../../index-Bk324h27.js";
|
|
6
|
+
import { u as F, a as O } from "../../index-Bry5AFQ2.js";
|
|
7
|
+
import { P } from "../../index-g-TFwd6Y.js";
|
|
8
|
+
import { cn as C } from "../../utils/index.js";
|
|
9
|
+
import { thumbVariants as V, switchVariants as D } from "./Switch.variants.js";
|
|
10
|
+
var k = "Switch", [L, ce] = B(k), [U, W] = L(k), R = h.forwardRef(
|
|
11
|
+
(e, u) => {
|
|
13
12
|
const {
|
|
14
13
|
__scopeSwitch: t,
|
|
15
|
-
name:
|
|
16
|
-
checked:
|
|
17
|
-
defaultChecked:
|
|
18
|
-
required:
|
|
19
|
-
disabled:
|
|
20
|
-
value:
|
|
21
|
-
onCheckedChange:
|
|
22
|
-
form:
|
|
23
|
-
...
|
|
24
|
-
} = e, [
|
|
25
|
-
prop:
|
|
26
|
-
defaultProp:
|
|
27
|
-
onChange:
|
|
14
|
+
name: s,
|
|
15
|
+
checked: a,
|
|
16
|
+
defaultChecked: n,
|
|
17
|
+
required: l,
|
|
18
|
+
disabled: r,
|
|
19
|
+
value: o = "on",
|
|
20
|
+
onCheckedChange: f,
|
|
21
|
+
form: c,
|
|
22
|
+
...p
|
|
23
|
+
} = e, [i, w] = h.useState(null), g = A(u, (b) => w(b)), v = h.useRef(!1), S = i ? c || !!i.closest("form") : !0, [m = !1, I] = z({
|
|
24
|
+
prop: a,
|
|
25
|
+
defaultProp: n,
|
|
26
|
+
onChange: f
|
|
28
27
|
});
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
28
|
+
return /* @__PURE__ */ x(U, { scope: t, checked: m, disabled: r, children: [
|
|
29
|
+
/* @__PURE__ */ d(
|
|
30
|
+
P.button,
|
|
32
31
|
{
|
|
33
32
|
type: "button",
|
|
34
33
|
role: "switch",
|
|
35
|
-
"aria-checked":
|
|
36
|
-
"aria-required":
|
|
37
|
-
"data-state": E(
|
|
38
|
-
"data-disabled":
|
|
39
|
-
disabled:
|
|
40
|
-
value:
|
|
41
|
-
...
|
|
42
|
-
ref:
|
|
43
|
-
onClick:
|
|
44
|
-
|
|
34
|
+
"aria-checked": m,
|
|
35
|
+
"aria-required": l,
|
|
36
|
+
"data-state": E(m),
|
|
37
|
+
"data-disabled": r ? "" : void 0,
|
|
38
|
+
disabled: r,
|
|
39
|
+
value: o,
|
|
40
|
+
...p,
|
|
41
|
+
ref: g,
|
|
42
|
+
onClick: q(e.onClick, (b) => {
|
|
43
|
+
I((T) => !T), S && (v.current = b.isPropagationStopped(), v.current || b.stopPropagation());
|
|
45
44
|
})
|
|
46
45
|
}
|
|
47
46
|
),
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
S && /* @__PURE__ */ d(
|
|
48
|
+
X,
|
|
50
49
|
{
|
|
51
|
-
control:
|
|
52
|
-
bubbles: !
|
|
53
|
-
name:
|
|
54
|
-
value:
|
|
55
|
-
checked:
|
|
56
|
-
required:
|
|
57
|
-
disabled:
|
|
58
|
-
form:
|
|
50
|
+
control: i,
|
|
51
|
+
bubbles: !v.current,
|
|
52
|
+
name: s,
|
|
53
|
+
value: o,
|
|
54
|
+
checked: m,
|
|
55
|
+
required: l,
|
|
56
|
+
disabled: r,
|
|
57
|
+
form: c,
|
|
59
58
|
style: { transform: "translateX(-100%)" }
|
|
60
59
|
}
|
|
61
60
|
)
|
|
@@ -63,41 +62,41 @@ var k = "Switch", [X, ie] = q(k), [G, J] = X(k), R = p.forwardRef(
|
|
|
63
62
|
}
|
|
64
63
|
);
|
|
65
64
|
R.displayName = k;
|
|
66
|
-
var y = "SwitchThumb", N =
|
|
67
|
-
(e,
|
|
68
|
-
const { __scopeSwitch: t, ...
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
|
|
65
|
+
var y = "SwitchThumb", N = h.forwardRef(
|
|
66
|
+
(e, u) => {
|
|
67
|
+
const { __scopeSwitch: t, ...s } = e, a = W(y, t);
|
|
68
|
+
return /* @__PURE__ */ d(
|
|
69
|
+
P.span,
|
|
71
70
|
{
|
|
72
|
-
"data-state": E(
|
|
73
|
-
"data-disabled":
|
|
74
|
-
...
|
|
75
|
-
ref:
|
|
71
|
+
"data-state": E(a.checked),
|
|
72
|
+
"data-disabled": a.disabled ? "" : void 0,
|
|
73
|
+
...s,
|
|
74
|
+
ref: u
|
|
76
75
|
}
|
|
77
76
|
);
|
|
78
77
|
}
|
|
79
78
|
);
|
|
80
79
|
N.displayName = y;
|
|
81
|
-
var
|
|
82
|
-
const { control:
|
|
83
|
-
return
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
|
|
80
|
+
var X = (e) => {
|
|
81
|
+
const { control: u, checked: t, bubbles: s = !0, ...a } = e, n = h.useRef(null), l = F(t), r = O(u);
|
|
82
|
+
return h.useEffect(() => {
|
|
83
|
+
const o = n.current, f = window.HTMLInputElement.prototype, p = Object.getOwnPropertyDescriptor(f, "checked").set;
|
|
84
|
+
if (l !== t && p) {
|
|
85
|
+
const i = new Event("click", { bubbles: s });
|
|
86
|
+
p.call(o, t), o.dispatchEvent(i);
|
|
88
87
|
}
|
|
89
|
-
}, [
|
|
88
|
+
}, [l, t, s]), /* @__PURE__ */ d(
|
|
90
89
|
"input",
|
|
91
90
|
{
|
|
92
91
|
type: "checkbox",
|
|
93
92
|
"aria-hidden": !0,
|
|
94
93
|
defaultChecked: t,
|
|
95
|
-
...
|
|
94
|
+
...a,
|
|
96
95
|
tabIndex: -1,
|
|
97
|
-
ref:
|
|
96
|
+
ref: n,
|
|
98
97
|
style: {
|
|
99
98
|
...e.style,
|
|
100
|
-
...
|
|
99
|
+
...r,
|
|
101
100
|
position: "absolute",
|
|
102
101
|
pointerEvents: "none",
|
|
103
102
|
opacity: 0,
|
|
@@ -109,65 +108,63 @@ var K = (e) => {
|
|
|
109
108
|
function E(e) {
|
|
110
109
|
return e ? "checked" : "unchecked";
|
|
111
110
|
}
|
|
112
|
-
var
|
|
113
|
-
const
|
|
111
|
+
var G = R, J = N;
|
|
112
|
+
const se = _(
|
|
114
113
|
({
|
|
115
114
|
name: e,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
[]
|
|
130
|
-
);
|
|
131
|
-
return /* @__PURE__ */ P(
|
|
115
|
+
alignment: u = "horizontal",
|
|
116
|
+
theme: t,
|
|
117
|
+
thumbClassName: s,
|
|
118
|
+
className: a,
|
|
119
|
+
label: n,
|
|
120
|
+
defaultChecked: l,
|
|
121
|
+
onChange: r,
|
|
122
|
+
value: o
|
|
123
|
+
}, f) => {
|
|
124
|
+
const c = H(null), p = M(), i = e ? `${p}-${e}` : p;
|
|
125
|
+
return $(f, () => c.current, [c]), j(() => {
|
|
126
|
+
c.current && (c.current.value = `${o}`);
|
|
127
|
+
}, [o]), /* @__PURE__ */ x(
|
|
132
128
|
"div",
|
|
133
129
|
{
|
|
134
|
-
className:
|
|
130
|
+
className: C(
|
|
135
131
|
"w-full flex gap-3",
|
|
136
|
-
|
|
132
|
+
u === "vertical" ? "flex-col" : "flex-row"
|
|
137
133
|
),
|
|
134
|
+
"data-theme": t,
|
|
138
135
|
children: [
|
|
139
|
-
|
|
136
|
+
n ? /* @__PURE__ */ d(
|
|
140
137
|
"label",
|
|
141
138
|
{
|
|
142
139
|
className: "text-base",
|
|
143
|
-
htmlFor:
|
|
140
|
+
htmlFor: i,
|
|
144
141
|
style: { paddingRight: 15 },
|
|
145
|
-
children:
|
|
142
|
+
children: n
|
|
146
143
|
}
|
|
147
144
|
) : null,
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
|
|
145
|
+
/* @__PURE__ */ d(
|
|
146
|
+
G,
|
|
150
147
|
{
|
|
151
|
-
id:
|
|
152
|
-
defaultChecked:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
148
|
+
id: i,
|
|
149
|
+
defaultChecked: l,
|
|
150
|
+
checked: o,
|
|
151
|
+
onCheckedChange: (w) => r == null ? void 0 : r(w),
|
|
152
|
+
className: C(D({ className: a })),
|
|
153
|
+
"aria-label": n,
|
|
154
|
+
children: /* @__PURE__ */ d(
|
|
155
|
+
J,
|
|
158
156
|
{
|
|
159
|
-
className:
|
|
160
|
-
|
|
161
|
-
className: n
|
|
157
|
+
className: V({
|
|
158
|
+
className: s
|
|
162
159
|
})
|
|
163
160
|
}
|
|
164
161
|
)
|
|
165
162
|
}
|
|
166
163
|
),
|
|
167
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ d(
|
|
168
165
|
"input",
|
|
169
166
|
{
|
|
170
|
-
ref:
|
|
167
|
+
ref: c,
|
|
171
168
|
name: e,
|
|
172
169
|
type: "text",
|
|
173
170
|
className: "hidden",
|
|
@@ -180,5 +177,5 @@ const ue = _(
|
|
|
180
177
|
}
|
|
181
178
|
);
|
|
182
179
|
export {
|
|
183
|
-
|
|
180
|
+
se as Switch
|
|
184
181
|
};
|
|
@@ -1,57 +1,32 @@
|
|
|
1
1
|
import { c as t } from "../../index-BNmRGtA6.js";
|
|
2
|
-
const e = t(
|
|
3
|
-
[
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"block",
|
|
31
|
-
"w-6",
|
|
32
|
-
"h-6",
|
|
33
|
-
"bg-white",
|
|
34
|
-
"rounded-full",
|
|
35
|
-
"shadow-md",
|
|
36
|
-
"transition-all",
|
|
37
|
-
"translate-x-1",
|
|
38
|
-
"data-[state=checked]:translate-x-5",
|
|
39
|
-
"delay-10",
|
|
40
|
-
"duration-300"
|
|
41
|
-
],
|
|
42
|
-
{
|
|
43
|
-
variants: {
|
|
44
|
-
theme: {
|
|
45
|
-
kubefirst: "",
|
|
46
|
-
colony: "",
|
|
47
|
-
civo: ""
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
defaultVariants: {
|
|
51
|
-
theme: "kubefirst"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
);
|
|
2
|
+
const e = t([
|
|
3
|
+
"w-[44px]",
|
|
4
|
+
"h-[22px]",
|
|
5
|
+
"flex",
|
|
6
|
+
"items-center",
|
|
7
|
+
"rounded-full",
|
|
8
|
+
"shadow",
|
|
9
|
+
"focus:shadow-md",
|
|
10
|
+
"data-[state=unchecked]:bg-zinc-200",
|
|
11
|
+
"transition-all",
|
|
12
|
+
"delay-10",
|
|
13
|
+
"duration-250",
|
|
14
|
+
"cursor-pointer",
|
|
15
|
+
"bg-kubefirst-primary",
|
|
16
|
+
"colony:bg-red-600"
|
|
17
|
+
]), r = t([
|
|
18
|
+
"block",
|
|
19
|
+
"w-[18px]",
|
|
20
|
+
"h-[18px]",
|
|
21
|
+
"bg-white",
|
|
22
|
+
"rounded-full",
|
|
23
|
+
"shadow-md",
|
|
24
|
+
"transition-all",
|
|
25
|
+
"translate-x-1",
|
|
26
|
+
"data-[state=checked]:translate-x-5.5",
|
|
27
|
+
"delay-10",
|
|
28
|
+
"duration-300"
|
|
29
|
+
]);
|
|
55
30
|
export {
|
|
56
31
|
e as switchVariants,
|
|
57
32
|
r as thumbVariants
|