"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

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

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

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

var _js = require("../../globals/js");

var _excluded = ["className", "children", "responsive", "withBorder"];
var prefix = _js.settings.prefix;
/** Tables are used to make large volumes of data easy to understand and to access. */

function Table(_ref) {
  var _classNames;

  var className = _ref.className,
      children = _ref.children,
      responsive = _ref.responsive,
      withBorder = _ref.withBorder,
      other = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var classes = (0, _classnames.default)("".concat(prefix, "--table"), (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefix, "--table--responsive"), responsive), (0, _defineProperty2.default)(_classNames, "".concat(prefix, "--table--with-border"), withBorder), _classNames), className);
  return /*#__PURE__*/_react.default.createElement("table", (0, _extends2.default)({}, other, {
    className: classes
  }), children);
}

Table.propTypes = {
  /**
   * Provide the content for the Table, usually `<thead />` or `<tbody/>`
   */
  children: _propTypes.default.node,

  /**
   * Provide a custom className to be applied to the containing `<table />` node
   */
  className: _propTypes.default.string,

  /**
   * Displays the `<table />` as a responsive layout on small devices
   */
  responsive: _propTypes.default.bool,

  /**
   * Displays a border around the `<table />` node
   */
  withBorder: _propTypes.default.bool
};