import{c,a as u}from"./ReferenceContentLoader-34zh6S1n.js";import{d as b,h as m,i as p,c as t,o as s,a as f,j as k,k as o,t as v,u as r}from"./index-CDPBytck.js";const y=["aria-checked","aria-disabled"],g={key:0,class:"sr-only"},B=b({__name:"ScalarToggle",props:m({disabled:{type:Boolean},label:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const d=l,e=p(l,"modelValue");function n(){d.disabled||(e.value=!e.value)}const i=u({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(a,h)=>(s(),t("button",{"aria-checked":e.value,"aria-disabled":a.disabled,class:o(r(c)(r(i)({checked:e.value,disabled:a.disabled}))),role:"switch",type:"button",onClick:n},[f("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.value}])},null,2),a.label?(s(),t("span",g,v(a.label),1)):k("",!0)],10,y))}});export{B as x};
