<commit_before>import React, { PropTypes } from 'react';
import classNames from 'classnames';
import Tab from './Tab';
import TabBar from './TabBar';
import mdlUpgrade from '../utils/mdlUpgrade';

const TabPropType = (props, propName, componentName) => {
    const prop = props[propName];
    if(prop.type !== Tab) {
        return new Error('`' + componentName + '` only accepts `Tab` as children.');
    }
};

class Tabs extends React.Component {
    static propTypes = {
        activeTab: PropTypes.number,
        children: PropTypes.oneOfType([
            TabPropType,
            PropTypes.arrayOf(TabPropType)
        ]),
        className: PropTypes.string,
        onChange: PropTypes.func,
        ripple: PropTypes.bool
    }

    render() {
        const { activeTab, className, onChange, ripple,
            children, ...otherProps } = this.props;

        const classes = classNames('mdl-tabs mdl-js-tabs', {
            'mdl-js-ripple-effect': ripple
        }, className);

        return (
            <div className={classes} {...otherProps}>
                <TabBar cssPrefix="mdl-tabs" activeTab={activeTab} onChange={onChange}>
                    {children}
                </TabBar>
                <div className="react-mdl-hack" id="undefined" />
            </div>
        );
    }
}

export default mdlUpgrade(Tabs);<commit_msg>Add tabBarProps prop to Tabs<commit_after>import React, { PropTypes } from 'react';
import classNames from 'classnames';
import Tab from './Tab';
import TabBar from './TabBar';
import mdlUpgrade from '../utils/mdlUpgrade';

const TabPropType = (props, propName, componentName) => {
    const prop = props[propName];
    if(prop.type !== Tab) {
        return new Error('`' + componentName + '` only accepts `Tab` as children.');
    }
};

class Tabs extends React.Component {
    static propTypes = {
        activeTab: PropTypes.number,
        children: PropTypes.oneOfType([
            TabPropType,
            PropTypes.arrayOf(TabPropType)
        ]),
        className: PropTypes.string,
        onChange: PropTypes.func,
        ripple: PropTypes.bool,
        tabBarProps: PropTypes.object,
    }

    render() {
        const { activeTab, className, onChange, ripple,
            children, tabBarProps, ...otherProps } = this.props;

        const classes = classNames('mdl-tabs mdl-js-tabs', {
            'mdl-js-ripple-effect': ripple
        }, className);

        return (
            <div className={classes} {...otherProps}>
                <TabBar cssPrefix="mdl-tabs" activeTab={activeTab} onChange={onChange} {...tabBarProps} >
                    {children}
                </TabBar>
                <div className="react-mdl-hack" id="undefined" />
            </div>
        );
    }
}

export default mdlUpgrade(Tabs);
{'fraction_non_alphanumeric': 0.12928571428571428, 'fraction_numerical': 0.0, 'mean_word_length': 2.2048054919908466, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4392850', 'n_tokens_mistral': 804, 'n_tokens_neox': 800, 'n_words': 189}