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