"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),v=require("./text.js"),x=require("../../hooks/useToggleState.js"),a=require("../../lib/cn.js"),l=require("react"),t=require("react-aria");const n=l.forwardRef((s,o)=>{const{checked:u,disabled:c=!1,label:i,className:d,...b}=s,f=l.useRef(null),g=o||f,r=x.useToggleState({...s,isSelected:u}),{buttonProps:h}=t.useToggleButton({...b,isDisabled:c},r,g),{isFocusVisible:m,focusProps:p}=t.useFocusRing();return e.jsxs("div",{className:"flex items-center",children:[i&&e.jsx("div",{className:"mr-2",children:e.jsx(v.default,{fontWeight:"medium",styles:{lineHeight:1},children:i})}),e.jsx("button",{...t.mergeProps(h,p),className:a.cn("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]",r.isSelected?"bg-brand-base hover:bg-brand-base":"bg-neutral-primary hover:bg-ink-70 dark:hover:bg-slate-4",m?"outline-brand-base outline-thick":"outline-transparent outline-thick",d),children:e.jsx("span",{className:a.cn("block rounded-full h-4 w-4 bg-paper relative transition-[left] duration-200 ease-in-out",r.isSelected?"left-6":"left-0")})})]})});n.displayName="Switch",exports.default=n;
//# sourceMappingURL=switch.js.map
