var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

import React from 'react';
import PropTypes from 'prop-types';

import './style.scss';

var Flex = function Flex(props) {
  return React.createElement(
    props.tag,
    _extends({}, props, { className: 'Flex Flex_' + props.layout + ' ' + (props.className || '') }),
    props.children
  );
};

Flex.propTypes = process.env.NODE_ENV !== "production" ? {
  align: PropTypes.oneOf(['center', 'start', 'end', 'baseline', 'stretch']),
  className: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.object]),
  inline: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
  justify: PropTypes.oneOf(['center', 'start', 'end', 'between', 'around']),
  layout: PropTypes.oneOf(['row', 'col']),
  tag: PropTypes.string,
  text: PropTypes.oneOf(['left', 'center', 'right'])
} : {};

Flex.defaultProps = {
  align: 'start',
  justify: 'between',
  layout: 'row',
  tag: 'div'
};

export default Flex;