import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
var _jsxFileName = 'src/radio/RadioButton.jsx';
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { CheckableTag } from '../tag';
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 _this = this;

    var prefixCls = props.prefixCls,
        _label = props.label,
        size = props.size,
        className = props.className,
        other = _objectWithoutProperties(props, ['prefixCls', 'label', 'size', 'className']);

    return React.createElement(SwitchBase, Object.assign({
        className: classNames(prefixCls, className),
        label: function label(state, disabled) {
            return React.createElement(
                CheckableTag,
                { checked: state, disabled: disabled, size: size, __source: {
                        fileName: _jsxFileName,
                        lineNumber: 42
                    },
                    __self: _this
                },
                _label
            );
        },
        size: size
    }, other, {
        checkedIcon: '',
        inputType: 'radio',
        __source: {
            fileName: _jsxFileName,
            lineNumber: 38
        },
        __self: this
    }));
}

RadioButton.propTypes = propTypes;
RadioButton.defaultProps = defaultProps;