"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _consts = require("../consts");
var _ = require("../../..");
var _excluded = ["label", "ariaLabel", "maxWidth", "backgroundColor", "borderColor", "invertedColors"];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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; }
var StyledTooltip = _styledComponents.default.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);
}, _consts.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;
});
var TooltipContent = function TooltipContent(_ref) {
  var label = _ref.label,
    ariaLabel = _ref.ariaLabel,
    maxWidth = _ref.maxWidth,
    backgroundColor = _ref.backgroundColor,
    borderColor = _ref.borderColor,
    invertedColors = _ref.invertedColors,
    htmlDivProps = _objectWithoutProperties(_ref, _excluded);
  return _react.default.createElement(StyledTooltip, _extends({
    maxWidth: maxWidth,
    "aria-label": ariaLabel,
    role: ariaLabel ? 'tooltip' : undefined,
    backgroundColor: backgroundColor,
    borderColor: borderColor
  }, htmlDivProps), _react.default.createElement(_.Typography, {
    type: "tertiary",
    color: function color(c) {
      return invertedColors ? c.color.textLight : c.color.text;
    }
  }, label));
};
var _default = exports.default = TooltipContent;