"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "ListItem", {
  enumerable: true,
  get: function get() {
    return _ListItem["default"];
  }
});
exports["default"] = exports.List = void 0;

var _core = require("@emotion/core");

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

var _styledBase = _interopRequireDefault(require("@emotion/styled-base"));

var React = _interopRequireWildcard(require("react"));

var _List = _interopRequireDefault(require("./List.styles"));

var _ListItem = _interopRequireDefault(require("./ListItem"));

var ListOrigin = (0, _styledBase["default"])("ul", {
  target: "e6j0s6y0",
  label: "ListOrigin"
})(_List["default"].base, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0xpc3QvTGlzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSzRCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0xpc3QvTGlzdC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBSZWFjdCBmcm9tICdyZWFjdCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHN0eWxlcyBmcm9tICcuL0xpc3Quc3R5bGVzJ1xuaW1wb3J0IExpc3RJdGVtLCB7IFByb3BzIH0gZnJvbSAnLi9MaXN0SXRlbSdcblxuY29uc3QgTGlzdE9yaWdpbiA9IHN0eWxlZC51bGBcbiAgJHtzdHlsZXMuYmFzZX1cbmBcblxuY29uc3QgTGlzdDogUmVhY3QuRkM8UHJvcHM+ID0gcHJvcHMgPT4ge1xuICBjb25zdCBwcm9jZXNzQ2hpbGQgPSAoY2hpbGQ6IFJlYWN0LlJlYWN0Q2hpbGQpID0+IHtcbiAgICBpZiAodHlwZW9mIGNoaWxkID09PSAnb2JqZWN0JyAmJiAoY2hpbGQudHlwZSBhcyBhbnkpLmlzRGVzaWduQ29yZUxpc3RJdGVtKSB7XG4gICAgICByZXR1cm4gUmVhY3QuY2xvbmVFbGVtZW50KGNoaWxkLCB7IHNpemU6IGNoaWxkLnByb3BzLnNpemUgfHwgcHJvcHMuc2l6ZSB9KVxuICAgIH1cblxuICAgIHJldHVybiBjaGlsZFxuICB9XG5cbiAgY29uc3QgY2hpbGRyZW4gPSBSZWFjdC5DaGlsZHJlbi5tYXAocHJvcHMuY2hpbGRyZW4sIHByb2Nlc3NDaGlsZClcblxuICByZXR1cm4gPExpc3RPcmlnaW4gey4uLnByb3BzfT57Y2hpbGRyZW59PC9MaXN0T3JpZ2luPlxufVxuXG5MaXN0LmRlZmF1bHRQcm9wcyA9IHtcbiAgc2l6ZTogJ3MnLFxufSBhcyBQcm9wc1xuXG5leHBvcnQgeyBMaXN0LCBMaXN0SXRlbSB9XG5leHBvcnQgZGVmYXVsdCBMaXN0XG4iXX0= */");

var List = function List(props) {
  var processChild = function processChild(child) {
    if ((0, _typeof2["default"])(child) === 'object' && child.type.isDesignCoreListItem) {
      return React.cloneElement(child, {
        size: child.props.size || props.size
      });
    }

    return child;
  };

  var children = React.Children.map(props.children, processChild);
  return (0, _core.jsx)(ListOrigin, props, children);
};

exports.List = List;
List.defaultProps = {
  size: 's'
};
var _default = List;
exports["default"] = _default;