premium-react-loaders 4.0.0 → 4.1.0

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 (162) hide show
  1. package/dist/components/index.d.ts +1 -0
  2. package/dist/components/index.d.ts.map +1 -1
  3. package/dist/components/neon/NeonPulse.d.ts +12 -0
  4. package/dist/components/neon/NeonPulse.d.ts.map +1 -0
  5. package/dist/components/neon/NeonSpinner.d.ts +12 -0
  6. package/dist/components/neon/NeonSpinner.d.ts.map +1 -0
  7. package/dist/components/neon/NeonText.d.ts +12 -0
  8. package/dist/components/neon/NeonText.d.ts.map +1 -0
  9. package/dist/components/neon/index.d.ts +4 -0
  10. package/dist/components/neon/index.d.ts.map +1 -0
  11. package/dist/components/particle/ParticleField.d.ts +3 -0
  12. package/dist/components/particle/ParticleField.d.ts.map +1 -0
  13. package/dist/components/particle/ParticleTrail.d.ts +12 -0
  14. package/dist/components/particle/ParticleTrail.d.ts.map +1 -0
  15. package/dist/components/particle/index.d.ts +2 -0
  16. package/dist/components/particle/index.d.ts.map +1 -1
  17. package/dist/components/status/InfoIndicator.d.ts +29 -0
  18. package/dist/components/status/InfoIndicator.d.ts.map +1 -0
  19. package/dist/components/status/WarningIndicator.d.ts +29 -0
  20. package/dist/components/status/WarningIndicator.d.ts.map +1 -0
  21. package/dist/components/status/index.d.ts +2 -0
  22. package/dist/components/status/index.d.ts.map +1 -1
  23. package/dist/index.cjs +41 -27
  24. package/dist/index.js +41 -27
  25. package/dist/index10.cjs +1 -1
  26. package/dist/index10.js +1 -1
  27. package/dist/index11.cjs +1 -1
  28. package/dist/index11.js +1 -1
  29. package/dist/index12.cjs +1 -1
  30. package/dist/index12.js +1 -1
  31. package/dist/index13.cjs +1 -1
  32. package/dist/index13.js +1 -1
  33. package/dist/index14.cjs +1 -1
  34. package/dist/index14.js +1 -1
  35. package/dist/index15.cjs +1 -1
  36. package/dist/index15.js +1 -1
  37. package/dist/index17.cjs +1 -1
  38. package/dist/index17.js +1 -1
  39. package/dist/index18.cjs +1 -1
  40. package/dist/index18.js +1 -1
  41. package/dist/index19.cjs +1 -1
  42. package/dist/index19.js +1 -1
  43. package/dist/index20.cjs +1 -1
  44. package/dist/index20.js +1 -1
  45. package/dist/index21.cjs +1 -1
  46. package/dist/index21.js +1 -1
  47. package/dist/index22.cjs +1 -1
  48. package/dist/index22.js +1 -1
  49. package/dist/index23.cjs +1 -1
  50. package/dist/index23.js +1 -1
  51. package/dist/index24.cjs +1 -1
  52. package/dist/index24.js +1 -1
  53. package/dist/index25.cjs +1 -1
  54. package/dist/index25.js +1 -1
  55. package/dist/index26.cjs +1 -1
  56. package/dist/index26.js +1 -1
  57. package/dist/index27.cjs +1 -1
  58. package/dist/index27.js +1 -1
  59. package/dist/index28.cjs +1 -1
  60. package/dist/index28.js +1 -1
  61. package/dist/index29.cjs +1 -1
  62. package/dist/index29.js +1 -1
  63. package/dist/index30.cjs +1 -1
  64. package/dist/index30.js +1 -1
  65. package/dist/index31.cjs +1 -1
  66. package/dist/index31.js +1 -1
  67. package/dist/index32.cjs +1 -1
  68. package/dist/index32.js +1 -1
  69. package/dist/index33.cjs +1 -1
  70. package/dist/index33.js +1 -1
  71. package/dist/index34.cjs +1 -1
  72. package/dist/index34.js +1 -1
  73. package/dist/index35.cjs +1 -1
  74. package/dist/index35.js +1 -1
  75. package/dist/index36.cjs +1 -1
  76. package/dist/index36.js +1 -1
  77. package/dist/index37.cjs +59 -145
  78. package/dist/index37.js +61 -147
  79. package/dist/index38.cjs +32 -53
  80. package/dist/index38.js +33 -54
  81. package/dist/index39.cjs +138 -84
  82. package/dist/index39.js +140 -86
  83. package/dist/index40.cjs +33 -106
  84. package/dist/index40.js +34 -107
  85. package/dist/index41.cjs +66 -50
  86. package/dist/index41.js +66 -50
  87. package/dist/index42.cjs +123 -44
  88. package/dist/index42.js +124 -45
  89. package/dist/index43.cjs +43 -85
  90. package/dist/index43.js +44 -86
  91. package/dist/index44.cjs +35 -27
  92. package/dist/index44.js +35 -27
  93. package/dist/index45.cjs +87 -58
  94. package/dist/index45.js +87 -58
  95. package/dist/index46.cjs +35 -88
  96. package/dist/index46.js +36 -89
  97. package/dist/index47.cjs +62 -58
  98. package/dist/index47.js +63 -59
  99. package/dist/index48.cjs +87 -110
  100. package/dist/index48.js +88 -111
  101. package/dist/index49.cjs +48 -109
  102. package/dist/index49.js +49 -110
  103. package/dist/index50.cjs +110 -62
  104. package/dist/index50.js +111 -63
  105. package/dist/index51.cjs +104 -49
  106. package/dist/index51.js +104 -49
  107. package/dist/index52.cjs +43 -77
  108. package/dist/index52.js +44 -78
  109. package/dist/index53.cjs +56 -56
  110. package/dist/index53.js +56 -56
  111. package/dist/index54.cjs +104 -149
  112. package/dist/index54.js +106 -151
  113. package/dist/index55.cjs +97 -38
  114. package/dist/index55.js +99 -40
  115. package/dist/index56.cjs +161 -27
  116. package/dist/index56.js +162 -28
  117. package/dist/index57.cjs +36 -102
  118. package/dist/index57.js +38 -104
  119. package/dist/index58.cjs +19 -34
  120. package/dist/index58.js +20 -35
  121. package/dist/index59.cjs +87 -34
  122. package/dist/index59.js +89 -36
  123. package/dist/index60.cjs +25 -23
  124. package/dist/index60.js +25 -23
  125. package/dist/index61.cjs +32 -65
  126. package/dist/index61.js +34 -67
  127. package/dist/index62.cjs +29 -36
  128. package/dist/index62.js +30 -37
  129. package/dist/index63.cjs +66 -59
  130. package/dist/index63.js +69 -62
  131. package/dist/index64.cjs +71 -121
  132. package/dist/index64.js +72 -122
  133. package/dist/index65.cjs +92 -0
  134. package/dist/index65.js +92 -0
  135. package/dist/index66.cjs +76 -0
  136. package/dist/index66.js +76 -0
  137. package/dist/index67.cjs +76 -0
  138. package/dist/index67.js +76 -0
  139. package/dist/index68.cjs +64 -0
  140. package/dist/index68.js +64 -0
  141. package/dist/index69.cjs +60 -0
  142. package/dist/index69.js +60 -0
  143. package/dist/index7.cjs +1 -1
  144. package/dist/index7.js +1 -1
  145. package/dist/index70.cjs +57 -0
  146. package/dist/index70.js +57 -0
  147. package/dist/index71.cjs +125 -0
  148. package/dist/index71.js +125 -0
  149. package/dist/index8.cjs +1 -1
  150. package/dist/index8.js +1 -1
  151. package/dist/index9.cjs +1 -1
  152. package/dist/index9.js +1 -1
  153. package/dist/premium-react-loaders.css +85 -0
  154. package/dist/types/index.d.ts +1 -0
  155. package/dist/types/index.d.ts.map +1 -1
  156. package/dist/types/neon.d.ts +26 -0
  157. package/dist/types/neon.d.ts.map +1 -0
  158. package/dist/types/particle.d.ts +18 -0
  159. package/dist/types/particle.d.ts.map +1 -1
  160. package/dist/types/status.d.ts +30 -0
  161. package/dist/types/status.d.ts.map +1 -1
  162. package/package.json +1 -1
package/dist/index60.cjs CHANGED
@@ -2,14 +2,14 @@
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 colors = require("./index4.cjs");
6
+ const hooks = require("./index71.cjs");
6
7
  const classNames = require("./index3.cjs");
7
- const GradientRing = react.forwardRef(
8
+ const WaveCircle = react.forwardRef(
8
9
  ({
9
- size = 48,
10
- colors = ["#3b82f6", "#8b5cf6", "#ec4899"],
11
- thickness = 6,
12
- backgroundColor = "white",
10
+ size = 80,
11
+ color = "#3b82f6",
12
+ ringCount = 3,
13
13
  speed = "normal",
14
14
  respectMotionPreference = true,
15
15
  delay = 0,
@@ -17,7 +17,7 @@ const GradientRing = react.forwardRef(
17
17
  transition,
18
18
  className,
19
19
  style,
20
- testId = "gradient-ring",
20
+ testId = "wave-circle",
21
21
  visible = true,
22
22
  ariaLabel = "Loading...",
23
23
  ...rest
@@ -26,9 +26,8 @@ const GradientRing = react.forwardRef(
26
26
  const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
27
27
  const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(visible, delay, minDuration, transition);
28
28
  if (!shouldRender) return null;
29
- const stops = colors.join(", ");
30
- const gradientStyle = `linear-gradient(135deg, ${stops}, ${colors[0]})`;
31
- const inner = size - thickness * 2;
29
+ const clampedCount = Math.min(5, Math.max(2, ringCount));
30
+ const durationMs = colors.parseDurationMs(effectiveDuration);
32
31
  return /* @__PURE__ */ jsxRuntime.jsxs(
33
32
  "div",
34
33
  {
@@ -44,25 +43,28 @@ const GradientRing = react.forwardRef(
44
43
  /* @__PURE__ */ jsxRuntime.jsx(
45
44
  "div",
46
45
  {
47
- className: "absolute inset-0 rounded-full",
48
- style: {
49
- background: gradientStyle,
50
- backgroundSize: "200% 200%",
51
- animation: `gradient-flow ${effectiveDuration} ease infinite, gradient-spin ${effectiveDuration} linear infinite`
52
- }
46
+ className: "absolute rounded-full z-10",
47
+ style: { width: size * 0.15, height: size * 0.15, backgroundColor: color }
53
48
  }
54
49
  ),
55
- /* @__PURE__ */ jsxRuntime.jsx(
50
+ Array.from({ length: clampedCount }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx(
56
51
  "div",
57
52
  {
58
- className: "absolute rounded-full",
59
- style: { width: inner, height: inner, backgroundColor }
60
- }
61
- )
53
+ className: "absolute rounded-full border-2",
54
+ style: {
55
+ width: size,
56
+ height: size,
57
+ borderColor: color,
58
+ animation: `wave-circle-expand ${effectiveDuration} ease-out infinite`,
59
+ animationDelay: `${i / clampedCount * durationMs}ms`
60
+ }
61
+ },
62
+ i
63
+ ))
62
64
  ]
63
65
  }
64
66
  );
65
67
  }
66
68
  );
67
- GradientRing.displayName = "GradientRing";
68
- exports.GradientRing = GradientRing;
69
+ WaveCircle.displayName = "WaveCircle";
70
+ exports.WaveCircle = WaveCircle;
package/dist/index60.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index64.js";
3
+ import { parseDurationMs } from "./index4.js";
4
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
4
5
  import { cn } from "./index3.js";
5
- const GradientRing = forwardRef(
6
+ const WaveCircle = forwardRef(
6
7
  ({
7
- size = 48,
8
- colors = ["#3b82f6", "#8b5cf6", "#ec4899"],
9
- thickness = 6,
10
- backgroundColor = "white",
8
+ size = 80,
9
+ color = "#3b82f6",
10
+ ringCount = 3,
11
11
  speed = "normal",
12
12
  respectMotionPreference = true,
13
13
  delay = 0,
@@ -15,7 +15,7 @@ const GradientRing = forwardRef(
15
15
  transition,
16
16
  className,
17
17
  style,
18
- testId = "gradient-ring",
18
+ testId = "wave-circle",
19
19
  visible = true,
20
20
  ariaLabel = "Loading...",
21
21
  ...rest
@@ -24,9 +24,8 @@ const GradientRing = forwardRef(
24
24
  const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
25
25
  const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(visible, delay, minDuration, transition);
26
26
  if (!shouldRender) return null;
27
- const stops = colors.join(", ");
28
- const gradientStyle = `linear-gradient(135deg, ${stops}, ${colors[0]})`;
29
- const inner = size - thickness * 2;
27
+ const clampedCount = Math.min(5, Math.max(2, ringCount));
28
+ const durationMs = parseDurationMs(effectiveDuration);
30
29
  return /* @__PURE__ */ jsxs(
31
30
  "div",
32
31
  {
@@ -42,27 +41,30 @@ const GradientRing = forwardRef(
42
41
  /* @__PURE__ */ jsx(
43
42
  "div",
44
43
  {
45
- className: "absolute inset-0 rounded-full",
46
- style: {
47
- background: gradientStyle,
48
- backgroundSize: "200% 200%",
49
- animation: `gradient-flow ${effectiveDuration} ease infinite, gradient-spin ${effectiveDuration} linear infinite`
50
- }
44
+ className: "absolute rounded-full z-10",
45
+ style: { width: size * 0.15, height: size * 0.15, backgroundColor: color }
51
46
  }
52
47
  ),
53
- /* @__PURE__ */ jsx(
48
+ Array.from({ length: clampedCount }, (_, i) => /* @__PURE__ */ jsx(
54
49
  "div",
55
50
  {
56
- className: "absolute rounded-full",
57
- style: { width: inner, height: inner, backgroundColor }
58
- }
59
- )
51
+ className: "absolute rounded-full border-2",
52
+ style: {
53
+ width: size,
54
+ height: size,
55
+ borderColor: color,
56
+ animation: `wave-circle-expand ${effectiveDuration} ease-out infinite`,
57
+ animationDelay: `${i / clampedCount * durationMs}ms`
58
+ }
59
+ },
60
+ i
61
+ ))
60
62
  ]
61
63
  }
62
64
  );
63
65
  }
64
66
  );
65
- GradientRing.displayName = "GradientRing";
67
+ WaveCircle.displayName = "WaveCircle";
66
68
  export {
67
- GradientRing
69
+ WaveCircle
68
70
  };
package/dist/index61.cjs CHANGED
@@ -2,17 +2,15 @@
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");
6
- const colors = require("./index4.cjs");
5
+ const hooks = require("./index71.cjs");
7
6
  const classNames = require("./index3.cjs");
8
- const GradientBar = react.forwardRef(
7
+ const GradientSpinner = react.forwardRef(
9
8
  ({
10
- value,
11
- width = "100%",
12
- height = 8,
9
+ size = 48,
13
10
  color = "#3b82f6",
14
11
  secondaryColor = "#8b5cf6",
15
- onComplete,
12
+ thickness = 4,
13
+ backgroundColor = "white",
16
14
  speed = "normal",
17
15
  respectMotionPreference = true,
18
16
  delay = 0,
@@ -20,80 +18,49 @@ const GradientBar = react.forwardRef(
20
18
  transition,
21
19
  className,
22
20
  style,
23
- testId = "gradient-bar",
21
+ testId = "gradient-spinner",
24
22
  visible = true,
25
- ariaLabel,
23
+ ariaLabel = "Loading...",
26
24
  ...rest
27
25
  }, ref) => {
28
26
  const prefersReducedMotion = hooks.useReducedMotion();
29
27
  const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
30
28
  const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(visible, delay, minDuration, transition);
31
- const onCompleteRef = react.useRef(onComplete);
32
- onCompleteRef.current = onComplete;
33
- const hasCompletedRef = react.useRef(false);
34
- const isIndeterminate = value === void 0;
35
- const clampedValue = isIndeterminate ? 0 : Math.min(100, Math.max(0, value));
36
- react.useEffect(() => {
37
- if (clampedValue < 100) {
38
- hasCompletedRef.current = false;
39
- }
40
- }, [clampedValue]);
41
- react.useEffect(() => {
42
- if (!isIndeterminate && clampedValue === 100 && !hasCompletedRef.current && onCompleteRef.current) {
43
- hasCompletedRef.current = true;
44
- onCompleteRef.current();
45
- }
46
- }, [clampedValue, isIndeterminate]);
47
29
  if (!shouldRender) return null;
48
- const gradient = `linear-gradient(90deg, ${color}, ${secondaryColor}, ${color})`;
49
- const progressLabel = ariaLabel || (isIndeterminate ? "Loading..." : `Loading ${clampedValue}%`);
50
- return /* @__PURE__ */ jsxRuntime.jsx(
30
+ const inner = size - thickness * 2;
31
+ return /* @__PURE__ */ jsxRuntime.jsxs(
51
32
  "div",
52
33
  {
53
34
  ref,
54
35
  "data-testid": testId,
55
- className: classNames.cn("relative overflow-hidden rounded-full", className),
56
- style: {
57
- width: colors.normalizeSize(width),
58
- height,
59
- backgroundColor: `${color}20`,
60
- opacity,
61
- transition: transitionStyle,
62
- ...style
63
- },
64
- role: "progressbar",
65
- "aria-label": progressLabel,
66
- "aria-valuenow": isIndeterminate ? void 0 : clampedValue,
67
- "aria-valuemin": 0,
68
- "aria-valuemax": 100,
36
+ className: classNames.cn("relative inline-flex items-center justify-center", className),
37
+ style: { width: size, height: size, opacity, transition: transitionStyle, ...style },
38
+ role: "status",
39
+ "aria-label": ariaLabel,
69
40
  "aria-busy": "true",
70
41
  ...rest,
71
- children: isIndeterminate ? /* @__PURE__ */ jsxRuntime.jsx(
72
- "div",
73
- {
74
- className: "absolute h-full rounded-full",
75
- style: {
76
- background: gradient,
77
- backgroundSize: "200% 100%",
78
- animation: `gradient-flow ${effectiveDuration} linear infinite, progress-indeterminate ${effectiveDuration} ease-in-out infinite`
42
+ children: [
43
+ /* @__PURE__ */ jsxRuntime.jsx(
44
+ "div",
45
+ {
46
+ className: "absolute inset-0 rounded-full",
47
+ style: {
48
+ background: `conic-gradient(from 0deg, ${color}, ${secondaryColor}, transparent)`,
49
+ animation: `gradient-spin ${effectiveDuration} linear infinite`
50
+ }
79
51
  }
80
- }
81
- ) : /* @__PURE__ */ jsxRuntime.jsx(
82
- "div",
83
- {
84
- className: "h-full rounded-full",
85
- style: {
86
- width: `${clampedValue}%`,
87
- background: gradient,
88
- backgroundSize: "200% 100%",
89
- animation: `gradient-flow ${effectiveDuration} linear infinite`,
90
- transition: "width 0.3s ease-in-out"
52
+ ),
53
+ /* @__PURE__ */ jsxRuntime.jsx(
54
+ "div",
55
+ {
56
+ className: "absolute rounded-full",
57
+ style: { width: inner, height: inner, backgroundColor }
91
58
  }
92
- }
93
- )
59
+ )
60
+ ]
94
61
  }
95
62
  );
96
63
  }
97
64
  );
98
- GradientBar.displayName = "GradientBar";
99
- exports.GradientBar = GradientBar;
65
+ GradientSpinner.displayName = "GradientSpinner";
66
+ exports.GradientSpinner = GradientSpinner;
package/dist/index61.js CHANGED
@@ -1,16 +1,14 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef, useRef, useEffect } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index64.js";
4
- import { normalizeSize } from "./index4.js";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
5
4
  import { cn } from "./index3.js";
6
- const GradientBar = forwardRef(
5
+ const GradientSpinner = forwardRef(
7
6
  ({
8
- value,
9
- width = "100%",
10
- height = 8,
7
+ size = 48,
11
8
  color = "#3b82f6",
12
9
  secondaryColor = "#8b5cf6",
13
- onComplete,
10
+ thickness = 4,
11
+ backgroundColor = "white",
14
12
  speed = "normal",
15
13
  respectMotionPreference = true,
16
14
  delay = 0,
@@ -18,82 +16,51 @@ const GradientBar = forwardRef(
18
16
  transition,
19
17
  className,
20
18
  style,
21
- testId = "gradient-bar",
19
+ testId = "gradient-spinner",
22
20
  visible = true,
23
- ariaLabel,
21
+ ariaLabel = "Loading...",
24
22
  ...rest
25
23
  }, ref) => {
26
24
  const prefersReducedMotion = useReducedMotion();
27
25
  const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
26
  const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(visible, delay, minDuration, transition);
29
- const onCompleteRef = useRef(onComplete);
30
- onCompleteRef.current = onComplete;
31
- const hasCompletedRef = useRef(false);
32
- const isIndeterminate = value === void 0;
33
- const clampedValue = isIndeterminate ? 0 : Math.min(100, Math.max(0, value));
34
- useEffect(() => {
35
- if (clampedValue < 100) {
36
- hasCompletedRef.current = false;
37
- }
38
- }, [clampedValue]);
39
- useEffect(() => {
40
- if (!isIndeterminate && clampedValue === 100 && !hasCompletedRef.current && onCompleteRef.current) {
41
- hasCompletedRef.current = true;
42
- onCompleteRef.current();
43
- }
44
- }, [clampedValue, isIndeterminate]);
45
27
  if (!shouldRender) return null;
46
- const gradient = `linear-gradient(90deg, ${color}, ${secondaryColor}, ${color})`;
47
- const progressLabel = ariaLabel || (isIndeterminate ? "Loading..." : `Loading ${clampedValue}%`);
48
- return /* @__PURE__ */ jsx(
28
+ const inner = size - thickness * 2;
29
+ return /* @__PURE__ */ jsxs(
49
30
  "div",
50
31
  {
51
32
  ref,
52
33
  "data-testid": testId,
53
- className: cn("relative overflow-hidden rounded-full", className),
54
- style: {
55
- width: normalizeSize(width),
56
- height,
57
- backgroundColor: `${color}20`,
58
- opacity,
59
- transition: transitionStyle,
60
- ...style
61
- },
62
- role: "progressbar",
63
- "aria-label": progressLabel,
64
- "aria-valuenow": isIndeterminate ? void 0 : clampedValue,
65
- "aria-valuemin": 0,
66
- "aria-valuemax": 100,
34
+ className: cn("relative inline-flex items-center justify-center", className),
35
+ style: { width: size, height: size, opacity, transition: transitionStyle, ...style },
36
+ role: "status",
37
+ "aria-label": ariaLabel,
67
38
  "aria-busy": "true",
68
39
  ...rest,
69
- children: isIndeterminate ? /* @__PURE__ */ jsx(
70
- "div",
71
- {
72
- className: "absolute h-full rounded-full",
73
- style: {
74
- background: gradient,
75
- backgroundSize: "200% 100%",
76
- animation: `gradient-flow ${effectiveDuration} linear infinite, progress-indeterminate ${effectiveDuration} ease-in-out infinite`
40
+ children: [
41
+ /* @__PURE__ */ jsx(
42
+ "div",
43
+ {
44
+ className: "absolute inset-0 rounded-full",
45
+ style: {
46
+ background: `conic-gradient(from 0deg, ${color}, ${secondaryColor}, transparent)`,
47
+ animation: `gradient-spin ${effectiveDuration} linear infinite`
48
+ }
77
49
  }
78
- }
79
- ) : /* @__PURE__ */ jsx(
80
- "div",
81
- {
82
- className: "h-full rounded-full",
83
- style: {
84
- width: `${clampedValue}%`,
85
- background: gradient,
86
- backgroundSize: "200% 100%",
87
- animation: `gradient-flow ${effectiveDuration} linear infinite`,
88
- transition: "width 0.3s ease-in-out"
50
+ ),
51
+ /* @__PURE__ */ jsx(
52
+ "div",
53
+ {
54
+ className: "absolute rounded-full",
55
+ style: { width: inner, height: inner, backgroundColor }
89
56
  }
90
- }
91
- )
57
+ )
58
+ ]
92
59
  }
93
60
  );
94
61
  }
95
62
  );
96
- GradientBar.displayName = "GradientBar";
63
+ GradientSpinner.displayName = "GradientSpinner";
97
64
  export {
98
- GradientBar
65
+ GradientSpinner
99
66
  };
package/dist/index62.cjs CHANGED
@@ -2,15 +2,14 @@
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");
6
- const colors = require("./index4.cjs");
5
+ const hooks = require("./index71.cjs");
7
6
  const classNames = require("./index3.cjs");
8
- const ParticleBurst = react.forwardRef(
7
+ const GradientRing = react.forwardRef(
9
8
  ({
10
- size = 60,
11
- count = 8,
12
- color = "#3b82f6",
13
- particleSize = 6,
9
+ size = 48,
10
+ colors = ["#3b82f6", "#8b5cf6", "#ec4899"],
11
+ thickness = 6,
12
+ backgroundColor = "white",
14
13
  speed = "normal",
15
14
  respectMotionPreference = true,
16
15
  delay = 0,
@@ -18,7 +17,7 @@ const ParticleBurst = react.forwardRef(
18
17
  transition,
19
18
  className,
20
19
  style,
21
- testId = "particle-burst",
20
+ testId = "gradient-ring",
22
21
  visible = true,
23
22
  ariaLabel = "Loading...",
24
23
  ...rest
@@ -27,10 +26,10 @@ const ParticleBurst = react.forwardRef(
27
26
  const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
27
  const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(visible, delay, minDuration, transition);
29
28
  if (!shouldRender) return null;
30
- const clampedCount = Math.min(20, Math.max(4, count));
31
- const radius = size / 2;
32
- const durationMs = colors.parseDurationMs(effectiveDuration);
33
- return /* @__PURE__ */ jsxRuntime.jsx(
29
+ const stops = colors.join(", ");
30
+ const gradientStyle = `linear-gradient(135deg, ${stops}, ${colors[0]})`;
31
+ const inner = size - thickness * 2;
32
+ return /* @__PURE__ */ jsxRuntime.jsxs(
34
33
  "div",
35
34
  {
36
35
  ref,
@@ -41,35 +40,29 @@ const ParticleBurst = react.forwardRef(
41
40
  "aria-label": ariaLabel,
42
41
  "aria-busy": "true",
43
42
  ...rest,
44
- children: Array.from({ length: clampedCount }, (_, i) => {
45
- const angle = i / clampedCount * 2 * Math.PI;
46
- const tx = Math.cos(angle) * radius;
47
- const ty = Math.sin(angle) * radius;
48
- const animationDelay = `${i / clampedCount * durationMs}ms`;
49
- return /* @__PURE__ */ jsxRuntime.jsx(
43
+ children: [
44
+ /* @__PURE__ */ jsxRuntime.jsx(
50
45
  "div",
51
46
  {
52
- className: "absolute rounded-full",
47
+ className: "absolute inset-0 rounded-full",
53
48
  style: {
54
- width: particleSize,
55
- height: particleSize,
56
- backgroundColor: color,
57
- top: "50%",
58
- left: "50%",
59
- marginTop: -particleSize / 2,
60
- marginLeft: -particleSize / 2,
61
- animation: `particle-burst ${effectiveDuration} ease-out infinite`,
62
- animationDelay,
63
- ["--tx"]: `${tx}px`,
64
- ["--ty"]: `${ty}px`
49
+ background: gradientStyle,
50
+ backgroundSize: "200% 200%",
51
+ animation: `gradient-flow ${effectiveDuration} ease infinite, gradient-spin ${effectiveDuration} linear infinite`
65
52
  }
66
- },
67
- i
68
- );
69
- })
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsxRuntime.jsx(
56
+ "div",
57
+ {
58
+ className: "absolute rounded-full",
59
+ style: { width: inner, height: inner, backgroundColor }
60
+ }
61
+ )
62
+ ]
70
63
  }
71
64
  );
72
65
  }
73
66
  );
74
- ParticleBurst.displayName = "ParticleBurst";
75
- exports.ParticleBurst = ParticleBurst;
67
+ GradientRing.displayName = "GradientRing";
68
+ exports.GradientRing = GradientRing;
package/dist/index62.js CHANGED
@@ -1,14 +1,13 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index64.js";
4
- import { parseDurationMs } from "./index4.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
5
4
  import { cn } from "./index3.js";
6
- const ParticleBurst = forwardRef(
5
+ const GradientRing = forwardRef(
7
6
  ({
8
- size = 60,
9
- count = 8,
10
- color = "#3b82f6",
11
- particleSize = 6,
7
+ size = 48,
8
+ colors = ["#3b82f6", "#8b5cf6", "#ec4899"],
9
+ thickness = 6,
10
+ backgroundColor = "white",
12
11
  speed = "normal",
13
12
  respectMotionPreference = true,
14
13
  delay = 0,
@@ -16,7 +15,7 @@ const ParticleBurst = forwardRef(
16
15
  transition,
17
16
  className,
18
17
  style,
19
- testId = "particle-burst",
18
+ testId = "gradient-ring",
20
19
  visible = true,
21
20
  ariaLabel = "Loading...",
22
21
  ...rest
@@ -25,10 +24,10 @@ const ParticleBurst = forwardRef(
25
24
  const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
26
25
  const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(visible, delay, minDuration, transition);
27
26
  if (!shouldRender) return null;
28
- const clampedCount = Math.min(20, Math.max(4, count));
29
- const radius = size / 2;
30
- const durationMs = parseDurationMs(effectiveDuration);
31
- return /* @__PURE__ */ jsx(
27
+ const stops = colors.join(", ");
28
+ const gradientStyle = `linear-gradient(135deg, ${stops}, ${colors[0]})`;
29
+ const inner = size - thickness * 2;
30
+ return /* @__PURE__ */ jsxs(
32
31
  "div",
33
32
  {
34
33
  ref,
@@ -39,37 +38,31 @@ const ParticleBurst = forwardRef(
39
38
  "aria-label": ariaLabel,
40
39
  "aria-busy": "true",
41
40
  ...rest,
42
- children: Array.from({ length: clampedCount }, (_, i) => {
43
- const angle = i / clampedCount * 2 * Math.PI;
44
- const tx = Math.cos(angle) * radius;
45
- const ty = Math.sin(angle) * radius;
46
- const animationDelay = `${i / clampedCount * durationMs}ms`;
47
- return /* @__PURE__ */ jsx(
41
+ children: [
42
+ /* @__PURE__ */ jsx(
48
43
  "div",
49
44
  {
50
- className: "absolute rounded-full",
45
+ className: "absolute inset-0 rounded-full",
51
46
  style: {
52
- width: particleSize,
53
- height: particleSize,
54
- backgroundColor: color,
55
- top: "50%",
56
- left: "50%",
57
- marginTop: -particleSize / 2,
58
- marginLeft: -particleSize / 2,
59
- animation: `particle-burst ${effectiveDuration} ease-out infinite`,
60
- animationDelay,
61
- ["--tx"]: `${tx}px`,
62
- ["--ty"]: `${ty}px`
47
+ background: gradientStyle,
48
+ backgroundSize: "200% 200%",
49
+ animation: `gradient-flow ${effectiveDuration} ease infinite, gradient-spin ${effectiveDuration} linear infinite`
63
50
  }
64
- },
65
- i
66
- );
67
- })
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsx(
54
+ "div",
55
+ {
56
+ className: "absolute rounded-full",
57
+ style: { width: inner, height: inner, backgroundColor }
58
+ }
59
+ )
60
+ ]
68
61
  }
69
62
  );
70
63
  }
71
64
  );
72
- ParticleBurst.displayName = "ParticleBurst";
65
+ GradientRing.displayName = "GradientRing";
73
66
  export {
74
- ParticleBurst
67
+ GradientRing
75
68
  };