'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var clsx = require('clsx');
var jsxRuntime = require('react/jsx-runtime');

function RadioButton({
  id,
  value = '',
  name,
  checked,
  onChange,
  disabled,
  readOnly,
  className,
  'aria-describedby': ariaDescribedBy
}) {
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
    children: [/*#__PURE__*/jsxRuntime.jsx("input", {
      type: "radio",
      className: clsx.clsx('sr-only', className),
      id: id,
      value: value,
      name: name,
      checked: checked,
      disabled: disabled || readOnly,
      "aria-describedby": ariaDescribedBy,
      onChange: () => {
        if (!checked) {
          onChange?.(value);
        }
      }
    }), /*#__PURE__*/jsxRuntime.jsx("span", {
      className: clsx.clsx('tw-radio-button', {
        checked,
        disabled: disabled || readOnly
      }),
      children: /*#__PURE__*/jsxRuntime.jsx("span", {
        className: "tw-radio-check"
      })
    })]
  });
}

exports.default = RadioButton;
//# sourceMappingURL=RadioButton.js.map
