spinners-react
Version:
Lightweight SVG/CSS spinners for React
24 lines (20 loc) • 1.24 kB
JavaScript
import { w as withSharedProps, _ as __rest, a as __assign } from './withSharedProps-KvHSGnzu.js';
import React from 'react';
import { s as styleInject, d as defaultProps } from './style-inject.es-CuJ1gXUq.js';
var css_248z = "@keyframes spinners-react-round{27%,73%{r:2px;stroke-width:4}}";
styleInject(css_248z);
function Component(_a) {
var _b = _a.speed, speed = _b === void 0 ? defaultProps.speed : _b, _c = _a.still, still = _c === void 0 ? defaultProps.still : _c, _d = _a.thickness, thickness = _d === void 0 ? defaultProps.thickness : _d, svgProps = __rest(_a, ["speed", "still", "thickness"]);
var strokeWidth = 3 * (thickness / 100);
var circleStyle = {
animation: "spinners-react-round ".concat(140 / speed, "s ease-in-out infinite"),
transformOrigin: 'center',
};
if (still)
circleStyle.animation = 'none';
return (React.createElement("svg", __assign({ fill: "none" }, svgProps, { viewBox: "0 0 66 66" }),
React.createElement("circle", { cx: "33", cy: "33", fill: "none", r: 28, stroke: "currentColor", strokeWidth: strokeWidth, style: circleStyle })));
}
var SpinnerRound = withSharedProps(Component);
export { SpinnerRound };
//# sourceMappingURL=SpinnerRound.js.map