Debian Codegraph @

node/@patternfly/react-core/dist/js/components/Modal/ModalHeader.js

raw
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.ModalHeader = void 0;
4 const tslib_1 = require("tslib");
5 const jsx_runtime_1 = require("react/jsx-runtime");
6 const react_styles_1 = require("@patternfly/react-styles");
7 const modal_box_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/ModalBox/modal-box"));
8 const ModalBoxDescription_1 = require("./ModalBoxDescription");
9 const ModalBoxTitle_1 = require("./ModalBoxTitle");
10 const ModalHeader = (_a) => {
11 var { children, className, descriptorId, description, labelId, title, titleIconVariant, titleScreenReaderText, help } = _a, props = tslib_1.__rest(_a, ["children", "className", "descriptorId", "description", "labelId", "title", "titleIconVariant", "titleScreenReaderText", "help"]);
12 const headerContent = children ? (children) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ModalBoxTitle_1.ModalBoxTitle, { title: title, titleIconVariant: titleIconVariant, titleScreenReaderText: titleScreenReaderText, id: labelId }), description && (0, jsx_runtime_1.jsx)(ModalBoxDescription_1.ModalBoxDescription, { id: descriptorId, children: description })] }));
13 return ((0, jsx_runtime_1.jsxs)("header", Object.assign({ className: (0, react_styles_1.css)(modal_box_1.default.modalBoxHeader, help && modal_box_1.default.modifiers.help, className) }, props, { children: [help && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: (0, react_styles_1.css)(modal_box_1.default.modalBoxHeaderMain), children: headerContent }), (0, jsx_runtime_1.jsx)("div", { className: `${modal_box_1.default.modalBoxHeader}-help`, children: help })] })), !help && headerContent] })));
14 };
15 exports.ModalHeader = ModalHeader;
16 exports.ModalHeader.displayName = 'ModalHeader';
17 //# sourceMappingURL=ModalHeader.js.map