1 | import { __rest } from "tslib";
|
2 | import * as React from 'react';
|
3 | import styles from '@patternfly/react-styles/css/components/Nav/nav';
|
4 | import { css } from '@patternfly/react-styles';
|
5 | import { getUniqueId } from '../../helpers/util';
|
6 | export const NavGroup = (_a) => {
|
7 | var { title, children = null, className = '', id = getUniqueId() } = _a, props = __rest(_a, ["title", "children", "className", "id"]);
|
8 | if (!title && !props['aria-label']) {
|
9 |
|
10 | console.warn("For accessibility reasons an aria-label should be specified on nav groups if a title isn't");
|
11 | }
|
12 | const labelledBy = title ? id : undefined;
|
13 | return (React.createElement("section", Object.assign({ className: css(styles.navSection, className), "aria-labelledby": labelledBy }, props),
|
14 | title && (React.createElement("h2", { className: css(styles.navSectionTitle), id: id }, title)),
|
15 | React.createElement("ul", { className: css(styles.navList, className) }, children)));
|
16 | };
|
17 | NavGroup.displayName = 'NavGroup';
|
18 |
|
\ | No newline at end of file |