UNPKG

@elastic/eui

Version:

Elastic UI Component Library

90 lines (89 loc) 5.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.euiToolTipStyles = exports.euiToolTipBorderColor = exports.euiToolTipBackgroundColor = exports.euiToolTipAnchorStyles = void 0; var _react = require("@emotion/react"); var _euiThemeCommon = require("@elastic/eui-theme-common"); var _global_styling = require("../../global_styling"); var _popover = require("../../services/popover"); var _panel = require("../panel/panel.styles"); var _templateObject; function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ var euiToolTipBackgroundColor = exports.euiToolTipBackgroundColor = function euiToolTipBackgroundColor(euiTheme) { return euiTheme.components.tooltipBackground; }; var euiToolTipBorderColor = exports.euiToolTipBorderColor = function euiToolTipBorderColor(euiTheme) { return euiTheme.components.tooltipBorder; }; var euiToolTipAnimation = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from { opacity: 0; }\n to { opacity: 1; }\n"]))); var euiToolTipStyles = exports.euiToolTipStyles = function euiToolTipStyles(euiThemeContext) { var euiTheme = euiThemeContext.euiTheme, highContrastMode = euiThemeContext.highContrastMode; var hasShadow = !highContrastMode; var arrowSize = euiTheme.size.m; var arrowStyles = (0, _popover._popoverArrowStyles)(euiThemeContext, arrowSize); return { // Base euiToolTip: /*#__PURE__*/(0, _react.css)(hasShadow ? (0, _euiThemeCommon.euiShadow)(euiThemeContext) : '', " border-radius:", euiTheme.border.radius.medium, ";background-color:", euiToolTipBackgroundColor(euiTheme), ";color:", euiTheme.colors.textGhost, ";z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('max-width', '256px'), " overflow-wrap:break-word;padding:", euiTheme.size.s, ";", (0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), " position:absolute;pointer-events:none;", (0, _panel.euiPanelBorderStyles)(euiThemeContext), " [class*='euiHorizontalRule']{background-color:", euiToolTipBorderColor(euiTheme), ";}", _euiThemeCommon.euiCanAnimate, "{animation:", euiToolTipAnimation, " ", euiTheme.animation.extraFast, " ease-out ", euiTheme.animation.fast, " both;};label:euiToolTip;"), // Positions - kept for component compatibility. Animation is in the base style. top: /*#__PURE__*/(0, _react.css)(";label:top;"), bottom: /*#__PURE__*/(0, _react.css)(";label:bottom;"), left: /*#__PURE__*/(0, _react.css)(";label:left;"), right: /*#__PURE__*/(0, _react.css)(";label:right;"), // Arrow euiToolTip__arrow: /*#__PURE__*/(0, _react.css)(arrowStyles._arrowStyles, " background-color:inherit;;label:euiToolTip__arrow;"), arrowPositions: arrowStyles.positions, // Title euiToolTip__title: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.bold, ";", (0, _global_styling.logicalCSS)('border-bottom', "solid ".concat(euiTheme.border.width.thin, " ").concat(euiToolTipBorderColor(euiTheme))), " ", (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), " ", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.xs), ";;label:euiToolTip__title;") }; }; var _ref = process.env.NODE_ENV === "production" ? { name: "1cjglks-flex", styles: "display:flex;label:flex;" } : { name: "1cjglks-flex", styles: "display:flex;label:flex;", toString: _EMOTION_STRINGIFIED_CSS_ERROR__ }; var _ref2 = process.env.NODE_ENV === "production" ? { name: "fzilnk-inlineBlock", styles: "display:inline-block;label:inlineBlock;" } : { name: "fzilnk-inlineBlock", styles: "display:inline-block;label:inlineBlock;", toString: _EMOTION_STRINGIFIED_CSS_ERROR__ }; var _ref3 = process.env.NODE_ENV === "production" ? { name: "14aceuy-block", styles: "display:block;label:block;" } : { name: "14aceuy-block", styles: "display:block;label:block;", toString: _EMOTION_STRINGIFIED_CSS_ERROR__ }; var _ref4 = process.env.NODE_ENV === "production" ? { name: "1s3i3p5-euiToolTipAnchor", styles: "*[disabled]{pointer-events:none;};label:euiToolTipAnchor;" } : { name: "1s3i3p5-euiToolTipAnchor", styles: "*[disabled]{pointer-events:none;};label:euiToolTipAnchor;", toString: _EMOTION_STRINGIFIED_CSS_ERROR__ }; var euiToolTipAnchorStyles = exports.euiToolTipAnchorStyles = function euiToolTipAnchorStyles() { return { // Elements euiToolTipAnchor: _ref4, // Variants block: _ref3, inlineBlock: _ref2, flex: _ref }; };