Debian Codegraph @

node/@patternfly/react-core/dist/esm/components/Icon/Icon.js

raw
1 import { __rest } from "tslib";
2 import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3 import styles from '@patternfly/react-styles/css/components/Icon/icon.mjs';
4 import { css } from '@patternfly/react-styles';
5 import { Spinner } from '../Spinner';
6 export const Icon = (_a) => {
7 var { children, className, progressIcon, size, iconSize, progressIconSize, status, isInline = false, isInProgress = false, defaultProgressArialabel = 'Loading...', shouldMirrorRTL = false } = _a, props = __rest(_a, ["children", "className", "progressIcon", "size", "iconSize", "progressIconSize", "status", "isInline", "isInProgress", "defaultProgressArialabel", "shouldMirrorRTL"]);
8 const _progressIcon = progressIcon !== null && progressIcon !== void 0 ? progressIcon : _jsx(Spinner, { diameter: "1em", "aria-label": defaultProgressArialabel });
9 return (_jsxs("span", Object.assign({ className: css(styles.icon, isInline && styles.modifiers.inline, isInProgress && styles.modifiers.inProgress, styles.modifiers[size], className) }, props, { children: [_jsx("span", { className: css(styles.iconContent, styles.modifiers[iconSize], styles.modifiers[status], shouldMirrorRTL && 'pf-v6-m-mirror-inline-rtl'), children: children }), isInProgress && (_jsx("span", { className: css(styles.iconProgress, styles.modifiers[progressIconSize], className), children: _progressIcon }))] })));
10 };
11 Icon.displayName = 'Icon';
12 //# sourceMappingURL=Icon.js.map