@coreui/react
Version:
UI Components Library for React.js
30 lines (26 loc) • 1.42 kB
JavaScript
var tslib_es6 = require('../../node_modules/tslib/tslib.es6.js');
var React = require('react');
var PropTypes = require('prop-types');
var index = require('../../_virtual/index.js');
var props = require('../../props.js');
var CSpinner = React.forwardRef(function (_a, ref) {
var _b;
var _c = _a.as, Component = _c === void 0 ? 'div' : _c, className = _a.className, color = _a.color, size = _a.size, _d = _a.variant, variant = _d === void 0 ? 'border' : _d, _e = _a.visuallyHiddenLabel, visuallyHiddenLabel = _e === void 0 ? 'Loading...' : _e, rest = tslib_es6.__rest(_a, ["as", "className", "color", "size", "variant", "visuallyHiddenLabel"]);
return (React.createElement(Component, tslib_es6.__assign({ className: index.default("spinner-".concat(variant), (_b = {},
_b["spinner-".concat(variant, "-").concat(size)] = size,
_b["text-".concat(color)] = color,
_b), className), role: "status" }, rest, { ref: ref }),
React.createElement("span", { className: "visually-hidden" }, visuallyHiddenLabel)));
});
CSpinner.propTypes = {
as: PropTypes.string,
className: PropTypes.string,
color: props.colorPropType,
size: PropTypes.oneOf(['sm']),
variant: PropTypes.oneOf(['border', 'grow']),
visuallyHiddenLabel: PropTypes.string,
};
CSpinner.displayName = 'CSpinner';
exports.CSpinner = CSpinner;
//# sourceMappingURL=CSpinner.js.map
;