import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "className", "colon", "kind", "small"];
import PropTypes from 'prop-types';
import React from 'react';
import classnames from 'classnames';
import { settings } from '../../globals/js';
var prefix = settings.prefix;
/** List component show a number of connected items written consecutively, typically one below the other. */

export var List = function List(_ref) {
  var _classnames;

  var children = _ref.children,
      className = _ref.className,
      colon = _ref.colon,
      kind = _ref.kind,
      small = _ref.small,
      other = _objectWithoutProperties(_ref, _excluded);

  var classNames = classnames("".concat(prefix, "--list"), className, (_classnames = {}, _defineProperty(_classnames, "".concat(prefix, "--list--").concat(kind), kind), _defineProperty(_classnames, "".concat(prefix, "--list--small"), small), _defineProperty(_classnames, "".concat(prefix, "--list--colon"), colon), _classnames));
  return /*#__PURE__*/React.createElement(React.Fragment, null, kind == 'ordered' ? /*#__PURE__*/React.createElement("ol", _extends({
    className: classNames
  }, other), children) : /*#__PURE__*/React.createElement("ul", _extends({
    className: classNames
  }, other), children));
};
List.propTypes = {
  /**
   * Provide multiple `ListItem` components
   */
  children: PropTypes.node,

  /**
   * Specify a custom className
   */
  className: PropTypes.string,

  /**
   * Specify if colons should be used
   */
  colon: PropTypes.bool,

  /**
   * Specify a kind.
   */
  kind: PropTypes.oneOf(['unstyled', 'simple-inline', 'details', 'unordered', 'ordered', 'tooltip', 'bullets']),

  /**
   * Specify if the List should be small
   */
  small: PropTypes.bool
};
List.defaultProps = {
  kind: 'unstyled',
  colon: false,
  small: false
};
export default List;