import{C as n,l as o,n as i,K as a,t as d,x as c}from"./Button-C102TjBP.js";const u=["disabled","aria-checked","aria-label"],g={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""},name:{type:String,default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:r}){const l=e,s=r;function t(){l.disabled||s("update:modelValue",!l.modelValue)}return(m,f)=>(n(),o("div",{class:a(["flex items-center gap-3",{"cursor-not-allowed opacity-60":e.disabled}])},[i("button",{type:"button",role:"switch",disabled:e.disabled,"aria-checked":e.modelValue,"aria-label":e.label||(e.modelValue?"Ativo":"Inativo"),class:a(["relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:ring-offset-2 dark:focus:ring-offset-zinc-900",e.modelValue?"bg-[var(--color-primary)]":"bg-zinc-200 dark:bg-zinc-600"]),onClick:t},[i("span",{class:a(["pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition",e.modelValue?"translate-x-5":"translate-x-0.5"])},null,2)],10,u),e.label?(n(),o("label",{key:0,class:"text-sm font-medium text-zinc-700 dark:text-zinc-300",onClick:t},d(e.label),1)):c("",!0)],2))}};export{g as _};
