import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["size", "children", "className", "classes"];
import React from "react";
import PropTypes from "prop-types";
import classnames from "classnames";
import MaterialRadio from "@material-ui/core/Radio";
import CircleIcon from "@material-ui/icons/RadioButtonUnchecked";
import CheckCircleIcon from "@material-ui/icons/RadioButtonChecked";
import getClasses from "./styles";

var Radio = function Radio(props) {
  var size = props.size,
      children = props.children,
      className = props.className,
      classesProps = props.classes,
      materialRadioProps = _objectWithoutProperties(props, _excluded);

  var classes = getClasses({
    size: size
  });
  return /*#__PURE__*/React.createElement("label", {
    className: classnames(classes.root, className)
  }, /*#__PURE__*/React.createElement(MaterialRadio, _extends({
    classes: {
      root: classes.radio
    }
  }, materialRadioProps)), /*#__PURE__*/React.createElement("div", {
    className: classesProps === null || classesProps === void 0 ? void 0 : classesProps.container
  }, children));
};

Radio.propTypes = {
  className: PropTypes.string,
  checked: PropTypes.bool.isRequired,
  value: PropTypes.string.isRequired,
  onChange: PropTypes.func,
  color: PropTypes.oneOf(["primary", "secondary"]),
  disabled: PropTypes.bool,
  size: PropTypes.number,
  icon: PropTypes.instanceOf(Object),
  checkedIcon: PropTypes.instanceOf(Object),
  classes: PropTypes.shape({
    container: PropTypes.string
  })
};
Radio.defaultProps = {
  className: "",
  onChange: function onChange() {},
  color: "primary",
  disabled: false,
  size: 20,
  icon: /*#__PURE__*/React.createElement(CircleIcon, null),
  checkedIcon: /*#__PURE__*/React.createElement(CheckCircleIcon, null)
};
export default Radio;