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/index33.cjs
CHANGED
|
@@ -2,99 +2,81 @@
|
|
|
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
|
-
const
|
|
8
|
-
const SuccessCheckmark = react.forwardRef(
|
|
7
|
+
const LoaderOverlay = react.forwardRef(
|
|
9
8
|
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
loading = false,
|
|
10
|
+
loader,
|
|
11
|
+
children,
|
|
12
|
+
position = "fixed",
|
|
13
|
+
backdropOpacity = 0.5,
|
|
14
|
+
backdropColor = "#000000",
|
|
15
|
+
blur = false,
|
|
17
16
|
delay = 0,
|
|
18
17
|
minDuration = 0,
|
|
19
|
-
transition
|
|
18
|
+
transition,
|
|
20
19
|
className,
|
|
21
20
|
style,
|
|
22
|
-
testId = "
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
testId = "loader-overlay",
|
|
22
|
+
ariaLabel = "Loading content...",
|
|
23
|
+
zIndex = 9999,
|
|
25
24
|
...rest
|
|
26
25
|
}, ref) => {
|
|
27
26
|
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
28
|
-
|
|
27
|
+
loading,
|
|
29
28
|
delay,
|
|
30
29
|
minDuration,
|
|
31
30
|
transition
|
|
32
31
|
);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
const backdropStyles = {
|
|
33
|
+
backgroundColor: backdropColor,
|
|
34
|
+
opacity: backdropOpacity,
|
|
35
|
+
backdropFilter: blur ? "blur(4px)" : void 0,
|
|
36
|
+
WebkitBackdropFilter: blur ? "blur(4px)" : void 0
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
37
39
|
"div",
|
|
38
40
|
{
|
|
39
41
|
ref,
|
|
40
42
|
"data-testid": testId,
|
|
41
|
-
className: classNames.cn("
|
|
42
|
-
style
|
|
43
|
-
...style,
|
|
44
|
-
opacity,
|
|
45
|
-
transition: transitionStyle
|
|
46
|
-
},
|
|
47
|
-
role: "status",
|
|
48
|
-
"aria-label": ariaLabel,
|
|
43
|
+
className: classNames.cn("relative", className),
|
|
44
|
+
style,
|
|
49
45
|
...rest,
|
|
50
|
-
children:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
viewBox: "0 0 52 52",
|
|
60
|
-
children: [
|
|
61
|
-
showCircle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
-
"circle",
|
|
63
|
-
{
|
|
64
|
-
className: "animate-success-circle",
|
|
65
|
-
cx: "26",
|
|
66
|
-
cy: "26",
|
|
67
|
-
r: "23",
|
|
68
|
-
fill: fillCircle ? effectiveCircleColor : "none",
|
|
69
|
-
stroke: effectiveCircleColor,
|
|
70
|
-
strokeWidth,
|
|
71
|
-
style: {
|
|
72
|
-
animationDuration: `${duration}ms`
|
|
73
|
-
}
|
|
74
|
-
}
|
|
46
|
+
children: [
|
|
47
|
+
children,
|
|
48
|
+
shouldRender && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: classNames.cn(
|
|
52
|
+
"inset-0 flex items-center justify-center",
|
|
53
|
+
position === "fixed" ? "fixed" : "absolute"
|
|
75
54
|
),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
55
|
+
style: {
|
|
56
|
+
zIndex,
|
|
57
|
+
opacity,
|
|
58
|
+
transition: transitionStyle
|
|
59
|
+
},
|
|
60
|
+
role: "status",
|
|
61
|
+
"aria-label": ariaLabel,
|
|
62
|
+
"aria-busy": "true",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: "absolute inset-0",
|
|
68
|
+
style: backdropStyles,
|
|
69
|
+
"aria-hidden": "true"
|
|
89
70
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10", children: loader })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
95
77
|
}
|
|
96
78
|
);
|
|
97
79
|
}
|
|
98
80
|
);
|
|
99
|
-
|
|
100
|
-
exports.
|
|
81
|
+
LoaderOverlay.displayName = "LoaderOverlay";
|
|
82
|
+
exports.LoaderOverlay = LoaderOverlay;
|
package/dist/index33.js
CHANGED
|
@@ -1,100 +1,82 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { useLoaderVisibility } from "./
|
|
3
|
+
import { useLoaderVisibility } from "./index56.js";
|
|
4
4
|
import { cn } from "./index3.js";
|
|
5
|
-
|
|
6
|
-
const SuccessCheckmark = forwardRef(
|
|
5
|
+
const LoaderOverlay = forwardRef(
|
|
7
6
|
({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
loading = false,
|
|
8
|
+
loader,
|
|
9
|
+
children,
|
|
10
|
+
position = "fixed",
|
|
11
|
+
backdropOpacity = 0.5,
|
|
12
|
+
backdropColor = "#000000",
|
|
13
|
+
blur = false,
|
|
15
14
|
delay = 0,
|
|
16
15
|
minDuration = 0,
|
|
17
|
-
transition
|
|
16
|
+
transition,
|
|
18
17
|
className,
|
|
19
18
|
style,
|
|
20
|
-
testId = "
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
testId = "loader-overlay",
|
|
20
|
+
ariaLabel = "Loading content...",
|
|
21
|
+
zIndex = 9999,
|
|
23
22
|
...rest
|
|
24
23
|
}, ref) => {
|
|
25
24
|
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
|
|
26
|
-
|
|
25
|
+
loading,
|
|
27
26
|
delay,
|
|
28
27
|
minDuration,
|
|
29
28
|
transition
|
|
30
29
|
);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const backdropStyles = {
|
|
31
|
+
backgroundColor: backdropColor,
|
|
32
|
+
opacity: backdropOpacity,
|
|
33
|
+
backdropFilter: blur ? "blur(4px)" : void 0,
|
|
34
|
+
WebkitBackdropFilter: blur ? "blur(4px)" : void 0
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
35
37
|
"div",
|
|
36
38
|
{
|
|
37
39
|
ref,
|
|
38
40
|
"data-testid": testId,
|
|
39
|
-
className: cn("
|
|
40
|
-
style
|
|
41
|
-
...style,
|
|
42
|
-
opacity,
|
|
43
|
-
transition: transitionStyle
|
|
44
|
-
},
|
|
45
|
-
role: "status",
|
|
46
|
-
"aria-label": ariaLabel,
|
|
41
|
+
className: cn("relative", className),
|
|
42
|
+
style,
|
|
47
43
|
...rest,
|
|
48
|
-
children:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
viewBox: "0 0 52 52",
|
|
58
|
-
children: [
|
|
59
|
-
showCircle && /* @__PURE__ */ jsx(
|
|
60
|
-
"circle",
|
|
61
|
-
{
|
|
62
|
-
className: "animate-success-circle",
|
|
63
|
-
cx: "26",
|
|
64
|
-
cy: "26",
|
|
65
|
-
r: "23",
|
|
66
|
-
fill: fillCircle ? effectiveCircleColor : "none",
|
|
67
|
-
stroke: effectiveCircleColor,
|
|
68
|
-
strokeWidth,
|
|
69
|
-
style: {
|
|
70
|
-
animationDuration: `${duration}ms`
|
|
71
|
-
}
|
|
72
|
-
}
|
|
44
|
+
children: [
|
|
45
|
+
children,
|
|
46
|
+
shouldRender && /* @__PURE__ */ jsxs(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
className: cn(
|
|
50
|
+
"inset-0 flex items-center justify-center",
|
|
51
|
+
position === "fixed" ? "fixed" : "absolute"
|
|
73
52
|
),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
53
|
+
style: {
|
|
54
|
+
zIndex,
|
|
55
|
+
opacity,
|
|
56
|
+
transition: transitionStyle
|
|
57
|
+
},
|
|
58
|
+
role: "status",
|
|
59
|
+
"aria-label": ariaLabel,
|
|
60
|
+
"aria-busy": "true",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: "absolute inset-0",
|
|
66
|
+
style: backdropStyles,
|
|
67
|
+
"aria-hidden": "true"
|
|
87
68
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsx("div", { className: "relative z-10", children: loader })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
93
75
|
}
|
|
94
76
|
);
|
|
95
77
|
}
|
|
96
78
|
);
|
|
97
|
-
|
|
79
|
+
LoaderOverlay.displayName = "LoaderOverlay";
|
|
98
80
|
export {
|
|
99
|
-
|
|
81
|
+
LoaderOverlay
|
|
100
82
|
};
|
package/dist/index34.cjs
CHANGED
|
@@ -2,39 +2,125 @@
|
|
|
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 ButtonSpinner = react.forwardRef(
|
|
9
9
|
({
|
|
10
|
-
size =
|
|
11
|
-
color = "
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
size = 16,
|
|
11
|
+
color = "currentColor",
|
|
12
|
+
variant = "circle",
|
|
13
|
+
position = "left",
|
|
14
|
+
thickness = 2,
|
|
15
|
+
dotCount = 3,
|
|
16
|
+
barCount = 3,
|
|
17
|
+
speed = "normal",
|
|
18
|
+
gap = 8,
|
|
19
|
+
showContent = true,
|
|
20
|
+
children,
|
|
18
21
|
delay = 0,
|
|
19
22
|
minDuration = 0,
|
|
20
|
-
transition
|
|
23
|
+
transition,
|
|
24
|
+
respectMotionPreference = true,
|
|
21
25
|
className,
|
|
22
26
|
style,
|
|
23
|
-
testId = "
|
|
27
|
+
testId = "button-spinner",
|
|
24
28
|
visible = true,
|
|
25
|
-
ariaLabel = "
|
|
29
|
+
ariaLabel = "Loading...",
|
|
26
30
|
...rest
|
|
27
31
|
}, ref) => {
|
|
32
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
33
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
28
34
|
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
29
35
|
visible,
|
|
30
36
|
delay,
|
|
31
37
|
minDuration,
|
|
32
38
|
transition
|
|
33
39
|
);
|
|
34
|
-
if (!shouldRender)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
if (!shouldRender) {
|
|
41
|
+
return children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className, style, children }) : null;
|
|
42
|
+
}
|
|
43
|
+
const spinnerSize = colors.normalizeSize(size);
|
|
44
|
+
const gapSize = typeof gap === "number" ? `${gap}px` : gap;
|
|
45
|
+
const renderSpinner = () => {
|
|
46
|
+
switch (variant) {
|
|
47
|
+
case "dots":
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: "inline-flex items-center justify-center",
|
|
52
|
+
style: { gap: `${parseInt(spinnerSize) / 8}px` },
|
|
53
|
+
children: Array.from({ length: dotCount }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: "animate-button-dot-pulse",
|
|
57
|
+
style: {
|
|
58
|
+
width: `${parseInt(spinnerSize) / 3}px`,
|
|
59
|
+
height: `${parseInt(spinnerSize) / 3}px`,
|
|
60
|
+
backgroundColor: color,
|
|
61
|
+
borderRadius: "50%",
|
|
62
|
+
animationDuration: effectiveDuration,
|
|
63
|
+
animationDelay: `${i * parseInt(effectiveDuration) / (dotCount * 3)}ms`
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
i
|
|
67
|
+
))
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
case "bars":
|
|
71
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: "inline-flex items-center justify-center",
|
|
75
|
+
style: { gap: `${parseInt(spinnerSize) / 8}px`, height: spinnerSize },
|
|
76
|
+
children: Array.from({ length: barCount }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: "animate-button-bar-pulse",
|
|
80
|
+
style: {
|
|
81
|
+
width: `${parseInt(spinnerSize) / 6}px`,
|
|
82
|
+
height: "100%",
|
|
83
|
+
backgroundColor: color,
|
|
84
|
+
borderRadius: "2px",
|
|
85
|
+
animationDuration: effectiveDuration,
|
|
86
|
+
animationDelay: `${i * parseInt(effectiveDuration) / (barCount * 3)}ms`
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
i
|
|
90
|
+
))
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
case "circle":
|
|
94
|
+
default:
|
|
95
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
"svg",
|
|
97
|
+
{
|
|
98
|
+
className: "animate-spinner-rotate",
|
|
99
|
+
style: {
|
|
100
|
+
width: spinnerSize,
|
|
101
|
+
height: spinnerSize,
|
|
102
|
+
animationDuration: effectiveDuration
|
|
103
|
+
},
|
|
104
|
+
viewBox: "0 0 50 50",
|
|
105
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
+
"circle",
|
|
107
|
+
{
|
|
108
|
+
cx: "25",
|
|
109
|
+
cy: "25",
|
|
110
|
+
r: 25 - thickness * 4,
|
|
111
|
+
fill: "none",
|
|
112
|
+
stroke: color,
|
|
113
|
+
strokeWidth: thickness * 2,
|
|
114
|
+
strokeDasharray: "80, 200",
|
|
115
|
+
strokeLinecap: "round"
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const flexDirection = position === "right" ? "row-reverse" : "row";
|
|
123
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
38
124
|
"div",
|
|
39
125
|
{
|
|
40
126
|
ref,
|
|
@@ -42,76 +128,22 @@ const ErrorIndicator = react.forwardRef(
|
|
|
42
128
|
className: classNames.cn("inline-flex items-center justify-center", className),
|
|
43
129
|
style: {
|
|
44
130
|
...style,
|
|
131
|
+
flexDirection: position === "center" ? "column" : flexDirection,
|
|
132
|
+
gap: showContent && children ? gapSize : 0,
|
|
45
133
|
opacity,
|
|
46
134
|
transition: transitionStyle
|
|
47
135
|
},
|
|
48
136
|
role: "status",
|
|
49
137
|
"aria-label": ariaLabel,
|
|
138
|
+
"aria-busy": "true",
|
|
50
139
|
...rest,
|
|
51
|
-
children:
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
style: {
|
|
56
|
-
width: sizeValue,
|
|
57
|
-
height: sizeValue,
|
|
58
|
-
animationDuration: `${duration}ms`
|
|
59
|
-
},
|
|
60
|
-
viewBox: "0 0 52 52",
|
|
61
|
-
children: [
|
|
62
|
-
showCircle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
-
"circle",
|
|
64
|
-
{
|
|
65
|
-
className: "animate-error-circle",
|
|
66
|
-
cx: "26",
|
|
67
|
-
cy: "26",
|
|
68
|
-
r: "23",
|
|
69
|
-
fill: fillCircle ? effectiveCircleColor : "none",
|
|
70
|
-
stroke: effectiveCircleColor,
|
|
71
|
-
strokeWidth,
|
|
72
|
-
style: {
|
|
73
|
-
animationDuration: `${duration}ms`
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
78
|
-
"g",
|
|
79
|
-
{
|
|
80
|
-
className: "animate-error-x",
|
|
81
|
-
style: {
|
|
82
|
-
animationDuration: `${duration}ms`,
|
|
83
|
-
animationDelay: showCircle ? `${duration * 0.3}ms` : "0ms"
|
|
84
|
-
},
|
|
85
|
-
children: [
|
|
86
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
-
"path",
|
|
88
|
-
{
|
|
89
|
-
fill: "none",
|
|
90
|
-
stroke: color,
|
|
91
|
-
strokeWidth,
|
|
92
|
-
strokeLinecap: "round",
|
|
93
|
-
d: "M16 16 36 36"
|
|
94
|
-
}
|
|
95
|
-
),
|
|
96
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
97
|
-
"path",
|
|
98
|
-
{
|
|
99
|
-
fill: "none",
|
|
100
|
-
stroke: color,
|
|
101
|
-
strokeWidth,
|
|
102
|
-
strokeLinecap: "round",
|
|
103
|
-
d: "M36 16 16 36"
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
)
|
|
140
|
+
children: [
|
|
141
|
+
renderSpinner(),
|
|
142
|
+
showContent && children && /* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
143
|
+
]
|
|
112
144
|
}
|
|
113
145
|
);
|
|
114
146
|
}
|
|
115
147
|
);
|
|
116
|
-
|
|
117
|
-
exports.
|
|
148
|
+
ButtonSpinner.displayName = "ButtonSpinner";
|
|
149
|
+
exports.ButtonSpinner = ButtonSpinner;
|