import { j as d } from "../../../_virtual/jsx-runtime.js";
import { forwardRef as u } from "react";
import { CheckRadioWrapper as R, CheckRadioInput as h, CheckRadioLabel as k } from "../styles.js";
import { slugify as x, getId as r, noop as j } from "../../../utils/index.js";
function C({
  id: a,
  name: n,
  label: t,
  value: s,
  onChange: p = j,
  disabled: c = !1,
  hasError: f = !1,
  checked: m,
  ...o
}, l) {
  !a && t && (a = x(t));
  const e = r(o["data-testid"]), i = r(o["data-testid"]);
  return /* @__PURE__ */ d.jsxs(R, { children: [
    /* @__PURE__ */ d.jsx(
      h,
      {
        ref: l,
        type: "radio",
        id: a,
        name: n,
        value: s,
        disabled: c,
        hasError: f,
        onChange: p,
        "data-testid": e("input"),
        "data-trackid": i("input"),
        "aria-label": o["aria-label"] || t,
        checked: m
      }
    ),
    t && /* @__PURE__ */ d.jsx(
      k,
      {
        htmlFor: a,
        "data-testid": e("label"),
        "data-trackid": i("label"),
        children: t
      }
    )
  ] });
}
const b = u(C);
export {
  b as Radio
};
