@vhyxui/react 0.1.3-alpha → 0.2.1-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.
- package/dist/{Badge-Fuc7l-1E.js → Badge-Bbxb4wyt.js} +7 -7
- package/dist/{Badge-RM7n86Rq.cjs → Badge-SBO9tGzn.cjs} +1 -1
- package/dist/{Button-D7eX45GC.js → Button-DDMc7-3S.js} +28 -28
- package/dist/{Button-AkUYT9eN.cjs → Button-akOSYEu9.cjs} +1 -1
- package/dist/Card-DSCA-Igh.cjs +1 -0
- package/dist/Card-Dh9Pcmfa.js +79 -0
- package/dist/Popover-BHGX_cC4.cjs +1 -0
- package/dist/Popover-u9vlClum.js +211 -0
- package/dist/Select-CGfKq69f.cjs +1 -0
- package/dist/Select-DHalg36V.js +344 -0
- package/dist/{SelectField-BYmKwRVU.cjs → SelectField-DG7SlT9m.cjs} +1 -1
- package/dist/{SelectField-DL7K4ZhA.js → SelectField-DTfYCDWa.js} +1 -1
- package/dist/{Spinner-CZSz1OpT.js → Spinner-BYi9eTfl.js} +19 -19
- package/dist/Spinner-CeIDpqkx.cjs +1 -0
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +26 -6
- package/dist/index.js +7 -7
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +7 -1
- package/dist/popover.js +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +19 -5
- package/dist/select.js +1 -1
- package/dist/selectfield.cjs +1 -1
- package/dist/selectfield.js +1 -1
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/Card-D7ZNeWtE.js +0 -75
- package/dist/Card-d5xrWgQS.cjs +0 -1
- package/dist/Popover-BPFkS4xn.cjs +0 -1
- package/dist/Popover-MxUovsIt.js +0 -194
- package/dist/Select-C9yB2B8M.cjs +0 -1
- package/dist/Select-DjeJOdb7.js +0 -327
- package/dist/Spinner-BZGPmp9c.cjs +0 -1
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { j as f } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
+
import E, { useState as k, useRef as N, useEffect as j, useCallback as x, useMemo as q, createContext as ae, useContext as le } from "react";
|
|
3
|
+
import de from "react-dom";
|
|
4
|
+
import { selectContract as K, Slot as ue, VhyxUIError as fe, VhyxUIErrorCode as pe } from "@vhyxui/core";
|
|
5
|
+
import { withAgentContract as ge } from "@vhyxseal/react";
|
|
6
|
+
import { u as z } from "./useId-BGRmH6iF.js";
|
|
7
|
+
const me = "_trigger_1t193_3", he = "_content_1t193_81", xe = "_item_1t193_101", ve = "_group_1t193_152", ye = "_label_1t193_158", Se = "_separator_1t193_170", b = {
|
|
8
|
+
trigger: me,
|
|
9
|
+
"trigger-value": "_trigger-value_1t193_62",
|
|
10
|
+
"trigger-icon": "_trigger-icon_1t193_70",
|
|
11
|
+
content: he,
|
|
12
|
+
item: xe,
|
|
13
|
+
"item-check": "_item-check_1t193_141",
|
|
14
|
+
group: ve,
|
|
15
|
+
label: ye,
|
|
16
|
+
separator: Se
|
|
17
|
+
}, Q = ae(null);
|
|
18
|
+
function A(r) {
|
|
19
|
+
const t = le(Q);
|
|
20
|
+
if (!t)
|
|
21
|
+
throw new fe({
|
|
22
|
+
code: pe.VHYXUI_MISSING_CONTEXT,
|
|
23
|
+
message: `${r} must be used within <Select>`,
|
|
24
|
+
suggestion: "Wrap your component tree with <Select>"
|
|
25
|
+
});
|
|
26
|
+
return t;
|
|
27
|
+
}
|
|
28
|
+
const Z = E.forwardRef(
|
|
29
|
+
({
|
|
30
|
+
value: r,
|
|
31
|
+
defaultValue: t,
|
|
32
|
+
onValueChange: a,
|
|
33
|
+
disabled: g = !1,
|
|
34
|
+
size: n = "md",
|
|
35
|
+
placeholder: u,
|
|
36
|
+
contract: y,
|
|
37
|
+
children: o,
|
|
38
|
+
className: v,
|
|
39
|
+
...s
|
|
40
|
+
}, S) => {
|
|
41
|
+
const w = z("vhyx-select-trigger"), l = z("vhyx-select-content"), m = z("vhyx-select"), d = r !== void 0, [L, R] = k(t), h = d ? r : L, [e, O] = k(!1), [V, I] = k(void 0), M = N(null), H = N(null), B = N(/* @__PURE__ */ new Map()), D = N([]), P = N(/* @__PURE__ */ new Map()), [U, T] = k(void 0), W = N(h);
|
|
42
|
+
W.current = h, j(() => {
|
|
43
|
+
if (h === void 0) {
|
|
44
|
+
T(void 0);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const i = B.current.get(h);
|
|
48
|
+
T(i ? i.label : void 0);
|
|
49
|
+
}, [h]);
|
|
50
|
+
const G = x(
|
|
51
|
+
(i, c, p) => {
|
|
52
|
+
B.current.has(i) || D.current.push(i);
|
|
53
|
+
const C = { label: c };
|
|
54
|
+
p !== void 0 && (C.disabled = p), B.current.set(i, C), i === W.current && T(c);
|
|
55
|
+
},
|
|
56
|
+
[]
|
|
57
|
+
), F = x(() => U, [U]), X = x(
|
|
58
|
+
(i) => {
|
|
59
|
+
var C;
|
|
60
|
+
const c = D.current.filter(
|
|
61
|
+
(_) => {
|
|
62
|
+
var $;
|
|
63
|
+
return !(($ = B.current.get(_)) != null && $.disabled);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
if (c.length === 0) return;
|
|
67
|
+
let p;
|
|
68
|
+
if (i === "home")
|
|
69
|
+
p = c[0];
|
|
70
|
+
else if (i === "end")
|
|
71
|
+
p = c[c.length - 1];
|
|
72
|
+
else {
|
|
73
|
+
const _ = V !== void 0 ? c.indexOf(V) : -1;
|
|
74
|
+
p = i === "down" ? c[Math.min(_ + 1, c.length - 1)] : c[Math.max(_ - 1, 0)];
|
|
75
|
+
}
|
|
76
|
+
p !== void 0 && (I(p), (C = P.current.get(p)) == null || C.focus());
|
|
77
|
+
},
|
|
78
|
+
[V]
|
|
79
|
+
), Y = x(
|
|
80
|
+
(i) => {
|
|
81
|
+
var c;
|
|
82
|
+
d || R(i), a == null || a(i), O(!1), I(void 0), (c = M.current) == null || c.focus();
|
|
83
|
+
},
|
|
84
|
+
[d, a]
|
|
85
|
+
), J = x(
|
|
86
|
+
(i) => {
|
|
87
|
+
if (O(i), i) {
|
|
88
|
+
const c = h ?? D.current[0];
|
|
89
|
+
I(c);
|
|
90
|
+
} else
|
|
91
|
+
I(void 0);
|
|
92
|
+
},
|
|
93
|
+
[h]
|
|
94
|
+
), ie = q(
|
|
95
|
+
() => ({ ...K, id: m, ...y }),
|
|
96
|
+
[m, y]
|
|
97
|
+
), ce = q(
|
|
98
|
+
() => ({
|
|
99
|
+
value: h,
|
|
100
|
+
onValueChange: Y,
|
|
101
|
+
open: e,
|
|
102
|
+
onOpenChange: J,
|
|
103
|
+
disabled: g,
|
|
104
|
+
size: n,
|
|
105
|
+
placeholder: u,
|
|
106
|
+
triggerId: w,
|
|
107
|
+
contentId: l,
|
|
108
|
+
triggerRef: M,
|
|
109
|
+
contentRef: H,
|
|
110
|
+
focusedValue: V,
|
|
111
|
+
setFocusedValue: I,
|
|
112
|
+
registerItem: G,
|
|
113
|
+
getSelectedLabel: F,
|
|
114
|
+
navigateItems: X,
|
|
115
|
+
itemElementsRef: P,
|
|
116
|
+
itemOrderRef: D,
|
|
117
|
+
itemRegistryRef: B
|
|
118
|
+
}),
|
|
119
|
+
[
|
|
120
|
+
h,
|
|
121
|
+
Y,
|
|
122
|
+
e,
|
|
123
|
+
J,
|
|
124
|
+
g,
|
|
125
|
+
n,
|
|
126
|
+
u,
|
|
127
|
+
w,
|
|
128
|
+
l,
|
|
129
|
+
V,
|
|
130
|
+
G,
|
|
131
|
+
F,
|
|
132
|
+
X
|
|
133
|
+
]
|
|
134
|
+
);
|
|
135
|
+
return j(() => {
|
|
136
|
+
if (!e) return;
|
|
137
|
+
function i(c) {
|
|
138
|
+
var p;
|
|
139
|
+
c.key === "Escape" && (O(!1), I(void 0), (p = M.current) == null || p.focus());
|
|
140
|
+
}
|
|
141
|
+
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
142
|
+
}, [e]), j(() => {
|
|
143
|
+
if (!e) return;
|
|
144
|
+
function i(c) {
|
|
145
|
+
var C, _;
|
|
146
|
+
const p = c.target;
|
|
147
|
+
(C = M.current) != null && C.contains(p) || (_ = H.current) != null && _.contains(p) || (O(!1), I(void 0));
|
|
148
|
+
}
|
|
149
|
+
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
150
|
+
}, [e]), /* @__PURE__ */ f.jsx(Q.Provider, { value: ce, children: /* @__PURE__ */ f.jsx(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
ref: S,
|
|
154
|
+
className: v,
|
|
155
|
+
"data-size": n,
|
|
156
|
+
"data-disabled": g ? !0 : void 0,
|
|
157
|
+
"data-vhyx-contract": JSON.stringify(ie),
|
|
158
|
+
...s,
|
|
159
|
+
children: o
|
|
160
|
+
}
|
|
161
|
+
) });
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
Z.displayName = "VhyxSelect";
|
|
165
|
+
const ee = E.forwardRef((r, t) => {
|
|
166
|
+
const { icon: a, className: g, asChild: n = !1, children: u, ...y } = r, o = A("Select.Trigger"), v = o.getSelectedLabel(), s = x(
|
|
167
|
+
(d) => {
|
|
168
|
+
o.triggerRef.current = d, typeof t == "function" ? t(d) : t && (t.current = d);
|
|
169
|
+
},
|
|
170
|
+
[t, o.triggerRef]
|
|
171
|
+
), S = x(() => {
|
|
172
|
+
o.disabled || o.onOpenChange(!o.open);
|
|
173
|
+
}, [o]), w = x(
|
|
174
|
+
(d) => {
|
|
175
|
+
(d.key === "ArrowDown" || d.key === "ArrowUp") && (d.preventDefault(), o.open || o.onOpenChange(!0));
|
|
176
|
+
},
|
|
177
|
+
[o]
|
|
178
|
+
), l = [b.trigger, g].filter(Boolean).join(" "), m = {
|
|
179
|
+
id: o.triggerId,
|
|
180
|
+
role: "combobox",
|
|
181
|
+
"aria-haspopup": "listbox",
|
|
182
|
+
"aria-expanded": o.open,
|
|
183
|
+
"aria-controls": o.open ? o.contentId : void 0,
|
|
184
|
+
disabled: o.disabled,
|
|
185
|
+
onClick: S,
|
|
186
|
+
onKeyDown: w,
|
|
187
|
+
className: l,
|
|
188
|
+
"data-size": o.size,
|
|
189
|
+
"data-state": o.open ? "open" : "closed",
|
|
190
|
+
"data-placeholder": v ? void 0 : !0,
|
|
191
|
+
...y
|
|
192
|
+
};
|
|
193
|
+
return n ? /* @__PURE__ */ f.jsx(ue, { ref: s, ...m, children: u }) : /* @__PURE__ */ f.jsxs("button", { ref: s, type: "button", ...m, children: [
|
|
194
|
+
/* @__PURE__ */ f.jsx("span", { className: b["trigger-value"], children: v ?? o.placeholder ?? "Select…" }),
|
|
195
|
+
/* @__PURE__ */ f.jsx("span", { className: b["trigger-icon"], "aria-hidden": "true", children: a ?? /* @__PURE__ */ f.jsx("svg", { viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ f.jsx("path", { d: "M2.5 4.5L6 8L9.5 4.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
196
|
+
] });
|
|
197
|
+
});
|
|
198
|
+
ee.displayName = "VhyxSelectTrigger";
|
|
199
|
+
function te({ children: r, className: t, style: a, ...g }) {
|
|
200
|
+
const n = A("Select.Content"), [u, y] = k(!1), [o, v] = k({
|
|
201
|
+
position: "fixed",
|
|
202
|
+
top: 0,
|
|
203
|
+
left: 0,
|
|
204
|
+
minWidth: 0,
|
|
205
|
+
zIndex: "var(--vhyx-z-dropdown)"
|
|
206
|
+
});
|
|
207
|
+
j(() => {
|
|
208
|
+
y(!0);
|
|
209
|
+
}, []), j(() => {
|
|
210
|
+
if (!n.open || !n.triggerRef.current) return;
|
|
211
|
+
const l = () => {
|
|
212
|
+
var e;
|
|
213
|
+
const m = n.triggerRef.current.getBoundingClientRect(), d = window.innerHeight - m.bottom, L = m.top, R = ((e = n.contentRef.current) == null ? void 0 : e.scrollHeight) ?? 300, h = d < R && L > d;
|
|
214
|
+
v({
|
|
215
|
+
position: "fixed",
|
|
216
|
+
top: h ? m.top - R - 4 : m.bottom + 4,
|
|
217
|
+
left: m.left,
|
|
218
|
+
minWidth: m.width,
|
|
219
|
+
zIndex: "var(--vhyx-z-dropdown)",
|
|
220
|
+
maxHeight: h ? Math.min(R, L - 8) : Math.min(R, d - 8),
|
|
221
|
+
overflowY: "auto"
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
|
|
225
|
+
window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
|
|
226
|
+
};
|
|
227
|
+
}, [n.open, n.triggerRef]), j(() => {
|
|
228
|
+
var l;
|
|
229
|
+
!n.open || !n.focusedValue || (l = n.itemElementsRef.current.get(n.focusedValue)) == null || l.focus();
|
|
230
|
+
}, [n.open]);
|
|
231
|
+
const s = x(
|
|
232
|
+
(l) => {
|
|
233
|
+
n.contentRef.current = l;
|
|
234
|
+
},
|
|
235
|
+
[n.contentRef]
|
|
236
|
+
);
|
|
237
|
+
if (!u) return null;
|
|
238
|
+
const S = [b.content, t].filter(Boolean).join(" "), w = /* @__PURE__ */ f.jsx(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
ref: s,
|
|
242
|
+
id: n.contentId,
|
|
243
|
+
role: "listbox",
|
|
244
|
+
"aria-labelledby": n.triggerId,
|
|
245
|
+
className: S,
|
|
246
|
+
"data-state": n.open ? "open" : "closed",
|
|
247
|
+
...g,
|
|
248
|
+
style: {
|
|
249
|
+
// Consumer's cosmetic style first — internal positioning/sizing keys
|
|
250
|
+
// (position/top/left/minWidth/zIndex/maxHeight/overflowY) are spread
|
|
251
|
+
// explicitly afterward so they always win, instead of letting a
|
|
252
|
+
// whole `style` object from a blind `{...rest}` spread replace this
|
|
253
|
+
// element's positioning outright.
|
|
254
|
+
...a,
|
|
255
|
+
...o
|
|
256
|
+
},
|
|
257
|
+
children: r
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
return de.createPortal(w, document.body);
|
|
261
|
+
}
|
|
262
|
+
te.displayName = "VhyxSelectContent";
|
|
263
|
+
const ne = E.forwardRef(
|
|
264
|
+
({ value: r, disabled: t, children: a, className: g, onClick: n, onKeyDown: u, onMouseEnter: y, ...o }, v) => {
|
|
265
|
+
const s = A("Select.Item"), S = s.value === r, w = s.focusedValue === r, l = typeof a == "string" ? a : "";
|
|
266
|
+
j(() => {
|
|
267
|
+
s.registerItem(r, l, t);
|
|
268
|
+
}, [s, r, l, t]);
|
|
269
|
+
const m = x(
|
|
270
|
+
(e) => {
|
|
271
|
+
e ? s.itemElementsRef.current.set(r, e) : s.itemElementsRef.current.delete(r), typeof v == "function" ? v(e) : v && (v.current = e);
|
|
272
|
+
},
|
|
273
|
+
[v, s, r]
|
|
274
|
+
), d = x(
|
|
275
|
+
(e) => {
|
|
276
|
+
n == null || n(e), t || s.onValueChange(r);
|
|
277
|
+
},
|
|
278
|
+
[n, t, s, r]
|
|
279
|
+
), L = x(
|
|
280
|
+
(e) => {
|
|
281
|
+
u == null || u(e), e.key === "Enter" || e.key === " " ? (e.preventDefault(), t || s.onValueChange(r)) : e.key === "ArrowDown" ? (e.preventDefault(), s.navigateItems("down")) : e.key === "ArrowUp" ? (e.preventDefault(), s.navigateItems("up")) : e.key === "Home" ? (e.preventDefault(), s.navigateItems("home")) : e.key === "End" && (e.preventDefault(), s.navigateItems("end"));
|
|
282
|
+
},
|
|
283
|
+
[u, t, s, r]
|
|
284
|
+
), R = x(
|
|
285
|
+
(e) => {
|
|
286
|
+
y == null || y(e), !t && (s.setFocusedValue(r), e.currentTarget.focus());
|
|
287
|
+
},
|
|
288
|
+
[y, t, s, r]
|
|
289
|
+
), h = [b.item, g].filter(Boolean).join(" ");
|
|
290
|
+
return /* @__PURE__ */ f.jsxs(
|
|
291
|
+
"div",
|
|
292
|
+
{
|
|
293
|
+
ref: m,
|
|
294
|
+
role: "option",
|
|
295
|
+
"aria-selected": S,
|
|
296
|
+
"aria-disabled": t ? !0 : void 0,
|
|
297
|
+
tabIndex: w ? 0 : -1,
|
|
298
|
+
onClick: d,
|
|
299
|
+
onKeyDown: L,
|
|
300
|
+
onMouseEnter: R,
|
|
301
|
+
className: h,
|
|
302
|
+
"data-state": S ? "selected" : "unselected",
|
|
303
|
+
"data-disabled": t ? !0 : void 0,
|
|
304
|
+
"data-focused": w ? !0 : void 0,
|
|
305
|
+
...o,
|
|
306
|
+
children: [
|
|
307
|
+
a,
|
|
308
|
+
S && /* @__PURE__ */ f.jsx("span", { className: b["item-check"], "aria-hidden": "true", children: /* @__PURE__ */ f.jsx("svg", { viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", children: /* @__PURE__ */ f.jsx("polyline", { points: "2,6 5,9 10,3" }) }) })
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
ne.displayName = "VhyxSelectItem";
|
|
315
|
+
function re({ children: r, className: t, ...a }) {
|
|
316
|
+
const g = z("vhyx-select-group-label"), n = [b.group, t].filter(Boolean).join(" ");
|
|
317
|
+
return /* @__PURE__ */ f.jsx("div", { role: "group", "aria-labelledby": g, className: n, ...a, children: E.Children.map(r, (u) => E.isValidElement(u) && u.type.displayName === "VhyxSelectLabel" ? E.cloneElement(u, { id: g }) : u) });
|
|
318
|
+
}
|
|
319
|
+
re.displayName = "VhyxSelectGroup";
|
|
320
|
+
function oe({ children: r, className: t, ...a }) {
|
|
321
|
+
const g = [b.label, t].filter(Boolean).join(" ");
|
|
322
|
+
return /* @__PURE__ */ f.jsx("span", { className: g, ...a, children: r });
|
|
323
|
+
}
|
|
324
|
+
oe.displayName = "VhyxSelectLabel";
|
|
325
|
+
function se({ className: r, ...t }) {
|
|
326
|
+
const a = [b.separator, r].filter(Boolean).join(" ");
|
|
327
|
+
return /* @__PURE__ */ f.jsx("hr", { "aria-hidden": "true", className: a, ...t });
|
|
328
|
+
}
|
|
329
|
+
se.displayName = "VhyxSelectSeparator";
|
|
330
|
+
const we = { ...K, id: "vhyxui-select" }, be = Object.assign(
|
|
331
|
+
ge(Z, we),
|
|
332
|
+
{
|
|
333
|
+
Trigger: ee,
|
|
334
|
+
Content: te,
|
|
335
|
+
Item: ne,
|
|
336
|
+
Group: re,
|
|
337
|
+
Label: oe,
|
|
338
|
+
Separator: se
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
be.displayName = "VhyxSelect";
|
|
342
|
+
export {
|
|
343
|
+
be as S
|
|
344
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BRMkMA8J.cjs"),R=require("./Field-D6FSsUGj.cjs"),t=require("./Select-
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-BRMkMA8J.cjs"),R=require("./Field-D6FSsUGj.cjs"),t=require("./Select-CGfKq69f.cjs");function r({name:l,label:i,hint:n,error:c,required:x,optional:u,layout:d,options:j,placeholder:o,value:m,onValueChange:a,disabled:S,size:p}){return e.jsxRuntimeExports.jsx(R.Field,{name:l,label:i,hint:n,error:c,required:x,optional:u,layout:d,children:e.jsxRuntimeExports.jsxs(t.Select,{value:m,onValueChange:a,disabled:S,size:p,placeholder:o,children:[e.jsxRuntimeExports.jsx(t.Select.Trigger,{"aria-label":typeof i=="string"?i:void 0}),e.jsxRuntimeExports.jsx(t.Select.Content,{children:j.map(s=>e.jsxRuntimeExports.jsx(t.Select.Item,{value:s.value,children:s.label},s.value))})]})})}r.displayName="VhyxSelectField";exports.SelectField=r;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as n } from "./jsx-runtime-CL69jGNW.js";
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { spinnerContract as d } from "@vhyxui/core";
|
|
4
4
|
import { withAgentContract as m } from "@vhyxseal/react";
|
|
5
|
-
const x = "
|
|
5
|
+
const x = "_spinner_1hvno_17", h = {
|
|
6
6
|
spinner: x
|
|
7
7
|
}, s = {
|
|
8
8
|
xs: 12,
|
|
@@ -12,31 +12,31 @@ const x = "_spinner_1udc2_1", h = {
|
|
|
12
12
|
xl: 64
|
|
13
13
|
}, e = l.forwardRef(
|
|
14
14
|
({
|
|
15
|
-
size:
|
|
15
|
+
size: r = "md",
|
|
16
16
|
variant: o = "default",
|
|
17
|
-
label:
|
|
17
|
+
label: t = "Loading",
|
|
18
18
|
className: i,
|
|
19
19
|
...a
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
20
|
+
}, p) => {
|
|
21
|
+
const c = [h.spinner, i].filter(Boolean).join(" ");
|
|
22
|
+
return /* @__PURE__ */ n.jsxs(
|
|
23
23
|
"svg",
|
|
24
24
|
{
|
|
25
|
-
ref:
|
|
25
|
+
ref: p,
|
|
26
26
|
role: "status",
|
|
27
|
-
"aria-label":
|
|
28
|
-
width: s[
|
|
29
|
-
height: s[
|
|
27
|
+
"aria-label": t,
|
|
28
|
+
width: s[r],
|
|
29
|
+
height: s[r],
|
|
30
30
|
viewBox: "0 0 24 24",
|
|
31
31
|
fill: "none",
|
|
32
32
|
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
-
className:
|
|
34
|
-
"data-size":
|
|
33
|
+
className: c,
|
|
34
|
+
"data-size": r,
|
|
35
35
|
"data-variant": o,
|
|
36
36
|
...a,
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ n.jsx("title", { children: t }),
|
|
39
|
+
/* @__PURE__ */ n.jsx(
|
|
40
40
|
"circle",
|
|
41
41
|
{
|
|
42
42
|
cx: 12,
|
|
@@ -47,7 +47,7 @@ const x = "_spinner_1udc2_1", h = {
|
|
|
47
47
|
opacity: 0.2
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ n.jsx(
|
|
51
51
|
"path",
|
|
52
52
|
{
|
|
53
53
|
d: "M12 3a9 9 0 0 1 9 9",
|
|
@@ -62,8 +62,8 @@ const x = "_spinner_1udc2_1", h = {
|
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
64
|
e.displayName = "VhyxSpinner";
|
|
65
|
-
const f = { ...d, id: "vhyxui-spinner" },
|
|
66
|
-
|
|
65
|
+
const f = { ...d, id: "vhyxui-spinner" }, g = m(e, f);
|
|
66
|
+
g.displayName = "VhyxSpinner";
|
|
67
67
|
export {
|
|
68
|
-
|
|
68
|
+
g as S
|
|
69
69
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-BRMkMA8J.cjs"),x=require("react"),d=require("@vhyxui/core"),u=require("@vhyxseal/react"),h="_spinner_1hvno_17",m={spinner:h},r={xs:12,sm:20,md:32,lg:48,xl:64},s=x.forwardRef(({size:t="md",variant:o="default",label:e="Loading",className:a,...c},p)=>{const l=[m.spinner,a].filter(Boolean).join(" ");return n.jsxRuntimeExports.jsxs("svg",{ref:p,role:"status","aria-label":e,width:r[t],height:r[t],viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l,"data-size":t,"data-variant":o,...c,children:[n.jsxRuntimeExports.jsx("title",{children:e}),n.jsxRuntimeExports.jsx("circle",{cx:12,cy:12,r:9,strokeWidth:2.5,stroke:"currentColor",opacity:.2}),n.jsxRuntimeExports.jsx("path",{d:"M12 3a9 9 0 0 1 9 9",strokeWidth:2.5,stroke:"currentColor",strokeLinecap:"round"})]})});s.displayName="VhyxSpinner";const j={...d.spinnerContract,id:"vhyxui-spinner"},i=u.withAgentContract(s,j);i.displayName="VhyxSpinner";exports.Spinner=i;
|
package/dist/badge.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Badge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Badge-SBO9tGzn.cjs");exports.Badge=e.Badge;
|
package/dist/badge.js
CHANGED
package/dist/button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Button-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Button-akOSYEu9.cjs");exports.Button=t.Button;
|
package/dist/button.js
CHANGED
package/dist/card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Card-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Card-DSCA-Igh.cjs");exports.Card=e.Card;
|
package/dist/card.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./VhyxUIProvider-C7ie8u2L.cjs"),u=require("./Button-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./VhyxUIProvider-C7ie8u2L.cjs"),u=require("./Button-akOSYEu9.cjs"),l=require("./Input-UQ2fQwE7.cjs"),T=require("./Textarea-H6evM8L4.cjs"),q=require("./Select-CGfKq69f.cjs"),g=require("./Checkbox-DvkT6QP9.cjs"),c=require("./RadioItem-BfkTHBxQ.cjs"),F=require("./Switch-BU_Tcttb.cjs"),s=require("./Field-D6FSsUGj.cjs"),m=require("./TextField-C3r-6jr6.cjs"),x=require("./SelectField-DG7SlT9m.cjs"),S=require("./TextareaField-D234Lyi_.cjs"),t=require("./Toast-ndaxbpcV.cjs"),P=require("./Alert-BJ1O0bnK.cjs"),f=require("./Badge-SBO9tGzn.cjs"),b=require("./Progress-FO-4WX0i.cjs"),v=require("./Spinner-CeIDpqkx.cjs"),I=require("./Dialog-gPT4noD8.cjs"),h=require("./Drawer-BygSIQQn.cjs"),w=require("./Tooltip-CCd6VRvZ.cjs"),B=require("./Popover-BHGX_cC4.cjs"),C=require("./Card-DSCA-Igh.cjs"),D=require("./Separator-C5lPGzes.cjs"),y=require("./Tabs-DuU02-UD.cjs"),A=require("./Breadcrumb-StitgXXx.cjs"),R=require("./Pagination-CmmcBPNz.cjs"),U=5e3;function o(i,r,e){const n={message:i,variant:r,duration:(e==null?void 0:e.duration)??U,dismissible:(e==null?void 0:e.dismissible)??!0};return(e==null?void 0:e.description)!==void 0&&(n.description=e.description),(e==null?void 0:e.action)!==void 0&&(n.action=e.action),n}function a(i,r){return t.addToast(o(i,"default",r))}a.success=function(r,e){return t.addToast(o(r,"success",e))};a.danger=function(r,e){return t.addToast(o(r,"danger",e))};a.warning=function(r,e){return t.addToast(o(r,"warning",e))};a.info=function(r,e){return t.addToast(o(r,"info",e))};a.dismiss=function(r){r!==void 0?t.dismissToast(r):t.dismissAllToasts()};const k=a;exports.VhyxUIProvider=d.VhyxUIProvider;exports.Button=u.Button;exports.Input=l.Input;exports.Textarea=T.Textarea;exports.Select=q.Select;exports.Checkbox=g.Checkbox;exports.RadioGroup=c.RadioGroup;exports.RadioItem=c.RadioItem;exports.Switch=F.Switch;exports.Field=s.Field;exports.Form=s.Form;exports.useFormContext=s.useFormContext;exports.TextField=m.TextField;exports.SelectField=x.SelectField;exports.TextareaField=S.TextareaField;exports.Toast=t.Toast;exports.ToastProvider=t.ToastProvider;exports.Alert=P.Alert;exports.Badge=f.Badge;exports.Progress=b.Progress;exports.Spinner=v.Spinner;exports.Dialog=I.Dialog;exports.Drawer=h.Drawer;exports.Tooltip=w.Tooltip;exports.Popover=B.Popover;exports.Card=C.Card;exports.Separator=D.Separator;exports.Tabs=y.Tabs;exports.Breadcrumb=A.Breadcrumb;exports.Pagination=R.Pagination;exports.toast=k;
|
package/dist/index.d.ts
CHANGED
|
@@ -672,8 +672,14 @@ export declare interface PopoverCloseProps extends default_2.ButtonHTMLAttribute
|
|
|
672
672
|
/**
|
|
673
673
|
* The floating panel. Rendered in a portal.
|
|
674
674
|
* Non-modal (aria-modal="false") — focus is NOT trapped.
|
|
675
|
+
*
|
|
676
|
+
* Deferred to client-only via `mounted` state, same pattern as
|
|
677
|
+
* Select.Content: SSR and client initial renders both produce null,
|
|
678
|
+
* eliminating both a hydration mismatch and a `document is not defined`
|
|
679
|
+
* crash from `ReactDOM.createPortal(..., document.body)` if this is open
|
|
680
|
+
* on first render (`document` doesn't exist during SSR).
|
|
675
681
|
*/
|
|
676
|
-
declare function PopoverContent({ children, className, side, align, ...rest }: PopoverContentProps): default_2.ReactPortal | null;
|
|
682
|
+
declare function PopoverContent({ children, className, side, align, style, ...rest }: PopoverContentProps): default_2.ReactPortal | null;
|
|
677
683
|
|
|
678
684
|
declare namespace PopoverContent {
|
|
679
685
|
var displayName: string;
|
|
@@ -801,7 +807,7 @@ export declare const Select: default_2.ComponentType<SelectProps & default_2.Ref
|
|
|
801
807
|
* SelectItem labels register on their own mount effects after this content
|
|
802
808
|
* mounts client-side, so the trigger label display is updated via state.
|
|
803
809
|
*/
|
|
804
|
-
declare function SelectContent({ children, className, ...rest }: SelectContentProps): default_2.ReactPortal | null;
|
|
810
|
+
declare function SelectContent({ children, className, style, ...rest }: SelectContentProps): default_2.ReactPortal | null;
|
|
805
811
|
|
|
806
812
|
declare namespace SelectContent {
|
|
807
813
|
var displayName: string;
|
|
@@ -918,12 +924,26 @@ export declare interface SelectSeparatorProps extends default_2.HTMLAttributes<H
|
|
|
918
924
|
/** Size tokens for Select. */
|
|
919
925
|
export declare type SelectSize = 'sm' | 'md' | 'lg';
|
|
920
926
|
|
|
921
|
-
|
|
927
|
+
declare type SelectTriggerBaseProps = Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
|
|
922
928
|
/** Optional icon rendered on the right. Defaults to a chevron SVG. */
|
|
923
929
|
icon?: default_2.ReactNode;
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Select.Trigger's default render always shows the selected value + a
|
|
934
|
+
* chevron icon — it never renders custom content, so `children` is not
|
|
935
|
+
* part of the props shape unless `asChild` is used. Use `asChild` with a
|
|
936
|
+
* single child element to fully customize what the trigger renders.
|
|
937
|
+
*/
|
|
938
|
+
export declare type SelectTriggerProps = (SelectTriggerBaseProps & {
|
|
939
|
+
/** Render as the child element via Slot, merging Select.Trigger's behavior onto it. */
|
|
940
|
+
asChild: true;
|
|
941
|
+
/** The single custom trigger element `asChild` merges open/close + aria/keyboard behavior onto. */
|
|
942
|
+
children: default_2.ReactElement;
|
|
943
|
+
}) | (SelectTriggerBaseProps & {
|
|
944
|
+
asChild?: false;
|
|
945
|
+
children?: never;
|
|
946
|
+
});
|
|
927
947
|
|
|
928
948
|
export declare const Separator: default_2.ForwardRefExoticComponent<default_2.PropsWithoutRef<SeparatorProps> & default_2.RefAttributes<HTMLElement>>;
|
|
929
949
|
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { V as l } from "./VhyxUIProvider-DVFSW4q-.js";
|
|
2
|
-
import { B as p } from "./Button-
|
|
2
|
+
import { B as p } from "./Button-DDMc7-3S.js";
|
|
3
3
|
import { I as S } from "./Input-BS_t1bl-.js";
|
|
4
4
|
import { T as P } from "./Textarea-CLrctxHU.js";
|
|
5
|
-
import { S as v } from "./Select-
|
|
5
|
+
import { S as v } from "./Select-DHalg36V.js";
|
|
6
6
|
import { C as D } from "./Checkbox-DWl91ci_.js";
|
|
7
7
|
import { R as A, a as C } from "./RadioItem-CzHSS_qK.js";
|
|
8
8
|
import { S as R } from "./Switch-DOAZfSV0.js";
|
|
9
9
|
import { F as y, a as U, u as V } from "./Field-Bv07PL2M.js";
|
|
10
10
|
import { T as E } from "./TextField-DtXQQJJk.js";
|
|
11
|
-
import { S as L } from "./SelectField-
|
|
11
|
+
import { S as L } from "./SelectField-DTfYCDWa.js";
|
|
12
12
|
import { T as O } from "./TextareaField-CpqPinvx.js";
|
|
13
13
|
import { b as s, c as i, d as m } from "./Toast-0acAjZTB.js";
|
|
14
14
|
import { T as j, a as q } from "./Toast-0acAjZTB.js";
|
|
15
15
|
import { A as H } from "./Alert-am3ANPTH.js";
|
|
16
|
-
import { B as K } from "./Badge-
|
|
16
|
+
import { B as K } from "./Badge-Bbxb4wyt.js";
|
|
17
17
|
import { P as Q } from "./Progress-DWLr6Bq2.js";
|
|
18
|
-
import { S as X } from "./Spinner-
|
|
18
|
+
import { S as X } from "./Spinner-BYi9eTfl.js";
|
|
19
19
|
import { D as Z } from "./Dialog-CtYu14zl.js";
|
|
20
20
|
import { D as rr } from "./Drawer-BFJxsPG1.js";
|
|
21
21
|
import { T as er } from "./Tooltip-BAmErB_g.js";
|
|
22
|
-
import { P as sr } from "./Popover-
|
|
23
|
-
import { C as fr } from "./Card-
|
|
22
|
+
import { P as sr } from "./Popover-u9vlClum.js";
|
|
23
|
+
import { C as fr } from "./Card-Dh9Pcmfa.js";
|
|
24
24
|
import { S as mr } from "./Separator-DQT58t90.js";
|
|
25
25
|
import { T as xr } from "./Tabs-BTfm4LbV.js";
|
|
26
26
|
import { B as cr } from "./Breadcrumb-Db7ASomJ.js";
|
package/dist/popover.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Popover-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Popover-BHGX_cC4.cjs");exports.Popover=e.Popover;
|
package/dist/popover.d.ts
CHANGED
|
@@ -32,8 +32,14 @@ export declare interface PopoverCloseProps extends default_2.ButtonHTMLAttribute
|
|
|
32
32
|
/**
|
|
33
33
|
* The floating panel. Rendered in a portal.
|
|
34
34
|
* Non-modal (aria-modal="false") — focus is NOT trapped.
|
|
35
|
+
*
|
|
36
|
+
* Deferred to client-only via `mounted` state, same pattern as
|
|
37
|
+
* Select.Content: SSR and client initial renders both produce null,
|
|
38
|
+
* eliminating both a hydration mismatch and a `document is not defined`
|
|
39
|
+
* crash from `ReactDOM.createPortal(..., document.body)` if this is open
|
|
40
|
+
* on first render (`document` doesn't exist during SSR).
|
|
35
41
|
*/
|
|
36
|
-
declare function PopoverContent({ children, className, side, align, ...rest }: PopoverContentProps): default_2.ReactPortal | null;
|
|
42
|
+
declare function PopoverContent({ children, className, side, align, style, ...rest }: PopoverContentProps): default_2.ReactPortal | null;
|
|
37
43
|
|
|
38
44
|
declare namespace PopoverContent {
|
|
39
45
|
var displayName: string;
|
package/dist/popover.js
CHANGED
package/dist/select.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Select-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Select-CGfKq69f.cjs");exports.Select=e.Select;
|
package/dist/select.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const Select: default_2.ComponentType<SelectProps & default_2.Ref
|
|
|
19
19
|
* SelectItem labels register on their own mount effects after this content
|
|
20
20
|
* mounts client-side, so the trigger label display is updated via state.
|
|
21
21
|
*/
|
|
22
|
-
declare function SelectContent({ children, className, ...rest }: SelectContentProps): default_2.ReactPortal | null;
|
|
22
|
+
declare function SelectContent({ children, className, style, ...rest }: SelectContentProps): default_2.ReactPortal | null;
|
|
23
23
|
|
|
24
24
|
declare namespace SelectContent {
|
|
25
25
|
var displayName: string;
|
|
@@ -87,11 +87,25 @@ export declare interface SelectSeparatorProps extends default_2.HTMLAttributes<H
|
|
|
87
87
|
/** Size tokens for Select. */
|
|
88
88
|
export declare type SelectSize = 'sm' | 'md' | 'lg';
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
declare type SelectTriggerBaseProps = Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
|
|
91
91
|
/** Optional icon rendered on the right. Defaults to a chevron SVG. */
|
|
92
92
|
icon?: default_2.ReactNode;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Select.Trigger's default render always shows the selected value + a
|
|
97
|
+
* chevron icon — it never renders custom content, so `children` is not
|
|
98
|
+
* part of the props shape unless `asChild` is used. Use `asChild` with a
|
|
99
|
+
* single child element to fully customize what the trigger renders.
|
|
100
|
+
*/
|
|
101
|
+
export declare type SelectTriggerProps = (SelectTriggerBaseProps & {
|
|
102
|
+
/** Render as the child element via Slot, merging Select.Trigger's behavior onto it. */
|
|
103
|
+
asChild: true;
|
|
104
|
+
/** The single custom trigger element `asChild` merges open/close + aria/keyboard behavior onto. */
|
|
105
|
+
children: default_2.ReactElement;
|
|
106
|
+
}) | (SelectTriggerBaseProps & {
|
|
107
|
+
asChild?: false;
|
|
108
|
+
children?: never;
|
|
109
|
+
});
|
|
96
110
|
|
|
97
111
|
export { }
|
package/dist/select.js
CHANGED