import{i as n,r as u,j as r}from"./vendor/react-core.DXghOv-E.min.js";import{D as m,M as i,aJ as p}from"../assets/layouts-e9o3BY4c.js";const A=m(()=>{const s=n({...i.margin({all:0}),cursor:"pointer",lineHeight:0},"label:ActsAsCheckbox-styles-label"),e=n({...i.absolute.srOnly()},"label:ActsAsCheckbox-styles-checkbox");return{label:s,checkbox:e}}),k=({checked:s=!1,onChange:e,title:a,children:b,disabled:h})=>{const l=A(),[t,c]=u.useState(!!h);async function x(){c(!0),await Promise.resolve(e()),c(!1)}const o=p();return r.jsxs("label",{htmlFor:o,className:l.label,title:a,children:[r.jsx("input",{id:o,type:"checkbox",className:l.checkbox,onChange:x,checked:s,disabled:t,"aria-label":a}),b({checked:s,disabled:t})]})};export{k as A};
