UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

44 lines (43 loc) 1.05 kB
"use client"; import { useContext } from 'react'; import clsx from 'clsx'; import E from "../Element.js"; import Context from "../../shared/Context.js"; import withComponentMarkers from "../../shared/helpers/withComponentMarkers.js"; import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; const Dl = ({ layout, ...props }) => { const context = useContext(Context); if (layout) { props.className = clsx(props.className, `dnb-dl__layout--${layout}`); } if (context?.theme?.surface === 'dark') { props.className = clsx(props.className, 'dnb-dl--surface-dark'); } return _jsx(E, { as: "dl", ...props, skeleton: false }); }; Dl.Item = ({ className, children, ...props }) => { return _jsxs(_Fragment, { children: [children, _jsx(E, { as: "dd", "aria-hidden": true, className: clsx(className, 'dnb-dl__item'), ...props })] }); }; withComponentMarkers(Dl, { _supportsSpacingProps: true }); export default Dl; //# sourceMappingURL=Dl.js.map