import React, { PureComponent } from 'react';
import classNames from 'classnames';
export const GROW_SIZES = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
export class SoftFlexItem extends PureComponent {
    render() {
        let { children, className, grow, component: Component, ...rest } = this.props;
        validateGrowValue(grow);
        const classes = classNames('softFlexItem', {
            'softFlexItem--flexGrowZero': !grow,
            [`softFlexItem--flexGrow${grow}`]: typeof grow === 'number' ? GROW_SIZES.indexOf(grow) >= 0 : undefined,
        }, className);
        return (React.createElement(Component, Object.assign({ className: classes }, rest), children));
    }
}
SoftFlexItem.defaultProps = { grow: true, component: 'div' };
function validateGrowValue(value) {
    const validValues = [null, undefined, true, false, ...GROW_SIZES];
    if (validValues.indexOf(value) === -1) {
        throw new Error(`Prop \`grow\` passed to \`SoftFlexItem\` must be a boolean or an integer between 1 and 10, received \`${value}\``);
    }
}
//# sourceMappingURL=SoftFlexItem.js.map