"use strict";const t=require("react/jsx-runtime"),R=require("react"),I=require("./field-helper-text-DSKO-Tce.js"),v=require("./label-yHK80hhV.js"),d=require("./index-BbtRr5Q6.js"),N=require("./bind-DeUYJ6m9.js"),T=require("./heading-DLCdW6gx.js"),B={"purpur-radio-button-group-item":"_purpur-radio-button-group-item_1j3ch_1","purpur-radio-button-group-item__radio":"_purpur-radio-button-group-item__radio_1j3ch_14","purpur-radio-button-group-item__label":"_purpur-radio-button-group-item__label_1j3ch_42","purpur-radio-button-group-item__container":"_purpur-radio-button-group-item__container_1j3ch_45","purpur-radio-button-group-item__item-label-container":"_purpur-radio-button-group-item__item-label-container_1j3ch_53","purpur-radio-button-group-item__item-helper":"_purpur-radio-button-group-item__item-helper_1j3ch_53","purpur-radio-button-group-item__label-container":"_purpur-radio-button-group-item__label-container_1j3ch_56","purpur-radio-button-group-item__indicator":"_purpur-radio-button-group-item__indicator_1j3ch_79"},u=N.c.bind(B),G=["ltr","rtl"],q=["horizontal","vertical"],i="purpur-radio-button-group-item",j=R.forwardRef(({disabled:o,id:r,value:_,label:a,"data-testid":e,helperText:n,...p},l)=>t.jsxs("div",{className:u(`${i}__container`),...p,children:[t.jsx(d.Item2,{className:u(i),"data-testid":e,disabled:o,id:r,ref:l,value:_,"aria-labelledby":`${r}-label ${r}-helper-text`,children:t.jsx("span",{className:u(`${i}__radio`),children:t.jsx(d.Indicator,{className:u(`${i}__indicator`)})})}),t.jsxs("span",{className:u(`${i}__label-container`),children:[t.jsx(v.Label,{htmlFor:r,id:`${r}-label`,className:u(`${i}__label`),disabled:o,children:a}),n&&t.jsx(I.FieldHelperText,{className:u(`${i}__helper`),"data-testid":e&&`${e}-helper-text`,disabled:o,id:`${r}-helper-text`,children:n})]})]},r)),U={"purpur-radio-button-group":"_purpur-radio-button-group_v7z64_1","purpur-radio-button-group__item-container":"_purpur-radio-button-group__item-container_v7z64_10","purpur-radio-button-group__container":"_purpur-radio-button-group__container_v7z64_13"},g=N.c.bind(U),h="purpur-radio-button-group",x=R.forwardRef(({id:o,"data-testid":r,className:_,items:a,heading:e,loop:n=!0,orientation:p="vertical",headingTag:l="h2",children:b,...c},O)=>{if(!a?.length&&!b)return null;const $=()=>a?.map(m=>t.jsx(j,{disabled:c.disabled,...m},`radio-item-${m.value}`));return t.jsxs("div",{className:g(_,`${h}__container`),children:[e&&t.jsxs(T.Heading,{tag:l,"data-testid":r?`${r}-heading`:void 0,id:`${o}-heading`,variant:"subsection-100",children:[c.required&&t.jsx("span",{"aria-hidden":!0,children:"* "}),e]}),t.jsx(d.Root2,{...c,"aria-labelledby":e?`${o}-heading`:void 0,className:g(h),"data-testid":r,loop:n,orientation:p,ref:O,children:a?.length?$():b})]})});x.displayName="RadioButtonGroupRoot";const s=({children:o,...r})=>t.jsx(x,{...r,children:o});s.Item=j;s.displayName="RadioButtonGroup";exports.RADIO_BUTTON_GROUP_DIRECTION=G;exports.RADIO_BUTTON_GROUP_ORIENTATION=q;exports.RadioButtonGroup=s;
//# sourceMappingURL=radio-button-group-CZ_FnVAi.js.map
