| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.Icon = void 0; |
| 4 |
const tslib_1 = require("tslib"); |
| 5 |
const jsx_runtime_1 = require("react/jsx-runtime"); |
| 6 |
const icon_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Icon/icon")); |
| 7 |
const react_styles_1 = require("@patternfly/react-styles"); |
| 8 |
const Spinner_1 = require("../Spinner"); |
| 9 |
const Icon = (_a) => { |
| 10 |
var { children, className, progressIcon, size, iconSize, progressIconSize, status, isInline = false, isInProgress = false, defaultProgressArialabel = 'Loading...', shouldMirrorRTL = false } = _a, props = tslib_1.__rest(_a, ["children", "className", "progressIcon", "size", "iconSize", "progressIconSize", "status", "isInline", "isInProgress", "defaultProgressArialabel", "shouldMirrorRTL"]); |
| 11 |
const _progressIcon = progressIcon !== null && progressIcon !== void 0 ? progressIcon : (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { diameter: "1em", "aria-label": defaultProgressArialabel }); |
| 12 |
return ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: (0, react_styles_1.css)(icon_1.default.icon, isInline && icon_1.default.modifiers.inline, isInProgress && icon_1.default.modifiers.inProgress, icon_1.default.modifiers[size], className) }, props, { children: [(0, jsx_runtime_1.jsx)("span", { className: (0, react_styles_1.css)(icon_1.default.iconContent, icon_1.default.modifiers[iconSize], icon_1.default.modifiers[status], shouldMirrorRTL && 'pf-v6-m-mirror-inline-rtl'), children: children }), isInProgress && ((0, jsx_runtime_1.jsx)("span", { className: (0, react_styles_1.css)(icon_1.default.iconProgress, icon_1.default.modifiers[progressIconSize], className), children: _progressIcon }))] }))); |
| 13 |
}; |
| 14 |
exports.Icon = Icon; |
| 15 |
exports.Icon.displayName = 'Icon'; |
| 16 |
//# sourceMappingURL=Icon.js.map |