premium-react-loaders 1.3.0 → 2.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 +264 -30
- package/dist/components/pulse/TypingIndicator.d.ts.map +1 -1
- package/dist/context/ThemeContext.d.ts +84 -0
- package/dist/context/ThemeContext.d.ts.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useLoader.d.ts +56 -0
- package/dist/hooks/useLoader.d.ts.map +1 -0
- package/dist/index.cjs +31 -27
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -27
- package/dist/index10.cjs +20 -32
- package/dist/index10.js +20 -32
- package/dist/index11.cjs +47 -26
- package/dist/index11.js +47 -26
- package/dist/index12.cjs +30 -127
- package/dist/index12.js +31 -128
- package/dist/index13.cjs +30 -54
- package/dist/index13.js +30 -54
- package/dist/index14.cjs +127 -44
- package/dist/index14.js +128 -45
- package/dist/index15.cjs +58 -38
- package/dist/index15.js +59 -39
- package/dist/index16.cjs +24 -37
- package/dist/index16.js +24 -37
- package/dist/index17.cjs +19 -22
- package/dist/index17.js +19 -22
- package/dist/index18.cjs +25 -21
- package/dist/index18.js +25 -21
- package/dist/index19.cjs +22 -33
- package/dist/index19.js +22 -33
- package/dist/index20.cjs +26 -36
- package/dist/index20.js +28 -38
- package/dist/index21.cjs +40 -77
- package/dist/index21.js +42 -79
- package/dist/index22.cjs +53 -103
- package/dist/index22.js +54 -104
- package/dist/index23.cjs +46 -81
- package/dist/index23.js +47 -82
- package/dist/index24.cjs +105 -104
- package/dist/index24.js +107 -106
- package/dist/index25.cjs +108 -28
- package/dist/index25.js +111 -31
- package/dist/index26.cjs +104 -37
- package/dist/index26.js +106 -39
- package/dist/index27.cjs +22 -31
- package/dist/index27.js +23 -32
- package/dist/index28.cjs +30 -30
- package/dist/index28.js +31 -31
- package/dist/index29.cjs +49 -53
- package/dist/index29.js +50 -54
- package/dist/index3.cjs +11 -3
- package/dist/index3.js +11 -3
- package/dist/index30.cjs +77 -17
- package/dist/index30.js +76 -16
- package/dist/index31.cjs +77 -121
- package/dist/index31.js +78 -122
- package/dist/index32.cjs +125 -0
- package/dist/index32.js +125 -0
- package/dist/index4.cjs +0 -1
- package/dist/index4.js +0 -1
- package/dist/index5.cjs +11 -73
- package/dist/index5.js +12 -74
- package/dist/index6.cjs +86 -66
- package/dist/index6.js +87 -67
- package/dist/index7.cjs +40 -21
- package/dist/index7.js +40 -21
- package/dist/index8.cjs +34 -22
- package/dist/index8.js +34 -22
- package/dist/index9.cjs +21 -56
- package/dist/index9.js +22 -57
- package/dist/premium-react-loaders.css +250 -1073
- package/dist/utils/classNames.d.ts +3 -2
- package/dist/utils/classNames.d.ts.map +1 -1
- package/package.json +5 -8
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index10.cjs.map +0 -1
- package/dist/index10.js.map +0 -1
- package/dist/index11.cjs.map +0 -1
- package/dist/index11.js.map +0 -1
- package/dist/index12.cjs.map +0 -1
- package/dist/index12.js.map +0 -1
- package/dist/index13.cjs.map +0 -1
- package/dist/index13.js.map +0 -1
- package/dist/index14.cjs.map +0 -1
- package/dist/index14.js.map +0 -1
- package/dist/index15.cjs.map +0 -1
- package/dist/index15.js.map +0 -1
- package/dist/index16.cjs.map +0 -1
- package/dist/index16.js.map +0 -1
- package/dist/index17.cjs.map +0 -1
- package/dist/index17.js.map +0 -1
- package/dist/index18.cjs.map +0 -1
- package/dist/index18.js.map +0 -1
- package/dist/index19.cjs.map +0 -1
- package/dist/index19.js.map +0 -1
- package/dist/index20.cjs.map +0 -1
- package/dist/index20.js.map +0 -1
- package/dist/index21.cjs.map +0 -1
- package/dist/index21.js.map +0 -1
- package/dist/index22.cjs.map +0 -1
- package/dist/index22.js.map +0 -1
- package/dist/index23.cjs.map +0 -1
- package/dist/index23.js.map +0 -1
- package/dist/index24.cjs.map +0 -1
- package/dist/index24.js.map +0 -1
- package/dist/index25.cjs.map +0 -1
- package/dist/index25.js.map +0 -1
- package/dist/index26.cjs.map +0 -1
- package/dist/index26.js.map +0 -1
- package/dist/index27.cjs.map +0 -1
- package/dist/index27.js.map +0 -1
- package/dist/index28.cjs.map +0 -1
- package/dist/index28.js.map +0 -1
- package/dist/index29.cjs.map +0 -1
- package/dist/index29.js.map +0 -1
- package/dist/index3.cjs.map +0 -1
- package/dist/index3.js.map +0 -1
- package/dist/index30.cjs.map +0 -1
- package/dist/index30.js.map +0 -1
- package/dist/index31.cjs.map +0 -1
- package/dist/index31.js.map +0 -1
- package/dist/index4.cjs.map +0 -1
- package/dist/index4.js.map +0 -1
- package/dist/index5.cjs.map +0 -1
- package/dist/index5.js.map +0 -1
- package/dist/index6.cjs.map +0 -1
- package/dist/index6.js.map +0 -1
- package/dist/index7.cjs.map +0 -1
- package/dist/index7.js.map +0 -1
- package/dist/index8.cjs.map +0 -1
- package/dist/index8.js.map +0 -1
- package/dist/index9.cjs.map +0 -1
- package/dist/index9.js.map +0 -1
package/dist/index28.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./
|
|
4
|
-
import { normalizeSize } from "./index4.js";
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index32.js";
|
|
4
|
+
import { normalizeSize, parseSizeToNumber } from "./index4.js";
|
|
5
5
|
import { cn } from "./index3.js";
|
|
6
|
-
const
|
|
6
|
+
const PulseWave = forwardRef(
|
|
7
7
|
({
|
|
8
|
-
size,
|
|
8
|
+
size = "md",
|
|
9
9
|
color = "#3b82f6",
|
|
10
|
-
|
|
11
|
-
dotSize = 8,
|
|
12
|
-
gap = 4,
|
|
13
|
-
variant = "bounce",
|
|
10
|
+
barCount = 5,
|
|
14
11
|
speed = "normal",
|
|
15
12
|
reverse = false,
|
|
16
13
|
respectMotionPreference = true,
|
|
@@ -19,9 +16,9 @@ const TypingIndicator = forwardRef(
|
|
|
19
16
|
transition,
|
|
20
17
|
className,
|
|
21
18
|
style,
|
|
22
|
-
testId = "
|
|
19
|
+
testId = "pulse-wave",
|
|
23
20
|
visible = true,
|
|
24
|
-
ariaLabel = "
|
|
21
|
+
ariaLabel = "Loading...",
|
|
25
22
|
...rest
|
|
26
23
|
}, ref) => {
|
|
27
24
|
const prefersReducedMotion = useReducedMotion();
|
|
@@ -33,16 +30,16 @@ const TypingIndicator = forwardRef(
|
|
|
33
30
|
transition
|
|
34
31
|
);
|
|
35
32
|
if (!shouldRender) return null;
|
|
36
|
-
const
|
|
33
|
+
const sizeValue = parseSizeToNumber(size, 40);
|
|
34
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2.5));
|
|
37
35
|
return /* @__PURE__ */ jsx(
|
|
38
36
|
"div",
|
|
39
37
|
{
|
|
40
38
|
ref,
|
|
41
39
|
"data-testid": testId,
|
|
42
|
-
className: cn("inline-flex items-center", className),
|
|
40
|
+
className: cn("inline-flex items-end justify-center gap-1", className),
|
|
43
41
|
style: {
|
|
44
|
-
|
|
45
|
-
height: size ? normalizeSize(size) : "auto",
|
|
42
|
+
height: normalizeSize(size),
|
|
46
43
|
...style,
|
|
47
44
|
opacity,
|
|
48
45
|
transition: transitionStyle
|
|
@@ -51,26 +48,29 @@ const TypingIndicator = forwardRef(
|
|
|
51
48
|
"aria-label": ariaLabel,
|
|
52
49
|
"aria-busy": "true",
|
|
53
50
|
...rest,
|
|
54
|
-
children: Array.from({ length:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
children: Array.from({ length: barCount }).map((_, index) => {
|
|
52
|
+
const delay2 = reverse ? (barCount - index - 1) / barCount * 0.5 : index / barCount * 0.5;
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: "rounded-sm",
|
|
57
|
+
style: {
|
|
58
|
+
width: `${barWidth}px`,
|
|
59
|
+
height: "100%",
|
|
60
|
+
backgroundColor: color,
|
|
61
|
+
animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
|
|
62
|
+
animationDelay: `${delay2}s`,
|
|
63
|
+
transformOrigin: "bottom"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
index
|
|
67
|
+
);
|
|
68
|
+
})
|
|
68
69
|
}
|
|
69
70
|
);
|
|
70
71
|
}
|
|
71
72
|
);
|
|
72
|
-
|
|
73
|
+
PulseWave.displayName = "PulseWave";
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
PulseWave
|
|
75
76
|
};
|
|
76
|
-
//# sourceMappingURL=index28.js.map
|
package/dist/index29.cjs
CHANGED
|
@@ -2,82 +2,78 @@
|
|
|
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("./index32.cjs");
|
|
6
|
+
const colors = require("./index4.cjs");
|
|
6
7
|
const classNames = require("./index3.cjs");
|
|
7
|
-
const
|
|
8
|
+
const PulseBars = react.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
blur = false,
|
|
10
|
+
size = "md",
|
|
11
|
+
color = "#3b82f6",
|
|
12
|
+
barCount = 4,
|
|
13
|
+
speed = "normal",
|
|
14
|
+
reverse = false,
|
|
15
|
+
respectMotionPreference = true,
|
|
16
16
|
delay = 0,
|
|
17
17
|
minDuration = 0,
|
|
18
18
|
transition,
|
|
19
19
|
className,
|
|
20
20
|
style,
|
|
21
|
-
testId = "
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
testId = "pulse-bars",
|
|
22
|
+
visible = true,
|
|
23
|
+
ariaLabel = "Loading...",
|
|
24
24
|
...rest
|
|
25
25
|
}, ref) => {
|
|
26
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
27
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
26
28
|
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
27
|
-
|
|
29
|
+
visible,
|
|
28
30
|
delay,
|
|
29
31
|
minDuration,
|
|
30
32
|
transition
|
|
31
33
|
);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
WebkitBackdropFilter: blur ? "blur(4px)" : void 0
|
|
37
|
-
};
|
|
38
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
34
|
+
if (!shouldRender) return null;
|
|
35
|
+
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
36
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2));
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
38
|
"div",
|
|
40
39
|
{
|
|
41
40
|
ref,
|
|
42
41
|
"data-testid": testId,
|
|
43
|
-
className: classNames.cn("
|
|
44
|
-
style
|
|
42
|
+
className: classNames.cn("inline-flex items-center justify-center gap-1", className),
|
|
43
|
+
style: {
|
|
44
|
+
height: colors.normalizeSize(size),
|
|
45
|
+
...style,
|
|
46
|
+
opacity,
|
|
47
|
+
transition: transitionStyle
|
|
48
|
+
},
|
|
49
|
+
role: "status",
|
|
50
|
+
"aria-label": ariaLabel,
|
|
51
|
+
"aria-busy": "true",
|
|
45
52
|
...rest,
|
|
46
|
-
children:
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
children: Array.from({ length: barCount }).map((_, index) => {
|
|
54
|
+
const delays = [0, 0.2, 0.4, 0.1, 0.3, 0.5];
|
|
55
|
+
const reversedDelays = [...delays].reverse();
|
|
56
|
+
const delay2 = reverse ? reversedDelays[index % reversedDelays.length] : delays[index % delays.length];
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
58
|
"div",
|
|
50
59
|
{
|
|
51
|
-
className:
|
|
52
|
-
"inset-0 flex items-center justify-center",
|
|
53
|
-
position === "fixed" ? "fixed" : "absolute"
|
|
54
|
-
),
|
|
60
|
+
className: "rounded-sm",
|
|
55
61
|
style: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
style: backdropStyles,
|
|
69
|
-
"aria-hidden": "true"
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10", children: loader })
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
]
|
|
62
|
+
width: `${barWidth}px`,
|
|
63
|
+
minHeight: "30%",
|
|
64
|
+
height: "100%",
|
|
65
|
+
backgroundColor: color,
|
|
66
|
+
animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
|
|
67
|
+
animationDelay: `${delay2}s`,
|
|
68
|
+
transformOrigin: "center"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
index
|
|
72
|
+
);
|
|
73
|
+
})
|
|
77
74
|
}
|
|
78
75
|
);
|
|
79
76
|
}
|
|
80
77
|
);
|
|
81
|
-
|
|
82
|
-
exports.
|
|
83
|
-
//# sourceMappingURL=index29.cjs.map
|
|
78
|
+
PulseBars.displayName = "PulseBars";
|
|
79
|
+
exports.PulseBars = PulseBars;
|
package/dist/index29.js
CHANGED
|
@@ -1,83 +1,79 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { useLoaderVisibility } from "./
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index32.js";
|
|
4
|
+
import { normalizeSize, parseSizeToNumber } from "./index4.js";
|
|
4
5
|
import { cn } from "./index3.js";
|
|
5
|
-
const
|
|
6
|
+
const PulseBars = forwardRef(
|
|
6
7
|
({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
blur = false,
|
|
8
|
+
size = "md",
|
|
9
|
+
color = "#3b82f6",
|
|
10
|
+
barCount = 4,
|
|
11
|
+
speed = "normal",
|
|
12
|
+
reverse = false,
|
|
13
|
+
respectMotionPreference = true,
|
|
14
14
|
delay = 0,
|
|
15
15
|
minDuration = 0,
|
|
16
16
|
transition,
|
|
17
17
|
className,
|
|
18
18
|
style,
|
|
19
|
-
testId = "
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
testId = "pulse-bars",
|
|
20
|
+
visible = true,
|
|
21
|
+
ariaLabel = "Loading...",
|
|
22
22
|
...rest
|
|
23
23
|
}, ref) => {
|
|
24
|
+
const prefersReducedMotion = useReducedMotion();
|
|
25
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
24
26
|
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
|
|
25
|
-
|
|
27
|
+
visible,
|
|
26
28
|
delay,
|
|
27
29
|
minDuration,
|
|
28
30
|
transition
|
|
29
31
|
);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
WebkitBackdropFilter: blur ? "blur(4px)" : void 0
|
|
35
|
-
};
|
|
36
|
-
return /* @__PURE__ */ jsxs(
|
|
32
|
+
if (!shouldRender) return null;
|
|
33
|
+
const sizeValue = parseSizeToNumber(size, 40);
|
|
34
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2));
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
37
36
|
"div",
|
|
38
37
|
{
|
|
39
38
|
ref,
|
|
40
39
|
"data-testid": testId,
|
|
41
|
-
className: cn("
|
|
42
|
-
style
|
|
40
|
+
className: cn("inline-flex items-center justify-center gap-1", className),
|
|
41
|
+
style: {
|
|
42
|
+
height: normalizeSize(size),
|
|
43
|
+
...style,
|
|
44
|
+
opacity,
|
|
45
|
+
transition: transitionStyle
|
|
46
|
+
},
|
|
47
|
+
role: "status",
|
|
48
|
+
"aria-label": ariaLabel,
|
|
49
|
+
"aria-busy": "true",
|
|
43
50
|
...rest,
|
|
44
|
-
children:
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
children: Array.from({ length: barCount }).map((_, index) => {
|
|
52
|
+
const delays = [0, 0.2, 0.4, 0.1, 0.3, 0.5];
|
|
53
|
+
const reversedDelays = [...delays].reverse();
|
|
54
|
+
const delay2 = reverse ? reversedDelays[index % reversedDelays.length] : delays[index % delays.length];
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
47
56
|
"div",
|
|
48
57
|
{
|
|
49
|
-
className:
|
|
50
|
-
"inset-0 flex items-center justify-center",
|
|
51
|
-
position === "fixed" ? "fixed" : "absolute"
|
|
52
|
-
),
|
|
58
|
+
className: "rounded-sm",
|
|
53
59
|
style: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
style: backdropStyles,
|
|
67
|
-
"aria-hidden": "true"
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
/* @__PURE__ */ jsx("div", { className: "relative z-10", children: loader })
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
]
|
|
60
|
+
width: `${barWidth}px`,
|
|
61
|
+
minHeight: "30%",
|
|
62
|
+
height: "100%",
|
|
63
|
+
backgroundColor: color,
|
|
64
|
+
animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
|
|
65
|
+
animationDelay: `${delay2}s`,
|
|
66
|
+
transformOrigin: "center"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
index
|
|
70
|
+
);
|
|
71
|
+
})
|
|
75
72
|
}
|
|
76
73
|
);
|
|
77
74
|
}
|
|
78
75
|
);
|
|
79
|
-
|
|
76
|
+
PulseBars.displayName = "PulseBars";
|
|
80
77
|
export {
|
|
81
|
-
|
|
78
|
+
PulseBars
|
|
82
79
|
};
|
|
83
|
-
//# sourceMappingURL=index29.js.map
|
package/dist/index3.cjs
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const clsx = require("./index30.cjs");
|
|
4
3
|
function cn(...inputs) {
|
|
5
|
-
|
|
4
|
+
const classes = [];
|
|
5
|
+
for (const input of inputs) {
|
|
6
|
+
if (!input) continue;
|
|
7
|
+
if (typeof input === "string") {
|
|
8
|
+
classes.push(input);
|
|
9
|
+
} else if (Array.isArray(input)) {
|
|
10
|
+
const result = cn(...input);
|
|
11
|
+
if (result) classes.push(result);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return classes.join(" ");
|
|
6
15
|
}
|
|
7
16
|
exports.cn = cn;
|
|
8
|
-
//# sourceMappingURL=index3.cjs.map
|
package/dist/index3.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { clsx } from "./index30.js";
|
|
2
1
|
function cn(...inputs) {
|
|
3
|
-
|
|
2
|
+
const classes = [];
|
|
3
|
+
for (const input of inputs) {
|
|
4
|
+
if (!input) continue;
|
|
5
|
+
if (typeof input === "string") {
|
|
6
|
+
classes.push(input);
|
|
7
|
+
} else if (Array.isArray(input)) {
|
|
8
|
+
const result = cn(...input);
|
|
9
|
+
if (result) classes.push(result);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return classes.join(" ");
|
|
4
13
|
}
|
|
5
14
|
export {
|
|
6
15
|
cn
|
|
7
16
|
};
|
|
8
|
-
//# sourceMappingURL=index3.js.map
|
package/dist/index30.cjs
CHANGED
|
@@ -1,18 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const hooks = require("./index32.cjs");
|
|
6
|
+
const colors = require("./index4.cjs");
|
|
7
|
+
const classNames = require("./index3.cjs");
|
|
8
|
+
const TypingIndicator = react.forwardRef(
|
|
9
|
+
({
|
|
10
|
+
size,
|
|
11
|
+
color = "#3b82f6",
|
|
12
|
+
dotCount = 3,
|
|
13
|
+
dotSize = 8,
|
|
14
|
+
gap = 4,
|
|
15
|
+
variant = "bounce",
|
|
16
|
+
speed = "normal",
|
|
17
|
+
reverse = false,
|
|
18
|
+
respectMotionPreference = true,
|
|
19
|
+
delay = 0,
|
|
20
|
+
minDuration = 0,
|
|
21
|
+
transition,
|
|
22
|
+
className,
|
|
23
|
+
style,
|
|
24
|
+
testId = "typing-indicator",
|
|
25
|
+
visible = true,
|
|
26
|
+
ariaLabel = "Typing...",
|
|
27
|
+
...rest
|
|
28
|
+
}, ref) => {
|
|
29
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
30
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
31
|
+
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
32
|
+
visible,
|
|
33
|
+
delay,
|
|
34
|
+
minDuration,
|
|
35
|
+
transition
|
|
36
|
+
);
|
|
37
|
+
if (!shouldRender) return null;
|
|
38
|
+
const gapValue = colors.normalizeSize(gap);
|
|
39
|
+
const durationMs = typeof effectiveDuration === "string" ? parseFloat(effectiveDuration) * 1e3 : effectiveDuration;
|
|
40
|
+
const delayBetweenDots = durationMs * 0.15 / 1e3;
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
ref,
|
|
45
|
+
"data-testid": testId,
|
|
46
|
+
className: classNames.cn("inline-flex items-center", className),
|
|
47
|
+
style: {
|
|
48
|
+
gap: gapValue,
|
|
49
|
+
height: size ? colors.normalizeSize(size) : "auto",
|
|
50
|
+
...style,
|
|
51
|
+
opacity,
|
|
52
|
+
transition: transitionStyle
|
|
53
|
+
},
|
|
54
|
+
role: "status",
|
|
55
|
+
"aria-label": ariaLabel,
|
|
56
|
+
"aria-busy": "true",
|
|
57
|
+
...rest,
|
|
58
|
+
children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: "rounded-full",
|
|
62
|
+
style: {
|
|
63
|
+
width: colors.normalizeSize(dotSize),
|
|
64
|
+
height: colors.normalizeSize(dotSize),
|
|
65
|
+
backgroundColor: color,
|
|
66
|
+
animation: `typing-${variant} ${effectiveDuration} ease-in-out infinite`,
|
|
67
|
+
animationDelay: reverse ? `${(dotCount - index - 1) * delayBetweenDots}s` : `${index * delayBetweenDots}s`,
|
|
68
|
+
willChange: "transform, opacity"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
index
|
|
72
|
+
))
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
TypingIndicator.displayName = "TypingIndicator";
|
|
78
|
+
exports.TypingIndicator = TypingIndicator;
|
package/dist/index30.js
CHANGED
|
@@ -1,18 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index32.js";
|
|
4
|
+
import { normalizeSize } from "./index4.js";
|
|
5
|
+
import { cn } from "./index3.js";
|
|
6
|
+
const TypingIndicator = forwardRef(
|
|
7
|
+
({
|
|
8
|
+
size,
|
|
9
|
+
color = "#3b82f6",
|
|
10
|
+
dotCount = 3,
|
|
11
|
+
dotSize = 8,
|
|
12
|
+
gap = 4,
|
|
13
|
+
variant = "bounce",
|
|
14
|
+
speed = "normal",
|
|
15
|
+
reverse = false,
|
|
16
|
+
respectMotionPreference = true,
|
|
17
|
+
delay = 0,
|
|
18
|
+
minDuration = 0,
|
|
19
|
+
transition,
|
|
20
|
+
className,
|
|
21
|
+
style,
|
|
22
|
+
testId = "typing-indicator",
|
|
23
|
+
visible = true,
|
|
24
|
+
ariaLabel = "Typing...",
|
|
25
|
+
...rest
|
|
26
|
+
}, ref) => {
|
|
27
|
+
const prefersReducedMotion = useReducedMotion();
|
|
28
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
29
|
+
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
|
|
30
|
+
visible,
|
|
31
|
+
delay,
|
|
32
|
+
minDuration,
|
|
33
|
+
transition
|
|
34
|
+
);
|
|
35
|
+
if (!shouldRender) return null;
|
|
36
|
+
const gapValue = normalizeSize(gap);
|
|
37
|
+
const durationMs = typeof effectiveDuration === "string" ? parseFloat(effectiveDuration) * 1e3 : effectiveDuration;
|
|
38
|
+
const delayBetweenDots = durationMs * 0.15 / 1e3;
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
"data-testid": testId,
|
|
44
|
+
className: cn("inline-flex items-center", className),
|
|
45
|
+
style: {
|
|
46
|
+
gap: gapValue,
|
|
47
|
+
height: size ? normalizeSize(size) : "auto",
|
|
48
|
+
...style,
|
|
49
|
+
opacity,
|
|
50
|
+
transition: transitionStyle
|
|
51
|
+
},
|
|
52
|
+
role: "status",
|
|
53
|
+
"aria-label": ariaLabel,
|
|
54
|
+
"aria-busy": "true",
|
|
55
|
+
...rest,
|
|
56
|
+
children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: "rounded-full",
|
|
60
|
+
style: {
|
|
61
|
+
width: normalizeSize(dotSize),
|
|
62
|
+
height: normalizeSize(dotSize),
|
|
63
|
+
backgroundColor: color,
|
|
64
|
+
animation: `typing-${variant} ${effectiveDuration} ease-in-out infinite`,
|
|
65
|
+
animationDelay: reverse ? `${(dotCount - index - 1) * delayBetweenDots}s` : `${index * delayBetweenDots}s`,
|
|
66
|
+
willChange: "transform, opacity"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
index
|
|
70
|
+
))
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
TypingIndicator.displayName = "TypingIndicator";
|
|
14
76
|
export {
|
|
15
|
-
|
|
16
|
-
clsx as default
|
|
77
|
+
TypingIndicator
|
|
17
78
|
};
|
|
18
|
-
//# sourceMappingURL=index30.js.map
|