'use strict';

exports.__esModule = true;

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; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

require('./style.scss');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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

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

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

exports.default = Flex;
module.exports = exports['default'];