UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

46 lines 1.6 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; const _excluded = ["className", "children", "layout", "transformLabel", "inheritVisibility", "inheritLabel"]; import React from 'react'; import classnames from 'classnames'; import { removeUndefinedProps } from '../../../../shared/component-helper'; import SummaryListContext from './SummaryListContext'; import Dl from '../../../../elements/Dl'; import ValueProvider from '../Provider/ValueProvider'; import { useVerifyChildren } from './useVerifyChildren'; function SummaryList(props) { const { className, children, layout = 'vertical', transformLabel, inheritVisibility, inheritLabel } = props, rest = _objectWithoutProperties(props, _excluded); const valueProviderProps = removeUndefinedProps({ transformLabel, inheritVisibility, inheritLabel }); const { verifyChild } = useVerifyChildren({ children, message: 'Value.SummaryList accepts only Value.* components!', messageInfo: props, ignoreTypes: ['Visibility', 'ValueBlock'] }); return React.createElement(SummaryListContext.Provider, { value: { layout, verifyChild } }, React.createElement(Dl, _extends({ className: classnames('dnb-forms-summary-list', className), layout: layout }, rest), React.createElement(ValueProvider, valueProviderProps, children))); } SummaryList._supportsSpacingProps = true; export default SummaryList; //# sourceMappingURL=SummaryList.js.map