import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["spaced", "className", "ordered", "children"];
import classNames from 'classnames';
import * as React from 'react';

var List = function List(_ref) {
  var spaced = _ref.spaced,
      className = _ref.className,
      ordered = _ref.ordered,
      children = _ref.children,
      props = _objectWithoutProperties(_ref, _excluded);

  var listClass = classNames('sg-list', {
    'sg-list--spaced-elements': spaced
  }, className);
  var Tag = ordered ? 'ol' : 'ul';
  return (
    /*#__PURE__*/
    // @ts-expect-error ts migration
    React.createElement(Tag, _extends({}, props, {
      className: listClass,
      role: "list"
    }), children)
  );
};

export default List;