1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.Spinner = exports.spinnerSize = void 0;
|
4 | const tslib_1 = require("tslib");
|
5 | const React = tslib_1.__importStar(require("react"));
|
6 | const spinner_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Spinner/spinner"));
|
7 | const react_styles_1 = require("@patternfly/react-styles");
|
8 | var spinnerSize;
|
9 | (function (spinnerSize) {
|
10 | spinnerSize["sm"] = "sm";
|
11 | spinnerSize["md"] = "md";
|
12 | spinnerSize["lg"] = "lg";
|
13 | spinnerSize["xl"] = "xl";
|
14 | })(spinnerSize = exports.spinnerSize || (exports.spinnerSize = {}));
|
15 | const Spinner = (_a) => {
|
16 | var {
|
17 |
|
18 | className = '', size = 'xl', 'aria-valuetext': ariaValueText = 'Loading...', isSVG = false, diameter, 'aria-label': ariaLabel, 'aria-labelledBy': ariaLabelledBy } = _a, props = tslib_1.__rest(_a, ["className", "size", 'aria-valuetext', "isSVG", "diameter", 'aria-label', 'aria-labelledBy']);
|
19 | const Component = isSVG ? 'svg' : 'span';
|
20 | return (React.createElement(Component, Object.assign({ className: react_styles_1.css(spinner_1.default.spinner, spinner_1.default.modifiers[size], className), role: "progressbar", "aria-valuetext": ariaValueText }, (isSVG && { viewBox: '0 0 100 100' }), (diameter && { style: { '--pf-c-spinner--diameter': diameter } }), (ariaLabel && { 'aria-label': ariaLabel }), (ariaLabelledBy && { 'aria-labelledBy': ariaLabelledBy }), (!ariaLabel && !ariaLabelledBy && { 'aria-label': 'Contents' }), props), isSVG ? (React.createElement("circle", { className: spinner_1.default.spinnerPath, cx: "50", cy: "50", r: "45", fill: "none" })) : (React.createElement(React.Fragment, null,
|
21 | React.createElement("span", { className: react_styles_1.css(spinner_1.default.spinnerClipper) }),
|
22 | React.createElement("span", { className: react_styles_1.css(spinner_1.default.spinnerLeadBall) }),
|
23 | React.createElement("span", { className: react_styles_1.css(spinner_1.default.spinnerTailBall) })))));
|
24 | };
|
25 | exports.Spinner = Spinner;
|
26 | exports.Spinner.displayName = 'Spinner';
|
27 |
|
\ | No newline at end of file |