premium-react-loaders 1.2.0 → 2.0.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 (154) hide show
  1. package/README.md +64 -30
  2. package/dist/components/overlay/LoaderOverlay.d.ts.map +1 -1
  3. package/dist/components/progress/ProgressBar.d.ts.map +1 -1
  4. package/dist/components/progress/ProgressCircle.d.ts.map +1 -1
  5. package/dist/components/progress/ProgressRing.d.ts.map +1 -1
  6. package/dist/components/progress/ProgressSteps.d.ts.map +1 -1
  7. package/dist/components/pulse/PulseBars.d.ts.map +1 -1
  8. package/dist/components/pulse/PulseDots.d.ts.map +1 -1
  9. package/dist/components/pulse/PulseWave.d.ts.map +1 -1
  10. package/dist/components/pulse/TypingIndicator.d.ts.map +1 -1
  11. package/dist/components/skeleton/Skeleton.d.ts.map +1 -1
  12. package/dist/components/skeleton/SkeletonAvatar.d.ts.map +1 -1
  13. package/dist/components/skeleton/SkeletonCard.d.ts.map +1 -1
  14. package/dist/components/skeleton/SkeletonForm.d.ts.map +1 -1
  15. package/dist/components/skeleton/SkeletonImage.d.ts.map +1 -1
  16. package/dist/components/skeleton/SkeletonList.d.ts.map +1 -1
  17. package/dist/components/skeleton/SkeletonPage.d.ts.map +1 -1
  18. package/dist/components/skeleton/SkeletonTable.d.ts.map +1 -1
  19. package/dist/components/skeleton/SkeletonText.d.ts.map +1 -1
  20. package/dist/components/spinner/SpinnerBars.d.ts.map +1 -1
  21. package/dist/components/spinner/SpinnerCircle.d.ts.map +1 -1
  22. package/dist/components/spinner/SpinnerDots.d.ts.map +1 -1
  23. package/dist/components/spinner/SpinnerGrid.d.ts.map +1 -1
  24. package/dist/components/spinner/SpinnerPulse.d.ts.map +1 -1
  25. package/dist/components/spinner/SpinnerRing.d.ts.map +1 -1
  26. package/dist/components/spinner/SpinnerWave.d.ts.map +1 -1
  27. package/dist/index.cjs +0 -1
  28. package/dist/index.js +0 -1
  29. package/dist/index10.cjs +14 -3
  30. package/dist/index10.js +14 -3
  31. package/dist/index11.cjs +16 -3
  32. package/dist/index11.js +16 -3
  33. package/dist/index12.cjs +16 -3
  34. package/dist/index12.js +16 -3
  35. package/dist/index13.cjs +12 -3
  36. package/dist/index13.js +12 -3
  37. package/dist/index14.cjs +16 -4
  38. package/dist/index14.js +16 -4
  39. package/dist/index15.cjs +16 -4
  40. package/dist/index15.js +16 -4
  41. package/dist/index16.cjs +16 -4
  42. package/dist/index16.js +16 -4
  43. package/dist/index17.cjs +14 -4
  44. package/dist/index17.js +14 -4
  45. package/dist/index18.cjs +18 -6
  46. package/dist/index18.js +18 -6
  47. package/dist/index19.cjs +16 -4
  48. package/dist/index19.js +16 -4
  49. package/dist/index20.cjs +16 -4
  50. package/dist/index20.js +16 -4
  51. package/dist/index21.cjs +15 -5
  52. package/dist/index21.js +15 -5
  53. package/dist/index22.cjs +14 -4
  54. package/dist/index22.js +14 -4
  55. package/dist/index23.cjs +15 -5
  56. package/dist/index23.js +15 -5
  57. package/dist/index24.cjs +16 -3
  58. package/dist/index24.js +16 -3
  59. package/dist/index25.cjs +14 -4
  60. package/dist/index25.js +14 -4
  61. package/dist/index26.cjs +16 -6
  62. package/dist/index26.js +16 -6
  63. package/dist/index27.cjs +16 -6
  64. package/dist/index27.js +16 -6
  65. package/dist/index28.cjs +14 -4
  66. package/dist/index28.js +14 -4
  67. package/dist/index29.cjs +14 -3
  68. package/dist/index29.js +14 -3
  69. package/dist/index3.cjs +11 -3
  70. package/dist/index3.js +11 -3
  71. package/dist/index30.cjs +122 -15
  72. package/dist/index30.js +121 -14
  73. package/dist/index4.cjs +0 -1
  74. package/dist/index4.js +0 -1
  75. package/dist/index5.cjs +14 -3
  76. package/dist/index5.js +14 -3
  77. package/dist/index6.cjs +14 -3
  78. package/dist/index6.js +14 -3
  79. package/dist/index7.cjs +16 -3
  80. package/dist/index7.js +16 -3
  81. package/dist/index8.cjs +14 -3
  82. package/dist/index8.js +14 -3
  83. package/dist/index9.cjs +16 -3
  84. package/dist/index9.js +16 -3
  85. package/dist/premium-react-loaders.css +217 -940
  86. package/dist/types/common.d.ts +6 -0
  87. package/dist/types/common.d.ts.map +1 -1
  88. package/dist/utils/classNames.d.ts +3 -2
  89. package/dist/utils/classNames.d.ts.map +1 -1
  90. package/dist/utils/hooks.d.ts +9 -0
  91. package/dist/utils/hooks.d.ts.map +1 -1
  92. package/package.json +5 -8
  93. package/dist/index.cjs.map +0 -1
  94. package/dist/index.js.map +0 -1
  95. package/dist/index10.cjs.map +0 -1
  96. package/dist/index10.js.map +0 -1
  97. package/dist/index11.cjs.map +0 -1
  98. package/dist/index11.js.map +0 -1
  99. package/dist/index12.cjs.map +0 -1
  100. package/dist/index12.js.map +0 -1
  101. package/dist/index13.cjs.map +0 -1
  102. package/dist/index13.js.map +0 -1
  103. package/dist/index14.cjs.map +0 -1
  104. package/dist/index14.js.map +0 -1
  105. package/dist/index15.cjs.map +0 -1
  106. package/dist/index15.js.map +0 -1
  107. package/dist/index16.cjs.map +0 -1
  108. package/dist/index16.js.map +0 -1
  109. package/dist/index17.cjs.map +0 -1
  110. package/dist/index17.js.map +0 -1
  111. package/dist/index18.cjs.map +0 -1
  112. package/dist/index18.js.map +0 -1
  113. package/dist/index19.cjs.map +0 -1
  114. package/dist/index19.js.map +0 -1
  115. package/dist/index20.cjs.map +0 -1
  116. package/dist/index20.js.map +0 -1
  117. package/dist/index21.cjs.map +0 -1
  118. package/dist/index21.js.map +0 -1
  119. package/dist/index22.cjs.map +0 -1
  120. package/dist/index22.js.map +0 -1
  121. package/dist/index23.cjs.map +0 -1
  122. package/dist/index23.js.map +0 -1
  123. package/dist/index24.cjs.map +0 -1
  124. package/dist/index24.js.map +0 -1
  125. package/dist/index25.cjs.map +0 -1
  126. package/dist/index25.js.map +0 -1
  127. package/dist/index26.cjs.map +0 -1
  128. package/dist/index26.js.map +0 -1
  129. package/dist/index27.cjs.map +0 -1
  130. package/dist/index27.js.map +0 -1
  131. package/dist/index28.cjs.map +0 -1
  132. package/dist/index28.js.map +0 -1
  133. package/dist/index29.cjs.map +0 -1
  134. package/dist/index29.js.map +0 -1
  135. package/dist/index3.cjs.map +0 -1
  136. package/dist/index3.js.map +0 -1
  137. package/dist/index30.cjs.map +0 -1
  138. package/dist/index30.js.map +0 -1
  139. package/dist/index31.cjs +0 -42
  140. package/dist/index31.cjs.map +0 -1
  141. package/dist/index31.js +0 -42
  142. package/dist/index31.js.map +0 -1
  143. package/dist/index4.cjs.map +0 -1
  144. package/dist/index4.js.map +0 -1
  145. package/dist/index5.cjs.map +0 -1
  146. package/dist/index5.js.map +0 -1
  147. package/dist/index6.cjs.map +0 -1
  148. package/dist/index6.js.map +0 -1
  149. package/dist/index7.cjs.map +0 -1
  150. package/dist/index7.js.map +0 -1
  151. package/dist/index8.cjs.map +0 -1
  152. package/dist/index8.js.map +0 -1
  153. package/dist/index9.cjs.map +0 -1
  154. package/dist/index9.js.map +0 -1
package/dist/index13.cjs CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const Skeleton = require("./index5.cjs");
6
+ const hooks = require("./index30.cjs");
6
7
  const colors = require("./index4.cjs");
7
8
  const classNames = require("./index3.cjs");
8
9
  const SkeletonForm = react.forwardRef(
@@ -16,13 +17,22 @@ const SkeletonForm = react.forwardRef(
16
17
  animate = true,
17
18
  baseColor,
18
19
  highlightColor,
20
+ delay = 0,
21
+ minDuration = 0,
22
+ transition,
19
23
  className,
20
24
  style,
21
25
  testId = "skeleton-form",
22
26
  visible = true,
23
27
  ...rest
24
28
  }, ref) => {
25
- if (!visible) return null;
29
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
30
+ visible,
31
+ delay,
32
+ minDuration,
33
+ transition
34
+ );
35
+ if (!shouldRender) return null;
26
36
  const gapValue = colors.normalizeSize(gap);
27
37
  const buttonAlign = buttonPosition === "left" ? "justify-start" : buttonPosition === "right" ? "justify-end" : "justify-center";
28
38
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -31,7 +41,7 @@ const SkeletonForm = react.forwardRef(
31
41
  ref,
32
42
  "data-testid": testId,
33
43
  className: classNames.cn("w-full", className),
34
- style: { ...style, display: "flex", flexDirection: "column", gap: gapValue },
44
+ style: { ...style, display: "flex", flexDirection: "column", gap: gapValue, opacity, transition: transitionStyle },
35
45
  role: "status",
36
46
  "aria-label": "Loading form...",
37
47
  "aria-busy": "true",
@@ -79,4 +89,3 @@ const SkeletonForm = react.forwardRef(
79
89
  );
80
90
  SkeletonForm.displayName = "SkeletonForm";
81
91
  exports.SkeletonForm = SkeletonForm;
82
- //# sourceMappingURL=index13.cjs.map
package/dist/index13.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { Skeleton } from "./index5.js";
4
+ import { useLoaderVisibility } from "./index30.js";
4
5
  import { normalizeSize } from "./index4.js";
5
6
  import { cn } from "./index3.js";
6
7
  const SkeletonForm = forwardRef(
@@ -14,13 +15,22 @@ const SkeletonForm = forwardRef(
14
15
  animate = true,
15
16
  baseColor,
16
17
  highlightColor,
18
+ delay = 0,
19
+ minDuration = 0,
20
+ transition,
17
21
  className,
18
22
  style,
19
23
  testId = "skeleton-form",
20
24
  visible = true,
21
25
  ...rest
22
26
  }, ref) => {
23
- if (!visible) return null;
27
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
28
+ visible,
29
+ delay,
30
+ minDuration,
31
+ transition
32
+ );
33
+ if (!shouldRender) return null;
24
34
  const gapValue = normalizeSize(gap);
25
35
  const buttonAlign = buttonPosition === "left" ? "justify-start" : buttonPosition === "right" ? "justify-end" : "justify-center";
26
36
  return /* @__PURE__ */ jsxs(
@@ -29,7 +39,7 @@ const SkeletonForm = forwardRef(
29
39
  ref,
30
40
  "data-testid": testId,
31
41
  className: cn("w-full", className),
32
- style: { ...style, display: "flex", flexDirection: "column", gap: gapValue },
42
+ style: { ...style, display: "flex", flexDirection: "column", gap: gapValue, opacity, transition: transitionStyle },
33
43
  role: "status",
34
44
  "aria-label": "Loading form...",
35
45
  "aria-busy": "true",
@@ -79,4 +89,3 @@ SkeletonForm.displayName = "SkeletonForm";
79
89
  export {
80
90
  SkeletonForm
81
91
  };
82
- //# sourceMappingURL=index13.js.map
package/dist/index14.cjs CHANGED
@@ -2,7 +2,7 @@
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("./index31.cjs");
5
+ const hooks = require("./index30.cjs");
6
6
  const classNames = require("./index3.cjs");
7
7
  const colors = require("./index4.cjs");
8
8
  const SpinnerCircle = react.forwardRef(
@@ -13,6 +13,9 @@ const SpinnerCircle = react.forwardRef(
13
13
  speed = "normal",
14
14
  reverse = false,
15
15
  respectMotionPreference = true,
16
+ delay = 0,
17
+ minDuration = 0,
18
+ transition,
16
19
  className,
17
20
  style,
18
21
  testId = "spinner-circle",
@@ -20,16 +23,26 @@ const SpinnerCircle = react.forwardRef(
20
23
  ariaLabel = "Loading...",
21
24
  ...rest
22
25
  }, ref) => {
23
- if (!visible) return null;
24
26
  const prefersReducedMotion = hooks.useReducedMotion();
25
27
  const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
29
+ visible,
30
+ delay,
31
+ minDuration,
32
+ transition
33
+ );
34
+ if (!shouldRender) return null;
26
35
  return /* @__PURE__ */ jsxRuntime.jsx(
27
36
  "div",
28
37
  {
29
38
  ref,
30
39
  "data-testid": testId,
31
40
  className: classNames.cn("inline-flex items-center justify-center", className),
32
- style,
41
+ style: {
42
+ ...style,
43
+ opacity,
44
+ transition: transitionStyle
45
+ },
33
46
  role: "status",
34
47
  "aria-label": ariaLabel,
35
48
  "aria-busy": "true",
@@ -66,4 +79,3 @@ const SpinnerCircle = react.forwardRef(
66
79
  );
67
80
  SpinnerCircle.displayName = "SpinnerCircle";
68
81
  exports.SpinnerCircle = SpinnerCircle;
69
- //# sourceMappingURL=index14.cjs.map
package/dist/index14.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, getEffectiveDuration } from "./index31.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index30.js";
4
4
  import { cn } from "./index3.js";
5
5
  import { normalizeSize } from "./index4.js";
6
6
  const SpinnerCircle = forwardRef(
@@ -11,6 +11,9 @@ const SpinnerCircle = forwardRef(
11
11
  speed = "normal",
12
12
  reverse = false,
13
13
  respectMotionPreference = true,
14
+ delay = 0,
15
+ minDuration = 0,
16
+ transition,
14
17
  className,
15
18
  style,
16
19
  testId = "spinner-circle",
@@ -18,16 +21,26 @@ const SpinnerCircle = forwardRef(
18
21
  ariaLabel = "Loading...",
19
22
  ...rest
20
23
  }, ref) => {
21
- if (!visible) return null;
22
24
  const prefersReducedMotion = useReducedMotion();
23
25
  const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
26
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
27
+ visible,
28
+ delay,
29
+ minDuration,
30
+ transition
31
+ );
32
+ if (!shouldRender) return null;
24
33
  return /* @__PURE__ */ jsx(
25
34
  "div",
26
35
  {
27
36
  ref,
28
37
  "data-testid": testId,
29
38
  className: cn("inline-flex items-center justify-center", className),
30
- style,
39
+ style: {
40
+ ...style,
41
+ opacity,
42
+ transition: transitionStyle
43
+ },
31
44
  role: "status",
32
45
  "aria-label": ariaLabel,
33
46
  "aria-busy": "true",
@@ -66,4 +79,3 @@ SpinnerCircle.displayName = "SpinnerCircle";
66
79
  export {
67
80
  SpinnerCircle
68
81
  };
69
- //# sourceMappingURL=index14.js.map
package/dist/index15.cjs CHANGED
@@ -2,7 +2,7 @@
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("./index31.cjs");
5
+ const hooks = require("./index30.cjs");
6
6
  const classNames = require("./index3.cjs");
7
7
  const colors = require("./index4.cjs");
8
8
  const SpinnerRing = react.forwardRef(
@@ -14,6 +14,9 @@ const SpinnerRing = react.forwardRef(
14
14
  speed = "normal",
15
15
  reverse = false,
16
16
  respectMotionPreference = true,
17
+ delay = 0,
18
+ minDuration = 0,
19
+ transition,
17
20
  className,
18
21
  style,
19
22
  testId = "spinner-ring",
@@ -21,16 +24,26 @@ const SpinnerRing = react.forwardRef(
21
24
  ariaLabel = "Loading...",
22
25
  ...rest
23
26
  }, ref) => {
24
- if (!visible) return null;
25
27
  const prefersReducedMotion = hooks.useReducedMotion();
26
28
  const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
29
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
30
+ visible,
31
+ delay,
32
+ minDuration,
33
+ transition
34
+ );
35
+ if (!shouldRender) return null;
27
36
  return /* @__PURE__ */ jsxRuntime.jsx(
28
37
  "div",
29
38
  {
30
39
  ref,
31
40
  "data-testid": testId,
32
41
  className: classNames.cn("inline-flex items-center justify-center", className),
33
- style,
42
+ style: {
43
+ ...style,
44
+ opacity,
45
+ transition: transitionStyle
46
+ },
34
47
  role: "status",
35
48
  "aria-label": ariaLabel,
36
49
  "aria-busy": "true",
@@ -55,4 +68,3 @@ const SpinnerRing = react.forwardRef(
55
68
  );
56
69
  SpinnerRing.displayName = "SpinnerRing";
57
70
  exports.SpinnerRing = SpinnerRing;
58
- //# sourceMappingURL=index15.cjs.map
package/dist/index15.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, getEffectiveDuration } from "./index31.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index30.js";
4
4
  import { cn } from "./index3.js";
5
5
  import { normalizeSize } from "./index4.js";
6
6
  const SpinnerRing = forwardRef(
@@ -12,6 +12,9 @@ const SpinnerRing = forwardRef(
12
12
  speed = "normal",
13
13
  reverse = false,
14
14
  respectMotionPreference = true,
15
+ delay = 0,
16
+ minDuration = 0,
17
+ transition,
15
18
  className,
16
19
  style,
17
20
  testId = "spinner-ring",
@@ -19,16 +22,26 @@ const SpinnerRing = forwardRef(
19
22
  ariaLabel = "Loading...",
20
23
  ...rest
21
24
  }, ref) => {
22
- if (!visible) return null;
23
25
  const prefersReducedMotion = useReducedMotion();
24
26
  const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
27
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
28
+ visible,
29
+ delay,
30
+ minDuration,
31
+ transition
32
+ );
33
+ if (!shouldRender) return null;
25
34
  return /* @__PURE__ */ jsx(
26
35
  "div",
27
36
  {
28
37
  ref,
29
38
  "data-testid": testId,
30
39
  className: cn("inline-flex items-center justify-center", className),
31
- style,
40
+ style: {
41
+ ...style,
42
+ opacity,
43
+ transition: transitionStyle
44
+ },
32
45
  role: "status",
33
46
  "aria-label": ariaLabel,
34
47
  "aria-busy": "true",
@@ -55,4 +68,3 @@ SpinnerRing.displayName = "SpinnerRing";
55
68
  export {
56
69
  SpinnerRing
57
70
  };
58
- //# sourceMappingURL=index15.js.map
package/dist/index16.cjs CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const colors = require("./index4.cjs");
6
- const hooks = require("./index31.cjs");
6
+ const hooks = require("./index30.cjs");
7
7
  const classNames = require("./index3.cjs");
8
8
  const SpinnerDots = react.forwardRef(
9
9
  ({
@@ -14,6 +14,9 @@ const SpinnerDots = react.forwardRef(
14
14
  speed = "normal",
15
15
  reverse = false,
16
16
  respectMotionPreference = true,
17
+ delay = 0,
18
+ minDuration = 0,
19
+ transition,
17
20
  className,
18
21
  style,
19
22
  testId = "spinner-dots",
@@ -21,9 +24,15 @@ const SpinnerDots = react.forwardRef(
21
24
  ariaLabel = "Loading...",
22
25
  ...rest
23
26
  }, ref) => {
24
- if (!visible) return null;
25
27
  const prefersReducedMotion = hooks.useReducedMotion();
26
28
  const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
29
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
30
+ visible,
31
+ delay,
32
+ minDuration,
33
+ transition
34
+ );
35
+ if (!shouldRender) return null;
27
36
  const sizeValue = colors.parseSizeToNumber(size, 40);
28
37
  const dotSizeValue = colors.parseSizeToNumber(dotSize, 4);
29
38
  const radius = (sizeValue - dotSizeValue) / 2;
@@ -33,7 +42,11 @@ const SpinnerDots = react.forwardRef(
33
42
  ref,
34
43
  "data-testid": testId,
35
44
  className: classNames.cn("inline-flex items-center justify-center", className),
36
- style,
45
+ style: {
46
+ ...style,
47
+ opacity,
48
+ transition: transitionStyle
49
+ },
37
50
  role: "status",
38
51
  "aria-label": ariaLabel,
39
52
  "aria-busy": "true",
@@ -78,4 +91,3 @@ const SpinnerDots = react.forwardRef(
78
91
  );
79
92
  SpinnerDots.displayName = "SpinnerDots";
80
93
  exports.SpinnerDots = SpinnerDots;
81
- //# sourceMappingURL=index16.cjs.map
package/dist/index16.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { normalizeSize, parseSizeToNumber } from "./index4.js";
4
- import { useReducedMotion, getEffectiveDuration } from "./index31.js";
4
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index30.js";
5
5
  import { cn } from "./index3.js";
6
6
  const SpinnerDots = forwardRef(
7
7
  ({
@@ -12,6 +12,9 @@ const SpinnerDots = forwardRef(
12
12
  speed = "normal",
13
13
  reverse = false,
14
14
  respectMotionPreference = true,
15
+ delay = 0,
16
+ minDuration = 0,
17
+ transition,
15
18
  className,
16
19
  style,
17
20
  testId = "spinner-dots",
@@ -19,9 +22,15 @@ const SpinnerDots = forwardRef(
19
22
  ariaLabel = "Loading...",
20
23
  ...rest
21
24
  }, ref) => {
22
- if (!visible) return null;
23
25
  const prefersReducedMotion = useReducedMotion();
24
26
  const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
27
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
28
+ visible,
29
+ delay,
30
+ minDuration,
31
+ transition
32
+ );
33
+ if (!shouldRender) return null;
25
34
  const sizeValue = parseSizeToNumber(size, 40);
26
35
  const dotSizeValue = parseSizeToNumber(dotSize, 4);
27
36
  const radius = (sizeValue - dotSizeValue) / 2;
@@ -31,7 +40,11 @@ const SpinnerDots = forwardRef(
31
40
  ref,
32
41
  "data-testid": testId,
33
42
  className: cn("inline-flex items-center justify-center", className),
34
- style,
43
+ style: {
44
+ ...style,
45
+ opacity,
46
+ transition: transitionStyle
47
+ },
35
48
  role: "status",
36
49
  "aria-label": ariaLabel,
37
50
  "aria-busy": "true",
@@ -78,4 +91,3 @@ SpinnerDots.displayName = "SpinnerDots";
78
91
  export {
79
92
  SpinnerDots
80
93
  };
81
- //# sourceMappingURL=index16.js.map
package/dist/index17.cjs CHANGED
@@ -2,7 +2,7 @@
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("./index31.cjs");
5
+ const hooks = require("./index30.cjs");
6
6
  const colors = require("./index4.cjs");
7
7
  const classNames = require("./index3.cjs");
8
8
  const SpinnerBars = react.forwardRef(
@@ -13,6 +13,9 @@ const SpinnerBars = react.forwardRef(
13
13
  speed = "normal",
14
14
  reverse = false,
15
15
  respectMotionPreference = true,
16
+ delay = 0,
17
+ minDuration = 0,
18
+ transition,
16
19
  className,
17
20
  style,
18
21
  testId = "spinner-bars",
@@ -20,9 +23,15 @@ const SpinnerBars = react.forwardRef(
20
23
  ariaLabel = "Loading...",
21
24
  ...rest
22
25
  }, ref) => {
23
- if (!visible) return null;
24
26
  const prefersReducedMotion = hooks.useReducedMotion();
25
27
  const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
29
+ visible,
30
+ delay,
31
+ minDuration,
32
+ transition
33
+ );
34
+ if (!shouldRender) return null;
26
35
  const sizeValue = colors.parseSizeToNumber(size, 40);
27
36
  const barWidth = Math.floor(sizeValue / (barCount * 2));
28
37
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -33,7 +42,9 @@ const SpinnerBars = react.forwardRef(
33
42
  className: classNames.cn("inline-flex items-center justify-center gap-1", className),
34
43
  style: {
35
44
  height: colors.normalizeSize(size),
36
- ...style
45
+ ...style,
46
+ opacity,
47
+ transition: transitionStyle
37
48
  },
38
49
  role: "status",
39
50
  "aria-label": ariaLabel,
@@ -59,4 +70,3 @@ const SpinnerBars = react.forwardRef(
59
70
  );
60
71
  SpinnerBars.displayName = "SpinnerBars";
61
72
  exports.SpinnerBars = SpinnerBars;
62
- //# sourceMappingURL=index17.cjs.map
package/dist/index17.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, getEffectiveDuration } from "./index31.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index30.js";
4
4
  import { normalizeSize, parseSizeToNumber } from "./index4.js";
5
5
  import { cn } from "./index3.js";
6
6
  const SpinnerBars = forwardRef(
@@ -11,6 +11,9 @@ const SpinnerBars = forwardRef(
11
11
  speed = "normal",
12
12
  reverse = false,
13
13
  respectMotionPreference = true,
14
+ delay = 0,
15
+ minDuration = 0,
16
+ transition,
14
17
  className,
15
18
  style,
16
19
  testId = "spinner-bars",
@@ -18,9 +21,15 @@ const SpinnerBars = forwardRef(
18
21
  ariaLabel = "Loading...",
19
22
  ...rest
20
23
  }, ref) => {
21
- if (!visible) return null;
22
24
  const prefersReducedMotion = useReducedMotion();
23
25
  const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
26
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
27
+ visible,
28
+ delay,
29
+ minDuration,
30
+ transition
31
+ );
32
+ if (!shouldRender) return null;
24
33
  const sizeValue = parseSizeToNumber(size, 40);
25
34
  const barWidth = Math.floor(sizeValue / (barCount * 2));
26
35
  return /* @__PURE__ */ jsx(
@@ -31,7 +40,9 @@ const SpinnerBars = forwardRef(
31
40
  className: cn("inline-flex items-center justify-center gap-1", className),
32
41
  style: {
33
42
  height: normalizeSize(size),
34
- ...style
43
+ ...style,
44
+ opacity,
45
+ transition: transitionStyle
35
46
  },
36
47
  role: "status",
37
48
  "aria-label": ariaLabel,
@@ -59,4 +70,3 @@ SpinnerBars.displayName = "SpinnerBars";
59
70
  export {
60
71
  SpinnerBars
61
72
  };
62
- //# sourceMappingURL=index17.js.map
package/dist/index18.cjs CHANGED
@@ -2,7 +2,7 @@
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("./index31.cjs");
5
+ const hooks = require("./index30.cjs");
6
6
  const classNames = require("./index3.cjs");
7
7
  const colors = require("./index4.cjs");
8
8
  const SpinnerGrid = react.forwardRef(
@@ -13,6 +13,9 @@ const SpinnerGrid = react.forwardRef(
13
13
  speed = "normal",
14
14
  reverse = false,
15
15
  respectMotionPreference = true,
16
+ delay = 0,
17
+ minDuration = 0,
18
+ transition,
16
19
  className,
17
20
  style,
18
21
  testId = "spinner-grid",
@@ -20,9 +23,15 @@ const SpinnerGrid = react.forwardRef(
20
23
  ariaLabel = "Loading...",
21
24
  ...rest
22
25
  }, ref) => {
23
- if (!visible) return null;
24
26
  const prefersReducedMotion = hooks.useReducedMotion();
25
27
  const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
29
+ visible,
30
+ delay,
31
+ minDuration,
32
+ transition
33
+ );
34
+ if (!shouldRender) return null;
26
35
  const sizeValue = colors.parseSizeToNumber(size, 40);
27
36
  const cellSize = Math.floor(sizeValue / gridSize) - 2;
28
37
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -31,7 +40,11 @@ const SpinnerGrid = react.forwardRef(
31
40
  ref,
32
41
  "data-testid": testId,
33
42
  className: classNames.cn("inline-flex items-center justify-center", className),
34
- style,
43
+ style: {
44
+ ...style,
45
+ opacity,
46
+ transition: transitionStyle
47
+ },
35
48
  role: "status",
36
49
  "aria-label": ariaLabel,
37
50
  "aria-busy": "true",
@@ -49,7 +62,7 @@ const SpinnerGrid = react.forwardRef(
49
62
  const row = Math.floor(index / gridSize);
50
63
  const col = index % gridSize;
51
64
  const maxDelay = (gridSize - 1) * 2;
52
- const delay = reverse ? (maxDelay - (row + col)) * 0.1 : (row + col) * 0.1;
65
+ const delay2 = reverse ? (maxDelay - (row + col)) * 0.1 : (row + col) * 0.1;
53
66
  return /* @__PURE__ */ jsxRuntime.jsx(
54
67
  "div",
55
68
  {
@@ -59,7 +72,7 @@ const SpinnerGrid = react.forwardRef(
59
72
  height: `${cellSize}px`,
60
73
  backgroundColor: color,
61
74
  animation: `fade-pulse ${effectiveDuration} ease-in-out infinite`,
62
- animationDelay: `${delay}s`
75
+ animationDelay: `${delay2}s`
63
76
  }
64
77
  },
65
78
  index
@@ -73,4 +86,3 @@ const SpinnerGrid = react.forwardRef(
73
86
  );
74
87
  SpinnerGrid.displayName = "SpinnerGrid";
75
88
  exports.SpinnerGrid = SpinnerGrid;
76
- //# sourceMappingURL=index18.cjs.map
package/dist/index18.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, getEffectiveDuration } from "./index31.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index30.js";
4
4
  import { cn } from "./index3.js";
5
5
  import { normalizeSize, parseSizeToNumber } from "./index4.js";
6
6
  const SpinnerGrid = forwardRef(
@@ -11,6 +11,9 @@ const SpinnerGrid = forwardRef(
11
11
  speed = "normal",
12
12
  reverse = false,
13
13
  respectMotionPreference = true,
14
+ delay = 0,
15
+ minDuration = 0,
16
+ transition,
14
17
  className,
15
18
  style,
16
19
  testId = "spinner-grid",
@@ -18,9 +21,15 @@ const SpinnerGrid = forwardRef(
18
21
  ariaLabel = "Loading...",
19
22
  ...rest
20
23
  }, ref) => {
21
- if (!visible) return null;
22
24
  const prefersReducedMotion = useReducedMotion();
23
25
  const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
26
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
27
+ visible,
28
+ delay,
29
+ minDuration,
30
+ transition
31
+ );
32
+ if (!shouldRender) return null;
24
33
  const sizeValue = parseSizeToNumber(size, 40);
25
34
  const cellSize = Math.floor(sizeValue / gridSize) - 2;
26
35
  return /* @__PURE__ */ jsx(
@@ -29,7 +38,11 @@ const SpinnerGrid = forwardRef(
29
38
  ref,
30
39
  "data-testid": testId,
31
40
  className: cn("inline-flex items-center justify-center", className),
32
- style,
41
+ style: {
42
+ ...style,
43
+ opacity,
44
+ transition: transitionStyle
45
+ },
33
46
  role: "status",
34
47
  "aria-label": ariaLabel,
35
48
  "aria-busy": "true",
@@ -47,7 +60,7 @@ const SpinnerGrid = forwardRef(
47
60
  const row = Math.floor(index / gridSize);
48
61
  const col = index % gridSize;
49
62
  const maxDelay = (gridSize - 1) * 2;
50
- const delay = reverse ? (maxDelay - (row + col)) * 0.1 : (row + col) * 0.1;
63
+ const delay2 = reverse ? (maxDelay - (row + col)) * 0.1 : (row + col) * 0.1;
51
64
  return /* @__PURE__ */ jsx(
52
65
  "div",
53
66
  {
@@ -57,7 +70,7 @@ const SpinnerGrid = forwardRef(
57
70
  height: `${cellSize}px`,
58
71
  backgroundColor: color,
59
72
  animation: `fade-pulse ${effectiveDuration} ease-in-out infinite`,
60
- animationDelay: `${delay}s`
73
+ animationDelay: `${delay2}s`
61
74
  }
62
75
  },
63
76
  index
@@ -73,4 +86,3 @@ SpinnerGrid.displayName = "SpinnerGrid";
73
86
  export {
74
87
  SpinnerGrid
75
88
  };
76
- //# sourceMappingURL=index18.js.map