premium-react-loaders 2.3.1 → 3.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.
- package/README.md +45 -3
- package/dist/components/bounce/BouncingBalls.d.ts +15 -0
- package/dist/components/bounce/BouncingBalls.d.ts.map +1 -0
- package/dist/components/bounce/BouncingDots.d.ts +15 -0
- package/dist/components/bounce/BouncingDots.d.ts.map +1 -0
- package/dist/components/bounce/index.d.ts +3 -0
- package/dist/components/bounce/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/infinity/InfinityLoader.d.ts +15 -0
- package/dist/components/infinity/InfinityLoader.d.ts.map +1 -0
- package/dist/components/infinity/MobiusLoader.d.ts +15 -0
- package/dist/components/infinity/MobiusLoader.d.ts.map +1 -0
- package/dist/components/infinity/index.d.ts +3 -0
- package/dist/components/infinity/index.d.ts.map +1 -0
- package/dist/components/orbit/AtomLoader.d.ts +15 -0
- package/dist/components/orbit/AtomLoader.d.ts.map +1 -0
- package/dist/components/orbit/OrbitDots.d.ts +15 -0
- package/dist/components/orbit/OrbitDots.d.ts.map +1 -0
- package/dist/components/orbit/OrbitRings.d.ts +15 -0
- package/dist/components/orbit/OrbitRings.d.ts.map +1 -0
- package/dist/components/orbit/index.d.ts +4 -0
- package/dist/components/orbit/index.d.ts.map +1 -0
- package/dist/components/shimmer/ShimmerBox.d.ts +15 -0
- package/dist/components/shimmer/ShimmerBox.d.ts.map +1 -0
- package/dist/components/shimmer/ShimmerButton.d.ts +15 -0
- package/dist/components/shimmer/ShimmerButton.d.ts.map +1 -0
- package/dist/components/shimmer/ShimmerText.d.ts +15 -0
- package/dist/components/shimmer/ShimmerText.d.ts.map +1 -0
- package/dist/components/shimmer/index.d.ts +4 -0
- package/dist/components/shimmer/index.d.ts.map +1 -0
- package/dist/components/text/LoadingText.d.ts +16 -0
- package/dist/components/text/LoadingText.d.ts.map +1 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/index.cjs +22 -0
- package/dist/index.js +22 -0
- 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/index16.cjs +1 -1
- package/dist/index16.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/index36.cjs +90 -119
- package/dist/index36.js +91 -120
- package/dist/index37.cjs +113 -0
- package/dist/index37.js +113 -0
- package/dist/index38.cjs +169 -0
- package/dist/index38.js +169 -0
- package/dist/index39.cjs +97 -0
- package/dist/index39.js +97 -0
- package/dist/index40.cjs +90 -0
- package/dist/index40.js +90 -0
- package/dist/index41.cjs +139 -0
- package/dist/index41.js +139 -0
- package/dist/index42.cjs +82 -0
- package/dist/index42.js +82 -0
- package/dist/index43.cjs +110 -0
- package/dist/index43.js +110 -0
- package/dist/index44.cjs +135 -0
- package/dist/index44.js +135 -0
- package/dist/index45.cjs +106 -0
- package/dist/index45.js +106 -0
- package/dist/index46.cjs +158 -0
- package/dist/index46.js +158 -0
- package/dist/index47.cjs +125 -0
- package/dist/index47.js +125 -0
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- 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 +217 -0
- package/dist/types/bounce.d.ts +41 -0
- package/dist/types/bounce.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/infinity.d.ts +35 -0
- package/dist/types/infinity.d.ts.map +1 -0
- package/dist/types/orbit.d.ts +50 -0
- package/dist/types/orbit.d.ts.map +1 -0
- package/dist/types/shimmer.d.ts +52 -0
- package/dist/types/shimmer.d.ts.map +1 -0
- package/dist/types/text.d.ts +27 -0
- package/dist/types/text.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index41.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index47.js";
|
|
4
|
+
import { normalizeSize } from "./index4.js";
|
|
5
|
+
import { cn } from "./index3.js";
|
|
6
|
+
const AtomLoader = forwardRef(
|
|
7
|
+
({
|
|
8
|
+
size = "md",
|
|
9
|
+
color = "#3b82f6",
|
|
10
|
+
secondaryColor,
|
|
11
|
+
orbits = 3,
|
|
12
|
+
nucleusSize = 8,
|
|
13
|
+
electronSize = 5,
|
|
14
|
+
showNucleus = true,
|
|
15
|
+
thickness = 1,
|
|
16
|
+
speed = "normal",
|
|
17
|
+
reverse = false,
|
|
18
|
+
respectMotionPreference = true,
|
|
19
|
+
delay = 0,
|
|
20
|
+
minDuration = 0,
|
|
21
|
+
transition,
|
|
22
|
+
className,
|
|
23
|
+
style,
|
|
24
|
+
testId = "atom-loader",
|
|
25
|
+
visible = true,
|
|
26
|
+
ariaLabel = "Loading...",
|
|
27
|
+
...rest
|
|
28
|
+
}, ref) => {
|
|
29
|
+
const prefersReducedMotion = useReducedMotion();
|
|
30
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
31
|
+
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
|
|
32
|
+
visible,
|
|
33
|
+
delay,
|
|
34
|
+
minDuration,
|
|
35
|
+
transition
|
|
36
|
+
);
|
|
37
|
+
if (!shouldRender) return null;
|
|
38
|
+
const normalizedSize = normalizeSize(size);
|
|
39
|
+
const durationNum = parseInt(effectiveDuration, 10);
|
|
40
|
+
const orbitAngles = Array.from({ length: orbits }, (_, i) => 180 / orbits * i);
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
ref,
|
|
45
|
+
"data-testid": testId,
|
|
46
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
47
|
+
style: {
|
|
48
|
+
width: normalizedSize,
|
|
49
|
+
height: normalizedSize,
|
|
50
|
+
opacity,
|
|
51
|
+
transition: transitionStyle,
|
|
52
|
+
...style
|
|
53
|
+
},
|
|
54
|
+
role: "status",
|
|
55
|
+
"aria-label": ariaLabel,
|
|
56
|
+
"aria-busy": "true",
|
|
57
|
+
...rest,
|
|
58
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative w-full h-full", children: [
|
|
59
|
+
showNucleus && /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: "absolute rounded-full",
|
|
63
|
+
style: {
|
|
64
|
+
width: nucleusSize,
|
|
65
|
+
height: nucleusSize,
|
|
66
|
+
backgroundColor: secondaryColor || color,
|
|
67
|
+
left: "50%",
|
|
68
|
+
top: "50%",
|
|
69
|
+
transform: "translate(-50%, -50%)"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
orbitAngles.map((angle, index) => {
|
|
74
|
+
const orbitDuration = durationNum + index * 150;
|
|
75
|
+
const shouldReverse = index % 2 === 1 ? !reverse : reverse;
|
|
76
|
+
const electronColor = secondaryColor && index % 2 === 1 ? secondaryColor : color;
|
|
77
|
+
return /* @__PURE__ */ jsxs(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: "absolute inset-0",
|
|
81
|
+
style: {
|
|
82
|
+
transform: `rotate(${angle}deg)`
|
|
83
|
+
},
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: "absolute rounded-full",
|
|
89
|
+
style: {
|
|
90
|
+
width: "100%",
|
|
91
|
+
height: "60%",
|
|
92
|
+
left: "0",
|
|
93
|
+
top: "20%",
|
|
94
|
+
border: `${thickness}px solid ${color}20`
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
className: "absolute",
|
|
102
|
+
style: {
|
|
103
|
+
width: "100%",
|
|
104
|
+
height: "60%",
|
|
105
|
+
left: "0",
|
|
106
|
+
top: "20%",
|
|
107
|
+
animation: `atom-orbit ${orbitDuration}ms linear infinite`,
|
|
108
|
+
animationDirection: shouldReverse ? "reverse" : "normal"
|
|
109
|
+
},
|
|
110
|
+
children: /* @__PURE__ */ jsx(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
className: "absolute rounded-full",
|
|
114
|
+
style: {
|
|
115
|
+
width: electronSize,
|
|
116
|
+
height: electronSize,
|
|
117
|
+
backgroundColor: electronColor,
|
|
118
|
+
left: "50%",
|
|
119
|
+
top: 0,
|
|
120
|
+
transform: "translate(-50%, -50%)"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
index
|
|
129
|
+
);
|
|
130
|
+
})
|
|
131
|
+
] })
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
AtomLoader.displayName = "AtomLoader";
|
|
137
|
+
export {
|
|
138
|
+
AtomLoader
|
|
139
|
+
};
|
package/dist/index42.cjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
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("./index47.cjs");
|
|
6
|
+
const classNames = require("./index3.cjs");
|
|
7
|
+
const BouncingDots = react.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
size = "md",
|
|
10
|
+
color = "#3b82f6",
|
|
11
|
+
secondaryColor,
|
|
12
|
+
dotCount = 3,
|
|
13
|
+
dotSize = 10,
|
|
14
|
+
gap = 8,
|
|
15
|
+
bounceHeight = 1,
|
|
16
|
+
staggerDelay = 150,
|
|
17
|
+
speed = "normal",
|
|
18
|
+
respectMotionPreference = true,
|
|
19
|
+
delay = 0,
|
|
20
|
+
minDuration = 0,
|
|
21
|
+
transition,
|
|
22
|
+
className,
|
|
23
|
+
style,
|
|
24
|
+
testId = "bouncing-dots",
|
|
25
|
+
visible = true,
|
|
26
|
+
ariaLabel = "Loading...",
|
|
27
|
+
...rest
|
|
28
|
+
}, ref) => {
|
|
29
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
30
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
31
|
+
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
32
|
+
visible,
|
|
33
|
+
delay,
|
|
34
|
+
minDuration,
|
|
35
|
+
transition
|
|
36
|
+
);
|
|
37
|
+
if (!shouldRender) return null;
|
|
38
|
+
const totalWidth = dotCount * dotSize + (dotCount - 1) * gap;
|
|
39
|
+
const bounceDistance = dotSize * bounceHeight;
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
ref,
|
|
44
|
+
"data-testid": testId,
|
|
45
|
+
className: classNames.cn("inline-flex items-end justify-center", className),
|
|
46
|
+
style: {
|
|
47
|
+
width: totalWidth,
|
|
48
|
+
height: dotSize + bounceDistance,
|
|
49
|
+
opacity,
|
|
50
|
+
transition: transitionStyle,
|
|
51
|
+
...style
|
|
52
|
+
},
|
|
53
|
+
role: "status",
|
|
54
|
+
"aria-label": ariaLabel,
|
|
55
|
+
"aria-busy": "true",
|
|
56
|
+
...rest,
|
|
57
|
+
children: Array.from({ length: dotCount }, (_, index) => {
|
|
58
|
+
const dotColor = secondaryColor && index % 2 === 1 ? secondaryColor : color;
|
|
59
|
+
const animationDelay = `${index * staggerDelay}ms`;
|
|
60
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: "rounded-full",
|
|
64
|
+
style: {
|
|
65
|
+
width: dotSize,
|
|
66
|
+
height: dotSize,
|
|
67
|
+
backgroundColor: dotColor,
|
|
68
|
+
marginRight: index < dotCount - 1 ? gap : 0,
|
|
69
|
+
animation: `bounce-dot ${effectiveDuration} ease-in-out infinite`,
|
|
70
|
+
animationDelay,
|
|
71
|
+
["--bounce-height"]: `${bounceDistance}px`
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
index
|
|
75
|
+
);
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
BouncingDots.displayName = "BouncingDots";
|
|
82
|
+
exports.BouncingDots = BouncingDots;
|
package/dist/index42.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index47.js";
|
|
4
|
+
import { cn } from "./index3.js";
|
|
5
|
+
const BouncingDots = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
size = "md",
|
|
8
|
+
color = "#3b82f6",
|
|
9
|
+
secondaryColor,
|
|
10
|
+
dotCount = 3,
|
|
11
|
+
dotSize = 10,
|
|
12
|
+
gap = 8,
|
|
13
|
+
bounceHeight = 1,
|
|
14
|
+
staggerDelay = 150,
|
|
15
|
+
speed = "normal",
|
|
16
|
+
respectMotionPreference = true,
|
|
17
|
+
delay = 0,
|
|
18
|
+
minDuration = 0,
|
|
19
|
+
transition,
|
|
20
|
+
className,
|
|
21
|
+
style,
|
|
22
|
+
testId = "bouncing-dots",
|
|
23
|
+
visible = true,
|
|
24
|
+
ariaLabel = "Loading...",
|
|
25
|
+
...rest
|
|
26
|
+
}, ref) => {
|
|
27
|
+
const prefersReducedMotion = useReducedMotion();
|
|
28
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
29
|
+
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
|
|
30
|
+
visible,
|
|
31
|
+
delay,
|
|
32
|
+
minDuration,
|
|
33
|
+
transition
|
|
34
|
+
);
|
|
35
|
+
if (!shouldRender) return null;
|
|
36
|
+
const totalWidth = dotCount * dotSize + (dotCount - 1) * gap;
|
|
37
|
+
const bounceDistance = dotSize * bounceHeight;
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
"data-testid": testId,
|
|
43
|
+
className: cn("inline-flex items-end justify-center", className),
|
|
44
|
+
style: {
|
|
45
|
+
width: totalWidth,
|
|
46
|
+
height: dotSize + bounceDistance,
|
|
47
|
+
opacity,
|
|
48
|
+
transition: transitionStyle,
|
|
49
|
+
...style
|
|
50
|
+
},
|
|
51
|
+
role: "status",
|
|
52
|
+
"aria-label": ariaLabel,
|
|
53
|
+
"aria-busy": "true",
|
|
54
|
+
...rest,
|
|
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
|
+
})
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
BouncingDots.displayName = "BouncingDots";
|
|
80
|
+
export {
|
|
81
|
+
BouncingDots
|
|
82
|
+
};
|
package/dist/index43.cjs
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
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("./index47.cjs");
|
|
6
|
+
const classNames = require("./index3.cjs");
|
|
7
|
+
const BouncingBalls = react.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
size = "md",
|
|
10
|
+
color = "#3b82f6",
|
|
11
|
+
secondaryColor,
|
|
12
|
+
ballCount = 3,
|
|
13
|
+
ballSize = 14,
|
|
14
|
+
gap = 10,
|
|
15
|
+
bounceHeight = 1.5,
|
|
16
|
+
shadow = true,
|
|
17
|
+
squash = true,
|
|
18
|
+
speed = "normal",
|
|
19
|
+
respectMotionPreference = true,
|
|
20
|
+
delay = 0,
|
|
21
|
+
minDuration = 0,
|
|
22
|
+
transition,
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
testId = "bouncing-balls",
|
|
26
|
+
visible = true,
|
|
27
|
+
ariaLabel = "Loading...",
|
|
28
|
+
...rest
|
|
29
|
+
}, ref) => {
|
|
30
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
31
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
32
|
+
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
33
|
+
visible,
|
|
34
|
+
delay,
|
|
35
|
+
minDuration,
|
|
36
|
+
transition
|
|
37
|
+
);
|
|
38
|
+
if (!shouldRender) return null;
|
|
39
|
+
const totalWidth = ballCount * ballSize + (ballCount - 1) * gap;
|
|
40
|
+
const bounceDistance = ballSize * bounceHeight;
|
|
41
|
+
const shadowSize = ballSize * 0.8;
|
|
42
|
+
const staggerDelay = 200;
|
|
43
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
ref,
|
|
47
|
+
"data-testid": testId,
|
|
48
|
+
className: classNames.cn("inline-flex items-end justify-center", className),
|
|
49
|
+
style: {
|
|
50
|
+
width: totalWidth,
|
|
51
|
+
height: ballSize + bounceDistance + (shadow ? 8 : 0),
|
|
52
|
+
opacity,
|
|
53
|
+
transition: transitionStyle,
|
|
54
|
+
...style
|
|
55
|
+
},
|
|
56
|
+
role: "status",
|
|
57
|
+
"aria-label": ariaLabel,
|
|
58
|
+
"aria-busy": "true",
|
|
59
|
+
...rest,
|
|
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
|
+
}
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
index
|
|
103
|
+
);
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
BouncingBalls.displayName = "BouncingBalls";
|
|
110
|
+
exports.BouncingBalls = BouncingBalls;
|
package/dist/index43.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index47.js";
|
|
4
|
+
import { cn } from "./index3.js";
|
|
5
|
+
const BouncingBalls = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
size = "md",
|
|
8
|
+
color = "#3b82f6",
|
|
9
|
+
secondaryColor,
|
|
10
|
+
ballCount = 3,
|
|
11
|
+
ballSize = 14,
|
|
12
|
+
gap = 10,
|
|
13
|
+
bounceHeight = 1.5,
|
|
14
|
+
shadow = true,
|
|
15
|
+
squash = true,
|
|
16
|
+
speed = "normal",
|
|
17
|
+
respectMotionPreference = true,
|
|
18
|
+
delay = 0,
|
|
19
|
+
minDuration = 0,
|
|
20
|
+
transition,
|
|
21
|
+
className,
|
|
22
|
+
style,
|
|
23
|
+
testId = "bouncing-balls",
|
|
24
|
+
visible = true,
|
|
25
|
+
ariaLabel = "Loading...",
|
|
26
|
+
...rest
|
|
27
|
+
}, ref) => {
|
|
28
|
+
const prefersReducedMotion = useReducedMotion();
|
|
29
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
30
|
+
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
|
|
31
|
+
visible,
|
|
32
|
+
delay,
|
|
33
|
+
minDuration,
|
|
34
|
+
transition
|
|
35
|
+
);
|
|
36
|
+
if (!shouldRender) return null;
|
|
37
|
+
const totalWidth = ballCount * ballSize + (ballCount - 1) * gap;
|
|
38
|
+
const bounceDistance = ballSize * bounceHeight;
|
|
39
|
+
const shadowSize = ballSize * 0.8;
|
|
40
|
+
const staggerDelay = 200;
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
ref,
|
|
45
|
+
"data-testid": testId,
|
|
46
|
+
className: cn("inline-flex items-end justify-center", className),
|
|
47
|
+
style: {
|
|
48
|
+
width: totalWidth,
|
|
49
|
+
height: ballSize + bounceDistance + (shadow ? 8 : 0),
|
|
50
|
+
opacity,
|
|
51
|
+
transition: transitionStyle,
|
|
52
|
+
...style
|
|
53
|
+
},
|
|
54
|
+
role: "status",
|
|
55
|
+
"aria-label": ariaLabel,
|
|
56
|
+
"aria-busy": "true",
|
|
57
|
+
...rest,
|
|
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
|
+
}
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
index
|
|
101
|
+
);
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
BouncingBalls.displayName = "BouncingBalls";
|
|
108
|
+
export {
|
|
109
|
+
BouncingBalls
|
|
110
|
+
};
|
package/dist/index44.cjs
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
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("./index47.cjs");
|
|
6
|
+
const classNames = require("./index3.cjs");
|
|
7
|
+
const colors = require("./index4.cjs");
|
|
8
|
+
const InfinityLoader = react.forwardRef(
|
|
9
|
+
({
|
|
10
|
+
size = "md",
|
|
11
|
+
color = "#3b82f6",
|
|
12
|
+
secondaryColor,
|
|
13
|
+
thickness = 3,
|
|
14
|
+
gradient = false,
|
|
15
|
+
showDot = false,
|
|
16
|
+
dotSize = 6,
|
|
17
|
+
speed = "normal",
|
|
18
|
+
reverse = false,
|
|
19
|
+
respectMotionPreference = true,
|
|
20
|
+
delay = 0,
|
|
21
|
+
minDuration = 0,
|
|
22
|
+
transition,
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
testId = "infinity-loader",
|
|
26
|
+
visible = true,
|
|
27
|
+
ariaLabel = "Loading...",
|
|
28
|
+
...rest
|
|
29
|
+
}, ref) => {
|
|
30
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
31
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
32
|
+
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
33
|
+
visible,
|
|
34
|
+
delay,
|
|
35
|
+
minDuration,
|
|
36
|
+
transition
|
|
37
|
+
);
|
|
38
|
+
if (!shouldRender) return null;
|
|
39
|
+
const normalizedSize = colors.normalizeSize(size);
|
|
40
|
+
const sizeNum = parseInt(normalizedSize, 10);
|
|
41
|
+
const width = sizeNum;
|
|
42
|
+
const height = sizeNum * 0.5;
|
|
43
|
+
const infinityPath = `M ${width * 0.15} ${height * 0.5}
|
|
44
|
+
C ${width * 0.15} ${height * 0.1}, ${width * 0.4} ${height * 0.1}, ${width * 0.5} ${height * 0.5}
|
|
45
|
+
C ${width * 0.6} ${height * 0.9}, ${width * 0.85} ${height * 0.9}, ${width * 0.85} ${height * 0.5}
|
|
46
|
+
C ${width * 0.85} ${height * 0.1}, ${width * 0.6} ${height * 0.1}, ${width * 0.5} ${height * 0.5}
|
|
47
|
+
C ${width * 0.4} ${height * 0.9}, ${width * 0.15} ${height * 0.9}, ${width * 0.15} ${height * 0.5}`;
|
|
48
|
+
const gradientId = `infinity-gradient-${testId}`;
|
|
49
|
+
const pathId = `infinity-path-${testId}`;
|
|
50
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
"data-testid": testId,
|
|
55
|
+
className: classNames.cn("inline-flex items-center justify-center", className),
|
|
56
|
+
style: {
|
|
57
|
+
width,
|
|
58
|
+
height,
|
|
59
|
+
opacity,
|
|
60
|
+
transition: transitionStyle,
|
|
61
|
+
...style
|
|
62
|
+
},
|
|
63
|
+
role: "status",
|
|
64
|
+
"aria-label": ariaLabel,
|
|
65
|
+
"aria-busy": "true",
|
|
66
|
+
...rest,
|
|
67
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
68
|
+
"svg",
|
|
69
|
+
{
|
|
70
|
+
width,
|
|
71
|
+
height,
|
|
72
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
73
|
+
fill: "none",
|
|
74
|
+
children: [
|
|
75
|
+
gradient && secondaryColor && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: color }),
|
|
77
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: secondaryColor })
|
|
78
|
+
] }) }),
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
+
"path",
|
|
81
|
+
{
|
|
82
|
+
d: infinityPath,
|
|
83
|
+
stroke: gradient && secondaryColor ? `url(#${gradientId})` : color,
|
|
84
|
+
strokeWidth: thickness,
|
|
85
|
+
strokeLinecap: "round",
|
|
86
|
+
fill: "none",
|
|
87
|
+
opacity: 0.2
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
91
|
+
"path",
|
|
92
|
+
{
|
|
93
|
+
id: pathId,
|
|
94
|
+
d: infinityPath,
|
|
95
|
+
stroke: gradient && secondaryColor ? `url(#${gradientId})` : color,
|
|
96
|
+
strokeWidth: thickness,
|
|
97
|
+
strokeLinecap: "round",
|
|
98
|
+
fill: "none",
|
|
99
|
+
style: {
|
|
100
|
+
strokeDasharray: "50 200",
|
|
101
|
+
animation: `infinity-dash ${effectiveDuration} linear infinite`,
|
|
102
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
showDot && /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
|
+
"circle",
|
|
108
|
+
{
|
|
109
|
+
r: dotSize / 2,
|
|
110
|
+
fill: secondaryColor || color,
|
|
111
|
+
style: {
|
|
112
|
+
animation: `infinity-dot ${effectiveDuration} linear infinite`,
|
|
113
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
114
|
+
},
|
|
115
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
+
"animateMotion",
|
|
117
|
+
{
|
|
118
|
+
dur: effectiveDuration,
|
|
119
|
+
repeatCount: "indefinite",
|
|
120
|
+
path: infinityPath,
|
|
121
|
+
keyPoints: reverse ? "1;0" : "0;1",
|
|
122
|
+
keyTimes: "0;1"
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
InfinityLoader.displayName = "InfinityLoader";
|
|
135
|
+
exports.InfinityLoader = InfinityLoader;
|