@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,33 +1,21 @@
1
- import { c as e } from "../../index-BNmRGtA6.js";
2
- const i = e(
3
- [
4
- "border",
5
- "border-gray-200",
6
- "disabled:cursor-not-allowed",
7
- "disabled:opacity-50",
8
- "focus-visible:outline-none",
9
- "focus-visible:ring-1",
10
- "focus-visible:ring-ring",
11
- "p-2",
12
- "placeholder:text-gray-300",
13
- "resize-none",
14
- "rounded-md",
15
- "shadow-sm",
16
- "w-full"
17
- ],
18
- {
19
- variants: {
20
- theme: {
21
- colony: "focus:ring-red-700",
22
- kubefirst: "focus:ring-kubefirst-primary",
23
- civo: ""
24
- }
25
- },
26
- defaultVariants: {
27
- theme: "kubefirst"
28
- }
29
- }
30
- );
1
+ import { c as r } from "../../index-BNmRGtA6.js";
2
+ const e = r([
3
+ "border",
4
+ "border-gray-200",
5
+ "disabled:cursor-not-allowed",
6
+ "disabled:opacity-50",
7
+ "focus-visible:outline-none",
8
+ "focus-visible:ring-1",
9
+ "focus-visible:ring-ring",
10
+ "p-2",
11
+ "placeholder:text-gray-300",
12
+ "resize-none",
13
+ "rounded-md",
14
+ "shadow-xs",
15
+ "w-full",
16
+ "focus:ring-kubefirst-primary",
17
+ "colony:focus:ring-red-700"
18
+ ]);
31
19
  export {
32
- i as textAreaVariants
20
+ e as textAreaVariants
33
21
  };
@@ -1,18 +1,17 @@
1
1
  import { jsx as c, jsxs as D, Fragment as se } from "react/jsx-runtime";
2
- import { u as ae, S as j } from "../../index-B_6_jmOO.js";
2
+ import { u as ae, S as j } from "../../index-Bk324h27.js";
3
3
  import * as s from "react";
4
4
  import { useRef as Re, useEffect as be, useMemo as oe, isValidElement as re, useCallback as ge } from "react";
5
- import { P as L, r as Se, d as Ie } from "../../index-D7QNmo_D.js";
6
- import { c as Ne, a as Ae, b, d as X, u as Fe } from "../../index-Cva-e5M4.js";
7
- import { c as _e } from "../../index-BbsJ0VIJ.js";
8
- import { B as De, R as Le, P as Me } from "../../index-D_76wh4w.js";
9
- import { P as Oe } from "../../index-Dj1pom3_.js";
10
- import { V as ie, R as ke } from "../../index-CbTU3cnP.js";
5
+ import { P as L, r as Se, d as Ie } from "../../index-g-TFwd6Y.js";
6
+ import { c as Ne, a as Ae, b, d as X, u as Fe } from "../../index-bYyfdsls.js";
7
+ import { c as _e } from "../../index-D9BbbgUq.js";
8
+ import { B as De, R as Le, P as Me } from "../../index-YaQrdkGE.js";
9
+ import { P as Oe } from "../../index-G_6jG4Qc.js";
10
+ import { V as ie, R as ke } from "../../index-CWKdynYu.js";
11
11
  import { cn as q } from "../../utils/index.js";
12
12
  import { closeToastVariants as Ve, toastVariants as Ke, viewportToastVariants as He } from "./Toast.variants.js";
13
13
  import { X as We } from "../../x-DU-Zw-L_.js";
14
- import { useTheme as Xe } from "../../contexts/theme.hook.js";
15
- var Z = "ToastProvider", [ee, $e, Ue] = _e("Toast"), [ce, bt] = Ne("Toast", [Ue]), [Ye, $] = ce(Z), ue = (e) => {
14
+ var Z = "ToastProvider", [ee, Xe, $e] = _e("Toast"), [ce, xt] = Ne("Toast", [$e]), [Ue, $] = ce(Z), ue = (e) => {
16
15
  const {
17
16
  __scopeToast: r,
18
17
  label: o = "Notification",
@@ -20,11 +19,11 @@ var Z = "ToastProvider", [ee, $e, Ue] = _e("Toast"), [ce, bt] = Ne("Toast", [Ue]
20
19
  swipeDirection: u = "right",
21
20
  swipeThreshold: d = 50,
22
21
  children: f
23
- } = e, [m, v] = s.useState(null), [n, y] = s.useState(0), w = s.useRef(!1), S = s.useRef(!1);
22
+ } = e, [m, v] = s.useState(null), [n, h] = s.useState(0), w = s.useRef(!1), S = s.useRef(!1);
24
23
  return o.trim() || console.error(
25
24
  `Invalid prop \`label\` supplied to \`${Z}\`. Expected non-empty \`string\`.`
26
25
  ), /* @__PURE__ */ c(ee.Provider, { scope: r, children: /* @__PURE__ */ c(
27
- Ye,
26
+ Ue,
28
27
  {
29
28
  scope: r,
30
29
  label: o,
@@ -34,8 +33,8 @@ var Z = "ToastProvider", [ee, $e, Ue] = _e("Toast"), [ce, bt] = Ne("Toast", [Ue]
34
33
  toastCount: n,
35
34
  viewport: m,
36
35
  onViewportChange: v,
37
- onToastAdd: s.useCallback(() => y((g) => g + 1), []),
38
- onToastRemove: s.useCallback(() => y((g) => g - 1), []),
36
+ onToastAdd: s.useCallback(() => h((g) => g + 1), []),
37
+ onToastRemove: s.useCallback(() => h((g) => g - 1), []),
39
38
  isFocusedToastEscapeKeyDownRef: w,
40
39
  isClosePausedRef: S,
41
40
  children: f
@@ -43,70 +42,70 @@ var Z = "ToastProvider", [ee, $e, Ue] = _e("Toast"), [ce, bt] = Ne("Toast", [Ue]
43
42
  ) });
44
43
  };
45
44
  ue.displayName = Z;
46
- var le = "ToastViewport", Be = ["F8"], G = "toast.viewportPause", J = "toast.viewportResume", de = s.forwardRef(
45
+ var le = "ToastViewport", Ye = ["F8"], G = "toast.viewportPause", J = "toast.viewportResume", de = s.forwardRef(
47
46
  (e, r) => {
48
47
  const {
49
48
  __scopeToast: o,
50
- hotkey: t = Be,
49
+ hotkey: t = Ye,
51
50
  label: u = "Notifications ({hotkey})",
52
51
  ...d
53
- } = e, f = $(le, o), m = $e(o), v = s.useRef(null), n = s.useRef(null), y = s.useRef(null), w = s.useRef(null), S = ae(r, w, f.onViewportChange), g = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = f.toastCount > 0;
52
+ } = e, f = $(le, o), m = Xe(o), v = s.useRef(null), n = s.useRef(null), h = s.useRef(null), w = s.useRef(null), S = ae(r, w, f.onViewportChange), g = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = f.toastCount > 0;
54
53
  s.useEffect(() => {
55
- const a = (h) => {
54
+ const i = (C) => {
56
55
  var T;
57
- t.length !== 0 && t.every((E) => h[E] || h.code === E) && ((T = w.current) == null || T.focus());
56
+ t.length !== 0 && t.every((E) => C[E] || C.code === E) && ((T = w.current) == null || T.focus());
58
57
  };
59
- return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
58
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
60
59
  }, [t]), s.useEffect(() => {
61
- const a = v.current, h = w.current;
62
- if (R && a && h) {
60
+ const i = v.current, C = w.current;
61
+ if (R && i && C) {
63
62
  const p = () => {
64
63
  if (!f.isClosePausedRef.current) {
65
64
  const P = new CustomEvent(G);
66
- h.dispatchEvent(P), f.isClosePausedRef.current = !0;
65
+ C.dispatchEvent(P), f.isClosePausedRef.current = !0;
67
66
  }
68
67
  }, T = () => {
69
68
  if (f.isClosePausedRef.current) {
70
69
  const P = new CustomEvent(J);
71
- h.dispatchEvent(P), f.isClosePausedRef.current = !1;
70
+ C.dispatchEvent(P), f.isClosePausedRef.current = !1;
72
71
  }
73
72
  }, E = (P) => {
74
- !a.contains(P.relatedTarget) && T();
75
- }, C = () => {
76
- a.contains(document.activeElement) || T();
73
+ !i.contains(P.relatedTarget) && T();
74
+ }, y = () => {
75
+ i.contains(document.activeElement) || T();
77
76
  };
78
- return a.addEventListener("focusin", p), a.addEventListener("focusout", E), a.addEventListener("pointermove", p), a.addEventListener("pointerleave", C), window.addEventListener("blur", p), window.addEventListener("focus", T), () => {
79
- a.removeEventListener("focusin", p), a.removeEventListener("focusout", E), a.removeEventListener("pointermove", p), a.removeEventListener("pointerleave", C), window.removeEventListener("blur", p), window.removeEventListener("focus", T);
77
+ return i.addEventListener("focusin", p), i.addEventListener("focusout", E), i.addEventListener("pointermove", p), i.addEventListener("pointerleave", y), window.addEventListener("blur", p), window.addEventListener("focus", T), () => {
78
+ i.removeEventListener("focusin", p), i.removeEventListener("focusout", E), i.removeEventListener("pointermove", p), i.removeEventListener("pointerleave", y), window.removeEventListener("blur", p), window.removeEventListener("focus", T);
80
79
  };
81
80
  }
82
81
  }, [R, f.isClosePausedRef]);
83
82
  const l = s.useCallback(
84
- ({ tabbingDirection: a }) => {
83
+ ({ tabbingDirection: i }) => {
85
84
  const p = m().map((T) => {
86
- const E = T.ref.current, C = [E, ...st(E)];
87
- return a === "forwards" ? C : C.reverse();
85
+ const E = T.ref.current, y = [E, ...nt(E)];
86
+ return i === "forwards" ? y : y.reverse();
88
87
  });
89
- return (a === "forwards" ? p.reverse() : p).flat();
88
+ return (i === "forwards" ? p.reverse() : p).flat();
90
89
  },
91
90
  [m]
92
91
  );
93
92
  return s.useEffect(() => {
94
- const a = w.current;
95
- if (a) {
96
- const h = (p) => {
97
- var C, P, N;
93
+ const i = w.current;
94
+ if (i) {
95
+ const C = (p) => {
96
+ var y, P, N;
98
97
  const T = p.altKey || p.ctrlKey || p.metaKey;
99
98
  if (p.key === "Tab" && !T) {
100
99
  const M = document.activeElement, F = p.shiftKey;
101
- if (p.target === a && F) {
102
- (C = n.current) == null || C.focus();
100
+ if (p.target === i && F) {
101
+ (y = n.current) == null || y.focus();
103
102
  return;
104
103
  }
105
- const A = l({ tabbingDirection: F ? "backwards" : "forwards" }), V = A.findIndex((i) => i === M);
106
- z(A.slice(V + 1)) ? p.preventDefault() : F ? (P = n.current) == null || P.focus() : (N = y.current) == null || N.focus();
104
+ const A = l({ tabbingDirection: F ? "backwards" : "forwards" }), V = A.findIndex((a) => a === M);
105
+ z(A.slice(V + 1)) ? p.preventDefault() : F ? (P = n.current) == null || P.focus() : (N = h.current) == null || N.focus();
107
106
  }
108
107
  };
109
- return a.addEventListener("keydown", h), () => a.removeEventListener("keydown", h);
108
+ return i.addEventListener("keydown", C), () => i.removeEventListener("keydown", C);
110
109
  }
111
110
  }, [m, l]), /* @__PURE__ */ D(
112
111
  De,
@@ -122,10 +121,10 @@ var le = "ToastViewport", Be = ["F8"], G = "toast.viewportPause", J = "toast.vie
122
121
  {
123
122
  ref: n,
124
123
  onFocusFromOutsideViewport: () => {
125
- const a = l({
124
+ const i = l({
126
125
  tabbingDirection: "forwards"
127
126
  });
128
- z(a);
127
+ z(i);
129
128
  }
130
129
  }
131
130
  ),
@@ -133,12 +132,12 @@ var le = "ToastViewport", Be = ["F8"], G = "toast.viewportPause", J = "toast.vie
133
132
  R && /* @__PURE__ */ c(
134
133
  Q,
135
134
  {
136
- ref: y,
135
+ ref: h,
137
136
  onFocusFromOutsideViewport: () => {
138
- const a = l({
137
+ const i = l({
139
138
  tabbingDirection: "backwards"
140
139
  });
141
- z(a);
140
+ z(i);
142
141
  }
143
142
  }
144
143
  )
@@ -169,7 +168,7 @@ var fe = "ToastFocusProxy", Q = s.forwardRef(
169
168
  }
170
169
  );
171
170
  Q.displayName = fe;
172
- var U = "Toast", je = "toast.swipeStart", qe = "toast.swipeMove", ze = "toast.swipeCancel", Ge = "toast.swipeEnd", pe = s.forwardRef(
171
+ var U = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.swipeCancel", ze = "toast.swipeEnd", pe = s.forwardRef(
173
172
  (e, r) => {
174
173
  const { forceMount: o, open: t, defaultOpen: u, onOpenChange: d, ...f } = e, [m = !0, v] = Ae({
175
174
  prop: t,
@@ -177,7 +176,7 @@ var U = "Toast", je = "toast.swipeStart", qe = "toast.swipeMove", ze = "toast.sw
177
176
  onChange: d
178
177
  });
179
178
  return /* @__PURE__ */ c(Oe, { present: o || m, children: /* @__PURE__ */ c(
180
- Ze,
179
+ Qe,
181
180
  {
182
181
  open: m,
183
182
  ...f,
@@ -189,25 +188,25 @@ var U = "Toast", je = "toast.swipeStart", qe = "toast.swipeMove", ze = "toast.sw
189
188
  n.currentTarget.setAttribute("data-swipe", "start");
190
189
  }),
191
190
  onSwipeMove: b(e.onSwipeMove, (n) => {
192
- const { x: y, y: w } = n.detail.delta;
193
- n.currentTarget.setAttribute("data-swipe", "move"), n.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${y}px`), n.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${w}px`);
191
+ const { x: h, y: w } = n.detail.delta;
192
+ n.currentTarget.setAttribute("data-swipe", "move"), n.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${h}px`), n.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${w}px`);
194
193
  }),
195
194
  onSwipeCancel: b(e.onSwipeCancel, (n) => {
196
195
  n.currentTarget.setAttribute("data-swipe", "cancel"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), n.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
197
196
  }),
198
197
  onSwipeEnd: b(e.onSwipeEnd, (n) => {
199
- const { x: y, y: w } = n.detail.delta;
200
- n.currentTarget.setAttribute("data-swipe", "end"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), n.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${y}px`), n.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${w}px`), v(!1);
198
+ const { x: h, y: w } = n.detail.delta;
199
+ n.currentTarget.setAttribute("data-swipe", "end"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), n.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), n.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${h}px`), n.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${w}px`), v(!1);
201
200
  })
202
201
  }
203
202
  ) });
204
203
  }
205
204
  );
206
205
  pe.displayName = U;
207
- var [Je, Qe] = ce(U, {
206
+ var [Ge, Je] = ce(U, {
208
207
  onClose() {
209
208
  }
210
- }), Ze = s.forwardRef(
209
+ }), Qe = s.forwardRef(
211
210
  (e, r) => {
212
211
  const {
213
212
  __scopeToast: o,
@@ -218,40 +217,40 @@ var [Je, Qe] = ce(U, {
218
217
  onEscapeKeyDown: m,
219
218
  onPause: v,
220
219
  onResume: n,
221
- onSwipeStart: y,
220
+ onSwipeStart: h,
222
221
  onSwipeMove: w,
223
222
  onSwipeCancel: S,
224
223
  onSwipeEnd: g,
225
224
  ...R
226
- } = e, l = $(U, o), [a, h] = s.useState(null), p = ae(r, (i) => h(i)), T = s.useRef(null), E = s.useRef(null), C = u || l.duration, P = s.useRef(0), N = s.useRef(C), M = s.useRef(0), { onToastAdd: F, onToastRemove: Y } = l, _ = X(() => {
225
+ } = e, l = $(U, o), [i, C] = s.useState(null), p = ae(r, (a) => C(a)), T = s.useRef(null), E = s.useRef(null), y = u || l.duration, P = s.useRef(0), N = s.useRef(y), M = s.useRef(0), { onToastAdd: F, onToastRemove: Y } = l, _ = X(() => {
227
226
  var x;
228
- (a == null ? void 0 : a.contains(document.activeElement)) && ((x = l.viewport) == null || x.focus()), f();
227
+ (i == null ? void 0 : i.contains(document.activeElement)) && ((x = l.viewport) == null || x.focus()), f();
229
228
  }), A = s.useCallback(
230
- (i) => {
231
- !i || i === 1 / 0 || (window.clearTimeout(M.current), P.current = (/* @__PURE__ */ new Date()).getTime(), M.current = window.setTimeout(_, i));
229
+ (a) => {
230
+ !a || a === 1 / 0 || (window.clearTimeout(M.current), P.current = (/* @__PURE__ */ new Date()).getTime(), M.current = window.setTimeout(_, a));
232
231
  },
233
232
  [_]
234
233
  );
235
234
  s.useEffect(() => {
236
- const i = l.viewport;
237
- if (i) {
235
+ const a = l.viewport;
236
+ if (a) {
238
237
  const x = () => {
239
238
  A(N.current), n == null || n();
240
239
  }, I = () => {
241
240
  const O = (/* @__PURE__ */ new Date()).getTime() - P.current;
242
241
  N.current = N.current - O, window.clearTimeout(M.current), v == null || v();
243
242
  };
244
- return i.addEventListener(G, I), i.addEventListener(J, x), () => {
245
- i.removeEventListener(G, I), i.removeEventListener(J, x);
243
+ return a.addEventListener(G, I), a.addEventListener(J, x), () => {
244
+ a.removeEventListener(G, I), a.removeEventListener(J, x);
246
245
  };
247
246
  }
248
- }, [l.viewport, C, v, n, A]), s.useEffect(() => {
249
- d && !l.isClosePausedRef.current && A(C);
250
- }, [d, C, l.isClosePausedRef, A]), s.useEffect(() => (F(), () => Y()), [F, Y]);
251
- const V = s.useMemo(() => a ? Ce(a) : null, [a]);
247
+ }, [l.viewport, y, v, n, A]), s.useEffect(() => {
248
+ d && !l.isClosePausedRef.current && A(y);
249
+ }, [d, y, l.isClosePausedRef, A]), s.useEffect(() => (F(), () => Y()), [F, Y]);
250
+ const V = s.useMemo(() => i ? Ce(i) : null, [i]);
252
251
  return l.viewport ? /* @__PURE__ */ D(se, { children: [
253
252
  V && /* @__PURE__ */ c(
254
- et,
253
+ Ze,
255
254
  {
256
255
  __scopeToast: o,
257
256
  role: "status",
@@ -260,7 +259,7 @@ var [Je, Qe] = ce(U, {
260
259
  children: V
261
260
  }
262
261
  ),
263
- /* @__PURE__ */ c(Je, { scope: o, onClose: _, children: Se.createPortal(
262
+ /* @__PURE__ */ c(Ge, { scope: o, onClose: _, children: Se.createPortal(
264
263
  /* @__PURE__ */ c(ee.ItemSlot, { scope: o, children: /* @__PURE__ */ c(
265
264
  Le,
266
265
  {
@@ -280,29 +279,29 @@ var [Je, Qe] = ce(U, {
280
279
  ...R,
281
280
  ref: p,
282
281
  style: { userSelect: "none", touchAction: "none", ...e.style },
283
- onKeyDown: b(e.onKeyDown, (i) => {
284
- i.key === "Escape" && (m == null || m(i.nativeEvent), i.nativeEvent.defaultPrevented || (l.isFocusedToastEscapeKeyDownRef.current = !0, _()));
282
+ onKeyDown: b(e.onKeyDown, (a) => {
283
+ a.key === "Escape" && (m == null || m(a.nativeEvent), a.nativeEvent.defaultPrevented || (l.isFocusedToastEscapeKeyDownRef.current = !0, _()));
285
284
  }),
286
- onPointerDown: b(e.onPointerDown, (i) => {
287
- i.button === 0 && (T.current = { x: i.clientX, y: i.clientY });
285
+ onPointerDown: b(e.onPointerDown, (a) => {
286
+ a.button === 0 && (T.current = { x: a.clientX, y: a.clientY });
288
287
  }),
289
- onPointerMove: b(e.onPointerMove, (i) => {
288
+ onPointerMove: b(e.onPointerMove, (a) => {
290
289
  if (!T.current) return;
291
- const x = i.clientX - T.current.x, I = i.clientY - T.current.y, O = !!E.current, k = ["left", "right"].includes(l.swipeDirection), K = ["left", "up"].includes(l.swipeDirection) ? Math.min : Math.max, Pe = k ? K(0, x) : 0, xe = k ? 0 : K(0, I), B = i.pointerType === "touch" ? 10 : 2, H = { x: Pe, y: xe }, te = { originalEvent: i, delta: H };
292
- O ? (E.current = H, W(qe, w, te, {
290
+ const x = a.clientX - T.current.x, I = a.clientY - T.current.y, O = !!E.current, k = ["left", "right"].includes(l.swipeDirection), K = ["left", "up"].includes(l.swipeDirection) ? Math.min : Math.max, Pe = k ? K(0, x) : 0, xe = k ? 0 : K(0, I), B = a.pointerType === "touch" ? 10 : 2, H = { x: Pe, y: xe }, te = { originalEvent: a, delta: H };
291
+ O ? (E.current = H, W(je, w, te, {
293
292
  discrete: !1
294
- })) : ne(H, l.swipeDirection, B) ? (E.current = H, W(je, y, te, {
293
+ })) : ne(H, l.swipeDirection, B) ? (E.current = H, W(Be, h, te, {
295
294
  discrete: !1
296
- }), i.target.setPointerCapture(i.pointerId)) : (Math.abs(x) > B || Math.abs(I) > B) && (T.current = null);
295
+ }), a.target.setPointerCapture(a.pointerId)) : (Math.abs(x) > B || Math.abs(I) > B) && (T.current = null);
297
296
  }),
298
- onPointerUp: b(e.onPointerUp, (i) => {
299
- const x = E.current, I = i.target;
300
- if (I.hasPointerCapture(i.pointerId) && I.releasePointerCapture(i.pointerId), E.current = null, T.current = null, x) {
301
- const O = i.currentTarget, k = { originalEvent: i, delta: x };
302
- ne(x, l.swipeDirection, l.swipeThreshold) ? W(Ge, g, k, {
297
+ onPointerUp: b(e.onPointerUp, (a) => {
298
+ const x = E.current, I = a.target;
299
+ if (I.hasPointerCapture(a.pointerId) && I.releasePointerCapture(a.pointerId), E.current = null, T.current = null, x) {
300
+ const O = a.currentTarget, k = { originalEvent: a, delta: x };
301
+ ne(x, l.swipeDirection, l.swipeThreshold) ? W(ze, g, k, {
303
302
  discrete: !0
304
303
  }) : W(
305
- ze,
304
+ qe,
306
305
  S,
307
306
  k,
308
307
  {
@@ -321,9 +320,9 @@ var [Je, Qe] = ce(U, {
321
320
  ) })
322
321
  ] }) : null;
323
322
  }
324
- ), et = (e) => {
323
+ ), Ze = (e) => {
325
324
  const { __scopeToast: r, children: o, ...t } = e, u = $(U, r), [d, f] = s.useState(!1), [m, v] = s.useState(!1);
326
- return rt(() => f(!0)), s.useEffect(() => {
325
+ return ot(() => f(!0)), s.useEffect(() => {
327
326
  const n = window.setTimeout(() => v(!0), 1e3);
328
327
  return () => window.clearTimeout(n);
329
328
  }, []), m ? null : /* @__PURE__ */ c(Me, { asChild: !0, children: /* @__PURE__ */ c(ie, { ...t, children: d && /* @__PURE__ */ D(se, { children: [
@@ -331,20 +330,20 @@ var [Je, Qe] = ce(U, {
331
330
  " ",
332
331
  o
333
332
  ] }) }) });
334
- }, tt = "ToastTitle", me = s.forwardRef(
333
+ }, et = "ToastTitle", me = s.forwardRef(
335
334
  (e, r) => {
336
335
  const { __scopeToast: o, ...t } = e;
337
336
  return /* @__PURE__ */ c(L.div, { ...t, ref: r });
338
337
  }
339
338
  );
340
- me.displayName = tt;
341
- var ot = "ToastDescription", Te = s.forwardRef(
339
+ me.displayName = et;
340
+ var tt = "ToastDescription", Te = s.forwardRef(
342
341
  (e, r) => {
343
342
  const { __scopeToast: o, ...t } = e;
344
343
  return /* @__PURE__ */ c(L.div, { ...t, ref: r });
345
344
  }
346
345
  );
347
- Te.displayName = ot;
346
+ Te.displayName = tt;
348
347
  var ve = "ToastAction", we = s.forwardRef(
349
348
  (e, r) => {
350
349
  const { altText: o, ...t } = e;
@@ -356,7 +355,7 @@ var ve = "ToastAction", we = s.forwardRef(
356
355
  we.displayName = ve;
357
356
  var Ee = "ToastClose", he = s.forwardRef(
358
357
  (e, r) => {
359
- const { __scopeToast: o, ...t } = e, u = Qe(Ee, o);
358
+ const { __scopeToast: o, ...t } = e, u = Je(Ee, o);
360
359
  return /* @__PURE__ */ c(ye, { asChild: !0, children: /* @__PURE__ */ c(
361
360
  L.button,
362
361
  {
@@ -384,7 +383,7 @@ var ye = s.forwardRef((e, r) => {
384
383
  function Ce(e) {
385
384
  const r = [];
386
385
  return Array.from(e.childNodes).forEach((t) => {
387
- if (t.nodeType === t.TEXT_NODE && t.textContent && r.push(t.textContent), nt(t)) {
386
+ if (t.nodeType === t.TEXT_NODE && t.textContent && r.push(t.textContent), rt(t)) {
388
387
  const u = t.ariaHidden || t.hidden || t.style.display === "none", d = t.dataset.radixToastAnnounceExclude === "";
389
388
  if (!u)
390
389
  if (d) {
@@ -403,7 +402,7 @@ var ne = (e, r, o = 0) => {
403
402
  const t = Math.abs(e.x), u = Math.abs(e.y), d = t > u;
404
403
  return r === "left" || r === "right" ? d && t > o : !d && u > o;
405
404
  };
406
- function rt(e = () => {
405
+ function ot(e = () => {
407
406
  }) {
408
407
  const r = X(e);
409
408
  Fe(() => {
@@ -413,10 +412,10 @@ function rt(e = () => {
413
412
  };
414
413
  }, [r]);
415
414
  }
416
- function nt(e) {
415
+ function rt(e) {
417
416
  return e.nodeType === e.ELEMENT_NODE;
418
417
  }
419
- function st(e) {
418
+ function nt(e) {
420
419
  const r = [], o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
421
420
  acceptNode: (t) => {
422
421
  const u = t.tagName === "INPUT" && t.type === "hidden";
@@ -430,8 +429,8 @@ function z(e) {
430
429
  const r = document.activeElement;
431
430
  return e.some((o) => o === r ? !0 : (o.focus(), document.activeElement !== r));
432
431
  }
433
- var at = ue, it = de, ct = pe, ut = me, lt = Te, dt = we;
434
- const gt = ({
432
+ var st = ue, at = de, it = pe, ct = me, ut = Te, lt = we;
433
+ const Rt = ({
435
434
  title: e,
436
435
  duration: r = 5e3,
437
436
  titleClassName: o,
@@ -442,32 +441,32 @@ const gt = ({
442
441
  showCloseButton: m = !0,
443
442
  closeButtonClassName: v,
444
443
  className: n,
445
- open: y = !1,
444
+ open: h = !1,
446
445
  setOpen: w
447
446
  }) => {
448
- const S = Re(0), { theme: g } = Xe(), R = f ?? g;
447
+ const S = Re(0);
449
448
  be(() => () => clearTimeout(S.current), []);
450
- const l = oe(() => re(e) ? /* @__PURE__ */ c(j, { className: o, children: e }) : e, [e, o]), a = oe(() => re(u) ? /* @__PURE__ */ c(j, { className: t, children: u }) : u, [u, t]), h = ge(() => {
449
+ const g = oe(() => re(e) ? /* @__PURE__ */ c(j, { className: o, children: e }) : e, [e, o]), R = oe(() => re(u) ? /* @__PURE__ */ c(j, { className: t, children: u }) : u, [u, t]), l = ge(() => {
451
450
  w(!1), S.current = window.setTimeout(() => w(!0), 100);
452
451
  }, [w]);
453
- return /* @__PURE__ */ D(at, { swipeDirection: "right", duration: r, children: [
454
- /* @__PURE__ */ c(j, { onClick: h, children: d }),
452
+ return /* @__PURE__ */ D(st, { swipeDirection: "right", duration: r, children: [
453
+ /* @__PURE__ */ c(j, { onClick: l, children: d }),
455
454
  /* @__PURE__ */ D(
456
- ct,
455
+ it,
457
456
  {
458
- className: q(Ke({ theme: R, className: n })),
459
- open: y,
457
+ className: q(Ke({ className: n })),
458
+ "data-theme": f,
459
+ open: h,
460
460
  onOpenChange: w,
461
461
  children: [
462
- /* @__PURE__ */ c(ut, { asChild: !0, className: o, children: l }),
463
- a && /* @__PURE__ */ c(lt, { asChild: !0, children: a }),
464
- m && /* @__PURE__ */ c(dt, { asChild: !0, altText: "Close the toast", children: /* @__PURE__ */ D("button", { type: "button", className: "absolute right-1.5 top-1.5", children: [
462
+ /* @__PURE__ */ c(ct, { asChild: !0, className: o, children: g }),
463
+ R && /* @__PURE__ */ c(ut, { asChild: !0, children: R }),
464
+ m && /* @__PURE__ */ c(lt, { asChild: !0, altText: "Close the toast", children: /* @__PURE__ */ D("button", { type: "button", className: "absolute right-1.5 top-1.5", children: [
465
465
  /* @__PURE__ */ c(
466
466
  We,
467
467
  {
468
468
  className: q(
469
469
  Ve({
470
- theme: R,
471
470
  className: v
472
471
  })
473
472
  )
@@ -478,14 +477,9 @@ const gt = ({
478
477
  ]
479
478
  }
480
479
  ),
481
- /* @__PURE__ */ c(
482
- it,
483
- {
484
- className: q(He({ theme: R }))
485
- }
486
- )
480
+ /* @__PURE__ */ c(at, { className: q(He()) })
487
481
  ] });
488
482
  };
489
483
  export {
490
- gt as Toast
484
+ Rt as Toast
491
485
  };
@@ -1,73 +1,45 @@
1
1
  import { c as e } from "../../index-BNmRGtA6.js";
2
- const a = e(
3
- [
4
- "rounded-md",
5
- "shadow-md",
6
- "p-4",
7
- "flex",
8
- "flex-col",
9
- "relative",
10
- "border",
11
- "overflow-hidden",
12
- "data-[state=open]:animate-slide-in",
13
- "data-[state=closed]:animate-hide",
14
- "data-[swipe=move]:translate-x-4",
15
- "data-[swipe=cancel]:translate-x-0",
16
- "data-[swipe=end]:animate-swipe-out"
17
- ],
18
- {
19
- variants: {
20
- theme: {
21
- kubefirst: ["shadow-purple-200", "border-purple-100"],
22
- colony: ["shadow-red-200", "border-red-100"],
23
- civo: ""
24
- }
25
- },
26
- defaultVariants: {
27
- theme: "kubefirst"
28
- }
29
- }
30
- ), r = e(
31
- [
32
- "fixed",
33
- "bottom-0",
34
- "right-0",
35
- "flex",
36
- "flex-col",
37
- "p-[var(--viewport-padding)]",
38
- "gap-8",
39
- "w-[390px]",
40
- "max-w-[100vw]",
41
- "m-0",
42
- "z-50",
43
- "outline-none"
44
- ],
45
- {
46
- variants: {
47
- theme: {
48
- kubefirst: "",
49
- colony: "",
50
- civo: ""
51
- }
52
- },
53
- defaultVariants: {
54
- theme: "kubefirst"
55
- }
56
- }
57
- ), o = e(["top-2", "right-2", "w-4", "h-4"], {
58
- variants: {
59
- theme: {
60
- kubefirst: ["text-kubefirst-primary"],
61
- colony: ["text-red-400"],
62
- civo: ""
63
- }
64
- },
65
- defaultVariants: {
66
- theme: "kubefirst"
67
- }
68
- });
2
+ const t = e([
3
+ "rounded-md",
4
+ "shadow-md",
5
+ "p-4",
6
+ "flex",
7
+ "flex-col",
8
+ "relative",
9
+ "border",
10
+ "overflow-hidden",
11
+ "data-[state=open]:animate-slide-in",
12
+ "data-[state=closed]:animate-hide",
13
+ "data-[swipe=move]:translate-x-4",
14
+ "data-[swipe=cancel]:translate-x-0",
15
+ "data-[swipe=end]:animate-swipe-out",
16
+ "shadow-purple-200",
17
+ "border-purple-100",
18
+ "colony:shadow-red-200",
19
+ "colony:border-red-100"
20
+ ]), o = e([
21
+ "fixed",
22
+ "bottom-0",
23
+ "right-0",
24
+ "flex",
25
+ "flex-col",
26
+ "p-[var(--viewport-padding)]",
27
+ "gap-8",
28
+ "w-[390px]",
29
+ "max-w-[100vw]",
30
+ "m-0",
31
+ "z-50",
32
+ "outline-none"
33
+ ]), r = e([
34
+ "top-2",
35
+ "right-2",
36
+ "w-4",
37
+ "h-4",
38
+ "text-kubefirst-primary",
39
+ "colony:text-red-400"
40
+ ]);
69
41
  export {
70
- o as closeToastVariants,
71
- a as toastVariants,
72
- r as viewportToastVariants
42
+ r as closeToastVariants,
43
+ t as toastVariants,
44
+ o as viewportToastVariants
73
45
  };