import{b1 as u,b2 as b}from"./navigation-BzNQiq4W.js";import{d as m,i as l,o as t,h as p,k as f,y as o,t as k,l as s}from"./index-DPl1iiyq.js";const V=["aria-checked","aria-disabled"],y={key:0,class:"sr-only"},w=m({__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=b({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,h)=>(t(),l("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},[p("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,k(e.label),1)):f("",!0)],10,V))}});export{w};
