@megha-ui/react 1.2.216 → 1.2.217

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.
@@ -27,7 +27,7 @@ const shimmer = keyframes `
27
27
  `;
28
28
  const Shimmer = styled.div `
29
29
  display: inline-block;
30
- width: ${(p) => p.width}px;
30
+ width: ${(p) => (typeof p.width === "number" ? `${p.width}px` : p.width)};
31
31
  height: ${(p) => p.height}px;
32
32
  border-radius: ${(p) => p.radius}px;
33
33
  background: linear-gradient(
@@ -39,10 +39,13 @@ const Shimmer = styled.div `
39
39
  background-size: 400% 100%;
40
40
  animation: ${shimmer} 1.2s ease-in-out infinite;
41
41
  `;
42
- const Loader = ({ size = 24, color = "var(--accent, #3498db)", className = "", variant = "spinner", }) => {
42
+ const Loader = ({ size, color = "var(--accent, #3498db)", className = "", variant = "spinner", }) => {
43
43
  if (variant === "shimmer") {
44
- return (_jsx(Shimmer, { width: size * 4, height: size, radius: size / 2, className: className }));
44
+ const shimmerHeight = size !== null && size !== void 0 ? size : 16;
45
+ const shimmerWidth = size ? size * 4 : "100%";
46
+ return (_jsx(Shimmer, { width: shimmerWidth, height: shimmerHeight, radius: shimmerHeight / 2, className: className }));
45
47
  }
46
- return _jsx(Spinner, { size: size, color: color, className: className });
48
+ const spinnerSize = size !== null && size !== void 0 ? size : 24;
49
+ return _jsx(Spinner, { size: spinnerSize, color: color, className: className });
47
50
  };
48
51
  export default Loader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.216",
3
+ "version": "1.2.217",
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",