import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Button from '../button';
import SwitchBase from '../switchBase';
var propTypes = {
  prefixCls: PropTypes.string,

  /** 标签文本 */
  label: PropTypes.node,

  /** 是否禁用 */
  disabled: PropTypes.bool,

  /** 选中状态（适用于受控组件） */
  checked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),

  /** 选中状态默认值 */
  defaultChecked: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),

  /** 选中状态icon */
  checkedIcon: PropTypes.node,
  className: PropTypes.string,

  /** 未选中状态icon */
  uncheckedIcon: PropTypes.node,

  /** 获取input的ref */
  inputRef: PropTypes.func,

  /** 选中状态改变时的回调 function(e, checked) */
  onChange: PropTypes.func
};
var defaultProps = {
  defaultChecked: false,
  prefixCls: 'ne-radio-button',
  disabled: false
};
/**
 * RadioButton
 */

export default function RadioButton(props) {
  var prefixCls = props.prefixCls,
      _label = props.label,
      size = props.size,
      className = props.className,
      other = _objectWithoutProperties(props, ["prefixCls", "label", "size", "className"]);

  return React.createElement(SwitchBase, _extends({
    className: classNames(prefixCls, className),
    label: function label(state, disabled) {
      return React.createElement(Button, _extends({
        className: "".concat(prefixCls, "-base"),
        component: "span",
        active: state,
        disabled: disabled,
        size: size
      }, other), _label);
    },
    size: size
  }, other, {
    checkedIcon: "",
    inputType: "radio"
  }));
}
RadioButton.propTypes = propTypes;
RadioButton.defaultProps = defaultProps;