"use strict";var e=require("react/jsx-runtime"),g=require("./text.js"),x=require("../../lib/cn.js"),r=require("react"),l=require("react-aria");const b=r.createContext({selectedValue:void 0,setSelectedValue:()=>{}}),h=o=>{const{children:d,onChange:i,selectedValue:s,vertical:a}=o,n=r.useCallback(u=>{i(u)},[i]);return e.jsx("div",{className:x.cn("flex",a?"flex-col gap-5":"flex-row gap-10"),role:"radiogroup",children:e.jsx(b.Provider,{value:{selectedValue:s,setSelectedValue:n},children:d})})},f=r.forwardRef((o,d)=>{const{label:i,value:s}=o,a=r.useContext(b),n=r.useRef(null),u=d||n,p=r.useCallback(()=>{a.setSelectedValue(s)},[a,s]),{hoverProps:v}=l.useHover({}),{focusProps:m,isFocusVisible:c}=l.useFocusRing(),{pressProps:j}=l.usePress({onPress:p}),t=a.selectedValue===s,R=t?0:-1;return e.jsxs("label",{className:"flex items-center",children:[e.jsx(l.VisuallyHidden,{children:e.jsx("input",{...l.mergeProps(j,m,v),ref:u,type:"radio",checked:t,tabIndex:R,readOnly:!0})}),e.jsx("div",{className:x.cn("flex justify-center items-center border-thick transition-colors duration-200 ease-in-out cursor-pointer w-6 h-6 rounded-full hover:border-brand-base",c||t?"border-brand-base":"border-text-tertiary",c?"outline outline-thick outline-brand-base outline-offset-[0.125rem]":"outline-none"),"aria-hidden":"true",children:t&&e.jsx("div",{className:"rounded-full w-3 h-3 bg-brand-base"})}),e.jsx("div",{className:"ml-3",children:e.jsx(g.default,{size:"lg",fontWeight:"medium",children:i})})]})});h.displayName="RadioGroup",f.displayName="Radio",exports.Radio=f,exports.RadioGroup=h;
//# sourceMappingURL=radio.js.map
