Debian Codegraph @

node/@patternfly/react-core/dist/js/components/Page/PageGroup.js

raw
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.PageGroup = 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 PageGroup = (_a) => {
12 var { className = '', children, stickyOnBreakpoint, stickyBase, isStickyStuck = false, isFilled, hasShadowTop = false, hasShadowBottom = false, hasOverflowScroll = false, 'aria-label': ariaLabel, isPlain = false, isNoPlainOnGlass = false } = _a, props = tslib_1.__rest(_a, ["className", "children", "stickyOnBreakpoint", "stickyBase", "isStickyStuck", "isFilled", "hasShadowTop", "hasShadowBottom", "hasOverflowScroll", 'aria-label', "isPlain", "isNoPlainOnGlass"]);
13 const { height, getVerticalBreakpoint } = (0, react_1.useContext)(PageContext_1.PageContext);
14 (0, react_1.useEffect)(() => {
15 if (hasOverflowScroll && !ariaLabel) {
16 /* eslint-disable no-console */
17 console.warn('PageGroup: An accessible aria-label is required when hasOverflowScroll is set to true.');
18 }
19 }, [hasOverflowScroll, ariaLabel]);
20 return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, props, { className: (0, react_styles_1.css)(page_1.default.pageMainGroup, (0, util_1.formatBreakpointMods)(stickyOnBreakpoint, page_1.default, 'sticky-', getVerticalBreakpoint(height), true), stickyBase === 'top' && page_1.default.modifiers.stickyTopBase, stickyBase === 'bottom' && page_1.default.modifiers.stickyBottomBase, isStickyStuck && stickyBase === 'top' && page_1.default.modifiers.stickyTopStuck, isStickyStuck && stickyBase === 'bottom' && page_1.default.modifiers.stickyBottomStuck, isFilled === false && page_1.default.modifiers.noFill, isFilled === true && page_1.default.modifiers.fill, hasShadowTop && page_1.default.modifiers.shadowTop, hasShadowBottom && page_1.default.modifiers.shadowBottom, hasOverflowScroll && page_1.default.modifiers.overflowScroll, isPlain && page_1.default.modifiers.plain, isNoPlainOnGlass && page_1.default.modifiers.noPlainOnGlass, className) }, (hasOverflowScroll && { tabIndex: 0, role: 'region', 'aria-label': ariaLabel }), { children: children })));
21 };
22 exports.PageGroup = PageGroup;
23 exports.PageGroup.displayName = 'PageGroup';
24 //# sourceMappingURL=PageGroup.js.map