| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.PageBreadcrumb = 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 react_styles_1 = require("@patternfly/react-styles"); |
| 8 |
const page_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Page/page")); |
| 9 |
const util_1 = require("../../helpers/util"); |
| 10 |
const PageContext_1 = require("./PageContext"); |
| 11 |
const PageBody_1 = require("./PageBody"); |
| 12 |
const PageBreadcrumb = (_a) => { |
| 13 |
var { className = '', children, isWidthLimited, stickyOnBreakpoint, hasShadowTop = false, hasShadowBottom = false, hasOverflowScroll = false, 'aria-label': ariaLabel, hasBodyWrapper = true } = _a, props = tslib_1.__rest(_a, ["className", "children", "isWidthLimited", "stickyOnBreakpoint", "hasShadowTop", "hasShadowBottom", "hasOverflowScroll", 'aria-label', "hasBodyWrapper"]); |
| 14 |
const { height, getVerticalBreakpoint } = (0, react_1.useContext)(PageContext_1.PageContext); |
| 15 |
(0, react_1.useEffect)(() => { |
| 16 |
if (hasOverflowScroll && !ariaLabel) { |
| 17 |
/* eslint-disable no-console */ |
| 18 |
console.warn('PageBreadcrumb: An accessible aria-label is required when hasOverflowScroll is set to true.'); |
| 19 |
} |
| 20 |
}, [hasOverflowScroll, ariaLabel]); |
| 21 |
return ((0, jsx_runtime_1.jsx)("section", Object.assign({ className: (0, react_styles_1.css)(page_1.default.pageMainBreadcrumb, (0, util_1.formatBreakpointMods)(stickyOnBreakpoint, page_1.default, 'sticky-', getVerticalBreakpoint(height), true), isWidthLimited && page_1.default.modifiers.limitWidth, hasShadowTop && page_1.default.modifiers.shadowTop, hasShadowBottom && page_1.default.modifiers.shadowBottom, hasOverflowScroll && page_1.default.modifiers.overflowScroll, className) }, (hasOverflowScroll && { tabIndex: 0 }), { "aria-label": ariaLabel }, props, { children: hasBodyWrapper ? (0, jsx_runtime_1.jsx)(PageBody_1.PageBody, { children: children }) : children }))); |
| 22 |
}; |
| 23 |
exports.PageBreadcrumb = PageBreadcrumb; |
| 24 |
exports.PageBreadcrumb.displayName = 'PageBreadcrumb'; |
| 25 |
//# sourceMappingURL=PageBreadcrumb.js.map |