"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/jsx-runtime.js"),k=require("react"),o=require("../styles.js"),r=require("../../../utils/index.js"),m=require("../../../icons/AlertCircle.js"),v=require("./Radio.js");function h({id:i,name:x,label:t,value:R,checked:j,onChange:l=r.noop,disabled:p=!1,hasError:d=!1,errorText:u,assistText:c,...a},f){const s=r.getId(a["data-testid"]),n=r.getId(a["data-testid"]);return!i&&t&&(i=r.slugify(t)),e.jsxRuntimeExports.jsxs(o.CheckRadioInputGroupWrapper,{children:[e.jsxRuntimeExports.jsx(v.Radio,{id:i,ref:f,name:x,value:R,checked:j,disabled:p,"aria-checked":a["aria-checked"],onChange:l,"data-testid":s("radio"),"data-trackid":n("radio"),"aria-label":a["aria-label"]||t,hasError:d,label:t}),d&&u&&e.jsxRuntimeExports.jsxs(o.CheckRadioErrorArea,{"data-testid":s("error"),"data-trackid":n("error"),children:[e.jsxRuntimeExports.jsx(m.default,{}),u]}),c&&!d&&e.jsxRuntimeExports.jsx(o.CheckRadioHintArea,{"data-testid":s("assistText"),"data-trackid":n("assistText"),children:c})]})}const q=k.forwardRef(h);exports.RadioButton=q;
