@node-core/ui-components 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Common/Banner/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import styles from './index.module.css';
|
|
3
|
-
const Banner = ({ type = 'default', children, }) => (_jsx("
|
|
3
|
+
const Banner = ({ type = 'default', children, ...props }) => (_jsx("section", { className: `${styles.banner} ${styles[type] || styles.default}`, ...props, children: children }));
|
|
4
4
|
export default Banner;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment, useMemo } from 'react';
|
|
3
3
|
import styles from './index.module.css';
|
|
4
|
-
const MetaBar = ({ items, headings, as: Component = 'a', heading, }) => {
|
|
4
|
+
const MetaBar = ({ items, headings, as: Component = 'a', heading, ...props }) => {
|
|
5
5
|
// The default depth of headings to display in the table of contents.
|
|
6
6
|
const { minDepth = 2, items: headingItems = [] } = headings || {};
|
|
7
7
|
const filteredHeadings = useMemo(() => headingItems.filter(({ depth }) => depth >= minDepth && depth <= 4), [minDepth, headingItems]);
|
|
8
|
-
return (_jsx("
|
|
8
|
+
return (_jsx("aside", { className: styles.wrapper, ...props, children: _jsxs("dl", { children: [Object.entries(items)
|
|
9
9
|
.filter(([, value]) => !!value)
|
|
10
10
|
.map(([key, value]) => (_jsxs(Fragment, { children: [_jsx("dt", { children: key }), _jsx("dd", { children: value })] }, key))), filteredHeadings.length > 0 && (_jsxs(_Fragment, { children: [_jsx("dt", { children: heading }), _jsx("dd", { children: _jsx("ol", { children: filteredHeadings.map(head => (_jsx("li", { className: head.depth === 3 ? 'pl-2' : head.depth === 4 ? 'pl-4' : '', children: _jsxs(Component, { href: `#${head.data?.id}`, children: [' ', head.value] }) }, head.data?.id))) }) })] }))] }) }));
|
|
11
11
|
};
|