PageSourceSearch

https://tailwindadmin-tanstack-pro-dark.netlify.app/assets/radio-group-CF-3wRIM.js

js tailwindadmin-tanstack-pro-dark.netlify.app collected 2026-10-03 11:30:40 UTC 4,269 bytes, 1 lines download raw bytes

vendor: 3,203 bytes, line 1
1import{r as n,j as t}from"./main-BkpAS6Tt.js";import{u as K,P as x,c as w,a as E}from"./index-DRcYnjBa.js";import{u as C}from"./index-L0SKbviM.js";import{R as T,I as U,c as I}from"./index-C0QJ8CHZ.js";import{u as V}from"./index-DhQbCedW.js";import{u as z}from"./index-B_H36sPx.js";import{u as H}from"./index-D9jDtrFa.js";import{P as $}from"./index-DjxFjNHx.js";import{c as N}from"./utils-4perknFd.js";import{C as W}from"./circle-DoQ76Nbd.js";var g="Radio",[X,P]=E(g),[Y,J]=X(g),k=n.forwardRef((r,a)=>{const{__scopeRadio:e,name:d,checked:o=!1,required:s,disabled:i,value:p="on",onCheck:f,form:m,...R}=r,[l,v]=n.useState(null),c=C(a,h=>v(h)),u=n.useRef(!1),y=l?m||!!l.closest("form"):!0;return t.jsxs(Y,{scope:e,checked:o,disabled:i,children:[t.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":S(o),"data-disabled":i?"":void 0,disabled:i,value:p,...R,ref:c,onClick:w(r.onClick,h=>{o||f?.(),y&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),y&&t.jsx(G,{control:l,bubbles:!u.current,name:d,value:p,checked:o,required:s,disabled:i,form:m,style:{transform:"translateX(-100%)"}})]})});k.displayName=g;var _="RadioIndicator",j=n.forwardRef((r,a)=>{const{__scopeRadio:e,forceMount:d,...o}=r,s=J(_,e);return t.jsx($,{present:d||s.checked,children:t.jsx(x.span,{"data-state":S(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:a})})});j.displayName=_;var Q="RadioBubbleInput",G=n.forwardRef(({__scopeRadio:r,control:a,checked:e,bubbles:d=!0,...o},s)=>{const i=n.useRef(null),p=C(i,s),f=H(e),m=z(a);return n.useEffect(()=>{const R=i.current;if(!R)return;const l=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(l,"checked").set;if(f!==e&&c){const u=new Event("click",{bubbles:d});c.call(R,e),R.dispatchEvent(u)}},[f,e,d]),t.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:e,...o,tabIndex:-1,ref:p,style:{...o.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});G.displayName=Q;function S(r){return r?"checked":"unchecked"}var Z=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[ee]=E(b,[I,P]),A=I(),D=P(),[oe,re]=ee(b),M=n.forwardRef((r,a)=>{const{__scopeRadioGroup:e,name:d,defaultValue:o,value:s,required:i=!1,disabled:p=!1,orientation:f,dir:m,loop:R=!0,onValueChange:l,...v}=r,c=A(e),u=V(m),[y,h]=K({prop:s,defaultProp:o??null,onChange:l,caller:b});return t.jsx(oe,{scope:e,name:d,required:i,disabled:p,value:y,onValueChange:h,children:t.jsx(T,{asChild:!0,...c,orientation:f,dir:u,loop:R,children:t.jsx(x.div,{role:"radiogroup","aria-required":i,"aria-orientation":f,"data-disabled":p?"":void 0,dir:u,...v,ref:a})})})});M.displayName=b;var O="RadioGroupItem",F=n.forwardRef((r,a)=>{const{__scopeRadioGroup:e,disabled:d,...o}=r,s=re(O,e),i=s.disabled||d,p=A(e),f=D(e),m=n.useRef(null),R=C(a,m),l=s.value===o.value,v=n.useRef(!1);return n.useEffect(()=>{const c=y=>{Z.includes(y.key)&&(v.current=!0)},u=()=>v.current=!1;return document.addEventListener("keydown",c),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",c),document.removeEventListener("keyup",u)}},[]),t.jsx(U,{asChild:!0,...p,focusable:!i,active:l,children:t.jsx(k,{disabled:i,required:s.required,
1checked:l,...f,...o,name:s.name,ref:R,onCheck:()=>s.onValueChange(o.value),onKeyDown:w(c=>{c.key==="Enter"&&c.preventDefault()}),onFocus:w(o.onFocus,()=>{v.current&&m.current?.click()})})})});F.displayName=O;var te="RadioGroupIndicator",L=n.forwardRef((r,a)=>{const{__scopeRadioGroup:e,...d}=r,o=D(e);return t.jsx(j,{...o,...d,ref:a})});L.displayName=te;var q=M,B=F,ae=L;const se=n.forwardRef(({className:r,...a},e)=>t.jsx(q,{className:N("grid gap-2",r),...a,ref:e}));se.displayName=q.displayName;const ne=n.forwardRef(({className:r,...a},e)=>t.jsx(B,{ref:e,className:N("aspect-square h-4 w-4 rounded-full border border-ld text-primary ring-offset-white focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50   dark:ring-offset-neutral-950 dark:focus-visible:ring-neutral-300",r),...a,children:t.jsx(ae,{className:"flex items-center justify-center",children:t.jsx(W,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ne.displayName=B.displayName;export{se as R,ne as a};

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.