import ConfigProvider from '../config-provider'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import cls from 'classnames'; // import hoistNonReactStatics from 'hoist-non-react-statics'; import { CommonThemeProps } from '../types'; import { Radio as NextRadio } from '@alifd/next'; import { RadioProps as NextRadioProps } from '@alifd/next/types/radio'; import { GroupProps as RadioGroupProps } from '@alifd/next/types/radio'; import { getTheme } from '../utils/getTheme'; import { omitProps } from '../utils/object'; interface RadioProps extends NextRadioProps { size?: 'xl' | 'large' | 'medium' | 'small'; } interface GroupProps extends Omit, CommonThemeProps { size?: 'xl' | 'large' | 'medium' | 'small' | 'xs'; type?: 'outline' | 'container' | 'solid' } class BdesignGroup extends Component { // contextTypes static contextTypes = { theme: PropTypes.string, }; render() { const { shape } = this.props; const { prefix = 'next-', size = 'medium', className, ...otherProps } = this.props; // button形状的radio const theme = getTheme(this.context, this.props); if (shape === 'button') { const { type = 'outline', size } = this.props; if (size === 'xs') { return ( ); } return ( ); } return ( ); } } class Radio extends Component { static Group = ConfigProvider.config(BdesignGroup); render() { const { size = 'medium', prefix = 'next-', className, ...otherProps } = this.props; return ( ); } } // hoistNonReactStatics(Radio, NextRadio); export default ConfigProvider.config(Radio);