UNPKG

1.52 kBJavaScriptView Raw
1import { __rest } from "tslib";
2import * as React from 'react';
3import { css } from '@patternfly/react-styles';
4import styles from '@patternfly/react-styles/css/components/Popover/popover';
5import { Title, TitleSizes } from '../Title';
6import { PopoverHeaderIcon } from './PopoverHeaderIcon';
7import { PopoverHeaderText } from './PopoverHeaderText';
8export const PopoverHeader = (_a) => {
9 var { children, icon, className, titleHeadingLevel = 'h6', alertSeverityVariant, id, alertSeverityScreenReaderText } = _a, props = __rest(_a, ["children", "icon", "className", "titleHeadingLevel", "alertSeverityVariant", "id", "alertSeverityScreenReaderText"]);
10 const HeadingLevel = titleHeadingLevel;
11 return icon || alertSeverityVariant ? (React.createElement("header", Object.assign({ className: css('pf-c-popover__header', className), id: id }, props),
12 React.createElement(HeadingLevel, { className: css(styles.popoverTitle, icon && styles.modifiers.icon) },
13 icon && React.createElement(PopoverHeaderIcon, null, icon),
14 alertSeverityVariant && alertSeverityScreenReaderText && (React.createElement("span", { className: "pf-u-screen-reader" }, alertSeverityScreenReaderText)),
15 React.createElement(PopoverHeaderText, null, children)))) : (React.createElement(Title, Object.assign({ headingLevel: titleHeadingLevel, size: TitleSizes.md, id: id, className: className }, props), children));
16};
17PopoverHeader.displayName = 'PopoverHeader';
18//# sourceMappingURL=PopoverHeader.js.map
\No newline at end of file