"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _classnames = _interopRequireDefault(require("classnames"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _react = _interopRequireDefault(require("react"));

require("./Box.css");

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

function _extends() { _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; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var Box = function Box(_ref) {
  var align = _ref.align,
      border = _ref.border,
      children = _ref.children,
      className = _ref.className,
      direction = _ref.direction,
      gap = _ref.gap,
      grow = _ref.grow,
      justify = _ref.justify,
      padding = _ref.padding,
      paddingBottom = _ref.paddingBottom,
      paddingLeft = _ref.paddingLeft,
      paddingRight = _ref.paddingRight,
      paddingTop = _ref.paddingTop,
      restProps = _objectWithoutProperties(_ref, ["align", "border", "children", "className", "direction", "gap", "grow", "justify", "padding", "paddingBottom", "paddingLeft", "paddingRight", "paddingTop"]);

  return _react.default.createElement("div", _extends({}, restProps, {
    className: (0, _classnames.default)('vs-box', "vs-box-direction-".concat(direction), border && 'vs-box-border', gap && "vs-box-gap-".concat(gap), padding && "vs-box-padding-".concat(padding), paddingBottom && "vs-box-padding-bottom-".concat(paddingBottom), paddingLeft && "vs-box-padding-left-".concat(paddingLeft), paddingRight && "vs-box-padding-right-".concat(paddingRight), paddingTop && "vs-box-padding-top-".concat(paddingTop), align && "vs-box-align-".concat(align), justify && "vs-box-justify-".concat(justify), grow && 'vs-box-grow', className)
  }), children);
};

Box.defaultProps = {
  direction: 'row'
};
Box.propTypes = {
  children: _propTypes.default.node,
  className: _propTypes.default.string,
  direction: _propTypes.default.oneOf(['column', 'row']),
  padding: _propTypes.default.oneOf(['small', 'default', 'large', 'xl', '2xl', '3xl', '4xl']),
  paddingTop: _propTypes.default.oneOf(['small', 'default', 'large', 'xl', '2xl', '3xl', '4xl']),
  paddingBottom: _propTypes.default.oneOf(['small', 'default', 'large', 'xl', '2xl', '3xl', '4xl']),
  paddingLeft: _propTypes.default.oneOf(['small', 'default', 'large', 'xl', '2xl', '3xl', '4xl']),
  paddingRight: _propTypes.default.oneOf(['small', 'default', 'large', 'xl', '2xl', '3xl', '4xl']),
  gap: _propTypes.default.oneOf(['small', 'default', 'large', 'xl', '2xl', '3xl', '4xl']),
  align: _propTypes.default.oneOf(['start', 'center', 'end']),
  justify: _propTypes.default.oneOf(['start', 'center', 'end', 'space-around', 'space-between', 'space-evenly']),
  border: _propTypes.default.bool,
  grow: _propTypes.default.bool
};
var _default = Box;
exports.default = _default;