"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Arrow = exports.Inner = exports.Body = void 0;

var _index = require("../styles/index.js");

var _styledComponents = require("../popover/styled-components.js");

var _utils = require("../popover/utils.js");

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/**
 * We want to reuse the default Popover styles and add our overrides
 * for Tooltip. Normally you could do something like
 * withStyleDeep(StyledPopoverBody, {...}), however this break the
 * ability to use $style properly–the style overrides passed in by
 * the customer will override the base styles but not the styles
 * specified here.
 *
 * We could create our own withStyleDeep that also takes the $style
 * prop into account
 */
var Body = (0, _index.styled)('div', function (props) {
  return _objectSpread({}, (0, _styledComponents.getBodyStyles)(props), {
    // Tooltip
    backgroundColor: props.$theme.tooltip.backgroundColor,
    borderRadius: props.$theme.borders.radius200,
    boxShadow: props.$theme.lighting.shadow400,
    color: props.$theme.colors.mono100,
    // Reset transition property to opacity only, and static transform
    transitionProperty: 'opacity',
    transform: (0, _utils.getEndPosition)(props.$popoverOffset)
  });
});
exports.Body = Body;
Body.displayName = "Body";
var Inner = (0, _index.styled)('div', function (props) {
  return _objectSpread({}, (0, _styledComponents.getInnerStyles)(props), {
    backgroundColor: props.$theme.tooltip.backgroundColor,
    borderRadius: props.$theme.borders.radius200,
    paddingTop: props.$theme.sizing.scale300,
    paddingBottom: props.$theme.sizing.scale300,
    paddingLeft: props.$theme.sizing.scale300,
    paddingRight: props.$theme.sizing.scale300
  }, props.$theme.typography.font250, {
    color: props.$theme.colors.background
  });
});
exports.Inner = Inner;
Inner.displayName = "Inner";
var Arrow = (0, _index.styled)('div', function (props) {
  return _objectSpread({}, (0, _styledComponents.getArrowStyles)(props), {
    backgroundColor: props.$theme.tooltip.backgroundColor
  });
});
exports.Arrow = Arrow;
Arrow.displayName = "Arrow";