"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _forms = require("@rebass/forms");

var _Label = _interopRequireDefault(require("../Label"));

var Radio = function Radio(_ref) {
  var label = _ref.label,
      disabled = _ref.disabled,
      readOnly = _ref.readOnly,
      rest = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["label", "disabled", "readOnly"]);
  return _react.default.createElement(_Label.default, (0, _extends2.default)({
    color: "inherit",
    alignItems: "center"
  }, rest), _react.default.createElement(_forms.Radio, (0, _extends2.default)({}, rest, {
    disabled: disabled,
    readOnly: readOnly
  })), label);
};

Radio.propTypes = {
  /** Disabled state */
  disabled: _propTypes.default.bool,

  /** Label for Radio  */
  label: _propTypes.default.node,

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

  /** Read-only state */
  readOnly: _propTypes.default.bool,

  /** Current value of the radio. */
  value: _propTypes.default.any
};
var _default = Radio;
exports.default = _default;