premium-react-loaders 4.0.0 → 4.1.1

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.
Files changed (163) hide show
  1. package/README.md +21 -6
  2. package/dist/components/index.d.ts +1 -0
  3. package/dist/components/index.d.ts.map +1 -1
  4. package/dist/components/neon/NeonPulse.d.ts +12 -0
  5. package/dist/components/neon/NeonPulse.d.ts.map +1 -0
  6. package/dist/components/neon/NeonSpinner.d.ts +12 -0
  7. package/dist/components/neon/NeonSpinner.d.ts.map +1 -0
  8. package/dist/components/neon/NeonText.d.ts +12 -0
  9. package/dist/components/neon/NeonText.d.ts.map +1 -0
  10. package/dist/components/neon/index.d.ts +4 -0
  11. package/dist/components/neon/index.d.ts.map +1 -0
  12. package/dist/components/particle/ParticleField.d.ts +3 -0
  13. package/dist/components/particle/ParticleField.d.ts.map +1 -0
  14. package/dist/components/particle/ParticleTrail.d.ts +12 -0
  15. package/dist/components/particle/ParticleTrail.d.ts.map +1 -0
  16. package/dist/components/particle/index.d.ts +2 -0
  17. package/dist/components/particle/index.d.ts.map +1 -1
  18. package/dist/components/status/InfoIndicator.d.ts +29 -0
  19. package/dist/components/status/InfoIndicator.d.ts.map +1 -0
  20. package/dist/components/status/WarningIndicator.d.ts +29 -0
  21. package/dist/components/status/WarningIndicator.d.ts.map +1 -0
  22. package/dist/components/status/index.d.ts +2 -0
  23. package/dist/components/status/index.d.ts.map +1 -1
  24. package/dist/index.cjs +41 -27
  25. package/dist/index.js +41 -27
  26. package/dist/index10.cjs +1 -1
  27. package/dist/index10.js +1 -1
  28. package/dist/index11.cjs +1 -1
  29. package/dist/index11.js +1 -1
  30. package/dist/index12.cjs +1 -1
  31. package/dist/index12.js +1 -1
  32. package/dist/index13.cjs +1 -1
  33. package/dist/index13.js +1 -1
  34. package/dist/index14.cjs +1 -1
  35. package/dist/index14.js +1 -1
  36. package/dist/index15.cjs +1 -1
  37. package/dist/index15.js +1 -1
  38. package/dist/index17.cjs +1 -1
  39. package/dist/index17.js +1 -1
  40. package/dist/index18.cjs +1 -1
  41. package/dist/index18.js +1 -1
  42. package/dist/index19.cjs +1 -1
  43. package/dist/index19.js +1 -1
  44. package/dist/index20.cjs +1 -1
  45. package/dist/index20.js +1 -1
  46. package/dist/index21.cjs +1 -1
  47. package/dist/index21.js +1 -1
  48. package/dist/index22.cjs +1 -1
  49. package/dist/index22.js +1 -1
  50. package/dist/index23.cjs +1 -1
  51. package/dist/index23.js +1 -1
  52. package/dist/index24.cjs +1 -1
  53. package/dist/index24.js +1 -1
  54. package/dist/index25.cjs +1 -1
  55. package/dist/index25.js +1 -1
  56. package/dist/index26.cjs +1 -1
  57. package/dist/index26.js +1 -1
  58. package/dist/index27.cjs +1 -1
  59. package/dist/index27.js +1 -1
  60. package/dist/index28.cjs +1 -1
  61. package/dist/index28.js +1 -1
  62. package/dist/index29.cjs +1 -1
  63. package/dist/index29.js +1 -1
  64. package/dist/index30.cjs +1 -1
  65. package/dist/index30.js +1 -1
  66. package/dist/index31.cjs +1 -1
  67. package/dist/index31.js +1 -1
  68. package/dist/index32.cjs +1 -1
  69. package/dist/index32.js +1 -1
  70. package/dist/index33.cjs +1 -1
  71. package/dist/index33.js +1 -1
  72. package/dist/index34.cjs +1 -1
  73. package/dist/index34.js +1 -1
  74. package/dist/index35.cjs +1 -1
  75. package/dist/index35.js +1 -1
  76. package/dist/index36.cjs +1 -1
  77. package/dist/index36.js +1 -1
  78. package/dist/index37.cjs +59 -145
  79. package/dist/index37.js +61 -147
  80. package/dist/index38.cjs +32 -53
  81. package/dist/index38.js +33 -54
  82. package/dist/index39.cjs +138 -84
  83. package/dist/index39.js +140 -86
  84. package/dist/index40.cjs +33 -106
  85. package/dist/index40.js +34 -107
  86. package/dist/index41.cjs +66 -50
  87. package/dist/index41.js +66 -50
  88. package/dist/index42.cjs +123 -44
  89. package/dist/index42.js +124 -45
  90. package/dist/index43.cjs +43 -85
  91. package/dist/index43.js +44 -86
  92. package/dist/index44.cjs +35 -27
  93. package/dist/index44.js +35 -27
  94. package/dist/index45.cjs +87 -58
  95. package/dist/index45.js +87 -58
  96. package/dist/index46.cjs +35 -88
  97. package/dist/index46.js +36 -89
  98. package/dist/index47.cjs +62 -58
  99. package/dist/index47.js +63 -59
  100. package/dist/index48.cjs +87 -110
  101. package/dist/index48.js +88 -111
  102. package/dist/index49.cjs +48 -109
  103. package/dist/index49.js +49 -110
  104. package/dist/index50.cjs +110 -62
  105. package/dist/index50.js +111 -63
  106. package/dist/index51.cjs +104 -49
  107. package/dist/index51.js +104 -49
  108. package/dist/index52.cjs +43 -77
  109. package/dist/index52.js +44 -78
  110. package/dist/index53.cjs +56 -56
  111. package/dist/index53.js +56 -56
  112. package/dist/index54.cjs +104 -149
  113. package/dist/index54.js +106 -151
  114. package/dist/index55.cjs +97 -38
  115. package/dist/index55.js +99 -40
  116. package/dist/index56.cjs +161 -27
  117. package/dist/index56.js +162 -28
  118. package/dist/index57.cjs +36 -102
  119. package/dist/index57.js +38 -104
  120. package/dist/index58.cjs +19 -34
  121. package/dist/index58.js +20 -35
  122. package/dist/index59.cjs +87 -34
  123. package/dist/index59.js +89 -36
  124. package/dist/index60.cjs +25 -23
  125. package/dist/index60.js +25 -23
  126. package/dist/index61.cjs +32 -65
  127. package/dist/index61.js +34 -67
  128. package/dist/index62.cjs +29 -36
  129. package/dist/index62.js +30 -37
  130. package/dist/index63.cjs +66 -59
  131. package/dist/index63.js +69 -62
  132. package/dist/index64.cjs +71 -121
  133. package/dist/index64.js +72 -122
  134. package/dist/index65.cjs +92 -0
  135. package/dist/index65.js +92 -0
  136. package/dist/index66.cjs +76 -0
  137. package/dist/index66.js +76 -0
  138. package/dist/index67.cjs +76 -0
  139. package/dist/index67.js +76 -0
  140. package/dist/index68.cjs +64 -0
  141. package/dist/index68.js +64 -0
  142. package/dist/index69.cjs +60 -0
  143. package/dist/index69.js +60 -0
  144. package/dist/index7.cjs +1 -1
  145. package/dist/index7.js +1 -1
  146. package/dist/index70.cjs +57 -0
  147. package/dist/index70.js +57 -0
  148. package/dist/index71.cjs +125 -0
  149. package/dist/index71.js +125 -0
  150. package/dist/index8.cjs +1 -1
  151. package/dist/index8.js +1 -1
  152. package/dist/index9.cjs +1 -1
  153. package/dist/index9.js +1 -1
  154. package/dist/premium-react-loaders.css +85 -0
  155. package/dist/types/index.d.ts +1 -0
  156. package/dist/types/index.d.ts.map +1 -1
  157. package/dist/types/neon.d.ts +26 -0
  158. package/dist/types/neon.d.ts.map +1 -0
  159. package/dist/types/particle.d.ts +18 -0
  160. package/dist/types/particle.d.ts.map +1 -1
  161. package/dist/types/status.d.ts +30 -0
  162. package/dist/types/status.d.ts.map +1 -1
  163. package/package.json +1 -1
package/dist/index37.js CHANGED
@@ -1,167 +1,81 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { forwardRef, useState, useRef, useEffect } from "react";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useLoaderVisibility } from "./index71.js";
3
4
  import { cn } from "./index3.js";
4
- const LoaderTransition = forwardRef(
5
+ const WarningIndicator = forwardRef(
5
6
  ({
6
- loading,
7
- loadingContent,
8
- children,
9
- transitionType = "fade",
10
- duration = 300,
11
- timing = "ease-out",
12
- keepMounted = false,
13
- exitDelay = 0,
14
- appearOnMount = false,
7
+ size = 48,
8
+ color = "#f59e0b",
9
+ animate = true,
10
+ shake = false,
11
+ duration = 500,
12
+ delay = 0,
13
+ minDuration = 0,
14
+ transition = true,
15
15
  className,
16
16
  style,
17
- testId = "loader-transition",
18
- ariaLabel,
17
+ testId = "warning-indicator",
19
18
  visible = true,
20
- delay = 0,
21
- minDuration = 0,
22
- transition: transitionProp,
19
+ ariaLabel = "Warning",
23
20
  ...rest
24
21
  }, ref) => {
25
- const [isTransitioning, setIsTransitioning] = useState(false);
26
- const [showLoading, setShowLoading] = useState(appearOnMount ? loading : false);
27
- const [showContent, setShowContent] = useState(!appearOnMount && !loading);
28
- const timeoutRef = useRef(null);
29
- const entryTimeRef = useRef(null);
30
- useEffect(() => {
31
- if (!visible) {
32
- setShowLoading(false);
33
- setShowContent(false);
34
- return;
35
- }
36
- if (loading) {
37
- if (timeoutRef.current) {
38
- clearTimeout(timeoutRef.current);
39
- }
40
- if (delay > 0) {
41
- timeoutRef.current = setTimeout(() => {
42
- setShowLoading(true);
43
- setShowContent(false);
44
- entryTimeRef.current = Date.now();
45
- }, delay);
46
- } else {
47
- setShowLoading(true);
48
- setShowContent(false);
49
- entryTimeRef.current = Date.now();
50
- }
51
- } else {
52
- const elapsed = entryTimeRef.current ? Date.now() - entryTimeRef.current : 0;
53
- const remainingMinDuration = Math.max(0, minDuration - elapsed);
54
- const totalDelay = exitDelay + remainingMinDuration;
55
- if (totalDelay > 0) {
56
- timeoutRef.current = setTimeout(() => {
57
- setIsTransitioning(true);
58
- timeoutRef.current = setTimeout(() => {
59
- setShowLoading(false);
60
- setShowContent(true);
61
- setIsTransitioning(false);
62
- }, duration);
63
- }, totalDelay);
64
- } else {
65
- setIsTransitioning(true);
66
- timeoutRef.current = setTimeout(() => {
67
- setShowLoading(false);
68
- setShowContent(true);
69
- setIsTransitioning(false);
70
- }, duration);
71
- }
72
- }
73
- return () => {
74
- if (timeoutRef.current) {
75
- clearTimeout(timeoutRef.current);
76
- }
77
- };
78
- }, [loading, visible, delay, minDuration, exitDelay, duration]);
79
- const getTransitionClasses = (isLoading, isTransition) => {
80
- const baseClasses = "loader-transition";
81
- const timingClass = `loader-transition-${timing}`;
82
- if (transitionType === "none") {
83
- return baseClasses;
84
- }
85
- if (transitionType === "fade") {
86
- if (isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-fade-enter-active`;
87
- if (!isLoading && isTransition) return `${baseClasses} ${timingClass} loader-transition-fade-exit-active`;
88
- if (!isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-fade-enter-active`;
89
- return `${baseClasses} ${timingClass}`;
90
- }
91
- if (transitionType === "slide-up") {
92
- if (isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-up-enter-active`;
93
- if (!isLoading && isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-up-exit-active`;
94
- if (!isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-up-enter-active`;
95
- return `${baseClasses} ${timingClass}`;
96
- }
97
- if (transitionType === "slide-down") {
98
- if (isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-down-enter-active`;
99
- if (!isLoading && isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-down-exit-active`;
100
- if (!isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-down-enter-active`;
101
- return `${baseClasses} ${timingClass}`;
102
- }
103
- if (transitionType === "slide-left") {
104
- if (isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-left-enter-active`;
105
- if (!isLoading && isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-left-exit-active`;
106
- if (!isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-left-enter-active`;
107
- return `${baseClasses} ${timingClass}`;
108
- }
109
- if (transitionType === "slide-right") {
110
- if (isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-right-enter-active`;
111
- if (!isLoading && isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-right-exit-active`;
112
- if (!isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-slide-right-enter-active`;
113
- return `${baseClasses} ${timingClass}`;
114
- }
115
- if (transitionType === "scale") {
116
- if (isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-scale-enter-active`;
117
- if (!isLoading && isTransition) return `${baseClasses} ${timingClass} loader-transition-scale-exit-active`;
118
- if (!isLoading && !isTransition) return `${baseClasses} ${timingClass} loader-transition-scale-enter-active`;
119
- return `${baseClasses} ${timingClass}`;
120
- }
121
- return baseClasses;
122
- };
123
- const shouldShowLoading = showLoading || keepMounted && loading;
124
- const shouldShowContent = showContent || keepMounted && !loading;
125
- return /* @__PURE__ */ jsxs(
22
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
23
+ visible,
24
+ delay,
25
+ minDuration,
26
+ transition
27
+ );
28
+ if (!shouldRender) return null;
29
+ const animClass = !animate ? "" : shake ? "animate-warning-shake" : "animate-warning-scale";
30
+ return /* @__PURE__ */ jsx(
126
31
  "div",
127
32
  {
128
33
  ref,
129
34
  "data-testid": testId,
130
- className: cn("relative", className),
131
- style,
35
+ className: cn("inline-flex items-center justify-center", className),
36
+ style: { opacity, transition: transitionStyle, ...style },
132
37
  role: "status",
133
38
  "aria-label": ariaLabel,
134
- "aria-busy": loading,
135
39
  ...rest,
136
- children: [
137
- shouldShowLoading && /* @__PURE__ */ jsx(
138
- "div",
139
- {
140
- className: getTransitionClasses(true, isTransitioning),
141
- style: {
142
- transitionDuration: `${duration}ms`,
143
- display: showLoading ? "block" : "none"
144
- },
145
- children: loadingContent
146
- }
147
- ),
148
- shouldShowContent && /* @__PURE__ */ jsx(
149
- "div",
150
- {
151
- className: getTransitionClasses(false, isTransitioning),
152
- style: {
153
- transitionDuration: `${duration}ms`,
154
- display: showContent ? "block" : "none"
155
- },
156
- children
157
- }
158
- )
159
- ]
40
+ children: /* @__PURE__ */ jsxs(
41
+ "svg",
42
+ {
43
+ className: animClass,
44
+ style: { width: size, height: size, animationDuration: `${duration}ms` },
45
+ viewBox: "0 0 52 52",
46
+ fill: "none",
47
+ children: [
48
+ /* @__PURE__ */ jsx(
49
+ "path",
50
+ {
51
+ d: "M26 4 L49 46 L3 46 Z",
52
+ fill: color,
53
+ stroke: color,
54
+ strokeWidth: 1,
55
+ strokeLinejoin: "round"
56
+ }
57
+ ),
58
+ /* @__PURE__ */ jsx(
59
+ "line",
60
+ {
61
+ x1: "26",
62
+ y1: "19",
63
+ x2: "26",
64
+ y2: "33",
65
+ stroke: "white",
66
+ strokeWidth: 3.5,
67
+ strokeLinecap: "round"
68
+ }
69
+ ),
70
+ /* @__PURE__ */ jsx("circle", { cx: "26", cy: "39", r: "2", fill: "white" })
71
+ ]
72
+ }
73
+ )
160
74
  }
161
75
  );
162
76
  }
163
77
  );
164
- LoaderTransition.displayName = "LoaderTransition";
78
+ WarningIndicator.displayName = "WarningIndicator";
165
79
  export {
166
- LoaderTransition
80
+ WarningIndicator
167
81
  };
package/dist/index38.cjs CHANGED
@@ -2,31 +2,25 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
- const hooks = require("./index64.cjs");
5
+ const hooks = require("./index71.cjs");
6
6
  const classNames = require("./index3.cjs");
7
- const ShimmerBox = react.forwardRef(
7
+ const InfoIndicator = react.forwardRef(
8
8
  ({
9
- width = 200,
10
- height,
11
- borderRadius = 8,
12
- baseColor = "#e5e7eb",
13
- highlightColor = "#f3f4f6",
14
- direction = "left-to-right",
15
- aspectRatio,
16
- speed = "normal",
17
- respectMotionPreference = true,
9
+ size = 48,
10
+ color = "#3b82f6",
11
+ animate = true,
12
+ pulse = false,
13
+ duration = 500,
18
14
  delay = 0,
19
15
  minDuration = 0,
20
- transition,
16
+ transition = true,
21
17
  className,
22
18
  style,
23
- testId = "shimmer-box",
19
+ testId = "info-indicator",
24
20
  visible = true,
25
- ariaLabel = "Loading...",
21
+ ariaLabel = "Info",
26
22
  ...rest
27
23
  }, ref) => {
28
- const prefersReducedMotion = hooks.useReducedMotion();
29
- const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
30
24
  const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
31
25
  visible,
32
26
  delay,
@@ -34,63 +28,48 @@ const ShimmerBox = react.forwardRef(
34
28
  transition
35
29
  );
36
30
  if (!shouldRender) return null;
37
- const getGradientDirection = () => {
38
- switch (direction) {
39
- case "right-to-left":
40
- return "to left";
41
- case "top-to-bottom":
42
- return "to bottom";
43
- case "bottom-to-top":
44
- return "to top";
45
- default:
46
- return "to right";
47
- }
48
- };
49
- const getAnimationName = () => {
50
- switch (direction) {
51
- case "right-to-left":
52
- return "shimmer-rtl";
53
- case "top-to-bottom":
54
- return "shimmer-ttb";
55
- case "bottom-to-top":
56
- return "shimmer-btt";
57
- default:
58
- return "shimmer-ltr";
59
- }
60
- };
61
31
  return /* @__PURE__ */ jsxRuntime.jsx(
62
32
  "div",
63
33
  {
64
34
  ref,
65
35
  "data-testid": testId,
66
- className: classNames.cn("relative overflow-hidden", className),
36
+ className: classNames.cn("inline-flex items-center justify-center", animate && "animate-info-scale", className),
67
37
  style: {
68
- width: typeof width === "number" ? `${width}px` : width,
69
- height: aspectRatio ? void 0 : typeof height === "number" ? `${height}px` : height || "100px",
70
- aspectRatio,
71
- borderRadius: typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius,
72
- backgroundColor: baseColor,
73
38
  opacity,
74
39
  transition: transitionStyle,
40
+ animationDuration: animate ? `${duration}ms` : void 0,
75
41
  ...style
76
42
  },
77
43
  role: "status",
78
44
  "aria-label": ariaLabel,
79
- "aria-busy": "true",
80
45
  ...rest,
81
46
  children: /* @__PURE__ */ jsxRuntime.jsx(
82
47
  "div",
83
48
  {
84
- className: "absolute inset-0",
49
+ className: classNames.cn("rounded-full inline-flex items-center justify-center", pulse && "animate-info-pulse-glow"),
85
50
  style: {
86
- background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${highlightColor} 50%, transparent 100%)`,
87
- animation: `${getAnimationName()} ${effectiveDuration} infinite`
88
- }
51
+ width: size,
52
+ height: size,
53
+ backgroundColor: color,
54
+ ["--info-color"]: color
55
+ },
56
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
57
+ "svg",
58
+ {
59
+ style: { width: size * 0.5, height: size * 0.5 },
60
+ viewBox: "0 0 24 24",
61
+ fill: "none",
62
+ children: [
63
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "8", r: "1.5", fill: "white" }),
64
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "12", x2: "12", y2: "18", stroke: "white", strokeWidth: 2.5, strokeLinecap: "round" })
65
+ ]
66
+ }
67
+ )
89
68
  }
90
69
  )
91
70
  }
92
71
  );
93
72
  }
94
73
  );
95
- ShimmerBox.displayName = "ShimmerBox";
96
- exports.ShimmerBox = ShimmerBox;
74
+ InfoIndicator.displayName = "InfoIndicator";
75
+ exports.InfoIndicator = InfoIndicator;
package/dist/index38.js CHANGED
@@ -1,30 +1,24 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index64.js";
3
+ import { useLoaderVisibility } from "./index71.js";
4
4
  import { cn } from "./index3.js";
5
- const ShimmerBox = forwardRef(
5
+ const InfoIndicator = forwardRef(
6
6
  ({
7
- width = 200,
8
- height,
9
- borderRadius = 8,
10
- baseColor = "#e5e7eb",
11
- highlightColor = "#f3f4f6",
12
- direction = "left-to-right",
13
- aspectRatio,
14
- speed = "normal",
15
- respectMotionPreference = true,
7
+ size = 48,
8
+ color = "#3b82f6",
9
+ animate = true,
10
+ pulse = false,
11
+ duration = 500,
16
12
  delay = 0,
17
13
  minDuration = 0,
18
- transition,
14
+ transition = true,
19
15
  className,
20
16
  style,
21
- testId = "shimmer-box",
17
+ testId = "info-indicator",
22
18
  visible = true,
23
- ariaLabel = "Loading...",
19
+ ariaLabel = "Info",
24
20
  ...rest
25
21
  }, ref) => {
26
- const prefersReducedMotion = useReducedMotion();
27
- const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
22
  const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
29
23
  visible,
30
24
  delay,
@@ -32,65 +26,50 @@ const ShimmerBox = forwardRef(
32
26
  transition
33
27
  );
34
28
  if (!shouldRender) return null;
35
- const getGradientDirection = () => {
36
- switch (direction) {
37
- case "right-to-left":
38
- return "to left";
39
- case "top-to-bottom":
40
- return "to bottom";
41
- case "bottom-to-top":
42
- return "to top";
43
- default:
44
- return "to right";
45
- }
46
- };
47
- const getAnimationName = () => {
48
- switch (direction) {
49
- case "right-to-left":
50
- return "shimmer-rtl";
51
- case "top-to-bottom":
52
- return "shimmer-ttb";
53
- case "bottom-to-top":
54
- return "shimmer-btt";
55
- default:
56
- return "shimmer-ltr";
57
- }
58
- };
59
29
  return /* @__PURE__ */ jsx(
60
30
  "div",
61
31
  {
62
32
  ref,
63
33
  "data-testid": testId,
64
- className: cn("relative overflow-hidden", className),
34
+ className: cn("inline-flex items-center justify-center", animate && "animate-info-scale", className),
65
35
  style: {
66
- width: typeof width === "number" ? `${width}px` : width,
67
- height: aspectRatio ? void 0 : typeof height === "number" ? `${height}px` : height || "100px",
68
- aspectRatio,
69
- borderRadius: typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius,
70
- backgroundColor: baseColor,
71
36
  opacity,
72
37
  transition: transitionStyle,
38
+ animationDuration: animate ? `${duration}ms` : void 0,
73
39
  ...style
74
40
  },
75
41
  role: "status",
76
42
  "aria-label": ariaLabel,
77
- "aria-busy": "true",
78
43
  ...rest,
79
44
  children: /* @__PURE__ */ jsx(
80
45
  "div",
81
46
  {
82
- className: "absolute inset-0",
47
+ className: cn("rounded-full inline-flex items-center justify-center", pulse && "animate-info-pulse-glow"),
83
48
  style: {
84
- background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${highlightColor} 50%, transparent 100%)`,
85
- animation: `${getAnimationName()} ${effectiveDuration} infinite`
86
- }
49
+ width: size,
50
+ height: size,
51
+ backgroundColor: color,
52
+ ["--info-color"]: color
53
+ },
54
+ children: /* @__PURE__ */ jsxs(
55
+ "svg",
56
+ {
57
+ style: { width: size * 0.5, height: size * 0.5 },
58
+ viewBox: "0 0 24 24",
59
+ fill: "none",
60
+ children: [
61
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "8", r: "1.5", fill: "white" }),
62
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "12", x2: "12", y2: "18", stroke: "white", strokeWidth: 2.5, strokeLinecap: "round" })
63
+ ]
64
+ }
65
+ )
87
66
  }
88
67
  )
89
68
  }
90
69
  );
91
70
  }
92
71
  );
93
- ShimmerBox.displayName = "ShimmerBox";
72
+ InfoIndicator.displayName = "InfoIndicator";
94
73
  export {
95
- ShimmerBox
74
+ InfoIndicator
96
75
  };