import{av as u,aw as m}from"./ReferenceContentLoader-jQeEHBuo.js";import{d as p,c as t,o as l,b,a as f,p as o,t as V,u as s}from"./index-D86EVCbM.js";const k=["aria-checked","aria-disabled"],h={key:0,class:"sr-only"},x=p({__name:"ScalarToggle",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(r,{emit:d}){const a=r,n=d;function i(){a.disabled||n("update:modelValue",!a.modelValue)}const c=m({base:"relative h-3.5 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,y)=>(l(),t("button",{"aria-checked":e.modelValue,"aria-disabled":e.disabled,class:o(s(u)(s(c)({checked:e.modelValue,disabled:e.disabled}))),role:"switch",type:"button",onClick:i},[b("div",{class:o(["absolute left-px top-px flex h-3 w-3 items-center justify-center rounded-full bg-white text-c-accent transition-transform duration-300",{"translate-x-2.5":e.modelValue}])},null,2),e.label?(l(),t("span",h,V(e.label),1)):f("",!0)],10,k))}});export{x as w};
