spinners-react
Version:
Lightweight SVG/CSS spinners for React
22 lines (18 loc) • 1.62 kB
JavaScript
import { w as withSharedProps, _ as __rest, a as __assign } from './withSharedProps-KvHSGnzu.js';
import React from 'react';
import { s as styleInject, a as secondaryColorDefaultProps } from './style-inject.es-CuJ1gXUq.js';
var css_248z = "@keyframes spinners-react-circular-fixed{0%{stroke-dashoffset:325}to{stroke-dashoffset:151}}";
styleInject(css_248z);
function Component(_a) {
var _b = _a.secondaryColor, secondaryColor = _b === void 0 ? secondaryColorDefaultProps.secondaryColor : _b, _c = _a.speed, speed = _c === void 0 ? secondaryColorDefaultProps.speed : _c, _d = _a.still, still = _d === void 0 ? secondaryColorDefaultProps.still : _d, _e = _a.thickness, thickness = _e === void 0 ? secondaryColorDefaultProps.thickness : _e, svgProps = __rest(_a, ["secondaryColor", "speed", "still", "thickness"]);
var strokeWidth = 4 * (thickness / 100);
var circleStyle = !still
? { animation: "spinners-react-circular-fixed ".concat(140 / speed, "s linear infinite") }
: {};
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: secondaryColor, strokeWidth: strokeWidth }),
React.createElement("circle", { cx: "33", cy: "33", fill: "none", r: "28", stroke: "currentColor", strokeDasharray: "40, 134", strokeDashoffset: "325", strokeLinecap: "round", strokeWidth: strokeWidth, style: circleStyle })));
}
var SpinnerCircularFixed = withSharedProps(Component);
export { SpinnerCircularFixed };
//# sourceMappingURL=SpinnerCircularFixed.js.map