{"size": 1080, "ext": "js", "max_stars_repo_path": "src/components/Flex/Flex.js", "max_stars_repo_name": "wolfspace/uikit-for-react", "max_stars_repo_stars_event_min_datetime": "2018-03-06T04:59:45.000Z", "max_stars_repo_stars_event_max_datetime": "2018-03-06T04:59:45.000Z", "max_issues_repo_path": "src/components/Flex/Flex.js", "max_issues_repo_name": "wolfspace/uikit-for-react", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/Flex/Flex.js", "max_forks_repo_name": "wolfspace/uikit-for-react", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.0, "max_line_length": 68, "alphanum_fraction": 0.587037037}
import React from 'react';
import classnames from 'classnames';
import omit from 'lodash/omit';
import { customPropTypes, HTML } from '../../lib';
import { propTypes, extrapolateClasses } from '../common/flexProps';
import Base from '../Base';

export default class Flex extends React.Component {
  static displayName = 'Flex';

  static propTypes = {
    ...omit(Base.propTypes, 'flex'),
    ...propTypes,
    as: customPropTypes.customOrStringElement(HTML.BLOCK_ELEMENTS),
  };

  static defaultProps = {
    ...Base.defaultProps,
    as: 'div',
    display: true,
  };

  render() {
    const {
      className,
      alignItems,
      direction,
      display,
      grow,
      inline,
      justifyContent,
      order,
      wrap,
      ...rest
    } = this.props;

    const classes = classnames(
      className,
      extrapolateClasses({
        alignItems,
        direction,
        display,
        grow,
        inline,
        justifyContent,
        order,
        wrap,
      }),
    );

    return <Base {...rest} className={classes} component={Flex} />;
  }
}
