@vhyxui/react 0.3.1-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-DHyfbt0C.js +0 -167
  232. package/dist/Toast-DVvbVxTf.cjs +0 -1
  233. package/dist/Tooltip-CCd6VRvZ.cjs +0 -1
  234. package/dist/VhyxUIProvider-DI8J763o.js +0 -31
  235. package/dist/VhyxUIProvider-oVy4G3P4.cjs +0 -1
  236. package/dist/jsx-runtime-BRMkMA8J.cjs +0 -22
  237. package/dist/jsx-runtime-CL69jGNW.js +0 -279
@@ -0,0 +1,350 @@
1
+ import { jsx as m, jsxs as Z } from "react/jsx-runtime";
2
+ import k, { useState as B, useRef as j, useEffect as V, useCallback as y, useMemo as K, createContext as de, useContext as fe } from "react";
3
+ import pe from "react-dom";
4
+ import { selectContract as ee, Slot as ge, VhyxUIError as me, VhyxUIErrorCode as he } from "@vhyxui/core";
5
+ import { withAgentContract as ye } from "@vhyxseal/react";
6
+ import { u as D } from "./useId-BGRmH6iF.js";
7
+ import { c as Q, r as ve } from "./floatingPosition-UeYoO5K4.js";
8
+ const xe = "_trigger_1t193_3", we = "_content_1t193_81", Se = "_item_1t193_101", be = "_group_1t193_152", Ce = "_label_1t193_158", Ie = "_separator_1t193_170", C = {
9
+ trigger: xe,
10
+ "trigger-value": "_trigger-value_1t193_62",
11
+ "trigger-icon": "_trigger-icon_1t193_70",
12
+ content: we,
13
+ item: Se,
14
+ "item-check": "_item-check_1t193_141",
15
+ group: be,
16
+ label: Ce,
17
+ separator: Ie
18
+ }, te = de(null);
19
+ function H(e) {
20
+ return e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(H).join("") : k.isValidElement(e) ? H(e.props.children) : "";
21
+ }
22
+ function z(e) {
23
+ const n = fe(te);
24
+ if (!n)
25
+ throw new me({
26
+ code: he.VHYXUI_MISSING_CONTEXT,
27
+ message: `${e} must be used within <Select>`,
28
+ suggestion: "Wrap your component tree with <Select>"
29
+ });
30
+ return n;
31
+ }
32
+ const ne = k.forwardRef(
33
+ ({
34
+ value: e,
35
+ defaultValue: n,
36
+ onValueChange: l,
37
+ disabled: g = !1,
38
+ size: r = "md",
39
+ placeholder: u,
40
+ contract: x,
41
+ children: o,
42
+ className: v,
43
+ ...s
44
+ }, S) => {
45
+ const b = D("vhyx-select-trigger"), d = D("vhyx-select-content"), h = D("vhyx-select"), c = e !== void 0, [_, E] = B(n), f = c ? e : _, [t, I] = B(!1), [L, w] = B(void 0), T = j(null), W = j(null), O = j(/* @__PURE__ */ new Map()), A = j([]), P = j(/* @__PURE__ */ new Map()), [U, M] = B(void 0), G = j(f);
46
+ G.current = f, V(() => {
47
+ if (f === void 0) {
48
+ M(void 0);
49
+ return;
50
+ }
51
+ const i = O.current.get(f);
52
+ M(i ? i.label : void 0);
53
+ }, [f]);
54
+ const F = y(
55
+ (i, a, p) => {
56
+ O.current.has(i) || A.current.push(i);
57
+ const R = { label: a };
58
+ p !== void 0 && (R.disabled = p), O.current.set(i, R), i === G.current && M(a);
59
+ },
60
+ []
61
+ ), X = y(() => U, [U]), Y = y(
62
+ (i) => {
63
+ var R;
64
+ const a = A.current.filter(
65
+ (N) => {
66
+ var q;
67
+ return !((q = O.current.get(N)) != null && q.disabled);
68
+ }
69
+ );
70
+ if (a.length === 0) return;
71
+ let p;
72
+ if (i === "home")
73
+ p = a[0];
74
+ else if (i === "end")
75
+ p = a[a.length - 1];
76
+ else {
77
+ const N = L !== void 0 ? a.indexOf(L) : -1;
78
+ p = i === "down" ? a[Math.min(N + 1, a.length - 1)] : a[Math.max(N - 1, 0)];
79
+ }
80
+ p !== void 0 && (w(p), (R = P.current.get(p)) == null || R.focus());
81
+ },
82
+ [L]
83
+ ), J = y(
84
+ (i) => {
85
+ var a;
86
+ c || E(i), l == null || l(i), I(!1), w(void 0), (a = T.current) == null || a.focus();
87
+ },
88
+ [c, l]
89
+ ), $ = y(
90
+ (i) => {
91
+ if (I(i), i) {
92
+ const a = f ?? A.current[0];
93
+ w(a);
94
+ } else
95
+ w(void 0);
96
+ },
97
+ [f]
98
+ ), le = K(
99
+ () => ({ ...ee, id: h, ...x }),
100
+ [h, x]
101
+ ), ue = K(
102
+ () => ({
103
+ value: f,
104
+ onValueChange: J,
105
+ open: t,
106
+ onOpenChange: $,
107
+ disabled: g,
108
+ size: r,
109
+ placeholder: u,
110
+ triggerId: b,
111
+ contentId: d,
112
+ triggerRef: T,
113
+ contentRef: W,
114
+ focusedValue: L,
115
+ setFocusedValue: w,
116
+ registerItem: F,
117
+ getSelectedLabel: X,
118
+ navigateItems: Y,
119
+ itemElementsRef: P,
120
+ itemOrderRef: A,
121
+ itemRegistryRef: O
122
+ }),
123
+ [
124
+ f,
125
+ J,
126
+ t,
127
+ $,
128
+ g,
129
+ r,
130
+ u,
131
+ b,
132
+ d,
133
+ L,
134
+ F,
135
+ X,
136
+ Y
137
+ ]
138
+ );
139
+ return V(() => {
140
+ if (!t) return;
141
+ function i(a) {
142
+ var p;
143
+ a.key === "Escape" && (I(!1), w(void 0), (p = T.current) == null || p.focus());
144
+ }
145
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
146
+ }, [t]), V(() => {
147
+ if (!t) return;
148
+ function i(a) {
149
+ var R, N;
150
+ const p = a.target;
151
+ (R = T.current) != null && R.contains(p) || (N = W.current) != null && N.contains(p) || (I(!1), w(void 0));
152
+ }
153
+ return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
154
+ }, [t]), /* @__PURE__ */ m(te.Provider, { value: ue, children: /* @__PURE__ */ m(
155
+ "div",
156
+ {
157
+ ref: S,
158
+ className: v,
159
+ "data-size": r,
160
+ "data-disabled": g ? !0 : void 0,
161
+ "data-vhyx-contract": JSON.stringify(le),
162
+ ...s,
163
+ children: o
164
+ }
165
+ ) });
166
+ }
167
+ );
168
+ ne.displayName = "VhyxSelect";
169
+ const re = k.forwardRef((e, n) => {
170
+ const { icon: l, className: g, asChild: r = !1, children: u, ...x } = e, o = z("Select.Trigger"), v = o.getSelectedLabel(), s = y(
171
+ (c) => {
172
+ o.triggerRef.current = c, typeof n == "function" ? n(c) : n && (n.current = c);
173
+ },
174
+ [n, o.triggerRef]
175
+ ), S = y(() => {
176
+ o.disabled || o.onOpenChange(!o.open);
177
+ }, [o]), b = y(
178
+ (c) => {
179
+ (c.key === "ArrowDown" || c.key === "ArrowUp") && (c.preventDefault(), o.open || o.onOpenChange(!0));
180
+ },
181
+ [o]
182
+ ), d = [C.trigger, g].filter(Boolean).join(" "), h = {
183
+ id: o.triggerId,
184
+ role: "combobox",
185
+ "aria-haspopup": "listbox",
186
+ "aria-expanded": o.open,
187
+ "aria-controls": o.open ? o.contentId : void 0,
188
+ disabled: o.disabled,
189
+ onClick: S,
190
+ onKeyDown: b,
191
+ className: d,
192
+ "data-size": o.size,
193
+ "data-state": o.open ? "open" : "closed",
194
+ "data-placeholder": v ? void 0 : !0,
195
+ ...x
196
+ };
197
+ return r ? /* @__PURE__ */ m(ge, { ref: s, ...h, children: u }) : /* @__PURE__ */ Z("button", { ref: s, type: "button", ...h, children: [
198
+ /* @__PURE__ */ m("span", { className: C["trigger-value"], children: v ?? o.placeholder ?? "Select…" }),
199
+ /* @__PURE__ */ m("span", { className: C["trigger-icon"], "aria-hidden": "true", children: l ?? /* @__PURE__ */ m("svg", { viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ m("path", { d: "M2.5 4.5L6 8L9.5 4.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
200
+ ] });
201
+ });
202
+ re.displayName = "VhyxSelectTrigger";
203
+ function oe({ children: e, className: n, style: l, ...g }) {
204
+ const r = z("Select.Content"), [u, x] = B(!1), [o, v] = B({
205
+ position: "fixed",
206
+ top: 0,
207
+ left: 0,
208
+ minWidth: 0,
209
+ zIndex: "var(--vhyx-z-dropdown)"
210
+ });
211
+ V(() => {
212
+ x(!0);
213
+ }, []), V(() => {
214
+ if (!r.open || !r.triggerRef.current) return;
215
+ const d = () => {
216
+ var w;
217
+ const c = r.triggerRef.current.getBoundingClientRect(), _ = window.innerHeight - c.bottom, E = c.top, f = ((w = r.contentRef.current) == null ? void 0 : w.scrollHeight) ?? 300, t = _ < f && E > _, I = t ? Math.min(f, E - 8) : Math.min(f, _ - 8), L = t ? c.top - I - 4 : c.bottom + 4;
218
+ v({
219
+ position: "fixed",
220
+ top: Q(L, I, window.innerHeight),
221
+ left: Q(c.left, c.width, window.innerWidth),
222
+ minWidth: c.width,
223
+ zIndex: "var(--vhyx-z-dropdown)",
224
+ maxHeight: I,
225
+ overflowY: "auto"
226
+ });
227
+ };
228
+ d();
229
+ const h = ve(d);
230
+ return window.addEventListener("scroll", h.run, !0), window.addEventListener("resize", h.run), () => {
231
+ h.cancel(), window.removeEventListener("scroll", h.run, !0), window.removeEventListener("resize", h.run);
232
+ };
233
+ }, [r.open, r.triggerRef]), V(() => {
234
+ var d;
235
+ !r.open || !r.focusedValue || (d = r.itemElementsRef.current.get(r.focusedValue)) == null || d.focus();
236
+ }, [r.open]);
237
+ const s = y(
238
+ (d) => {
239
+ r.contentRef.current = d;
240
+ },
241
+ [r.contentRef]
242
+ );
243
+ if (!u) return null;
244
+ const S = [C.content, n].filter(Boolean).join(" "), b = /* @__PURE__ */ m(
245
+ "div",
246
+ {
247
+ ref: s,
248
+ id: r.contentId,
249
+ role: "listbox",
250
+ "aria-labelledby": r.triggerId,
251
+ className: S,
252
+ "data-state": r.open ? "open" : "closed",
253
+ ...g,
254
+ style: {
255
+ // Consumer's cosmetic style first — internal positioning/sizing keys
256
+ // (position/top/left/minWidth/zIndex/maxHeight/overflowY) are spread
257
+ // explicitly afterward so they always win, instead of letting a
258
+ // whole `style` object from a blind `{...rest}` spread replace this
259
+ // element's positioning outright.
260
+ ...l,
261
+ ...o
262
+ },
263
+ children: e
264
+ }
265
+ );
266
+ return pe.createPortal(b, document.body);
267
+ }
268
+ oe.displayName = "VhyxSelectContent";
269
+ const se = k.forwardRef(
270
+ ({ value: e, disabled: n, children: l, className: g, onClick: r, onKeyDown: u, onMouseEnter: x, ...o }, v) => {
271
+ const s = z("Select.Item"), S = s.value === e, b = s.focusedValue === e, d = H(l);
272
+ V(() => {
273
+ s.registerItem(e, d, n);
274
+ }, [s, e, d, n]);
275
+ const h = y(
276
+ (t) => {
277
+ t ? s.itemElementsRef.current.set(e, t) : s.itemElementsRef.current.delete(e), typeof v == "function" ? v(t) : v && (v.current = t);
278
+ },
279
+ [v, s, e]
280
+ ), c = y(
281
+ (t) => {
282
+ r == null || r(t), n || s.onValueChange(e);
283
+ },
284
+ [r, n, s, e]
285
+ ), _ = y(
286
+ (t) => {
287
+ u == null || u(t), t.key === "Enter" || t.key === " " ? (t.preventDefault(), n || s.onValueChange(e)) : t.key === "ArrowDown" ? (t.preventDefault(), s.navigateItems("down")) : t.key === "ArrowUp" ? (t.preventDefault(), s.navigateItems("up")) : t.key === "Home" ? (t.preventDefault(), s.navigateItems("home")) : t.key === "End" && (t.preventDefault(), s.navigateItems("end"));
288
+ },
289
+ [u, n, s, e]
290
+ ), E = y(
291
+ (t) => {
292
+ x == null || x(t), !n && (s.setFocusedValue(e), t.currentTarget.focus());
293
+ },
294
+ [x, n, s, e]
295
+ ), f = [C.item, g].filter(Boolean).join(" ");
296
+ return /* @__PURE__ */ Z(
297
+ "div",
298
+ {
299
+ ref: h,
300
+ role: "option",
301
+ "aria-selected": S,
302
+ "aria-disabled": n ? !0 : void 0,
303
+ tabIndex: b ? 0 : -1,
304
+ onClick: c,
305
+ onKeyDown: _,
306
+ onMouseEnter: E,
307
+ className: f,
308
+ "data-state": S ? "selected" : "unselected",
309
+ "data-disabled": n ? !0 : void 0,
310
+ "data-focused": b ? !0 : void 0,
311
+ ...o,
312
+ children: [
313
+ l,
314
+ S && /* @__PURE__ */ m("span", { className: C["item-check"], "aria-hidden": "true", children: /* @__PURE__ */ m("svg", { viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", children: /* @__PURE__ */ m("polyline", { points: "2,6 5,9 10,3" }) }) })
315
+ ]
316
+ }
317
+ );
318
+ }
319
+ );
320
+ se.displayName = "VhyxSelectItem";
321
+ function ie({ children: e, className: n, ...l }) {
322
+ const g = D("vhyx-select-group-label"), r = [C.group, n].filter(Boolean).join(" ");
323
+ return /* @__PURE__ */ m("div", { role: "group", "aria-labelledby": g, className: r, ...l, children: k.Children.map(e, (u) => k.isValidElement(u) && u.type.displayName === "VhyxSelectLabel" ? k.cloneElement(u, { id: g }) : u) });
324
+ }
325
+ ie.displayName = "VhyxSelectGroup";
326
+ function ce({ children: e, className: n, ...l }) {
327
+ const g = [C.label, n].filter(Boolean).join(" ");
328
+ return /* @__PURE__ */ m("span", { className: g, ...l, children: e });
329
+ }
330
+ ce.displayName = "VhyxSelectLabel";
331
+ function ae({ className: e, ...n }) {
332
+ const l = [C.separator, e].filter(Boolean).join(" ");
333
+ return /* @__PURE__ */ m("hr", { "aria-hidden": "true", className: l, ...n });
334
+ }
335
+ ae.displayName = "VhyxSelectSeparator";
336
+ const Re = { ...ee, id: "vhyxui-select" }, _e = Object.assign(
337
+ ye(ne, Re),
338
+ {
339
+ Trigger: re,
340
+ Content: oe,
341
+ Item: se,
342
+ Group: ie,
343
+ Label: ce,
344
+ Separator: ae
345
+ }
346
+ );
347
+ _e.displayName = "VhyxSelect";
348
+ export {
349
+ _e as S
350
+ };
@@ -0,0 +1 @@
1
+ "use strict";const f=require("react/jsx-runtime"),e=require("react"),ce=require("react-dom"),N=require("@vhyxui/core"),ie=require("@vhyxseal/react"),M=require("./useId-D2AEOm2G.cjs"),O=require("./floatingPosition-oslPPzF_.cjs"),ae="_trigger_1t193_3",le="_content_1t193_81",ue="_item_1t193_101",de="_group_1t193_152",fe="_label_1t193_158",pe="_separator_1t193_170",C={trigger:ae,"trigger-value":"_trigger-value_1t193_62","trigger-icon":"_trigger-icon_1t193_70",content:le,item:ue,"item-check":"_item-check_1t193_141",group:de,label:fe,separator:pe},J=e.createContext(null);function A(t){return t==null||typeof t=="boolean"?"":typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(A).join(""):e.isValidElement(t)?A(t.props.children):""}function D(t){const r=e.useContext(J);if(!r)throw new N.VhyxUIError({code:N.VhyxUIErrorCode.VHYXUI_MISSING_CONTEXT,message:`${t} must be used within <Select>`,suggestion:"Wrap your component tree with <Select>"});return r}const $=e.forwardRef(({value:t,defaultValue:r,onValueChange:u,disabled:h=!1,size:o="md",placeholder:d,contract:v,children:s,className:y,...c},S)=>{const w=M.useId("vhyx-select-trigger"),p=M.useId("vhyx-select-content"),x=M.useId("vhyx-select"),a=t!==void 0,[I,E]=e.useState(r),g=a?t:I,[n,R]=e.useState(!1),[_,b]=e.useState(void 0),V=e.useRef(null),H=e.useRef(null),L=e.useRef(new Map),B=e.useRef([]),q=e.useRef(new Map),[z,T]=e.useState(void 0),P=e.useRef(g);P.current=g,e.useEffect(()=>{if(g===void 0){T(void 0);return}const i=L.current.get(g);T(i?i.label:void 0)},[g]);const W=e.useCallback((i,l,m)=>{L.current.has(i)||B.current.push(i);const k={label:l};m!==void 0&&(k.disabled=m),L.current.set(i,k),i===P.current&&T(l)},[]),U=e.useCallback(()=>z,[z]),G=e.useCallback(i=>{var k;const l=B.current.filter(j=>{var Y;return!((Y=L.current.get(j))!=null&&Y.disabled)});if(l.length===0)return;let m;if(i==="home")m=l[0];else if(i==="end")m=l[l.length-1];else{const j=_!==void 0?l.indexOf(_):-1;m=i==="down"?l[Math.min(j+1,l.length-1)]:l[Math.max(j-1,0)]}m!==void 0&&(b(m),(k=q.current.get(m))==null||k.focus())},[_]),F=e.useCallback(i=>{var l;a||E(i),u==null||u(i),R(!1),b(void 0),(l=V.current)==null||l.focus()},[a,u]),X=e.useCallback(i=>{if(R(i),i){const l=g??B.current[0];b(l)}else b(void 0)},[g]),oe=e.useMemo(()=>({...N.selectContract,id:x,...v}),[x,v]),se=e.useMemo(()=>({value:g,onValueChange:F,open:n,onOpenChange:X,disabled:h,size:o,placeholder:d,triggerId:w,contentId:p,triggerRef:V,contentRef:H,focusedValue:_,setFocusedValue:b,registerItem:W,getSelectedLabel:U,navigateItems:G,itemElementsRef:q,itemOrderRef:B,itemRegistryRef:L}),[g,F,n,X,h,o,d,w,p,_,W,U,G]);return e.useEffect(()=>{if(!n)return;function i(l){var m;l.key==="Escape"&&(R(!1),b(void 0),(m=V.current)==null||m.focus())}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n]),e.useEffect(()=>{if(!n)return;function i(l){var k,j;const m=l.target;(k=V.current)!=null&&k.contains(m)||(j=H.current)!=null&&j.contains(m)||(R(!1),b(void 0))}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),f.jsx(J.Provider,{value:se,children:f.jsx("div",{ref:S,className:y,"data-size":o,"data-disabled":h?!0:void 0,"data-vhyx-contract":JSON.stringify(oe),...c,children:s})})});$.displayName="VhyxSelect";const K=e.forwardRef((t,r)=>{const{icon:u,className:h,asChild:o=!1,children:d,...v}=t,s=D("Select.Trigger"),y=s.getSelectedLabel(),c=e.useCallback(a=>{s.triggerRef.current=a,typeof r=="function"?r(a):r&&(r.current=a)},[r,s.triggerRef]),S=e.useCallback(()=>{s.disabled||s.onOpenChange(!s.open)},[s]),w=e.useCallback(a=>{(a.key==="ArrowDown"||a.key==="ArrowUp")&&(a.preventDefault(),s.open||s.onOpenChange(!0))},[s]),p=[C.trigger,h].filter(Boolean).join(" "),x={id:s.triggerId,role:"combobox","aria-haspopup":"listbox","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,disabled:s.disabled,onClick:S,onKeyDown:w,className:p,"data-size":s.size,"data-state":s.open?"open":"closed","data-placeholder":y?void 0:!0,...v};return o?f.jsx(N.Slot,{ref:c,...x,children:d}):f.jsxs("button",{ref:c,type:"button",...x,children:[f.jsx("span",{className:C["trigger-value"],children:y??s.placeholder??"Select…"}),f.jsx("span",{className:C["trigger-icon"],"aria-hidden":"true",children:u??f.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:f.jsx("path",{d:"M2.5 4.5L6 8L9.5 4.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});K.displayName="VhyxSelectTrigger";function Q({children:t,className:r,style:u,...h}){const o=D("Select.Content"),[d,v]=e.useState(!1),[s,y]=e.useState({position:"fixed",top:0,left:0,minWidth:0,zIndex:"var(--vhyx-z-dropdown)"});e.useEffect(()=>{v(!0)},[]),e.useEffect(()=>{if(!o.open||!o.triggerRef.current)return;const p=()=>{var b;const a=o.triggerRef.current.getBoundingClientRect(),I=window.innerHeight-a.bottom,E=a.top,g=((b=o.contentRef.current)==null?void 0:b.scrollHeight)??300,n=I<g&&E>I,R=n?Math.min(g,E-8):Math.min(g,I-8),_=n?a.top-R-4:a.bottom+4;y({position:"fixed",top:O.clampToViewport(_,R,window.innerHeight),left:O.clampToViewport(a.left,a.width,window.innerWidth),minWidth:a.width,zIndex:"var(--vhyx-z-dropdown)",maxHeight:R,overflowY:"auto"})};p();const x=O.rafBatched(p);return window.addEventListener("scroll",x.run,!0),window.addEventListener("resize",x.run),()=>{x.cancel(),window.removeEventListener("scroll",x.run,!0),window.removeEventListener("resize",x.run)}},[o.open,o.triggerRef]),e.useEffect(()=>{var p;!o.open||!o.focusedValue||(p=o.itemElementsRef.current.get(o.focusedValue))==null||p.focus()},[o.open]);const c=e.useCallback(p=>{o.contentRef.current=p},[o.contentRef]);if(!d)return null;const S=[C.content,r].filter(Boolean).join(" "),w=f.jsx("div",{ref:c,id:o.contentId,role:"listbox","aria-labelledby":o.triggerId,className:S,"data-state":o.open?"open":"closed",...h,style:{...u,...s},children:t});return ce.createPortal(w,document.body)}Q.displayName="VhyxSelectContent";const Z=e.forwardRef(({value:t,disabled:r,children:u,className:h,onClick:o,onKeyDown:d,onMouseEnter:v,...s},y)=>{const c=D("Select.Item"),S=c.value===t,w=c.focusedValue===t,p=A(u);e.useEffect(()=>{c.registerItem(t,p,r)},[c,t,p,r]);const x=e.useCallback(n=>{n?c.itemElementsRef.current.set(t,n):c.itemElementsRef.current.delete(t),typeof y=="function"?y(n):y&&(y.current=n)},[y,c,t]),a=e.useCallback(n=>{o==null||o(n),r||c.onValueChange(t)},[o,r,c,t]),I=e.useCallback(n=>{d==null||d(n),n.key==="Enter"||n.key===" "?(n.preventDefault(),r||c.onValueChange(t)):n.key==="ArrowDown"?(n.preventDefault(),c.navigateItems("down")):n.key==="ArrowUp"?(n.preventDefault(),c.navigateItems("up")):n.key==="Home"?(n.preventDefault(),c.navigateItems("home")):n.key==="End"&&(n.preventDefault(),c.navigateItems("end"))},[d,r,c,t]),E=e.useCallback(n=>{v==null||v(n),!r&&(c.setFocusedValue(t),n.currentTarget.focus())},[v,r,c,t]),g=[C.item,h].filter(Boolean).join(" ");return f.jsxs("div",{ref:x,role:"option","aria-selected":S,"aria-disabled":r?!0:void 0,tabIndex:w?0:-1,onClick:a,onKeyDown:I,onMouseEnter:E,className:g,"data-state":S?"selected":"unselected","data-disabled":r?!0:void 0,"data-focused":w?!0:void 0,...s,children:[u,S&&f.jsx("span",{className:C["item-check"],"aria-hidden":"true",children:f.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:f.jsx("polyline",{points:"2,6 5,9 10,3"})})})]})});Z.displayName="VhyxSelectItem";function ee({children:t,className:r,...u}){const h=M.useId("vhyx-select-group-label"),o=[C.group,r].filter(Boolean).join(" ");return f.jsx("div",{role:"group","aria-labelledby":h,className:o,...u,children:e.Children.map(t,d=>e.isValidElement(d)&&d.type.displayName==="VhyxSelectLabel"?e.cloneElement(d,{id:h}):d)})}ee.displayName="VhyxSelectGroup";function te({children:t,className:r,...u}){const h=[C.label,r].filter(Boolean).join(" ");return f.jsx("span",{className:h,...u,children:t})}te.displayName="VhyxSelectLabel";function ne({className:t,...r}){const u=[C.separator,t].filter(Boolean).join(" ");return f.jsx("hr",{"aria-hidden":"true",className:u,...r})}ne.displayName="VhyxSelectSeparator";const ge={...N.selectContract,id:"vhyxui-select"},re=Object.assign(ie.withAgentContract($,ge),{Trigger:K,Content:Q,Item:Z,Group:ee,Label:te,Separator:ne});re.displayName="VhyxSelect";exports.Select=re;
@@ -0,0 +1,49 @@
1
+ import { jsx as e, jsxs as S } from "react/jsx-runtime";
2
+ import { F as v } from "./Field-Dx9gXxGL.js";
3
+ import { S as r } from "./Select-CgjfJSB8.js";
4
+ function x({
5
+ name: t,
6
+ label: i,
7
+ hint: a,
8
+ error: n,
9
+ required: d,
10
+ optional: m,
11
+ layout: o,
12
+ options: c,
13
+ placeholder: s,
14
+ value: f,
15
+ onValueChange: h,
16
+ disabled: p,
17
+ size: u
18
+ }) {
19
+ return /* @__PURE__ */ e(
20
+ v,
21
+ {
22
+ name: t,
23
+ label: i,
24
+ hint: a,
25
+ error: n,
26
+ required: d,
27
+ optional: m,
28
+ layout: o,
29
+ children: /* @__PURE__ */ S(
30
+ r,
31
+ {
32
+ value: f,
33
+ onValueChange: h,
34
+ disabled: p,
35
+ size: u,
36
+ placeholder: s,
37
+ children: [
38
+ /* @__PURE__ */ e(r.Trigger, { "aria-label": typeof i == "string" ? i : void 0 }),
39
+ /* @__PURE__ */ e(r.Content, { children: c.map((l) => /* @__PURE__ */ e(r.Item, { value: l.value, children: l.label }, l.value)) })
40
+ ]
41
+ }
42
+ )
43
+ }
44
+ );
45
+ }
46
+ x.displayName = "VhyxSelectField";
47
+ export {
48
+ x as S
49
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),m=require("./Field-DJvjEmzE.cjs"),l=require("./Select-D_oVKzzK.cjs");function c({name:r,label:i,hint:n,error:s,required:d,optional:u,layout:a,options:S,placeholder:x,value:j,onValueChange:h,disabled:o,size:F}){return e.jsx(m.Field,{name:r,label:i,hint:n,error:s,required:d,optional:u,layout:a,children:e.jsxs(l.Select,{value:j,onValueChange:h,disabled:o,size:F,placeholder:x,children:[e.jsx(l.Select.Trigger,{"aria-label":typeof i=="string"?i:void 0}),e.jsx(l.Select.Content,{children:S.map(t=>e.jsx(l.Select.Item,{value:t.value,children:t.label},t.value))})]})})}c.displayName="VhyxSelectField";exports.SelectField=c;
@@ -0,0 +1,52 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import d from "react";
3
+ import { separatorContract as m } from "@vhyxui/core";
4
+ import { withAgentContract as h } from "@vhyxseal/react";
5
+ const _ = "_separator_2n49e_1", x = "_line_2n49e_28", r = {
6
+ separator: _,
7
+ "separator--labeled": "_separator--labeled_2n49e_21",
8
+ line: x,
9
+ "label-text": "_label-text_2n49e_34"
10
+ }, i = d.forwardRef(
11
+ ({
12
+ orientation: a = "horizontal",
13
+ decorative: t = !0,
14
+ label: o,
15
+ className: s,
16
+ ...n
17
+ }, l) => {
18
+ const p = {
19
+ className: [r.separator, s].filter(Boolean).join(" "),
20
+ "data-orientation": a,
21
+ ...t ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": a },
22
+ ...n
23
+ };
24
+ return o && a === "horizontal" ? /* @__PURE__ */ c(
25
+ "div",
26
+ {
27
+ ref: l,
28
+ className: [r["separator--labeled"], s].filter(Boolean).join(" "),
29
+ "data-orientation": a,
30
+ ...t ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": a },
31
+ ...n,
32
+ children: [
33
+ /* @__PURE__ */ e("span", { className: r.line }),
34
+ /* @__PURE__ */ e("span", { className: r["label-text"], children: o }),
35
+ /* @__PURE__ */ e("span", { className: r.line })
36
+ ]
37
+ }
38
+ ) : /* @__PURE__ */ e(
39
+ "hr",
40
+ {
41
+ ref: l,
42
+ ...p
43
+ }
44
+ );
45
+ }
46
+ );
47
+ i.displayName = "VhyxSeparator";
48
+ const f = { ...m, id: "vhyxui-separator" }, u = h(i, f);
49
+ u.displayName = "VhyxSeparator";
50
+ export {
51
+ u as S
52
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),d=require("react"),h=require("@vhyxui/core"),u=require("@vhyxseal/react"),x="_separator_2n49e_1",_="_line_2n49e_28",r={separator:x,"separator--labeled":"_separator--labeled_2n49e_21",line:_,"label-text":"_label-text_2n49e_34"},i=d.forwardRef(({orientation:a="horizontal",decorative:t=!0,label:s,className:o,...n},l)=>{const c={className:[r.separator,o].filter(Boolean).join(" "),"data-orientation":a,...t?{"aria-hidden":!0}:{role:"separator","aria-orientation":a},...n};return s&&a==="horizontal"?e.jsxs("div",{ref:l,className:[r["separator--labeled"],o].filter(Boolean).join(" "),"data-orientation":a,...t?{"aria-hidden":!0}:{role:"separator","aria-orientation":a},...n,children:[e.jsx("span",{className:r.line}),e.jsx("span",{className:r["label-text"],children:s}),e.jsx("span",{className:r.line})]}):e.jsx("hr",{ref:l,...c})});i.displayName="VhyxSeparator";const j={...h.separatorContract,id:"vhyxui-separator"},p=u.withAgentContract(i,j);p.displayName="VhyxSeparator";exports.Separator=p;
@@ -0,0 +1,20 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { c as k } from "./cx-OWdTFKLx.js";
3
+ const p = "_skeleton_pcsk4_6", d = {
4
+ skeleton: p
5
+ };
6
+ function y({ variant: i = "rect", width: a, height: n, lines: t, className: o, style: r, ...s }) {
7
+ const c = { ...a !== void 0 ? { width: a } : {}, ...n !== void 0 ? { height: n } : {} };
8
+ return t && t > 1 ? /* @__PURE__ */ e("span", { "aria-hidden": "true", style: { display: "block", ...r }, className: o, ...s, children: Array.from({ length: t }, (m, l) => /* @__PURE__ */ e(
9
+ "span",
10
+ {
11
+ className: d.skeleton,
12
+ "data-variant": "text",
13
+ style: { ...c, ...l === t - 1 ? { width: "60%" } : {} }
14
+ },
15
+ l
16
+ )) }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", className: k(d.skeleton, o), "data-variant": i, style: { ...c, ...r }, ...s });
17
+ }
18
+ export {
19
+ y as S
20
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),k=require("./cx-dgWA95G6.cjs"),u="_skeleton_pcsk4_6",l={skeleton:u};function x({variant:d="rect",width:s,height:n,lines:e,className:a,style:r,...o}){const c={...s!==void 0?{width:s}:{},...n!==void 0?{height:n}:{}};return e&&e>1?t.jsx("span",{"aria-hidden":"true",style:{display:"block",...r},className:a,...o,children:Array.from({length:e},(p,i)=>t.jsx("span",{className:l.skeleton,"data-variant":"text",style:{...c,...i===e-1?{width:"60%"}:{}}},i))}):t.jsx("span",{"aria-hidden":"true",className:k.cx(l.skeleton,a),"data-variant":d,style:{...c,...r},...o})}exports.Skeleton=x;
@@ -0,0 +1 @@
1
+ "use strict";const n=require("react/jsx-runtime"),d=require("react"),h=require("@vhyxui/core"),u=require("@vhyxseal/react"),x="_spinner_1hvno_17",g={spinner:x},t={xs:12,sm:20,md:32,lg:48,xl:64},s=d.forwardRef(({size:e="md",variant:o="default",label:r="Loading",className:a,...c},l)=>{const p=[g.spinner,a].filter(Boolean).join(" ");return n.jsxs("svg",{ref:l,role:"status","aria-label":r,width:t[e],height:t[e],viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:p,"data-size":e,"data-variant":o,...c,children:[n.jsx("title",{children:r}),n.jsx("circle",{cx:12,cy:12,r:9,strokeWidth:2.5,stroke:"currentColor",opacity:.2}),n.jsx("path",{d:"M12 3a9 9 0 0 1 9 9",strokeWidth:2.5,stroke:"currentColor",strokeLinecap:"round"})]})});s.displayName="VhyxSpinner";const m={...h.spinnerContract,id:"vhyxui-spinner"},i=u.withAgentContract(s,m);i.displayName="VhyxSpinner";exports.Spinner=i;
@@ -1,42 +1,42 @@
1
- import { j as n } from "./jsx-runtime-CL69jGNW.js";
2
- import l from "react";
3
- import { spinnerContract as d } from "@vhyxui/core";
4
- import { withAgentContract as m } from "@vhyxseal/react";
5
- const x = "_spinner_1hvno_17", h = {
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import d from "react";
3
+ import { spinnerContract as m } from "@vhyxui/core";
4
+ import { withAgentContract as h } from "@vhyxseal/react";
5
+ const x = "_spinner_1hvno_17", f = {
6
6
  spinner: x
7
- }, s = {
7
+ }, e = {
8
8
  xs: 12,
9
9
  sm: 20,
10
10
  md: 32,
11
11
  lg: 48,
12
12
  xl: 64
13
- }, e = l.forwardRef(
13
+ }, o = d.forwardRef(
14
14
  ({
15
- size: r = "md",
16
- variant: o = "default",
15
+ size: n = "md",
16
+ variant: s = "default",
17
17
  label: t = "Loading",
18
18
  className: i,
19
19
  ...a
20
- }, p) => {
21
- const c = [h.spinner, i].filter(Boolean).join(" ");
22
- return /* @__PURE__ */ n.jsxs(
20
+ }, c) => {
21
+ const p = [f.spinner, i].filter(Boolean).join(" ");
22
+ return /* @__PURE__ */ l(
23
23
  "svg",
24
24
  {
25
- ref: p,
25
+ ref: c,
26
26
  role: "status",
27
27
  "aria-label": t,
28
- width: s[r],
29
- height: s[r],
28
+ width: e[n],
29
+ height: e[n],
30
30
  viewBox: "0 0 24 24",
31
31
  fill: "none",
32
32
  xmlns: "http://www.w3.org/2000/svg",
33
- className: c,
34
- "data-size": r,
35
- "data-variant": o,
33
+ className: p,
34
+ "data-size": n,
35
+ "data-variant": s,
36
36
  ...a,
37
37
  children: [
38
- /* @__PURE__ */ n.jsx("title", { children: t }),
39
- /* @__PURE__ */ n.jsx(
38
+ /* @__PURE__ */ r("title", { children: t }),
39
+ /* @__PURE__ */ r(
40
40
  "circle",
41
41
  {
42
42
  cx: 12,
@@ -47,7 +47,7 @@ const x = "_spinner_1hvno_17", h = {
47
47
  opacity: 0.2
48
48
  }
49
49
  ),
50
- /* @__PURE__ */ n.jsx(
50
+ /* @__PURE__ */ r(
51
51
  "path",
52
52
  {
53
53
  d: "M12 3a9 9 0 0 1 9 9",
@@ -61,9 +61,9 @@ const x = "_spinner_1hvno_17", h = {
61
61
  );
62
62
  }
63
63
  );
64
- e.displayName = "VhyxSpinner";
65
- const f = { ...d, id: "vhyxui-spinner" }, g = m(e, f);
66
- g.displayName = "VhyxSpinner";
64
+ o.displayName = "VhyxSpinner";
65
+ const g = { ...m, id: "vhyxui-spinner" }, w = h(o, g);
66
+ w.displayName = "VhyxSpinner";
67
67
  export {
68
- g as S
68
+ w as S
69
69
  };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("react/jsx-runtime"),n=require("react"),m=require("./cx-dgWA95G6.cjs"),i=require("./utils.cjs"),V="_stack_10gdj_1",w={stack:V},h={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},j={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"},a=n.forwardRef(({as:e="div",direction:t="column",gap:c=3,align:r,justify:o,wrap:x=!1,collapseBelow:u,padding:d,className:f,style:p,...y},S)=>s.jsx(e,{ref:S,className:m.cx(w.stack,f),"data-direction":t,"data-wrap":x?"true":void 0,"data-collapse":u,style:{gap:i.spaceVar(c),...r?{alignItems:h[r]}:{},...o?{justifyContent:j[o]}:{},...d!==void 0?{padding:i.spaceVar(d)}:{},...p},...y}));a.displayName="VhyxStack";const l=n.forwardRef(({align:e="center",...t},c)=>s.jsx(a,{ref:c,direction:"row",align:e,...t}));l.displayName="VhyxHStack";const k=n.forwardRef((e,t)=>s.jsx(a,{ref:t,direction:"column",...e}));k.displayName="VhyxVStack";exports.HStack=l;exports.Stack=a;exports.VStack=k;
@@ -0,0 +1,49 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import c from "react";
3
+ import { c as y } from "./cx-OWdTFKLx.js";
4
+ import { spaceVar as l } from "./utils.js";
5
+ const S = "_stack_10gdj_1", w = {
6
+ stack: S
7
+ }, V = {
8
+ start: "flex-start",
9
+ center: "center",
10
+ end: "flex-end",
11
+ stretch: "stretch",
12
+ baseline: "baseline"
13
+ }, h = {
14
+ start: "flex-start",
15
+ center: "center",
16
+ end: "flex-end",
17
+ between: "space-between",
18
+ around: "space-around",
19
+ evenly: "space-evenly"
20
+ }, r = c.forwardRef(
21
+ ({ as: e = "div", direction: t = "column", gap: a = 3, align: n, justify: o, wrap: i = !1, collapseBelow: f, padding: d, className: m, style: p, ...k }, x) => /* @__PURE__ */ s(
22
+ e,
23
+ {
24
+ ref: x,
25
+ className: y(w.stack, m),
26
+ "data-direction": t,
27
+ "data-wrap": i ? "true" : void 0,
28
+ "data-collapse": f,
29
+ style: {
30
+ gap: l(a),
31
+ ...n ? { alignItems: V[n] } : {},
32
+ ...o ? { justifyContent: h[o] } : {},
33
+ ...d !== void 0 ? { padding: l(d) } : {},
34
+ ...p
35
+ },
36
+ ...k
37
+ }
38
+ )
39
+ );
40
+ r.displayName = "VhyxStack";
41
+ const u = c.forwardRef(({ align: e = "center", ...t }, a) => /* @__PURE__ */ s(r, { ref: a, direction: "row", align: e, ...t }));
42
+ u.displayName = "VhyxHStack";
43
+ const v = c.forwardRef((e, t) => /* @__PURE__ */ s(r, { ref: t, direction: "column", ...e }));
44
+ v.displayName = "VhyxVStack";
45
+ export {
46
+ u as H,
47
+ r as S,
48
+ v as V
49
+ };
@@ -0,0 +1 @@
1
+ "use strict";const o=require("react/jsx-runtime"),s=require("react"),h=require("@vhyxui/core"),E=require("@vhyxseal/react"),J=require("./useId-D2AEOm2G.cjs"),O="_thumb_du6cw_38",m={switch:"_switch_du6cw_1",thumb:O},x=s.forwardRef(({checked:l,defaultChecked:b=!1,onCheckedChange:c,size:y="md",asChild:p=!1,contract:v,className:_,id:j,disabled:n,onClick:e,onKeyDown:r,children:q,...I},d)=>{const N=J.useId("vhyx-switch"),w=j??N,u=l!==void 0,[R,B]=s.useState(b),a=u?l:R,i=s.useCallback(()=>{if(n)return;const t=!a;u||B(t),c==null||c(t)},[n,a,u,c]),V=s.useCallback(t=>{e==null||e(t),i()},[e,i]),k=s.useCallback(t=>{r==null||r(t),t.key==="Enter"&&(t.preventDefault(),i())},[r,i]),z={...h.switchContract,id:w,...v},A=[m.switch,_].filter(Boolean).join(" "),f={id:w,role:"switch","aria-checked":a,disabled:n,onClick:V,onKeyDown:k,className:A,"data-state":a?"checked":"unchecked","data-size":y,"data-vhyx-contract":JSON.stringify(z),...I};return p?o.jsx(h.Slot,{ref:d,...f,children:q}):o.jsx("button",{ref:d,type:"button",...f,children:o.jsx("span",{className:m.thumb})})});x.displayName="VhyxSwitch";const P={...h.switchContract,id:"vhyxui-switch"},S=E.withAgentContract(x,P);S.displayName="VhyxSwitch";exports.Switch=S;