Debian Codegraph @

node/@patternfly/react-core/dist/esm/components/Breadcrumb/Breadcrumb.js

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