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.
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/neon/NeonPulse.d.ts +12 -0
- package/dist/components/neon/NeonPulse.d.ts.map +1 -0
- package/dist/components/neon/NeonSpinner.d.ts +12 -0
- package/dist/components/neon/NeonSpinner.d.ts.map +1 -0
- package/dist/components/neon/NeonText.d.ts +12 -0
- package/dist/components/neon/NeonText.d.ts.map +1 -0
- package/dist/components/neon/index.d.ts +4 -0
- package/dist/components/neon/index.d.ts.map +1 -0
- package/dist/components/particle/ParticleField.d.ts +3 -0
- package/dist/components/particle/ParticleField.d.ts.map +1 -0
- package/dist/components/particle/ParticleTrail.d.ts +12 -0
- package/dist/components/particle/ParticleTrail.d.ts.map +1 -0
- package/dist/components/particle/index.d.ts +2 -0
- package/dist/components/particle/index.d.ts.map +1 -1
- package/dist/components/status/InfoIndicator.d.ts +29 -0
- package/dist/components/status/InfoIndicator.d.ts.map +1 -0
- package/dist/components/status/WarningIndicator.d.ts +29 -0
- package/dist/components/status/WarningIndicator.d.ts.map +1 -0
- package/dist/components/status/index.d.ts +2 -0
- package/dist/components/status/index.d.ts.map +1 -1
- package/dist/index.cjs +41 -27
- package/dist/index.js +41 -27
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +1 -1
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +1 -1
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +1 -1
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +1 -1
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +1 -1
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +1 -1
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +1 -1
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +1 -1
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +1 -1
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +1 -1
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +1 -1
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +1 -1
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +1 -1
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +1 -1
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +1 -1
- package/dist/index37.cjs +59 -145
- package/dist/index37.js +61 -147
- package/dist/index38.cjs +32 -53
- package/dist/index38.js +33 -54
- package/dist/index39.cjs +138 -84
- package/dist/index39.js +140 -86
- package/dist/index40.cjs +33 -106
- package/dist/index40.js +34 -107
- package/dist/index41.cjs +66 -50
- package/dist/index41.js +66 -50
- package/dist/index42.cjs +123 -44
- package/dist/index42.js +124 -45
- package/dist/index43.cjs +43 -85
- package/dist/index43.js +44 -86
- package/dist/index44.cjs +35 -27
- package/dist/index44.js +35 -27
- package/dist/index45.cjs +87 -58
- package/dist/index45.js +87 -58
- package/dist/index46.cjs +35 -88
- package/dist/index46.js +36 -89
- package/dist/index47.cjs +62 -58
- package/dist/index47.js +63 -59
- package/dist/index48.cjs +87 -110
- package/dist/index48.js +88 -111
- package/dist/index49.cjs +48 -109
- package/dist/index49.js +49 -110
- package/dist/index50.cjs +110 -62
- package/dist/index50.js +111 -63
- package/dist/index51.cjs +104 -49
- package/dist/index51.js +104 -49
- package/dist/index52.cjs +43 -77
- package/dist/index52.js +44 -78
- package/dist/index53.cjs +56 -56
- package/dist/index53.js +56 -56
- package/dist/index54.cjs +104 -149
- package/dist/index54.js +106 -151
- package/dist/index55.cjs +97 -38
- package/dist/index55.js +99 -40
- package/dist/index56.cjs +161 -27
- package/dist/index56.js +162 -28
- package/dist/index57.cjs +36 -102
- package/dist/index57.js +38 -104
- package/dist/index58.cjs +19 -34
- package/dist/index58.js +20 -35
- package/dist/index59.cjs +87 -34
- package/dist/index59.js +89 -36
- package/dist/index60.cjs +25 -23
- package/dist/index60.js +25 -23
- package/dist/index61.cjs +32 -65
- package/dist/index61.js +34 -67
- package/dist/index62.cjs +29 -36
- package/dist/index62.js +30 -37
- package/dist/index63.cjs +66 -59
- package/dist/index63.js +69 -62
- package/dist/index64.cjs +71 -121
- package/dist/index64.js +72 -122
- package/dist/index65.cjs +92 -0
- package/dist/index65.js +92 -0
- package/dist/index66.cjs +76 -0
- package/dist/index66.js +76 -0
- package/dist/index67.cjs +76 -0
- package/dist/index67.js +76 -0
- package/dist/index68.cjs +64 -0
- package/dist/index68.js +64 -0
- package/dist/index69.cjs +60 -0
- package/dist/index69.js +60 -0
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +57 -0
- package/dist/index70.js +57 -0
- package/dist/index71.cjs +125 -0
- package/dist/index71.js +125 -0
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +1 -1
- package/dist/premium-react-loaders.css +85 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/neon.d.ts +26 -0
- package/dist/types/neon.d.ts.map +1 -0
- package/dist/types/particle.d.ts +18 -0
- package/dist/types/particle.d.ts.map +1 -1
- package/dist/types/status.d.ts +30 -0
- package/dist/types/status.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index46.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
|
|
4
4
|
import { cn } from "./index3.js";
|
|
5
|
-
|
|
6
|
-
const InfinityLoader = forwardRef(
|
|
5
|
+
const BouncingDots = forwardRef(
|
|
7
6
|
({
|
|
8
7
|
size = "md",
|
|
9
8
|
color = "#3b82f6",
|
|
10
9
|
secondaryColor,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
dotCount = 3,
|
|
11
|
+
dotSize = 10,
|
|
12
|
+
gap = 8,
|
|
13
|
+
bounceHeight = 1,
|
|
14
|
+
staggerDelay = 150,
|
|
15
15
|
speed = "normal",
|
|
16
|
-
reverse = false,
|
|
17
16
|
respectMotionPreference = true,
|
|
18
17
|
delay = 0,
|
|
19
18
|
minDuration = 0,
|
|
20
19
|
transition,
|
|
21
20
|
className,
|
|
22
21
|
style,
|
|
23
|
-
testId = "
|
|
22
|
+
testId = "bouncing-dots",
|
|
24
23
|
visible = true,
|
|
25
24
|
ariaLabel = "Loading...",
|
|
26
25
|
...rest
|
|
@@ -34,26 +33,17 @@ const InfinityLoader = forwardRef(
|
|
|
34
33
|
transition
|
|
35
34
|
);
|
|
36
35
|
if (!shouldRender) return null;
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const width = sizeNum;
|
|
40
|
-
const height = sizeNum * 0.5;
|
|
41
|
-
const infinityPath = `M ${width * 0.15} ${height * 0.5}
|
|
42
|
-
C ${width * 0.15} ${height * 0.1}, ${width * 0.4} ${height * 0.1}, ${width * 0.5} ${height * 0.5}
|
|
43
|
-
C ${width * 0.6} ${height * 0.9}, ${width * 0.85} ${height * 0.9}, ${width * 0.85} ${height * 0.5}
|
|
44
|
-
C ${width * 0.85} ${height * 0.1}, ${width * 0.6} ${height * 0.1}, ${width * 0.5} ${height * 0.5}
|
|
45
|
-
C ${width * 0.4} ${height * 0.9}, ${width * 0.15} ${height * 0.9}, ${width * 0.15} ${height * 0.5}`;
|
|
46
|
-
const gradientId = `infinity-gradient-${testId}`;
|
|
47
|
-
const pathId = `infinity-path-${testId}`;
|
|
36
|
+
const totalWidth = dotCount * dotSize + (dotCount - 1) * gap;
|
|
37
|
+
const bounceDistance = dotSize * bounceHeight;
|
|
48
38
|
return /* @__PURE__ */ jsx(
|
|
49
39
|
"div",
|
|
50
40
|
{
|
|
51
41
|
ref,
|
|
52
42
|
"data-testid": testId,
|
|
53
|
-
className: cn("inline-flex items-
|
|
43
|
+
className: cn("inline-flex items-end justify-center", className),
|
|
54
44
|
style: {
|
|
55
|
-
width,
|
|
56
|
-
height,
|
|
45
|
+
width: totalWidth,
|
|
46
|
+
height: dotSize + bounceDistance,
|
|
57
47
|
opacity,
|
|
58
48
|
transition: transitionStyle,
|
|
59
49
|
...style
|
|
@@ -62,74 +52,31 @@ const InfinityLoader = forwardRef(
|
|
|
62
52
|
"aria-label": ariaLabel,
|
|
63
53
|
"aria-busy": "true",
|
|
64
54
|
...rest,
|
|
65
|
-
children:
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
opacity: 0.2
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
/* @__PURE__ */ jsx(
|
|
89
|
-
"path",
|
|
90
|
-
{
|
|
91
|
-
id: pathId,
|
|
92
|
-
d: infinityPath,
|
|
93
|
-
stroke: gradient && secondaryColor ? `url(#${gradientId})` : color,
|
|
94
|
-
strokeWidth: thickness,
|
|
95
|
-
strokeLinecap: "round",
|
|
96
|
-
fill: "none",
|
|
97
|
-
style: {
|
|
98
|
-
strokeDasharray: "50 200",
|
|
99
|
-
animation: `infinity-dash ${effectiveDuration} linear infinite`,
|
|
100
|
-
animationDirection: reverse ? "reverse" : "normal"
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
),
|
|
104
|
-
showDot && /* @__PURE__ */ jsx(
|
|
105
|
-
"circle",
|
|
106
|
-
{
|
|
107
|
-
r: dotSize / 2,
|
|
108
|
-
fill: secondaryColor || color,
|
|
109
|
-
style: {
|
|
110
|
-
animation: `infinity-dot ${effectiveDuration} linear infinite`,
|
|
111
|
-
animationDirection: reverse ? "reverse" : "normal"
|
|
112
|
-
},
|
|
113
|
-
children: /* @__PURE__ */ jsx(
|
|
114
|
-
"animateMotion",
|
|
115
|
-
{
|
|
116
|
-
dur: effectiveDuration,
|
|
117
|
-
repeatCount: "indefinite",
|
|
118
|
-
path: infinityPath,
|
|
119
|
-
keyPoints: reverse ? "1;0" : "0;1",
|
|
120
|
-
keyTimes: "0;1"
|
|
121
|
-
}
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
)
|
|
55
|
+
children: Array.from({ length: dotCount }, (_, index) => {
|
|
56
|
+
const dotColor = secondaryColor && index % 2 === 1 ? secondaryColor : color;
|
|
57
|
+
const animationDelay = `${index * staggerDelay}ms`;
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: "rounded-full",
|
|
62
|
+
style: {
|
|
63
|
+
width: dotSize,
|
|
64
|
+
height: dotSize,
|
|
65
|
+
backgroundColor: dotColor,
|
|
66
|
+
marginRight: index < dotCount - 1 ? gap : 0,
|
|
67
|
+
animation: `bounce-dot ${effectiveDuration} ease-in-out infinite`,
|
|
68
|
+
animationDelay,
|
|
69
|
+
["--bounce-height"]: `${bounceDistance}px`
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
index
|
|
73
|
+
);
|
|
74
|
+
})
|
|
128
75
|
}
|
|
129
76
|
);
|
|
130
77
|
}
|
|
131
78
|
);
|
|
132
|
-
|
|
79
|
+
BouncingDots.displayName = "BouncingDots";
|
|
133
80
|
export {
|
|
134
|
-
|
|
81
|
+
BouncingDots
|
|
135
82
|
};
|
package/dist/index47.cjs
CHANGED
|
@@ -2,27 +2,27 @@
|
|
|
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("./
|
|
6
|
-
const colors = require("./index4.cjs");
|
|
5
|
+
const hooks = require("./index71.cjs");
|
|
7
6
|
const classNames = require("./index3.cjs");
|
|
8
|
-
const
|
|
7
|
+
const BouncingBalls = react.forwardRef(
|
|
9
8
|
({
|
|
10
9
|
size = "md",
|
|
11
10
|
color = "#3b82f6",
|
|
12
11
|
secondaryColor,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
ballCount = 3,
|
|
13
|
+
ballSize = 14,
|
|
14
|
+
gap = 10,
|
|
15
|
+
bounceHeight = 1.5,
|
|
16
|
+
shadow = true,
|
|
17
|
+
squash = true,
|
|
17
18
|
speed = "normal",
|
|
18
|
-
reverse = false,
|
|
19
19
|
respectMotionPreference = true,
|
|
20
20
|
delay = 0,
|
|
21
21
|
minDuration = 0,
|
|
22
22
|
transition,
|
|
23
23
|
className,
|
|
24
24
|
style,
|
|
25
|
-
testId = "
|
|
25
|
+
testId = "bouncing-balls",
|
|
26
26
|
visible = true,
|
|
27
27
|
ariaLabel = "Loading...",
|
|
28
28
|
...rest
|
|
@@ -36,22 +36,19 @@ const MobiusLoader = react.forwardRef(
|
|
|
36
36
|
transition
|
|
37
37
|
);
|
|
38
38
|
if (!shouldRender) return null;
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const centerY = sizeNum / 2;
|
|
44
|
-
const radiusX = (sizeNum - ribbonWidth) / 2;
|
|
45
|
-
const radiusY = (sizeNum - ribbonWidth) / 3;
|
|
39
|
+
const totalWidth = ballCount * ballSize + (ballCount - 1) * gap;
|
|
40
|
+
const bounceDistance = ballSize * bounceHeight;
|
|
41
|
+
const shadowSize = ballSize * 0.8;
|
|
42
|
+
const staggerDelay = 200;
|
|
46
43
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
47
44
|
"div",
|
|
48
45
|
{
|
|
49
46
|
ref,
|
|
50
47
|
"data-testid": testId,
|
|
51
|
-
className: classNames.cn("inline-flex items-
|
|
48
|
+
className: classNames.cn("inline-flex items-end justify-center", className),
|
|
52
49
|
style: {
|
|
53
|
-
width:
|
|
54
|
-
height:
|
|
50
|
+
width: totalWidth,
|
|
51
|
+
height: ballSize + bounceDistance + (shadow ? 8 : 0),
|
|
55
52
|
opacity,
|
|
56
53
|
transition: transitionStyle,
|
|
57
54
|
...style
|
|
@@ -60,47 +57,54 @@ const MobiusLoader = react.forwardRef(
|
|
|
60
57
|
"aria-label": ariaLabel,
|
|
61
58
|
"aria-busy": "true",
|
|
62
59
|
...rest,
|
|
63
|
-
children:
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
60
|
+
children: Array.from({ length: ballCount }, (_, index) => {
|
|
61
|
+
const ballColor = secondaryColor && index % 2 === 1 ? secondaryColor : color;
|
|
62
|
+
const animationDelay = `${index * staggerDelay}ms`;
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: "relative flex flex-col items-center",
|
|
67
|
+
style: {
|
|
68
|
+
marginRight: index < ballCount - 1 ? gap : 0
|
|
69
|
+
},
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: "rounded-full",
|
|
75
|
+
style: {
|
|
76
|
+
width: ballSize,
|
|
77
|
+
height: ballSize,
|
|
78
|
+
backgroundColor: ballColor,
|
|
79
|
+
animation: squash ? `bounce-ball-squash ${effectiveDuration} ease-in-out infinite` : `bounce-ball ${effectiveDuration} ease-in-out infinite`,
|
|
80
|
+
animationDelay,
|
|
81
|
+
["--bounce-height"]: `${bounceDistance}px`,
|
|
82
|
+
transformOrigin: "center bottom"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
shadow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: "absolute bottom-0 rounded-full",
|
|
90
|
+
style: {
|
|
91
|
+
width: shadowSize,
|
|
92
|
+
height: shadowSize * 0.3,
|
|
93
|
+
backgroundColor: "rgba(0, 0, 0, 0.2)",
|
|
94
|
+
animation: `bounce-shadow ${effectiveDuration} ease-in-out infinite`,
|
|
95
|
+
animationDelay,
|
|
96
|
+
filter: "blur(2px)"
|
|
97
|
+
}
|
|
94
98
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
)
|
|
99
|
+
)
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
index
|
|
103
|
+
);
|
|
104
|
+
})
|
|
101
105
|
}
|
|
102
106
|
);
|
|
103
107
|
}
|
|
104
108
|
);
|
|
105
|
-
|
|
106
|
-
exports.
|
|
109
|
+
BouncingBalls.displayName = "BouncingBalls";
|
|
110
|
+
exports.BouncingBalls = BouncingBalls;
|
package/dist/index47.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./
|
|
4
|
-
import { normalizeSize } from "./index4.js";
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
|
|
5
4
|
import { cn } from "./index3.js";
|
|
6
|
-
const
|
|
5
|
+
const BouncingBalls = forwardRef(
|
|
7
6
|
({
|
|
8
7
|
size = "md",
|
|
9
8
|
color = "#3b82f6",
|
|
10
9
|
secondaryColor,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
ballCount = 3,
|
|
11
|
+
ballSize = 14,
|
|
12
|
+
gap = 10,
|
|
13
|
+
bounceHeight = 1.5,
|
|
14
|
+
shadow = true,
|
|
15
|
+
squash = true,
|
|
15
16
|
speed = "normal",
|
|
16
|
-
reverse = false,
|
|
17
17
|
respectMotionPreference = true,
|
|
18
18
|
delay = 0,
|
|
19
19
|
minDuration = 0,
|
|
20
20
|
transition,
|
|
21
21
|
className,
|
|
22
22
|
style,
|
|
23
|
-
testId = "
|
|
23
|
+
testId = "bouncing-balls",
|
|
24
24
|
visible = true,
|
|
25
25
|
ariaLabel = "Loading...",
|
|
26
26
|
...rest
|
|
@@ -34,22 +34,19 @@ const MobiusLoader = forwardRef(
|
|
|
34
34
|
transition
|
|
35
35
|
);
|
|
36
36
|
if (!shouldRender) return null;
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const centerY = sizeNum / 2;
|
|
42
|
-
const radiusX = (sizeNum - ribbonWidth) / 2;
|
|
43
|
-
const radiusY = (sizeNum - ribbonWidth) / 3;
|
|
37
|
+
const totalWidth = ballCount * ballSize + (ballCount - 1) * gap;
|
|
38
|
+
const bounceDistance = ballSize * bounceHeight;
|
|
39
|
+
const shadowSize = ballSize * 0.8;
|
|
40
|
+
const staggerDelay = 200;
|
|
44
41
|
return /* @__PURE__ */ jsx(
|
|
45
42
|
"div",
|
|
46
43
|
{
|
|
47
44
|
ref,
|
|
48
45
|
"data-testid": testId,
|
|
49
|
-
className: cn("inline-flex items-
|
|
46
|
+
className: cn("inline-flex items-end justify-center", className),
|
|
50
47
|
style: {
|
|
51
|
-
width:
|
|
52
|
-
height:
|
|
48
|
+
width: totalWidth,
|
|
49
|
+
height: ballSize + bounceDistance + (shadow ? 8 : 0),
|
|
53
50
|
opacity,
|
|
54
51
|
transition: transitionStyle,
|
|
55
52
|
...style
|
|
@@ -58,49 +55,56 @@ const MobiusLoader = forwardRef(
|
|
|
58
55
|
"aria-label": ariaLabel,
|
|
59
56
|
"aria-busy": "true",
|
|
60
57
|
...rest,
|
|
61
|
-
children:
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
58
|
+
children: Array.from({ length: ballCount }, (_, index) => {
|
|
59
|
+
const ballColor = secondaryColor && index % 2 === 1 ? secondaryColor : color;
|
|
60
|
+
const animationDelay = `${index * staggerDelay}ms`;
|
|
61
|
+
return /* @__PURE__ */ jsxs(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: "relative flex flex-col items-center",
|
|
65
|
+
style: {
|
|
66
|
+
marginRight: index < ballCount - 1 ? gap : 0
|
|
67
|
+
},
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: "rounded-full",
|
|
73
|
+
style: {
|
|
74
|
+
width: ballSize,
|
|
75
|
+
height: ballSize,
|
|
76
|
+
backgroundColor: ballColor,
|
|
77
|
+
animation: squash ? `bounce-ball-squash ${effectiveDuration} ease-in-out infinite` : `bounce-ball ${effectiveDuration} ease-in-out infinite`,
|
|
78
|
+
animationDelay,
|
|
79
|
+
["--bounce-height"]: `${bounceDistance}px`,
|
|
80
|
+
transformOrigin: "center bottom"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
shadow && /* @__PURE__ */ jsx(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: "absolute bottom-0 rounded-full",
|
|
88
|
+
style: {
|
|
89
|
+
width: shadowSize,
|
|
90
|
+
height: shadowSize * 0.3,
|
|
91
|
+
backgroundColor: "rgba(0, 0, 0, 0.2)",
|
|
92
|
+
animation: `bounce-shadow ${effectiveDuration} ease-in-out infinite`,
|
|
93
|
+
animationDelay,
|
|
94
|
+
filter: "blur(2px)"
|
|
95
|
+
}
|
|
92
96
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
index
|
|
101
|
+
);
|
|
102
|
+
})
|
|
99
103
|
}
|
|
100
104
|
);
|
|
101
105
|
}
|
|
102
106
|
);
|
|
103
|
-
|
|
107
|
+
BouncingBalls.displayName = "BouncingBalls";
|
|
104
108
|
export {
|
|
105
|
-
|
|
109
|
+
BouncingBalls
|
|
106
110
|
};
|