var _excluded = ["label", "ariaLabel", "maxWidth", "backgroundColor", "borderColor", "invertedColors", "bottomSheetTitle", "onBottomSheetClose"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import styled from 'styled-components';
import { BORDER_SIZE } from '../consts';
import { Box, Button, Flexbox, Icon, Typography } from '../../..';
var StyledTooltip = styled.div.withConfig({
  displayName: "TooltipContent__StyledTooltip",
  componentId: "sc-1x7e7gl-0"
})(["padding:", "px ", "px;box-shadow:0 10px 16px ", ";background:", ";border:solid ", "px ", ";", " overflow-wrap:break-word;border-radius:", ";", ""], function (p) {
  return p.theme.spacing.unit(1);
}, function (p) {
  return p.theme.spacing.unit(2);
}, function (p) {
  return p.theme.color.shadowModal;
}, function (p) {
  return p.backgroundColor(p.theme);
}, BORDER_SIZE, function (p) {
  return p.borderColor(p.theme);
}, function (p) {
  return p.maxWidth ? "max-width: ".concat(p.theme.spacing.unit(p.maxWidth), "px;") : '';
}, function (p) {
  return p.theme.borderRadius4;
}, function (p) {
  return p.bottomSheet && "\n        width: 100%;\n        max-width: none;\n        box-sizing: border-box;\n        border-radius: ".concat(p.theme.borderRadius20, " ").concat(p.theme.borderRadius20, " 0px 0px;\n    ");
});
var StyledBottomSheetTitle = styled(Typography).withConfig({
  displayName: "TooltipContent__StyledBottomSheetTitle",
  componentId: "sc-1x7e7gl-1"
})(["font-weight:900;"]);
var TooltipContent = function TooltipContent(_ref) {
  var label = _ref.label,
    ariaLabel = _ref.ariaLabel,
    maxWidth = _ref.maxWidth,
    backgroundColor = _ref.backgroundColor,
    borderColor = _ref.borderColor,
    invertedColors = _ref.invertedColors,
    bottomSheetTitle = _ref.bottomSheetTitle,
    onBottomSheetClose = _ref.onBottomSheetClose,
    htmlDivProps = _objectWithoutProperties(_ref, _excluded);
  return React.createElement(StyledTooltip, _extends({
    maxWidth: maxWidth,
    "aria-label": ariaLabel,
    role: ariaLabel ? 'tooltip' : undefined,
    backgroundColor: backgroundColor,
    borderColor: borderColor
  }, htmlDivProps), bottomSheetTitle && htmlDivProps.bottomSheet ? React.createElement(Box, {
    p: 5
  }, React.createElement(Typography, {
    type: "tertiary",
    color: function color(c) {
      return invertedColors ? c.color.textLight : c.color.text;
    }
  }, React.createElement(Box, {
    pb: 5
  }, React.createElement(Flexbox, {
    container: true,
    justifyContent: "space-between"
  }, React.createElement(StyledBottomSheetTitle, {
    type: "title2"
  }, bottomSheetTitle), React.createElement(Button, {
    variant: "neutral",
    onClick: onBottomSheetClose
  }, React.createElement(Icon.Cross24, null)))), label)) : React.createElement(Typography, {
    type: "tertiary",
    color: function color(c) {
      return invertedColors ? c.color.textLight : c.color.text;
    }
  }, label));
};
export default TooltipContent;