@elastic/eui
Version:
Elastic UI Component Library
41 lines (40 loc) • 1.75 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "className", "banner"];
/*
* 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 React from 'react';
import classNames from 'classnames';
import { useEuiTheme } from '../../services';
import { euiFlyoutBodyStyles } from './flyout_body.styles';
import { jsx as ___EmotionJSX } from "@emotion/react";
export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
var children = _ref.children,
className = _ref.className,
banner = _ref.banner,
rest = _objectWithoutProperties(_ref, _excluded);
var classes = classNames('euiFlyoutBody', className);
var euiTheme = useEuiTheme();
var styles = euiFlyoutBodyStyles(euiTheme);
var cssStyles = [styles.euiFlyoutBody];
var bannerCssStyles = [banner && styles.euiFlyoutBody__banner];
var overflowCssStyles = [banner ? styles.euiFlyoutBody__overflow.hasBanner : styles.euiFlyoutBody__overflow.noBanner];
return ___EmotionJSX("div", _extends({
className: classes,
css: cssStyles
}, rest), ___EmotionJSX("div", {
tabIndex: 0,
className: "euiFlyoutBody__overflow",
css: overflowCssStyles
}, banner && ___EmotionJSX("div", {
className: "euiFlyoutBody__banner",
css: bannerCssStyles
}, banner), ___EmotionJSX("div", {
className: "euiFlyoutBody__overflowContent"
}, children)));
};