import{r as i,b as m,j as e}from"./app--5U4-9K0.js";function h(l){const{id:r,value:s,onChange:n}=l,a=typeof l.option=="string"?{label:l.option,value:l.option}:l.option;return e.jsxs("div",{className:"rl-form-flex-control",children:[e.jsx("input",{disabled:a.disabled,type:"radio",value:a.value,id:`${r}-${a.value}`,checked:s===a.value,onChange:n}),e.jsxs("div",{className:"rl-form-inline-label",children:[e.jsx("label",{htmlFor:`${r}-${a.value}`,children:a.label}),a.caption&&e.jsx("small",{className:"rl-form-control-caption",children:a.caption})]})]})}const p=i.memo(function({id:r,label:s,value:n,required:a,options:c,flexDirection:d="col"}){const t=m(r,"change","value"),u=i.useCallback(o=>{t(o.target.value)},[t]);return e.jsxs(e.Fragment,{children:[s&&e.jsxs("label",{children:[s," ",a&&e.jsx("span",{className:"rl-required",children:"*"})]}),e.jsx("div",{className:`rl-form-control-group rl-flex-${d}`,children:c.map(o=>e.jsx(h,{id:r,value:n,onChange:u,option:o},typeof o=="string"?o:o.value))})]})});p.displayName="RadioGroup";export{p as default};
