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/index52.cjs
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
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("./
|
|
5
|
+
const hooks = require("./index71.cjs");
|
|
6
6
|
const classNames = require("./index3.cjs");
|
|
7
7
|
const colors = require("./index4.cjs");
|
|
8
|
-
const
|
|
8
|
+
const FlipCard = react.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
size = "md",
|
|
11
11
|
color = "#3b82f6",
|
|
12
12
|
secondaryColor = "#8b5cf6",
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
direction = "horizontal",
|
|
14
|
+
frontColor,
|
|
15
|
+
backColor,
|
|
16
|
+
width,
|
|
15
17
|
height,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
particleSize = 6,
|
|
19
|
-
showLines = false,
|
|
18
|
+
interval,
|
|
19
|
+
perspective = 1e3,
|
|
20
20
|
speed = "normal",
|
|
21
21
|
reverse = false,
|
|
22
22
|
respectMotionPreference = true,
|
|
@@ -25,13 +25,17 @@ const Helix = react.forwardRef(
|
|
|
25
25
|
transition,
|
|
26
26
|
className,
|
|
27
27
|
style,
|
|
28
|
-
testId = "
|
|
28
|
+
testId = "flip-card",
|
|
29
29
|
visible = true,
|
|
30
30
|
ariaLabel = "Loading...",
|
|
31
31
|
...rest
|
|
32
32
|
}, ref) => {
|
|
33
33
|
const prefersReducedMotion = hooks.useReducedMotion();
|
|
34
|
-
const effectiveDuration = hooks.getEffectiveDuration(
|
|
34
|
+
const effectiveDuration = hooks.getEffectiveDuration(
|
|
35
|
+
interval !== void 0 ? interval : speed,
|
|
36
|
+
respectMotionPreference,
|
|
37
|
+
prefersReducedMotion
|
|
38
|
+
);
|
|
35
39
|
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
36
40
|
visible,
|
|
37
41
|
delay,
|
|
@@ -39,23 +43,11 @@ const Helix = react.forwardRef(
|
|
|
39
43
|
transition
|
|
40
44
|
);
|
|
41
45
|
if (!shouldRender) return null;
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const x = Math.cos(angle) * radius;
|
|
48
|
-
const z = Math.sin(angle) * radius;
|
|
49
|
-
const isSecondStrand = index % 2 === 1;
|
|
50
|
-
return {
|
|
51
|
-
x,
|
|
52
|
-
y,
|
|
53
|
-
z,
|
|
54
|
-
angle,
|
|
55
|
-
color: isSecondStrand ? secondaryColor : color
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
const animationClass = direction === "up" ? "animate-helix-rotate-up" : "animate-helix-rotate-down";
|
|
46
|
+
const cardWidth = width ? colors.normalizeSize(width) : colors.normalizeSize(size);
|
|
47
|
+
const cardHeight = height ? colors.normalizeSize(height) : `calc(${colors.normalizeSize(size)} * 0.6)`;
|
|
48
|
+
const front = frontColor || color;
|
|
49
|
+
const back = backColor || secondaryColor;
|
|
50
|
+
const animationClass = direction === "horizontal" ? "animate-flip-card-horizontal" : "animate-flip-card-vertical";
|
|
59
51
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
60
52
|
"div",
|
|
61
53
|
{
|
|
@@ -66,7 +58,7 @@ const Helix = react.forwardRef(
|
|
|
66
58
|
...style,
|
|
67
59
|
opacity,
|
|
68
60
|
transition: transitionStyle,
|
|
69
|
-
perspective:
|
|
61
|
+
perspective: `${perspective}px`
|
|
70
62
|
},
|
|
71
63
|
role: "status",
|
|
72
64
|
"aria-label": ariaLabel,
|
|
@@ -77,62 +69,36 @@ const Helix = react.forwardRef(
|
|
|
77
69
|
{
|
|
78
70
|
className: classNames.cn("relative", animationClass),
|
|
79
71
|
style: {
|
|
80
|
-
width:
|
|
81
|
-
height:
|
|
72
|
+
width: cardWidth,
|
|
73
|
+
height: cardHeight,
|
|
82
74
|
transformStyle: "preserve-3d",
|
|
83
75
|
animationDuration: effectiveDuration,
|
|
84
76
|
animationDirection: reverse ? "reverse" : "normal"
|
|
85
77
|
},
|
|
86
78
|
children: [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
height: `${helixHeight}px`,
|
|
100
|
-
pointerEvents: "none"
|
|
101
|
-
},
|
|
102
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
-
"line",
|
|
104
|
-
{
|
|
105
|
-
x1: prevParticle.x + radius + particleSize,
|
|
106
|
-
y1: prevParticle.y,
|
|
107
|
-
x2: particle.x + radius + particleSize,
|
|
108
|
-
y2: particle.y,
|
|
109
|
-
stroke: particle.color,
|
|
110
|
-
strokeWidth: "1",
|
|
111
|
-
opacity: "0.3"
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
},
|
|
115
|
-
`line-${index}`
|
|
116
|
-
);
|
|
117
|
-
}),
|
|
118
|
-
particles.map((particle, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: "absolute inset-0 rounded-md flex items-center justify-center",
|
|
83
|
+
style: {
|
|
84
|
+
backgroundColor: front,
|
|
85
|
+
backfaceVisibility: "hidden",
|
|
86
|
+
WebkitBackfaceVisibility: "hidden"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
91
|
"div",
|
|
120
92
|
{
|
|
121
|
-
className: "absolute
|
|
93
|
+
className: "absolute inset-0 rounded-md flex items-center justify-center",
|
|
122
94
|
style: {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
backgroundColor: particle.color,
|
|
128
|
-
borderRadius: "50%",
|
|
129
|
-
transform: `translate3d(${particle.x}px, 0, ${particle.z}px)`,
|
|
130
|
-
animationDuration: "1s",
|
|
131
|
-
animationDelay: `${index * 0.08}s`
|
|
95
|
+
backgroundColor: back,
|
|
96
|
+
backfaceVisibility: "hidden",
|
|
97
|
+
WebkitBackfaceVisibility: "hidden",
|
|
98
|
+
transform: direction === "horizontal" ? "rotateY(180deg)" : "rotateX(180deg)"
|
|
132
99
|
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
))
|
|
100
|
+
}
|
|
101
|
+
)
|
|
136
102
|
]
|
|
137
103
|
}
|
|
138
104
|
)
|
|
@@ -140,5 +106,5 @@ const Helix = react.forwardRef(
|
|
|
140
106
|
);
|
|
141
107
|
}
|
|
142
108
|
);
|
|
143
|
-
|
|
144
|
-
exports.
|
|
109
|
+
FlipCard.displayName = "FlipCard";
|
|
110
|
+
exports.FlipCard = FlipCard;
|
package/dist/index52.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx, jsxs } 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
|
-
import {
|
|
6
|
-
const
|
|
5
|
+
import { normalizeSize } from "./index4.js";
|
|
6
|
+
const FlipCard = forwardRef(
|
|
7
7
|
({
|
|
8
8
|
size = "md",
|
|
9
9
|
color = "#3b82f6",
|
|
10
10
|
secondaryColor = "#8b5cf6",
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
direction = "horizontal",
|
|
12
|
+
frontColor,
|
|
13
|
+
backColor,
|
|
14
|
+
width,
|
|
13
15
|
height,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
particleSize = 6,
|
|
17
|
-
showLines = false,
|
|
16
|
+
interval,
|
|
17
|
+
perspective = 1e3,
|
|
18
18
|
speed = "normal",
|
|
19
19
|
reverse = false,
|
|
20
20
|
respectMotionPreference = true,
|
|
@@ -23,13 +23,17 @@ const Helix = forwardRef(
|
|
|
23
23
|
transition,
|
|
24
24
|
className,
|
|
25
25
|
style,
|
|
26
|
-
testId = "
|
|
26
|
+
testId = "flip-card",
|
|
27
27
|
visible = true,
|
|
28
28
|
ariaLabel = "Loading...",
|
|
29
29
|
...rest
|
|
30
30
|
}, ref) => {
|
|
31
31
|
const prefersReducedMotion = useReducedMotion();
|
|
32
|
-
const effectiveDuration = getEffectiveDuration(
|
|
32
|
+
const effectiveDuration = getEffectiveDuration(
|
|
33
|
+
interval !== void 0 ? interval : speed,
|
|
34
|
+
respectMotionPreference,
|
|
35
|
+
prefersReducedMotion
|
|
36
|
+
);
|
|
33
37
|
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
|
|
34
38
|
visible,
|
|
35
39
|
delay,
|
|
@@ -37,23 +41,11 @@ const Helix = forwardRef(
|
|
|
37
41
|
transition
|
|
38
42
|
);
|
|
39
43
|
if (!shouldRender) return null;
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const x = Math.cos(angle) * radius;
|
|
46
|
-
const z = Math.sin(angle) * radius;
|
|
47
|
-
const isSecondStrand = index % 2 === 1;
|
|
48
|
-
return {
|
|
49
|
-
x,
|
|
50
|
-
y,
|
|
51
|
-
z,
|
|
52
|
-
angle,
|
|
53
|
-
color: isSecondStrand ? secondaryColor : color
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
const animationClass = direction === "up" ? "animate-helix-rotate-up" : "animate-helix-rotate-down";
|
|
44
|
+
const cardWidth = width ? normalizeSize(width) : normalizeSize(size);
|
|
45
|
+
const cardHeight = height ? normalizeSize(height) : `calc(${normalizeSize(size)} * 0.6)`;
|
|
46
|
+
const front = frontColor || color;
|
|
47
|
+
const back = backColor || secondaryColor;
|
|
48
|
+
const animationClass = direction === "horizontal" ? "animate-flip-card-horizontal" : "animate-flip-card-vertical";
|
|
57
49
|
return /* @__PURE__ */ jsx(
|
|
58
50
|
"div",
|
|
59
51
|
{
|
|
@@ -64,7 +56,7 @@ const Helix = forwardRef(
|
|
|
64
56
|
...style,
|
|
65
57
|
opacity,
|
|
66
58
|
transition: transitionStyle,
|
|
67
|
-
perspective:
|
|
59
|
+
perspective: `${perspective}px`
|
|
68
60
|
},
|
|
69
61
|
role: "status",
|
|
70
62
|
"aria-label": ariaLabel,
|
|
@@ -75,62 +67,36 @@ const Helix = forwardRef(
|
|
|
75
67
|
{
|
|
76
68
|
className: cn("relative", animationClass),
|
|
77
69
|
style: {
|
|
78
|
-
width:
|
|
79
|
-
height:
|
|
70
|
+
width: cardWidth,
|
|
71
|
+
height: cardHeight,
|
|
80
72
|
transformStyle: "preserve-3d",
|
|
81
73
|
animationDuration: effectiveDuration,
|
|
82
74
|
animationDirection: reverse ? "reverse" : "normal"
|
|
83
75
|
},
|
|
84
76
|
children: [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
height: `${helixHeight}px`,
|
|
98
|
-
pointerEvents: "none"
|
|
99
|
-
},
|
|
100
|
-
children: /* @__PURE__ */ jsx(
|
|
101
|
-
"line",
|
|
102
|
-
{
|
|
103
|
-
x1: prevParticle.x + radius + particleSize,
|
|
104
|
-
y1: prevParticle.y,
|
|
105
|
-
x2: particle.x + radius + particleSize,
|
|
106
|
-
y2: particle.y,
|
|
107
|
-
stroke: particle.color,
|
|
108
|
-
strokeWidth: "1",
|
|
109
|
-
opacity: "0.3"
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
},
|
|
113
|
-
`line-${index}`
|
|
114
|
-
);
|
|
115
|
-
}),
|
|
116
|
-
particles.map((particle, index) => /* @__PURE__ */ jsx(
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: "absolute inset-0 rounded-md flex items-center justify-center",
|
|
81
|
+
style: {
|
|
82
|
+
backgroundColor: front,
|
|
83
|
+
backfaceVisibility: "hidden",
|
|
84
|
+
WebkitBackfaceVisibility: "hidden"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
117
89
|
"div",
|
|
118
90
|
{
|
|
119
|
-
className: "absolute
|
|
91
|
+
className: "absolute inset-0 rounded-md flex items-center justify-center",
|
|
120
92
|
style: {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
backgroundColor: particle.color,
|
|
126
|
-
borderRadius: "50%",
|
|
127
|
-
transform: `translate3d(${particle.x}px, 0, ${particle.z}px)`,
|
|
128
|
-
animationDuration: "1s",
|
|
129
|
-
animationDelay: `${index * 0.08}s`
|
|
93
|
+
backgroundColor: back,
|
|
94
|
+
backfaceVisibility: "hidden",
|
|
95
|
+
WebkitBackfaceVisibility: "hidden",
|
|
96
|
+
transform: direction === "horizontal" ? "rotateY(180deg)" : "rotateX(180deg)"
|
|
130
97
|
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
))
|
|
98
|
+
}
|
|
99
|
+
)
|
|
134
100
|
]
|
|
135
101
|
}
|
|
136
102
|
)
|
|
@@ -138,7 +104,7 @@ const Helix = forwardRef(
|
|
|
138
104
|
);
|
|
139
105
|
}
|
|
140
106
|
);
|
|
141
|
-
|
|
107
|
+
FlipCard.displayName = "FlipCard";
|
|
142
108
|
export {
|
|
143
|
-
|
|
109
|
+
FlipCard
|
|
144
110
|
};
|
package/dist/index53.cjs
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
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("./
|
|
5
|
+
const hooks = require("./index71.cjs");
|
|
6
6
|
const classNames = require("./index3.cjs");
|
|
7
7
|
const colors = require("./index4.cjs");
|
|
8
|
-
const
|
|
8
|
+
const PlaneRotate = react.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
size = "md",
|
|
11
11
|
color = "#3b82f6",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
planeCount = 3,
|
|
13
|
+
spacing = 6,
|
|
14
|
+
rotationType = "staggered",
|
|
15
|
+
opacity: planeOpacity = 0.6,
|
|
16
|
+
showAxis = false,
|
|
17
17
|
speed = "normal",
|
|
18
18
|
reverse = false,
|
|
19
19
|
respectMotionPreference = true,
|
|
@@ -22,23 +22,27 @@ const PerspectiveRing = react.forwardRef(
|
|
|
22
22
|
transition,
|
|
23
23
|
className,
|
|
24
24
|
style,
|
|
25
|
-
testId = "
|
|
25
|
+
testId = "plane-rotate",
|
|
26
26
|
visible = true,
|
|
27
27
|
ariaLabel = "Loading...",
|
|
28
28
|
...rest
|
|
29
29
|
}, ref) => {
|
|
30
30
|
const prefersReducedMotion = hooks.useReducedMotion();
|
|
31
31
|
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
32
|
-
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
32
|
+
const { shouldRender, opacity: containerOpacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
33
33
|
visible,
|
|
34
34
|
delay,
|
|
35
35
|
minDuration,
|
|
36
36
|
transition
|
|
37
37
|
);
|
|
38
38
|
if (!shouldRender) return null;
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
39
|
+
const planeSize = colors.normalizeSize(size);
|
|
40
|
+
const count = Math.min(Math.max(planeCount, 2), 6);
|
|
41
|
+
const animationClass = {
|
|
42
|
+
synchronized: "animate-plane-rotate-sync",
|
|
43
|
+
staggered: "animate-plane-rotate-stagger",
|
|
44
|
+
opposite: "animate-plane-rotate-opposite"
|
|
45
|
+
}[rotationType];
|
|
42
46
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
47
|
"div",
|
|
44
48
|
{
|
|
@@ -47,66 +51,62 @@ const PerspectiveRing = react.forwardRef(
|
|
|
47
51
|
className: classNames.cn("inline-flex items-center justify-center", className),
|
|
48
52
|
style: {
|
|
49
53
|
...style,
|
|
50
|
-
opacity,
|
|
54
|
+
opacity: containerOpacity,
|
|
51
55
|
transition: transitionStyle,
|
|
52
|
-
perspective: "
|
|
56
|
+
perspective: "600px"
|
|
53
57
|
},
|
|
54
58
|
role: "status",
|
|
55
59
|
"aria-label": ariaLabel,
|
|
56
60
|
"aria-busy": "true",
|
|
57
61
|
...rest,
|
|
58
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
children: Array.from({ length: segmentCount }).map((_, index) => {
|
|
84
|
-
const angle = index / segmentCount * 360;
|
|
85
|
-
const segmentOpacity = 0.3 + (Math.cos(angle * Math.PI / 180) + 1) / 2 * 0.7;
|
|
62
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: "relative",
|
|
66
|
+
style: {
|
|
67
|
+
width: planeSize,
|
|
68
|
+
height: planeSize,
|
|
69
|
+
transformStyle: "preserve-3d"
|
|
70
|
+
},
|
|
71
|
+
children: [
|
|
72
|
+
showAxis && /* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
76
|
+
style: {
|
|
77
|
+
width: "2px",
|
|
78
|
+
height: planeSize,
|
|
79
|
+
backgroundColor: color,
|
|
80
|
+
opacity: 0.3
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
Array.from({ length: count }).map((_, index) => {
|
|
85
|
+
const delay2 = rotationType === "staggered" ? `${index * 0.15}s` : "0s";
|
|
86
|
+
const direction = rotationType === "opposite" && index % 2 === 1 ? reverse ? "normal" : "reverse" : reverse ? "reverse" : "normal";
|
|
86
87
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
88
|
"div",
|
|
88
89
|
{
|
|
89
|
-
className: "absolute
|
|
90
|
+
className: classNames.cn("absolute inset-0", animationClass),
|
|
90
91
|
style: {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
opacity: segmentOpacity
|
|
92
|
+
backgroundColor: color,
|
|
93
|
+
opacity: planeOpacity,
|
|
94
|
+
transformStyle: "preserve-3d",
|
|
95
|
+
transform: `translateZ(${(index - count / 2) * spacing}px)`,
|
|
96
|
+
animationDuration: effectiveDuration,
|
|
97
|
+
animationDelay: delay2,
|
|
98
|
+
animationDirection: direction
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
index
|
|
102
102
|
);
|
|
103
103
|
})
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
|
-
|
|
112
|
-
exports.
|
|
111
|
+
PlaneRotate.displayName = "PlaneRotate";
|
|
112
|
+
exports.PlaneRotate = PlaneRotate;
|