UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

44 lines 1.38 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import React from 'react'; import classnames from 'classnames'; import { removeUndefinedProps } from "../../../../shared/component-helper.js"; import SummaryListContext from "./SummaryListContext.js"; import Dl from "../../../../elements/Dl.js"; import ValueProvider from "../Provider/ValueProvider.js"; import { useVerifyChildren } from "./useVerifyChildren.js"; function SummaryList(props) { const { className, children, layout = 'vertical', transformLabel, inheritVisibility, inheritLabel, ...rest } = props; const valueProviderProps = removeUndefinedProps({ transformLabel, inheritVisibility, inheritLabel }); const { verifyChild } = useVerifyChildren({ children, message: 'Value.SummaryList accepts only Value.* components!', messageInfo: props, ignoreTypes: ['Visibility', 'ValueBlock', 'CompositionValue'] }); 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