@megha-ui/react 1.2.215 → 1.2.216

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ interface LoadingProps {
4
4
  color?: string;
5
5
  message?: string;
6
6
  className?: string;
7
+ variant?: "spinner" | "shimmer";
7
8
  }
8
9
  declare const Loader: React.FC<LoadingProps>;
9
10
  export default Loader;
@@ -17,7 +17,32 @@ const Spinner = styled.div `
17
17
  border-radius: 50%;
18
18
  animation: ${spin} 1s linear infinite;
19
19
  `;
20
- const Loader = ({ size = 24, color = "var(--accent, #3498db)", className = "", }) => {
20
+ const shimmer = keyframes `
21
+ 0% {
22
+ background-position: -200% 0;
23
+ }
24
+ 100% {
25
+ background-position: 200% 0;
26
+ }
27
+ `;
28
+ const Shimmer = styled.div `
29
+ display: inline-block;
30
+ width: ${(p) => p.width}px;
31
+ height: ${(p) => p.height}px;
32
+ border-radius: ${(p) => p.radius}px;
33
+ background: linear-gradient(
34
+ 90deg,
35
+ rgba(0, 0, 0, 0.06) 25%,
36
+ rgba(0, 0, 0, 0.12) 37%,
37
+ rgba(0, 0, 0, 0.06) 63%
38
+ );
39
+ background-size: 400% 100%;
40
+ animation: ${shimmer} 1.2s ease-in-out infinite;
41
+ `;
42
+ const Loader = ({ size = 24, color = "var(--accent, #3498db)", className = "", variant = "spinner", }) => {
43
+ if (variant === "shimmer") {
44
+ return (_jsx(Shimmer, { width: size * 4, height: size, radius: size / 2, className: className }));
45
+ }
21
46
  return _jsx(Spinner, { size: size, color: color, className: className });
22
47
  };
23
48
  export default Loader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.215",
3
+ "version": "1.2.216",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",