UNPKG

1.12 kBJavaScriptView Raw
1import { __rest } from "tslib";
2import * as React from 'react';
3import styles from '@patternfly/react-styles/css/components/Breadcrumb/breadcrumb';
4import { css } from '@patternfly/react-styles';
5import { useOUIAProps } from '../../helpers';
6export const Breadcrumb = (_a) => {
7 var { children = null, className = '', 'aria-label': ariaLabel = 'Breadcrumb', ouiaId, ouiaSafe = true } = _a, props = __rest(_a, ["children", "className", 'aria-label', "ouiaId", "ouiaSafe"]);
8 const ouiaProps = useOUIAProps(Breadcrumb.displayName, ouiaId, ouiaSafe);
9 return (React.createElement("nav", Object.assign({}, props, { "aria-label": ariaLabel, className: css(styles.breadcrumb, className) }, ouiaProps),
10 React.createElement("ol", { className: styles.breadcrumbList }, React.Children.map(children, (child, index) => {
11 const showDivider = index > 0;
12 if (React.isValidElement(child)) {
13 return React.cloneElement(child, { showDivider });
14 }
15 return child;
16 }))));
17};
18Breadcrumb.displayName = 'Breadcrumb';
19//# sourceMappingURL=Breadcrumb.js.map
\No newline at end of file