UNPKG

@engie-group/fluid-design-system-react

Version:

Fluid Design System React

15 lines (12 loc) 1.3 kB
import { jsx, jsxs } from 'react/jsx-runtime'; import { Root as Slot } from '../../node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.js'; import { forwardRef } from 'react'; import { Utils } from '../../utils/util.js'; import { NJHeading } from '../heading/NJHeading.js'; const rootClass = 'nj-sub-header'; const NJSubHeader = forwardRef(({ header, layout, rowsOf, children, footer, featured, seeAllLink, ...htmlAttributes }, ref) => { const className = Utils.classNames(rootClass, layout ? `${rootClass}--${layout}` : !!layout); return (jsx(Slot, { className: className, style: { '--nj-sub-header-rows-of': rowsOf?.toString() }, children: jsxs("div", { ref: ref, ...htmlAttributes, children: [layout !== 'single-column' && (jsxs("div", { className: `${rootClass}__header`, children: [header && jsx(NJHeading, { scale: "md", children: header }), seeAllLink] })), jsxs("div", { className: `${rootClass}__content`, children: [jsx("ul", { className: `${rootClass}__menu`, role: "menu", children: children }), layout === 'single-column' && seeAllLink, featured] }), footer && jsx("div", { className: `${rootClass}__footer`, children: footer })] }) })); }); NJSubHeader.displayName = 'NJSubHeader'; export { NJSubHeader };