| 1 |
import { __rest } from "tslib"; |
| 2 |
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; |
| 3 |
import { forwardRef } from 'react'; |
| 4 |
import styles from '@patternfly/react-styles/css/components/Menu/menu.mjs'; |
| 5 |
import { css } from '@patternfly/react-styles'; |
| 6 |
const MenuGroupBase = (_a) => { |
| 7 |
var { children, className = '', label, titleId, innerRef, labelHeadingLevel: HeadingLevel = 'h1' } = _a, props = __rest(_a, ["children", "className", "label", "titleId", "innerRef", "labelHeadingLevel"]); |
| 8 |
const Wrapper = typeof label === 'function' ? label : HeadingLevel; |
| 9 |
const hasLabel = label !== undefined && label !== null && label !== ''; |
| 10 |
return (_jsx("section", Object.assign({}, props, { className: css(styles.menuGroup, className), ref: innerRef, children: _jsxs(_Fragment, { children: [hasLabel && (_jsx(_Fragment, { children: ['function', 'string'].includes(typeof label) ? (_jsx(Wrapper, { className: css(styles.menuGroupTitle), id: titleId, children: label })) : (label) })), children] }) }))); |
| 11 |
}; |
| 12 |
export const MenuGroup = forwardRef((props, ref) => (_jsx(MenuGroupBase, Object.assign({}, props, { innerRef: ref })))); |
| 13 |
MenuGroup.displayName = 'MenuGroup'; |
| 14 |
//# sourceMappingURL=MenuGroup.js.map |