import _extends from "@babel/runtime/helpers/esm/extends";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["children", "onClose", "size", "lead", "fill", "modal", "withBugbox", "smallSpaced", "splashScreen", "limitedWidth", "row", "noPadding", "transparent", "className", "onCloseButtonKeyDown"];
import * as React from 'react';
import classnames from 'classnames';
import Icon, { ICON_COLOR } from '../icons/Icon';
export var SIZE = {
  SMALL: 'small',
  MEDIUM: 'medium',
  LARGE: 'large'
};

var TopLayer = function TopLayer(props) {
  var children = props.children,
      onClose = props.onClose,
      size = props.size,
      lead = props.lead,
      fill = props.fill,
      modal = props.modal,
      withBugbox = props.withBugbox,
      smallSpaced = props.smallSpaced,
      splashScreen = props.splashScreen,
      limitedWidth = props.limitedWidth,
      row = props.row,
      noPadding = props.noPadding,
      transparent = props.transparent,
      className = props.className,
      onCloseButtonKeyDown = props.onCloseButtonKeyDown,
      additionalProps = _objectWithoutProperties(props, _excluded);

  var topLayerClassName = classnames('sg-toplayer', _defineProperty({
    'sg-toplayer--lead': lead,
    'sg-toplayer--fill': fill,
    'sg-toplayer--modal': modal,
    'sg-toplayer--with-bugbox': withBugbox,
    'sg-toplayer--small-spaced': smallSpaced,
    'sg-toplayer--splash-screen': splashScreen,
    'sg-toplayer--limited-width': limitedWidth,
    'sg-toplayer--row': row,
    'sg-toplayer--transparent': transparent
  }, "sg-toplayer--".concat(String(size)), size), className);
  var toplayerWrapperClassName = classnames('sg-toplayer__wrapper', {
    'sg-toplayer__wrapper--no-padding': noPadding
  });
  return /*#__PURE__*/React.createElement("div", _extends({}, additionalProps, {
    className: topLayerClassName
  }), onClose ? /*#__PURE__*/React.createElement("div", {
    className: "sg-toplayer__close",
    onClick: onClose,
    onKeyDown: onCloseButtonKeyDown,
    role: "button",
    tabIndex: 0
  }, /*#__PURE__*/React.createElement(Icon, {
    type: "close",
    color: ICON_COLOR['icon-gray-50'],
    size: 24
  })) : null, /*#__PURE__*/React.createElement("div", {
    className: toplayerWrapperClassName
  }, children));
};

export default TopLayer;