@elastic/eui
Version:
Elastic UI Component Library
38 lines (36 loc) • 2.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.euiPopoverTitleStyles = void 0;
var _react = require("@emotion/react");
var _global_styling = require("../../global_styling");
var _title = require("../title/title.styles");
/*
* 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 euiPopoverTitleStyles = exports.euiPopoverTitleStyles = function euiPopoverTitleStyles(euiThemeContext) {
var euiTheme = euiThemeContext.euiTheme;
return {
// Base
euiPopoverTitle: /*#__PURE__*/(0, _react.css)((0, _title.euiTitle)(euiThemeContext, 'xxs'), " ", (0, _global_styling.logicalCSS)('border-bottom', euiTheme.border.thin), ";;label:euiPopoverTitle;"),
// If the popover's containing panel has padding applied,
// ensure the title expands to cover that padding via negative margins
panelPaddingSizes: {
none: /*#__PURE__*/(0, _react.css)(";label:none;"),
xs: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 'xs'), ";;label:xs;"),
s: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 's'), ";;label:s;"),
m: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 'm'), ";;label:m;"),
l: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 'l'), ";;label:l;"),
xl: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 'xl'), ";;label:xl;")
}
};
};
var getPaddingOffset = function getPaddingOffset(euiThemeContext, size) {
var panelPaddingSize = (0, _global_styling.euiPaddingSize)(euiThemeContext, size);
return (0, _global_styling.logicalShorthandCSS)('margin', "-".concat(panelPaddingSize, " -").concat(panelPaddingSize, " ").concat(panelPaddingSize));
};