| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.Breadcrumb = void 0; |
| 4 |
const tslib_1 = require("tslib"); |
| 5 |
const jsx_runtime_1 = require("react/jsx-runtime"); |
| 6 |
const react_1 = require("react"); |
| 7 |
const breadcrumb_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Breadcrumb/breadcrumb")); |
| 8 |
const react_styles_1 = require("@patternfly/react-styles"); |
| 9 |
const helpers_1 = require("../../helpers"); |
| 10 |
const Breadcrumb = (_a) => { |
| 11 |
var { children = null, className = '', 'aria-label': ariaLabel = 'Breadcrumb', ouiaId, ouiaSafe = true } = _a, props = tslib_1.__rest(_a, ["children", "className", 'aria-label', "ouiaId", "ouiaSafe"]); |
| 12 |
const ouiaProps = (0, helpers_1.useOUIAProps)(exports.Breadcrumb.displayName, ouiaId, ouiaSafe); |
| 13 |
return ((0, jsx_runtime_1.jsx)("nav", Object.assign({}, props, { "aria-label": ariaLabel, className: (0, react_styles_1.css)(breadcrumb_1.default.breadcrumb, className) }, ouiaProps, { children: (0, jsx_runtime_1.jsx)("ol", { className: breadcrumb_1.default.breadcrumbList, role: "list", children: react_1.Children.map(children, (child, index) => { |
| 14 |
const showDivider = index > 0; |
| 15 |
if ((0, react_1.isValidElement)(child)) { |
| 16 |
return (0, react_1.cloneElement)(child, { showDivider }); |
| 17 |
} |
| 18 |
return child; |
| 19 |
}) }) }))); |
| 20 |
}; |
| 21 |
exports.Breadcrumb = Breadcrumb; |
| 22 |
exports.Breadcrumb.displayName = 'Breadcrumb'; |
| 23 |
//# sourceMappingURL=Breadcrumb.js.map |