premium-react-loaders 3.1.1 → 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 (197) hide show
  1. package/README.md +30 -3
  2. package/dist/components/gradient/GradientBar.d.ts +13 -0
  3. package/dist/components/gradient/GradientBar.d.ts.map +1 -0
  4. package/dist/components/gradient/GradientRing.d.ts +12 -0
  5. package/dist/components/gradient/GradientRing.d.ts.map +1 -0
  6. package/dist/components/gradient/GradientSpinner.d.ts +12 -0
  7. package/dist/components/gradient/GradientSpinner.d.ts.map +1 -0
  8. package/dist/components/gradient/index.d.ts +4 -0
  9. package/dist/components/gradient/index.d.ts.map +1 -0
  10. package/dist/components/index.d.ts +4 -0
  11. package/dist/components/index.d.ts.map +1 -1
  12. package/dist/components/morph/LiquidFill.d.ts +13 -0
  13. package/dist/components/morph/LiquidFill.d.ts.map +1 -0
  14. package/dist/components/morph/MorphBlob.d.ts +12 -0
  15. package/dist/components/morph/MorphBlob.d.ts.map +1 -0
  16. package/dist/components/morph/WaveCircle.d.ts +12 -0
  17. package/dist/components/morph/WaveCircle.d.ts.map +1 -0
  18. package/dist/components/morph/index.d.ts +4 -0
  19. package/dist/components/morph/index.d.ts.map +1 -0
  20. package/dist/components/neon/NeonPulse.d.ts +12 -0
  21. package/dist/components/neon/NeonPulse.d.ts.map +1 -0
  22. package/dist/components/neon/NeonSpinner.d.ts +12 -0
  23. package/dist/components/neon/NeonSpinner.d.ts.map +1 -0
  24. package/dist/components/neon/NeonText.d.ts +12 -0
  25. package/dist/components/neon/NeonText.d.ts.map +1 -0
  26. package/dist/components/neon/index.d.ts +4 -0
  27. package/dist/components/neon/index.d.ts.map +1 -0
  28. package/dist/components/particle/ParticleBurst.d.ts +12 -0
  29. package/dist/components/particle/ParticleBurst.d.ts.map +1 -0
  30. package/dist/components/particle/ParticleField.d.ts +3 -0
  31. package/dist/components/particle/ParticleField.d.ts.map +1 -0
  32. package/dist/components/particle/ParticleOrbit.d.ts +12 -0
  33. package/dist/components/particle/ParticleOrbit.d.ts.map +1 -0
  34. package/dist/components/particle/ParticleTrail.d.ts +12 -0
  35. package/dist/components/particle/ParticleTrail.d.ts.map +1 -0
  36. package/dist/components/particle/index.d.ts +5 -0
  37. package/dist/components/particle/index.d.ts.map +1 -0
  38. package/dist/components/progress/ProgressBar.d.ts.map +1 -1
  39. package/dist/components/progress/ProgressCircle.d.ts.map +1 -1
  40. package/dist/components/progress/ProgressRing.d.ts.map +1 -1
  41. package/dist/components/status/InfoIndicator.d.ts +29 -0
  42. package/dist/components/status/InfoIndicator.d.ts.map +1 -0
  43. package/dist/components/status/WarningIndicator.d.ts +29 -0
  44. package/dist/components/status/WarningIndicator.d.ts.map +1 -0
  45. package/dist/components/status/index.d.ts +2 -0
  46. package/dist/components/status/index.d.ts.map +1 -1
  47. package/dist/index.cjs +50 -20
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +50 -20
  50. package/dist/index10.cjs +1 -1
  51. package/dist/index10.js +1 -1
  52. package/dist/index11.cjs +1 -1
  53. package/dist/index11.js +1 -1
  54. package/dist/index12.cjs +1 -1
  55. package/dist/index12.js +1 -1
  56. package/dist/index13.cjs +1 -1
  57. package/dist/index13.js +1 -1
  58. package/dist/index14.cjs +1 -1
  59. package/dist/index14.js +1 -1
  60. package/dist/index15.cjs +1 -1
  61. package/dist/index15.js +1 -1
  62. package/dist/index17.cjs +1 -1
  63. package/dist/index17.js +1 -1
  64. package/dist/index18.cjs +1 -1
  65. package/dist/index18.js +1 -1
  66. package/dist/index19.cjs +1 -1
  67. package/dist/index19.js +1 -1
  68. package/dist/index20.cjs +1 -1
  69. package/dist/index20.js +1 -1
  70. package/dist/index21.cjs +1 -1
  71. package/dist/index21.js +1 -1
  72. package/dist/index22.cjs +1 -1
  73. package/dist/index22.js +1 -1
  74. package/dist/index23.cjs +1 -1
  75. package/dist/index23.js +1 -1
  76. package/dist/index24.cjs +1 -1
  77. package/dist/index24.js +1 -1
  78. package/dist/index25.cjs +17 -2
  79. package/dist/index25.js +18 -3
  80. package/dist/index26.cjs +17 -2
  81. package/dist/index26.js +18 -3
  82. package/dist/index27.cjs +17 -2
  83. package/dist/index27.js +18 -3
  84. package/dist/index28.cjs +1 -1
  85. package/dist/index28.js +1 -1
  86. package/dist/index29.cjs +1 -1
  87. package/dist/index29.js +1 -1
  88. package/dist/index30.cjs +1 -1
  89. package/dist/index30.js +1 -1
  90. package/dist/index31.cjs +1 -1
  91. package/dist/index31.js +1 -1
  92. package/dist/index32.cjs +1 -1
  93. package/dist/index32.js +1 -1
  94. package/dist/index33.cjs +1 -1
  95. package/dist/index33.js +1 -1
  96. package/dist/index34.cjs +1 -1
  97. package/dist/index34.js +1 -1
  98. package/dist/index35.cjs +1 -1
  99. package/dist/index35.js +1 -1
  100. package/dist/index36.cjs +1 -1
  101. package/dist/index36.js +1 -1
  102. package/dist/index37.cjs +59 -145
  103. package/dist/index37.js +61 -147
  104. package/dist/index38.cjs +32 -53
  105. package/dist/index38.js +33 -54
  106. package/dist/index39.cjs +138 -84
  107. package/dist/index39.js +140 -86
  108. package/dist/index4.cjs +10 -0
  109. package/dist/index4.js +10 -0
  110. package/dist/index40.cjs +33 -106
  111. package/dist/index40.js +34 -107
  112. package/dist/index41.cjs +66 -50
  113. package/dist/index41.js +66 -50
  114. package/dist/index42.cjs +123 -44
  115. package/dist/index42.js +124 -45
  116. package/dist/index43.cjs +43 -85
  117. package/dist/index43.js +44 -86
  118. package/dist/index44.cjs +35 -27
  119. package/dist/index44.js +35 -27
  120. package/dist/index45.cjs +87 -58
  121. package/dist/index45.js +87 -58
  122. package/dist/index46.cjs +35 -88
  123. package/dist/index46.js +36 -89
  124. package/dist/index47.cjs +62 -58
  125. package/dist/index47.js +63 -59
  126. package/dist/index48.cjs +87 -110
  127. package/dist/index48.js +88 -111
  128. package/dist/index49.cjs +48 -109
  129. package/dist/index49.js +49 -110
  130. package/dist/index50.cjs +110 -62
  131. package/dist/index50.js +111 -63
  132. package/dist/index51.cjs +104 -49
  133. package/dist/index51.js +104 -49
  134. package/dist/index52.cjs +43 -77
  135. package/dist/index52.js +44 -78
  136. package/dist/index53.cjs +56 -56
  137. package/dist/index53.js +56 -56
  138. package/dist/index54.cjs +104 -149
  139. package/dist/index54.js +106 -151
  140. package/dist/index55.cjs +97 -38
  141. package/dist/index55.js +99 -40
  142. package/dist/index56.cjs +184 -120
  143. package/dist/index56.js +185 -121
  144. package/dist/index57.cjs +53 -0
  145. package/dist/index57.js +53 -0
  146. package/dist/index58.cjs +55 -0
  147. package/dist/index58.js +55 -0
  148. package/dist/index59.cjs +119 -0
  149. package/dist/index59.js +119 -0
  150. package/dist/index60.cjs +70 -0
  151. package/dist/index60.js +70 -0
  152. package/dist/index61.cjs +66 -0
  153. package/dist/index61.js +66 -0
  154. package/dist/index62.cjs +68 -0
  155. package/dist/index62.js +68 -0
  156. package/dist/index63.cjs +99 -0
  157. package/dist/index63.js +99 -0
  158. package/dist/index64.cjs +75 -0
  159. package/dist/index64.js +75 -0
  160. package/dist/index65.cjs +92 -0
  161. package/dist/index65.js +92 -0
  162. package/dist/index66.cjs +76 -0
  163. package/dist/index66.js +76 -0
  164. package/dist/index67.cjs +76 -0
  165. package/dist/index67.js +76 -0
  166. package/dist/index68.cjs +64 -0
  167. package/dist/index68.js +64 -0
  168. package/dist/index69.cjs +60 -0
  169. package/dist/index69.js +60 -0
  170. package/dist/index7.cjs +1 -1
  171. package/dist/index7.js +1 -1
  172. package/dist/index70.cjs +57 -0
  173. package/dist/index70.js +57 -0
  174. package/dist/index71.cjs +125 -0
  175. package/dist/index71.js +125 -0
  176. package/dist/index8.cjs +1 -1
  177. package/dist/index8.js +1 -1
  178. package/dist/index9.cjs +1 -1
  179. package/dist/index9.js +1 -1
  180. package/dist/premium-react-loaders.css +126 -0
  181. package/dist/types/gradient.d.ts +38 -0
  182. package/dist/types/gradient.d.ts.map +1 -0
  183. package/dist/types/index.d.ts +4 -0
  184. package/dist/types/index.d.ts.map +1 -1
  185. package/dist/types/morph.d.ts +28 -0
  186. package/dist/types/morph.d.ts.map +1 -0
  187. package/dist/types/neon.d.ts +26 -0
  188. package/dist/types/neon.d.ts.map +1 -0
  189. package/dist/types/particle.d.ts +40 -0
  190. package/dist/types/particle.d.ts.map +1 -0
  191. package/dist/types/progress.d.ts +6 -0
  192. package/dist/types/progress.d.ts.map +1 -1
  193. package/dist/types/status.d.ts +30 -0
  194. package/dist/types/status.d.ts.map +1 -1
  195. package/dist/utils/colors.d.ts +5 -0
  196. package/dist/utils/colors.d.ts.map +1 -1
  197. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const react = require("react");
5
+ const hooks = require("./index71.cjs");
6
+ const classNames = require("./index3.cjs");
7
+ const GradientRing = react.forwardRef(
8
+ ({
9
+ size = 48,
10
+ colors = ["#3b82f6", "#8b5cf6", "#ec4899"],
11
+ thickness = 6,
12
+ backgroundColor = "white",
13
+ speed = "normal",
14
+ respectMotionPreference = true,
15
+ delay = 0,
16
+ minDuration = 0,
17
+ transition,
18
+ className,
19
+ style,
20
+ testId = "gradient-ring",
21
+ visible = true,
22
+ ariaLabel = "Loading...",
23
+ ...rest
24
+ }, ref) => {
25
+ const prefersReducedMotion = hooks.useReducedMotion();
26
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
27
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(visible, delay, minDuration, transition);
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;
32
+ return /* @__PURE__ */ jsxRuntime.jsxs(
33
+ "div",
34
+ {
35
+ ref,
36
+ "data-testid": testId,
37
+ className: classNames.cn("relative inline-flex items-center justify-center", className),
38
+ style: { width: size, height: size, opacity, transition: transitionStyle, ...style },
39
+ role: "status",
40
+ "aria-label": ariaLabel,
41
+ "aria-busy": "true",
42
+ ...rest,
43
+ children: [
44
+ /* @__PURE__ */ jsxRuntime.jsx(
45
+ "div",
46
+ {
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
+ }
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsxRuntime.jsx(
56
+ "div",
57
+ {
58
+ className: "absolute rounded-full",
59
+ style: { width: inner, height: inner, backgroundColor }
60
+ }
61
+ )
62
+ ]
63
+ }
64
+ );
65
+ }
66
+ );
67
+ GradientRing.displayName = "GradientRing";
68
+ exports.GradientRing = GradientRing;
@@ -0,0 +1,68 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
4
+ import { cn } from "./index3.js";
5
+ const GradientRing = forwardRef(
6
+ ({
7
+ size = 48,
8
+ colors = ["#3b82f6", "#8b5cf6", "#ec4899"],
9
+ thickness = 6,
10
+ backgroundColor = "white",
11
+ speed = "normal",
12
+ respectMotionPreference = true,
13
+ delay = 0,
14
+ minDuration = 0,
15
+ transition,
16
+ className,
17
+ style,
18
+ testId = "gradient-ring",
19
+ visible = true,
20
+ ariaLabel = "Loading...",
21
+ ...rest
22
+ }, ref) => {
23
+ const prefersReducedMotion = useReducedMotion();
24
+ const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
25
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(visible, delay, minDuration, transition);
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;
30
+ return /* @__PURE__ */ jsxs(
31
+ "div",
32
+ {
33
+ ref,
34
+ "data-testid": testId,
35
+ className: cn("relative inline-flex items-center justify-center", className),
36
+ style: { width: size, height: size, opacity, transition: transitionStyle, ...style },
37
+ role: "status",
38
+ "aria-label": ariaLabel,
39
+ "aria-busy": "true",
40
+ ...rest,
41
+ children: [
42
+ /* @__PURE__ */ jsx(
43
+ "div",
44
+ {
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
+ }
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsx(
54
+ "div",
55
+ {
56
+ className: "absolute rounded-full",
57
+ style: { width: inner, height: inner, backgroundColor }
58
+ }
59
+ )
60
+ ]
61
+ }
62
+ );
63
+ }
64
+ );
65
+ GradientRing.displayName = "GradientRing";
66
+ export {
67
+ GradientRing
68
+ };
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const react = require("react");
5
+ const hooks = require("./index71.cjs");
6
+ const colors = require("./index4.cjs");
7
+ const classNames = require("./index3.cjs");
8
+ const GradientBar = react.forwardRef(
9
+ ({
10
+ value,
11
+ width = "100%",
12
+ height = 8,
13
+ color = "#3b82f6",
14
+ secondaryColor = "#8b5cf6",
15
+ onComplete,
16
+ speed = "normal",
17
+ respectMotionPreference = true,
18
+ delay = 0,
19
+ minDuration = 0,
20
+ transition,
21
+ className,
22
+ style,
23
+ testId = "gradient-bar",
24
+ visible = true,
25
+ ariaLabel,
26
+ ...rest
27
+ }, ref) => {
28
+ const prefersReducedMotion = hooks.useReducedMotion();
29
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
30
+ 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
+ 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(
51
+ "div",
52
+ {
53
+ ref,
54
+ "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,
69
+ "aria-busy": "true",
70
+ ...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`
79
+ }
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"
91
+ }
92
+ }
93
+ )
94
+ }
95
+ );
96
+ }
97
+ );
98
+ GradientBar.displayName = "GradientBar";
99
+ exports.GradientBar = GradientBar;
@@ -0,0 +1,99 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useRef, useEffect } from "react";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
4
+ import { normalizeSize } from "./index4.js";
5
+ import { cn } from "./index3.js";
6
+ const GradientBar = forwardRef(
7
+ ({
8
+ value,
9
+ width = "100%",
10
+ height = 8,
11
+ color = "#3b82f6",
12
+ secondaryColor = "#8b5cf6",
13
+ onComplete,
14
+ speed = "normal",
15
+ respectMotionPreference = true,
16
+ delay = 0,
17
+ minDuration = 0,
18
+ transition,
19
+ className,
20
+ style,
21
+ testId = "gradient-bar",
22
+ visible = true,
23
+ ariaLabel,
24
+ ...rest
25
+ }, ref) => {
26
+ const prefersReducedMotion = useReducedMotion();
27
+ const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
+ 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
+ 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(
49
+ "div",
50
+ {
51
+ ref,
52
+ "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,
67
+ "aria-busy": "true",
68
+ ...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`
77
+ }
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"
89
+ }
90
+ }
91
+ )
92
+ }
93
+ );
94
+ }
95
+ );
96
+ GradientBar.displayName = "GradientBar";
97
+ export {
98
+ GradientBar
99
+ };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const react = require("react");
5
+ const hooks = require("./index71.cjs");
6
+ const colors = require("./index4.cjs");
7
+ const classNames = require("./index3.cjs");
8
+ const ParticleBurst = react.forwardRef(
9
+ ({
10
+ size = 60,
11
+ count = 8,
12
+ color = "#3b82f6",
13
+ particleSize = 6,
14
+ speed = "normal",
15
+ respectMotionPreference = true,
16
+ delay = 0,
17
+ minDuration = 0,
18
+ transition,
19
+ className,
20
+ style,
21
+ testId = "particle-burst",
22
+ visible = true,
23
+ ariaLabel = "Loading...",
24
+ ...rest
25
+ }, ref) => {
26
+ const prefersReducedMotion = hooks.useReducedMotion();
27
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(visible, delay, minDuration, transition);
29
+ 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(
34
+ "div",
35
+ {
36
+ ref,
37
+ "data-testid": testId,
38
+ className: classNames.cn("relative inline-flex items-center justify-center", className),
39
+ style: { width: size, height: size, opacity, transition: transitionStyle, ...style },
40
+ role: "status",
41
+ "aria-label": ariaLabel,
42
+ "aria-busy": "true",
43
+ ...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(
50
+ "div",
51
+ {
52
+ className: "absolute rounded-full",
53
+ 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`
65
+ }
66
+ },
67
+ i
68
+ );
69
+ })
70
+ }
71
+ );
72
+ }
73
+ );
74
+ ParticleBurst.displayName = "ParticleBurst";
75
+ exports.ParticleBurst = ParticleBurst;
@@ -0,0 +1,75 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
4
+ import { parseDurationMs } from "./index4.js";
5
+ import { cn } from "./index3.js";
6
+ const ParticleBurst = forwardRef(
7
+ ({
8
+ size = 60,
9
+ count = 8,
10
+ color = "#3b82f6",
11
+ particleSize = 6,
12
+ speed = "normal",
13
+ respectMotionPreference = true,
14
+ delay = 0,
15
+ minDuration = 0,
16
+ transition,
17
+ className,
18
+ style,
19
+ testId = "particle-burst",
20
+ visible = true,
21
+ ariaLabel = "Loading...",
22
+ ...rest
23
+ }, ref) => {
24
+ const prefersReducedMotion = useReducedMotion();
25
+ const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
26
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(visible, delay, minDuration, transition);
27
+ 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(
32
+ "div",
33
+ {
34
+ ref,
35
+ "data-testid": testId,
36
+ className: 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,
40
+ "aria-busy": "true",
41
+ ...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(
48
+ "div",
49
+ {
50
+ className: "absolute rounded-full",
51
+ 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`
63
+ }
64
+ },
65
+ i
66
+ );
67
+ })
68
+ }
69
+ );
70
+ }
71
+ );
72
+ ParticleBurst.displayName = "ParticleBurst";
73
+ export {
74
+ ParticleBurst
75
+ };
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const react = require("react");
5
+ const hooks = require("./index71.cjs");
6
+ const colors = require("./index4.cjs");
7
+ const classNames = require("./index3.cjs");
8
+ const ParticleOrbit = react.forwardRef(
9
+ ({
10
+ size = 80,
11
+ count = 5,
12
+ color = "#3b82f6",
13
+ centerColor,
14
+ speed = "normal",
15
+ respectMotionPreference = true,
16
+ delay = 0,
17
+ minDuration = 0,
18
+ transition,
19
+ className,
20
+ style,
21
+ testId = "particle-orbit",
22
+ visible = true,
23
+ ariaLabel = "Loading...",
24
+ ...rest
25
+ }, ref) => {
26
+ const prefersReducedMotion = hooks.useReducedMotion();
27
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(visible, delay, minDuration, transition);
29
+ if (!shouldRender) return null;
30
+ const clampedCount = Math.min(8, Math.max(3, count));
31
+ const orbitRadius = size * 0.35;
32
+ const particleSize = size * 0.1;
33
+ const centerSize = size * 0.15;
34
+ const dotColor = centerColor || color;
35
+ const durationMs = colors.parseDurationMs(effectiveDuration);
36
+ return /* @__PURE__ */ jsxRuntime.jsxs(
37
+ "div",
38
+ {
39
+ ref,
40
+ "data-testid": testId,
41
+ className: classNames.cn("relative inline-flex items-center justify-center", className),
42
+ style: { width: size, height: size, opacity, transition: transitionStyle, ...style },
43
+ role: "status",
44
+ "aria-label": ariaLabel,
45
+ "aria-busy": "true",
46
+ ...rest,
47
+ children: [
48
+ /* @__PURE__ */ jsxRuntime.jsx(
49
+ "div",
50
+ {
51
+ className: "absolute rounded-full z-10",
52
+ style: {
53
+ width: centerSize,
54
+ height: centerSize,
55
+ backgroundColor: dotColor,
56
+ top: "50%",
57
+ left: "50%",
58
+ transform: "translate(-50%, -50%)"
59
+ }
60
+ }
61
+ ),
62
+ Array.from({ length: clampedCount }, (_, i) => {
63
+ const startAngle = `${i / clampedCount * 360}deg`;
64
+ const staggerDelay = `-${i / clampedCount * durationMs}ms`;
65
+ return /* @__PURE__ */ jsxRuntime.jsx(
66
+ "div",
67
+ {
68
+ className: "absolute rounded-full",
69
+ style: {
70
+ width: particleSize,
71
+ height: particleSize,
72
+ backgroundColor: color,
73
+ top: "50%",
74
+ left: "50%",
75
+ marginTop: -particleSize / 2,
76
+ marginLeft: -particleSize / 2,
77
+ animation: `particle-orbit ${effectiveDuration} linear infinite`,
78
+ animationDelay: staggerDelay,
79
+ ["--start-angle"]: startAngle,
80
+ ["--orbit-radius"]: `${orbitRadius}px`
81
+ }
82
+ },
83
+ i
84
+ );
85
+ })
86
+ ]
87
+ }
88
+ );
89
+ }
90
+ );
91
+ ParticleOrbit.displayName = "ParticleOrbit";
92
+ exports.ParticleOrbit = ParticleOrbit;
@@ -0,0 +1,92 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
4
+ import { parseDurationMs } from "./index4.js";
5
+ import { cn } from "./index3.js";
6
+ const ParticleOrbit = forwardRef(
7
+ ({
8
+ size = 80,
9
+ count = 5,
10
+ color = "#3b82f6",
11
+ centerColor,
12
+ speed = "normal",
13
+ respectMotionPreference = true,
14
+ delay = 0,
15
+ minDuration = 0,
16
+ transition,
17
+ className,
18
+ style,
19
+ testId = "particle-orbit",
20
+ visible = true,
21
+ ariaLabel = "Loading...",
22
+ ...rest
23
+ }, ref) => {
24
+ const prefersReducedMotion = useReducedMotion();
25
+ const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
26
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(visible, delay, minDuration, transition);
27
+ if (!shouldRender) return null;
28
+ const clampedCount = Math.min(8, Math.max(3, count));
29
+ const orbitRadius = size * 0.35;
30
+ const particleSize = size * 0.1;
31
+ const centerSize = size * 0.15;
32
+ const dotColor = centerColor || color;
33
+ const durationMs = parseDurationMs(effectiveDuration);
34
+ return /* @__PURE__ */ jsxs(
35
+ "div",
36
+ {
37
+ ref,
38
+ "data-testid": testId,
39
+ className: cn("relative inline-flex items-center justify-center", className),
40
+ style: { width: size, height: size, opacity, transition: transitionStyle, ...style },
41
+ role: "status",
42
+ "aria-label": ariaLabel,
43
+ "aria-busy": "true",
44
+ ...rest,
45
+ children: [
46
+ /* @__PURE__ */ jsx(
47
+ "div",
48
+ {
49
+ className: "absolute rounded-full z-10",
50
+ style: {
51
+ width: centerSize,
52
+ height: centerSize,
53
+ backgroundColor: dotColor,
54
+ top: "50%",
55
+ left: "50%",
56
+ transform: "translate(-50%, -50%)"
57
+ }
58
+ }
59
+ ),
60
+ Array.from({ length: clampedCount }, (_, i) => {
61
+ const startAngle = `${i / clampedCount * 360}deg`;
62
+ const staggerDelay = `-${i / clampedCount * durationMs}ms`;
63
+ return /* @__PURE__ */ jsx(
64
+ "div",
65
+ {
66
+ className: "absolute rounded-full",
67
+ style: {
68
+ width: particleSize,
69
+ height: particleSize,
70
+ backgroundColor: color,
71
+ top: "50%",
72
+ left: "50%",
73
+ marginTop: -particleSize / 2,
74
+ marginLeft: -particleSize / 2,
75
+ animation: `particle-orbit ${effectiveDuration} linear infinite`,
76
+ animationDelay: staggerDelay,
77
+ ["--start-angle"]: startAngle,
78
+ ["--orbit-radius"]: `${orbitRadius}px`
79
+ }
80
+ },
81
+ i
82
+ );
83
+ })
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ );
89
+ ParticleOrbit.displayName = "ParticleOrbit";
90
+ export {
91
+ ParticleOrbit
92
+ };