UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

29 lines 890 B
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; const _excluded = ["className"]; import React from 'react'; import classnames from 'classnames'; import E from '../Element'; import Ul from './Ul'; import Ol from './Ol'; const Li = function () { let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; let { className } = _ref, props = _objectWithoutProperties(_ref, _excluded); if (Array.isArray(props.children)) { props.children.forEach(Comp => { if (Comp && (Comp.type === Ul || Comp.type === Ol)) { className = classnames(className, 'is-nested'); } }); } return React.createElement(E, _extends({ as: "li" }, props, { className: className })); }; export default Li; //# sourceMappingURL=Li.js.map