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/index38.cjs
CHANGED
|
@@ -2,19 +2,17 @@
|
|
|
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
|
|
7
|
+
const ShimmerBox = react.forwardRef(
|
|
8
8
|
({
|
|
9
|
-
width =
|
|
10
|
-
height
|
|
9
|
+
width = 200,
|
|
10
|
+
height,
|
|
11
11
|
borderRadius = 8,
|
|
12
12
|
baseColor = "#e5e7eb",
|
|
13
13
|
highlightColor = "#f3f4f6",
|
|
14
14
|
direction = "left-to-right",
|
|
15
|
-
|
|
16
|
-
showIcon = false,
|
|
17
|
-
iconPosition = "left",
|
|
15
|
+
aspectRatio,
|
|
18
16
|
speed = "normal",
|
|
19
17
|
respectMotionPreference = true,
|
|
20
18
|
delay = 0,
|
|
@@ -22,9 +20,9 @@ const ShimmerButton = react.forwardRef(
|
|
|
22
20
|
transition,
|
|
23
21
|
className,
|
|
24
22
|
style,
|
|
25
|
-
testId = "shimmer-
|
|
23
|
+
testId = "shimmer-box",
|
|
26
24
|
visible = true,
|
|
27
|
-
ariaLabel = "Loading
|
|
25
|
+
ariaLabel = "Loading...",
|
|
28
26
|
...rest
|
|
29
27
|
}, ref) => {
|
|
30
28
|
const prefersReducedMotion = hooks.useReducedMotion();
|
|
@@ -36,48 +34,42 @@ const ShimmerButton = react.forwardRef(
|
|
|
36
34
|
transition
|
|
37
35
|
);
|
|
38
36
|
if (!shouldRender) return null;
|
|
39
|
-
const
|
|
37
|
+
const getGradientDirection = () => {
|
|
40
38
|
switch (direction) {
|
|
41
39
|
case "right-to-left":
|
|
42
|
-
return "
|
|
40
|
+
return "to left";
|
|
43
41
|
case "top-to-bottom":
|
|
44
|
-
return "
|
|
42
|
+
return "to bottom";
|
|
45
43
|
case "bottom-to-top":
|
|
46
|
-
return "
|
|
44
|
+
return "to top";
|
|
47
45
|
default:
|
|
48
|
-
return "
|
|
46
|
+
return "to right";
|
|
49
47
|
}
|
|
50
48
|
};
|
|
51
|
-
const
|
|
49
|
+
const getAnimationName = () => {
|
|
52
50
|
switch (direction) {
|
|
53
51
|
case "right-to-left":
|
|
54
|
-
return "
|
|
52
|
+
return "shimmer-rtl";
|
|
55
53
|
case "top-to-bottom":
|
|
56
|
-
return "
|
|
54
|
+
return "shimmer-ttb";
|
|
57
55
|
case "bottom-to-top":
|
|
58
|
-
return "
|
|
56
|
+
return "shimmer-btt";
|
|
59
57
|
default:
|
|
60
|
-
return "
|
|
58
|
+
return "shimmer-ltr";
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
|
-
|
|
64
|
-
const iconSize = Math.floor(normalizedHeight * 0.5);
|
|
65
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
61
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
66
62
|
"div",
|
|
67
63
|
{
|
|
68
64
|
ref,
|
|
69
65
|
"data-testid": testId,
|
|
70
|
-
className: classNames.cn(
|
|
71
|
-
"relative overflow-hidden inline-flex items-center justify-center gap-2",
|
|
72
|
-
className
|
|
73
|
-
),
|
|
66
|
+
className: classNames.cn("relative overflow-hidden", className),
|
|
74
67
|
style: {
|
|
75
68
|
width: typeof width === "number" ? `${width}px` : width,
|
|
76
|
-
height: typeof height === "number" ? `${height}px` : height,
|
|
69
|
+
height: aspectRatio ? void 0 : typeof height === "number" ? `${height}px` : height || "100px",
|
|
70
|
+
aspectRatio,
|
|
77
71
|
borderRadius: typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius,
|
|
78
|
-
backgroundColor:
|
|
79
|
-
border: variant === "outline" ? `2px solid ${baseColor}` : "none",
|
|
80
|
-
padding: "0 16px",
|
|
72
|
+
backgroundColor: baseColor,
|
|
81
73
|
opacity,
|
|
82
74
|
transition: transitionStyle,
|
|
83
75
|
...style
|
|
@@ -86,84 +78,19 @@ const ShimmerButton = react.forwardRef(
|
|
|
86
78
|
"aria-label": ariaLabel,
|
|
87
79
|
"aria-busy": "true",
|
|
88
80
|
...rest,
|
|
89
|
-
children:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
height: iconSize,
|
|
97
|
-
backgroundColor: variant === "solid" ? highlightColor : baseColor
|
|
98
|
-
},
|
|
99
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
className: "absolute inset-0",
|
|
103
|
-
style: {
|
|
104
|
-
background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${variant === "solid" ? baseColor : highlightColor} 50%, transparent 100%)`,
|
|
105
|
-
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
),
|
|
111
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
-
"div",
|
|
113
|
-
{
|
|
114
|
-
className: "relative overflow-hidden flex-1",
|
|
115
|
-
style: {
|
|
116
|
-
height: Math.floor(normalizedHeight * 0.35),
|
|
117
|
-
borderRadius: 4,
|
|
118
|
-
backgroundColor: variant === "solid" ? highlightColor : baseColor
|
|
119
|
-
},
|
|
120
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
121
|
-
"div",
|
|
122
|
-
{
|
|
123
|
-
className: "absolute inset-0",
|
|
124
|
-
style: {
|
|
125
|
-
background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${variant === "solid" ? baseColor : highlightColor} 50%, transparent 100%)`,
|
|
126
|
-
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
showIcon && iconPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
className: "relative overflow-hidden rounded-full flex-shrink-0",
|
|
136
|
-
style: {
|
|
137
|
-
width: iconSize,
|
|
138
|
-
height: iconSize,
|
|
139
|
-
backgroundColor: variant === "solid" ? highlightColor : baseColor
|
|
140
|
-
},
|
|
141
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
142
|
-
"div",
|
|
143
|
-
{
|
|
144
|
-
className: "absolute inset-0",
|
|
145
|
-
style: {
|
|
146
|
-
background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${variant === "solid" ? baseColor : highlightColor} 50%, transparent 100%)`,
|
|
147
|
-
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
),
|
|
153
|
-
variant === "solid" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
154
|
-
"div",
|
|
155
|
-
{
|
|
156
|
-
className: "absolute inset-0 pointer-events-none",
|
|
157
|
-
style: {
|
|
158
|
-
background: `linear-gradient(${getGradientDirection()}, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%)`,
|
|
159
|
-
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
160
|
-
}
|
|
81
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
className: "absolute inset-0",
|
|
85
|
+
style: {
|
|
86
|
+
background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${highlightColor} 50%, transparent 100%)`,
|
|
87
|
+
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
161
88
|
}
|
|
162
|
-
|
|
163
|
-
|
|
89
|
+
}
|
|
90
|
+
)
|
|
164
91
|
}
|
|
165
92
|
);
|
|
166
93
|
}
|
|
167
94
|
);
|
|
168
|
-
|
|
169
|
-
exports.
|
|
95
|
+
ShimmerBox.displayName = "ShimmerBox";
|
|
96
|
+
exports.ShimmerBox = ShimmerBox;
|
package/dist/index38.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
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
|
-
const
|
|
5
|
+
const ShimmerBox = forwardRef(
|
|
6
6
|
({
|
|
7
|
-
width =
|
|
8
|
-
height
|
|
7
|
+
width = 200,
|
|
8
|
+
height,
|
|
9
9
|
borderRadius = 8,
|
|
10
10
|
baseColor = "#e5e7eb",
|
|
11
11
|
highlightColor = "#f3f4f6",
|
|
12
12
|
direction = "left-to-right",
|
|
13
|
-
|
|
14
|
-
showIcon = false,
|
|
15
|
-
iconPosition = "left",
|
|
13
|
+
aspectRatio,
|
|
16
14
|
speed = "normal",
|
|
17
15
|
respectMotionPreference = true,
|
|
18
16
|
delay = 0,
|
|
@@ -20,9 +18,9 @@ const ShimmerButton = forwardRef(
|
|
|
20
18
|
transition,
|
|
21
19
|
className,
|
|
22
20
|
style,
|
|
23
|
-
testId = "shimmer-
|
|
21
|
+
testId = "shimmer-box",
|
|
24
22
|
visible = true,
|
|
25
|
-
ariaLabel = "Loading
|
|
23
|
+
ariaLabel = "Loading...",
|
|
26
24
|
...rest
|
|
27
25
|
}, ref) => {
|
|
28
26
|
const prefersReducedMotion = useReducedMotion();
|
|
@@ -34,48 +32,42 @@ const ShimmerButton = forwardRef(
|
|
|
34
32
|
transition
|
|
35
33
|
);
|
|
36
34
|
if (!shouldRender) return null;
|
|
37
|
-
const
|
|
35
|
+
const getGradientDirection = () => {
|
|
38
36
|
switch (direction) {
|
|
39
37
|
case "right-to-left":
|
|
40
|
-
return "
|
|
38
|
+
return "to left";
|
|
41
39
|
case "top-to-bottom":
|
|
42
|
-
return "
|
|
40
|
+
return "to bottom";
|
|
43
41
|
case "bottom-to-top":
|
|
44
|
-
return "
|
|
42
|
+
return "to top";
|
|
45
43
|
default:
|
|
46
|
-
return "
|
|
44
|
+
return "to right";
|
|
47
45
|
}
|
|
48
46
|
};
|
|
49
|
-
const
|
|
47
|
+
const getAnimationName = () => {
|
|
50
48
|
switch (direction) {
|
|
51
49
|
case "right-to-left":
|
|
52
|
-
return "
|
|
50
|
+
return "shimmer-rtl";
|
|
53
51
|
case "top-to-bottom":
|
|
54
|
-
return "
|
|
52
|
+
return "shimmer-ttb";
|
|
55
53
|
case "bottom-to-top":
|
|
56
|
-
return "
|
|
54
|
+
return "shimmer-btt";
|
|
57
55
|
default:
|
|
58
|
-
return "
|
|
56
|
+
return "shimmer-ltr";
|
|
59
57
|
}
|
|
60
58
|
};
|
|
61
|
-
|
|
62
|
-
const iconSize = Math.floor(normalizedHeight * 0.5);
|
|
63
|
-
return /* @__PURE__ */ jsxs(
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
64
60
|
"div",
|
|
65
61
|
{
|
|
66
62
|
ref,
|
|
67
63
|
"data-testid": testId,
|
|
68
|
-
className: cn(
|
|
69
|
-
"relative overflow-hidden inline-flex items-center justify-center gap-2",
|
|
70
|
-
className
|
|
71
|
-
),
|
|
64
|
+
className: cn("relative overflow-hidden", className),
|
|
72
65
|
style: {
|
|
73
66
|
width: typeof width === "number" ? `${width}px` : width,
|
|
74
|
-
height: typeof height === "number" ? `${height}px` : height,
|
|
67
|
+
height: aspectRatio ? void 0 : typeof height === "number" ? `${height}px` : height || "100px",
|
|
68
|
+
aspectRatio,
|
|
75
69
|
borderRadius: typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius,
|
|
76
|
-
backgroundColor:
|
|
77
|
-
border: variant === "outline" ? `2px solid ${baseColor}` : "none",
|
|
78
|
-
padding: "0 16px",
|
|
70
|
+
backgroundColor: baseColor,
|
|
79
71
|
opacity,
|
|
80
72
|
transition: transitionStyle,
|
|
81
73
|
...style
|
|
@@ -84,86 +76,21 @@ const ShimmerButton = forwardRef(
|
|
|
84
76
|
"aria-label": ariaLabel,
|
|
85
77
|
"aria-busy": "true",
|
|
86
78
|
...rest,
|
|
87
|
-
children:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
height: iconSize,
|
|
95
|
-
backgroundColor: variant === "solid" ? highlightColor : baseColor
|
|
96
|
-
},
|
|
97
|
-
children: /* @__PURE__ */ jsx(
|
|
98
|
-
"div",
|
|
99
|
-
{
|
|
100
|
-
className: "absolute inset-0",
|
|
101
|
-
style: {
|
|
102
|
-
background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${variant === "solid" ? baseColor : highlightColor} 50%, transparent 100%)`,
|
|
103
|
-
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
/* @__PURE__ */ jsx(
|
|
110
|
-
"div",
|
|
111
|
-
{
|
|
112
|
-
className: "relative overflow-hidden flex-1",
|
|
113
|
-
style: {
|
|
114
|
-
height: Math.floor(normalizedHeight * 0.35),
|
|
115
|
-
borderRadius: 4,
|
|
116
|
-
backgroundColor: variant === "solid" ? highlightColor : baseColor
|
|
117
|
-
},
|
|
118
|
-
children: /* @__PURE__ */ jsx(
|
|
119
|
-
"div",
|
|
120
|
-
{
|
|
121
|
-
className: "absolute inset-0",
|
|
122
|
-
style: {
|
|
123
|
-
background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${variant === "solid" ? baseColor : highlightColor} 50%, transparent 100%)`,
|
|
124
|
-
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
),
|
|
130
|
-
showIcon && iconPosition === "right" && /* @__PURE__ */ jsx(
|
|
131
|
-
"div",
|
|
132
|
-
{
|
|
133
|
-
className: "relative overflow-hidden rounded-full flex-shrink-0",
|
|
134
|
-
style: {
|
|
135
|
-
width: iconSize,
|
|
136
|
-
height: iconSize,
|
|
137
|
-
backgroundColor: variant === "solid" ? highlightColor : baseColor
|
|
138
|
-
},
|
|
139
|
-
children: /* @__PURE__ */ jsx(
|
|
140
|
-
"div",
|
|
141
|
-
{
|
|
142
|
-
className: "absolute inset-0",
|
|
143
|
-
style: {
|
|
144
|
-
background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${variant === "solid" ? baseColor : highlightColor} 50%, transparent 100%)`,
|
|
145
|
-
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
variant === "solid" && /* @__PURE__ */ jsx(
|
|
152
|
-
"div",
|
|
153
|
-
{
|
|
154
|
-
className: "absolute inset-0 pointer-events-none",
|
|
155
|
-
style: {
|
|
156
|
-
background: `linear-gradient(${getGradientDirection()}, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%)`,
|
|
157
|
-
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
158
|
-
}
|
|
79
|
+
children: /* @__PURE__ */ jsx(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: "absolute inset-0",
|
|
83
|
+
style: {
|
|
84
|
+
background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${highlightColor} 50%, transparent 100%)`,
|
|
85
|
+
animation: `${getAnimationName()} ${effectiveDuration} infinite`
|
|
159
86
|
}
|
|
160
|
-
|
|
161
|
-
|
|
87
|
+
}
|
|
88
|
+
)
|
|
162
89
|
}
|
|
163
90
|
);
|
|
164
91
|
}
|
|
165
92
|
);
|
|
166
|
-
|
|
93
|
+
ShimmerBox.displayName = "ShimmerBox";
|
|
167
94
|
export {
|
|
168
|
-
|
|
95
|
+
ShimmerBox
|
|
169
96
|
};
|
package/dist/index39.cjs
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
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("./index56.cjs");
|
|
7
6
|
const classNames = require("./index3.cjs");
|
|
8
|
-
const
|
|
7
|
+
const ShimmerText = react.forwardRef(
|
|
9
8
|
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
width = "100%",
|
|
10
|
+
height = 16,
|
|
11
|
+
borderRadius = 4,
|
|
12
|
+
baseColor = "#e5e7eb",
|
|
13
|
+
highlightColor = "#f3f4f6",
|
|
14
|
+
direction = "left-to-right",
|
|
15
|
+
lines = 3,
|
|
16
|
+
lineGap = 12,
|
|
17
|
+
lastLineWidth = "75%",
|
|
17
18
|
speed = "normal",
|
|
18
|
-
reverse = false,
|
|
19
19
|
respectMotionPreference = true,
|
|
20
20
|
delay = 0,
|
|
21
21
|
minDuration = 0,
|
|
22
22
|
transition,
|
|
23
23
|
className,
|
|
24
24
|
style,
|
|
25
|
-
testId = "
|
|
25
|
+
testId = "shimmer-text",
|
|
26
26
|
visible = true,
|
|
27
|
-
ariaLabel = "Loading...",
|
|
27
|
+
ariaLabel = "Loading text...",
|
|
28
28
|
...rest
|
|
29
29
|
}, ref) => {
|
|
30
30
|
const prefersReducedMotion = hooks.useReducedMotion();
|
|
@@ -36,18 +36,39 @@ const OrbitDots = react.forwardRef(
|
|
|
36
36
|
transition
|
|
37
37
|
);
|
|
38
38
|
if (!shouldRender) return null;
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const getGradientDirection = () => {
|
|
40
|
+
switch (direction) {
|
|
41
|
+
case "right-to-left":
|
|
42
|
+
return "to left";
|
|
43
|
+
case "top-to-bottom":
|
|
44
|
+
return "to bottom";
|
|
45
|
+
case "bottom-to-top":
|
|
46
|
+
return "to top";
|
|
47
|
+
default:
|
|
48
|
+
return "to right";
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const getAnimationName = () => {
|
|
52
|
+
switch (direction) {
|
|
53
|
+
case "right-to-left":
|
|
54
|
+
return "shimmer-rtl";
|
|
55
|
+
case "top-to-bottom":
|
|
56
|
+
return "shimmer-ttb";
|
|
57
|
+
case "bottom-to-top":
|
|
58
|
+
return "shimmer-btt";
|
|
59
|
+
default:
|
|
60
|
+
return "shimmer-ltr";
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const normalizedGap = typeof lineGap === "number" ? `${lineGap}px` : lineGap;
|
|
42
64
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
65
|
"div",
|
|
44
66
|
{
|
|
45
67
|
ref,
|
|
46
68
|
"data-testid": testId,
|
|
47
|
-
className: classNames.cn("
|
|
69
|
+
className: classNames.cn("flex flex-col", className),
|
|
48
70
|
style: {
|
|
49
|
-
|
|
50
|
-
height: normalizedSize,
|
|
71
|
+
gap: normalizedGap,
|
|
51
72
|
opacity,
|
|
52
73
|
transition: transitionStyle,
|
|
53
74
|
...style
|
|
@@ -56,42 +77,37 @@ const OrbitDots = react.forwardRef(
|
|
|
56
77
|
"aria-label": ariaLabel,
|
|
57
78
|
"aria-busy": "true",
|
|
58
79
|
...rest,
|
|
59
|
-
children:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
80
|
+
children: Array.from({ length: lines }, (_, index) => {
|
|
81
|
+
const isLastLine = index === lines - 1;
|
|
82
|
+
const lineWidth = isLastLine && lines > 1 ? lastLineWidth : width;
|
|
83
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: "relative overflow-hidden",
|
|
87
|
+
style: {
|
|
88
|
+
width: typeof lineWidth === "number" ? `${lineWidth}px` : lineWidth,
|
|
89
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
90
|
+
borderRadius: typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius,
|
|
91
|
+
backgroundColor: baseColor
|
|
92
|
+
},
|
|
93
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
94
|
"div",
|
|
73
95
|
{
|
|
74
|
-
className: "absolute
|
|
96
|
+
className: "absolute inset-0",
|
|
75
97
|
style: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
left: "50%",
|
|
80
|
-
top: "50%",
|
|
81
|
-
transform: `translate(-50%, -50%) rotate(${angle}deg) translateX(${radius}px)`,
|
|
82
|
-
opacity: stagger ? void 0 : 1,
|
|
83
|
-
animation: stagger ? `orbit-dot-pulse 1s ease-in-out infinite` : void 0,
|
|
84
|
-
animationDelay: staggerDelay
|
|
98
|
+
background: `linear-gradient(${getGradientDirection()}, transparent 0%, ${highlightColor} 50%, transparent 100%)`,
|
|
99
|
+
animation: `${getAnimationName()} ${effectiveDuration} infinite`,
|
|
100
|
+
animationDelay: `${index * 100}ms`
|
|
85
101
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
)
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
},
|
|
105
|
+
index
|
|
106
|
+
);
|
|
107
|
+
})
|
|
92
108
|
}
|
|
93
109
|
);
|
|
94
110
|
}
|
|
95
111
|
);
|
|
96
|
-
|
|
97
|
-
exports.
|
|
112
|
+
ShimmerText.displayName = "ShimmerText";
|
|
113
|
+
exports.ShimmerText = ShimmerText;
|