PageSourceSearch

https://living-corporate.com/assets/checkbox-CrGTwbPu.js

js living-corporate.com collected 2026-10-02 05:01:39 UTC 3,863 bytes, 1 lines download raw bytes

vendor: 3,863 bytes, line 1
1import{r as d,j as n,a3 as H,a8 as _,ad as z,a5 as S,a6 as N,aj as G,a1 as K,af as w}from"./index-QiiZ-xPT.js";import{u as U}from"./index-DqZlRfV5.js";import{C as X}from"./check-KTa2Xihg.js";var y="Checkbox",[$]=K(y),[J,I]=$(y);function Q(t){const{__scopeCheckbox:s,checked:r,children:l,defaultChecked:a,disabled:e,form:f,name:h,onCheckedChange:i,required:k,value:m="on",internal_do_not_use_render:u}=t,[p,v]=z({prop:r,defaultProp:a??!1,onChange:i,caller:y}),[C,x]=d.useState(null),[g,o]=d.useState(null),c=d.useRef(!1),E=C?!!f||!!C.closest("form"):!0,R={checked:p,disabled:e,setChecked:v,control:C,setControl:x,name:h,form:f,value:m,hasConsumerStoppedPropagationRef:c,required:k,defaultChecked:b(a)?!1:a,isFormControl:E,bubbleInput:g,setBubbleInput:o};return n.jsx(J,{scope:s,...R,children:V(u)?u(R):l})}var B="CheckboxTrigger",M=d.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:r,...l},a)=>{const{control:e,value:f,disabled:h,checked:i,required:k,setControl:m,setChecked:u,hasConsumerStoppedPropagationRef:p,isFormControl:v,bubbleInput:C}=I(B,t),x=S(a,m),g=d.useRef(i);return d.useEffect(()=>{const o=e?.form;if(o){const c=()=>u(g.current);return o.addEventListener("reset",c),()=>o.removeEventListener("reset",c)}},[e,u]),n.jsx(_.button,{type:"button",role:"checkbox","aria-checked":b(i)?"mixed":i,"aria-required":k,"data-state":F(i),"data-disabled":h?"":void 0,disabled:h,value:f,...l,ref:x,onKeyDown:N(s,o=>{o.key==="Enter"&&o.preventDefault()}),onClick:N(r,o=>{u(c=>b(c)?!0:!c),C&&v&&(p.current=o.isPropagationStopped(),p.current||o.stopPropagation())})})});M.displayName=B;var P=d.forwardRef((t,s)=>{const{__scopeCheckbox:r,name:l,checked:a,defaultChecked:e,required:f,disabled:h,value:i,onCheckedChange:k,form:m,...u}=t;return n.jsx(Q,{__scopeCheckbox:r,checked:a,defaultChecked:e,disabled:h,required:f,onCheckedChange:k,name:l,form:m,value:i,internal_do_not_use_render:({isFormControl:p})=>n.jsxs(n.Fragment,{children:[n.jsx(M,{...u,ref:s,__scopeCheckbox:r}),p&&n.jsx(D,{__scopeCheckbox:r})]})})});P.displayName=y;var T="CheckboxIndicator",q=d.forwardRef((t,s)=>{const{__scopeCheckbox:r,forceMount:l,...a}=t,e=I(T,r);return n.jsx(H,{present:l||b(e.checked)||e.checked===!0,children:n.jsx(_.span,{"data-state":F(e.checked),"data-disabled":e.disabled?"":void 0,...a,ref:s,style:{pointerEvents:"none",...t.style}})})});q.displayName=T;var A="CheckboxBubbleInput",D=d.forwardRef(({__scopeCheckbox:t,...s},r)=>{const{control:l,hasConsumerStoppedPropagationRef:a,checked:e,defaultChecked:f,required:h,disabled:i,name:k,value:m,form:u,bubbleInput:p,setBubbleInput:v}=I(A,t),C=S(r,v),x=U(e),g=G(l);d.useEffect(()=>{const c=p;if(!c)return;const E=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(E,"checked").set,L=!a.current;if(x!==e&&j){const O=new Event("click",{bubbles:L});c.indeterminate=b(e),j.call(c,b(e)?!1:e),c.dispatchEvent(O)}},[p,x,e,a]);const o=d.useRef(b(e)?!1:e);return n.jsx(_.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??o.current,required:h,disabled:i,name:k,value:m,form:u,...s,tabIndex:-1,ref:C,style:{...s.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});D.displayName=A;function V(t){return typeof t=="function"}function b(t){return t==="indeterminate"}function F(t){return b(t)?"indeterminate":t?"checked":"unchecked"}const W=d.forwardRef(({className:t,...s},r)=>n.jsx(P,{ref:r,className:w("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...s,children:n.jsx(q,{className:w("grid place-content-center text-current"),children:n.jsx(X,{className:"h-4 w-4"})})}));W.displayName=P.displayName;export{W as C};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.