"use strict";

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

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

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

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

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

/**
 * @deprecated This component has been deprecated 2021-06-04. Use Grid or LayoutGrid instead.
 */
var Row = _react["default"].forwardRef(function (_ref, ref) {
  var _ref$as = _ref.as,
      Component = _ref$as === void 0 ? "div" : _ref$as,
      border = _ref.border,
      displayVertical = _ref.displayVertical,
      overflow = _ref.overflow,
      outlineDebug = _ref.outlineDebug,
      paddedContent = _ref.paddedContent,
      removeGutters = _ref.removeGutters,
      shouldWrap = _ref.shouldWrap,
      verticalAlignment = _ref.verticalAlignment,
      props = _objectWithoutProperties(_ref, ["as", "border", "displayVertical", "overflow", "outlineDebug", "paddedContent", "removeGutters", "shouldWrap", "verticalAlignment"]);

  var classes = [];

  if (border) {
    classes.push("border--".concat(border));
  }

  if (displayVertical) {
    classes.push("flex--column");
  }

  if (outlineDebug) {
    classes.push("outline--debug");
  }

  if (overflow) {
    classes.push(overflow);
  }

  if (!shouldWrap) {
    classes.push("row--no-wrap");
  }

  if (paddedContent && paddedContent !== "none") {
    classes.push("padded-content--".concat(paddedContent));
  }

  if (verticalAlignment) {
    classes.push("flex-align--".concat(verticalAlignment));
  }

  return _react["default"].createElement(Component, _extends({}, props, {
    ref: ref,
    className: (0, _classnames["default"])("row", classes, removeGutters && "gutters--remove")
  }));
});

Row.propTypes = {
  as: _propTypes["default"].any,
  border: _propTypes["default"].oneOf(["top", "bottom", "left", "right", "sides", "ends", "all", "none"]),
  displayVertical: _propTypes["default"].bool,
  outlineDebug: _propTypes["default"].bool,
  overflow: _propTypes["default"].oneOf(["overflow-y--scroll", "overflow-x--auto", "overflow-y--auto"]),
  paddedContent: _propTypes["default"].oneOf(["none", "around", "sides", "ends", "remove", "top", "bottom"]),
  ref: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].func, _propTypes["default"].object]),
  removeGutters: _propTypes["default"].bool,
  shouldWrap: _propTypes["default"].bool,
  verticalAlignment: _propTypes["default"].oneOf(["start", "center", "end"])
};
Row.displayName = "Row";
Row.defaultProps = {
  border: "none",
  displayVertical: false,
  overflow: undefined,
  outlineDebug: false,
  paddedContent: "none",
  removeGutters: false,
  shouldWrap: true
};
var _default = Row;
exports["default"] = _default;