premium-react-loaders 4.0.0 → 4.1.1
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 +21 -6
- 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/index60.cjs
CHANGED
|
@@ -2,14 +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
|
|
5
|
+
const colors = require("./index4.cjs");
|
|
6
|
+
const hooks = require("./index71.cjs");
|
|
6
7
|
const classNames = require("./index3.cjs");
|
|
7
|
-
const
|
|
8
|
+
const WaveCircle = react.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
size =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
backgroundColor = "white",
|
|
10
|
+
size = 80,
|
|
11
|
+
color = "#3b82f6",
|
|
12
|
+
ringCount = 3,
|
|
13
13
|
speed = "normal",
|
|
14
14
|
respectMotionPreference = true,
|
|
15
15
|
delay = 0,
|
|
@@ -17,7 +17,7 @@ const GradientRing = react.forwardRef(
|
|
|
17
17
|
transition,
|
|
18
18
|
className,
|
|
19
19
|
style,
|
|
20
|
-
testId = "
|
|
20
|
+
testId = "wave-circle",
|
|
21
21
|
visible = true,
|
|
22
22
|
ariaLabel = "Loading...",
|
|
23
23
|
...rest
|
|
@@ -26,9 +26,8 @@ const GradientRing = react.forwardRef(
|
|
|
26
26
|
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
27
27
|
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(visible, delay, minDuration, transition);
|
|
28
28
|
if (!shouldRender) return null;
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const inner = size - thickness * 2;
|
|
29
|
+
const clampedCount = Math.min(5, Math.max(2, ringCount));
|
|
30
|
+
const durationMs = colors.parseDurationMs(effectiveDuration);
|
|
32
31
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33
32
|
"div",
|
|
34
33
|
{
|
|
@@ -44,25 +43,28 @@ const GradientRing = react.forwardRef(
|
|
|
44
43
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
45
44
|
"div",
|
|
46
45
|
{
|
|
47
|
-
className: "absolute
|
|
48
|
-
style: {
|
|
49
|
-
background: gradientStyle,
|
|
50
|
-
backgroundSize: "200% 200%",
|
|
51
|
-
animation: `gradient-flow ${effectiveDuration} ease infinite, gradient-spin ${effectiveDuration} linear infinite`
|
|
52
|
-
}
|
|
46
|
+
className: "absolute rounded-full z-10",
|
|
47
|
+
style: { width: size * 0.15, height: size * 0.15, backgroundColor: color }
|
|
53
48
|
}
|
|
54
49
|
),
|
|
55
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
50
|
+
Array.from({ length: clampedCount }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
51
|
"div",
|
|
57
52
|
{
|
|
58
|
-
className: "absolute rounded-full",
|
|
59
|
-
style: {
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
className: "absolute rounded-full border-2",
|
|
54
|
+
style: {
|
|
55
|
+
width: size,
|
|
56
|
+
height: size,
|
|
57
|
+
borderColor: color,
|
|
58
|
+
animation: `wave-circle-expand ${effectiveDuration} ease-out infinite`,
|
|
59
|
+
animationDelay: `${i / clampedCount * durationMs}ms`
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
i
|
|
63
|
+
))
|
|
62
64
|
]
|
|
63
65
|
}
|
|
64
66
|
);
|
|
65
67
|
}
|
|
66
68
|
);
|
|
67
|
-
|
|
68
|
-
exports.
|
|
69
|
+
WaveCircle.displayName = "WaveCircle";
|
|
70
|
+
exports.WaveCircle = WaveCircle;
|
package/dist/index60.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { parseDurationMs } from "./index4.js";
|
|
4
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
|
|
4
5
|
import { cn } from "./index3.js";
|
|
5
|
-
const
|
|
6
|
+
const WaveCircle = forwardRef(
|
|
6
7
|
({
|
|
7
|
-
size =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
backgroundColor = "white",
|
|
8
|
+
size = 80,
|
|
9
|
+
color = "#3b82f6",
|
|
10
|
+
ringCount = 3,
|
|
11
11
|
speed = "normal",
|
|
12
12
|
respectMotionPreference = true,
|
|
13
13
|
delay = 0,
|
|
@@ -15,7 +15,7 @@ const GradientRing = forwardRef(
|
|
|
15
15
|
transition,
|
|
16
16
|
className,
|
|
17
17
|
style,
|
|
18
|
-
testId = "
|
|
18
|
+
testId = "wave-circle",
|
|
19
19
|
visible = true,
|
|
20
20
|
ariaLabel = "Loading...",
|
|
21
21
|
...rest
|
|
@@ -24,9 +24,8 @@ const GradientRing = forwardRef(
|
|
|
24
24
|
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
25
25
|
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(visible, delay, minDuration, transition);
|
|
26
26
|
if (!shouldRender) return null;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const inner = size - thickness * 2;
|
|
27
|
+
const clampedCount = Math.min(5, Math.max(2, ringCount));
|
|
28
|
+
const durationMs = parseDurationMs(effectiveDuration);
|
|
30
29
|
return /* @__PURE__ */ jsxs(
|
|
31
30
|
"div",
|
|
32
31
|
{
|
|
@@ -42,27 +41,30 @@ const GradientRing = forwardRef(
|
|
|
42
41
|
/* @__PURE__ */ jsx(
|
|
43
42
|
"div",
|
|
44
43
|
{
|
|
45
|
-
className: "absolute
|
|
46
|
-
style: {
|
|
47
|
-
background: gradientStyle,
|
|
48
|
-
backgroundSize: "200% 200%",
|
|
49
|
-
animation: `gradient-flow ${effectiveDuration} ease infinite, gradient-spin ${effectiveDuration} linear infinite`
|
|
50
|
-
}
|
|
44
|
+
className: "absolute rounded-full z-10",
|
|
45
|
+
style: { width: size * 0.15, height: size * 0.15, backgroundColor: color }
|
|
51
46
|
}
|
|
52
47
|
),
|
|
53
|
-
/* @__PURE__ */ jsx(
|
|
48
|
+
Array.from({ length: clampedCount }, (_, i) => /* @__PURE__ */ jsx(
|
|
54
49
|
"div",
|
|
55
50
|
{
|
|
56
|
-
className: "absolute rounded-full",
|
|
57
|
-
style: {
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
className: "absolute rounded-full border-2",
|
|
52
|
+
style: {
|
|
53
|
+
width: size,
|
|
54
|
+
height: size,
|
|
55
|
+
borderColor: color,
|
|
56
|
+
animation: `wave-circle-expand ${effectiveDuration} ease-out infinite`,
|
|
57
|
+
animationDelay: `${i / clampedCount * durationMs}ms`
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
i
|
|
61
|
+
))
|
|
60
62
|
]
|
|
61
63
|
}
|
|
62
64
|
);
|
|
63
65
|
}
|
|
64
66
|
);
|
|
65
|
-
|
|
67
|
+
WaveCircle.displayName = "WaveCircle";
|
|
66
68
|
export {
|
|
67
|
-
|
|
69
|
+
WaveCircle
|
|
68
70
|
};
|
package/dist/index61.cjs
CHANGED
|
@@ -2,17 +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("./
|
|
6
|
-
const colors = require("./index4.cjs");
|
|
5
|
+
const hooks = require("./index71.cjs");
|
|
7
6
|
const classNames = require("./index3.cjs");
|
|
8
|
-
const
|
|
7
|
+
const GradientSpinner = react.forwardRef(
|
|
9
8
|
({
|
|
10
|
-
|
|
11
|
-
width = "100%",
|
|
12
|
-
height = 8,
|
|
9
|
+
size = 48,
|
|
13
10
|
color = "#3b82f6",
|
|
14
11
|
secondaryColor = "#8b5cf6",
|
|
15
|
-
|
|
12
|
+
thickness = 4,
|
|
13
|
+
backgroundColor = "white",
|
|
16
14
|
speed = "normal",
|
|
17
15
|
respectMotionPreference = true,
|
|
18
16
|
delay = 0,
|
|
@@ -20,80 +18,49 @@ const GradientBar = react.forwardRef(
|
|
|
20
18
|
transition,
|
|
21
19
|
className,
|
|
22
20
|
style,
|
|
23
|
-
testId = "gradient-
|
|
21
|
+
testId = "gradient-spinner",
|
|
24
22
|
visible = true,
|
|
25
|
-
ariaLabel,
|
|
23
|
+
ariaLabel = "Loading...",
|
|
26
24
|
...rest
|
|
27
25
|
}, ref) => {
|
|
28
26
|
const prefersReducedMotion = hooks.useReducedMotion();
|
|
29
27
|
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
30
28
|
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(visible, delay, minDuration, transition);
|
|
31
|
-
const onCompleteRef = react.useRef(onComplete);
|
|
32
|
-
onCompleteRef.current = onComplete;
|
|
33
|
-
const hasCompletedRef = react.useRef(false);
|
|
34
|
-
const isIndeterminate = value === void 0;
|
|
35
|
-
const clampedValue = isIndeterminate ? 0 : Math.min(100, Math.max(0, value));
|
|
36
|
-
react.useEffect(() => {
|
|
37
|
-
if (clampedValue < 100) {
|
|
38
|
-
hasCompletedRef.current = false;
|
|
39
|
-
}
|
|
40
|
-
}, [clampedValue]);
|
|
41
|
-
react.useEffect(() => {
|
|
42
|
-
if (!isIndeterminate && clampedValue === 100 && !hasCompletedRef.current && onCompleteRef.current) {
|
|
43
|
-
hasCompletedRef.current = true;
|
|
44
|
-
onCompleteRef.current();
|
|
45
|
-
}
|
|
46
|
-
}, [clampedValue, isIndeterminate]);
|
|
47
29
|
if (!shouldRender) return null;
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
+
const inner = size - thickness * 2;
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
51
32
|
"div",
|
|
52
33
|
{
|
|
53
34
|
ref,
|
|
54
35
|
"data-testid": testId,
|
|
55
|
-
className: classNames.cn("relative
|
|
56
|
-
style: {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
backgroundColor: `${color}20`,
|
|
60
|
-
opacity,
|
|
61
|
-
transition: transitionStyle,
|
|
62
|
-
...style
|
|
63
|
-
},
|
|
64
|
-
role: "progressbar",
|
|
65
|
-
"aria-label": progressLabel,
|
|
66
|
-
"aria-valuenow": isIndeterminate ? void 0 : clampedValue,
|
|
67
|
-
"aria-valuemin": 0,
|
|
68
|
-
"aria-valuemax": 100,
|
|
36
|
+
className: classNames.cn("relative inline-flex items-center justify-center", className),
|
|
37
|
+
style: { width: size, height: size, opacity, transition: transitionStyle, ...style },
|
|
38
|
+
role: "status",
|
|
39
|
+
"aria-label": ariaLabel,
|
|
69
40
|
"aria-busy": "true",
|
|
70
41
|
...rest,
|
|
71
|
-
children:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: "absolute inset-0 rounded-full",
|
|
47
|
+
style: {
|
|
48
|
+
background: `conic-gradient(from 0deg, ${color}, ${secondaryColor}, transparent)`,
|
|
49
|
+
animation: `gradient-spin ${effectiveDuration} linear infinite`
|
|
50
|
+
}
|
|
79
51
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
width: `${clampedValue}%`,
|
|
87
|
-
background: gradient,
|
|
88
|
-
backgroundSize: "200% 100%",
|
|
89
|
-
animation: `gradient-flow ${effectiveDuration} linear infinite`,
|
|
90
|
-
transition: "width 0.3s ease-in-out"
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: "absolute rounded-full",
|
|
57
|
+
style: { width: inner, height: inner, backgroundColor }
|
|
91
58
|
}
|
|
92
|
-
|
|
93
|
-
|
|
59
|
+
)
|
|
60
|
+
]
|
|
94
61
|
}
|
|
95
62
|
);
|
|
96
63
|
}
|
|
97
64
|
);
|
|
98
|
-
|
|
99
|
-
exports.
|
|
65
|
+
GradientSpinner.displayName = "GradientSpinner";
|
|
66
|
+
exports.GradientSpinner = GradientSpinner;
|
package/dist/index61.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./
|
|
4
|
-
import { normalizeSize } from "./index4.js";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
|
|
5
4
|
import { cn } from "./index3.js";
|
|
6
|
-
const
|
|
5
|
+
const GradientSpinner = forwardRef(
|
|
7
6
|
({
|
|
8
|
-
|
|
9
|
-
width = "100%",
|
|
10
|
-
height = 8,
|
|
7
|
+
size = 48,
|
|
11
8
|
color = "#3b82f6",
|
|
12
9
|
secondaryColor = "#8b5cf6",
|
|
13
|
-
|
|
10
|
+
thickness = 4,
|
|
11
|
+
backgroundColor = "white",
|
|
14
12
|
speed = "normal",
|
|
15
13
|
respectMotionPreference = true,
|
|
16
14
|
delay = 0,
|
|
@@ -18,82 +16,51 @@ const GradientBar = forwardRef(
|
|
|
18
16
|
transition,
|
|
19
17
|
className,
|
|
20
18
|
style,
|
|
21
|
-
testId = "gradient-
|
|
19
|
+
testId = "gradient-spinner",
|
|
22
20
|
visible = true,
|
|
23
|
-
ariaLabel,
|
|
21
|
+
ariaLabel = "Loading...",
|
|
24
22
|
...rest
|
|
25
23
|
}, ref) => {
|
|
26
24
|
const prefersReducedMotion = useReducedMotion();
|
|
27
25
|
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
28
26
|
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(visible, delay, minDuration, transition);
|
|
29
|
-
const onCompleteRef = useRef(onComplete);
|
|
30
|
-
onCompleteRef.current = onComplete;
|
|
31
|
-
const hasCompletedRef = useRef(false);
|
|
32
|
-
const isIndeterminate = value === void 0;
|
|
33
|
-
const clampedValue = isIndeterminate ? 0 : Math.min(100, Math.max(0, value));
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (clampedValue < 100) {
|
|
36
|
-
hasCompletedRef.current = false;
|
|
37
|
-
}
|
|
38
|
-
}, [clampedValue]);
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (!isIndeterminate && clampedValue === 100 && !hasCompletedRef.current && onCompleteRef.current) {
|
|
41
|
-
hasCompletedRef.current = true;
|
|
42
|
-
onCompleteRef.current();
|
|
43
|
-
}
|
|
44
|
-
}, [clampedValue, isIndeterminate]);
|
|
45
27
|
if (!shouldRender) return null;
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
+
const inner = size - thickness * 2;
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
49
30
|
"div",
|
|
50
31
|
{
|
|
51
32
|
ref,
|
|
52
33
|
"data-testid": testId,
|
|
53
|
-
className: cn("relative
|
|
54
|
-
style: {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
backgroundColor: `${color}20`,
|
|
58
|
-
opacity,
|
|
59
|
-
transition: transitionStyle,
|
|
60
|
-
...style
|
|
61
|
-
},
|
|
62
|
-
role: "progressbar",
|
|
63
|
-
"aria-label": progressLabel,
|
|
64
|
-
"aria-valuenow": isIndeterminate ? void 0 : clampedValue,
|
|
65
|
-
"aria-valuemin": 0,
|
|
66
|
-
"aria-valuemax": 100,
|
|
34
|
+
className: cn("relative inline-flex items-center justify-center", className),
|
|
35
|
+
style: { width: size, height: size, opacity, transition: transitionStyle, ...style },
|
|
36
|
+
role: "status",
|
|
37
|
+
"aria-label": ariaLabel,
|
|
67
38
|
"aria-busy": "true",
|
|
68
39
|
...rest,
|
|
69
|
-
children:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "absolute inset-0 rounded-full",
|
|
45
|
+
style: {
|
|
46
|
+
background: `conic-gradient(from 0deg, ${color}, ${secondaryColor}, transparent)`,
|
|
47
|
+
animation: `gradient-spin ${effectiveDuration} linear infinite`
|
|
48
|
+
}
|
|
77
49
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
width: `${clampedValue}%`,
|
|
85
|
-
background: gradient,
|
|
86
|
-
backgroundSize: "200% 100%",
|
|
87
|
-
animation: `gradient-flow ${effectiveDuration} linear infinite`,
|
|
88
|
-
transition: "width 0.3s ease-in-out"
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
className: "absolute rounded-full",
|
|
55
|
+
style: { width: inner, height: inner, backgroundColor }
|
|
89
56
|
}
|
|
90
|
-
|
|
91
|
-
|
|
57
|
+
)
|
|
58
|
+
]
|
|
92
59
|
}
|
|
93
60
|
);
|
|
94
61
|
}
|
|
95
62
|
);
|
|
96
|
-
|
|
63
|
+
GradientSpinner.displayName = "GradientSpinner";
|
|
97
64
|
export {
|
|
98
|
-
|
|
65
|
+
GradientSpinner
|
|
99
66
|
};
|
package/dist/index62.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 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 GradientRing = react.forwardRef(
|
|
9
8
|
({
|
|
10
|
-
size =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
size = 48,
|
|
10
|
+
colors = ["#3b82f6", "#8b5cf6", "#ec4899"],
|
|
11
|
+
thickness = 6,
|
|
12
|
+
backgroundColor = "white",
|
|
14
13
|
speed = "normal",
|
|
15
14
|
respectMotionPreference = true,
|
|
16
15
|
delay = 0,
|
|
@@ -18,7 +17,7 @@ const ParticleBurst = react.forwardRef(
|
|
|
18
17
|
transition,
|
|
19
18
|
className,
|
|
20
19
|
style,
|
|
21
|
-
testId = "
|
|
20
|
+
testId = "gradient-ring",
|
|
22
21
|
visible = true,
|
|
23
22
|
ariaLabel = "Loading...",
|
|
24
23
|
...rest
|
|
@@ -27,10 +26,10 @@ const ParticleBurst = react.forwardRef(
|
|
|
27
26
|
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
28
27
|
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(visible, delay, minDuration, transition);
|
|
29
28
|
if (!shouldRender) return null;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
29
|
+
const stops = colors.join(", ");
|
|
30
|
+
const gradientStyle = `linear-gradient(135deg, ${stops}, ${colors[0]})`;
|
|
31
|
+
const inner = size - thickness * 2;
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
34
33
|
"div",
|
|
35
34
|
{
|
|
36
35
|
ref,
|
|
@@ -41,35 +40,29 @@ const ParticleBurst = react.forwardRef(
|
|
|
41
40
|
"aria-label": ariaLabel,
|
|
42
41
|
"aria-busy": "true",
|
|
43
42
|
...rest,
|
|
44
|
-
children:
|
|
45
|
-
|
|
46
|
-
const tx = Math.cos(angle) * radius;
|
|
47
|
-
const ty = Math.sin(angle) * radius;
|
|
48
|
-
const animationDelay = `${i / clampedCount * durationMs}ms`;
|
|
49
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
50
45
|
"div",
|
|
51
46
|
{
|
|
52
|
-
className: "absolute rounded-full",
|
|
47
|
+
className: "absolute inset-0 rounded-full",
|
|
53
48
|
style: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
top: "50%",
|
|
58
|
-
left: "50%",
|
|
59
|
-
marginTop: -particleSize / 2,
|
|
60
|
-
marginLeft: -particleSize / 2,
|
|
61
|
-
animation: `particle-burst ${effectiveDuration} ease-out infinite`,
|
|
62
|
-
animationDelay,
|
|
63
|
-
["--tx"]: `${tx}px`,
|
|
64
|
-
["--ty"]: `${ty}px`
|
|
49
|
+
background: gradientStyle,
|
|
50
|
+
backgroundSize: "200% 200%",
|
|
51
|
+
animation: `gradient-flow ${effectiveDuration} ease infinite, gradient-spin ${effectiveDuration} linear infinite`
|
|
65
52
|
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: "absolute rounded-full",
|
|
59
|
+
style: { width: inner, height: inner, backgroundColor }
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
]
|
|
70
63
|
}
|
|
71
64
|
);
|
|
72
65
|
}
|
|
73
66
|
);
|
|
74
|
-
|
|
75
|
-
exports.
|
|
67
|
+
GradientRing.displayName = "GradientRing";
|
|
68
|
+
exports.GradientRing = GradientRing;
|
package/dist/index62.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
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 "./
|
|
4
|
-
import { parseDurationMs } from "./index4.js";
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
|
|
5
4
|
import { cn } from "./index3.js";
|
|
6
|
-
const
|
|
5
|
+
const GradientRing = forwardRef(
|
|
7
6
|
({
|
|
8
|
-
size =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
size = 48,
|
|
8
|
+
colors = ["#3b82f6", "#8b5cf6", "#ec4899"],
|
|
9
|
+
thickness = 6,
|
|
10
|
+
backgroundColor = "white",
|
|
12
11
|
speed = "normal",
|
|
13
12
|
respectMotionPreference = true,
|
|
14
13
|
delay = 0,
|
|
@@ -16,7 +15,7 @@ const ParticleBurst = forwardRef(
|
|
|
16
15
|
transition,
|
|
17
16
|
className,
|
|
18
17
|
style,
|
|
19
|
-
testId = "
|
|
18
|
+
testId = "gradient-ring",
|
|
20
19
|
visible = true,
|
|
21
20
|
ariaLabel = "Loading...",
|
|
22
21
|
...rest
|
|
@@ -25,10 +24,10 @@ const ParticleBurst = forwardRef(
|
|
|
25
24
|
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
26
25
|
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(visible, delay, minDuration, transition);
|
|
27
26
|
if (!shouldRender) return null;
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
return /* @__PURE__ */
|
|
27
|
+
const stops = colors.join(", ");
|
|
28
|
+
const gradientStyle = `linear-gradient(135deg, ${stops}, ${colors[0]})`;
|
|
29
|
+
const inner = size - thickness * 2;
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
32
31
|
"div",
|
|
33
32
|
{
|
|
34
33
|
ref,
|
|
@@ -39,37 +38,31 @@ const ParticleBurst = forwardRef(
|
|
|
39
38
|
"aria-label": ariaLabel,
|
|
40
39
|
"aria-busy": "true",
|
|
41
40
|
...rest,
|
|
42
|
-
children:
|
|
43
|
-
|
|
44
|
-
const tx = Math.cos(angle) * radius;
|
|
45
|
-
const ty = Math.sin(angle) * radius;
|
|
46
|
-
const animationDelay = `${i / clampedCount * durationMs}ms`;
|
|
47
|
-
return /* @__PURE__ */ jsx(
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
48
43
|
"div",
|
|
49
44
|
{
|
|
50
|
-
className: "absolute rounded-full",
|
|
45
|
+
className: "absolute inset-0 rounded-full",
|
|
51
46
|
style: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
top: "50%",
|
|
56
|
-
left: "50%",
|
|
57
|
-
marginTop: -particleSize / 2,
|
|
58
|
-
marginLeft: -particleSize / 2,
|
|
59
|
-
animation: `particle-burst ${effectiveDuration} ease-out infinite`,
|
|
60
|
-
animationDelay,
|
|
61
|
-
["--tx"]: `${tx}px`,
|
|
62
|
-
["--ty"]: `${ty}px`
|
|
47
|
+
background: gradientStyle,
|
|
48
|
+
backgroundSize: "200% 200%",
|
|
49
|
+
animation: `gradient-flow ${effectiveDuration} ease infinite, gradient-spin ${effectiveDuration} linear infinite`
|
|
63
50
|
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: "absolute rounded-full",
|
|
57
|
+
style: { width: inner, height: inner, backgroundColor }
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
]
|
|
68
61
|
}
|
|
69
62
|
);
|
|
70
63
|
}
|
|
71
64
|
);
|
|
72
|
-
|
|
65
|
+
GradientRing.displayName = "GradientRing";
|
|
73
66
|
export {
|
|
74
|
-
|
|
67
|
+
GradientRing
|
|
75
68
|
};
|