import{jsxs as h,jsx as e}from"react/jsx-runtime";import g from"./text.js";import{useToggleState as v}from"../../hooks/useToggleState.js";import{cn as r}from"../../lib/cn.js";import{forwardRef as k,useRef as N}from"react";import{useToggleButton as x,useFocusRing as S,mergeProps as w}from"react-aria";const s=k((o,l)=>{const{checked:n,disabled:a=!1,label:i,className:d,...u}=o,c=N(null),m=l||c,t=v({...o,isSelected:n}),{buttonProps:b}=x({...u,isDisabled:a},t,m),{isFocusVisible:f,focusProps:p}=S();return h("div",{className:"flex items-center",children:[i&&e("div",{className:"mr-2",children:e(g,{fontWeight:"medium",styles:{lineHeight:1},children:i})}),e("button",{...w(b,p),className:r("px-0.5 h-5 w-11 disabled:opacity-30 disabled:pointer-events-none transition-colors duration-200 ease-in-out rounded-full cursor-pointer outline outline-offset-[0.125rem]",t.isSelected?"bg-brand-base hover:bg-brand-base":"bg-neutral-primary hover:bg-ink-70 dark:hover:bg-slate-4",f?"outline-brand-base outline-thick":"outline-transparent outline-thick",d),children:e("span",{className:r("block rounded-full h-4 w-4 bg-paper relative transition-[left] duration-200 ease-in-out",t.isSelected?"left-6":"left-0")})})]})});s.displayName="Switch";export{s as default};
//# sourceMappingURL=switch.js.map
