import{C as l,l as r,n as b,z as m,u as o,x as f,M as s,p as i,K as n,t as k,X as h,a2 as y}from"./Button-1eZ2gOMK.js";import{C as v}from"./check-D2Bblidk.js";const g=["aria-checked","aria-label","onKeydown"],p={key:0,class:"select-none"},V={__name:"Checkbox",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""},disabled:{type:Boolean,default:!1},class:{type:[String,Object,Array],default:""}},emits:["update:modelValue"],setup(e,{emit:c}){const a=e,d=c;function t(){a.disabled||d("update:modelValue",!a.modelValue)}return(u,x)=>(l(),r("label",{class:n(["flex w-full cursor-pointer items-center gap-3 text-sm text-zinc-700 dark:text-zinc-300 transition-colors",e.disabled&&"cursor-not-allowed opacity-60",o(y)(a.class)]),onClick:t},[b("span",{role:"checkbox","aria-checked":e.modelValue,"aria-label":e.label||(e.modelValue?"Marcado":"Desmarcado"),class:n(["relative flex h-5 w-5 shrink-0 items-center justify-center rounded-md border-2 transition-all duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-primary)] focus-visible:ring-offset-2 dark:focus-visible:ring-offset-zinc-900",e.modelValue?"border-[var(--color-primary)] bg-[var(--color-primary)] text-white":"border-zinc-300 bg-white hover:border-zinc-400 dark:border-zinc-600 dark:bg-zinc-800 dark:hover:border-zinc-500",e.disabled&&"pointer-events-none"]),tabindex:"0",onKeydown:[s(i(t,["prevent"]),["enter"]),s(i(t,["prevent"]),["space"])]},[e.modelValue?(l(),m(o(v),{key:0,class:"h-3 w-3 stroke-[2.5]"})):f("",!0)],42,g),e.label?(l(),r("span",p,k(e.label),1)):h(u.$slots,"default",{key:1})],2))}};export{V as _};
