tharikida-ui
Version:
A modern, lightweight React UI component library with built-in theming, accessibility, and full TypeScript support. Create beautiful, responsive, and customizable web apps faster with ready-to-use components for any project.
23 lines (22 loc) • 1.36 kB
JavaScript
"use client";
import { jsx as _jsx } from "react/jsx-runtime";
import { useTheme } from "../../theme/ThemeProvider";
const Loader = ({ size = 32, color, styles, className = "" }) => {
const theme = useTheme();
const loaderColor = color || theme.primaryColor || "#000";
const loaderStyles = {
display: "inline-block",
color: theme.textColor,
fontFamily: theme.fontFamily,
fontSize: theme.fontSize,
fontWeight: theme.fontWeight,
lineHeight: theme.lineHeight,
letterSpacing: theme.letterSpacing,
padding: theme.padding,
margin: theme.margin,
transition: theme.transitionDuration,
...styles,
};
return (_jsx("div", { className: `tharikida-loader ${className}`, style: loaderStyles, children: _jsx("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { display: "block" }, children: _jsx("circle", { cx: size / 2, cy: size / 2, r: size / 2 - 4, stroke: loaderColor, strokeWidth: "4", fill: "none", strokeDasharray: Math.PI * (size - 8), strokeDashoffset: Math.PI * (size - 8) * 0.25, strokeLinecap: "round", children: _jsx("animateTransform", { attributeName: "transform", type: "rotate", from: `0 ${size / 2} ${size / 2}`, to: `360 ${size / 2} ${size / 2}`, dur: "1s", repeatCount: "indefinite" }) }) }) }));
};
export default Loader;