import{d as u,j as l,o as t,i as b,n as m,C as o,t as p,p as s,bv as f,bw as V}from"./index-BX34W763.js";const k=["aria-checked","aria-disabled"],y={key:0,class:"sr-only"},w=u({__name:"ScalarToggle",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(n,{emit:d}){const a=n,r=d;function c(){a.disabled||r("update:modelValue",!a.modelValue)}const i=V({base:"relative h-3.5 min-w-6 w-6 cursor-pointer rounded-full bg-b-3 transition-colors duration-300",variants:{checked:{true:"bg-c-accent"},disabled:{true:"cursor-not-allowed opacity-40"}}});return(e,g)=>(t(),l("button",{"aria-checked":e.modelValue,"aria-disabled":e.disabled,class:o(s(f)(s(i)({checked:e.modelValue,disabled:e.disabled}))),role:"switch",type:"button",onClick:c},[b("div",{class:o(["absolute left-px top-px flex h-3 w-3 items-center justify-center rounded-full bg-b-1 text-c-accent transition-transform duration-300",{"translate-x-2.5":e.modelValue}])},null,2),e.label?(t(),l("span",y,p(e.label),1)):m("",!0)],10,k))}});export{w};
