@vhyxui/react 0.3.0-alpha → 0.4.0-alpha

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 (237) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +65 -0
  3. package/dist/Accordion-qtPur3CA.js +81 -0
  4. package/dist/Accordion-z3QDvyGf.cjs +1 -0
  5. package/dist/Alert-D4EFVKUy.js +99 -0
  6. package/dist/Alert-DWB9Gtpv.cjs +1 -0
  7. package/dist/Avatar-CDoAvY0m.js +51 -0
  8. package/dist/Avatar-afXJdutp.cjs +1 -0
  9. package/dist/Badge-DOhfKlXt.cjs +1 -0
  10. package/dist/Badge-Z6crWSLX.js +38 -0
  11. package/dist/Breadcrumb-CbPmH-b4.js +90 -0
  12. package/dist/Breadcrumb-DWRxQvbb.cjs +1 -0
  13. package/dist/Button-CnNtk6HV.cjs +1 -0
  14. package/dist/Button-DN5vy24q.js +60 -0
  15. package/dist/Card-CI7DyOJg.js +79 -0
  16. package/dist/Card-CZUQhd45.cjs +1 -0
  17. package/dist/Center-BmKeGEa1.cjs +1 -0
  18. package/dist/Center-DFq5m7mf.js +22 -0
  19. package/dist/Checkbox-D-5qaOEj.js +92 -0
  20. package/dist/Checkbox-DOd4SIx2.cjs +1 -0
  21. package/dist/Container-CcsVyA6r.cjs +1 -0
  22. package/dist/Container-DPKIgeDZ.js +21 -0
  23. package/dist/Dialog-B7Mhq9Qc.cjs +1 -0
  24. package/dist/Dialog-DhIanyWH.js +258 -0
  25. package/dist/Drawer-8maigAH9.cjs +1 -0
  26. package/dist/Drawer-BKizItfr.js +259 -0
  27. package/dist/Field-DJvjEmzE.cjs +1 -0
  28. package/dist/Field-Dx9gXxGL.js +120 -0
  29. package/dist/Grid-Bzzb0usH.cjs +1 -0
  30. package/dist/Grid-x_OHCzGV.js +25 -0
  31. package/dist/Heading-BPqfnM8i.js +14 -0
  32. package/dist/Heading-icKRWRno.cjs +1 -0
  33. package/dist/Input-B0dEXpG8.js +151 -0
  34. package/dist/Input-CdS0oZyf.cjs +1 -0
  35. package/dist/Kbd-C2vxklhy.cjs +1 -0
  36. package/dist/Kbd-DGURpjWN.js +22 -0
  37. package/dist/Pagination-CiE9Jzm0.cjs +1 -0
  38. package/dist/Pagination-UQ53MWnR.js +128 -0
  39. package/dist/{Popover-j9pNswBn.js → Popover-0QvSlzcQ.js} +53 -53
  40. package/dist/Popover-Chf2ikqa.cjs +1 -0
  41. package/dist/Progress-DdWZRQVS.js +75 -0
  42. package/dist/Progress-lItZES-D.cjs +1 -0
  43. package/dist/RadioItem-BbIH7LoA.js +141 -0
  44. package/dist/RadioItem-Cfxch4Gj.cjs +1 -0
  45. package/dist/Select-CgjfJSB8.js +350 -0
  46. package/dist/Select-D_oVKzzK.cjs +1 -0
  47. package/dist/SelectField-DBGtOECg.js +49 -0
  48. package/dist/SelectField-DdkU9fXq.cjs +1 -0
  49. package/dist/Separator-BwR51KpL.js +52 -0
  50. package/dist/Separator-CTncQd7E.cjs +1 -0
  51. package/dist/Skeleton-C1LTpmVC.js +20 -0
  52. package/dist/Skeleton-CpzYhkFp.cjs +1 -0
  53. package/dist/Spinner-BJnT9SOB.cjs +1 -0
  54. package/dist/{Spinner-BYi9eTfl.js → Spinner-Dz68qwGs.js} +25 -25
  55. package/dist/Stack--mNjuxZe.cjs +1 -0
  56. package/dist/Stack-CfwjUv0j.js +49 -0
  57. package/dist/Switch-I712svE0.cjs +1 -0
  58. package/dist/{Switch-DOAZfSV0.js → Switch-bIbcXIMH.js} +22 -22
  59. package/dist/Table-C2TUkSZv.cjs +1 -0
  60. package/dist/Table-C_jZjmPK.js +67 -0
  61. package/dist/Tabs-CbmdCTVE.js +220 -0
  62. package/dist/Tabs-Dfuu2ZVq.cjs +1 -0
  63. package/dist/Text-CgsfCbWf.cjs +1 -0
  64. package/dist/Text-Dl4z0gus.js +26 -0
  65. package/dist/Text.module-CEBydIO4.js +7 -0
  66. package/dist/Text.module-gGopk2Yk.cjs +1 -0
  67. package/dist/TextField-B492c5Ct.js +31 -0
  68. package/dist/TextField-Bp-b0-hG.cjs +1 -0
  69. package/dist/{Textarea-CLrctxHU.js → Textarea-cloHZ5Sz.js} +41 -41
  70. package/dist/Textarea-uXK6PrFb.cjs +1 -0
  71. package/dist/TextareaField-C5naVyA1.cjs +1 -0
  72. package/dist/TextareaField-CrRndsuY.js +31 -0
  73. package/dist/Toast-CESL8AKT.cjs +1 -0
  74. package/dist/Toast-DYqE0PjM.js +167 -0
  75. package/dist/Tooltip-B-PpSm6T.cjs +1 -0
  76. package/dist/{Tooltip-BAmErB_g.js → Tooltip-DCCaNX5W.js} +34 -34
  77. package/dist/VhyxUIProvider-3f3b9ukY.cjs +1 -0
  78. package/dist/VhyxUIProvider-B2UHeumk.js +58 -0
  79. package/dist/VisuallyHidden-BWdnOImJ.cjs +1 -0
  80. package/dist/VisuallyHidden-CPTxPvL_.js +18 -0
  81. package/dist/accordion.cjs +1 -0
  82. package/dist/accordion.d.ts +48 -0
  83. package/dist/accordion.js +5 -0
  84. package/dist/alert.cjs +1 -1
  85. package/dist/alert.js +3 -2
  86. package/dist/avatar.cjs +1 -0
  87. package/dist/avatar.d.ts +53 -0
  88. package/dist/avatar.js +7 -0
  89. package/dist/badge.cjs +1 -1
  90. package/dist/badge.js +2 -1
  91. package/dist/breadcrumb.cjs +1 -1
  92. package/dist/breadcrumb.js +3 -2
  93. package/dist/button.cjs +1 -1
  94. package/dist/button.js +3 -2
  95. package/dist/card.cjs +1 -1
  96. package/dist/card.js +3 -2
  97. package/dist/center.cjs +1 -0
  98. package/dist/center.d.ts +20 -0
  99. package/dist/center.js +5 -0
  100. package/dist/checkbox.cjs +1 -1
  101. package/dist/checkbox.js +3 -2
  102. package/dist/container.cjs +1 -0
  103. package/dist/container.d.ts +23 -0
  104. package/dist/container.js +5 -0
  105. package/dist/cx-OWdTFKLx.js +15 -0
  106. package/dist/cx-dgWA95G6.cjs +1 -0
  107. package/dist/dialog.cjs +1 -1
  108. package/dist/dialog.d.ts +0 -1
  109. package/dist/dialog.js +3 -2
  110. package/dist/drawer.cjs +1 -1
  111. package/dist/drawer.d.ts +0 -1
  112. package/dist/drawer.js +3 -2
  113. package/dist/env-Cqd4Y-Z7.cjs +1 -0
  114. package/dist/env-lFT_FRkA.js +19 -0
  115. package/dist/form.cjs +1 -1
  116. package/dist/form.d.ts +6 -6
  117. package/dist/form.js +5 -4
  118. package/dist/grid.cjs +1 -0
  119. package/dist/grid.d.ts +35 -0
  120. package/dist/grid.js +5 -0
  121. package/dist/heading.cjs +1 -0
  122. package/dist/heading.d.ts +25 -0
  123. package/dist/heading.js +5 -0
  124. package/dist/index.cjs +1 -1
  125. package/dist/index.d.ts +440 -20
  126. package/dist/index.js +96 -62
  127. package/dist/input.cjs +1 -1
  128. package/dist/input.js +3 -2
  129. package/dist/kbd.cjs +1 -0
  130. package/dist/kbd.d.ts +16 -0
  131. package/dist/kbd.js +5 -0
  132. package/dist/pagination.cjs +1 -1
  133. package/dist/pagination.js +2 -1
  134. package/dist/popover.cjs +1 -1
  135. package/dist/popover.js +3 -2
  136. package/dist/progress.cjs +1 -1
  137. package/dist/progress.js +2 -1
  138. package/dist/radio.cjs +1 -1
  139. package/dist/radio.js +4 -3
  140. package/dist/select.cjs +1 -1
  141. package/dist/select.d.ts +3 -3
  142. package/dist/select.js +3 -2
  143. package/dist/selectfield.cjs +1 -1
  144. package/dist/selectfield.d.ts +6 -6
  145. package/dist/selectfield.js +3 -2
  146. package/dist/separator.cjs +1 -1
  147. package/dist/separator.js +3 -2
  148. package/dist/skeleton.cjs +1 -0
  149. package/dist/skeleton.d.ts +22 -0
  150. package/dist/skeleton.js +5 -0
  151. package/dist/spinner.cjs +1 -1
  152. package/dist/spinner.js +3 -2
  153. package/dist/stack.cjs +1 -0
  154. package/dist/stack.d.ts +58 -0
  155. package/dist/stack.js +7 -0
  156. package/dist/style.css +2 -1
  157. package/dist/switch.cjs +1 -1
  158. package/dist/switch.js +3 -2
  159. package/dist/table.cjs +1 -0
  160. package/dist/table.d.ts +65 -0
  161. package/dist/table.js +5 -0
  162. package/dist/tabs.cjs +1 -1
  163. package/dist/tabs.js +3 -2
  164. package/dist/test-utils.cjs +1 -1
  165. package/dist/test-utils.d.ts +14 -2
  166. package/dist/test-utils.js +5 -5
  167. package/dist/text.cjs +1 -0
  168. package/dist/text.d.ts +38 -0
  169. package/dist/text.js +5 -0
  170. package/dist/textarea.cjs +1 -1
  171. package/dist/textarea.js +2 -1
  172. package/dist/textareafield.cjs +1 -1
  173. package/dist/textareafield.d.ts +6 -6
  174. package/dist/textareafield.js +2 -1
  175. package/dist/textfield.cjs +1 -1
  176. package/dist/textfield.d.ts +6 -6
  177. package/dist/textfield.js +3 -2
  178. package/dist/toast.cjs +1 -1
  179. package/dist/toast.js +4 -3
  180. package/dist/tooltip.cjs +1 -1
  181. package/dist/tooltip.js +3 -2
  182. package/dist/utils.cjs +1 -0
  183. package/dist/utils.d.ts +28 -0
  184. package/dist/utils.js +8 -0
  185. package/dist/visually-hidden.cjs +1 -0
  186. package/dist/visually-hidden.d.ts +16 -0
  187. package/dist/visually-hidden.js +5 -0
  188. package/package.json +166 -72
  189. package/dist/Alert-BJ1O0bnK.cjs +0 -1
  190. package/dist/Alert-am3ANPTH.js +0 -99
  191. package/dist/Badge-Bbxb4wyt.js +0 -38
  192. package/dist/Badge-SBO9tGzn.cjs +0 -1
  193. package/dist/Breadcrumb-Db7ASomJ.js +0 -90
  194. package/dist/Breadcrumb-StitgXXx.cjs +0 -1
  195. package/dist/Button-DDMc7-3S.js +0 -58
  196. package/dist/Button-akOSYEu9.cjs +0 -1
  197. package/dist/Card-DSCA-Igh.cjs +0 -1
  198. package/dist/Card-Dh9Pcmfa.js +0 -79
  199. package/dist/Checkbox-DWl91ci_.js +0 -92
  200. package/dist/Checkbox-DvkT6QP9.cjs +0 -1
  201. package/dist/Dialog-CtYu14zl.js +0 -245
  202. package/dist/Dialog-gPT4noD8.cjs +0 -1
  203. package/dist/Drawer-BFJxsPG1.js +0 -246
  204. package/dist/Drawer-BygSIQQn.cjs +0 -1
  205. package/dist/Field-Bv07PL2M.js +0 -120
  206. package/dist/Field-D6FSsUGj.cjs +0 -1
  207. package/dist/Input-BS_t1bl-.js +0 -151
  208. package/dist/Input-UQ2fQwE7.cjs +0 -1
  209. package/dist/Pagination-C1h7OTgM.js +0 -128
  210. package/dist/Pagination-CmmcBPNz.cjs +0 -1
  211. package/dist/Popover-BlCmIF9J.cjs +0 -1
  212. package/dist/Progress-DWLr6Bq2.js +0 -75
  213. package/dist/Progress-FO-4WX0i.cjs +0 -1
  214. package/dist/RadioItem-BfkTHBxQ.cjs +0 -1
  215. package/dist/RadioItem-CzHSS_qK.js +0 -141
  216. package/dist/Select-BkJNe4Lc.cjs +0 -1
  217. package/dist/Select-DfV10hZt.js +0 -350
  218. package/dist/SelectField-B6N0uub8.js +0 -49
  219. package/dist/SelectField-Dxl2Mgbv.cjs +0 -1
  220. package/dist/Separator-C5lPGzes.cjs +0 -1
  221. package/dist/Separator-DQT58t90.js +0 -52
  222. package/dist/Spinner-CeIDpqkx.cjs +0 -1
  223. package/dist/Switch-BU_Tcttb.cjs +0 -1
  224. package/dist/Tabs-BTfm4LbV.js +0 -220
  225. package/dist/Tabs-DuU02-UD.cjs +0 -1
  226. package/dist/TextField-C3r-6jr6.cjs +0 -1
  227. package/dist/TextField-DtXQQJJk.js +0 -31
  228. package/dist/Textarea-H6evM8L4.cjs +0 -1
  229. package/dist/TextareaField-CpqPinvx.js +0 -31
  230. package/dist/TextareaField-D234Lyi_.cjs +0 -1
  231. package/dist/Toast-0acAjZTB.js +0 -167
  232. package/dist/Toast-ndaxbpcV.cjs +0 -1
  233. package/dist/Tooltip-CCd6VRvZ.cjs +0 -1
  234. package/dist/VhyxUIProvider-C7ie8u2L.cjs +0 -1
  235. package/dist/VhyxUIProvider-DVFSW4q-.js +0 -31
  236. package/dist/jsx-runtime-BRMkMA8J.cjs +0 -22
  237. package/dist/jsx-runtime-CL69jGNW.js +0 -279
@@ -1,17 +1,17 @@
1
- import { j as g } from "./jsx-runtime-CL69jGNW.js";
2
- import N, { useState as _, useRef as L, useCallback as b, useEffect as j, useMemo as V, createContext as U, useContext as $ } from "react";
1
+ import { jsx as g } from "react/jsx-runtime";
2
+ import E, { useState as N, useRef as V, useCallback as b, useEffect as I, useMemo as B, createContext as U, useContext as $ } from "react";
3
3
  import D from "react-dom";
4
- import { popoverContract as T, Slot as M, VhyxUIError as G, VhyxUIErrorCode as X } from "@vhyxui/core";
4
+ import { popoverContract as j, Slot as M, VhyxUIError as G, VhyxUIErrorCode as X } from "@vhyxui/core";
5
5
  import { withAgentContract as J } from "@vhyxseal/react";
6
6
  import { u as K } from "./useId-BGRmH6iF.js";
7
- import { c as B, r as Y } from "./floatingPosition-UeYoO5K4.js";
8
- const q = "_trigger_5e049_1", F = "_content_5e049_7", Q = "_arrow_5e049_21", Z = "_close_5e049_29", I = {
7
+ import { c as T, r as Y } from "./floatingPosition-UeYoO5K4.js";
8
+ const q = "_trigger_5e049_1", F = "_content_5e049_7", Q = "_arrow_5e049_21", Z = "_close_5e049_29", _ = {
9
9
  trigger: q,
10
10
  content: F,
11
11
  arrow: Q,
12
12
  close: Z
13
13
  }, S = U(null);
14
- function E(r) {
14
+ function L(r) {
15
15
  const i = $(S);
16
16
  if (!i)
17
17
  throw new G({
@@ -21,65 +21,65 @@ function E(r) {
21
21
  });
22
22
  return i;
23
23
  }
24
- const A = N.forwardRef(
24
+ const A = E.forwardRef(
25
25
  ({
26
26
  open: r,
27
27
  defaultOpen: i = !1,
28
28
  onOpenChange: t,
29
29
  contract: n,
30
- children: P
30
+ children: x
31
31
  }, c) => {
32
- const e = K("vhyx-popover"), l = `${e}-trigger`, m = `${e}-content`, f = r !== void 0, [v, u] = _(i), p = f ? r : v, C = L(null), R = L(null), a = b(
32
+ const e = K("vhyx-popover"), l = `${e}-trigger`, m = `${e}-content`, f = r !== void 0, [v, u] = N(i), p = f ? r : v, R = V(null), C = V(null), a = b(
33
33
  (s) => {
34
34
  f || u(s), t == null || t(s);
35
35
  },
36
36
  [f, t]
37
37
  );
38
- j(() => {
38
+ I(() => {
39
39
  if (!p) return;
40
40
  function s(h) {
41
41
  var d;
42
- h.key === "Escape" && (a(!1), (d = C.current) == null || d.focus());
42
+ h.key === "Escape" && (a(!1), (d = R.current) == null || d.focus());
43
43
  }
44
44
  return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
45
- }, [p, a]), j(() => {
45
+ }, [p, a]), I(() => {
46
46
  if (!p) return;
47
47
  function s(h) {
48
- var x, y;
48
+ var y, P;
49
49
  const d = h.target;
50
- (x = C.current) != null && x.contains(d) || (y = R.current) != null && y.contains(d) || a(!1);
50
+ (y = R.current) != null && y.contains(d) || (P = C.current) != null && P.contains(d) || a(!1);
51
51
  }
52
52
  return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
53
53
  }, [p, a]);
54
- const o = V(
55
- () => ({ ...T, id: e, ...n }),
54
+ const o = B(
55
+ () => ({ ...j, id: e, ...n }),
56
56
  [e, n]
57
- ), w = V(
57
+ ), w = B(
58
58
  () => ({
59
59
  open: p,
60
60
  onOpenChange: a,
61
61
  triggerId: l,
62
62
  contentId: m,
63
- triggerRef: C,
64
- contentRef: R
63
+ triggerRef: R,
64
+ contentRef: C
65
65
  }),
66
66
  [p, a, l, m]
67
67
  );
68
- return /* @__PURE__ */ g.jsx(S.Provider, { value: w, children: /* @__PURE__ */ g.jsx(
68
+ return /* @__PURE__ */ g(S.Provider, { value: w, children: /* @__PURE__ */ g(
69
69
  "div",
70
70
  {
71
71
  ref: c,
72
72
  "data-state": p ? "open" : "closed",
73
73
  "data-vhyx-contract": JSON.stringify(o),
74
- children: P
74
+ children: x
75
75
  }
76
76
  ) });
77
77
  }
78
78
  );
79
79
  A.displayName = "VhyxPopover";
80
- const O = N.forwardRef(
81
- ({ children: r, className: i, onClick: t, asChild: n = !1, ...P }, c) => {
82
- const e = E("Popover.Trigger"), l = b(
80
+ const O = E.forwardRef(
81
+ ({ children: r, className: i, onClick: t, asChild: n = !1, ...x }, c) => {
82
+ const e = L("Popover.Trigger"), l = b(
83
83
  (u) => {
84
84
  e.triggerRef.current = u, typeof c == "function" ? c(u) : c && (c.current = u);
85
85
  },
@@ -89,16 +89,16 @@ const O = N.forwardRef(
89
89
  t == null || t(u), e.onOpenChange(!e.open);
90
90
  },
91
91
  [t, e]
92
- ), f = [I.trigger, i].filter(Boolean).join(" "), v = {
92
+ ), f = [_.trigger, i].filter(Boolean).join(" "), v = {
93
93
  id: e.triggerId,
94
94
  "aria-haspopup": "dialog",
95
95
  "aria-expanded": e.open,
96
96
  "aria-controls": e.open ? e.contentId : void 0,
97
97
  onClick: m,
98
98
  className: f,
99
- ...P
99
+ ...x
100
100
  };
101
- return n ? /* @__PURE__ */ g.jsx(M, { ref: l, ...v, children: r }) : /* @__PURE__ */ g.jsx("button", { ref: l, type: "button", ...v, children: r });
101
+ return n ? /* @__PURE__ */ g(M, { ref: l, ...v, children: r }) : /* @__PURE__ */ g("button", { ref: l, type: "button", ...v, children: r });
102
102
  }
103
103
  );
104
104
  O.displayName = "VhyxPopoverTrigger";
@@ -107,39 +107,39 @@ function H({
107
107
  className: i,
108
108
  side: t = "bottom",
109
109
  align: n = "center",
110
- style: P,
110
+ style: x,
111
111
  ...c
112
112
  }) {
113
- const e = E("Popover.Content"), [l, m] = _(!1), [f, v] = _({
113
+ const e = L("Popover.Content"), [l, m] = N(!1), [f, v] = N({
114
114
  top: 0,
115
115
  left: 0
116
116
  });
117
- j(() => {
117
+ I(() => {
118
118
  m(!0);
119
- }, []), j(() => {
119
+ }, []), I(() => {
120
120
  if (!l || !e.open || !e.triggerRef.current) return;
121
- const R = () => {
121
+ const C = () => {
122
122
  const o = e.triggerRef.current.getBoundingClientRect(), w = e.contentRef.current, s = (w == null ? void 0 : w.offsetWidth) ?? o.width, h = (w == null ? void 0 : w.offsetHeight) ?? 0, d = 8;
123
- let x, y;
124
- t === "bottom" || t === "top" ? (x = t === "bottom" ? o.bottom + d : o.top - d - h, n === "start" ? y = o.left : n === "end" ? y = o.right - s : y = o.left + o.width / 2 - s / 2) : (y = t === "right" ? o.right + d : o.left - d - s, n === "start" ? x = o.top : n === "end" ? x = o.bottom - h : x = o.top + o.height / 2 - h / 2), v({
125
- top: B(x, h, window.innerHeight),
126
- left: B(y, s, window.innerWidth)
123
+ let y, P;
124
+ t === "bottom" || t === "top" ? (y = t === "bottom" ? o.bottom + d : o.top - d - h, n === "start" ? P = o.left : n === "end" ? P = o.right - s : P = o.left + o.width / 2 - s / 2) : (P = t === "right" ? o.right + d : o.left - d - s, n === "start" ? y = o.top : n === "end" ? y = o.bottom - h : y = o.top + o.height / 2 - h / 2), v({
125
+ top: T(y, h, window.innerHeight),
126
+ left: T(P, s, window.innerWidth)
127
127
  });
128
128
  };
129
- R();
130
- const a = Y(R);
129
+ C();
130
+ const a = Y(C);
131
131
  return window.addEventListener("scroll", a.run, !0), window.addEventListener("resize", a.run), () => {
132
132
  a.cancel(), window.removeEventListener("scroll", a.run, !0), window.removeEventListener("resize", a.run);
133
133
  };
134
134
  }, [l, e.open, e.triggerRef, t, n]);
135
135
  const u = b(
136
- (R) => {
137
- e.contentRef.current = R;
136
+ (C) => {
137
+ e.contentRef.current = C;
138
138
  },
139
139
  [e.contentRef]
140
140
  );
141
141
  if (!l || !e.open) return null;
142
- const p = [I.content, i].filter(Boolean).join(" "), C = /* @__PURE__ */ g.jsx(
142
+ const p = [_.content, i].filter(Boolean).join(" "), R = /* @__PURE__ */ g(
143
143
  "div",
144
144
  {
145
145
  ref: u,
@@ -157,7 +157,7 @@ function H({
157
157
  // are applied explicitly afterward so they always win, instead of
158
158
  // letting a whole `style` object from a blind `{...rest}` spread
159
159
  // replace this element's positioning outright.
160
- ...P,
160
+ ...x,
161
161
  position: "fixed",
162
162
  top: f.top,
163
163
  left: f.left,
@@ -167,40 +167,40 @@ function H({
167
167
  children: r
168
168
  }
169
169
  );
170
- return D.createPortal(C, document.body);
170
+ return D.createPortal(R, document.body);
171
171
  }
172
172
  H.displayName = "VhyxPopoverContent";
173
173
  function W({ className: r, ...i }) {
174
- const t = [I.arrow, r].filter(Boolean).join(" ");
175
- return /* @__PURE__ */ g.jsx(
174
+ const t = [_.arrow, r].filter(Boolean).join(" ");
175
+ return /* @__PURE__ */ g(
176
176
  "svg",
177
177
  {
178
178
  "aria-hidden": "true",
179
179
  className: t,
180
180
  viewBox: "0 0 10 5",
181
181
  ...i,
182
- children: /* @__PURE__ */ g.jsx("path", { d: "M0 5L5 0L10 5", fill: "currentColor" })
182
+ children: /* @__PURE__ */ g("path", { d: "M0 5L5 0L10 5", fill: "currentColor" })
183
183
  }
184
184
  );
185
185
  }
186
186
  W.displayName = "VhyxPopoverArrow";
187
- const z = N.forwardRef(
188
- ({ children: r, className: i, onClick: t, asChild: n = !1, ...P }, c) => {
189
- const e = E("Popover.Close"), l = b(
187
+ const z = E.forwardRef(
188
+ ({ children: r, className: i, onClick: t, asChild: n = !1, ...x }, c) => {
189
+ const e = L("Popover.Close"), l = b(
190
190
  (v) => {
191
191
  t == null || t(v), e.onOpenChange(!1);
192
192
  },
193
193
  [t, e]
194
- ), m = [I.close, i].filter(Boolean).join(" "), f = {
194
+ ), m = [_.close, i].filter(Boolean).join(" "), f = {
195
195
  onClick: l,
196
196
  className: m,
197
- ...P
197
+ ...x
198
198
  };
199
- return n ? /* @__PURE__ */ g.jsx(M, { ref: c, ...f, children: r }) : /* @__PURE__ */ g.jsx("button", { ref: c, type: "button", ...f, children: r ?? "Close" });
199
+ return n ? /* @__PURE__ */ g(M, { ref: c, ...f, children: r }) : /* @__PURE__ */ g("button", { ref: c, type: "button", ...f, children: r ?? "Close" });
200
200
  }
201
201
  );
202
202
  z.displayName = "VhyxPopoverClose";
203
- const k = { ...T, id: "vhyxui-popover" }, ee = Object.assign(
203
+ const k = { ...j, id: "vhyxui-popover" }, ee = Object.assign(
204
204
  J(A, k),
205
205
  {
206
206
  Trigger: O,
@@ -0,0 +1 @@
1
+ "use strict";const v=require("react/jsx-runtime"),o=require("react"),M=require("react-dom"),b=require("@vhyxui/core"),A=require("@vhyxseal/react"),O=require("./useId-D2AEOm2G.cjs"),_=require("./floatingPosition-oslPPzF_.cjs"),H="_trigger_5e049_1",W="_content_5e049_7",z="_arrow_5e049_21",U="_close_5e049_29",j={trigger:H,content:W,arrow:z,close:U},N=o.createContext(null);function E(n){const i=o.useContext(N);if(!i)throw new b.VhyxUIError({code:b.VhyxUIErrorCode.VHYXUI_MISSING_CONTEXT,message:`${n} must be used within <Popover>`,suggestion:"Wrap your component tree with <Popover>"});return i}const V=o.forwardRef(({open:n,defaultOpen:i=!1,onOpenChange:t,contract:s,children:C},a)=>{const e=O.useId("vhyx-popover"),u=`${e}-trigger`,w=`${e}-content`,f=n!==void 0,[h,p]=o.useState(i),g=f?n:h,I=o.useRef(null),R=o.useRef(null),l=o.useCallback(c=>{f||p(c),t==null||t(c)},[f,t]);o.useEffect(()=>{if(!g)return;function c(x){var d;x.key==="Escape"&&(l(!1),(d=I.current)==null||d.focus())}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[g,l]),o.useEffect(()=>{if(!g)return;function c(x){var y,P;const d=x.target;(y=I.current)!=null&&y.contains(d)||(P=R.current)!=null&&P.contains(d)||l(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[g,l]);const r=o.useMemo(()=>({...b.popoverContract,id:e,...s}),[e,s]),m=o.useMemo(()=>({open:g,onOpenChange:l,triggerId:u,contentId:w,triggerRef:I,contentRef:R}),[g,l,u,w]);return v.jsx(N.Provider,{value:m,children:v.jsx("div",{ref:a,"data-state":g?"open":"closed","data-vhyx-contract":JSON.stringify(r),children:C})})});V.displayName="VhyxPopover";const L=o.forwardRef(({children:n,className:i,onClick:t,asChild:s=!1,...C},a)=>{const e=E("Popover.Trigger"),u=o.useCallback(p=>{e.triggerRef.current=p,typeof a=="function"?a(p):a&&(a.current=p)},[a,e.triggerRef]),w=o.useCallback(p=>{t==null||t(p),e.onOpenChange(!e.open)},[t,e]),f=[j.trigger,i].filter(Boolean).join(" "),h={id:e.triggerId,"aria-haspopup":"dialog","aria-expanded":e.open,"aria-controls":e.open?e.contentId:void 0,onClick:w,className:f,...C};return s?v.jsx(b.Slot,{ref:u,...h,children:n}):v.jsx("button",{ref:u,type:"button",...h,children:n})});L.displayName="VhyxPopoverTrigger";function S({children:n,className:i,side:t="bottom",align:s="center",style:C,...a}){const e=E("Popover.Content"),[u,w]=o.useState(!1),[f,h]=o.useState({top:0,left:0});o.useEffect(()=>{w(!0)},[]),o.useEffect(()=>{if(!u||!e.open||!e.triggerRef.current)return;const R=()=>{const r=e.triggerRef.current.getBoundingClientRect(),m=e.contentRef.current,c=(m==null?void 0:m.offsetWidth)??r.width,x=(m==null?void 0:m.offsetHeight)??0,d=8;let y,P;t==="bottom"||t==="top"?(y=t==="bottom"?r.bottom+d:r.top-d-x,s==="start"?P=r.left:s==="end"?P=r.right-c:P=r.left+r.width/2-c/2):(P=t==="right"?r.right+d:r.left-d-c,s==="start"?y=r.top:s==="end"?y=r.bottom-x:y=r.top+r.height/2-x/2),h({top:_.clampToViewport(y,x,window.innerHeight),left:_.clampToViewport(P,c,window.innerWidth)})};R();const l=_.rafBatched(R);return window.addEventListener("scroll",l.run,!0),window.addEventListener("resize",l.run),()=>{l.cancel(),window.removeEventListener("scroll",l.run,!0),window.removeEventListener("resize",l.run)}},[u,e.open,e.triggerRef,t,s]);const p=o.useCallback(R=>{e.contentRef.current=R},[e.contentRef]);if(!u||!e.open)return null;const g=[j.content,i].filter(Boolean).join(" "),I=v.jsx("div",{ref:p,id:e.contentId,role:"dialog","aria-modal":"false","aria-labelledby":e.triggerId,className:g,"data-state":"open","data-side":t,"data-align":s,...a,style:{...C,position:"fixed",top:f.top,left:f.left,zIndex:450},children:n});return M.createPortal(I,document.body)}S.displayName="VhyxPopoverContent";function T({className:n,...i}){const t=[j.arrow,n].filter(Boolean).join(" ");return v.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 10 5",...i,children:v.jsx("path",{d:"M0 5L5 0L10 5",fill:"currentColor"})})}T.displayName="VhyxPopoverArrow";const q=o.forwardRef(({children:n,className:i,onClick:t,asChild:s=!1,...C},a)=>{const e=E("Popover.Close"),u=o.useCallback(h=>{t==null||t(h),e.onOpenChange(!1)},[t,e]),w=[j.close,i].filter(Boolean).join(" "),f={onClick:u,className:w,...C};return s?v.jsx(b.Slot,{ref:a,...f,children:n}):v.jsx("button",{ref:a,type:"button",...f,children:n??"Close"})});q.displayName="VhyxPopoverClose";const $={...b.popoverContract,id:"vhyxui-popover"},B=Object.assign(A.withAgentContract(V,$),{Trigger:L,Content:S,Arrow:T,Close:q});B.displayName="VhyxPopover";exports.Popover=B;
@@ -0,0 +1,75 @@
1
+ import { jsxs as j, jsx as t } from "react/jsx-runtime";
2
+ import x, { useMemo as N } from "react";
3
+ import { progressContract as c } from "@vhyxui/core";
4
+ import { withAgentContract as C } from "@vhyxseal/react";
5
+ import { u as P } from "./useId-BGRmH6iF.js";
6
+ const M = "_wrapper_ko60j_1", I = "_label_ko60j_10", B = "_track_ko60j_21", R = "_fill_ko60j_52", o = {
7
+ wrapper: M,
8
+ label: I,
9
+ track: B,
10
+ fill: R
11
+ }, n = x.forwardRef(
12
+ ({
13
+ value: a,
14
+ max: s = 100,
15
+ indeterminate: r = !1,
16
+ size: d = "md",
17
+ variant: p = "default",
18
+ showLabel: f = !1,
19
+ label: m,
20
+ contract: h,
21
+ className: g,
22
+ id: v,
23
+ ..._
24
+ }, u) => {
25
+ const y = P("vhyx-progress"), e = v ?? y, l = N(() => {
26
+ if (a === void 0 || r) return 0;
27
+ const b = Math.max(0, Math.min(a, s));
28
+ return Math.round(b / s * 100);
29
+ }, [a, s, r]), i = m ?? `${l}%`, w = {
30
+ ...c,
31
+ id: e,
32
+ ...h
33
+ }, k = [o.wrapper, g].filter(Boolean).join(" ");
34
+ return /* @__PURE__ */ j(
35
+ "div",
36
+ {
37
+ ref: u,
38
+ id: e,
39
+ className: k,
40
+ "data-size": d,
41
+ "data-variant": p,
42
+ "data-vhyx-contract": JSON.stringify(w),
43
+ ..._,
44
+ children: [
45
+ f && /* @__PURE__ */ t("span", { className: o.label, "aria-hidden": "true", children: i }),
46
+ /* @__PURE__ */ t(
47
+ "div",
48
+ {
49
+ role: "progressbar",
50
+ "aria-valuemin": 0,
51
+ "aria-valuemax": s,
52
+ "aria-valuenow": r ? void 0 : a ?? 0,
53
+ "aria-label": i,
54
+ className: o.track,
55
+ children: /* @__PURE__ */ t(
56
+ "div",
57
+ {
58
+ className: o.fill,
59
+ "data-indeterminate": r ? !0 : void 0,
60
+ style: r ? void 0 : { width: `${l}%` }
61
+ }
62
+ )
63
+ }
64
+ )
65
+ ]
66
+ }
67
+ );
68
+ }
69
+ );
70
+ n.displayName = "VhyxProgress";
71
+ const S = { ...c, id: "vhyxui-progress" }, V = C(n, S);
72
+ V.displayName = "VhyxProgress";
73
+ export {
74
+ V as P
75
+ };
@@ -0,0 +1 @@
1
+ "use strict";const a=require("react/jsx-runtime"),l=require("react"),n=require("@vhyxui/core"),N=require("@vhyxseal/react"),C=require("./useId-D2AEOm2G.cjs"),q="_wrapper_ko60j_1",P="_label_ko60j_10",I="_track_ko60j_21",M="_fill_ko60j_52",t={wrapper:q,label:P,track:I,fill:M},d=l.forwardRef(({value:s,max:e=100,indeterminate:r=!1,size:u="md",variant:g="default",showLabel:f=!1,label:h,contract:v,className:_,id:y,...j},w)=>{const x=C.useId("vhyx-progress"),o=y??x,c=l.useMemo(()=>{if(s===void 0||r)return 0;const b=Math.max(0,Math.min(s,e));return Math.round(b/e*100)},[s,e,r]),i=h??`${c}%`,k={...n.progressContract,id:o,...v},m=[t.wrapper,_].filter(Boolean).join(" ");return a.jsxs("div",{ref:w,id:o,className:m,"data-size":u,"data-variant":g,"data-vhyx-contract":JSON.stringify(k),...j,children:[f&&a.jsx("span",{className:t.label,"aria-hidden":"true",children:i}),a.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":e,"aria-valuenow":r?void 0:s??0,"aria-label":i,className:t.track,children:a.jsx("div",{className:t.fill,"data-indeterminate":r?!0:void 0,style:r?void 0:{width:`${c}%`}})})]})});d.displayName="VhyxProgress";const R={...n.progressContract,id:"vhyxui-progress"},p=N.withAgentContract(d,R);p.displayName="VhyxProgress";exports.Progress=p;
@@ -0,0 +1,141 @@
1
+ import { jsx as R, jsxs as H } from "react/jsx-runtime";
2
+ import z, { useState as M, useRef as A, useCallback as m, useMemo as U, useContext as Q, createContext as T, useEffect as X } from "react";
3
+ import { radioContract as C } from "@vhyxui/core";
4
+ import { withAgentContract as Y } from "@vhyxseal/react";
5
+ import { u as Z } from "./useId-BGRmH6iF.js";
6
+ const $ = "_group_16juf_3", K = "_item_16juf_17", x = {
7
+ group: $,
8
+ item: K,
9
+ "radio-indicator": "_radio-indicator_16juf_40",
10
+ "radio-dot": "_radio-dot_16juf_98",
11
+ "radio-label": "_radio-label_16juf_109"
12
+ }, D = T(null);
13
+ function V() {
14
+ const r = Q(D);
15
+ if (!r)
16
+ throw new Error(
17
+ "[VhyxUI] <RadioItem> must be used within <RadioGroup>. Wrap your RadioItem components with <RadioGroup>."
18
+ );
19
+ return r;
20
+ }
21
+ const J = z.forwardRef(
22
+ ({
23
+ value: r,
24
+ defaultValue: w,
25
+ onValueChange: o,
26
+ disabled: h = !1,
27
+ orientation: a = "vertical",
28
+ size: s = "md",
29
+ contract: I,
30
+ className: c,
31
+ id: e,
32
+ children: f,
33
+ ...l
34
+ }, y) => {
35
+ const N = Z("vhyx-radiogroup"), d = e ?? N, u = r !== void 0, [j, g] = M(w), _ = u ? r : j, t = A(/* @__PURE__ */ new Map()), p = A([]), [B, S] = M(void 0), E = m(
36
+ (i, b) => {
37
+ b ? (!t.current.has(i) && (p.current.push(i), p.current.length === 1 && S(i)), t.current.set(i, b)) : (t.current.delete(i), p.current = p.current.filter((n) => n !== i), S(p.current[0]));
38
+ },
39
+ []
40
+ ), O = m(
41
+ (i, b) => {
42
+ const n = p.current, G = n.indexOf(i);
43
+ if (G === -1) return;
44
+ const q = b === "next" ? (G + 1) % n.length : (G - 1 + n.length) % n.length, v = n[q];
45
+ if (v === void 0) return;
46
+ const k = t.current.get(v);
47
+ !k || k.disabled || (k.focus(), u || g(v), o == null || o(v));
48
+ },
49
+ [u, o]
50
+ ), F = m(
51
+ (i) => {
52
+ u || g(i), o == null || o(i);
53
+ },
54
+ [u, o]
55
+ ), L = U(
56
+ () => ({ ...C, id: d, ...I }),
57
+ [d, I]
58
+ ), P = U(
59
+ () => ({
60
+ value: _,
61
+ onValueChange: F,
62
+ disabled: h,
63
+ size: s,
64
+ groupId: d,
65
+ registerItem: E,
66
+ navigateItem: O,
67
+ firstValue: B
68
+ }),
69
+ [_, F, h, s, d, E, O, B]
70
+ ), W = [x.group, c].filter(Boolean).join(" ");
71
+ return /* @__PURE__ */ R(D.Provider, { value: P, children: /* @__PURE__ */ R(
72
+ "div",
73
+ {
74
+ ref: y,
75
+ id: d,
76
+ role: "radiogroup",
77
+ "aria-orientation": a,
78
+ className: W,
79
+ "data-orientation": a,
80
+ "data-size": s,
81
+ "data-vhyx-contract": JSON.stringify(L),
82
+ ...l,
83
+ children: f
84
+ }
85
+ ) });
86
+ }
87
+ );
88
+ J.displayName = "VhyxRadioGroup";
89
+ const tt = { ...C, id: "vhyxui-radio-group" }, rt = Y(J, tt);
90
+ rt.displayName = "VhyxRadioGroup";
91
+ const et = z.forwardRef(
92
+ ({ value: r, disabled: w, children: o, className: h, onClick: a, onKeyDown: s, ...I }, c) => {
93
+ const e = V(), f = e.value === r, l = !!w || e.disabled, y = A(null), N = m(
94
+ (t) => {
95
+ y.current = t, typeof c == "function" ? c(t) : c && (c.current = t);
96
+ },
97
+ [c]
98
+ );
99
+ X(() => (e.registerItem(r, y.current), () => {
100
+ e.registerItem(r, null);
101
+ }), [e, r]);
102
+ const d = m(
103
+ (t) => {
104
+ a == null || a(t), l || e.onValueChange(r);
105
+ },
106
+ [a, l, e, r]
107
+ ), u = m(
108
+ (t) => {
109
+ s == null || s(t), t.key === "ArrowDown" || t.key === "ArrowRight" ? (t.preventDefault(), e.navigateItem(r, "next")) : (t.key === "ArrowUp" || t.key === "ArrowLeft") && (t.preventDefault(), e.navigateItem(r, "prev"));
110
+ },
111
+ [s, e, r]
112
+ ), j = !e.value && e.firstValue === r, g = f || j ? 0 : -1, _ = [x.item, h].filter(Boolean).join(" ");
113
+ return /* @__PURE__ */ H(
114
+ "button",
115
+ {
116
+ ref: N,
117
+ type: "button",
118
+ role: "radio",
119
+ "aria-checked": f,
120
+ disabled: l,
121
+ tabIndex: g,
122
+ onClick: d,
123
+ onKeyDown: u,
124
+ className: _,
125
+ "data-state": f ? "checked" : "unchecked",
126
+ "data-size": e.size,
127
+ "data-disabled": l ? !0 : void 0,
128
+ ...I,
129
+ children: [
130
+ /* @__PURE__ */ R("span", { className: x["radio-indicator"], children: f && /* @__PURE__ */ R("span", { className: x["radio-dot"] }) }),
131
+ o && /* @__PURE__ */ R("span", { className: x["radio-label"], children: o })
132
+ ]
133
+ }
134
+ );
135
+ }
136
+ );
137
+ et.displayName = "VhyxRadioItem";
138
+ export {
139
+ rt as R,
140
+ et as a
141
+ };
@@ -0,0 +1 @@
1
+ "use strict";const m=require("react/jsx-runtime"),e=require("react"),E=require("@vhyxui/core"),P=require("@vhyxseal/react"),W=require("./useId-D2AEOm2G.cjs"),H="_group_16juf_3",Q="_item_16juf_17",R={group:H,item:Q,"radio-indicator":"_radio-indicator_16juf_40","radio-dot":"_radio-dot_16juf_98","radio-label":"_radio-label_16juf_109"},M=e.createContext(null);function T(){const r=e.useContext(M);if(!r)throw new Error("[VhyxUI] <RadioItem> must be used within <RadioGroup>. Wrap your RadioItem components with <RadioGroup>.");return r}const O=e.forwardRef(({value:r,defaultValue:v,onValueChange:o,disabled:I=!1,orientation:c="vertical",size:a="md",contract:h,className:d,id:s,children:f,...p},b)=>{const w=W.useId("vhyx-radiogroup"),u=s??w,l=r!==void 0,[N,y]=e.useState(v),g=l?r:N,t=e.useRef(new Map),x=e.useRef([]),[C,q]=e.useState(void 0),A=e.useCallback((i,_)=>{_?(!t.current.has(i)&&(x.current.push(i),x.current.length===1&&q(i)),t.current.set(i,_)):(t.current.delete(i),x.current=x.current.filter(n=>n!==i),q(x.current[0]))},[]),S=e.useCallback((i,_)=>{const n=x.current,k=n.indexOf(i);if(k===-1)return;const L=_==="next"?(k+1)%n.length:(k-1+n.length)%n.length,j=n[L];if(j===void 0)return;const G=t.current.get(j);!G||G.disabled||(G.focus(),l||y(j),o==null||o(j))},[l,o]),B=e.useCallback(i=>{l||y(i),o==null||o(i)},[l,o]),z=e.useMemo(()=>({...E.radioContract,id:u,...h}),[u,h]),D=e.useMemo(()=>({value:g,onValueChange:B,disabled:I,size:a,groupId:u,registerItem:A,navigateItem:S,firstValue:C}),[g,B,I,a,u,A,S,C]),J=[R.group,d].filter(Boolean).join(" ");return m.jsx(M.Provider,{value:D,children:m.jsx("div",{ref:b,id:u,role:"radiogroup","aria-orientation":c,className:J,"data-orientation":c,"data-size":a,"data-vhyx-contract":JSON.stringify(z),...p,children:f})})});O.displayName="VhyxRadioGroup";const X={...E.radioContract,id:"vhyxui-radio-group"},F=P.withAgentContract(O,X);F.displayName="VhyxRadioGroup";const U=e.forwardRef(({value:r,disabled:v,children:o,className:I,onClick:c,onKeyDown:a,...h},d)=>{const s=T(),f=s.value===r,p=!!v||s.disabled,b=e.useRef(null),w=e.useCallback(t=>{b.current=t,typeof d=="function"?d(t):d&&(d.current=t)},[d]);e.useEffect(()=>(s.registerItem(r,b.current),()=>{s.registerItem(r,null)}),[s,r]);const u=e.useCallback(t=>{c==null||c(t),p||s.onValueChange(r)},[c,p,s,r]),l=e.useCallback(t=>{a==null||a(t),t.key==="ArrowDown"||t.key==="ArrowRight"?(t.preventDefault(),s.navigateItem(r,"next")):(t.key==="ArrowUp"||t.key==="ArrowLeft")&&(t.preventDefault(),s.navigateItem(r,"prev"))},[a,s,r]),N=!s.value&&s.firstValue===r,y=f||N?0:-1,g=[R.item,I].filter(Boolean).join(" ");return m.jsxs("button",{ref:w,type:"button",role:"radio","aria-checked":f,disabled:p,tabIndex:y,onClick:u,onKeyDown:l,className:g,"data-state":f?"checked":"unchecked","data-size":s.size,"data-disabled":p?!0:void 0,...h,children:[m.jsx("span",{className:R["radio-indicator"],children:f&&m.jsx("span",{className:R["radio-dot"]})}),o&&m.jsx("span",{className:R["radio-label"],children:o})]})});U.displayName="VhyxRadioItem";exports.RadioGroup=F;exports.RadioItem=U;