@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.
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/Accordion-qtPur3CA.js +81 -0
- package/dist/Accordion-z3QDvyGf.cjs +1 -0
- package/dist/Alert-D4EFVKUy.js +99 -0
- package/dist/Alert-DWB9Gtpv.cjs +1 -0
- package/dist/Avatar-CDoAvY0m.js +51 -0
- package/dist/Avatar-afXJdutp.cjs +1 -0
- package/dist/Badge-DOhfKlXt.cjs +1 -0
- package/dist/Badge-Z6crWSLX.js +38 -0
- package/dist/Breadcrumb-CbPmH-b4.js +90 -0
- package/dist/Breadcrumb-DWRxQvbb.cjs +1 -0
- package/dist/Button-CnNtk6HV.cjs +1 -0
- package/dist/Button-DN5vy24q.js +60 -0
- package/dist/Card-CI7DyOJg.js +79 -0
- package/dist/Card-CZUQhd45.cjs +1 -0
- package/dist/Center-BmKeGEa1.cjs +1 -0
- package/dist/Center-DFq5m7mf.js +22 -0
- package/dist/Checkbox-D-5qaOEj.js +92 -0
- package/dist/Checkbox-DOd4SIx2.cjs +1 -0
- package/dist/Container-CcsVyA6r.cjs +1 -0
- package/dist/Container-DPKIgeDZ.js +21 -0
- package/dist/Dialog-B7Mhq9Qc.cjs +1 -0
- package/dist/Dialog-DhIanyWH.js +258 -0
- package/dist/Drawer-8maigAH9.cjs +1 -0
- package/dist/Drawer-BKizItfr.js +259 -0
- package/dist/Field-DJvjEmzE.cjs +1 -0
- package/dist/Field-Dx9gXxGL.js +120 -0
- package/dist/Grid-Bzzb0usH.cjs +1 -0
- package/dist/Grid-x_OHCzGV.js +25 -0
- package/dist/Heading-BPqfnM8i.js +14 -0
- package/dist/Heading-icKRWRno.cjs +1 -0
- package/dist/Input-B0dEXpG8.js +151 -0
- package/dist/Input-CdS0oZyf.cjs +1 -0
- package/dist/Kbd-C2vxklhy.cjs +1 -0
- package/dist/Kbd-DGURpjWN.js +22 -0
- package/dist/Pagination-CiE9Jzm0.cjs +1 -0
- package/dist/Pagination-UQ53MWnR.js +128 -0
- package/dist/{Popover-j9pNswBn.js → Popover-0QvSlzcQ.js} +53 -53
- package/dist/Popover-Chf2ikqa.cjs +1 -0
- package/dist/Progress-DdWZRQVS.js +75 -0
- package/dist/Progress-lItZES-D.cjs +1 -0
- package/dist/RadioItem-BbIH7LoA.js +141 -0
- package/dist/RadioItem-Cfxch4Gj.cjs +1 -0
- package/dist/Select-CgjfJSB8.js +350 -0
- package/dist/Select-D_oVKzzK.cjs +1 -0
- package/dist/SelectField-DBGtOECg.js +49 -0
- package/dist/SelectField-DdkU9fXq.cjs +1 -0
- package/dist/Separator-BwR51KpL.js +52 -0
- package/dist/Separator-CTncQd7E.cjs +1 -0
- package/dist/Skeleton-C1LTpmVC.js +20 -0
- package/dist/Skeleton-CpzYhkFp.cjs +1 -0
- package/dist/Spinner-BJnT9SOB.cjs +1 -0
- package/dist/{Spinner-BYi9eTfl.js → Spinner-Dz68qwGs.js} +25 -25
- package/dist/Stack--mNjuxZe.cjs +1 -0
- package/dist/Stack-CfwjUv0j.js +49 -0
- package/dist/Switch-I712svE0.cjs +1 -0
- package/dist/{Switch-DOAZfSV0.js → Switch-bIbcXIMH.js} +22 -22
- package/dist/Table-C2TUkSZv.cjs +1 -0
- package/dist/Table-C_jZjmPK.js +67 -0
- package/dist/Tabs-CbmdCTVE.js +220 -0
- package/dist/Tabs-Dfuu2ZVq.cjs +1 -0
- package/dist/Text-CgsfCbWf.cjs +1 -0
- package/dist/Text-Dl4z0gus.js +26 -0
- package/dist/Text.module-CEBydIO4.js +7 -0
- package/dist/Text.module-gGopk2Yk.cjs +1 -0
- package/dist/TextField-B492c5Ct.js +31 -0
- package/dist/TextField-Bp-b0-hG.cjs +1 -0
- package/dist/{Textarea-CLrctxHU.js → Textarea-cloHZ5Sz.js} +41 -41
- package/dist/Textarea-uXK6PrFb.cjs +1 -0
- package/dist/TextareaField-C5naVyA1.cjs +1 -0
- package/dist/TextareaField-CrRndsuY.js +31 -0
- package/dist/Toast-CESL8AKT.cjs +1 -0
- package/dist/Toast-DYqE0PjM.js +167 -0
- package/dist/Tooltip-B-PpSm6T.cjs +1 -0
- package/dist/{Tooltip-BAmErB_g.js → Tooltip-DCCaNX5W.js} +34 -34
- package/dist/VhyxUIProvider-3f3b9ukY.cjs +1 -0
- package/dist/VhyxUIProvider-B2UHeumk.js +58 -0
- package/dist/VisuallyHidden-BWdnOImJ.cjs +1 -0
- package/dist/VisuallyHidden-CPTxPvL_.js +18 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.d.ts +48 -0
- package/dist/accordion.js +5 -0
- package/dist/alert.cjs +1 -1
- package/dist/alert.js +3 -2
- package/dist/avatar.cjs +1 -0
- package/dist/avatar.d.ts +53 -0
- package/dist/avatar.js +7 -0
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +2 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +3 -2
- package/dist/button.cjs +1 -1
- package/dist/button.js +3 -2
- package/dist/card.cjs +1 -1
- package/dist/card.js +3 -2
- package/dist/center.cjs +1 -0
- package/dist/center.d.ts +20 -0
- package/dist/center.js +5 -0
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +3 -2
- package/dist/container.cjs +1 -0
- package/dist/container.d.ts +23 -0
- package/dist/container.js +5 -0
- package/dist/cx-OWdTFKLx.js +15 -0
- package/dist/cx-dgWA95G6.cjs +1 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +0 -1
- package/dist/dialog.js +3 -2
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +0 -1
- package/dist/drawer.js +3 -2
- package/dist/env-Cqd4Y-Z7.cjs +1 -0
- package/dist/env-lFT_FRkA.js +19 -0
- package/dist/form.cjs +1 -1
- package/dist/form.d.ts +6 -6
- package/dist/form.js +5 -4
- package/dist/grid.cjs +1 -0
- package/dist/grid.d.ts +35 -0
- package/dist/grid.js +5 -0
- package/dist/heading.cjs +1 -0
- package/dist/heading.d.ts +25 -0
- package/dist/heading.js +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +440 -20
- package/dist/index.js +96 -62
- package/dist/input.cjs +1 -1
- package/dist/input.js +3 -2
- package/dist/kbd.cjs +1 -0
- package/dist/kbd.d.ts +16 -0
- package/dist/kbd.js +5 -0
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.js +2 -1
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +3 -2
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +2 -1
- package/dist/radio.cjs +1 -1
- package/dist/radio.js +4 -3
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +3 -3
- package/dist/select.js +3 -2
- package/dist/selectfield.cjs +1 -1
- package/dist/selectfield.d.ts +6 -6
- package/dist/selectfield.js +3 -2
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +3 -2
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.d.ts +22 -0
- package/dist/skeleton.js +5 -0
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +3 -2
- package/dist/stack.cjs +1 -0
- package/dist/stack.d.ts +58 -0
- package/dist/stack.js +7 -0
- package/dist/style.css +2 -1
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +3 -2
- package/dist/table.cjs +1 -0
- package/dist/table.d.ts +65 -0
- package/dist/table.js +5 -0
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +3 -2
- package/dist/test-utils.cjs +1 -1
- package/dist/test-utils.d.ts +14 -2
- package/dist/test-utils.js +5 -5
- package/dist/text.cjs +1 -0
- package/dist/text.d.ts +38 -0
- package/dist/text.js +5 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +2 -1
- package/dist/textareafield.cjs +1 -1
- package/dist/textareafield.d.ts +6 -6
- package/dist/textareafield.js +2 -1
- package/dist/textfield.cjs +1 -1
- package/dist/textfield.d.ts +6 -6
- package/dist/textfield.js +3 -2
- package/dist/toast.cjs +1 -1
- package/dist/toast.js +4 -3
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +3 -2
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +28 -0
- package/dist/utils.js +8 -0
- package/dist/visually-hidden.cjs +1 -0
- package/dist/visually-hidden.d.ts +16 -0
- package/dist/visually-hidden.js +5 -0
- package/package.json +166 -72
- package/dist/Alert-BJ1O0bnK.cjs +0 -1
- package/dist/Alert-am3ANPTH.js +0 -99
- package/dist/Badge-Bbxb4wyt.js +0 -38
- package/dist/Badge-SBO9tGzn.cjs +0 -1
- package/dist/Breadcrumb-Db7ASomJ.js +0 -90
- package/dist/Breadcrumb-StitgXXx.cjs +0 -1
- package/dist/Button-DDMc7-3S.js +0 -58
- package/dist/Button-akOSYEu9.cjs +0 -1
- package/dist/Card-DSCA-Igh.cjs +0 -1
- package/dist/Card-Dh9Pcmfa.js +0 -79
- package/dist/Checkbox-DWl91ci_.js +0 -92
- package/dist/Checkbox-DvkT6QP9.cjs +0 -1
- package/dist/Dialog-CtYu14zl.js +0 -245
- package/dist/Dialog-gPT4noD8.cjs +0 -1
- package/dist/Drawer-BFJxsPG1.js +0 -246
- package/dist/Drawer-BygSIQQn.cjs +0 -1
- package/dist/Field-Bv07PL2M.js +0 -120
- package/dist/Field-D6FSsUGj.cjs +0 -1
- package/dist/Input-BS_t1bl-.js +0 -151
- package/dist/Input-UQ2fQwE7.cjs +0 -1
- package/dist/Pagination-C1h7OTgM.js +0 -128
- package/dist/Pagination-CmmcBPNz.cjs +0 -1
- package/dist/Popover-BlCmIF9J.cjs +0 -1
- package/dist/Progress-DWLr6Bq2.js +0 -75
- package/dist/Progress-FO-4WX0i.cjs +0 -1
- package/dist/RadioItem-BfkTHBxQ.cjs +0 -1
- package/dist/RadioItem-CzHSS_qK.js +0 -141
- package/dist/Select-BkJNe4Lc.cjs +0 -1
- package/dist/Select-DfV10hZt.js +0 -350
- package/dist/SelectField-B6N0uub8.js +0 -49
- package/dist/SelectField-Dxl2Mgbv.cjs +0 -1
- package/dist/Separator-C5lPGzes.cjs +0 -1
- package/dist/Separator-DQT58t90.js +0 -52
- package/dist/Spinner-CeIDpqkx.cjs +0 -1
- package/dist/Switch-BU_Tcttb.cjs +0 -1
- package/dist/Tabs-BTfm4LbV.js +0 -220
- package/dist/Tabs-DuU02-UD.cjs +0 -1
- package/dist/TextField-C3r-6jr6.cjs +0 -1
- package/dist/TextField-DtXQQJJk.js +0 -31
- package/dist/Textarea-H6evM8L4.cjs +0 -1
- package/dist/TextareaField-CpqPinvx.js +0 -31
- package/dist/TextareaField-D234Lyi_.cjs +0 -1
- package/dist/Toast-DHyfbt0C.js +0 -167
- package/dist/Toast-DVvbVxTf.cjs +0 -1
- package/dist/Tooltip-CCd6VRvZ.cjs +0 -1
- package/dist/VhyxUIProvider-DI8J763o.js +0 -31
- package/dist/VhyxUIProvider-oVy4G3P4.cjs +0 -1
- package/dist/jsx-runtime-BRMkMA8J.cjs +0 -22
- package/dist/jsx-runtime-CL69jGNW.js +0 -279
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import J, { useState as O, useCallback as h } from "react";
|
|
3
3
|
import { switchContract as w, Slot as P } from "@vhyxui/core";
|
|
4
4
|
import { withAgentContract as q } from "@vhyxseal/react";
|
|
@@ -8,52 +8,52 @@ const G = "_thumb_du6cw_38", f = {
|
|
|
8
8
|
thumb: G
|
|
9
9
|
}, p = J.forwardRef(
|
|
10
10
|
({
|
|
11
|
-
checked:
|
|
12
|
-
defaultChecked:
|
|
11
|
+
checked: l,
|
|
12
|
+
defaultChecked: S = !1,
|
|
13
13
|
onCheckedChange: s,
|
|
14
|
-
size:
|
|
14
|
+
size: x = "md",
|
|
15
15
|
asChild: y = !1,
|
|
16
16
|
contract: b,
|
|
17
|
-
className:
|
|
18
|
-
id:
|
|
17
|
+
className: v,
|
|
18
|
+
id: _,
|
|
19
19
|
disabled: e,
|
|
20
20
|
onClick: c,
|
|
21
21
|
onKeyDown: r,
|
|
22
|
-
children:
|
|
23
|
-
...
|
|
24
|
-
},
|
|
25
|
-
const
|
|
22
|
+
children: N,
|
|
23
|
+
...I
|
|
24
|
+
}, u) => {
|
|
25
|
+
const j = F("vhyx-switch"), m = _ ?? j, o = l !== void 0, [B, R] = O(S), a = o ? l : B, i = h(() => {
|
|
26
26
|
if (e) return;
|
|
27
27
|
const t = !a;
|
|
28
|
-
o ||
|
|
29
|
-
}, [e, a, o, s]),
|
|
28
|
+
o || R(t), s == null || s(t);
|
|
29
|
+
}, [e, a, o, s]), V = h(
|
|
30
30
|
(t) => {
|
|
31
31
|
c == null || c(t), i();
|
|
32
32
|
},
|
|
33
33
|
[c, i]
|
|
34
|
-
),
|
|
34
|
+
), z = h(
|
|
35
35
|
(t) => {
|
|
36
36
|
r == null || r(t), t.key === "Enter" && (t.preventDefault(), i());
|
|
37
37
|
},
|
|
38
38
|
[r, i]
|
|
39
|
-
),
|
|
39
|
+
), A = {
|
|
40
40
|
...w,
|
|
41
41
|
id: m,
|
|
42
42
|
...b
|
|
43
|
-
},
|
|
43
|
+
}, E = [f.switch, v].filter(Boolean).join(" "), d = {
|
|
44
44
|
id: m,
|
|
45
45
|
role: "switch",
|
|
46
46
|
"aria-checked": a,
|
|
47
47
|
disabled: e,
|
|
48
|
-
onClick:
|
|
49
|
-
onKeyDown:
|
|
50
|
-
className:
|
|
48
|
+
onClick: V,
|
|
49
|
+
onKeyDown: z,
|
|
50
|
+
className: E,
|
|
51
51
|
"data-state": a ? "checked" : "unchecked",
|
|
52
|
-
"data-size":
|
|
53
|
-
"data-vhyx-contract": JSON.stringify(
|
|
54
|
-
...
|
|
52
|
+
"data-size": x,
|
|
53
|
+
"data-vhyx-contract": JSON.stringify(A),
|
|
54
|
+
...I
|
|
55
55
|
};
|
|
56
|
-
return y ? /* @__PURE__ */ n
|
|
56
|
+
return y ? /* @__PURE__ */ n(P, { ref: u, ...d, children: N }) : /* @__PURE__ */ n("button", { ref: u, type: "button", ...d, children: /* @__PURE__ */ n("span", { className: f.thumb }) });
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
p.displayName = "VhyxSwitch";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),o=require("react"),v=require("@vhyxui/core"),C=require("@vhyxseal/react"),i=require("./cx-dgWA95G6.cjs"),V="_wrapper_evcoi_1",H="_table_evcoi_9",S="_caption_evcoi_17",q="_head_evcoi_24",k="_th_evcoi_28",B="_td_evcoi_40",O="_row_evcoi_46",J="_body_evcoi_53",r={wrapper:V,table:H,caption:S,head:q,th:k,td:B,row:O,body:J};function A(t,l){const e=t[l];return e==null?"—":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):o.isValidElement(e)?e:JSON.stringify(e)}const g=o.forwardRef(({striped:t=!1,hoverable:l=!0,density:e="comfortable",caption:d,columns:h,data:f,rowKey:j,emptyState:w,contract:m,className:N,children:u,...T},R)=>a.jsx("div",{className:r.wrapper,children:a.jsxs("table",{ref:R,className:i.cx(r.table,N),"data-striped":t?"true":void 0,"data-hover":l?"true":void 0,"data-density":e,"data-vhyx-contract":m?JSON.stringify({...v.tableContract,...m}):void 0,...T,children:[d&&a.jsx("caption",{className:r.caption,children:d}),h?a.jsxs(a.Fragment,{children:[a.jsx(y,{children:a.jsx(c,{children:h.map(s=>a.jsx(_,{align:s.align??"start",style:s.width?{width:s.width}:void 0,children:s.header},s.key))})}),a.jsx(p,{children:(f??[]).length===0?a.jsx(c,{children:a.jsx(x,{colSpan:h.length,align:"center",children:w??"No data"})}):(f??[]).map((s,b)=>a.jsx(c,{children:h.map(n=>a.jsx(x,{align:n.align??"start",children:n.cell?n.cell(s,b):A(s,n.key)},n.key))},j?j(s,b):String(s.id??b)))})]}):u]})}));g.displayName="VhyxTable";const y=o.forwardRef(({className:t,...l},e)=>a.jsx("thead",{ref:e,className:i.cx(r.head,t),...l}));y.displayName="VhyxTableHead";const p=o.forwardRef(({className:t,...l},e)=>a.jsx("tbody",{ref:e,className:i.cx(r.body,t),...l}));p.displayName="VhyxTableBody";const c=o.forwardRef(({className:t,...l},e)=>a.jsx("tr",{ref:e,className:i.cx(r.row,t),...l}));c.displayName="VhyxTableRow";const _=o.forwardRef(({align:t,className:l,...e},d)=>a.jsx("th",{ref:d,scope:"col",className:i.cx(r.th,l),"data-align":t,...e}));_.displayName="VhyxTableHeader";const x=o.forwardRef(({align:t,className:l,...e},d)=>a.jsx("td",{ref:d,className:i.cx(r.td,l),"data-align":t,...e}));x.displayName="VhyxTableCell";const E={...v.tableContract,id:"vhyxui-table"},F=Object.assign(C.withAgentContract(g,E),{Head:y,Body:p,Row:c,Header:_,Cell:x});exports.Table=F;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as a, jsxs as w, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import { tableContract as N } from "@vhyxui/core";
|
|
4
|
+
import { withAgentContract as S } from "@vhyxseal/react";
|
|
5
|
+
import { c as n } from "./cx-OWdTFKLx.js";
|
|
6
|
+
const j = "_wrapper_evcoi_1", k = "_table_evcoi_9", B = "_caption_evcoi_17", O = "_head_evcoi_24", J = "_th_evcoi_28", A = "_td_evcoi_40", E = "_row_evcoi_46", F = "_body_evcoi_53", r = {
|
|
7
|
+
wrapper: j,
|
|
8
|
+
table: k,
|
|
9
|
+
caption: B,
|
|
10
|
+
head: O,
|
|
11
|
+
th: J,
|
|
12
|
+
td: A,
|
|
13
|
+
row: E,
|
|
14
|
+
body: F
|
|
15
|
+
};
|
|
16
|
+
function q(t, l) {
|
|
17
|
+
const e = t[l];
|
|
18
|
+
return e == null ? "—" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : d.isValidElement(e) ? e : JSON.stringify(e);
|
|
19
|
+
}
|
|
20
|
+
const T = d.forwardRef(
|
|
21
|
+
({ striped: t = !1, hoverable: l = !0, density: e = "comfortable", caption: i, columns: h, data: _, rowKey: v, emptyState: x, contract: g, className: R, children: u, ...C }, V) => /* @__PURE__ */ a("div", { className: r.wrapper, children: /* @__PURE__ */ w(
|
|
22
|
+
"table",
|
|
23
|
+
{
|
|
24
|
+
ref: V,
|
|
25
|
+
className: n(r.table, R),
|
|
26
|
+
"data-striped": t ? "true" : void 0,
|
|
27
|
+
"data-hover": l ? "true" : void 0,
|
|
28
|
+
"data-density": e,
|
|
29
|
+
"data-vhyx-contract": g ? JSON.stringify({ ...N, ...g }) : void 0,
|
|
30
|
+
...C,
|
|
31
|
+
children: [
|
|
32
|
+
i && /* @__PURE__ */ a("caption", { className: r.caption, children: i }),
|
|
33
|
+
h ? /* @__PURE__ */ w(H, { children: [
|
|
34
|
+
/* @__PURE__ */ a(b, { children: /* @__PURE__ */ a(c, { children: h.map((o) => /* @__PURE__ */ a(m, { align: o.align ?? "start", style: o.width ? { width: o.width } : void 0, children: o.header }, o.key)) }) }),
|
|
35
|
+
/* @__PURE__ */ a(f, { children: (_ ?? []).length === 0 ? /* @__PURE__ */ a(c, { children: /* @__PURE__ */ a(p, { colSpan: h.length, align: "center", children: x ?? "No data" }) }) : (_ ?? []).map((o, y) => /* @__PURE__ */ a(c, { children: h.map((s) => /* @__PURE__ */ a(p, { align: s.align ?? "start", children: s.cell ? s.cell(o, y) : q(o, s.key) }, s.key)) }, v ? v(o, y) : String(o.id ?? y))) })
|
|
36
|
+
] }) : u
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
) })
|
|
40
|
+
);
|
|
41
|
+
T.displayName = "VhyxTable";
|
|
42
|
+
const b = d.forwardRef(
|
|
43
|
+
({ className: t, ...l }, e) => /* @__PURE__ */ a("thead", { ref: e, className: n(r.head, t), ...l })
|
|
44
|
+
);
|
|
45
|
+
b.displayName = "VhyxTableHead";
|
|
46
|
+
const f = d.forwardRef(
|
|
47
|
+
({ className: t, ...l }, e) => /* @__PURE__ */ a("tbody", { ref: e, className: n(r.body, t), ...l })
|
|
48
|
+
);
|
|
49
|
+
f.displayName = "VhyxTableBody";
|
|
50
|
+
const c = d.forwardRef(
|
|
51
|
+
({ className: t, ...l }, e) => /* @__PURE__ */ a("tr", { ref: e, className: n(r.row, t), ...l })
|
|
52
|
+
);
|
|
53
|
+
c.displayName = "VhyxTableRow";
|
|
54
|
+
const m = d.forwardRef(({ align: t, className: l, ...e }, i) => /* @__PURE__ */ a("th", { ref: i, scope: "col", className: n(r.th, l), "data-align": t, ...e }));
|
|
55
|
+
m.displayName = "VhyxTableHeader";
|
|
56
|
+
const p = d.forwardRef(({ align: t, className: l, ...e }, i) => /* @__PURE__ */ a("td", { ref: i, className: n(r.td, l), "data-align": t, ...e }));
|
|
57
|
+
p.displayName = "VhyxTableCell";
|
|
58
|
+
const z = { ...N, id: "vhyxui-table" }, P = Object.assign(S(T, z), {
|
|
59
|
+
Head: b,
|
|
60
|
+
Body: f,
|
|
61
|
+
Row: c,
|
|
62
|
+
Header: m,
|
|
63
|
+
Cell: p
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
P as T
|
|
67
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { jsx as v, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import $, { useState as q, useRef as w, useCallback as T, useMemo as L, useEffect as P, createContext as W, useContext as Y } from "react";
|
|
3
|
+
import { tabsContract as z, Slot as G, VhyxUIError as J, VhyxUIErrorCode as F } from "@vhyxui/core";
|
|
4
|
+
import { withAgentContract as Q } from "@vhyxseal/react";
|
|
5
|
+
import { u as Z } from "./useId-BGRmH6iF.js";
|
|
6
|
+
const K = "_root_11mqx_3", tt = "_list_11mqx_16", et = "_trigger_11mqx_49", rt = "_indicator_11mqx_114", st = "_panel_11mqx_149", _ = {
|
|
7
|
+
root: K,
|
|
8
|
+
list: tt,
|
|
9
|
+
trigger: et,
|
|
10
|
+
indicator: rt,
|
|
11
|
+
panel: st
|
|
12
|
+
}, O = W(null);
|
|
13
|
+
function E(e) {
|
|
14
|
+
const c = Y(O);
|
|
15
|
+
if (!c)
|
|
16
|
+
throw new J({
|
|
17
|
+
code: F.VHYXUI_MISSING_CONTEXT,
|
|
18
|
+
message: `${e} must be used within <Tabs>`,
|
|
19
|
+
suggestion: "Wrap your component tree with <Tabs>"
|
|
20
|
+
});
|
|
21
|
+
return c;
|
|
22
|
+
}
|
|
23
|
+
const V = $.forwardRef(
|
|
24
|
+
({
|
|
25
|
+
value: e,
|
|
26
|
+
defaultValue: c,
|
|
27
|
+
onValueChange: f,
|
|
28
|
+
orientation: n = "horizontal",
|
|
29
|
+
variant: t = "default",
|
|
30
|
+
size: i = "md",
|
|
31
|
+
contract: u,
|
|
32
|
+
className: b,
|
|
33
|
+
children: l,
|
|
34
|
+
...s
|
|
35
|
+
}, a) => {
|
|
36
|
+
const h = Z("vhyx-tabs"), I = e !== void 0, [C, N] = q(c), R = I ? e : C, p = w([]), m = w(/* @__PURE__ */ new Map()), r = T(
|
|
37
|
+
(d, y) => {
|
|
38
|
+
y ? (p.current.includes(d) || p.current.push(d), m.current.set(d, y)) : (m.current.delete(d), p.current = p.current.filter((o) => o !== d));
|
|
39
|
+
},
|
|
40
|
+
[]
|
|
41
|
+
), g = T(
|
|
42
|
+
(d) => {
|
|
43
|
+
I || N(d), f == null || f(d);
|
|
44
|
+
},
|
|
45
|
+
[I, f]
|
|
46
|
+
), S = T(
|
|
47
|
+
(d, y) => {
|
|
48
|
+
var j;
|
|
49
|
+
const o = p.current;
|
|
50
|
+
if (o.length === 0) return;
|
|
51
|
+
let x;
|
|
52
|
+
if (y === "first")
|
|
53
|
+
x = o[0];
|
|
54
|
+
else if (y === "last")
|
|
55
|
+
x = o[o.length - 1];
|
|
56
|
+
else {
|
|
57
|
+
const A = o.indexOf(d);
|
|
58
|
+
y === "next" ? x = o[(A + 1) % o.length] : x = o[(A - 1 + o.length) % o.length];
|
|
59
|
+
}
|
|
60
|
+
x !== void 0 && (g(x), (j = m.current.get(x)) == null || j.focus());
|
|
61
|
+
},
|
|
62
|
+
[g]
|
|
63
|
+
), U = L(
|
|
64
|
+
() => ({ ...z, id: h, ...u }),
|
|
65
|
+
[h, u]
|
|
66
|
+
), M = L(
|
|
67
|
+
() => ({
|
|
68
|
+
value: R,
|
|
69
|
+
onValueChange: g,
|
|
70
|
+
orientation: n,
|
|
71
|
+
variant: t,
|
|
72
|
+
size: i,
|
|
73
|
+
tabsId: h,
|
|
74
|
+
triggerOrderRef: p,
|
|
75
|
+
triggerElementsRef: m,
|
|
76
|
+
registerTrigger: r,
|
|
77
|
+
navigateTab: S
|
|
78
|
+
}),
|
|
79
|
+
[
|
|
80
|
+
R,
|
|
81
|
+
g,
|
|
82
|
+
n,
|
|
83
|
+
t,
|
|
84
|
+
i,
|
|
85
|
+
h,
|
|
86
|
+
r,
|
|
87
|
+
S
|
|
88
|
+
]
|
|
89
|
+
), X = [_.root, b].filter(Boolean).join(" ");
|
|
90
|
+
return /* @__PURE__ */ v(O.Provider, { value: M, children: /* @__PURE__ */ v(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
ref: a,
|
|
94
|
+
className: X,
|
|
95
|
+
"data-orientation": n,
|
|
96
|
+
"data-variant": t,
|
|
97
|
+
"data-size": i,
|
|
98
|
+
"data-vhyx-contract": JSON.stringify(U),
|
|
99
|
+
...s,
|
|
100
|
+
children: l
|
|
101
|
+
}
|
|
102
|
+
) });
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
V.displayName = "VhyxTabs";
|
|
106
|
+
const k = $.forwardRef(
|
|
107
|
+
({ children: e, className: c, ...f }, n) => {
|
|
108
|
+
const t = E("Tabs.List"), i = w(null), [u, b] = q({}), l = T(
|
|
109
|
+
(a) => {
|
|
110
|
+
i.current = a, typeof n == "function" ? n(a) : n && (n.current = a);
|
|
111
|
+
},
|
|
112
|
+
[n]
|
|
113
|
+
);
|
|
114
|
+
P(() => {
|
|
115
|
+
if (!t.value || !i.current) return;
|
|
116
|
+
const a = t.triggerElementsRef.current.get(t.value);
|
|
117
|
+
a && (t.orientation === "horizontal" ? b({
|
|
118
|
+
width: a.offsetWidth,
|
|
119
|
+
transform: `translateX(${a.offsetLeft}px)`
|
|
120
|
+
}) : b({
|
|
121
|
+
height: a.offsetHeight,
|
|
122
|
+
transform: `translateY(${a.offsetTop}px)`
|
|
123
|
+
}));
|
|
124
|
+
}, [t.value, t.orientation, t.triggerElementsRef]);
|
|
125
|
+
const s = [_.list, c].filter(Boolean).join(" ");
|
|
126
|
+
return /* @__PURE__ */ D(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
ref: l,
|
|
130
|
+
role: "tablist",
|
|
131
|
+
"aria-orientation": t.orientation,
|
|
132
|
+
className: s,
|
|
133
|
+
"data-variant": t.variant,
|
|
134
|
+
"data-orientation": t.orientation,
|
|
135
|
+
...f,
|
|
136
|
+
children: [
|
|
137
|
+
e,
|
|
138
|
+
/* @__PURE__ */ v(
|
|
139
|
+
"span",
|
|
140
|
+
{
|
|
141
|
+
className: _.indicator,
|
|
142
|
+
"data-orientation": t.orientation,
|
|
143
|
+
"aria-hidden": "true",
|
|
144
|
+
style: u
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
k.displayName = "VhyxTabsList";
|
|
153
|
+
const B = $.forwardRef(
|
|
154
|
+
({ value: e, children: c, className: f, onClick: n, onKeyDown: t, disabled: i, asChild: u = !1, ...b }, l) => {
|
|
155
|
+
const s = E("Tabs.Trigger"), a = s.value === e, h = `${s.tabsId}-panel-${e}`, I = `${s.tabsId}-trigger-${e}`, C = T(
|
|
156
|
+
(r) => {
|
|
157
|
+
s.registerTrigger(e, r), typeof l == "function" ? l(r) : l && (l.current = r);
|
|
158
|
+
},
|
|
159
|
+
[l, s, e]
|
|
160
|
+
), N = T(
|
|
161
|
+
(r) => {
|
|
162
|
+
n == null || n(r), i || s.onValueChange(e);
|
|
163
|
+
},
|
|
164
|
+
[n, i, s, e]
|
|
165
|
+
), R = T(
|
|
166
|
+
(r) => {
|
|
167
|
+
t == null || t(r);
|
|
168
|
+
const g = s.orientation === "horizontal";
|
|
169
|
+
g && r.key === "ArrowRight" || !g && r.key === "ArrowDown" ? (r.preventDefault(), s.navigateTab(e, "next")) : g && r.key === "ArrowLeft" || !g && r.key === "ArrowUp" ? (r.preventDefault(), s.navigateTab(e, "prev")) : r.key === "Home" ? (r.preventDefault(), s.navigateTab(e, "first")) : r.key === "End" && (r.preventDefault(), s.navigateTab(e, "last"));
|
|
170
|
+
},
|
|
171
|
+
[t, s, e]
|
|
172
|
+
), p = [_.trigger, f].filter(Boolean).join(" "), m = {
|
|
173
|
+
id: I,
|
|
174
|
+
role: "tab",
|
|
175
|
+
"aria-selected": a,
|
|
176
|
+
"aria-controls": h,
|
|
177
|
+
disabled: i,
|
|
178
|
+
tabIndex: a ? 0 : -1,
|
|
179
|
+
onClick: N,
|
|
180
|
+
onKeyDown: R,
|
|
181
|
+
className: p,
|
|
182
|
+
"data-state": a ? "active" : "inactive",
|
|
183
|
+
"data-size": s.size,
|
|
184
|
+
...b
|
|
185
|
+
};
|
|
186
|
+
return u ? /* @__PURE__ */ v(G, { ref: C, ...m, children: c }) : /* @__PURE__ */ v("button", { ref: C, type: "button", ...m, children: c });
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
B.displayName = "VhyxTabsTrigger";
|
|
190
|
+
function H({ value: e, children: c, className: f, ...n }) {
|
|
191
|
+
const t = E("Tabs.Content"), i = t.value === e, u = `${t.tabsId}-panel-${e}`, b = `${t.tabsId}-trigger-${e}`;
|
|
192
|
+
if (!i) return null;
|
|
193
|
+
const l = [_.panel, f].filter(Boolean).join(" ");
|
|
194
|
+
return /* @__PURE__ */ v(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
id: u,
|
|
198
|
+
role: "tabpanel",
|
|
199
|
+
"aria-labelledby": b,
|
|
200
|
+
tabIndex: 0,
|
|
201
|
+
className: l,
|
|
202
|
+
"data-state": "active",
|
|
203
|
+
...n,
|
|
204
|
+
children: c
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
H.displayName = "VhyxTabsContent";
|
|
209
|
+
const nt = { ...z, id: "vhyxui-tabs" }, at = Object.assign(
|
|
210
|
+
Q(V, nt),
|
|
211
|
+
{
|
|
212
|
+
List: k,
|
|
213
|
+
Trigger: B,
|
|
214
|
+
Content: H
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
at.displayName = "VhyxTabs";
|
|
218
|
+
export {
|
|
219
|
+
at as T
|
|
220
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const m=require("react/jsx-runtime"),r=require("react"),I=require("@vhyxui/core"),M=require("@vhyxseal/react"),U=require("./useId-D2AEOm2G.cjs"),X="_root_11mqx_3",D="_list_11mqx_16",P="_trigger_11mqx_49",W="_indicator_11mqx_114",Y="_panel_11mqx_149",R={root:X,list:D,trigger:P,indicator:W,panel:Y},S=r.createContext(null);function w(e){const l=r.useContext(S);if(!l)throw new I.VhyxUIError({code:I.VhyxUIErrorCode.VHYXUI_MISSING_CONTEXT,message:`${e} must be used within <Tabs>`,suggestion:"Wrap your component tree with <Tabs>"});return l}const E=r.forwardRef(({value:e,defaultValue:l,onValueChange:u,orientation:a="horizontal",variant:t="default",size:o="md",contract:b,className:x,children:f,...n},i)=>{const y=U.useId("vhyx-tabs"),v=e!==void 0,[_,N]=r.useState(l),j=v?e:_,p=r.useRef([]),T=r.useRef(new Map),s=r.useCallback((d,C)=>{C?(p.current.includes(d)||p.current.push(d),T.current.set(d,C)):(T.current.delete(d),p.current=p.current.filter(c=>c!==d))},[]),g=r.useCallback(d=>{v||N(d),u==null||u(d)},[v,u]),$=r.useCallback((d,C)=>{var k;const c=p.current;if(c.length===0)return;let h;if(C==="first")h=c[0];else if(C==="last")h=c[c.length-1];else{const q=c.indexOf(d);C==="next"?h=c[(q+1)%c.length]:h=c[(q-1+c.length)%c.length]}h!==void 0&&(g(h),(k=T.current.get(h))==null||k.focus())},[g]),V=r.useMemo(()=>({...I.tabsContract,id:y,...b}),[y,b]),B=r.useMemo(()=>({value:j,onValueChange:g,orientation:a,variant:t,size:o,tabsId:y,triggerOrderRef:p,triggerElementsRef:T,registerTrigger:s,navigateTab:$}),[j,g,a,t,o,y,s,$]),H=[R.root,x].filter(Boolean).join(" ");return m.jsx(S.Provider,{value:B,children:m.jsx("div",{ref:i,className:H,"data-orientation":a,"data-variant":t,"data-size":o,"data-vhyx-contract":JSON.stringify(V),...n,children:f})})});E.displayName="VhyxTabs";const A=r.forwardRef(({children:e,className:l,...u},a)=>{const t=w("Tabs.List"),o=r.useRef(null),[b,x]=r.useState({}),f=r.useCallback(i=>{o.current=i,typeof a=="function"?a(i):a&&(a.current=i)},[a]);r.useEffect(()=>{if(!t.value||!o.current)return;const i=t.triggerElementsRef.current.get(t.value);i&&(t.orientation==="horizontal"?x({width:i.offsetWidth,transform:`translateX(${i.offsetLeft}px)`}):x({height:i.offsetHeight,transform:`translateY(${i.offsetTop}px)`}))},[t.value,t.orientation,t.triggerElementsRef]);const n=[R.list,l].filter(Boolean).join(" ");return m.jsxs("div",{ref:f,role:"tablist","aria-orientation":t.orientation,className:n,"data-variant":t.variant,"data-orientation":t.orientation,...u,children:[e,m.jsx("span",{className:R.indicator,"data-orientation":t.orientation,"aria-hidden":"true",style:b})]})});A.displayName="VhyxTabsList";const L=r.forwardRef(({value:e,children:l,className:u,onClick:a,onKeyDown:t,disabled:o,asChild:b=!1,...x},f)=>{const n=w("Tabs.Trigger"),i=n.value===e,y=`${n.tabsId}-panel-${e}`,v=`${n.tabsId}-trigger-${e}`,_=r.useCallback(s=>{n.registerTrigger(e,s),typeof f=="function"?f(s):f&&(f.current=s)},[f,n,e]),N=r.useCallback(s=>{a==null||a(s),o||n.onValueChange(e)},[a,o,n,e]),j=r.useCallback(s=>{t==null||t(s);const g=n.orientation==="horizontal";g&&s.key==="ArrowRight"||!g&&s.key==="ArrowDown"?(s.preventDefault(),n.navigateTab(e,"next")):g&&s.key==="ArrowLeft"||!g&&s.key==="ArrowUp"?(s.preventDefault(),n.navigateTab(e,"prev")):s.key==="Home"?(s.preventDefault(),n.navigateTab(e,"first")):s.key==="End"&&(s.preventDefault(),n.navigateTab(e,"last"))},[t,n,e]),p=[R.trigger,u].filter(Boolean).join(" "),T={id:v,role:"tab","aria-selected":i,"aria-controls":y,disabled:o,tabIndex:i?0:-1,onClick:N,onKeyDown:j,className:p,"data-state":i?"active":"inactive","data-size":n.size,...x};return b?m.jsx(I.Slot,{ref:_,...T,children:l}):m.jsx("button",{ref:_,type:"button",...T,children:l})});L.displayName="VhyxTabsTrigger";function z({value:e,children:l,className:u,...a}){const t=w("Tabs.Content"),o=t.value===e,b=`${t.tabsId}-panel-${e}`,x=`${t.tabsId}-trigger-${e}`;if(!o)return null;const f=[R.panel,u].filter(Boolean).join(" ");return m.jsx("div",{id:b,role:"tabpanel","aria-labelledby":x,tabIndex:0,className:f,"data-state":"active",...a,children:l})}z.displayName="VhyxTabsContent";const G={...I.tabsContract,id:"vhyxui-tabs"},O=Object.assign(M.withAgentContract(E,G),{List:A,Trigger:L,Content:z});O.displayName="VhyxTabs";exports.Tabs=O;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),f=require("react"),p=require("./cx-dgWA95G6.cjs"),q=require("./Text.module-gGopk2Yk.cjs"),d=f.forwardRef(({as:r="p",size:i="md",tone:a="default",weight:o,align:s,mono:c,truncate:u,lines:t,className:x,style:e,...m},n)=>l.jsx(r,{ref:n,className:p.cx(q.styles.text,x),"data-size":i,"data-tone":a==="default"?void 0:a,"data-weight":o,"data-align":s,"data-mono":c?"true":void 0,"data-truncate":u?"true":void 0,"data-clamp":t?String(t):void 0,style:t?{WebkitLineClamp:t,...e}:e,...m}));d.displayName="VhyxText";exports.Text=d;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { c as u } from "./cx-OWdTFKLx.js";
|
|
4
|
+
import { s as v } from "./Text.module-CEBydIO4.js";
|
|
5
|
+
const g = l.forwardRef(
|
|
6
|
+
({ as: d = "p", size: e = "md", tone: t = "default", weight: r, align: m, mono: i, truncate: s, lines: a, className: p, style: o, ...f }, c) => /* @__PURE__ */ x(
|
|
7
|
+
d,
|
|
8
|
+
{
|
|
9
|
+
ref: c,
|
|
10
|
+
className: u(v.text, p),
|
|
11
|
+
"data-size": e,
|
|
12
|
+
"data-tone": t === "default" ? void 0 : t,
|
|
13
|
+
"data-weight": r,
|
|
14
|
+
"data-align": m,
|
|
15
|
+
"data-mono": i ? "true" : void 0,
|
|
16
|
+
"data-truncate": s ? "true" : void 0,
|
|
17
|
+
"data-clamp": a ? String(a) : void 0,
|
|
18
|
+
style: a ? { WebkitLineClamp: a, ...o } : o,
|
|
19
|
+
...f
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
g.displayName = "VhyxText";
|
|
24
|
+
export {
|
|
25
|
+
g as T
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t="_text_70oqj_1",e="_heading_70oqj_43",s={text:t,heading:e};exports.styles=s;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { F as s } from "./Field-Dx9gXxGL.js";
|
|
3
|
+
import { I as x } from "./Input-B0dEXpG8.js";
|
|
4
|
+
function a({
|
|
5
|
+
name: r,
|
|
6
|
+
label: e,
|
|
7
|
+
hint: o,
|
|
8
|
+
error: i,
|
|
9
|
+
required: m,
|
|
10
|
+
optional: p,
|
|
11
|
+
layout: d,
|
|
12
|
+
...l
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ t(
|
|
15
|
+
s,
|
|
16
|
+
{
|
|
17
|
+
name: r,
|
|
18
|
+
label: e,
|
|
19
|
+
hint: o,
|
|
20
|
+
error: i,
|
|
21
|
+
required: m,
|
|
22
|
+
optional: p,
|
|
23
|
+
layout: d,
|
|
24
|
+
children: /* @__PURE__ */ t(x, { name: r, error: !!i, ...l })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
a.displayName = "VhyxTextField";
|
|
29
|
+
export {
|
|
30
|
+
a as T
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),c=require("./Field-DJvjEmzE.cjs"),F=require("./Input-CdS0oZyf.cjs");function r({name:e,label:n,hint:s,error:i,required:u,optional:d,layout:l,...x}){return t.jsx(c.Field,{name:e,label:n,hint:s,error:i,required:u,optional:d,layout:l,children:t.jsx(F.Input,{name:e,error:!!i,...x})})}r.displayName="VhyxTextField";exports.TextField=r;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as x, jsx as Y } from "react/jsx-runtime";
|
|
2
|
+
import $, { useRef as k, useCallback as l, useEffect as A } from "react";
|
|
3
3
|
import { textareaContract as y } from "@vhyxui/core";
|
|
4
|
-
import { withAgentContract as
|
|
5
|
-
import { u as
|
|
6
|
-
const
|
|
7
|
-
wrapper:
|
|
8
|
-
textarea:
|
|
9
|
-
count:
|
|
10
|
-
}, m =
|
|
4
|
+
import { withAgentContract as E } from "@vhyxseal/react";
|
|
5
|
+
import { u as F } from "./useId-BGRmH6iF.js";
|
|
6
|
+
const J = "_wrapper_lafqn_1", M = "_textarea_lafqn_8", O = "_count_lafqn_72", d = {
|
|
7
|
+
wrapper: J,
|
|
8
|
+
textarea: M,
|
|
9
|
+
count: O
|
|
10
|
+
}, m = $.forwardRef(
|
|
11
11
|
({
|
|
12
12
|
size: v = "md",
|
|
13
13
|
resize: a = "vertical",
|
|
14
14
|
minRows: g = 3,
|
|
15
15
|
maxRows: s,
|
|
16
16
|
showCount: _ = !1,
|
|
17
|
-
error:
|
|
17
|
+
error: f = !1,
|
|
18
18
|
contract: b,
|
|
19
|
-
className:
|
|
20
|
-
id:
|
|
19
|
+
className: w,
|
|
20
|
+
id: H,
|
|
21
21
|
value: r,
|
|
22
22
|
onChange: o,
|
|
23
23
|
maxLength: n,
|
|
24
|
-
"aria-label":
|
|
25
|
-
"aria-describedby":
|
|
26
|
-
style:
|
|
27
|
-
...
|
|
24
|
+
"aria-label": N,
|
|
25
|
+
"aria-describedby": C,
|
|
26
|
+
style: T,
|
|
27
|
+
...j
|
|
28
28
|
}, e) => {
|
|
29
|
-
const
|
|
29
|
+
const q = F("vhyx-textarea"), u = H ?? q, p = k(null), I = l(
|
|
30
30
|
(t) => {
|
|
31
|
-
|
|
31
|
+
p.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
|
|
32
32
|
},
|
|
33
33
|
[e]
|
|
34
|
-
), i =
|
|
35
|
-
const t =
|
|
34
|
+
), i = l(() => {
|
|
35
|
+
const t = p.current;
|
|
36
36
|
if (!t || a !== "auto") return;
|
|
37
37
|
t.style.height = "auto";
|
|
38
38
|
const c = t.scrollHeight;
|
|
@@ -42,48 +42,48 @@ const F = "_wrapper_lafqn_1", J = "_textarea_lafqn_8", M = "_count_lafqn_72", f
|
|
|
42
42
|
} else
|
|
43
43
|
t.style.height = `${c}px`, t.style.overflowY = "hidden";
|
|
44
44
|
}, [a, s]);
|
|
45
|
-
|
|
45
|
+
A(() => {
|
|
46
46
|
a === "auto" && i();
|
|
47
47
|
}, [r, a, i]);
|
|
48
|
-
const
|
|
48
|
+
const R = l(
|
|
49
49
|
(t) => {
|
|
50
50
|
o == null || o(t), a === "auto" && i();
|
|
51
51
|
},
|
|
52
52
|
[o, a, i]
|
|
53
53
|
), S = typeof r == "string" ? r.length : 0, B = {
|
|
54
54
|
...y,
|
|
55
|
-
id:
|
|
55
|
+
id: u,
|
|
56
56
|
...b
|
|
57
|
-
},
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
57
|
+
}, V = [d.textarea, w].filter(Boolean).join(" ");
|
|
58
|
+
return /* @__PURE__ */ x("div", { className: d.wrapper, children: [
|
|
59
|
+
/* @__PURE__ */ Y(
|
|
60
60
|
"textarea",
|
|
61
61
|
{
|
|
62
|
-
ref:
|
|
63
|
-
id:
|
|
62
|
+
ref: I,
|
|
63
|
+
id: u,
|
|
64
64
|
value: r,
|
|
65
|
-
onChange:
|
|
65
|
+
onChange: R,
|
|
66
66
|
maxLength: n,
|
|
67
67
|
rows: g,
|
|
68
|
-
"aria-invalid":
|
|
69
|
-
"aria-label":
|
|
70
|
-
"aria-describedby":
|
|
71
|
-
className:
|
|
68
|
+
"aria-invalid": f ? !0 : void 0,
|
|
69
|
+
"aria-label": N,
|
|
70
|
+
"aria-describedby": C,
|
|
71
|
+
className: V,
|
|
72
72
|
"data-size": v,
|
|
73
73
|
"data-resize": a,
|
|
74
|
-
"data-error":
|
|
74
|
+
"data-error": f ? !0 : void 0,
|
|
75
75
|
"data-vhyx-contract": JSON.stringify(B),
|
|
76
76
|
style: {
|
|
77
77
|
resize: a === "auto" ? "none" : a,
|
|
78
|
-
...
|
|
78
|
+
...T
|
|
79
79
|
},
|
|
80
|
-
...
|
|
80
|
+
...j
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
_ && n !== void 0 && /* @__PURE__ */
|
|
83
|
+
_ && n !== void 0 && /* @__PURE__ */ x(
|
|
84
84
|
"span",
|
|
85
85
|
{
|
|
86
|
-
className:
|
|
86
|
+
className: d.count,
|
|
87
87
|
"aria-live": "polite",
|
|
88
88
|
"aria-atomic": "true",
|
|
89
89
|
children: [
|
|
@@ -97,8 +97,8 @@ const F = "_wrapper_lafqn_1", J = "_textarea_lafqn_8", M = "_count_lafqn_72", f
|
|
|
97
97
|
}
|
|
98
98
|
);
|
|
99
99
|
m.displayName = "VhyxTextarea";
|
|
100
|
-
const
|
|
101
|
-
|
|
100
|
+
const D = { ...y, id: "vhyxui-textarea" }, G = E(m, D);
|
|
101
|
+
G.displayName = "VhyxTextarea";
|
|
102
102
|
export {
|
|
103
|
-
|
|
103
|
+
G as T
|
|
104
104
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("react/jsx-runtime"),a=require("react"),p=require("@vhyxui/core"),Y=require("@vhyxseal/react"),$=require("./useId-D2AEOm2G.cjs"),A="_wrapper_lafqn_1",E="_textarea_lafqn_8",F="_count_lafqn_72",d={wrapper:A,textarea:E,count:F},v=a.forwardRef(({size:b="md",resize:e="vertical",minRows:_=3,maxRows:n,showCount:q=!1,error:x=!1,contract:C,className:m,id:w,value:s,onChange:i,maxLength:o,"aria-label":H,"aria-describedby":j,style:N,...T},r)=>{const I=$.useId("vhyx-textarea"),f=w??I,h=a.useRef(null),R=a.useCallback(t=>{h.current=t,typeof r=="function"?r(t):r&&(r.current=t)},[r]),c=a.useCallback(()=>{const t=h.current;if(!t||e!=="auto")return;t.style.height="auto";const l=t.scrollHeight;if(n!==void 0){const y=(parseFloat(getComputedStyle(t).lineHeight)||20)*n;t.style.height=`${Math.min(l,y)}px`,t.style.overflowY=l>y?"auto":"hidden"}else t.style.height=`${l}px`,t.style.overflowY="hidden"},[e,n]);a.useEffect(()=>{e==="auto"&&c()},[s,e,c]);const k=a.useCallback(t=>{i==null||i(t),e==="auto"&&c()},[i,e,c]),S=typeof s=="string"?s.length:0,B={...p.textareaContract,id:f,...C},V=[d.textarea,m].filter(Boolean).join(" ");return u.jsxs("div",{className:d.wrapper,children:[u.jsx("textarea",{ref:R,id:f,value:s,onChange:k,maxLength:o,rows:_,"aria-invalid":x?!0:void 0,"aria-label":H,"aria-describedby":j,className:V,"data-size":b,"data-resize":e,"data-error":x?!0:void 0,"data-vhyx-contract":JSON.stringify(B),style:{resize:e==="auto"?"none":e,...N},...T}),q&&o!==void 0&&u.jsxs("span",{className:d.count,"aria-live":"polite","aria-atomic":"true",children:[S,"/",o]})]})});v.displayName="VhyxTextarea";const J={...p.textareaContract,id:"vhyxui-textarea"},g=Y.withAgentContract(v,J);g.displayName="VhyxTextarea";exports.Textarea=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),u=require("./Field-DJvjEmzE.cjs"),c=require("./Textarea-uXK6PrFb.cjs");function t({name:e,label:a,hint:s,error:r,required:x,optional:d,layout:l,...n}){return i.jsx(u.Field,{name:e,label:a,hint:s,error:r,required:x,optional:d,layout:l,children:i.jsx(c.Textarea,{name:e,error:!!r,...n})})}t.displayName="VhyxTextareaField";exports.TextareaField=t;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { F as l } from "./Field-Dx9gXxGL.js";
|
|
3
|
+
import { T as p } from "./Textarea-cloHZ5Sz.js";
|
|
4
|
+
function s({
|
|
5
|
+
name: r,
|
|
6
|
+
label: i,
|
|
7
|
+
hint: t,
|
|
8
|
+
error: e,
|
|
9
|
+
required: o,
|
|
10
|
+
optional: m,
|
|
11
|
+
layout: x,
|
|
12
|
+
...d
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ a(
|
|
15
|
+
l,
|
|
16
|
+
{
|
|
17
|
+
name: r,
|
|
18
|
+
label: i,
|
|
19
|
+
hint: t,
|
|
20
|
+
error: e,
|
|
21
|
+
required: o,
|
|
22
|
+
optional: m,
|
|
23
|
+
layout: x,
|
|
24
|
+
children: /* @__PURE__ */ a(p, { name: r, error: !!e, ...d })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
s.displayName = "VhyxTextareaField";
|
|
29
|
+
export {
|
|
30
|
+
s as T
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),r=require("react"),T=require("@vhyxui/core"),g=require("@vhyxseal/react");let c=[],x=5;const d=new Set;let m=0;function f(){for(const t of d)t()}function p(t){t.maxToasts!==void 0&&(x=t.maxToasts)}function _(){return c}function v(t){m+=1;const e=`vhyx-toast-${m}`,n={...t,id:e},o=[...c];return o.length>=x&&o.shift(),c=[...o,n],f(),e}function h(t){c=c.filter(e=>e.id!==t),f()}function j(){c=[],f()}function y(t){return d.add(t),()=>{d.delete(t)}}const q="_region_lqmlf_3",N="_toast_lqmlf_12",a={region:q,toast:N,"toast-content":"_toast-content_lqmlf_74","toast-icon":"_toast-icon_lqmlf_103","toast-body":"_toast-body_lqmlf_117","toast-message":"_toast-message_lqmlf_125","toast-description":"_toast-description_lqmlf_133","toast-action":"_toast-action_lqmlf_142","toast-dismiss":"_toast-dismiss_lqmlf_168"};function b({position:t="bottom-right",maxToasts:e=5,defaultDuration:n=5e3,children:o}){const[i,l]=r.useState(()=>_());return r.useEffect(()=>{p({maxToasts:e})},[e]),r.useEffect(()=>y(()=>{l(_())}),[]),s.jsxs(s.Fragment,{children:[o,s.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"false","aria-label":"Notifications",className:a.region,"data-position":t,children:i.map(u=>s.jsx(C,{item:u,defaultDuration:n},u.id))})]})}function C({item:t,defaultDuration:e}){const n=r.useCallback(()=>h(t.id),[t.id]),o=r.useRef(null),i=t.duration??e;return r.useEffect(()=>{if(!(!isFinite(i)||i<=0))return o.current=setTimeout(n,i),()=>{o.current&&clearTimeout(o.current)}},[n,i]),s.jsx("div",{role:"status","aria-live":"polite",className:a.toast,"data-variant":t.variant,"data-state":"open",children:s.jsxs("div",{className:a["toast-content"],children:[s.jsx("span",{className:a["toast-icon"],"aria-hidden":"true",children:k(t.variant)}),s.jsxs("div",{className:a["toast-body"],children:[s.jsx("span",{className:a["toast-message"],children:t.message}),t.description&&s.jsx("span",{className:a["toast-description"],children:t.description})]}),t.action&&s.jsx("button",{type:"button",className:a["toast-action"],onClick:()=>{var l;(l=t.action)==null||l.onClick(),n()},children:t.action.label}),t.dismissible!==!1&&s.jsx("button",{type:"button",className:a["toast-dismiss"],onClick:n,"aria-label":"Dismiss",children:s.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",children:[s.jsx("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),s.jsx("line",{x1:"10",y1:"2",x2:"2",y2:"10"})]})})]})})}function k(t){switch(t){case"success":return"✓";case"danger":return"✕";case"warning":return"⚠";case"info":return"ℹ";default:return"●"}}const w={...T.toastContract,id:"vhyxui-toast"},I=Object.assign(g.withAgentContract(b,w),{displayName:"VhyxToast"});exports.Toast=I;exports.ToastProvider=b;exports.addToast=v;exports.dismissAllToasts=j;exports.dismissToast=h;
|