@vhyxui/react 0.3.0-alpha → 0.4.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-0acAjZTB.js +0 -167
- package/dist/Toast-ndaxbpcV.cjs +0 -1
- package/dist/Tooltip-CCd6VRvZ.cjs +0 -1
- package/dist/VhyxUIProvider-C7ie8u2L.cjs +0 -1
- package/dist/VhyxUIProvider-DVFSW4q-.js +0 -31
- package/dist/jsx-runtime-BRMkMA8J.cjs +0 -22
- package/dist/jsx-runtime-CL69jGNW.js +0 -279
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BRMkMA8J.cjs"),R=require("./Field-D6FSsUGj.cjs"),t=require("./Select-BkJNe4Lc.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 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BRMkMA8J.cjs"),x=require("react"),u=require("@vhyxui/core"),d=require("@vhyxseal/react"),j="_separator_2n49e_1",h="_line_2n49e_28",r={separator:j,"separator--labeled":"_separator--labeled_2n49e_21",line:h,"label-text":"_label-text_2n49e_34"},l=x.forwardRef(({orientation:a="horizontal",decorative:t=!0,label:s,className:o,...n},i)=>{const c={className:[r.separator,o].filter(Boolean).join(" "),"data-orientation":a,...t?{"aria-hidden":!0}:{role:"separator","aria-orientation":a},...n};return s&&a==="horizontal"?e.jsxRuntimeExports.jsxs("div",{ref:i,className:[r["separator--labeled"],o].filter(Boolean).join(" "),"data-orientation":a,...t?{"aria-hidden":!0}:{role:"separator","aria-orientation":a},...n,children:[e.jsxRuntimeExports.jsx("span",{className:r.line}),e.jsxRuntimeExports.jsx("span",{className:r["label-text"],children:s}),e.jsxRuntimeExports.jsx("span",{className:r.line})]}):e.jsxRuntimeExports.jsx("hr",{ref:i,...c})});l.displayName="VhyxSeparator";const m={...u.separatorContract,id:"vhyxui-separator"},p=d.withAgentContract(l,m);p.displayName="VhyxSeparator";exports.Separator=p;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { j as r } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
-
import c from "react";
|
|
3
|
-
import { separatorContract as d } from "@vhyxui/core";
|
|
4
|
-
import { withAgentContract as m } from "@vhyxseal/react";
|
|
5
|
-
const x = "_separator_2n49e_1", h = "_line_2n49e_28", e = {
|
|
6
|
-
separator: x,
|
|
7
|
-
"separator--labeled": "_separator--labeled_2n49e_21",
|
|
8
|
-
line: h,
|
|
9
|
-
"label-text": "_label-text_2n49e_34"
|
|
10
|
-
}, i = c.forwardRef(
|
|
11
|
-
({
|
|
12
|
-
orientation: a = "horizontal",
|
|
13
|
-
decorative: t = !0,
|
|
14
|
-
label: s,
|
|
15
|
-
className: o,
|
|
16
|
-
...n
|
|
17
|
-
}, l) => {
|
|
18
|
-
const p = {
|
|
19
|
-
className: [e.separator, o].filter(Boolean).join(" "),
|
|
20
|
-
"data-orientation": a,
|
|
21
|
-
...t ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": a },
|
|
22
|
-
...n
|
|
23
|
-
};
|
|
24
|
-
return s && a === "horizontal" ? /* @__PURE__ */ r.jsxs(
|
|
25
|
-
"div",
|
|
26
|
-
{
|
|
27
|
-
ref: l,
|
|
28
|
-
className: [e["separator--labeled"], o].filter(Boolean).join(" "),
|
|
29
|
-
"data-orientation": a,
|
|
30
|
-
...t ? { "aria-hidden": !0 } : { role: "separator", "aria-orientation": a },
|
|
31
|
-
...n,
|
|
32
|
-
children: [
|
|
33
|
-
/* @__PURE__ */ r.jsx("span", { className: e.line }),
|
|
34
|
-
/* @__PURE__ */ r.jsx("span", { className: e["label-text"], children: s }),
|
|
35
|
-
/* @__PURE__ */ r.jsx("span", { className: e.line })
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
) : /* @__PURE__ */ r.jsx(
|
|
39
|
-
"hr",
|
|
40
|
-
{
|
|
41
|
-
ref: l,
|
|
42
|
-
...p
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
i.displayName = "VhyxSeparator";
|
|
48
|
-
const _ = { ...d, id: "vhyxui-separator" }, j = m(i, _);
|
|
49
|
-
j.displayName = "VhyxSeparator";
|
|
50
|
-
export {
|
|
51
|
-
j as S
|
|
52
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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/Switch-BU_Tcttb.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("./jsx-runtime-BRMkMA8J.cjs"),s=require("react"),h=require("@vhyxui/core"),A=require("@vhyxseal/react"),J=require("./useId-D2AEOm2G.cjs"),O="_thumb_du6cw_38",m={switch:"_switch_du6cw_1",thumb:O},f=s.forwardRef(({checked:l,defaultChecked:S=!1,onCheckedChange:c,size:b="md",asChild:j=!1,contract:y,className:v,id:R,disabled:n,onClick:e,onKeyDown:r,children:_,...q},d)=>{const I=J.useId("vhyx-switch"),w=R??I,u=l!==void 0,[N,E]=s.useState(S),i=u?l:N,a=s.useCallback(()=>{if(n)return;const t=!i;u||E(t),c==null||c(t)},[n,i,u,c]),B=s.useCallback(t=>{e==null||e(t),a()},[e,a]),V=s.useCallback(t=>{r==null||r(t),t.key==="Enter"&&(t.preventDefault(),a())},[r,a]),k={...h.switchContract,id:w,...y},z=[m.switch,v].filter(Boolean).join(" "),x={id:w,role:"switch","aria-checked":i,disabled:n,onClick:B,onKeyDown:V,className:z,"data-state":i?"checked":"unchecked","data-size":b,"data-vhyx-contract":JSON.stringify(k),...q};return j?o.jsxRuntimeExports.jsx(h.Slot,{ref:d,...x,children:_}):o.jsxRuntimeExports.jsx("button",{ref:d,type:"button",...x,children:o.jsxRuntimeExports.jsx("span",{className:m.thumb})})});f.displayName="VhyxSwitch";const P={...h.switchContract,id:"vhyxui-switch"},p=A.withAgentContract(f,P);p.displayName="VhyxSwitch";exports.Switch=p;
|
package/dist/Tabs-BTfm4LbV.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { j as h } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
-
import w, { useState as q, useRef as N, useCallback as T, useMemo as L, useEffect as D, createContext as P, useContext as W } from "react";
|
|
3
|
-
import { tabsContract as z, Slot as Y, VhyxUIError as G, VhyxUIErrorCode as J } from "@vhyxui/core";
|
|
4
|
-
import { withAgentContract as F } from "@vhyxseal/react";
|
|
5
|
-
import { u as Q } from "./useId-BGRmH6iF.js";
|
|
6
|
-
const Z = "_root_11mqx_3", K = "_list_11mqx_16", tt = "_trigger_11mqx_49", et = "_indicator_11mqx_114", st = "_panel_11mqx_149", _ = {
|
|
7
|
-
root: Z,
|
|
8
|
-
list: K,
|
|
9
|
-
trigger: tt,
|
|
10
|
-
indicator: et,
|
|
11
|
-
panel: st
|
|
12
|
-
}, O = P(null);
|
|
13
|
-
function $(e) {
|
|
14
|
-
const c = W(O);
|
|
15
|
-
if (!c)
|
|
16
|
-
throw new G({
|
|
17
|
-
code: J.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 = w.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: x,
|
|
33
|
-
children: l,
|
|
34
|
-
...r
|
|
35
|
-
}, a) => {
|
|
36
|
-
const y = Q("vhyx-tabs"), I = e !== void 0, [C, j] = q(c), R = I ? e : C, b = N([]), p = N(/* @__PURE__ */ new Map()), s = T(
|
|
37
|
-
(d, v) => {
|
|
38
|
-
v ? (b.current.includes(d) || b.current.push(d), p.current.set(d, v)) : (p.current.delete(d), b.current = b.current.filter((o) => o !== d));
|
|
39
|
-
},
|
|
40
|
-
[]
|
|
41
|
-
), g = T(
|
|
42
|
-
(d) => {
|
|
43
|
-
I || j(d), f == null || f(d);
|
|
44
|
-
},
|
|
45
|
-
[I, f]
|
|
46
|
-
), E = T(
|
|
47
|
-
(d, v) => {
|
|
48
|
-
var S;
|
|
49
|
-
const o = b.current;
|
|
50
|
-
if (o.length === 0) return;
|
|
51
|
-
let m;
|
|
52
|
-
if (v === "first")
|
|
53
|
-
m = o[0];
|
|
54
|
-
else if (v === "last")
|
|
55
|
-
m = o[o.length - 1];
|
|
56
|
-
else {
|
|
57
|
-
const A = o.indexOf(d);
|
|
58
|
-
v === "next" ? m = o[(A + 1) % o.length] : m = o[(A - 1 + o.length) % o.length];
|
|
59
|
-
}
|
|
60
|
-
m !== void 0 && (g(m), (S = p.current.get(m)) == null || S.focus());
|
|
61
|
-
},
|
|
62
|
-
[g]
|
|
63
|
-
), U = L(
|
|
64
|
-
() => ({ ...z, id: y, ...u }),
|
|
65
|
-
[y, u]
|
|
66
|
-
), M = L(
|
|
67
|
-
() => ({
|
|
68
|
-
value: R,
|
|
69
|
-
onValueChange: g,
|
|
70
|
-
orientation: n,
|
|
71
|
-
variant: t,
|
|
72
|
-
size: i,
|
|
73
|
-
tabsId: y,
|
|
74
|
-
triggerOrderRef: b,
|
|
75
|
-
triggerElementsRef: p,
|
|
76
|
-
registerTrigger: s,
|
|
77
|
-
navigateTab: E
|
|
78
|
-
}),
|
|
79
|
-
[
|
|
80
|
-
R,
|
|
81
|
-
g,
|
|
82
|
-
n,
|
|
83
|
-
t,
|
|
84
|
-
i,
|
|
85
|
-
y,
|
|
86
|
-
s,
|
|
87
|
-
E
|
|
88
|
-
]
|
|
89
|
-
), X = [_.root, x].filter(Boolean).join(" ");
|
|
90
|
-
return /* @__PURE__ */ h.jsx(O.Provider, { value: M, children: /* @__PURE__ */ h.jsx(
|
|
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
|
-
...r,
|
|
100
|
-
children: l
|
|
101
|
-
}
|
|
102
|
-
) });
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
V.displayName = "VhyxTabs";
|
|
106
|
-
const k = w.forwardRef(
|
|
107
|
-
({ children: e, className: c, ...f }, n) => {
|
|
108
|
-
const t = $("Tabs.List"), i = N(null), [u, x] = q({}), l = T(
|
|
109
|
-
(a) => {
|
|
110
|
-
i.current = a, typeof n == "function" ? n(a) : n && (n.current = a);
|
|
111
|
-
},
|
|
112
|
-
[n]
|
|
113
|
-
);
|
|
114
|
-
D(() => {
|
|
115
|
-
if (!t.value || !i.current) return;
|
|
116
|
-
const a = t.triggerElementsRef.current.get(t.value);
|
|
117
|
-
a && (t.orientation === "horizontal" ? x({
|
|
118
|
-
width: a.offsetWidth,
|
|
119
|
-
transform: `translateX(${a.offsetLeft}px)`
|
|
120
|
-
}) : x({
|
|
121
|
-
height: a.offsetHeight,
|
|
122
|
-
transform: `translateY(${a.offsetTop}px)`
|
|
123
|
-
}));
|
|
124
|
-
}, [t.value, t.orientation, t.triggerElementsRef]);
|
|
125
|
-
const r = [_.list, c].filter(Boolean).join(" ");
|
|
126
|
-
return /* @__PURE__ */ h.jsxs(
|
|
127
|
-
"div",
|
|
128
|
-
{
|
|
129
|
-
ref: l,
|
|
130
|
-
role: "tablist",
|
|
131
|
-
"aria-orientation": t.orientation,
|
|
132
|
-
className: r,
|
|
133
|
-
"data-variant": t.variant,
|
|
134
|
-
"data-orientation": t.orientation,
|
|
135
|
-
...f,
|
|
136
|
-
children: [
|
|
137
|
-
e,
|
|
138
|
-
/* @__PURE__ */ h.jsx(
|
|
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 = w.forwardRef(
|
|
154
|
-
({ value: e, children: c, className: f, onClick: n, onKeyDown: t, disabled: i, asChild: u = !1, ...x }, l) => {
|
|
155
|
-
const r = $("Tabs.Trigger"), a = r.value === e, y = `${r.tabsId}-panel-${e}`, I = `${r.tabsId}-trigger-${e}`, C = T(
|
|
156
|
-
(s) => {
|
|
157
|
-
r.registerTrigger(e, s), typeof l == "function" ? l(s) : l && (l.current = s);
|
|
158
|
-
},
|
|
159
|
-
[l, r, e]
|
|
160
|
-
), j = T(
|
|
161
|
-
(s) => {
|
|
162
|
-
n == null || n(s), i || r.onValueChange(e);
|
|
163
|
-
},
|
|
164
|
-
[n, i, r, e]
|
|
165
|
-
), R = T(
|
|
166
|
-
(s) => {
|
|
167
|
-
t == null || t(s);
|
|
168
|
-
const g = r.orientation === "horizontal";
|
|
169
|
-
g && s.key === "ArrowRight" || !g && s.key === "ArrowDown" ? (s.preventDefault(), r.navigateTab(e, "next")) : g && s.key === "ArrowLeft" || !g && s.key === "ArrowUp" ? (s.preventDefault(), r.navigateTab(e, "prev")) : s.key === "Home" ? (s.preventDefault(), r.navigateTab(e, "first")) : s.key === "End" && (s.preventDefault(), r.navigateTab(e, "last"));
|
|
170
|
-
},
|
|
171
|
-
[t, r, e]
|
|
172
|
-
), b = [_.trigger, f].filter(Boolean).join(" "), p = {
|
|
173
|
-
id: I,
|
|
174
|
-
role: "tab",
|
|
175
|
-
"aria-selected": a,
|
|
176
|
-
"aria-controls": y,
|
|
177
|
-
disabled: i,
|
|
178
|
-
tabIndex: a ? 0 : -1,
|
|
179
|
-
onClick: j,
|
|
180
|
-
onKeyDown: R,
|
|
181
|
-
className: b,
|
|
182
|
-
"data-state": a ? "active" : "inactive",
|
|
183
|
-
"data-size": r.size,
|
|
184
|
-
...x
|
|
185
|
-
};
|
|
186
|
-
return u ? /* @__PURE__ */ h.jsx(Y, { ref: C, ...p, children: c }) : /* @__PURE__ */ h.jsx("button", { ref: C, type: "button", ...p, children: c });
|
|
187
|
-
}
|
|
188
|
-
);
|
|
189
|
-
B.displayName = "VhyxTabsTrigger";
|
|
190
|
-
function H({ value: e, children: c, className: f, ...n }) {
|
|
191
|
-
const t = $("Tabs.Content"), i = t.value === e, u = `${t.tabsId}-panel-${e}`, x = `${t.tabsId}-trigger-${e}`;
|
|
192
|
-
if (!i) return null;
|
|
193
|
-
const l = [_.panel, f].filter(Boolean).join(" ");
|
|
194
|
-
return /* @__PURE__ */ h.jsx(
|
|
195
|
-
"div",
|
|
196
|
-
{
|
|
197
|
-
id: u,
|
|
198
|
-
role: "tabpanel",
|
|
199
|
-
"aria-labelledby": x,
|
|
200
|
-
tabIndex: 0,
|
|
201
|
-
className: l,
|
|
202
|
-
"data-state": "active",
|
|
203
|
-
...n,
|
|
204
|
-
children: c
|
|
205
|
-
}
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
H.displayName = "VhyxTabsContent";
|
|
209
|
-
const rt = { ...z, id: "vhyxui-tabs" }, nt = Object.assign(
|
|
210
|
-
F(V, rt),
|
|
211
|
-
{
|
|
212
|
-
List: k,
|
|
213
|
-
Trigger: B,
|
|
214
|
-
Content: H
|
|
215
|
-
}
|
|
216
|
-
);
|
|
217
|
-
nt.displayName = "VhyxTabs";
|
|
218
|
-
export {
|
|
219
|
-
nt as T
|
|
220
|
-
};
|
package/dist/Tabs-DuU02-UD.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("./jsx-runtime-BRMkMA8J.cjs"),r=require("react"),j=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",v={root:X,list:D,trigger:P,indicator:W,panel:Y},q=r.createContext(null);function N(e){const l=r.useContext(q);if(!l)throw new j.VhyxUIError({code:j.VhyxUIErrorCode.VHYXUI_MISSING_CONTEXT,message:`${e} must be used within <Tabs>`,suggestion:"Wrap your component tree with <Tabs>"});return l}const S=r.forwardRef(({value:e,defaultValue:l,onValueChange:u,orientation:a="horizontal",variant:t="default",size:o="md",contract:x,className:b,children:f,...n},i)=>{const y=U.useId("vhyx-tabs"),C=e!==void 0,[I,E]=r.useState(l),_=C?e:I,p=r.useRef([]),m=r.useRef(new Map),s=r.useCallback((d,R)=>{R?(p.current.includes(d)||p.current.push(d),m.current.set(d,R)):(m.current.delete(d),p.current=p.current.filter(c=>c!==d))},[]),g=r.useCallback(d=>{C||E(d),u==null||u(d)},[C,u]),w=r.useCallback((d,R)=>{var $;const c=p.current;if(c.length===0)return;let T;if(R==="first")T=c[0];else if(R==="last")T=c[c.length-1];else{const k=c.indexOf(d);R==="next"?T=c[(k+1)%c.length]:T=c[(k-1+c.length)%c.length]}T!==void 0&&(g(T),($=m.current.get(T))==null||$.focus())},[g]),V=r.useMemo(()=>({...j.tabsContract,id:y,...x}),[y,x]),B=r.useMemo(()=>({value:_,onValueChange:g,orientation:a,variant:t,size:o,tabsId:y,triggerOrderRef:p,triggerElementsRef:m,registerTrigger:s,navigateTab:w}),[_,g,a,t,o,y,s,w]),H=[v.root,b].filter(Boolean).join(" ");return h.jsxRuntimeExports.jsx(q.Provider,{value:B,children:h.jsxRuntimeExports.jsx("div",{ref:i,className:H,"data-orientation":a,"data-variant":t,"data-size":o,"data-vhyx-contract":JSON.stringify(V),...n,children:f})})});S.displayName="VhyxTabs";const A=r.forwardRef(({children:e,className:l,...u},a)=>{const t=N("Tabs.List"),o=r.useRef(null),[x,b]=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"?b({width:i.offsetWidth,transform:`translateX(${i.offsetLeft}px)`}):b({height:i.offsetHeight,transform:`translateY(${i.offsetTop}px)`}))},[t.value,t.orientation,t.triggerElementsRef]);const n=[v.list,l].filter(Boolean).join(" ");return h.jsxRuntimeExports.jsxs("div",{ref:f,role:"tablist","aria-orientation":t.orientation,className:n,"data-variant":t.variant,"data-orientation":t.orientation,...u,children:[e,h.jsxRuntimeExports.jsx("span",{className:v.indicator,"data-orientation":t.orientation,"aria-hidden":"true",style:x})]})});A.displayName="VhyxTabsList";const L=r.forwardRef(({value:e,children:l,className:u,onClick:a,onKeyDown:t,disabled:o,asChild:x=!1,...b},f)=>{const n=N("Tabs.Trigger"),i=n.value===e,y=`${n.tabsId}-panel-${e}`,C=`${n.tabsId}-trigger-${e}`,I=r.useCallback(s=>{n.registerTrigger(e,s),typeof f=="function"?f(s):f&&(f.current=s)},[f,n,e]),E=r.useCallback(s=>{a==null||a(s),o||n.onValueChange(e)},[a,o,n,e]),_=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=[v.trigger,u].filter(Boolean).join(" "),m={id:C,role:"tab","aria-selected":i,"aria-controls":y,disabled:o,tabIndex:i?0:-1,onClick:E,onKeyDown:_,className:p,"data-state":i?"active":"inactive","data-size":n.size,...b};return x?h.jsxRuntimeExports.jsx(j.Slot,{ref:I,...m,children:l}):h.jsxRuntimeExports.jsx("button",{ref:I,type:"button",...m,children:l})});L.displayName="VhyxTabsTrigger";function z({value:e,children:l,className:u,...a}){const t=N("Tabs.Content"),o=t.value===e,x=`${t.tabsId}-panel-${e}`,b=`${t.tabsId}-trigger-${e}`;if(!o)return null;const f=[v.panel,u].filter(Boolean).join(" ");return h.jsxRuntimeExports.jsx("div",{id:x,role:"tabpanel","aria-labelledby":b,tabIndex:0,className:f,"data-state":"active",...a,children:l})}z.displayName="VhyxTabsContent";const G={...j.tabsContract,id:"vhyxui-tabs"},O=Object.assign(M.withAgentContract(S,G),{List:A,Trigger:L,Content:z});O.displayName="VhyxTabs";exports.Tabs=O;
|
|
@@ -1 +0,0 @@
|
|
|
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;
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("./jsx-runtime-BRMkMA8J.cjs"),a=require("react"),y=require("@vhyxui/core"),V=require("@vhyxseal/react"),Y=require("./useId-D2AEOm2G.cjs"),$="_wrapper_lafqn_1",A="_textarea_lafqn_8",F="_count_lafqn_72",d={wrapper:$,textarea:A,count:F},v=a.forwardRef(({size:m="md",resize:e="vertical",minRows:b=3,maxRows:c,showCount:j=!1,error:x=!1,contract:_,className:q,id:C,value:s,onChange:i,maxLength:o,"aria-label":w,"aria-describedby":H,style:R,...N},r)=>{const T=Y.useId("vhyx-textarea"),f=C??T,h=a.useRef(null),E=a.useCallback(t=>{h.current=t,typeof r=="function"?r(t):r&&(r.current=t)},[r]),n=a.useCallback(()=>{const t=h.current;if(!t||e!=="auto")return;t.style.height="auto";const l=t.scrollHeight;if(c!==void 0){const p=(parseFloat(getComputedStyle(t).lineHeight)||20)*c;t.style.height=`${Math.min(l,p)}px`,t.style.overflowY=l>p?"auto":"hidden"}else t.style.height=`${l}px`,t.style.overflowY="hidden"},[e,c]);a.useEffect(()=>{e==="auto"&&n()},[s,e,n]);const I=a.useCallback(t=>{i==null||i(t),e==="auto"&&n()},[i,e,n]),k=typeof s=="string"?s.length:0,S={...y.textareaContract,id:f,..._},B=[d.textarea,q].filter(Boolean).join(" ");return u.jsxRuntimeExports.jsxs("div",{className:d.wrapper,children:[u.jsxRuntimeExports.jsx("textarea",{ref:E,id:f,value:s,onChange:I,maxLength:o,rows:b,"aria-invalid":x?!0:void 0,"aria-label":w,"aria-describedby":H,className:B,"data-size":m,"data-resize":e,"data-error":x?!0:void 0,"data-vhyx-contract":JSON.stringify(S),style:{resize:e==="auto"?"none":e,...R},...N}),j&&o!==void 0&&u.jsxRuntimeExports.jsxs("span",{className:d.count,"aria-live":"polite","aria-atomic":"true",children:[k,"/",o]})]})});v.displayName="VhyxTextarea";const J={...y.textareaContract,id:"vhyxui-textarea"},g=V.withAgentContract(v,J);g.displayName="VhyxTextarea";exports.Textarea=g;
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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/Toast-0acAjZTB.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { j as s } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
-
import { useState as p, useEffect as d, useCallback as h, useRef as b } from "react";
|
|
3
|
-
import { toastContract as g } from "@vhyxui/core";
|
|
4
|
-
import { withAgentContract as j } from "@vhyxseal/react";
|
|
5
|
-
let r = [], _ = 5;
|
|
6
|
-
const u = /* @__PURE__ */ new Set();
|
|
7
|
-
let m = 0;
|
|
8
|
-
function f() {
|
|
9
|
-
for (const t of u)
|
|
10
|
-
t();
|
|
11
|
-
}
|
|
12
|
-
function v(t) {
|
|
13
|
-
t.maxToasts !== void 0 && (_ = t.maxToasts);
|
|
14
|
-
}
|
|
15
|
-
function x() {
|
|
16
|
-
return r;
|
|
17
|
-
}
|
|
18
|
-
function B(t) {
|
|
19
|
-
m += 1;
|
|
20
|
-
const o = `vhyx-toast-${m}`, e = { ...t, id: o }, a = [...r];
|
|
21
|
-
return a.length >= _ && a.shift(), r = [...a, e], f(), o;
|
|
22
|
-
}
|
|
23
|
-
function y(t) {
|
|
24
|
-
r = r.filter((o) => o.id !== t), f();
|
|
25
|
-
}
|
|
26
|
-
function D() {
|
|
27
|
-
r = [], f();
|
|
28
|
-
}
|
|
29
|
-
function T(t) {
|
|
30
|
-
return u.add(t), () => {
|
|
31
|
-
u.delete(t);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const N = "_region_1l6lf_3", C = "_toast_1l6lf_49", n = {
|
|
35
|
-
region: N,
|
|
36
|
-
toast: C,
|
|
37
|
-
"toast-content": "_toast-content_1l6lf_60",
|
|
38
|
-
"toast-icon": "_toast-icon_1l6lf_89",
|
|
39
|
-
"toast-body": "_toast-body_1l6lf_103",
|
|
40
|
-
"toast-message": "_toast-message_1l6lf_111",
|
|
41
|
-
"toast-description": "_toast-description_1l6lf_119",
|
|
42
|
-
"toast-action": "_toast-action_1l6lf_128",
|
|
43
|
-
"toast-dismiss": "_toast-dismiss_1l6lf_154"
|
|
44
|
-
};
|
|
45
|
-
function k({
|
|
46
|
-
position: t = "bottom-right",
|
|
47
|
-
maxToasts: o = 5,
|
|
48
|
-
defaultDuration: e = 5e3,
|
|
49
|
-
children: a
|
|
50
|
-
}) {
|
|
51
|
-
const [i, c] = p(() => x());
|
|
52
|
-
return d(() => {
|
|
53
|
-
v({ maxToasts: o });
|
|
54
|
-
}, [o]), d(() => T(() => {
|
|
55
|
-
c(x());
|
|
56
|
-
}), []), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
57
|
-
a,
|
|
58
|
-
/* @__PURE__ */ s.jsx(
|
|
59
|
-
"div",
|
|
60
|
-
{
|
|
61
|
-
role: "status",
|
|
62
|
-
"aria-live": "polite",
|
|
63
|
-
"aria-atomic": "false",
|
|
64
|
-
"aria-label": "Notifications",
|
|
65
|
-
className: n.region,
|
|
66
|
-
"data-position": t,
|
|
67
|
-
children: i.map((l) => /* @__PURE__ */ s.jsx(
|
|
68
|
-
w,
|
|
69
|
-
{
|
|
70
|
-
item: l,
|
|
71
|
-
defaultDuration: e
|
|
72
|
-
},
|
|
73
|
-
l.id
|
|
74
|
-
))
|
|
75
|
-
}
|
|
76
|
-
)
|
|
77
|
-
] });
|
|
78
|
-
}
|
|
79
|
-
function w({
|
|
80
|
-
item: t,
|
|
81
|
-
defaultDuration: o
|
|
82
|
-
}) {
|
|
83
|
-
const e = h(() => y(t.id), [t.id]), a = b(null), i = t.duration ?? o;
|
|
84
|
-
return d(() => {
|
|
85
|
-
if (!(!isFinite(i) || i <= 0))
|
|
86
|
-
return a.current = setTimeout(e, i), () => {
|
|
87
|
-
a.current && clearTimeout(a.current);
|
|
88
|
-
};
|
|
89
|
-
}, [e, i]), /* @__PURE__ */ s.jsx(
|
|
90
|
-
"div",
|
|
91
|
-
{
|
|
92
|
-
role: "status",
|
|
93
|
-
"aria-live": "polite",
|
|
94
|
-
className: n.toast,
|
|
95
|
-
"data-variant": t.variant,
|
|
96
|
-
"data-state": "open",
|
|
97
|
-
children: /* @__PURE__ */ s.jsxs("div", { className: n["toast-content"], children: [
|
|
98
|
-
/* @__PURE__ */ s.jsx("span", { className: n["toast-icon"], "aria-hidden": "true", children: I(t.variant) }),
|
|
99
|
-
/* @__PURE__ */ s.jsxs("div", { className: n["toast-body"], children: [
|
|
100
|
-
/* @__PURE__ */ s.jsx("span", { className: n["toast-message"], children: t.message }),
|
|
101
|
-
t.description && /* @__PURE__ */ s.jsx("span", { className: n["toast-description"], children: t.description })
|
|
102
|
-
] }),
|
|
103
|
-
t.action && /* @__PURE__ */ s.jsx(
|
|
104
|
-
"button",
|
|
105
|
-
{
|
|
106
|
-
type: "button",
|
|
107
|
-
className: n["toast-action"],
|
|
108
|
-
onClick: () => {
|
|
109
|
-
var c;
|
|
110
|
-
(c = t.action) == null || c.onClick(), e();
|
|
111
|
-
},
|
|
112
|
-
children: t.action.label
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
t.dismissible !== !1 && /* @__PURE__ */ s.jsx(
|
|
116
|
-
"button",
|
|
117
|
-
{
|
|
118
|
-
type: "button",
|
|
119
|
-
className: n["toast-dismiss"],
|
|
120
|
-
onClick: e,
|
|
121
|
-
"aria-label": "Dismiss",
|
|
122
|
-
children: /* @__PURE__ */ s.jsxs(
|
|
123
|
-
"svg",
|
|
124
|
-
{
|
|
125
|
-
"aria-hidden": "true",
|
|
126
|
-
viewBox: "0 0 12 12",
|
|
127
|
-
fill: "none",
|
|
128
|
-
stroke: "currentColor",
|
|
129
|
-
strokeWidth: 1.5,
|
|
130
|
-
strokeLinecap: "round",
|
|
131
|
-
children: [
|
|
132
|
-
/* @__PURE__ */ s.jsx("line", { x1: "2", y1: "2", x2: "10", y2: "10" }),
|
|
133
|
-
/* @__PURE__ */ s.jsx("line", { x1: "10", y1: "2", x2: "2", y2: "10" })
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
] })
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
function I(t) {
|
|
144
|
-
switch (t) {
|
|
145
|
-
case "success":
|
|
146
|
-
return "✓";
|
|
147
|
-
case "danger":
|
|
148
|
-
return "✕";
|
|
149
|
-
case "warning":
|
|
150
|
-
return "⚠";
|
|
151
|
-
case "info":
|
|
152
|
-
return "ℹ";
|
|
153
|
-
default:
|
|
154
|
-
return "●";
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
const S = { ...g, id: "vhyxui-toast" }, L = Object.assign(
|
|
158
|
-
j(k, S),
|
|
159
|
-
{ displayName: "VhyxToast" }
|
|
160
|
-
);
|
|
161
|
-
export {
|
|
162
|
-
L as T,
|
|
163
|
-
k as a,
|
|
164
|
-
B as b,
|
|
165
|
-
y as c,
|
|
166
|
-
D as d
|
|
167
|
-
};
|
package/dist/Toast-ndaxbpcV.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("./jsx-runtime-BRMkMA8J.cjs"),r=require("react"),h=require("@vhyxui/core"),b=require("@vhyxseal/react");let c=[],p=5;const d=new Set;let f=0;function x(){for(const t of d)t()}function R(t){t.maxToasts!==void 0&&(p=t.maxToasts)}function m(){return c}function T(t){f+=1;const e=`vhyx-toast-${f}`,i={...t,id:e},o=[...c];return o.length>=p&&o.shift(),c=[...o,i],x(),e}function j(t){c=c.filter(e=>e.id!==t),x()}function g(){c=[],x()}function E(t){return d.add(t),()=>{d.delete(t)}}const v="_region_1l6lf_3",y="_toast_1l6lf_49",n={region:v,toast:y,"toast-content":"_toast-content_1l6lf_60","toast-icon":"_toast-icon_1l6lf_89","toast-body":"_toast-body_1l6lf_103","toast-message":"_toast-message_1l6lf_111","toast-description":"_toast-description_1l6lf_119","toast-action":"_toast-action_1l6lf_128","toast-dismiss":"_toast-dismiss_1l6lf_154"};function _({position:t="bottom-right",maxToasts:e=5,defaultDuration:i=5e3,children:o}){const[a,l]=r.useState(()=>m());return r.useEffect(()=>{R({maxToasts:e})},[e]),r.useEffect(()=>E(()=>{l(m())}),[]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[o,s.jsxRuntimeExports.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"false","aria-label":"Notifications",className:n.region,"data-position":t,children:a.map(u=>s.jsxRuntimeExports.jsx(N,{item:u,defaultDuration:i},u.id))})]})}function N({item:t,defaultDuration:e}){const i=r.useCallback(()=>j(t.id),[t.id]),o=r.useRef(null),a=t.duration??e;return r.useEffect(()=>{if(!(!isFinite(a)||a<=0))return o.current=setTimeout(i,a),()=>{o.current&&clearTimeout(o.current)}},[i,a]),s.jsxRuntimeExports.jsx("div",{role:"status","aria-live":"polite",className:n.toast,"data-variant":t.variant,"data-state":"open",children:s.jsxRuntimeExports.jsxs("div",{className:n["toast-content"],children:[s.jsxRuntimeExports.jsx("span",{className:n["toast-icon"],"aria-hidden":"true",children:C(t.variant)}),s.jsxRuntimeExports.jsxs("div",{className:n["toast-body"],children:[s.jsxRuntimeExports.jsx("span",{className:n["toast-message"],children:t.message}),t.description&&s.jsxRuntimeExports.jsx("span",{className:n["toast-description"],children:t.description})]}),t.action&&s.jsxRuntimeExports.jsx("button",{type:"button",className:n["toast-action"],onClick:()=>{var l;(l=t.action)==null||l.onClick(),i()},children:t.action.label}),t.dismissible!==!1&&s.jsxRuntimeExports.jsx("button",{type:"button",className:n["toast-dismiss"],onClick:i,"aria-label":"Dismiss",children:s.jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",children:[s.jsxRuntimeExports.jsx("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),s.jsxRuntimeExports.jsx("line",{x1:"10",y1:"2",x2:"2",y2:"10"})]})})]})})}function C(t){switch(t){case"success":return"✓";case"danger":return"✕";case"warning":return"⚠";case"info":return"ℹ";default:return"●"}}const k={...h.toastContract,id:"vhyxui-toast"},w=Object.assign(b.withAgentContract(_,k),{displayName:"VhyxToast"});exports.Toast=w;exports.ToastProvider=_;exports.addToast=T;exports.dismissAllToasts=g;exports.dismissToast=j;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("./jsx-runtime-BRMkMA8J.cjs"),o=require("react"),q=require("react-dom"),B=require("@vhyxui/core"),L=require("@vhyxseal/react"),O=require("./useId-D2AEOm2G.cjs"),P="_tooltip_jlaje_1",F={tooltip:P};function R({content:T,side:n="top",align:v="center",delayDuration:y=400,skipDelayDuration:C=300,children:s}){const x=O.useId("vhyx-tooltip"),[l,u]=o.useState(!1),[b,j]=o.useState({top:0,left:0}),g=o.useRef(null),p=o.useRef(null),m=o.useRef(null),i=o.useCallback(()=>{p.current&&clearTimeout(p.current),m.current&&clearTimeout(m.current)},[]);o.useEffect(()=>()=>i(),[i]);const d=o.useCallback(()=>{const e=g.current;if(!e)return;const t=e.getBoundingClientRect(),a=6;let r=0,c=0;n==="top"?(r=t.top-a,c=t.left+t.width/2):n==="bottom"?(r=t.bottom+a,c=t.left+t.width/2):n==="right"?(r=t.top+t.height/2,c=t.right+a):(r=t.top+t.height/2,c=t.left-a),j({top:r,left:c})},[n]),k=o.useCallback(()=>{i(),p.current=setTimeout(()=>{d(),u(!0)},y)},[i,y,d]),f=o.useCallback((e=0)=>{i(),e>0?m.current=setTimeout(()=>u(!1),e):u(!1)},[i]);o.useEffect(()=>{if(!l)return;function e(t){t.key==="Escape"&&f(0)}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[l,f]);const w=o.cloneElement(s,{ref:o.useCallback(e=>{g.current=e;const t=s.ref;typeof t=="function"?t(e):t&&typeof t=="object"&&(t.current=e)},[]),"aria-describedby":l?x:void 0,onMouseEnter:e=>{const t=s.props.onMouseEnter;typeof t=="function"&&t(e),k()},onMouseLeave:e=>{const t=s.props.onMouseLeave;typeof t=="function"&&t(e),f(C)},onFocus:e=>{const t=s.props.onFocus;typeof t=="function"&&t(e),d(),u(!0)},onBlur:e=>{const t=s.props.onBlur;typeof t=="function"&&t(e),f(0)}}),M=l?q.createPortal(h.jsxRuntimeExports.jsx("div",{id:x,role:"tooltip",className:F.tooltip,"data-side":n,"data-align":v,style:{position:"fixed",top:b.top,left:b.left,zIndex:550,transform:n==="top"||n==="bottom"?"translateX(-50%)":"translateY(-50%)"},children:T}),document.body):null;return h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[w,M]})}R.displayName="VhyxTooltip";const I={...B.tooltipContract,id:"vhyxui-tooltip"},E=L.withAgentContract(R,I);E.displayName="VhyxTooltip";exports.Tooltip=E;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BRMkMA8J.cjs"),d=require("@vhyxseal/react"),p=require("./Toast-ndaxbpcV.cjs"),x={"skip-link":"_skip-link_1u818_1"};function i({children:s,toastPosition:o="bottom-right",maxToasts:n=5,defaultDuration:r=4e3,domain:t}){const c=t??(typeof process<"u"?process.env.NEXT_PUBLIC_VHYX_DOMAIN??"":""),a=process.env.NODE_ENV!=="production";return e.jsxRuntimeExports.jsxs(d.SealProvider,{config:{domain:c,domainVerified:!1,verificationToken:""},dev:a,children:[e.jsxRuntimeExports.jsx("a",{href:"#vhyx-main",className:x["skip-link"],children:"Skip to main content"}),e.jsxRuntimeExports.jsx(p.ToastProvider,{position:o,maxToasts:n,defaultDuration:r,children:s})]})}i.displayName="VhyxUIProvider";exports.VhyxUIProvider=i;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { j as o } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
-
import { SealProvider as p } from "@vhyxseal/react";
|
|
3
|
-
import { a as d } from "./Toast-0acAjZTB.js";
|
|
4
|
-
const m = {
|
|
5
|
-
"skip-link": "_skip-link_1u818_1"
|
|
6
|
-
};
|
|
7
|
-
function c({
|
|
8
|
-
children: i,
|
|
9
|
-
toastPosition: e = "bottom-right",
|
|
10
|
-
maxToasts: s = 5,
|
|
11
|
-
defaultDuration: r = 4e3,
|
|
12
|
-
domain: n
|
|
13
|
-
}) {
|
|
14
|
-
const t = n ?? (typeof process < "u" ? process.env.NEXT_PUBLIC_VHYX_DOMAIN ?? "" : ""), a = process.env.NODE_ENV !== "production";
|
|
15
|
-
return /* @__PURE__ */ o.jsxs(p, { config: { domain: t, domainVerified: !1, verificationToken: "" }, dev: a, children: [
|
|
16
|
-
/* @__PURE__ */ o.jsx("a", { href: "#vhyx-main", className: m["skip-link"], children: "Skip to main content" }),
|
|
17
|
-
/* @__PURE__ */ o.jsx(
|
|
18
|
-
d,
|
|
19
|
-
{
|
|
20
|
-
position: e,
|
|
21
|
-
maxToasts: s,
|
|
22
|
-
defaultDuration: r,
|
|
23
|
-
children: i
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
] });
|
|
27
|
-
}
|
|
28
|
-
c.displayName = "VhyxUIProvider";
|
|
29
|
-
export {
|
|
30
|
-
c as V
|
|
31
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";const Q=require("react");var S={exports:{}},m={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var $;function K(){if($)return m;$=1;var l=Symbol.for("react.transitional.element"),_=Symbol.for("react.fragment");function c(i,o,s){var f=null;if(s!==void 0&&(f=""+s),o.key!==void 0&&(f=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:l,type:i,key:f,ref:o!==void 0?o:null,props:s}}return m.Fragment=_,m.jsx=c,m.jsxs=c,m}var E={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var I;function ee(){return I||(I=1,process.env.NODE_ENV!=="production"&&function(){function l(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===B?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case W:return"Profiler";case M:return"StrictMode";case q:return"Suspense";case G:return"SuspenseList";case X:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case L:return"Portal";case V:return e.displayName||"Context";case U:return(e._context.displayName||"Context")+".Consumer";case z:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return r=e.displayName||null,r!==null?r:l(e.type)||"Memo";case p:r=e._payload,e=e._init;try{return l(e(r))}catch{}}return null}function _(e){return""+e}function c(e){try{_(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),_(e)}}function i(e){if(e===v)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===p)return"<...>";try{var r=l(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function o(){var e=T.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function f(e){if(g.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function d(e,r){function t(){x||(x=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function F(){var e=l(this.type);return h[e]||(h[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function D(e,r,t,n,b,O){var a=t.ref;return e={$$typeof:j,type:e,key:r,props:t,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:F}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:b}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:O}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function P(e,r,t,n,b,O){var a=r.children;if(a!==void 0)if(n)if(H(a)){for(n=0;n<a.length;n++)w(a[n]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else w(a);if(g.call(r,"key")){a=l(e);var u=Object.keys(r).filter(function(Z){return Z!=="key"});n=0<u.length?"{key: someKey, "+u.join(": ..., ")+": ...}":"{key: someKey}",Y[a+n]||(u=0<u.length?"{"+u.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
-
let props = %s;
|
|
19
|
-
<%s {...props} />
|
|
20
|
-
React keys must be passed directly to JSX without using spread:
|
|
21
|
-
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,n,a,u,a),Y[a+n]=!0)}if(a=null,t!==void 0&&(c(t),a=""+t),f(r)&&(c(r.key),a=""+r.key),"key"in r){t={};for(var A in r)A!=="key"&&(t[A]=r[A])}else t=r;return a&&d(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),D(e,a,t,o(),b,O)}function w(e){y(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===p&&(e._payload.status==="fulfilled"?y(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function y(e){return typeof e=="object"&&e!==null&&e.$$typeof===j}var R=Q,j=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),V=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),B=Symbol.for("react.client.reference"),T=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,g=Object.prototype.hasOwnProperty,H=Array.isArray,k=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var x,h={},N=R.react_stack_bottom_frame.bind(R,s)(),C=k(i(s)),Y={};E.Fragment=v,E.jsx=function(e,r,t){var n=1e4>T.recentlyCreatedOwnerStacks++;return P(e,r,t,!1,n?Error("react-stack-top-frame"):N,n?k(i(e)):C)},E.jsxs=function(e,r,t){var n=1e4>T.recentlyCreatedOwnerStacks++;return P(e,r,t,!0,n?Error("react-stack-top-frame"):N,n?k(i(e)):C)}}()),E}process.env.NODE_ENV==="production"?S.exports=K():S.exports=ee();var re=S.exports;exports.jsxRuntimeExports=re;
|