UNPKG

@elastic/eui

Version:

Elastic UI Component Library

50 lines (49 loc) 3.14 kB
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. */ import { css } from '@emotion/react'; // .euiSelectableList__list requires a static vanilla className // as it's passed down to react-window's virtualization library import { css as classNameCss } from '@emotion/css'; import { mathWithUnits } from '@elastic/eui-theme-common'; import { euiFocusRing, euiYScrollWithShadows, logicalCSS } from '../../../global_styling'; import { euiTitle } from '../../title/title.styles'; import { euiListItemVariables } from '../../list_item_layout/_list_item_layout.styles'; var _ref = process.env.NODE_ENV === "production" ? { name: "1giu8j5-fullHeight", styles: "flex-grow:1;label:fullHeight;" } : { name: "1giu8j5-fullHeight", styles: "flex-grow:1;label:fullHeight;", toString: _EMOTION_STRINGIFIED_CSS_ERROR__ }; export var euiSelectableListStyles = function euiSelectableListStyles(euiThemeContext) { var euiTheme = euiThemeContext.euiTheme; return { euiSelectableList: /*#__PURE__*/css("&:has(:focus-visible){", euiFocusRing(euiThemeContext, 'outset'), ";};label:euiSelectableList;"), fullHeight: _ref, bordered: /*#__PURE__*/css("overflow:hidden;border:", euiTheme.border.thin, ";border-radius:", euiTheme.border.radius.medium, ";;label:bordered;"), paddingSize: { s: /*#__PURE__*/css("padding:", euiTheme.size.s, ";;label:s;") }, euiSelectableList__list: /*#__PURE__*/classNameCss(euiYScrollWithShadows(euiThemeContext, { hasAnimatedOverflowShadow: true }), " &:focus,&>ul:focus{outline:none;};label:euiSelectableList__list;") }; }; export var euiSelectableListGroupLabelStyles = function euiSelectableListGroupLabelStyles(euiThemeContext) { var euiTheme = euiThemeContext.euiTheme; var itemVars = euiListItemVariables(euiThemeContext); var spacingVertical = euiTheme.size.s; var borderColor = euiTheme.components.selectableListItemBorderColor; return { groupLabel: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xxxs'), " position:relative;display:flex;align-items:center;gap:", itemVars.spacing.horizontal, ";", logicalCSS('padding-horizontal', itemVars.textPadding.horizontal), " ", logicalCSS('padding-vertical', spacingVertical), " &:not(:first-child){", logicalCSS('padding-top', mathWithUnits([spacingVertical], function (a) { return a * 3; })), " &::before{content:'';position:absolute;z-index:-1;inset:0;inset-block-start:", spacingVertical, ";", logicalCSS('border-top', "".concat(euiTheme.border.width.thin, " solid ").concat(borderColor)), ";}};label:groupLabel;") }; };