UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

45 lines (44 loc) 1.19 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 }) => { var _context$theme; const context = useContext(Context); if (layout) { props.className = clsx(props.className, `dnb-dl__layout--${layout}`); } if ((context === null || context === void 0 || (_context$theme = context.theme) === null || _context$theme === void 0 ? void 0 : _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