import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React, { forwardRef } from 'react';
import PropTypes from 'prop-types';
import { Radio as RebassRadio } from '@rebass/forms';
import Label from '../Label';
const Radio = /*#__PURE__*/forwardRef((_ref, ref) => {
  let {
    label,
    disabled,
    readOnly,
    name,
    value,
    onChange,
    checked
  } = _ref,
      rest = _objectWithoutProperties(_ref, ["label", "disabled", "readOnly", "name", "value", "onChange", "checked"]);

  return /*#__PURE__*/React.createElement(Label, _extends({
    ref: ref,
    color: "inherit",
    alignItems: "center"
  }, rest), /*#__PURE__*/React.createElement(RebassRadio, {
    name: name,
    value: value,
    disabled: disabled,
    checked: checked,
    readOnly: readOnly,
    onChange: onChange
  }), label);
});
Radio.displayName = 'Radio';
Radio.propTypes = {
  checked: PropTypes.bool,

  /** Disabled state */
  disabled: PropTypes.bool,

  /** Label for Radio  */
  label: PropTypes.node,
  name: PropTypes.string,

  /** Called when `onChange` event is triggered. */
  onChange: PropTypes.func,

  /** Read-only state */
  readOnly: PropTypes.bool,

  /** Current value of the radio. */
  value: PropTypes.any
};
export default Radio;