UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

28 lines 1.04 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; const _excluded = ["className", "children", "context", "skeleton"]; import React from 'react'; import classnames from 'classnames'; import { createSkeletonClass } from '../../components/skeleton/SkeletonHelper'; const SuffixContext = React.createContext(null); const Suffix = _ref => { let { className, children, context, skeleton } = _ref, props = _objectWithoutProperties(_ref, _excluded); const content = React.createElement("span", _extends({ className: classnames('dnb-suffix', className, !React.isValidElement(children) && createSkeletonClass('font', skeleton, context)) }, props), children); if (typeof children !== 'string' && context) { return React.createElement(SuffixContext.Provider, { value: context }, content); } return content; }; export { SuffixContext }; export default Suffix; //# sourceMappingURL=Suffix.js.map