import _pt from "prop-types";

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

import classNames from "classnames";
import React from "react";

/**
 * @deprecated This component has been deprecated 2021-06-04. Use Grid or LayoutGrid instead.
 */
var Row = React.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.createElement(Component, _extends({}, props, {
    ref: ref,
    className: classNames("row", classes, removeGutters && "gutters--remove")
  }));
});
Row.propTypes = {
  as: _pt.any,
  border: _pt.oneOf(["top", "bottom", "left", "right", "sides", "ends", "all", "none"]),
  displayVertical: _pt.bool,
  outlineDebug: _pt.bool,
  overflow: _pt.oneOf(["overflow-y--scroll", "overflow-x--auto", "overflow-y--auto"]),
  paddedContent: _pt.oneOf(["none", "around", "sides", "ends", "remove", "top", "bottom"]),
  ref: _pt.oneOfType([_pt.string, _pt.func, _pt.object]),
  removeGutters: _pt.bool,
  shouldWrap: _pt.bool,
  verticalAlignment: _pt.oneOf(["start", "center", "end"])
};
Row.displayName = "Row";
Row.defaultProps = {
  border: "none",
  displayVertical: false,
  overflow: undefined,
  outlineDebug: false,
  paddedContent: "none",
  removeGutters: false,
  shouldWrap: true
};
export default Row;