| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.AlertToggleExpandButton = 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 Button_1 = require("../Button"); |
| 8 |
const AlertContext_1 = require("./AlertContext"); |
| 9 |
const rh_microns_caret_down_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/rh-microns-caret-down-icon')); |
| 10 |
const react_styles_1 = require("@patternfly/react-styles"); |
| 11 |
const alert_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Alert/alert")); |
| 12 |
const AlertToggleExpandButton = (_a) => { |
| 13 |
var { 'aria-label': ariaLabel = '', variantLabel, onToggleExpand, isExpanded = false } = _a, props = tslib_1.__rest(_a, ['aria-label', "variantLabel", "onToggleExpand", "isExpanded"]); |
| 14 |
const { title, variantLabel: alertVariantLabel } = (0, react_1.useContext)(AlertContext_1.AlertContext); |
| 15 |
return ((0, jsx_runtime_1.jsx)(Button_1.Button, Object.assign({ variant: Button_1.ButtonVariant.plain, onClick: onToggleExpand, "aria-expanded": isExpanded, "aria-label": ariaLabel === '' ? `Toggle ${variantLabel || alertVariantLabel} alert: ${title}` : ariaLabel }, props, { icon: (0, jsx_runtime_1.jsx)("span", { className: (0, react_styles_1.css)(alert_1.default.alertToggleIcon), children: (0, jsx_runtime_1.jsx)(rh_microns_caret_down_icon_1.default, {}) }) }))); |
| 16 |
}; |
| 17 |
exports.AlertToggleExpandButton = AlertToggleExpandButton; |
| 18 |
exports.AlertToggleExpandButton.displayName = 'AlertToggleExpandButton'; |
| 19 |
//# sourceMappingURL=AlertToggleExpandButton.js.map |