premium-react-loaders 2.0.0 → 2.2.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 (96) hide show
  1. package/README.md +262 -6
  2. package/dist/components/button/ButtonSpinner.d.ts +25 -0
  3. package/dist/components/button/ButtonSpinner.d.ts.map +1 -0
  4. package/dist/components/button/index.d.ts +2 -0
  5. package/dist/components/button/index.d.ts.map +1 -0
  6. package/dist/components/index.d.ts +2 -0
  7. package/dist/components/index.d.ts.map +1 -1
  8. package/dist/components/pulse/TypingIndicator.d.ts.map +1 -1
  9. package/dist/components/status/ErrorIndicator.d.ts +32 -0
  10. package/dist/components/status/ErrorIndicator.d.ts.map +1 -0
  11. package/dist/components/status/SuccessCheckmark.d.ts +31 -0
  12. package/dist/components/status/SuccessCheckmark.d.ts.map +1 -0
  13. package/dist/components/status/index.d.ts +3 -0
  14. package/dist/components/status/index.d.ts.map +1 -0
  15. package/dist/context/ThemeContext.d.ts +84 -0
  16. package/dist/context/ThemeContext.d.ts.map +1 -0
  17. package/dist/context/index.d.ts +3 -0
  18. package/dist/context/index.d.ts.map +1 -0
  19. package/dist/hooks/index.d.ts +3 -0
  20. package/dist/hooks/index.d.ts.map +1 -0
  21. package/dist/hooks/useLoader.d.ts +56 -0
  22. package/dist/hooks/useLoader.d.ts.map +1 -0
  23. package/dist/index.cjs +37 -26
  24. package/dist/index.d.ts +5 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +37 -26
  27. package/dist/index10.cjs +20 -31
  28. package/dist/index10.js +20 -31
  29. package/dist/index11.cjs +47 -25
  30. package/dist/index11.js +47 -25
  31. package/dist/index12.cjs +30 -126
  32. package/dist/index12.js +31 -127
  33. package/dist/index13.cjs +30 -53
  34. package/dist/index13.js +30 -53
  35. package/dist/index14.cjs +127 -43
  36. package/dist/index14.js +128 -44
  37. package/dist/index15.cjs +58 -37
  38. package/dist/index15.js +59 -38
  39. package/dist/index16.cjs +24 -36
  40. package/dist/index16.js +24 -36
  41. package/dist/index17.cjs +19 -21
  42. package/dist/index17.js +19 -21
  43. package/dist/index18.cjs +25 -20
  44. package/dist/index18.js +25 -20
  45. package/dist/index19.cjs +22 -32
  46. package/dist/index19.js +22 -32
  47. package/dist/index20.cjs +26 -35
  48. package/dist/index20.js +28 -37
  49. package/dist/index21.cjs +40 -76
  50. package/dist/index21.js +42 -78
  51. package/dist/index22.cjs +53 -102
  52. package/dist/index22.js +54 -103
  53. package/dist/index23.cjs +46 -80
  54. package/dist/index23.js +47 -81
  55. package/dist/index24.cjs +105 -103
  56. package/dist/index24.js +107 -105
  57. package/dist/index25.cjs +108 -27
  58. package/dist/index25.js +111 -30
  59. package/dist/index26.cjs +104 -36
  60. package/dist/index26.js +106 -38
  61. package/dist/index27.cjs +22 -30
  62. package/dist/index27.js +23 -31
  63. package/dist/index28.cjs +30 -29
  64. package/dist/index28.js +31 -30
  65. package/dist/index29.cjs +49 -52
  66. package/dist/index29.js +50 -53
  67. package/dist/index30.cjs +74 -121
  68. package/dist/index30.js +75 -122
  69. package/dist/index31.cjs +82 -0
  70. package/dist/index31.js +82 -0
  71. package/dist/index32.cjs +149 -0
  72. package/dist/index32.js +149 -0
  73. package/dist/index33.cjs +100 -0
  74. package/dist/index33.js +100 -0
  75. package/dist/index34.cjs +117 -0
  76. package/dist/index34.js +117 -0
  77. package/dist/index35.cjs +125 -0
  78. package/dist/index35.js +125 -0
  79. package/dist/index5.cjs +11 -72
  80. package/dist/index5.js +12 -73
  81. package/dist/index6.cjs +86 -65
  82. package/dist/index6.js +87 -66
  83. package/dist/index7.cjs +40 -20
  84. package/dist/index7.js +40 -20
  85. package/dist/index8.cjs +34 -21
  86. package/dist/index8.js +34 -21
  87. package/dist/index9.cjs +21 -55
  88. package/dist/index9.js +22 -56
  89. package/dist/premium-react-loaders.css +178 -6
  90. package/dist/types/button.d.ts +31 -0
  91. package/dist/types/button.d.ts.map +1 -0
  92. package/dist/types/index.d.ts +2 -0
  93. package/dist/types/index.d.ts.map +1 -1
  94. package/dist/types/status.d.ts +34 -0
  95. package/dist/types/status.d.ts.map +1 -0
  96. package/package.json +1 -1
package/dist/index15.js CHANGED
@@ -1,29 +1,29 @@
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 "./index30.js";
4
- import { cn } from "./index3.js";
3
+ import { Skeleton } from "./index7.js";
4
+ import { useLoaderVisibility } from "./index35.js";
5
5
  import { normalizeSize } from "./index4.js";
6
- const SpinnerRing = forwardRef(
6
+ import { cn } from "./index3.js";
7
+ const SkeletonForm = forwardRef(
7
8
  ({
8
- size = "md",
9
- color = "#3b82f6",
10
- secondaryColor = "rgba(0, 0, 0, 0.1)",
11
- thickness = 4,
12
- speed = "normal",
13
- reverse = false,
14
- respectMotionPreference = true,
9
+ fields = 3,
10
+ showLabels = true,
11
+ showButton = true,
12
+ gap = 16,
13
+ buttonWidth = "120px",
14
+ buttonPosition = "left",
15
+ animate = true,
16
+ baseColor,
17
+ highlightColor,
15
18
  delay = 0,
16
19
  minDuration = 0,
17
20
  transition,
18
21
  className,
19
22
  style,
20
- testId = "spinner-ring",
23
+ testId = "skeleton-form",
21
24
  visible = true,
22
- ariaLabel = "Loading...",
23
25
  ...rest
24
26
  }, ref) => {
25
- const prefersReducedMotion = useReducedMotion();
26
- const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
27
27
  const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
28
28
  visible,
29
29
  delay,
@@ -31,40 +31,61 @@ const SpinnerRing = forwardRef(
31
31
  transition
32
32
  );
33
33
  if (!shouldRender) return null;
34
- return /* @__PURE__ */ jsx(
34
+ const gapValue = normalizeSize(gap);
35
+ const buttonAlign = buttonPosition === "left" ? "justify-start" : buttonPosition === "right" ? "justify-end" : "justify-center";
36
+ return /* @__PURE__ */ jsxs(
35
37
  "div",
36
38
  {
37
39
  ref,
38
40
  "data-testid": testId,
39
- className: cn("inline-flex items-center justify-center", className),
40
- style: {
41
- ...style,
42
- opacity,
43
- transition: transitionStyle
44
- },
41
+ className: cn("w-full", className),
42
+ style: { ...style, display: "flex", flexDirection: "column", gap: gapValue, opacity, transition: transitionStyle },
45
43
  role: "status",
46
- "aria-label": ariaLabel,
44
+ "aria-label": "Loading form...",
47
45
  "aria-busy": "true",
48
46
  ...rest,
49
- children: /* @__PURE__ */ jsx(
50
- "div",
51
- {
52
- className: "rounded-full",
53
- style: {
54
- width: normalizeSize(size),
55
- height: normalizeSize(size),
56
- border: `${thickness}px solid ${secondaryColor}`,
57
- borderTopColor: color,
58
- animation: `spinner-rotate ${effectiveDuration} linear infinite`,
59
- animationDirection: reverse ? "reverse" : "normal"
47
+ children: [
48
+ Array.from({ length: fields }).map((_, index) => /* @__PURE__ */ jsxs("div", { className: "w-full", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
49
+ showLabels && /* @__PURE__ */ jsx(
50
+ Skeleton,
51
+ {
52
+ width: "30%",
53
+ height: "0.875rem",
54
+ variant: "text",
55
+ animate,
56
+ baseColor,
57
+ highlightColor
58
+ }
59
+ ),
60
+ /* @__PURE__ */ jsx(
61
+ Skeleton,
62
+ {
63
+ width: "100%",
64
+ height: "2.5rem",
65
+ variant: "rectangular",
66
+ animate,
67
+ baseColor,
68
+ highlightColor
69
+ }
70
+ )
71
+ ] }, index)),
72
+ showButton && /* @__PURE__ */ jsx("div", { className: cn("flex", buttonAlign), style: { marginTop: "8px" }, children: /* @__PURE__ */ jsx(
73
+ Skeleton,
74
+ {
75
+ width: buttonWidth,
76
+ height: "2.5rem",
77
+ variant: "rounded",
78
+ animate,
79
+ baseColor,
80
+ highlightColor
60
81
  }
61
- }
62
- )
82
+ ) })
83
+ ]
63
84
  }
64
85
  );
65
86
  }
66
87
  );
67
- SpinnerRing.displayName = "SpinnerRing";
88
+ SkeletonForm.displayName = "SkeletonForm";
68
89
  export {
69
- SpinnerRing
90
+ SkeletonForm
70
91
  };
package/dist/index16.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 colors = require("./index4.cjs");
6
- const hooks = require("./index30.cjs");
5
+ const hooks = require("./index35.cjs");
7
6
  const classNames = require("./index3.cjs");
8
- const SpinnerDots = react.forwardRef(
7
+ const colors = require("./index4.cjs");
8
+ const SpinnerCircle = react.forwardRef(
9
9
  ({
10
10
  size = "md",
11
11
  color = "#3b82f6",
12
- dotCount = 8,
13
- dotSize = 4,
12
+ thickness = 4,
14
13
  speed = "normal",
15
14
  reverse = false,
16
15
  respectMotionPreference = true,
@@ -19,7 +18,7 @@ const SpinnerDots = react.forwardRef(
19
18
  transition,
20
19
  className,
21
20
  style,
22
- testId = "spinner-dots",
21
+ testId = "spinner-circle",
23
22
  visible = true,
24
23
  ariaLabel = "Loading...",
25
24
  ...rest
@@ -33,9 +32,6 @@ const SpinnerDots = react.forwardRef(
33
32
  transition
34
33
  );
35
34
  if (!shouldRender) return null;
36
- const sizeValue = colors.parseSizeToNumber(size, 40);
37
- const dotSizeValue = colors.parseSizeToNumber(dotSize, 4);
38
- const radius = (sizeValue - dotSizeValue) / 2;
39
35
  return /* @__PURE__ */ jsxRuntime.jsx(
40
36
  "div",
41
37
  {
@@ -52,42 +48,34 @@ const SpinnerDots = react.forwardRef(
52
48
  "aria-busy": "true",
53
49
  ...rest,
54
50
  children: /* @__PURE__ */ jsxRuntime.jsx(
55
- "div",
51
+ "svg",
56
52
  {
57
- className: "relative",
53
+ className: "animate-spinner-rotate",
58
54
  style: {
59
55
  width: colors.normalizeSize(size),
60
56
  height: colors.normalizeSize(size),
61
- animation: `spinner-rotate ${effectiveDuration} linear infinite`,
57
+ animationDuration: effectiveDuration,
62
58
  animationDirection: reverse ? "reverse" : "normal"
63
59
  },
64
- children: Array.from({ length: dotCount }).map((_, index) => {
65
- const angle = 360 / dotCount * index;
66
- const radian = angle * Math.PI / 180;
67
- const x = radius * Math.cos(radian) + radius;
68
- const y = radius * Math.sin(radian) + radius;
69
- return /* @__PURE__ */ jsxRuntime.jsx(
70
- "div",
71
- {
72
- className: "absolute rounded-full",
73
- style: {
74
- width: colors.normalizeSize(dotSize),
75
- height: colors.normalizeSize(dotSize),
76
- backgroundColor: color,
77
- left: `${x}px`,
78
- top: `${y}px`,
79
- opacity: 1 - index / dotCount * 0.7
80
- // Fade effect
81
- }
82
- },
83
- index
84
- );
85
- })
60
+ viewBox: "0 0 50 50",
61
+ children: /* @__PURE__ */ jsxRuntime.jsx(
62
+ "circle",
63
+ {
64
+ cx: "25",
65
+ cy: "25",
66
+ r: 25 - thickness * 2,
67
+ fill: "none",
68
+ stroke: color,
69
+ strokeWidth: thickness,
70
+ strokeDasharray: "80, 200",
71
+ strokeLinecap: "round"
72
+ }
73
+ )
86
74
  }
87
75
  )
88
76
  }
89
77
  );
90
78
  }
91
79
  );
92
- SpinnerDots.displayName = "SpinnerDots";
93
- exports.SpinnerDots = SpinnerDots;
80
+ SpinnerCircle.displayName = "SpinnerCircle";
81
+ exports.SpinnerCircle = SpinnerCircle;
package/dist/index16.js CHANGED
@@ -1,14 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { normalizeSize, parseSizeToNumber } from "./index4.js";
4
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index30.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index35.js";
5
4
  import { cn } from "./index3.js";
6
- const SpinnerDots = forwardRef(
5
+ import { normalizeSize } from "./index4.js";
6
+ const SpinnerCircle = forwardRef(
7
7
  ({
8
8
  size = "md",
9
9
  color = "#3b82f6",
10
- dotCount = 8,
11
- dotSize = 4,
10
+ thickness = 4,
12
11
  speed = "normal",
13
12
  reverse = false,
14
13
  respectMotionPreference = true,
@@ -17,7 +16,7 @@ const SpinnerDots = forwardRef(
17
16
  transition,
18
17
  className,
19
18
  style,
20
- testId = "spinner-dots",
19
+ testId = "spinner-circle",
21
20
  visible = true,
22
21
  ariaLabel = "Loading...",
23
22
  ...rest
@@ -31,9 +30,6 @@ const SpinnerDots = forwardRef(
31
30
  transition
32
31
  );
33
32
  if (!shouldRender) return null;
34
- const sizeValue = parseSizeToNumber(size, 40);
35
- const dotSizeValue = parseSizeToNumber(dotSize, 4);
36
- const radius = (sizeValue - dotSizeValue) / 2;
37
33
  return /* @__PURE__ */ jsx(
38
34
  "div",
39
35
  {
@@ -50,44 +46,36 @@ const SpinnerDots = forwardRef(
50
46
  "aria-busy": "true",
51
47
  ...rest,
52
48
  children: /* @__PURE__ */ jsx(
53
- "div",
49
+ "svg",
54
50
  {
55
- className: "relative",
51
+ className: "animate-spinner-rotate",
56
52
  style: {
57
53
  width: normalizeSize(size),
58
54
  height: normalizeSize(size),
59
- animation: `spinner-rotate ${effectiveDuration} linear infinite`,
55
+ animationDuration: effectiveDuration,
60
56
  animationDirection: reverse ? "reverse" : "normal"
61
57
  },
62
- children: Array.from({ length: dotCount }).map((_, index) => {
63
- const angle = 360 / dotCount * index;
64
- const radian = angle * Math.PI / 180;
65
- const x = radius * Math.cos(radian) + radius;
66
- const y = radius * Math.sin(radian) + radius;
67
- return /* @__PURE__ */ jsx(
68
- "div",
69
- {
70
- className: "absolute rounded-full",
71
- style: {
72
- width: normalizeSize(dotSize),
73
- height: normalizeSize(dotSize),
74
- backgroundColor: color,
75
- left: `${x}px`,
76
- top: `${y}px`,
77
- opacity: 1 - index / dotCount * 0.7
78
- // Fade effect
79
- }
80
- },
81
- index
82
- );
83
- })
58
+ viewBox: "0 0 50 50",
59
+ children: /* @__PURE__ */ jsx(
60
+ "circle",
61
+ {
62
+ cx: "25",
63
+ cy: "25",
64
+ r: 25 - thickness * 2,
65
+ fill: "none",
66
+ stroke: color,
67
+ strokeWidth: thickness,
68
+ strokeDasharray: "80, 200",
69
+ strokeLinecap: "round"
70
+ }
71
+ )
84
72
  }
85
73
  )
86
74
  }
87
75
  );
88
76
  }
89
77
  );
90
- SpinnerDots.displayName = "SpinnerDots";
78
+ SpinnerCircle.displayName = "SpinnerCircle";
91
79
  export {
92
- SpinnerDots
80
+ SpinnerCircle
93
81
  };
package/dist/index17.cjs CHANGED
@@ -2,14 +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("./index30.cjs");
6
- const colors = require("./index4.cjs");
5
+ const hooks = require("./index35.cjs");
7
6
  const classNames = require("./index3.cjs");
8
- const SpinnerBars = react.forwardRef(
7
+ const colors = require("./index4.cjs");
8
+ const SpinnerRing = react.forwardRef(
9
9
  ({
10
10
  size = "md",
11
11
  color = "#3b82f6",
12
- barCount = 5,
12
+ secondaryColor = "rgba(0, 0, 0, 0.1)",
13
+ thickness = 4,
13
14
  speed = "normal",
14
15
  reverse = false,
15
16
  respectMotionPreference = true,
@@ -18,7 +19,7 @@ const SpinnerBars = react.forwardRef(
18
19
  transition,
19
20
  className,
20
21
  style,
21
- testId = "spinner-bars",
22
+ testId = "spinner-ring",
22
23
  visible = true,
23
24
  ariaLabel = "Loading...",
24
25
  ...rest
@@ -32,16 +33,13 @@ const SpinnerBars = react.forwardRef(
32
33
  transition
33
34
  );
34
35
  if (!shouldRender) return null;
35
- const sizeValue = colors.parseSizeToNumber(size, 40);
36
- const barWidth = Math.floor(sizeValue / (barCount * 2));
37
36
  return /* @__PURE__ */ jsxRuntime.jsx(
38
37
  "div",
39
38
  {
40
39
  ref,
41
40
  "data-testid": testId,
42
- className: classNames.cn("inline-flex items-center justify-center gap-1", className),
41
+ className: classNames.cn("inline-flex items-center justify-center", className),
43
42
  style: {
44
- height: colors.normalizeSize(size),
45
43
  ...style,
46
44
  opacity,
47
45
  transition: transitionStyle
@@ -50,23 +48,23 @@ const SpinnerBars = react.forwardRef(
50
48
  "aria-label": ariaLabel,
51
49
  "aria-busy": "true",
52
50
  ...rest,
53
- children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
51
+ children: /* @__PURE__ */ jsxRuntime.jsx(
54
52
  "div",
55
53
  {
56
- className: "rounded-sm",
54
+ className: "rounded-full",
57
55
  style: {
58
- width: `${barWidth}px`,
59
- height: "100%",
60
- backgroundColor: color,
61
- animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
62
- animationDelay: reverse ? `${(barCount - index - 1) * 0.1}s` : `${index * 0.1}s`
56
+ width: colors.normalizeSize(size),
57
+ height: colors.normalizeSize(size),
58
+ border: `${thickness}px solid ${secondaryColor}`,
59
+ borderTopColor: color,
60
+ animation: `spinner-rotate ${effectiveDuration} linear infinite`,
61
+ animationDirection: reverse ? "reverse" : "normal"
63
62
  }
64
- },
65
- index
66
- ))
63
+ }
64
+ )
67
65
  }
68
66
  );
69
67
  }
70
68
  );
71
- SpinnerBars.displayName = "SpinnerBars";
72
- exports.SpinnerBars = SpinnerBars;
69
+ SpinnerRing.displayName = "SpinnerRing";
70
+ exports.SpinnerRing = SpinnerRing;
package/dist/index17.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index30.js";
4
- import { normalizeSize, parseSizeToNumber } from "./index4.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index35.js";
5
4
  import { cn } from "./index3.js";
6
- const SpinnerBars = forwardRef(
5
+ import { normalizeSize } from "./index4.js";
6
+ const SpinnerRing = forwardRef(
7
7
  ({
8
8
  size = "md",
9
9
  color = "#3b82f6",
10
- barCount = 5,
10
+ secondaryColor = "rgba(0, 0, 0, 0.1)",
11
+ thickness = 4,
11
12
  speed = "normal",
12
13
  reverse = false,
13
14
  respectMotionPreference = true,
@@ -16,7 +17,7 @@ const SpinnerBars = forwardRef(
16
17
  transition,
17
18
  className,
18
19
  style,
19
- testId = "spinner-bars",
20
+ testId = "spinner-ring",
20
21
  visible = true,
21
22
  ariaLabel = "Loading...",
22
23
  ...rest
@@ -30,16 +31,13 @@ const SpinnerBars = forwardRef(
30
31
  transition
31
32
  );
32
33
  if (!shouldRender) return null;
33
- const sizeValue = parseSizeToNumber(size, 40);
34
- const barWidth = Math.floor(sizeValue / (barCount * 2));
35
34
  return /* @__PURE__ */ jsx(
36
35
  "div",
37
36
  {
38
37
  ref,
39
38
  "data-testid": testId,
40
- className: cn("inline-flex items-center justify-center gap-1", className),
39
+ className: cn("inline-flex items-center justify-center", className),
41
40
  style: {
42
- height: normalizeSize(size),
43
41
  ...style,
44
42
  opacity,
45
43
  transition: transitionStyle
@@ -48,25 +46,25 @@ const SpinnerBars = forwardRef(
48
46
  "aria-label": ariaLabel,
49
47
  "aria-busy": "true",
50
48
  ...rest,
51
- children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsx(
49
+ children: /* @__PURE__ */ jsx(
52
50
  "div",
53
51
  {
54
- className: "rounded-sm",
52
+ className: "rounded-full",
55
53
  style: {
56
- width: `${barWidth}px`,
57
- height: "100%",
58
- backgroundColor: color,
59
- animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
60
- animationDelay: reverse ? `${(barCount - index - 1) * 0.1}s` : `${index * 0.1}s`
54
+ width: normalizeSize(size),
55
+ height: normalizeSize(size),
56
+ border: `${thickness}px solid ${secondaryColor}`,
57
+ borderTopColor: color,
58
+ animation: `spinner-rotate ${effectiveDuration} linear infinite`,
59
+ animationDirection: reverse ? "reverse" : "normal"
61
60
  }
62
- },
63
- index
64
- ))
61
+ }
62
+ )
65
63
  }
66
64
  );
67
65
  }
68
66
  );
69
- SpinnerBars.displayName = "SpinnerBars";
67
+ SpinnerRing.displayName = "SpinnerRing";
70
68
  export {
71
- SpinnerBars
69
+ SpinnerRing
72
70
  };
package/dist/index18.cjs CHANGED
@@ -2,14 +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("./index30.cjs");
6
- const classNames = require("./index3.cjs");
7
5
  const colors = require("./index4.cjs");
8
- const SpinnerGrid = react.forwardRef(
6
+ const hooks = require("./index35.cjs");
7
+ const classNames = require("./index3.cjs");
8
+ const SpinnerDots = react.forwardRef(
9
9
  ({
10
10
  size = "md",
11
11
  color = "#3b82f6",
12
- gridSize = 3,
12
+ dotCount = 8,
13
+ dotSize = 4,
13
14
  speed = "normal",
14
15
  reverse = false,
15
16
  respectMotionPreference = true,
@@ -18,7 +19,7 @@ const SpinnerGrid = react.forwardRef(
18
19
  transition,
19
20
  className,
20
21
  style,
21
- testId = "spinner-grid",
22
+ testId = "spinner-dots",
22
23
  visible = true,
23
24
  ariaLabel = "Loading...",
24
25
  ...rest
@@ -33,7 +34,8 @@ const SpinnerGrid = react.forwardRef(
33
34
  );
34
35
  if (!shouldRender) return null;
35
36
  const sizeValue = colors.parseSizeToNumber(size, 40);
36
- const cellSize = Math.floor(sizeValue / gridSize) - 2;
37
+ const dotSizeValue = colors.parseSizeToNumber(dotSize, 4);
38
+ const radius = (sizeValue - dotSizeValue) / 2;
37
39
  return /* @__PURE__ */ jsxRuntime.jsx(
38
40
  "div",
39
41
  {
@@ -52,27 +54,30 @@ const SpinnerGrid = react.forwardRef(
52
54
  children: /* @__PURE__ */ jsxRuntime.jsx(
53
55
  "div",
54
56
  {
55
- className: "grid gap-0.5",
57
+ className: "relative",
56
58
  style: {
57
59
  width: colors.normalizeSize(size),
58
60
  height: colors.normalizeSize(size),
59
- gridTemplateColumns: `repeat(${gridSize}, 1fr)`
61
+ animation: `spinner-rotate ${effectiveDuration} linear infinite`,
62
+ animationDirection: reverse ? "reverse" : "normal"
60
63
  },
61
- children: Array.from({ length: gridSize * gridSize }).map((_, index) => {
62
- const row = Math.floor(index / gridSize);
63
- const col = index % gridSize;
64
- const maxDelay = (gridSize - 1) * 2;
65
- const delay2 = reverse ? (maxDelay - (row + col)) * 0.1 : (row + col) * 0.1;
64
+ children: Array.from({ length: dotCount }).map((_, index) => {
65
+ const angle = 360 / dotCount * index;
66
+ const radian = angle * Math.PI / 180;
67
+ const x = radius * Math.cos(radian) + radius;
68
+ const y = radius * Math.sin(radian) + radius;
66
69
  return /* @__PURE__ */ jsxRuntime.jsx(
67
70
  "div",
68
71
  {
69
- className: "rounded-sm",
72
+ className: "absolute rounded-full",
70
73
  style: {
71
- width: `${cellSize}px`,
72
- height: `${cellSize}px`,
74
+ width: colors.normalizeSize(dotSize),
75
+ height: colors.normalizeSize(dotSize),
73
76
  backgroundColor: color,
74
- animation: `fade-pulse ${effectiveDuration} ease-in-out infinite`,
75
- animationDelay: `${delay2}s`
77
+ left: `${x}px`,
78
+ top: `${y}px`,
79
+ opacity: 1 - index / dotCount * 0.7
80
+ // Fade effect
76
81
  }
77
82
  },
78
83
  index
@@ -84,5 +89,5 @@ const SpinnerGrid = react.forwardRef(
84
89
  );
85
90
  }
86
91
  );
87
- SpinnerGrid.displayName = "SpinnerGrid";
88
- exports.SpinnerGrid = SpinnerGrid;
92
+ SpinnerDots.displayName = "SpinnerDots";
93
+ exports.SpinnerDots = SpinnerDots;