var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import ConfigProvider from '../config-provider';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import cls from 'classnames';
import { Radio as NextRadio } from '@alifd/next';
import { getTheme } from '../utils/getTheme';
import { omitProps } from '../utils/object';
class BdesignGroup extends Component {
    render() {
        const { shape } = this.props;
        const _a = this.props, { prefix = 'next-', size = 'medium', className } = _a, otherProps = __rest(_a, ["prefix", "size", "className"]);
        // button形状的radio
        const theme = getTheme(this.context, this.props);
        if (shape === 'button') {
            const { type = 'outline', size } = this.props;
            if (size === 'xs') {
                return (React.createElement(NextRadio.Group, Object.assign({}, omitProps(otherProps, ['size']), { prefix: prefix, className: cls(className, {
                        [`${prefix}grey`]: theme === 'grey',
                        [`${prefix}white`]: theme === 'white',
                        [`${prefix}xs`]: size === 'xs',
                        [`${prefix}outline`]: type === 'outline',
                        [`${prefix}solid`]: type === 'solid',
                        [`${prefix}container`]: type === 'container',
                    }) })));
            }
            return (React.createElement(NextRadio.Group, Object.assign({}, otherProps, { prefix: prefix, size: size, className: cls(className, {
                    [`${prefix}grey`]: theme === 'grey',
                    [`${prefix}white`]: theme === 'white',
                    [`${prefix}large`]: size === 'large',
                    [`${prefix}medium`]: size === 'medium',
                    [`${prefix}small`]: size === 'small',
                    [`${prefix}outline`]: type === 'outline',
                    [`${prefix}solid`]: type === 'solid',
                    [`${prefix}container`]: type === 'container',
                }) })));
        }
        return (React.createElement(NextRadio.Group, Object.assign({}, otherProps, { prefix: prefix, className: cls(className, {
                [`${prefix}xl`]: size === 'xl',
                [`${prefix}large`]: size === 'large',
                [`${prefix}medium`]: size === 'medium',
                [`${prefix}small`]: size === 'small',
            }) })));
    }
}
// contextTypes
BdesignGroup.contextTypes = {
    theme: PropTypes.string,
};
class Radio extends Component {
    render() {
        const _a = this.props, { size = 'medium', prefix = 'next-', className } = _a, otherProps = __rest(_a, ["size", "prefix", "className"]);
        return (React.createElement(NextRadio, Object.assign({}, otherProps, { prefix: prefix, className: cls(className, {
                [`${prefix}xl`]: size === 'xl',
                [`${prefix}large`]: size === 'large',
                [`${prefix}medium`]: size === 'medium',
                [`${prefix}small`]: size === 'small',
            }) })));
    }
}
Radio.Group = ConfigProvider.config(BdesignGroup);
// hoistNonReactStatics(Radio, NextRadio);
export default ConfigProvider.config(Radio);
