premium-react-loaders 3.0.0 → 3.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/README.md +45 -3
- package/dist/components/3d/CubeSpinner.d.ts +21 -0
- package/dist/components/3d/CubeSpinner.d.ts.map +1 -0
- package/dist/components/3d/FlipCard.d.ts +21 -0
- package/dist/components/3d/FlipCard.d.ts.map +1 -0
- package/dist/components/3d/Helix.d.ts +23 -0
- package/dist/components/3d/Helix.d.ts.map +1 -0
- package/dist/components/3d/PerspectiveRing.d.ts +21 -0
- package/dist/components/3d/PerspectiveRing.d.ts.map +1 -0
- package/dist/components/3d/PlaneRotate.d.ts +21 -0
- package/dist/components/3d/PlaneRotate.d.ts.map +1 -0
- package/dist/components/3d/index.d.ts +6 -0
- package/dist/components/3d/index.d.ts.map +1 -0
- package/dist/components/accessibility/LiveRegion.d.ts +34 -0
- package/dist/components/accessibility/LiveRegion.d.ts.map +1 -0
- package/dist/components/accessibility/index.d.ts +2 -0
- package/dist/components/accessibility/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/skeleton/DataTableSkeleton.d.ts +25 -0
- package/dist/components/skeleton/DataTableSkeleton.d.ts.map +1 -0
- package/dist/components/skeleton/SmartSkeleton.d.ts +23 -0
- package/dist/components/skeleton/SmartSkeleton.d.ts.map +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.d.ts.map +1 -1
- package/dist/components/smart/FormFieldLoader.d.ts +22 -0
- package/dist/components/smart/FormFieldLoader.d.ts.map +1 -0
- package/dist/components/smart/index.d.ts +2 -0
- package/dist/components/smart/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useLoadingAnalytics.d.ts +101 -0
- package/dist/hooks/useLoadingAnalytics.d.ts.map +1 -0
- package/dist/hooks/useLoadingOrchestrator.d.ts +104 -0
- package/dist/hooks/useLoadingOrchestrator.d.ts.map +1 -0
- package/dist/hooks/useSmartLoader.d.ts +98 -0
- package/dist/hooks/useSmartLoader.d.ts.map +1 -0
- package/dist/index.cjs +49 -31
- package/dist/index.js +49 -31
- 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 +131 -66
- package/dist/index16.js +132 -67
- package/dist/index17.cjs +245 -30
- package/dist/index17.js +246 -31
- package/dist/index18.cjs +24 -36
- package/dist/index18.js +24 -36
- package/dist/index19.cjs +19 -21
- package/dist/index19.js +19 -21
- package/dist/index20.cjs +25 -20
- package/dist/index20.js +25 -20
- package/dist/index21.cjs +22 -32
- package/dist/index21.js +22 -32
- package/dist/index22.cjs +26 -35
- package/dist/index22.js +28 -37
- package/dist/index23.cjs +40 -76
- package/dist/index23.js +42 -78
- package/dist/index24.cjs +53 -102
- package/dist/index24.js +54 -103
- package/dist/index25.cjs +46 -80
- package/dist/index25.js +47 -81
- package/dist/index26.cjs +105 -103
- package/dist/index26.js +107 -105
- package/dist/index27.cjs +108 -27
- package/dist/index27.js +111 -30
- package/dist/index28.cjs +104 -36
- package/dist/index28.js +106 -38
- package/dist/index29.cjs +22 -30
- package/dist/index29.js +23 -31
- package/dist/index30.cjs +30 -32
- package/dist/index30.js +31 -33
- package/dist/index31.cjs +49 -52
- package/dist/index31.js +50 -53
- package/dist/index32.cjs +37 -108
- package/dist/index32.js +38 -109
- package/dist/index33.cjs +54 -72
- package/dist/index33.js +55 -73
- package/dist/index34.cjs +112 -80
- package/dist/index34.js +112 -80
- package/dist/index35.cjs +78 -145
- package/dist/index35.js +80 -147
- package/dist/index36.cjs +78 -57
- package/dist/index36.js +79 -58
- package/dist/index37.cjs +138 -84
- package/dist/index37.js +140 -86
- package/dist/index38.cjs +33 -106
- package/dist/index38.js +34 -107
- package/dist/index39.cjs +66 -50
- package/dist/index39.js +66 -50
- package/dist/index40.cjs +123 -44
- package/dist/index40.js +124 -45
- package/dist/index41.cjs +43 -85
- package/dist/index41.js +44 -86
- package/dist/index42.cjs +35 -27
- package/dist/index42.js +35 -27
- package/dist/index43.cjs +87 -58
- package/dist/index43.js +87 -58
- package/dist/index44.cjs +35 -88
- package/dist/index44.js +36 -89
- package/dist/index45.cjs +62 -58
- package/dist/index45.js +63 -59
- package/dist/index46.cjs +87 -110
- package/dist/index46.js +88 -111
- package/dist/index47.cjs +101 -120
- package/dist/index47.js +102 -121
- package/dist/index48.cjs +158 -0
- package/dist/index48.js +158 -0
- package/dist/index49.cjs +167 -0
- package/dist/index49.js +167 -0
- package/dist/index50.cjs +110 -0
- package/dist/index50.js +110 -0
- package/dist/index51.cjs +112 -0
- package/dist/index51.js +112 -0
- package/dist/index52.cjs +144 -0
- package/dist/index52.js +144 -0
- package/dist/index53.cjs +112 -0
- package/dist/index53.js +112 -0
- package/dist/index54.cjs +189 -0
- package/dist/index54.js +189 -0
- package/dist/index55.cjs +53 -0
- package/dist/index55.js +53 -0
- package/dist/index56.cjs +125 -0
- package/dist/index56.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 +140 -0
- package/dist/types/3d.d.ts +85 -0
- package/dist/types/3d.d.ts.map +1 -0
- package/dist/types/accessibility.d.ts +35 -0
- package/dist/types/accessibility.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/smart.d.ts +63 -0
- package/dist/types/smart.d.ts.map +1 -0
- package/dist/utils/accessibility.d.ts +67 -0
- package/dist/utils/accessibility.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index19.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./
|
|
4
|
-
import { normalizeSize, parseSizeToNumber } from "./index4.js";
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index56.js";
|
|
5
4
|
import { cn } from "./index3.js";
|
|
6
|
-
|
|
5
|
+
import { normalizeSize } from "./index4.js";
|
|
6
|
+
const SpinnerRing = forwardRef(
|
|
7
7
|
({
|
|
8
8
|
size = "md",
|
|
9
9
|
color = "#3b82f6",
|
|
10
|
-
|
|
10
|
+
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
11
|
+
thickness = 4,
|
|
11
12
|
speed = "normal",
|
|
12
13
|
reverse = false,
|
|
13
14
|
respectMotionPreference = true,
|
|
@@ -16,7 +17,7 @@ const SpinnerBars = forwardRef(
|
|
|
16
17
|
transition,
|
|
17
18
|
className,
|
|
18
19
|
style,
|
|
19
|
-
testId = "spinner-
|
|
20
|
+
testId = "spinner-ring",
|
|
20
21
|
visible = true,
|
|
21
22
|
ariaLabel = "Loading...",
|
|
22
23
|
...rest
|
|
@@ -30,16 +31,13 @@ const SpinnerBars = forwardRef(
|
|
|
30
31
|
transition
|
|
31
32
|
);
|
|
32
33
|
if (!shouldRender) return null;
|
|
33
|
-
const sizeValue = parseSizeToNumber(size, 40);
|
|
34
|
-
const barWidth = Math.floor(sizeValue / (barCount * 2));
|
|
35
34
|
return /* @__PURE__ */ jsx(
|
|
36
35
|
"div",
|
|
37
36
|
{
|
|
38
37
|
ref,
|
|
39
38
|
"data-testid": testId,
|
|
40
|
-
className: cn("inline-flex items-center justify-center
|
|
39
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
41
40
|
style: {
|
|
42
|
-
height: normalizeSize(size),
|
|
43
41
|
...style,
|
|
44
42
|
opacity,
|
|
45
43
|
transition: transitionStyle
|
|
@@ -48,25 +46,25 @@ const SpinnerBars = forwardRef(
|
|
|
48
46
|
"aria-label": ariaLabel,
|
|
49
47
|
"aria-busy": "true",
|
|
50
48
|
...rest,
|
|
51
|
-
children:
|
|
49
|
+
children: /* @__PURE__ */ jsx(
|
|
52
50
|
"div",
|
|
53
51
|
{
|
|
54
|
-
className: "rounded-
|
|
52
|
+
className: "rounded-full",
|
|
55
53
|
style: {
|
|
56
|
-
width:
|
|
57
|
-
height:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
width: normalizeSize(size),
|
|
55
|
+
height: normalizeSize(size),
|
|
56
|
+
border: `${thickness}px solid ${secondaryColor}`,
|
|
57
|
+
borderTopColor: color,
|
|
58
|
+
animation: `spinner-rotate ${effectiveDuration} linear infinite`,
|
|
59
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
61
60
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
))
|
|
61
|
+
}
|
|
62
|
+
)
|
|
65
63
|
}
|
|
66
64
|
);
|
|
67
65
|
}
|
|
68
66
|
);
|
|
69
|
-
|
|
67
|
+
SpinnerRing.displayName = "SpinnerRing";
|
|
70
68
|
export {
|
|
71
|
-
|
|
69
|
+
SpinnerRing
|
|
72
70
|
};
|
package/dist/index20.cjs
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const hooks = require("./index47.cjs");
|
|
6
|
-
const classNames = require("./index3.cjs");
|
|
7
5
|
const colors = require("./index4.cjs");
|
|
8
|
-
const
|
|
6
|
+
const hooks = require("./index56.cjs");
|
|
7
|
+
const classNames = require("./index3.cjs");
|
|
8
|
+
const SpinnerDots = react.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
size = "md",
|
|
11
11
|
color = "#3b82f6",
|
|
12
|
-
|
|
12
|
+
dotCount = 8,
|
|
13
|
+
dotSize = 4,
|
|
13
14
|
speed = "normal",
|
|
14
15
|
reverse = false,
|
|
15
16
|
respectMotionPreference = true,
|
|
@@ -18,7 +19,7 @@ const SpinnerGrid = react.forwardRef(
|
|
|
18
19
|
transition,
|
|
19
20
|
className,
|
|
20
21
|
style,
|
|
21
|
-
testId = "spinner-
|
|
22
|
+
testId = "spinner-dots",
|
|
22
23
|
visible = true,
|
|
23
24
|
ariaLabel = "Loading...",
|
|
24
25
|
...rest
|
|
@@ -33,7 +34,8 @@ const SpinnerGrid = react.forwardRef(
|
|
|
33
34
|
);
|
|
34
35
|
if (!shouldRender) return null;
|
|
35
36
|
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
36
|
-
const
|
|
37
|
+
const dotSizeValue = colors.parseSizeToNumber(dotSize, 4);
|
|
38
|
+
const radius = (sizeValue - dotSizeValue) / 2;
|
|
37
39
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
40
|
"div",
|
|
39
41
|
{
|
|
@@ -52,27 +54,30 @@ const SpinnerGrid = react.forwardRef(
|
|
|
52
54
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53
55
|
"div",
|
|
54
56
|
{
|
|
55
|
-
className: "
|
|
57
|
+
className: "relative",
|
|
56
58
|
style: {
|
|
57
59
|
width: colors.normalizeSize(size),
|
|
58
60
|
height: colors.normalizeSize(size),
|
|
59
|
-
|
|
61
|
+
animation: `spinner-rotate ${effectiveDuration} linear infinite`,
|
|
62
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
60
63
|
},
|
|
61
|
-
children: Array.from({ length:
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
64
|
+
children: Array.from({ length: dotCount }).map((_, index) => {
|
|
65
|
+
const angle = 360 / dotCount * index;
|
|
66
|
+
const radian = angle * Math.PI / 180;
|
|
67
|
+
const x = radius * Math.cos(radian) + radius;
|
|
68
|
+
const y = radius * Math.sin(radian) + radius;
|
|
66
69
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
67
70
|
"div",
|
|
68
71
|
{
|
|
69
|
-
className: "rounded-
|
|
72
|
+
className: "absolute rounded-full",
|
|
70
73
|
style: {
|
|
71
|
-
width:
|
|
72
|
-
height:
|
|
74
|
+
width: colors.normalizeSize(dotSize),
|
|
75
|
+
height: colors.normalizeSize(dotSize),
|
|
73
76
|
backgroundColor: color,
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
left: `${x}px`,
|
|
78
|
+
top: `${y}px`,
|
|
79
|
+
opacity: 1 - index / dotCount * 0.7
|
|
80
|
+
// Fade effect
|
|
76
81
|
}
|
|
77
82
|
},
|
|
78
83
|
index
|
|
@@ -84,5 +89,5 @@ const SpinnerGrid = react.forwardRef(
|
|
|
84
89
|
);
|
|
85
90
|
}
|
|
86
91
|
);
|
|
87
|
-
|
|
88
|
-
exports.
|
|
92
|
+
SpinnerDots.displayName = "SpinnerDots";
|
|
93
|
+
exports.SpinnerDots = SpinnerDots;
|
package/dist/index20.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index47.js";
|
|
4
|
-
import { cn } from "./index3.js";
|
|
5
3
|
import { normalizeSize, parseSizeToNumber } from "./index4.js";
|
|
6
|
-
|
|
4
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index56.js";
|
|
5
|
+
import { cn } from "./index3.js";
|
|
6
|
+
const SpinnerDots = forwardRef(
|
|
7
7
|
({
|
|
8
8
|
size = "md",
|
|
9
9
|
color = "#3b82f6",
|
|
10
|
-
|
|
10
|
+
dotCount = 8,
|
|
11
|
+
dotSize = 4,
|
|
11
12
|
speed = "normal",
|
|
12
13
|
reverse = false,
|
|
13
14
|
respectMotionPreference = true,
|
|
@@ -16,7 +17,7 @@ const SpinnerGrid = forwardRef(
|
|
|
16
17
|
transition,
|
|
17
18
|
className,
|
|
18
19
|
style,
|
|
19
|
-
testId = "spinner-
|
|
20
|
+
testId = "spinner-dots",
|
|
20
21
|
visible = true,
|
|
21
22
|
ariaLabel = "Loading...",
|
|
22
23
|
...rest
|
|
@@ -31,7 +32,8 @@ const SpinnerGrid = forwardRef(
|
|
|
31
32
|
);
|
|
32
33
|
if (!shouldRender) return null;
|
|
33
34
|
const sizeValue = parseSizeToNumber(size, 40);
|
|
34
|
-
const
|
|
35
|
+
const dotSizeValue = parseSizeToNumber(dotSize, 4);
|
|
36
|
+
const radius = (sizeValue - dotSizeValue) / 2;
|
|
35
37
|
return /* @__PURE__ */ jsx(
|
|
36
38
|
"div",
|
|
37
39
|
{
|
|
@@ -50,27 +52,30 @@ const SpinnerGrid = forwardRef(
|
|
|
50
52
|
children: /* @__PURE__ */ jsx(
|
|
51
53
|
"div",
|
|
52
54
|
{
|
|
53
|
-
className: "
|
|
55
|
+
className: "relative",
|
|
54
56
|
style: {
|
|
55
57
|
width: normalizeSize(size),
|
|
56
58
|
height: normalizeSize(size),
|
|
57
|
-
|
|
59
|
+
animation: `spinner-rotate ${effectiveDuration} linear infinite`,
|
|
60
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
58
61
|
},
|
|
59
|
-
children: Array.from({ length:
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
62
|
+
children: Array.from({ length: dotCount }).map((_, index) => {
|
|
63
|
+
const angle = 360 / dotCount * index;
|
|
64
|
+
const radian = angle * Math.PI / 180;
|
|
65
|
+
const x = radius * Math.cos(radian) + radius;
|
|
66
|
+
const y = radius * Math.sin(radian) + radius;
|
|
64
67
|
return /* @__PURE__ */ jsx(
|
|
65
68
|
"div",
|
|
66
69
|
{
|
|
67
|
-
className: "rounded-
|
|
70
|
+
className: "absolute rounded-full",
|
|
68
71
|
style: {
|
|
69
|
-
width:
|
|
70
|
-
height:
|
|
72
|
+
width: normalizeSize(dotSize),
|
|
73
|
+
height: normalizeSize(dotSize),
|
|
71
74
|
backgroundColor: color,
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
left: `${x}px`,
|
|
76
|
+
top: `${y}px`,
|
|
77
|
+
opacity: 1 - index / dotCount * 0.7
|
|
78
|
+
// Fade effect
|
|
74
79
|
}
|
|
75
80
|
},
|
|
76
81
|
index
|
|
@@ -82,7 +87,7 @@ const SpinnerGrid = forwardRef(
|
|
|
82
87
|
);
|
|
83
88
|
}
|
|
84
89
|
);
|
|
85
|
-
|
|
90
|
+
SpinnerDots.displayName = "SpinnerDots";
|
|
86
91
|
export {
|
|
87
|
-
|
|
92
|
+
SpinnerDots
|
|
88
93
|
};
|
package/dist/index21.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 classNames = require("./index3.cjs");
|
|
5
|
+
const hooks = require("./index56.cjs");
|
|
7
6
|
const colors = require("./index4.cjs");
|
|
8
|
-
const
|
|
7
|
+
const classNames = require("./index3.cjs");
|
|
8
|
+
const SpinnerBars = react.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
size = "md",
|
|
11
11
|
color = "#3b82f6",
|
|
12
|
-
|
|
13
|
-
maxScale = 2,
|
|
12
|
+
barCount = 5,
|
|
14
13
|
speed = "normal",
|
|
15
14
|
reverse = false,
|
|
16
15
|
respectMotionPreference = true,
|
|
@@ -19,7 +18,7 @@ const SpinnerWave = react.forwardRef(
|
|
|
19
18
|
transition,
|
|
20
19
|
className,
|
|
21
20
|
style,
|
|
22
|
-
testId = "spinner-
|
|
21
|
+
testId = "spinner-bars",
|
|
23
22
|
visible = true,
|
|
24
23
|
ariaLabel = "Loading...",
|
|
25
24
|
...rest
|
|
@@ -33,14 +32,16 @@ const SpinnerWave = react.forwardRef(
|
|
|
33
32
|
transition
|
|
34
33
|
);
|
|
35
34
|
if (!shouldRender) return null;
|
|
36
|
-
const sizeValue = colors.
|
|
35
|
+
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
36
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2));
|
|
37
37
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
ref,
|
|
41
41
|
"data-testid": testId,
|
|
42
|
-
className: classNames.cn("inline-flex items-center justify-center", className),
|
|
42
|
+
className: classNames.cn("inline-flex items-center justify-center gap-1", className),
|
|
43
43
|
style: {
|
|
44
|
+
height: colors.normalizeSize(size),
|
|
44
45
|
...style,
|
|
45
46
|
opacity,
|
|
46
47
|
transition: transitionStyle
|
|
@@ -49,34 +50,23 @@ const SpinnerWave = react.forwardRef(
|
|
|
49
50
|
"aria-label": ariaLabel,
|
|
50
51
|
"aria-busy": "true",
|
|
51
52
|
...rest,
|
|
52
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
53
54
|
"div",
|
|
54
55
|
{
|
|
55
|
-
className: "
|
|
56
|
+
className: "rounded-sm",
|
|
56
57
|
style: {
|
|
57
|
-
width:
|
|
58
|
-
height:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
animation: `ripple-expand ${effectiveDuration} ease-out infinite`,
|
|
67
|
-
animationDelay: reverse ? `${(ripples - index - 1) * 0.4}s` : `${index * 0.4}s`,
|
|
68
|
-
animationDirection: reverse ? "reverse" : "normal",
|
|
69
|
-
// @ts-ignore - CSS variable for animation
|
|
70
|
-
"--max-scale": maxScale
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
index
|
|
74
|
-
))
|
|
75
|
-
}
|
|
76
|
-
)
|
|
58
|
+
width: `${barWidth}px`,
|
|
59
|
+
height: "100%",
|
|
60
|
+
backgroundColor: color,
|
|
61
|
+
animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
|
|
62
|
+
animationDelay: reverse ? `${(barCount - index - 1) * 0.1}s` : `${index * 0.1}s`
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
index
|
|
66
|
+
))
|
|
77
67
|
}
|
|
78
68
|
);
|
|
79
69
|
}
|
|
80
70
|
);
|
|
81
|
-
|
|
82
|
-
exports.
|
|
71
|
+
SpinnerBars.displayName = "SpinnerBars";
|
|
72
|
+
exports.SpinnerBars = SpinnerBars;
|
package/dist/index21.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
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 "./index56.js";
|
|
4
|
+
import { normalizeSize, parseSizeToNumber } from "./index4.js";
|
|
4
5
|
import { cn } from "./index3.js";
|
|
5
|
-
|
|
6
|
-
const SpinnerWave = forwardRef(
|
|
6
|
+
const SpinnerBars = forwardRef(
|
|
7
7
|
({
|
|
8
8
|
size = "md",
|
|
9
9
|
color = "#3b82f6",
|
|
10
|
-
|
|
11
|
-
maxScale = 2,
|
|
10
|
+
barCount = 5,
|
|
12
11
|
speed = "normal",
|
|
13
12
|
reverse = false,
|
|
14
13
|
respectMotionPreference = true,
|
|
@@ -17,7 +16,7 @@ const SpinnerWave = forwardRef(
|
|
|
17
16
|
transition,
|
|
18
17
|
className,
|
|
19
18
|
style,
|
|
20
|
-
testId = "spinner-
|
|
19
|
+
testId = "spinner-bars",
|
|
21
20
|
visible = true,
|
|
22
21
|
ariaLabel = "Loading...",
|
|
23
22
|
...rest
|
|
@@ -31,14 +30,16 @@ const SpinnerWave = forwardRef(
|
|
|
31
30
|
transition
|
|
32
31
|
);
|
|
33
32
|
if (!shouldRender) return null;
|
|
34
|
-
const sizeValue =
|
|
33
|
+
const sizeValue = parseSizeToNumber(size, 40);
|
|
34
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2));
|
|
35
35
|
return /* @__PURE__ */ jsx(
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
38
|
ref,
|
|
39
39
|
"data-testid": testId,
|
|
40
|
-
className: cn("inline-flex items-center justify-center", className),
|
|
40
|
+
className: cn("inline-flex items-center justify-center gap-1", className),
|
|
41
41
|
style: {
|
|
42
|
+
height: normalizeSize(size),
|
|
42
43
|
...style,
|
|
43
44
|
opacity,
|
|
44
45
|
transition: transitionStyle
|
|
@@ -47,36 +48,25 @@ const SpinnerWave = forwardRef(
|
|
|
47
48
|
"aria-label": ariaLabel,
|
|
48
49
|
"aria-busy": "true",
|
|
49
50
|
...rest,
|
|
50
|
-
children: /* @__PURE__ */ jsx(
|
|
51
|
+
children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsx(
|
|
51
52
|
"div",
|
|
52
53
|
{
|
|
53
|
-
className: "
|
|
54
|
+
className: "rounded-sm",
|
|
54
55
|
style: {
|
|
55
|
-
width:
|
|
56
|
-
height:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
animation: `ripple-expand ${effectiveDuration} ease-out infinite`,
|
|
65
|
-
animationDelay: reverse ? `${(ripples - index - 1) * 0.4}s` : `${index * 0.4}s`,
|
|
66
|
-
animationDirection: reverse ? "reverse" : "normal",
|
|
67
|
-
// @ts-ignore - CSS variable for animation
|
|
68
|
-
"--max-scale": maxScale
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
index
|
|
72
|
-
))
|
|
73
|
-
}
|
|
74
|
-
)
|
|
56
|
+
width: `${barWidth}px`,
|
|
57
|
+
height: "100%",
|
|
58
|
+
backgroundColor: color,
|
|
59
|
+
animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
|
|
60
|
+
animationDelay: reverse ? `${(barCount - index - 1) * 0.1}s` : `${index * 0.1}s`
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
index
|
|
64
|
+
))
|
|
75
65
|
}
|
|
76
66
|
);
|
|
77
67
|
}
|
|
78
68
|
);
|
|
79
|
-
|
|
69
|
+
SpinnerBars.displayName = "SpinnerBars";
|
|
80
70
|
export {
|
|
81
|
-
|
|
71
|
+
SpinnerBars
|
|
82
72
|
};
|
package/dist/index22.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("./
|
|
5
|
+
const hooks = require("./index56.cjs");
|
|
6
6
|
const classNames = require("./index3.cjs");
|
|
7
7
|
const colors = require("./index4.cjs");
|
|
8
|
-
const
|
|
8
|
+
const SpinnerGrid = react.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
size = "md",
|
|
11
11
|
color = "#3b82f6",
|
|
12
|
-
|
|
13
|
-
maxScale = 1.8,
|
|
12
|
+
gridSize = 3,
|
|
14
13
|
speed = "normal",
|
|
15
14
|
reverse = false,
|
|
16
15
|
respectMotionPreference = true,
|
|
@@ -19,7 +18,7 @@ const SpinnerPulse = react.forwardRef(
|
|
|
19
18
|
transition,
|
|
20
19
|
className,
|
|
21
20
|
style,
|
|
22
|
-
testId = "spinner-
|
|
21
|
+
testId = "spinner-grid",
|
|
23
22
|
visible = true,
|
|
24
23
|
ariaLabel = "Loading...",
|
|
25
24
|
...rest
|
|
@@ -33,7 +32,8 @@ const SpinnerPulse = react.forwardRef(
|
|
|
33
32
|
transition
|
|
34
33
|
);
|
|
35
34
|
if (!shouldRender) return null;
|
|
36
|
-
const sizeValue = colors.
|
|
35
|
+
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
36
|
+
const cellSize = Math.floor(sizeValue / gridSize) - 2;
|
|
37
37
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
@@ -49,49 +49,40 @@ const SpinnerPulse = react.forwardRef(
|
|
|
49
49
|
"aria-label": ariaLabel,
|
|
50
50
|
"aria-busy": "true",
|
|
51
51
|
...rest,
|
|
52
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
52
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
|
-
className: "
|
|
55
|
+
className: "grid gap-0.5",
|
|
56
56
|
style: {
|
|
57
|
-
width:
|
|
58
|
-
height:
|
|
57
|
+
width: colors.normalizeSize(size),
|
|
58
|
+
height: colors.normalizeSize(size),
|
|
59
|
+
gridTemplateColumns: `repeat(${gridSize}, 1fr)`
|
|
59
60
|
},
|
|
60
|
-
children:
|
|
61
|
-
|
|
61
|
+
children: Array.from({ length: gridSize * gridSize }).map((_, index) => {
|
|
62
|
+
const row = Math.floor(index / gridSize);
|
|
63
|
+
const col = index % gridSize;
|
|
64
|
+
const maxDelay = (gridSize - 1) * 2;
|
|
65
|
+
const delay2 = reverse ? (maxDelay - (row + col)) * 0.1 : (row + col) * 0.1;
|
|
66
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
67
|
"div",
|
|
63
68
|
{
|
|
64
|
-
className: "
|
|
69
|
+
className: "rounded-sm",
|
|
65
70
|
style: {
|
|
71
|
+
width: `${cellSize}px`,
|
|
72
|
+
height: `${cellSize}px`,
|
|
66
73
|
backgroundColor: color,
|
|
67
|
-
animation: `
|
|
68
|
-
animationDelay:
|
|
69
|
-
animationDirection: reverse ? "reverse" : "normal",
|
|
70
|
-
// @ts-ignore - CSS variable for animation
|
|
71
|
-
"--max-scale": maxScale
|
|
74
|
+
animation: `fade-pulse ${effectiveDuration} ease-in-out infinite`,
|
|
75
|
+
animationDelay: `${delay2}s`
|
|
72
76
|
}
|
|
73
77
|
},
|
|
74
78
|
index
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
"div",
|
|
78
|
-
{
|
|
79
|
-
className: "absolute rounded-full",
|
|
80
|
-
style: {
|
|
81
|
-
backgroundColor: color,
|
|
82
|
-
width: "50%",
|
|
83
|
-
height: "50%",
|
|
84
|
-
top: "25%",
|
|
85
|
-
left: "25%"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
]
|
|
79
|
+
);
|
|
80
|
+
})
|
|
90
81
|
}
|
|
91
82
|
)
|
|
92
83
|
}
|
|
93
84
|
);
|
|
94
85
|
}
|
|
95
86
|
);
|
|
96
|
-
|
|
97
|
-
exports.
|
|
87
|
+
SpinnerGrid.displayName = "SpinnerGrid";
|
|
88
|
+
exports.SpinnerGrid = SpinnerGrid;
|
package/dist/index22.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
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 "./index56.js";
|
|
4
4
|
import { cn } from "./index3.js";
|
|
5
|
-
import { normalizeSize } from "./index4.js";
|
|
6
|
-
const
|
|
5
|
+
import { normalizeSize, parseSizeToNumber } from "./index4.js";
|
|
6
|
+
const SpinnerGrid = forwardRef(
|
|
7
7
|
({
|
|
8
8
|
size = "md",
|
|
9
9
|
color = "#3b82f6",
|
|
10
|
-
|
|
11
|
-
maxScale = 1.8,
|
|
10
|
+
gridSize = 3,
|
|
12
11
|
speed = "normal",
|
|
13
12
|
reverse = false,
|
|
14
13
|
respectMotionPreference = true,
|
|
@@ -17,7 +16,7 @@ const SpinnerPulse = forwardRef(
|
|
|
17
16
|
transition,
|
|
18
17
|
className,
|
|
19
18
|
style,
|
|
20
|
-
testId = "spinner-
|
|
19
|
+
testId = "spinner-grid",
|
|
21
20
|
visible = true,
|
|
22
21
|
ariaLabel = "Loading...",
|
|
23
22
|
...rest
|
|
@@ -31,7 +30,8 @@ const SpinnerPulse = forwardRef(
|
|
|
31
30
|
transition
|
|
32
31
|
);
|
|
33
32
|
if (!shouldRender) return null;
|
|
34
|
-
const sizeValue =
|
|
33
|
+
const sizeValue = parseSizeToNumber(size, 40);
|
|
34
|
+
const cellSize = Math.floor(sizeValue / gridSize) - 2;
|
|
35
35
|
return /* @__PURE__ */ jsx(
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
@@ -47,51 +47,42 @@ const SpinnerPulse = forwardRef(
|
|
|
47
47
|
"aria-label": ariaLabel,
|
|
48
48
|
"aria-busy": "true",
|
|
49
49
|
...rest,
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ jsx(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
|
-
className: "
|
|
53
|
+
className: "grid gap-0.5",
|
|
54
54
|
style: {
|
|
55
|
-
width:
|
|
56
|
-
height:
|
|
55
|
+
width: normalizeSize(size),
|
|
56
|
+
height: normalizeSize(size),
|
|
57
|
+
gridTemplateColumns: `repeat(${gridSize}, 1fr)`
|
|
57
58
|
},
|
|
58
|
-
children:
|
|
59
|
-
|
|
59
|
+
children: Array.from({ length: gridSize * gridSize }).map((_, index) => {
|
|
60
|
+
const row = Math.floor(index / gridSize);
|
|
61
|
+
const col = index % gridSize;
|
|
62
|
+
const maxDelay = (gridSize - 1) * 2;
|
|
63
|
+
const delay2 = reverse ? (maxDelay - (row + col)) * 0.1 : (row + col) * 0.1;
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
60
65
|
"div",
|
|
61
66
|
{
|
|
62
|
-
className: "
|
|
67
|
+
className: "rounded-sm",
|
|
63
68
|
style: {
|
|
69
|
+
width: `${cellSize}px`,
|
|
70
|
+
height: `${cellSize}px`,
|
|
64
71
|
backgroundColor: color,
|
|
65
|
-
animation: `
|
|
66
|
-
animationDelay:
|
|
67
|
-
animationDirection: reverse ? "reverse" : "normal",
|
|
68
|
-
// @ts-ignore - CSS variable for animation
|
|
69
|
-
"--max-scale": maxScale
|
|
72
|
+
animation: `fade-pulse ${effectiveDuration} ease-in-out infinite`,
|
|
73
|
+
animationDelay: `${delay2}s`
|
|
70
74
|
}
|
|
71
75
|
},
|
|
72
76
|
index
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
"div",
|
|
76
|
-
{
|
|
77
|
-
className: "absolute rounded-full",
|
|
78
|
-
style: {
|
|
79
|
-
backgroundColor: color,
|
|
80
|
-
width: "50%",
|
|
81
|
-
height: "50%",
|
|
82
|
-
top: "25%",
|
|
83
|
-
left: "25%"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
)
|
|
87
|
-
]
|
|
77
|
+
);
|
|
78
|
+
})
|
|
88
79
|
}
|
|
89
80
|
)
|
|
90
81
|
}
|
|
91
82
|
);
|
|
92
83
|
}
|
|
93
84
|
);
|
|
94
|
-
|
|
85
|
+
SpinnerGrid.displayName = "SpinnerGrid";
|
|
95
86
|
export {
|
|
96
|
-
|
|
87
|
+
SpinnerGrid
|
|
97
88
|
};
|