UNPKG

@carbon/ibm-security

Version:

Carbon for Cloud & Cognitive IBM Security UI components

28 lines (27 loc) 1.16 kB
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["className"]; /** * @file Background. * @copyright IBM Security 2020 - 2021 */ import classnames from 'classnames'; import React from 'react'; import { getComponentNamespace } from '../../globals/namespace'; export default (function (WrappedComponent) { var WithBackground = function WithBackground(_ref) { var className = _ref.className, other = _objectWithoutProperties(_ref, _excluded); return /*#__PURE__*/React.createElement(WrappedComponent, _extends({ className: classnames(getComponentNamespace('background'), className) }, other)); }; var defaultProps = WrappedComponent.defaultProps, wrappedComponentDisplayName = WrappedComponent.displayName, name = WrappedComponent.name, propTypes = WrappedComponent.propTypes; WithBackground.propTypes = propTypes; WithBackground.defaultProps = defaultProps; WithBackground.displayName = "withBackground(".concat(wrappedComponentDisplayName || name || 'Component', ")"); return WithBackground; });