@elastic/eui
Version:
Elastic UI Component Library
45 lines (44 loc) • 2.13 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "restrictWidth", "paddingSize", "style", "className"];
/*
* 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 { keysOf } from '../../common';
import { setPropsForRestrictedPageWidth } from '../_restrict_width';
import { jsx as ___EmotionJSX } from "@emotion/react";
var paddingSizeToClassNameMap = {
none: null,
s: 'euiPageContentBody--paddingSmall',
m: 'euiPageContentBody--paddingMedium',
l: 'euiPageContentBody--paddingLarge'
};
export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
/**
* @deprecated Use EuiPageSection instead
*/
export var EuiPageContentBody_Deprecated = function EuiPageContentBody_Deprecated(_ref) {
var children = _ref.children,
_ref$restrictWidth = _ref.restrictWidth,
restrictWidth = _ref$restrictWidth === void 0 ? false : _ref$restrictWidth,
_ref$paddingSize = _ref.paddingSize,
paddingSize = _ref$paddingSize === void 0 ? 'none' : _ref$paddingSize,
style = _ref.style,
className = _ref.className,
rest = _objectWithoutProperties(_ref, _excluded);
var _setPropsForRestricte = setPropsForRestrictedPageWidth(restrictWidth, style),
widthClassName = _setPropsForRestricte.widthClassName,
newStyle = _setPropsForRestricte.newStyle;
var classes = classNames('euiPageContentBody', paddingSizeToClassNameMap[paddingSize], _defineProperty({}, "euiPageContentBody--".concat(widthClassName), widthClassName), className);
return ___EmotionJSX("div", _extends({
className: classes,
style: newStyle || style
}, rest), children);
};