@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 t=require("./jsx-runtime-BRMkMA8J.cjs"),j=require("react"),y=require("@vhyxui/core"),I=require("@vhyxseal/react"),g=require("./useId-D2AEOm2G.cjs"),L="_nav_1kxmq_1",M="_list_1kxmq_5",P="_button_1kxmq_15",w="_ellipsis_1kxmq_75",e={nav:L,list:M,button:P,ellipsis:w},b="ellipsis";function A(s,i,n){const u=n*2+5;if(i<=u)return Array.from({length:i},(o,p)=>p+1);const r=Math.max(s-n,2),c=Math.min(s+n,i-1),a=r>2,d=c<i-1,l=[1];a&&l.push(b);for(let o=r;o<=c;o++)l.push(o);return d&&l.push(b),l.push(i),l}const v=j.forwardRef(({page:s,pageCount:i,onPageChange:n,siblingCount:u=1,showFirstLast:r=!1,showPrevNext:c=!0,size:a="md",contract:d,className:l,...o},p)=>{const h=g.useId("vhyx-pagination"),N=j.useMemo(()=>({...y.paginationContract,id:h,...d}),[h,d]),k=j.useMemo(()=>A(s,i,u),[s,i,u]),R=s<=1,E=s>=i,q=[e.nav,l].filter(Boolean).join(" ");return t.jsxRuntimeExports.jsx("nav",{ref:p,"aria-label":"Pagination",className:q,"data-size":a,"data-vhyx-contract":JSON.stringify(N),...o,children:t.jsxRuntimeExports.jsxs("ul",{className:e.list,children:[r&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("button",{type:"button",className:e.button,onClick:()=>n(1),disabled:R,"aria-label":"First page","data-size":a,children:"«"})}),c&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("button",{type:"button",className:e.button,onClick:()=>n(s-1),disabled:R,"aria-label":"Previous page","data-size":a,children:"‹"})}),k.map((f,S)=>{if(f===b)return t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("span",{className:e.ellipsis,"aria-hidden":"true",children:"…"})},`ellipsis-${S}`);const x=f,m=x===s;return t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("button",{type:"button",className:e.button,onClick:()=>!m&&n(x),"aria-current":m?"page":void 0,"aria-label":m?void 0:`Page ${x}`,"data-state":m?"active":"inactive","data-size":a,children:x})},x)}),c&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("button",{type:"button",className:e.button,onClick:()=>n(s+1),disabled:E,"aria-label":"Next page","data-size":a,children:"›"})}),r&&t.jsxRuntimeExports.jsx("li",{children:t.jsxRuntimeExports.jsx("button",{type:"button",className:e.button,onClick:()=>n(i),disabled:E,"aria-label":"Last page","data-size":a,children:"»"})})]})})});v.displayName="VhyxPagination";const B={...y.paginationContract,id:"vhyxui-pagination"},_=I.withAgentContract(v,B);_.displayName="VhyxPagination";exports.Pagination=_;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const x=require("./jsx-runtime-BRMkMA8J.cjs"),o=require("react"),M=require("react-dom"),j=require("@vhyxui/core"),A=require("@vhyxseal/react"),O=require("./useId-D2AEOm2G.cjs"),I=require("./floatingPosition-oslPPzF_.cjs"),H="_trigger_5e049_1",W="_content_5e049_7",z="_arrow_5e049_21",U="_close_5e049_29",b={trigger:H,content:W,arrow:z,close:U},N=o.createContext(null);function _(n){const c=o.useContext(N);if(!c)throw new j.VhyxUIError({code:j.VhyxUIErrorCode.VHYXUI_MISSING_CONTEXT,message:`${n} must be used within <Popover>`,suggestion:"Wrap your component tree with <Popover>"});return c}const V=o.forwardRef(({open:n,defaultOpen:c=!1,onOpenChange:t,contract:s,children:P},a)=>{const e=O.useId("vhyx-popover"),l=`${e}-trigger`,v=`${e}-content`,f=n!==void 0,[m,p]=o.useState(c),g=f?n:m,E=o.useRef(null),C=o.useRef(null),u=o.useCallback(i=>{f||p(i),t==null||t(i)},[f,t]);o.useEffect(()=>{if(!g)return;function i(h){var d;h.key==="Escape"&&(u(!1),(d=E.current)==null||d.focus())}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[g,u]),o.useEffect(()=>{if(!g)return;function i(h){var R,y;const d=h.target;(R=E.current)!=null&&R.contains(d)||(y=C.current)!=null&&y.contains(d)||u(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[g,u]);const r=o.useMemo(()=>({...j.popoverContract,id:e,...s}),[e,s]),w=o.useMemo(()=>({open:g,onOpenChange:u,triggerId:l,contentId:v,triggerRef:E,contentRef:C}),[g,u,l,v]);return x.jsxRuntimeExports.jsx(N.Provider,{value:w,children:x.jsxRuntimeExports.jsx("div",{ref:a,"data-state":g?"open":"closed","data-vhyx-contract":JSON.stringify(r),children:P})})});V.displayName="VhyxPopover";const L=o.forwardRef(({children:n,className:c,onClick:t,asChild:s=!1,...P},a)=>{const e=_("Popover.Trigger"),l=o.useCallback(p=>{e.triggerRef.current=p,typeof a=="function"?a(p):a&&(a.current=p)},[a,e.triggerRef]),v=o.useCallback(p=>{t==null||t(p),e.onOpenChange(!e.open)},[t,e]),f=[b.trigger,c].filter(Boolean).join(" "),m={id:e.triggerId,"aria-haspopup":"dialog","aria-expanded":e.open,"aria-controls":e.open?e.contentId:void 0,onClick:v,className:f,...P};return s?x.jsxRuntimeExports.jsx(j.Slot,{ref:l,...m,children:n}):x.jsxRuntimeExports.jsx("button",{ref:l,type:"button",...m,children:n})});L.displayName="VhyxPopoverTrigger";function S({children:n,className:c,side:t="bottom",align:s="center",style:P,...a}){const e=_("Popover.Content"),[l,v]=o.useState(!1),[f,m]=o.useState({top:0,left:0});o.useEffect(()=>{v(!0)},[]),o.useEffect(()=>{if(!l||!e.open||!e.triggerRef.current)return;const C=()=>{const r=e.triggerRef.current.getBoundingClientRect(),w=e.contentRef.current,i=(w==null?void 0:w.offsetWidth)??r.width,h=(w==null?void 0:w.offsetHeight)??0,d=8;let R,y;t==="bottom"||t==="top"?(R=t==="bottom"?r.bottom+d:r.top-d-h,s==="start"?y=r.left:s==="end"?y=r.right-i:y=r.left+r.width/2-i/2):(y=t==="right"?r.right+d:r.left-d-i,s==="start"?R=r.top:s==="end"?R=r.bottom-h:R=r.top+r.height/2-h/2),m({top:I.clampToViewport(R,h,window.innerHeight),left:I.clampToViewport(y,i,window.innerWidth)})};C();const u=I.rafBatched(C);return window.addEventListener("scroll",u.run,!0),window.addEventListener("resize",u.run),()=>{u.cancel(),window.removeEventListener("scroll",u.run,!0),window.removeEventListener("resize",u.run)}},[l,e.open,e.triggerRef,t,s]);const p=o.useCallback(C=>{e.contentRef.current=C},[e.contentRef]);if(!l||!e.open)return null;const g=[b.content,c].filter(Boolean).join(" "),E=x.jsxRuntimeExports.jsx("div",{ref:p,id:e.contentId,role:"dialog","aria-modal":"false","aria-labelledby":e.triggerId,className:g,"data-state":"open","data-side":t,"data-align":s,...a,style:{...P,position:"fixed",top:f.top,left:f.left,zIndex:450},children:n});return M.createPortal(E,document.body)}S.displayName="VhyxPopoverContent";function T({className:n,...c}){const t=[b.arrow,n].filter(Boolean).join(" ");return x.jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 10 5",...c,children:x.jsxRuntimeExports.jsx("path",{d:"M0 5L5 0L10 5",fill:"currentColor"})})}T.displayName="VhyxPopoverArrow";const q=o.forwardRef(({children:n,className:c,onClick:t,asChild:s=!1,...P},a)=>{const e=_("Popover.Close"),l=o.useCallback(m=>{t==null||t(m),e.onOpenChange(!1)},[t,e]),v=[b.close,c].filter(Boolean).join(" "),f={onClick:l,className:v,...P};return s?x.jsxRuntimeExports.jsx(j.Slot,{ref:a,...f,children:n}):x.jsxRuntimeExports.jsx("button",{ref:a,type:"button",...f,children:n??"Close"})});q.displayName="VhyxPopoverClose";const $={...j.popoverContract,id:"vhyxui-popover"},B=Object.assign(A.withAgentContract(V,$),{Trigger:L,Content:S,Arrow:T,Close:q});B.displayName="VhyxPopover";exports.Popover=B;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { j as o } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
-
import k, { useMemo as b } from "react";
|
|
3
|
-
import { progressContract as c } from "@vhyxui/core";
|
|
4
|
-
import { withAgentContract as N } from "@vhyxseal/react";
|
|
5
|
-
import { u as C } from "./useId-BGRmH6iF.js";
|
|
6
|
-
const P = "_wrapper_ko60j_1", M = "_label_ko60j_10", I = "_track_ko60j_21", R = "_fill_ko60j_52", t = {
|
|
7
|
-
wrapper: P,
|
|
8
|
-
label: M,
|
|
9
|
-
track: I,
|
|
10
|
-
fill: R
|
|
11
|
-
}, n = k.forwardRef(
|
|
12
|
-
({
|
|
13
|
-
value: a,
|
|
14
|
-
max: s = 100,
|
|
15
|
-
indeterminate: r = !1,
|
|
16
|
-
size: p = "md",
|
|
17
|
-
variant: d = "default",
|
|
18
|
-
showLabel: f = !1,
|
|
19
|
-
label: m,
|
|
20
|
-
contract: h,
|
|
21
|
-
className: g,
|
|
22
|
-
id: u,
|
|
23
|
-
...v
|
|
24
|
-
}, _) => {
|
|
25
|
-
const j = C("vhyx-progress"), e = u ?? j, l = b(() => {
|
|
26
|
-
if (a === void 0 || r) return 0;
|
|
27
|
-
const w = Math.max(0, Math.min(a, s));
|
|
28
|
-
return Math.round(w / s * 100);
|
|
29
|
-
}, [a, s, r]), i = m ?? `${l}%`, x = {
|
|
30
|
-
...c,
|
|
31
|
-
id: e,
|
|
32
|
-
...h
|
|
33
|
-
}, y = [t.wrapper, g].filter(Boolean).join(" ");
|
|
34
|
-
return /* @__PURE__ */ o.jsxs(
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
ref: _,
|
|
38
|
-
id: e,
|
|
39
|
-
className: y,
|
|
40
|
-
"data-size": p,
|
|
41
|
-
"data-variant": d,
|
|
42
|
-
"data-vhyx-contract": JSON.stringify(x),
|
|
43
|
-
...v,
|
|
44
|
-
children: [
|
|
45
|
-
f && /* @__PURE__ */ o.jsx("span", { className: t.label, "aria-hidden": "true", children: i }),
|
|
46
|
-
/* @__PURE__ */ o.jsx(
|
|
47
|
-
"div",
|
|
48
|
-
{
|
|
49
|
-
role: "progressbar",
|
|
50
|
-
"aria-valuemin": 0,
|
|
51
|
-
"aria-valuemax": s,
|
|
52
|
-
"aria-valuenow": r ? void 0 : a ?? 0,
|
|
53
|
-
"aria-label": i,
|
|
54
|
-
className: t.track,
|
|
55
|
-
children: /* @__PURE__ */ o.jsx(
|
|
56
|
-
"div",
|
|
57
|
-
{
|
|
58
|
-
className: t.fill,
|
|
59
|
-
"data-indeterminate": r ? !0 : void 0,
|
|
60
|
-
style: r ? void 0 : { width: `${l}%` }
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
)
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
n.displayName = "VhyxProgress";
|
|
71
|
-
const B = { ...c, id: "vhyxui-progress" }, S = N(n, B);
|
|
72
|
-
S.displayName = "VhyxProgress";
|
|
73
|
-
export {
|
|
74
|
-
S as P
|
|
75
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("./jsx-runtime-BRMkMA8J.cjs"),n=require("react"),l=require("@vhyxui/core"),N=require("@vhyxseal/react"),R=require("./useId-D2AEOm2G.cjs"),C="_wrapper_ko60j_1",q="_label_ko60j_10",P="_track_ko60j_21",E="_fill_ko60j_52",t={wrapper:C,label:q,track:P,fill:E},d=n.forwardRef(({value:r,max:e=100,indeterminate:s=!1,size:u="md",variant:x="default",showLabel:g=!1,label:f,contract:h,className:j,id:m,...v},_)=>{const y=R.useId("vhyx-progress"),o=m??y,c=n.useMemo(()=>{if(r===void 0||s)return 0;const b=Math.max(0,Math.min(r,e));return Math.round(b/e*100)},[r,e,s]),i=f??`${c}%`,w={...l.progressContract,id:o,...h},k=[t.wrapper,j].filter(Boolean).join(" ");return a.jsxRuntimeExports.jsxs("div",{ref:_,id:o,className:k,"data-size":u,"data-variant":x,"data-vhyx-contract":JSON.stringify(w),...v,children:[g&&a.jsxRuntimeExports.jsx("span",{className:t.label,"aria-hidden":"true",children:i}),a.jsxRuntimeExports.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":e,"aria-valuenow":s?void 0:r??0,"aria-label":i,className:t.track,children:a.jsxRuntimeExports.jsx("div",{className:t.fill,"data-indeterminate":s?!0:void 0,style:s?void 0:{width:`${c}%`}})})]})});d.displayName="VhyxProgress";const I={...l.progressContract,id:"vhyxui-progress"},p=N.withAgentContract(d,I);p.displayName="VhyxProgress";exports.Progress=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const m=require("./jsx-runtime-BRMkMA8J.cjs"),e=require("react"),B=require("@vhyxui/core"),P=require("@vhyxseal/react"),W=require("./useId-D2AEOm2G.cjs"),H="_group_16juf_3",Q="_item_16juf_17",R={group:H,item:Q,"radio-indicator":"_radio-indicator_16juf_40","radio-dot":"_radio-dot_16juf_98","radio-label":"_radio-label_16juf_109"},M=e.createContext(null);function T(){const r=e.useContext(M);if(!r)throw new Error("[VhyxUI] <RadioItem> must be used within <RadioGroup>. Wrap your RadioItem components with <RadioGroup>.");return r}const O=e.forwardRef(({value:r,defaultValue:v,onValueChange:o,disabled:j=!1,orientation:c="vertical",size:n="md",contract:I,className:d,id:s,children:f,...p},h)=>{const w=W.useId("vhyx-radiogroup"),u=s??w,l=r!==void 0,[N,b]=e.useState(v),y=l?r:N,t=e.useRef(new Map),x=e.useRef([]),[E,C]=e.useState(void 0),q=e.useCallback((i,g)=>{g?(!t.current.has(i)&&(x.current.push(i),x.current.length===1&&C(i)),t.current.set(i,g)):(t.current.delete(i),x.current=x.current.filter(a=>a!==i),C(x.current[0]))},[]),A=e.useCallback((i,g)=>{const a=x.current,k=a.indexOf(i);if(k===-1)return;const L=g==="next"?(k+1)%a.length:(k-1+a.length)%a.length,_=a[L];if(_===void 0)return;const G=t.current.get(_);!G||G.disabled||(G.focus(),l||b(_),o==null||o(_))},[l,o]),S=e.useCallback(i=>{l||b(i),o==null||o(i)},[l,o]),z=e.useMemo(()=>({...B.radioContract,id:u,...I}),[u,I]),D=e.useMemo(()=>({value:y,onValueChange:S,disabled:j,size:n,groupId:u,registerItem:q,navigateItem:A,firstValue:E}),[y,S,j,n,u,q,A,E]),J=[R.group,d].filter(Boolean).join(" ");return m.jsxRuntimeExports.jsx(M.Provider,{value:D,children:m.jsxRuntimeExports.jsx("div",{ref:h,id:u,role:"radiogroup","aria-orientation":c,className:J,"data-orientation":c,"data-size":n,"data-vhyx-contract":JSON.stringify(z),...p,children:f})})});O.displayName="VhyxRadioGroup";const X={...B.radioContract,id:"vhyxui-radio-group"},F=P.withAgentContract(O,X);F.displayName="VhyxRadioGroup";const U=e.forwardRef(({value:r,disabled:v,children:o,className:j,onClick:c,onKeyDown:n,...I},d)=>{const s=T(),f=s.value===r,p=v??s.disabled,h=e.useRef(null),w=e.useCallback(t=>{h.current=t,typeof d=="function"?d(t):d&&(d.current=t)},[d]);e.useEffect(()=>(s.registerItem(r,h.current),()=>{s.registerItem(r,null)}),[s,r]);const u=e.useCallback(t=>{c==null||c(t),p||s.onValueChange(r)},[c,p,s,r]),l=e.useCallback(t=>{n==null||n(t),t.key==="ArrowDown"||t.key==="ArrowRight"?(t.preventDefault(),s.navigateItem(r,"next")):(t.key==="ArrowUp"||t.key==="ArrowLeft")&&(t.preventDefault(),s.navigateItem(r,"prev"))},[n,s,r]),N=!s.value&&s.firstValue===r,b=f||N?0:-1,y=[R.item,j].filter(Boolean).join(" ");return m.jsxRuntimeExports.jsxs("button",{ref:w,type:"button",role:"radio","aria-checked":f,disabled:p,tabIndex:b,onClick:u,onKeyDown:l,className:y,"data-state":f?"checked":"unchecked","data-size":s.size,"data-disabled":p?!0:void 0,...I,children:[m.jsxRuntimeExports.jsx("span",{className:R["radio-indicator"],children:f&&m.jsxRuntimeExports.jsx("span",{className:R["radio-dot"]})}),o&&m.jsxRuntimeExports.jsx("span",{className:R["radio-label"],children:o})]})});U.displayName="VhyxRadioItem";exports.RadioGroup=F;exports.RadioItem=U;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { j as m } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
-
import z, { useState as M, useRef as A, useCallback as x, useMemo as U, useContext as H, createContext as Q, useEffect as T } from "react";
|
|
3
|
-
import { radioContract as C } from "@vhyxui/core";
|
|
4
|
-
import { withAgentContract as X } from "@vhyxseal/react";
|
|
5
|
-
import { u as Y } from "./useId-BGRmH6iF.js";
|
|
6
|
-
const Z = "_group_16juf_3", $ = "_item_16juf_17", R = {
|
|
7
|
-
group: Z,
|
|
8
|
-
item: $,
|
|
9
|
-
"radio-indicator": "_radio-indicator_16juf_40",
|
|
10
|
-
"radio-dot": "_radio-dot_16juf_98",
|
|
11
|
-
"radio-label": "_radio-label_16juf_109"
|
|
12
|
-
}, D = Q(null);
|
|
13
|
-
function K() {
|
|
14
|
-
const r = H(D);
|
|
15
|
-
if (!r)
|
|
16
|
-
throw new Error(
|
|
17
|
-
"[VhyxUI] <RadioItem> must be used within <RadioGroup>. Wrap your RadioItem components with <RadioGroup>."
|
|
18
|
-
);
|
|
19
|
-
return r;
|
|
20
|
-
}
|
|
21
|
-
const J = z.forwardRef(
|
|
22
|
-
({
|
|
23
|
-
value: r,
|
|
24
|
-
defaultValue: v,
|
|
25
|
-
onValueChange: o,
|
|
26
|
-
disabled: h = !1,
|
|
27
|
-
orientation: a = "vertical",
|
|
28
|
-
size: i = "md",
|
|
29
|
-
contract: I,
|
|
30
|
-
className: c,
|
|
31
|
-
id: e,
|
|
32
|
-
children: f,
|
|
33
|
-
...l
|
|
34
|
-
}, y) => {
|
|
35
|
-
const w = Y("vhyx-radiogroup"), d = e ?? w, u = r !== void 0, [N, g] = M(v), j = u ? r : N, t = A(/* @__PURE__ */ new Map()), p = A([]), [E, S] = M(void 0), B = x(
|
|
36
|
-
(s, _) => {
|
|
37
|
-
_ ? (!t.current.has(s) && (p.current.push(s), p.current.length === 1 && S(s)), t.current.set(s, _)) : (t.current.delete(s), p.current = p.current.filter((n) => n !== s), S(p.current[0]));
|
|
38
|
-
},
|
|
39
|
-
[]
|
|
40
|
-
), O = x(
|
|
41
|
-
(s, _) => {
|
|
42
|
-
const n = p.current, G = n.indexOf(s);
|
|
43
|
-
if (G === -1) return;
|
|
44
|
-
const q = _ === "next" ? (G + 1) % n.length : (G - 1 + n.length) % n.length, b = n[q];
|
|
45
|
-
if (b === void 0) return;
|
|
46
|
-
const k = t.current.get(b);
|
|
47
|
-
!k || k.disabled || (k.focus(), u || g(b), o == null || o(b));
|
|
48
|
-
},
|
|
49
|
-
[u, o]
|
|
50
|
-
), F = x(
|
|
51
|
-
(s) => {
|
|
52
|
-
u || g(s), o == null || o(s);
|
|
53
|
-
},
|
|
54
|
-
[u, o]
|
|
55
|
-
), L = U(
|
|
56
|
-
() => ({ ...C, id: d, ...I }),
|
|
57
|
-
[d, I]
|
|
58
|
-
), P = U(
|
|
59
|
-
() => ({
|
|
60
|
-
value: j,
|
|
61
|
-
onValueChange: F,
|
|
62
|
-
disabled: h,
|
|
63
|
-
size: i,
|
|
64
|
-
groupId: d,
|
|
65
|
-
registerItem: B,
|
|
66
|
-
navigateItem: O,
|
|
67
|
-
firstValue: E
|
|
68
|
-
}),
|
|
69
|
-
[j, F, h, i, d, B, O, E]
|
|
70
|
-
), W = [R.group, c].filter(Boolean).join(" ");
|
|
71
|
-
return /* @__PURE__ */ m.jsx(D.Provider, { value: P, children: /* @__PURE__ */ m.jsx(
|
|
72
|
-
"div",
|
|
73
|
-
{
|
|
74
|
-
ref: y,
|
|
75
|
-
id: d,
|
|
76
|
-
role: "radiogroup",
|
|
77
|
-
"aria-orientation": a,
|
|
78
|
-
className: W,
|
|
79
|
-
"data-orientation": a,
|
|
80
|
-
"data-size": i,
|
|
81
|
-
"data-vhyx-contract": JSON.stringify(L),
|
|
82
|
-
...l,
|
|
83
|
-
children: f
|
|
84
|
-
}
|
|
85
|
-
) });
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
J.displayName = "VhyxRadioGroup";
|
|
89
|
-
const V = { ...C, id: "vhyxui-radio-group" }, tt = X(J, V);
|
|
90
|
-
tt.displayName = "VhyxRadioGroup";
|
|
91
|
-
const rt = z.forwardRef(
|
|
92
|
-
({ value: r, disabled: v, children: o, className: h, onClick: a, onKeyDown: i, ...I }, c) => {
|
|
93
|
-
const e = K(), f = e.value === r, l = v ?? e.disabled, y = A(null), w = x(
|
|
94
|
-
(t) => {
|
|
95
|
-
y.current = t, typeof c == "function" ? c(t) : c && (c.current = t);
|
|
96
|
-
},
|
|
97
|
-
[c]
|
|
98
|
-
);
|
|
99
|
-
T(() => (e.registerItem(r, y.current), () => {
|
|
100
|
-
e.registerItem(r, null);
|
|
101
|
-
}), [e, r]);
|
|
102
|
-
const d = x(
|
|
103
|
-
(t) => {
|
|
104
|
-
a == null || a(t), l || e.onValueChange(r);
|
|
105
|
-
},
|
|
106
|
-
[a, l, e, r]
|
|
107
|
-
), u = x(
|
|
108
|
-
(t) => {
|
|
109
|
-
i == null || i(t), t.key === "ArrowDown" || t.key === "ArrowRight" ? (t.preventDefault(), e.navigateItem(r, "next")) : (t.key === "ArrowUp" || t.key === "ArrowLeft") && (t.preventDefault(), e.navigateItem(r, "prev"));
|
|
110
|
-
},
|
|
111
|
-
[i, e, r]
|
|
112
|
-
), N = !e.value && e.firstValue === r, g = f || N ? 0 : -1, j = [R.item, h].filter(Boolean).join(" ");
|
|
113
|
-
return /* @__PURE__ */ m.jsxs(
|
|
114
|
-
"button",
|
|
115
|
-
{
|
|
116
|
-
ref: w,
|
|
117
|
-
type: "button",
|
|
118
|
-
role: "radio",
|
|
119
|
-
"aria-checked": f,
|
|
120
|
-
disabled: l,
|
|
121
|
-
tabIndex: g,
|
|
122
|
-
onClick: d,
|
|
123
|
-
onKeyDown: u,
|
|
124
|
-
className: j,
|
|
125
|
-
"data-state": f ? "checked" : "unchecked",
|
|
126
|
-
"data-size": e.size,
|
|
127
|
-
"data-disabled": l ? !0 : void 0,
|
|
128
|
-
...I,
|
|
129
|
-
children: [
|
|
130
|
-
/* @__PURE__ */ m.jsx("span", { className: R["radio-indicator"], children: f && /* @__PURE__ */ m.jsx("span", { className: R["radio-dot"] }) }),
|
|
131
|
-
o && /* @__PURE__ */ m.jsx("span", { className: R["radio-label"], children: o })
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
);
|
|
137
|
-
rt.displayName = "VhyxRadioItem";
|
|
138
|
-
export {
|
|
139
|
-
tt as R,
|
|
140
|
-
rt as a
|
|
141
|
-
};
|
package/dist/Select-BkJNe4Lc.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const f=require("./jsx-runtime-BRMkMA8J.cjs"),e=require("react"),ie=require("react-dom"),N=require("@vhyxui/core"),ce=require("@vhyxseal/react"),M=require("./useId-D2AEOm2G.cjs"),O=require("./floatingPosition-oslPPzF_.cjs"),ae="_trigger_1t193_3",le="_content_1t193_81",ue="_item_1t193_101",de="_group_1t193_152",fe="_label_1t193_158",pe="_separator_1t193_170",w={trigger:ae,"trigger-value":"_trigger-value_1t193_62","trigger-icon":"_trigger-icon_1t193_70",content:le,item:ue,"item-check":"_item-check_1t193_141",group:de,label:fe,separator:pe},J=e.createContext(null);function A(t){return t==null||typeof t=="boolean"?"":typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(A).join(""):e.isValidElement(t)?A(t.props.children):""}function D(t){const r=e.useContext(J);if(!r)throw new N.VhyxUIError({code:N.VhyxUIErrorCode.VHYXUI_MISSING_CONTEXT,message:`${t} must be used within <Select>`,suggestion:"Wrap your component tree with <Select>"});return r}const $=e.forwardRef(({value:t,defaultValue:r,onValueChange:u,disabled:x=!1,size:s="md",placeholder:d,contract:v,children:o,className:y,...i},b)=>{const S=M.useId("vhyx-select-trigger"),p=M.useId("vhyx-select-content"),h=M.useId("vhyx-select"),a=t!==void 0,[E,_]=e.useState(r),g=a?t:E,[n,C]=e.useState(!1),[k,R]=e.useState(void 0),V=e.useRef(null),H=e.useRef(null),L=e.useRef(new Map),B=e.useRef([]),q=e.useRef(new Map),[z,T]=e.useState(void 0),P=e.useRef(g);P.current=g,e.useEffect(()=>{if(g===void 0){T(void 0);return}const c=L.current.get(g);T(c?c.label:void 0)},[g]);const W=e.useCallback((c,l,m)=>{L.current.has(c)||B.current.push(c);const j={label:l};m!==void 0&&(j.disabled=m),L.current.set(c,j),c===P.current&&T(l)},[]),U=e.useCallback(()=>z,[z]),G=e.useCallback(c=>{var j;const l=B.current.filter(I=>{var Y;return!((Y=L.current.get(I))!=null&&Y.disabled)});if(l.length===0)return;let m;if(c==="home")m=l[0];else if(c==="end")m=l[l.length-1];else{const I=k!==void 0?l.indexOf(k):-1;m=c==="down"?l[Math.min(I+1,l.length-1)]:l[Math.max(I-1,0)]}m!==void 0&&(R(m),(j=q.current.get(m))==null||j.focus())},[k]),F=e.useCallback(c=>{var l;a||_(c),u==null||u(c),C(!1),R(void 0),(l=V.current)==null||l.focus()},[a,u]),X=e.useCallback(c=>{if(C(c),c){const l=g??B.current[0];R(l)}else R(void 0)},[g]),se=e.useMemo(()=>({...N.selectContract,id:h,...v}),[h,v]),oe=e.useMemo(()=>({value:g,onValueChange:F,open:n,onOpenChange:X,disabled:x,size:s,placeholder:d,triggerId:S,contentId:p,triggerRef:V,contentRef:H,focusedValue:k,setFocusedValue:R,registerItem:W,getSelectedLabel:U,navigateItems:G,itemElementsRef:q,itemOrderRef:B,itemRegistryRef:L}),[g,F,n,X,x,s,d,S,p,k,W,U,G]);return e.useEffect(()=>{if(!n)return;function c(l){var m;l.key==="Escape"&&(C(!1),R(void 0),(m=V.current)==null||m.focus())}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[n]),e.useEffect(()=>{if(!n)return;function c(l){var j,I;const m=l.target;(j=V.current)!=null&&j.contains(m)||(I=H.current)!=null&&I.contains(m)||(C(!1),R(void 0))}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]),f.jsxRuntimeExports.jsx(J.Provider,{value:oe,children:f.jsxRuntimeExports.jsx("div",{ref:b,className:y,"data-size":s,"data-disabled":x?!0:void 0,"data-vhyx-contract":JSON.stringify(se),...i,children:o})})});$.displayName="VhyxSelect";const K=e.forwardRef((t,r)=>{const{icon:u,className:x,asChild:s=!1,children:d,...v}=t,o=D("Select.Trigger"),y=o.getSelectedLabel(),i=e.useCallback(a=>{o.triggerRef.current=a,typeof r=="function"?r(a):r&&(r.current=a)},[r,o.triggerRef]),b=e.useCallback(()=>{o.disabled||o.onOpenChange(!o.open)},[o]),S=e.useCallback(a=>{(a.key==="ArrowDown"||a.key==="ArrowUp")&&(a.preventDefault(),o.open||o.onOpenChange(!0))},[o]),p=[w.trigger,x].filter(Boolean).join(" "),h={id:o.triggerId,role:"combobox","aria-haspopup":"listbox","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,disabled:o.disabled,onClick:b,onKeyDown:S,className:p,"data-size":o.size,"data-state":o.open?"open":"closed","data-placeholder":y?void 0:!0,...v};return s?f.jsxRuntimeExports.jsx(N.Slot,{ref:i,...h,children:d}):f.jsxRuntimeExports.jsxs("button",{ref:i,type:"button",...h,children:[f.jsxRuntimeExports.jsx("span",{className:w["trigger-value"],children:y??o.placeholder??"Select…"}),f.jsxRuntimeExports.jsx("span",{className:w["trigger-icon"],"aria-hidden":"true",children:u??f.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:f.jsxRuntimeExports.jsx("path",{d:"M2.5 4.5L6 8L9.5 4.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});K.displayName="VhyxSelectTrigger";function Q({children:t,className:r,style:u,...x}){const s=D("Select.Content"),[d,v]=e.useState(!1),[o,y]=e.useState({position:"fixed",top:0,left:0,minWidth:0,zIndex:"var(--vhyx-z-dropdown)"});e.useEffect(()=>{v(!0)},[]),e.useEffect(()=>{if(!s.open||!s.triggerRef.current)return;const p=()=>{var R;const a=s.triggerRef.current.getBoundingClientRect(),E=window.innerHeight-a.bottom,_=a.top,g=((R=s.contentRef.current)==null?void 0:R.scrollHeight)??300,n=E<g&&_>E,C=n?Math.min(g,_-8):Math.min(g,E-8),k=n?a.top-C-4:a.bottom+4;y({position:"fixed",top:O.clampToViewport(k,C,window.innerHeight),left:O.clampToViewport(a.left,a.width,window.innerWidth),minWidth:a.width,zIndex:"var(--vhyx-z-dropdown)",maxHeight:C,overflowY:"auto"})};p();const h=O.rafBatched(p);return window.addEventListener("scroll",h.run,!0),window.addEventListener("resize",h.run),()=>{h.cancel(),window.removeEventListener("scroll",h.run,!0),window.removeEventListener("resize",h.run)}},[s.open,s.triggerRef]),e.useEffect(()=>{var p;!s.open||!s.focusedValue||(p=s.itemElementsRef.current.get(s.focusedValue))==null||p.focus()},[s.open]);const i=e.useCallback(p=>{s.contentRef.current=p},[s.contentRef]);if(!d)return null;const b=[w.content,r].filter(Boolean).join(" "),S=f.jsxRuntimeExports.jsx("div",{ref:i,id:s.contentId,role:"listbox","aria-labelledby":s.triggerId,className:b,"data-state":s.open?"open":"closed",...x,style:{...u,...o},children:t});return ie.createPortal(S,document.body)}Q.displayName="VhyxSelectContent";const Z=e.forwardRef(({value:t,disabled:r,children:u,className:x,onClick:s,onKeyDown:d,onMouseEnter:v,...o},y)=>{const i=D("Select.Item"),b=i.value===t,S=i.focusedValue===t,p=A(u);e.useEffect(()=>{i.registerItem(t,p,r)},[i,t,p,r]);const h=e.useCallback(n=>{n?i.itemElementsRef.current.set(t,n):i.itemElementsRef.current.delete(t),typeof y=="function"?y(n):y&&(y.current=n)},[y,i,t]),a=e.useCallback(n=>{s==null||s(n),r||i.onValueChange(t)},[s,r,i,t]),E=e.useCallback(n=>{d==null||d(n),n.key==="Enter"||n.key===" "?(n.preventDefault(),r||i.onValueChange(t)):n.key==="ArrowDown"?(n.preventDefault(),i.navigateItems("down")):n.key==="ArrowUp"?(n.preventDefault(),i.navigateItems("up")):n.key==="Home"?(n.preventDefault(),i.navigateItems("home")):n.key==="End"&&(n.preventDefault(),i.navigateItems("end"))},[d,r,i,t]),_=e.useCallback(n=>{v==null||v(n),!r&&(i.setFocusedValue(t),n.currentTarget.focus())},[v,r,i,t]),g=[w.item,x].filter(Boolean).join(" ");return f.jsxRuntimeExports.jsxs("div",{ref:h,role:"option","aria-selected":b,"aria-disabled":r?!0:void 0,tabIndex:S?0:-1,onClick:a,onKeyDown:E,onMouseEnter:_,className:g,"data-state":b?"selected":"unselected","data-disabled":r?!0:void 0,"data-focused":S?!0:void 0,...o,children:[u,b&&f.jsxRuntimeExports.jsx("span",{className:w["item-check"],"aria-hidden":"true",children:f.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:f.jsxRuntimeExports.jsx("polyline",{points:"2,6 5,9 10,3"})})})]})});Z.displayName="VhyxSelectItem";function ee({children:t,className:r,...u}){const x=M.useId("vhyx-select-group-label"),s=[w.group,r].filter(Boolean).join(" ");return f.jsxRuntimeExports.jsx("div",{role:"group","aria-labelledby":x,className:s,...u,children:e.Children.map(t,d=>e.isValidElement(d)&&d.type.displayName==="VhyxSelectLabel"?e.cloneElement(d,{id:x}):d)})}ee.displayName="VhyxSelectGroup";function te({children:t,className:r,...u}){const x=[w.label,r].filter(Boolean).join(" ");return f.jsxRuntimeExports.jsx("span",{className:x,...u,children:t})}te.displayName="VhyxSelectLabel";function ne({className:t,...r}){const u=[w.separator,t].filter(Boolean).join(" ");return f.jsxRuntimeExports.jsx("hr",{"aria-hidden":"true",className:u,...r})}ne.displayName="VhyxSelectSeparator";const ge={...N.selectContract,id:"vhyxui-select"},re=Object.assign(ce.withAgentContract($,ge),{Trigger:K,Content:Q,Item:Z,Group:ee,Label:te,Separator:ne});re.displayName="VhyxSelect";exports.Select=re;
|
package/dist/Select-DfV10hZt.js
DELETED
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import { j as d } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
-
import N, { useState as B, useRef as E, useEffect as k, useCallback as x, useMemo as K, createContext as ue, useContext as de } from "react";
|
|
3
|
-
import fe from "react-dom";
|
|
4
|
-
import { selectContract as Z, Slot as pe, VhyxUIError as ge, VhyxUIErrorCode as me } from "@vhyxui/core";
|
|
5
|
-
import { withAgentContract as he } from "@vhyxseal/react";
|
|
6
|
-
import { u as D } from "./useId-BGRmH6iF.js";
|
|
7
|
-
import { c as Q, r as xe } from "./floatingPosition-UeYoO5K4.js";
|
|
8
|
-
const ye = "_trigger_1t193_3", ve = "_content_1t193_81", we = "_item_1t193_101", Se = "_group_1t193_152", be = "_label_1t193_158", Ce = "_separator_1t193_170", C = {
|
|
9
|
-
trigger: ye,
|
|
10
|
-
"trigger-value": "_trigger-value_1t193_62",
|
|
11
|
-
"trigger-icon": "_trigger-icon_1t193_70",
|
|
12
|
-
content: ve,
|
|
13
|
-
item: we,
|
|
14
|
-
"item-check": "_item-check_1t193_141",
|
|
15
|
-
group: Se,
|
|
16
|
-
label: be,
|
|
17
|
-
separator: Ce
|
|
18
|
-
}, ee = ue(null);
|
|
19
|
-
function H(e) {
|
|
20
|
-
return e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(H).join("") : N.isValidElement(e) ? H(e.props.children) : "";
|
|
21
|
-
}
|
|
22
|
-
function z(e) {
|
|
23
|
-
const n = de(ee);
|
|
24
|
-
if (!n)
|
|
25
|
-
throw new ge({
|
|
26
|
-
code: me.VHYXUI_MISSING_CONTEXT,
|
|
27
|
-
message: `${e} must be used within <Select>`,
|
|
28
|
-
suggestion: "Wrap your component tree with <Select>"
|
|
29
|
-
});
|
|
30
|
-
return n;
|
|
31
|
-
}
|
|
32
|
-
const te = N.forwardRef(
|
|
33
|
-
({
|
|
34
|
-
value: e,
|
|
35
|
-
defaultValue: n,
|
|
36
|
-
onValueChange: l,
|
|
37
|
-
disabled: m = !1,
|
|
38
|
-
size: r = "md",
|
|
39
|
-
placeholder: u,
|
|
40
|
-
contract: v,
|
|
41
|
-
children: o,
|
|
42
|
-
className: y,
|
|
43
|
-
...s
|
|
44
|
-
}, S) => {
|
|
45
|
-
const b = D("vhyx-select-trigger"), f = D("vhyx-select-content"), h = D("vhyx-select"), c = e !== void 0, [_, V] = B(n), p = c ? e : _, [t, R] = B(!1), [j, w] = B(void 0), T = E(null), W = E(null), O = E(/* @__PURE__ */ new Map()), A = E([]), P = E(/* @__PURE__ */ new Map()), [U, M] = B(void 0), G = E(p);
|
|
46
|
-
G.current = p, k(() => {
|
|
47
|
-
if (p === void 0) {
|
|
48
|
-
M(void 0);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const i = O.current.get(p);
|
|
52
|
-
M(i ? i.label : void 0);
|
|
53
|
-
}, [p]);
|
|
54
|
-
const F = x(
|
|
55
|
-
(i, a, g) => {
|
|
56
|
-
O.current.has(i) || A.current.push(i);
|
|
57
|
-
const I = { label: a };
|
|
58
|
-
g !== void 0 && (I.disabled = g), O.current.set(i, I), i === G.current && M(a);
|
|
59
|
-
},
|
|
60
|
-
[]
|
|
61
|
-
), X = x(() => U, [U]), Y = x(
|
|
62
|
-
(i) => {
|
|
63
|
-
var I;
|
|
64
|
-
const a = A.current.filter(
|
|
65
|
-
(L) => {
|
|
66
|
-
var q;
|
|
67
|
-
return !((q = O.current.get(L)) != null && q.disabled);
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
if (a.length === 0) return;
|
|
71
|
-
let g;
|
|
72
|
-
if (i === "home")
|
|
73
|
-
g = a[0];
|
|
74
|
-
else if (i === "end")
|
|
75
|
-
g = a[a.length - 1];
|
|
76
|
-
else {
|
|
77
|
-
const L = j !== void 0 ? a.indexOf(j) : -1;
|
|
78
|
-
g = i === "down" ? a[Math.min(L + 1, a.length - 1)] : a[Math.max(L - 1, 0)];
|
|
79
|
-
}
|
|
80
|
-
g !== void 0 && (w(g), (I = P.current.get(g)) == null || I.focus());
|
|
81
|
-
},
|
|
82
|
-
[j]
|
|
83
|
-
), J = x(
|
|
84
|
-
(i) => {
|
|
85
|
-
var a;
|
|
86
|
-
c || V(i), l == null || l(i), R(!1), w(void 0), (a = T.current) == null || a.focus();
|
|
87
|
-
},
|
|
88
|
-
[c, l]
|
|
89
|
-
), $ = x(
|
|
90
|
-
(i) => {
|
|
91
|
-
if (R(i), i) {
|
|
92
|
-
const a = p ?? A.current[0];
|
|
93
|
-
w(a);
|
|
94
|
-
} else
|
|
95
|
-
w(void 0);
|
|
96
|
-
},
|
|
97
|
-
[p]
|
|
98
|
-
), ae = K(
|
|
99
|
-
() => ({ ...Z, id: h, ...v }),
|
|
100
|
-
[h, v]
|
|
101
|
-
), le = K(
|
|
102
|
-
() => ({
|
|
103
|
-
value: p,
|
|
104
|
-
onValueChange: J,
|
|
105
|
-
open: t,
|
|
106
|
-
onOpenChange: $,
|
|
107
|
-
disabled: m,
|
|
108
|
-
size: r,
|
|
109
|
-
placeholder: u,
|
|
110
|
-
triggerId: b,
|
|
111
|
-
contentId: f,
|
|
112
|
-
triggerRef: T,
|
|
113
|
-
contentRef: W,
|
|
114
|
-
focusedValue: j,
|
|
115
|
-
setFocusedValue: w,
|
|
116
|
-
registerItem: F,
|
|
117
|
-
getSelectedLabel: X,
|
|
118
|
-
navigateItems: Y,
|
|
119
|
-
itemElementsRef: P,
|
|
120
|
-
itemOrderRef: A,
|
|
121
|
-
itemRegistryRef: O
|
|
122
|
-
}),
|
|
123
|
-
[
|
|
124
|
-
p,
|
|
125
|
-
J,
|
|
126
|
-
t,
|
|
127
|
-
$,
|
|
128
|
-
m,
|
|
129
|
-
r,
|
|
130
|
-
u,
|
|
131
|
-
b,
|
|
132
|
-
f,
|
|
133
|
-
j,
|
|
134
|
-
F,
|
|
135
|
-
X,
|
|
136
|
-
Y
|
|
137
|
-
]
|
|
138
|
-
);
|
|
139
|
-
return k(() => {
|
|
140
|
-
if (!t) return;
|
|
141
|
-
function i(a) {
|
|
142
|
-
var g;
|
|
143
|
-
a.key === "Escape" && (R(!1), w(void 0), (g = T.current) == null || g.focus());
|
|
144
|
-
}
|
|
145
|
-
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
146
|
-
}, [t]), k(() => {
|
|
147
|
-
if (!t) return;
|
|
148
|
-
function i(a) {
|
|
149
|
-
var I, L;
|
|
150
|
-
const g = a.target;
|
|
151
|
-
(I = T.current) != null && I.contains(g) || (L = W.current) != null && L.contains(g) || (R(!1), w(void 0));
|
|
152
|
-
}
|
|
153
|
-
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
154
|
-
}, [t]), /* @__PURE__ */ d.jsx(ee.Provider, { value: le, children: /* @__PURE__ */ d.jsx(
|
|
155
|
-
"div",
|
|
156
|
-
{
|
|
157
|
-
ref: S,
|
|
158
|
-
className: y,
|
|
159
|
-
"data-size": r,
|
|
160
|
-
"data-disabled": m ? !0 : void 0,
|
|
161
|
-
"data-vhyx-contract": JSON.stringify(ae),
|
|
162
|
-
...s,
|
|
163
|
-
children: o
|
|
164
|
-
}
|
|
165
|
-
) });
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
te.displayName = "VhyxSelect";
|
|
169
|
-
const ne = N.forwardRef((e, n) => {
|
|
170
|
-
const { icon: l, className: m, asChild: r = !1, children: u, ...v } = e, o = z("Select.Trigger"), y = o.getSelectedLabel(), s = x(
|
|
171
|
-
(c) => {
|
|
172
|
-
o.triggerRef.current = c, typeof n == "function" ? n(c) : n && (n.current = c);
|
|
173
|
-
},
|
|
174
|
-
[n, o.triggerRef]
|
|
175
|
-
), S = x(() => {
|
|
176
|
-
o.disabled || o.onOpenChange(!o.open);
|
|
177
|
-
}, [o]), b = x(
|
|
178
|
-
(c) => {
|
|
179
|
-
(c.key === "ArrowDown" || c.key === "ArrowUp") && (c.preventDefault(), o.open || o.onOpenChange(!0));
|
|
180
|
-
},
|
|
181
|
-
[o]
|
|
182
|
-
), f = [C.trigger, m].filter(Boolean).join(" "), h = {
|
|
183
|
-
id: o.triggerId,
|
|
184
|
-
role: "combobox",
|
|
185
|
-
"aria-haspopup": "listbox",
|
|
186
|
-
"aria-expanded": o.open,
|
|
187
|
-
"aria-controls": o.open ? o.contentId : void 0,
|
|
188
|
-
disabled: o.disabled,
|
|
189
|
-
onClick: S,
|
|
190
|
-
onKeyDown: b,
|
|
191
|
-
className: f,
|
|
192
|
-
"data-size": o.size,
|
|
193
|
-
"data-state": o.open ? "open" : "closed",
|
|
194
|
-
"data-placeholder": y ? void 0 : !0,
|
|
195
|
-
...v
|
|
196
|
-
};
|
|
197
|
-
return r ? /* @__PURE__ */ d.jsx(pe, { ref: s, ...h, children: u }) : /* @__PURE__ */ d.jsxs("button", { ref: s, type: "button", ...h, children: [
|
|
198
|
-
/* @__PURE__ */ d.jsx("span", { className: C["trigger-value"], children: y ?? o.placeholder ?? "Select…" }),
|
|
199
|
-
/* @__PURE__ */ d.jsx("span", { className: C["trigger-icon"], "aria-hidden": "true", children: l ?? /* @__PURE__ */ d.jsx("svg", { viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ d.jsx("path", { d: "M2.5 4.5L6 8L9.5 4.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
200
|
-
] });
|
|
201
|
-
});
|
|
202
|
-
ne.displayName = "VhyxSelectTrigger";
|
|
203
|
-
function re({ children: e, className: n, style: l, ...m }) {
|
|
204
|
-
const r = z("Select.Content"), [u, v] = B(!1), [o, y] = B({
|
|
205
|
-
position: "fixed",
|
|
206
|
-
top: 0,
|
|
207
|
-
left: 0,
|
|
208
|
-
minWidth: 0,
|
|
209
|
-
zIndex: "var(--vhyx-z-dropdown)"
|
|
210
|
-
});
|
|
211
|
-
k(() => {
|
|
212
|
-
v(!0);
|
|
213
|
-
}, []), k(() => {
|
|
214
|
-
if (!r.open || !r.triggerRef.current) return;
|
|
215
|
-
const f = () => {
|
|
216
|
-
var w;
|
|
217
|
-
const c = r.triggerRef.current.getBoundingClientRect(), _ = window.innerHeight - c.bottom, V = c.top, p = ((w = r.contentRef.current) == null ? void 0 : w.scrollHeight) ?? 300, t = _ < p && V > _, R = t ? Math.min(p, V - 8) : Math.min(p, _ - 8), j = t ? c.top - R - 4 : c.bottom + 4;
|
|
218
|
-
y({
|
|
219
|
-
position: "fixed",
|
|
220
|
-
top: Q(j, R, window.innerHeight),
|
|
221
|
-
left: Q(c.left, c.width, window.innerWidth),
|
|
222
|
-
minWidth: c.width,
|
|
223
|
-
zIndex: "var(--vhyx-z-dropdown)",
|
|
224
|
-
maxHeight: R,
|
|
225
|
-
overflowY: "auto"
|
|
226
|
-
});
|
|
227
|
-
};
|
|
228
|
-
f();
|
|
229
|
-
const h = xe(f);
|
|
230
|
-
return window.addEventListener("scroll", h.run, !0), window.addEventListener("resize", h.run), () => {
|
|
231
|
-
h.cancel(), window.removeEventListener("scroll", h.run, !0), window.removeEventListener("resize", h.run);
|
|
232
|
-
};
|
|
233
|
-
}, [r.open, r.triggerRef]), k(() => {
|
|
234
|
-
var f;
|
|
235
|
-
!r.open || !r.focusedValue || (f = r.itemElementsRef.current.get(r.focusedValue)) == null || f.focus();
|
|
236
|
-
}, [r.open]);
|
|
237
|
-
const s = x(
|
|
238
|
-
(f) => {
|
|
239
|
-
r.contentRef.current = f;
|
|
240
|
-
},
|
|
241
|
-
[r.contentRef]
|
|
242
|
-
);
|
|
243
|
-
if (!u) return null;
|
|
244
|
-
const S = [C.content, n].filter(Boolean).join(" "), b = /* @__PURE__ */ d.jsx(
|
|
245
|
-
"div",
|
|
246
|
-
{
|
|
247
|
-
ref: s,
|
|
248
|
-
id: r.contentId,
|
|
249
|
-
role: "listbox",
|
|
250
|
-
"aria-labelledby": r.triggerId,
|
|
251
|
-
className: S,
|
|
252
|
-
"data-state": r.open ? "open" : "closed",
|
|
253
|
-
...m,
|
|
254
|
-
style: {
|
|
255
|
-
// Consumer's cosmetic style first — internal positioning/sizing keys
|
|
256
|
-
// (position/top/left/minWidth/zIndex/maxHeight/overflowY) are spread
|
|
257
|
-
// explicitly afterward so they always win, instead of letting a
|
|
258
|
-
// whole `style` object from a blind `{...rest}` spread replace this
|
|
259
|
-
// element's positioning outright.
|
|
260
|
-
...l,
|
|
261
|
-
...o
|
|
262
|
-
},
|
|
263
|
-
children: e
|
|
264
|
-
}
|
|
265
|
-
);
|
|
266
|
-
return fe.createPortal(b, document.body);
|
|
267
|
-
}
|
|
268
|
-
re.displayName = "VhyxSelectContent";
|
|
269
|
-
const oe = N.forwardRef(
|
|
270
|
-
({ value: e, disabled: n, children: l, className: m, onClick: r, onKeyDown: u, onMouseEnter: v, ...o }, y) => {
|
|
271
|
-
const s = z("Select.Item"), S = s.value === e, b = s.focusedValue === e, f = H(l);
|
|
272
|
-
k(() => {
|
|
273
|
-
s.registerItem(e, f, n);
|
|
274
|
-
}, [s, e, f, n]);
|
|
275
|
-
const h = x(
|
|
276
|
-
(t) => {
|
|
277
|
-
t ? s.itemElementsRef.current.set(e, t) : s.itemElementsRef.current.delete(e), typeof y == "function" ? y(t) : y && (y.current = t);
|
|
278
|
-
},
|
|
279
|
-
[y, s, e]
|
|
280
|
-
), c = x(
|
|
281
|
-
(t) => {
|
|
282
|
-
r == null || r(t), n || s.onValueChange(e);
|
|
283
|
-
},
|
|
284
|
-
[r, n, s, e]
|
|
285
|
-
), _ = x(
|
|
286
|
-
(t) => {
|
|
287
|
-
u == null || u(t), t.key === "Enter" || t.key === " " ? (t.preventDefault(), n || s.onValueChange(e)) : t.key === "ArrowDown" ? (t.preventDefault(), s.navigateItems("down")) : t.key === "ArrowUp" ? (t.preventDefault(), s.navigateItems("up")) : t.key === "Home" ? (t.preventDefault(), s.navigateItems("home")) : t.key === "End" && (t.preventDefault(), s.navigateItems("end"));
|
|
288
|
-
},
|
|
289
|
-
[u, n, s, e]
|
|
290
|
-
), V = x(
|
|
291
|
-
(t) => {
|
|
292
|
-
v == null || v(t), !n && (s.setFocusedValue(e), t.currentTarget.focus());
|
|
293
|
-
},
|
|
294
|
-
[v, n, s, e]
|
|
295
|
-
), p = [C.item, m].filter(Boolean).join(" ");
|
|
296
|
-
return /* @__PURE__ */ d.jsxs(
|
|
297
|
-
"div",
|
|
298
|
-
{
|
|
299
|
-
ref: h,
|
|
300
|
-
role: "option",
|
|
301
|
-
"aria-selected": S,
|
|
302
|
-
"aria-disabled": n ? !0 : void 0,
|
|
303
|
-
tabIndex: b ? 0 : -1,
|
|
304
|
-
onClick: c,
|
|
305
|
-
onKeyDown: _,
|
|
306
|
-
onMouseEnter: V,
|
|
307
|
-
className: p,
|
|
308
|
-
"data-state": S ? "selected" : "unselected",
|
|
309
|
-
"data-disabled": n ? !0 : void 0,
|
|
310
|
-
"data-focused": b ? !0 : void 0,
|
|
311
|
-
...o,
|
|
312
|
-
children: [
|
|
313
|
-
l,
|
|
314
|
-
S && /* @__PURE__ */ d.jsx("span", { className: C["item-check"], "aria-hidden": "true", children: /* @__PURE__ */ d.jsx("svg", { viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", children: /* @__PURE__ */ d.jsx("polyline", { points: "2,6 5,9 10,3" }) }) })
|
|
315
|
-
]
|
|
316
|
-
}
|
|
317
|
-
);
|
|
318
|
-
}
|
|
319
|
-
);
|
|
320
|
-
oe.displayName = "VhyxSelectItem";
|
|
321
|
-
function se({ children: e, className: n, ...l }) {
|
|
322
|
-
const m = D("vhyx-select-group-label"), r = [C.group, n].filter(Boolean).join(" ");
|
|
323
|
-
return /* @__PURE__ */ d.jsx("div", { role: "group", "aria-labelledby": m, className: r, ...l, children: N.Children.map(e, (u) => N.isValidElement(u) && u.type.displayName === "VhyxSelectLabel" ? N.cloneElement(u, { id: m }) : u) });
|
|
324
|
-
}
|
|
325
|
-
se.displayName = "VhyxSelectGroup";
|
|
326
|
-
function ie({ children: e, className: n, ...l }) {
|
|
327
|
-
const m = [C.label, n].filter(Boolean).join(" ");
|
|
328
|
-
return /* @__PURE__ */ d.jsx("span", { className: m, ...l, children: e });
|
|
329
|
-
}
|
|
330
|
-
ie.displayName = "VhyxSelectLabel";
|
|
331
|
-
function ce({ className: e, ...n }) {
|
|
332
|
-
const l = [C.separator, e].filter(Boolean).join(" ");
|
|
333
|
-
return /* @__PURE__ */ d.jsx("hr", { "aria-hidden": "true", className: l, ...n });
|
|
334
|
-
}
|
|
335
|
-
ce.displayName = "VhyxSelectSeparator";
|
|
336
|
-
const Re = { ...Z, id: "vhyxui-select" }, Ie = Object.assign(
|
|
337
|
-
he(te, Re),
|
|
338
|
-
{
|
|
339
|
-
Trigger: ne,
|
|
340
|
-
Content: re,
|
|
341
|
-
Item: oe,
|
|
342
|
-
Group: se,
|
|
343
|
-
Label: ie,
|
|
344
|
-
Separator: ce
|
|
345
|
-
}
|
|
346
|
-
);
|
|
347
|
-
Ie.displayName = "VhyxSelect";
|
|
348
|
-
export {
|
|
349
|
-
Ie as S
|
|
350
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
-
import { F as f } from "./Field-Bv07PL2M.js";
|
|
3
|
-
import { S as r } from "./Select-DfV10hZt.js";
|
|
4
|
-
function h({
|
|
5
|
-
name: s,
|
|
6
|
-
label: i,
|
|
7
|
-
hint: t,
|
|
8
|
-
error: a,
|
|
9
|
-
required: n,
|
|
10
|
-
optional: m,
|
|
11
|
-
layout: o,
|
|
12
|
-
options: d,
|
|
13
|
-
placeholder: x,
|
|
14
|
-
value: c,
|
|
15
|
-
onValueChange: j,
|
|
16
|
-
disabled: p,
|
|
17
|
-
size: u
|
|
18
|
-
}) {
|
|
19
|
-
return /* @__PURE__ */ e.jsx(
|
|
20
|
-
f,
|
|
21
|
-
{
|
|
22
|
-
name: s,
|
|
23
|
-
label: i,
|
|
24
|
-
hint: t,
|
|
25
|
-
error: a,
|
|
26
|
-
required: n,
|
|
27
|
-
optional: m,
|
|
28
|
-
layout: o,
|
|
29
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
30
|
-
r,
|
|
31
|
-
{
|
|
32
|
-
value: c,
|
|
33
|
-
onValueChange: j,
|
|
34
|
-
disabled: p,
|
|
35
|
-
size: u,
|
|
36
|
-
placeholder: x,
|
|
37
|
-
children: [
|
|
38
|
-
/* @__PURE__ */ e.jsx(r.Trigger, { "aria-label": typeof i == "string" ? i : void 0 }),
|
|
39
|
-
/* @__PURE__ */ e.jsx(r.Content, { children: d.map((l) => /* @__PURE__ */ e.jsx(r.Item, { value: l.value, children: l.label }, l.value)) })
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
h.displayName = "VhyxSelectField";
|
|
47
|
-
export {
|
|
48
|
-
h as S
|
|
49
|
-
};
|