@vhyxui/react 0.1.2-alpha.2 → 0.2.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.
- 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-DG7SlT9m.cjs +1 -0
- package/dist/SelectField-DTfYCDWa.js +49 -0
- package/dist/{Spinner-CZSz1OpT.js → Spinner-BYi9eTfl.js} +19 -19
- package/dist/Spinner-CeIDpqkx.cjs +1 -0
- package/dist/TextField-C3r-6jr6.cjs +1 -0
- package/dist/TextField-DtXQQJJk.js +31 -0
- package/dist/TextareaField-CpqPinvx.js +31 -0
- package/dist/TextareaField-D234Lyi_.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 +129 -6
- package/dist/index.js +47 -41
- 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 -0
- package/dist/selectfield.d.ts +82 -0
- package/dist/selectfield.js +4 -0
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +1 -1
- package/dist/style.css +1 -1
- package/dist/textareafield.cjs +1 -0
- package/dist/textareafield.d.ts +84 -0
- package/dist/textareafield.js +4 -0
- package/dist/textfield.cjs +1 -0
- package/dist/textfield.d.ts +82 -0
- package/dist/textfield.js +4 -0
- package/package.json +16 -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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
+
import { F as f } from "./Field-Bv07PL2M.js";
|
|
3
|
+
import { S as r } from "./Select-DHalg36V.js";
|
|
4
|
+
function h({
|
|
5
|
+
name: s,
|
|
6
|
+
label: i,
|
|
7
|
+
hint: t,
|
|
8
|
+
error: a,
|
|
9
|
+
required: n,
|
|
10
|
+
optional: m,
|
|
11
|
+
layout: o,
|
|
12
|
+
options: d,
|
|
13
|
+
placeholder: x,
|
|
14
|
+
value: c,
|
|
15
|
+
onValueChange: j,
|
|
16
|
+
disabled: p,
|
|
17
|
+
size: u
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ e.jsx(
|
|
20
|
+
f,
|
|
21
|
+
{
|
|
22
|
+
name: s,
|
|
23
|
+
label: i,
|
|
24
|
+
hint: t,
|
|
25
|
+
error: a,
|
|
26
|
+
required: n,
|
|
27
|
+
optional: m,
|
|
28
|
+
layout: o,
|
|
29
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
30
|
+
r,
|
|
31
|
+
{
|
|
32
|
+
value: c,
|
|
33
|
+
onValueChange: j,
|
|
34
|
+
disabled: p,
|
|
35
|
+
size: u,
|
|
36
|
+
placeholder: x,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ e.jsx(r.Trigger, { "aria-label": typeof i == "string" ? i : void 0 }),
|
|
39
|
+
/* @__PURE__ */ e.jsx(r.Content, { children: d.map((l) => /* @__PURE__ */ e.jsx(r.Item, { value: l.value, children: l.label }, l.value)) })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
h.displayName = "VhyxSelectField";
|
|
47
|
+
export {
|
|
48
|
+
h as S
|
|
49
|
+
};
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./jsx-runtime-BRMkMA8J.cjs"),c=require("./Field-D6FSsUGj.cjs"),o=require("./Input-UQ2fQwE7.cjs");function s({name:e,label:r,hint:n,error:t,required:u,optional:x,layout:d,...l}){return i.jsxRuntimeExports.jsx(c.Field,{name:e,label:r,hint:n,error:t,required:u,optional:x,layout:d,children:i.jsxRuntimeExports.jsx(o.Input,{name:e,error:!!t,...l})})}s.displayName="VhyxTextField";exports.TextField=s;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as i } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
+
import { F as a } from "./Field-Bv07PL2M.js";
|
|
3
|
+
import { I as d } from "./Input-BS_t1bl-.js";
|
|
4
|
+
function l({
|
|
5
|
+
name: r,
|
|
6
|
+
label: e,
|
|
7
|
+
hint: o,
|
|
8
|
+
error: t,
|
|
9
|
+
required: s,
|
|
10
|
+
optional: x,
|
|
11
|
+
layout: m,
|
|
12
|
+
...p
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ i.jsx(
|
|
15
|
+
a,
|
|
16
|
+
{
|
|
17
|
+
name: r,
|
|
18
|
+
label: e,
|
|
19
|
+
hint: o,
|
|
20
|
+
error: t,
|
|
21
|
+
required: s,
|
|
22
|
+
optional: x,
|
|
23
|
+
layout: m,
|
|
24
|
+
children: /* @__PURE__ */ i.jsx(d, { name: r, error: !!t, ...p })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
l.displayName = "VhyxTextField";
|
|
29
|
+
export {
|
|
30
|
+
l as T
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as a } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
+
import { F as p } from "./Field-Bv07PL2M.js";
|
|
3
|
+
import { T as d } from "./Textarea-CLrctxHU.js";
|
|
4
|
+
function l({
|
|
5
|
+
name: r,
|
|
6
|
+
label: t,
|
|
7
|
+
hint: i,
|
|
8
|
+
error: e,
|
|
9
|
+
required: o,
|
|
10
|
+
optional: s,
|
|
11
|
+
layout: x,
|
|
12
|
+
...m
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ a.jsx(
|
|
15
|
+
p,
|
|
16
|
+
{
|
|
17
|
+
name: r,
|
|
18
|
+
label: t,
|
|
19
|
+
hint: i,
|
|
20
|
+
error: e,
|
|
21
|
+
required: o,
|
|
22
|
+
optional: s,
|
|
23
|
+
layout: x,
|
|
24
|
+
children: /* @__PURE__ */ a.jsx(d, { name: r, error: !!e, ...m })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
l.displayName = "VhyxTextareaField";
|
|
29
|
+
export {
|
|
30
|
+
l as T
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("./jsx-runtime-BRMkMA8J.cjs"),l=require("./Field-D6FSsUGj.cjs"),c=require("./Textarea-H6evM8L4.cjs");function i({name:e,label:s,hint:x,error:r,required:a,optional:n,layout:u,...d}){return t.jsxRuntimeExports.jsx(l.Field,{name:e,label:s,hint:x,error:r,required:a,optional:n,layout:u,children:t.jsxRuntimeExports.jsx(c.Textarea,{name:e,error:!!r,...d})})}i.displayName="VhyxTextareaField";exports.TextareaField=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
|
|
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;
|