premium-react-loaders 2.0.0 → 2.2.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.
Files changed (96) hide show
  1. package/README.md +262 -6
  2. package/dist/components/button/ButtonSpinner.d.ts +25 -0
  3. package/dist/components/button/ButtonSpinner.d.ts.map +1 -0
  4. package/dist/components/button/index.d.ts +2 -0
  5. package/dist/components/button/index.d.ts.map +1 -0
  6. package/dist/components/index.d.ts +2 -0
  7. package/dist/components/index.d.ts.map +1 -1
  8. package/dist/components/pulse/TypingIndicator.d.ts.map +1 -1
  9. package/dist/components/status/ErrorIndicator.d.ts +32 -0
  10. package/dist/components/status/ErrorIndicator.d.ts.map +1 -0
  11. package/dist/components/status/SuccessCheckmark.d.ts +31 -0
  12. package/dist/components/status/SuccessCheckmark.d.ts.map +1 -0
  13. package/dist/components/status/index.d.ts +3 -0
  14. package/dist/components/status/index.d.ts.map +1 -0
  15. package/dist/context/ThemeContext.d.ts +84 -0
  16. package/dist/context/ThemeContext.d.ts.map +1 -0
  17. package/dist/context/index.d.ts +3 -0
  18. package/dist/context/index.d.ts.map +1 -0
  19. package/dist/hooks/index.d.ts +3 -0
  20. package/dist/hooks/index.d.ts.map +1 -0
  21. package/dist/hooks/useLoader.d.ts +56 -0
  22. package/dist/hooks/useLoader.d.ts.map +1 -0
  23. package/dist/index.cjs +37 -26
  24. package/dist/index.d.ts +5 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +37 -26
  27. package/dist/index10.cjs +20 -31
  28. package/dist/index10.js +20 -31
  29. package/dist/index11.cjs +47 -25
  30. package/dist/index11.js +47 -25
  31. package/dist/index12.cjs +30 -126
  32. package/dist/index12.js +31 -127
  33. package/dist/index13.cjs +30 -53
  34. package/dist/index13.js +30 -53
  35. package/dist/index14.cjs +127 -43
  36. package/dist/index14.js +128 -44
  37. package/dist/index15.cjs +58 -37
  38. package/dist/index15.js +59 -38
  39. package/dist/index16.cjs +24 -36
  40. package/dist/index16.js +24 -36
  41. package/dist/index17.cjs +19 -21
  42. package/dist/index17.js +19 -21
  43. package/dist/index18.cjs +25 -20
  44. package/dist/index18.js +25 -20
  45. package/dist/index19.cjs +22 -32
  46. package/dist/index19.js +22 -32
  47. package/dist/index20.cjs +26 -35
  48. package/dist/index20.js +28 -37
  49. package/dist/index21.cjs +40 -76
  50. package/dist/index21.js +42 -78
  51. package/dist/index22.cjs +53 -102
  52. package/dist/index22.js +54 -103
  53. package/dist/index23.cjs +46 -80
  54. package/dist/index23.js +47 -81
  55. package/dist/index24.cjs +105 -103
  56. package/dist/index24.js +107 -105
  57. package/dist/index25.cjs +108 -27
  58. package/dist/index25.js +111 -30
  59. package/dist/index26.cjs +104 -36
  60. package/dist/index26.js +106 -38
  61. package/dist/index27.cjs +22 -30
  62. package/dist/index27.js +23 -31
  63. package/dist/index28.cjs +30 -29
  64. package/dist/index28.js +31 -30
  65. package/dist/index29.cjs +49 -52
  66. package/dist/index29.js +50 -53
  67. package/dist/index30.cjs +74 -121
  68. package/dist/index30.js +75 -122
  69. package/dist/index31.cjs +82 -0
  70. package/dist/index31.js +82 -0
  71. package/dist/index32.cjs +149 -0
  72. package/dist/index32.js +149 -0
  73. package/dist/index33.cjs +100 -0
  74. package/dist/index33.js +100 -0
  75. package/dist/index34.cjs +117 -0
  76. package/dist/index34.js +117 -0
  77. package/dist/index35.cjs +125 -0
  78. package/dist/index35.js +125 -0
  79. package/dist/index5.cjs +11 -72
  80. package/dist/index5.js +12 -73
  81. package/dist/index6.cjs +86 -65
  82. package/dist/index6.js +87 -66
  83. package/dist/index7.cjs +40 -20
  84. package/dist/index7.js +40 -20
  85. package/dist/index8.cjs +34 -21
  86. package/dist/index8.js +34 -21
  87. package/dist/index9.cjs +21 -55
  88. package/dist/index9.js +22 -56
  89. package/dist/premium-react-loaders.css +178 -6
  90. package/dist/types/button.d.ts +31 -0
  91. package/dist/types/button.d.ts.map +1 -0
  92. package/dist/types/index.d.ts +2 -0
  93. package/dist/types/index.d.ts.map +1 -1
  94. package/dist/types/status.d.ts +34 -0
  95. package/dist/types/status.d.ts.map +1 -0
  96. package/package.json +1 -1
package/dist/index26.cjs CHANGED
@@ -2,29 +2,30 @@
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("./index30.cjs");
6
- const colors = require("./index4.cjs");
5
+ const hooks = require("./index35.cjs");
7
6
  const classNames = require("./index3.cjs");
8
- const PulseWave = react.forwardRef(
7
+ const ProgressSteps = react.forwardRef(
9
8
  ({
10
- size = "md",
9
+ steps,
10
+ currentStep,
11
+ labels,
12
+ showNumbers = true,
13
+ orientation = "horizontal",
14
+ connector = "line",
11
15
  color = "#3b82f6",
12
- barCount = 5,
13
- speed = "normal",
14
- reverse = false,
15
- respectMotionPreference = true,
16
+ completedColor,
17
+ activeColor,
18
+ inactiveColor = "#e0e0e0",
16
19
  delay = 0,
17
20
  minDuration = 0,
18
21
  transition,
19
22
  className,
20
23
  style,
21
- testId = "pulse-wave",
24
+ testId = "progress-steps",
22
25
  visible = true,
23
- ariaLabel = "Loading...",
26
+ ariaLabel = "Progress steps",
24
27
  ...rest
25
28
  }, ref) => {
26
- const prefersReducedMotion = hooks.useReducedMotion();
27
- const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
28
29
  const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
29
30
  visible,
30
31
  delay,
@@ -32,45 +33,112 @@ const PulseWave = react.forwardRef(
32
33
  transition
33
34
  );
34
35
  if (!shouldRender) return null;
35
- const sizeValue = colors.parseSizeToNumber(size, 40);
36
- const barWidth = Math.floor(sizeValue / (barCount * 2.5));
36
+ const completed = completedColor || color;
37
+ const active = activeColor || color;
38
+ const getStepStatus = (index) => {
39
+ if (index < currentStep) return "completed";
40
+ if (index === currentStep) return "active";
41
+ return "inactive";
42
+ };
43
+ const getStepColor = (status) => {
44
+ if (status === "completed") return completed;
45
+ if (status === "active") return active;
46
+ return inactiveColor;
47
+ };
48
+ const getConnectorColor = (index) => {
49
+ return index < currentStep ? completed : inactiveColor;
50
+ };
51
+ const isHorizontal = orientation === "horizontal";
37
52
  return /* @__PURE__ */ jsxRuntime.jsx(
38
53
  "div",
39
54
  {
40
55
  ref,
41
56
  "data-testid": testId,
42
- className: classNames.cn("inline-flex items-end justify-center gap-1", className),
57
+ className: classNames.cn(
58
+ "flex",
59
+ isHorizontal ? "flex-row items-center w-full" : "flex-col items-start",
60
+ className
61
+ ),
43
62
  style: {
44
- height: colors.normalizeSize(size),
45
63
  ...style,
46
64
  opacity,
47
65
  transition: transitionStyle
48
66
  },
49
- role: "status",
67
+ role: "progressbar",
50
68
  "aria-label": ariaLabel,
51
- "aria-busy": "true",
69
+ "aria-valuenow": currentStep,
70
+ "aria-valuemin": 0,
71
+ "aria-valuemax": steps - 1,
52
72
  ...rest,
53
- children: Array.from({ length: barCount }).map((_, index) => {
54
- const delay2 = reverse ? (barCount - index - 1) / barCount * 0.5 : index / barCount * 0.5;
55
- return /* @__PURE__ */ jsxRuntime.jsx(
56
- "div",
57
- {
58
- className: "rounded-sm",
59
- style: {
60
- width: `${barWidth}px`,
61
- height: "100%",
62
- backgroundColor: color,
63
- animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
64
- animationDelay: `${delay2}s`,
65
- transformOrigin: "bottom"
73
+ children: Array.from({ length: steps }).map((_, index) => {
74
+ const status = getStepStatus(index);
75
+ const stepColor = getStepColor(status);
76
+ const showConnector = index < steps - 1 && connector === "line";
77
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
78
+ /* @__PURE__ */ jsxRuntime.jsxs(
79
+ "div",
80
+ {
81
+ className: classNames.cn(
82
+ "flex items-center",
83
+ isHorizontal ? "flex-col" : "flex-row gap-3"
84
+ ),
85
+ children: [
86
+ /* @__PURE__ */ jsxRuntime.jsx(
87
+ "div",
88
+ {
89
+ className: "rounded-full flex items-center justify-center font-medium text-sm transition-colors",
90
+ style: {
91
+ width: "2rem",
92
+ height: "2rem",
93
+ backgroundColor: stepColor,
94
+ color: "#ffffff"
95
+ },
96
+ children: showNumbers && /* @__PURE__ */ jsxRuntime.jsx("span", { children: index + 1 })
97
+ }
98
+ ),
99
+ (labels == null ? void 0 : labels[index]) && /* @__PURE__ */ jsxRuntime.jsx(
100
+ "span",
101
+ {
102
+ className: classNames.cn(
103
+ "text-xs mt-1 transition-colors",
104
+ isHorizontal ? "text-center" : "text-left"
105
+ ),
106
+ style: {
107
+ color: status === "inactive" ? "#9ca3af" : "#374151",
108
+ maxWidth: isHorizontal ? "80px" : "none"
109
+ },
110
+ children: labels[index]
111
+ }
112
+ )
113
+ ]
66
114
  }
67
- },
68
- index
69
- );
115
+ ),
116
+ showConnector && /* @__PURE__ */ jsxRuntime.jsx(
117
+ "div",
118
+ {
119
+ className: "transition-colors",
120
+ style: {
121
+ backgroundColor: getConnectorColor(index),
122
+ ...isHorizontal ? {
123
+ height: "2px",
124
+ flex: 1,
125
+ marginLeft: "4px",
126
+ marginRight: "4px"
127
+ } : {
128
+ width: "2px",
129
+ height: "32px",
130
+ marginLeft: "15px",
131
+ marginTop: (labels == null ? void 0 : labels[index]) ? "4px" : "0",
132
+ marginBottom: "4px"
133
+ }
134
+ }
135
+ }
136
+ )
137
+ ] }, index);
70
138
  })
71
139
  }
72
140
  );
73
141
  }
74
142
  );
75
- PulseWave.displayName = "PulseWave";
76
- exports.PulseWave = PulseWave;
143
+ ProgressSteps.displayName = "ProgressSteps";
144
+ exports.ProgressSteps = ProgressSteps;
package/dist/index26.js CHANGED
@@ -1,28 +1,29 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index30.js";
4
- import { normalizeSize, parseSizeToNumber } from "./index4.js";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, Fragment } from "react";
3
+ import { useLoaderVisibility } from "./index35.js";
5
4
  import { cn } from "./index3.js";
6
- const PulseWave = forwardRef(
5
+ const ProgressSteps = forwardRef(
7
6
  ({
8
- size = "md",
7
+ steps,
8
+ currentStep,
9
+ labels,
10
+ showNumbers = true,
11
+ orientation = "horizontal",
12
+ connector = "line",
9
13
  color = "#3b82f6",
10
- barCount = 5,
11
- speed = "normal",
12
- reverse = false,
13
- respectMotionPreference = true,
14
+ completedColor,
15
+ activeColor,
16
+ inactiveColor = "#e0e0e0",
14
17
  delay = 0,
15
18
  minDuration = 0,
16
19
  transition,
17
20
  className,
18
21
  style,
19
- testId = "pulse-wave",
22
+ testId = "progress-steps",
20
23
  visible = true,
21
- ariaLabel = "Loading...",
24
+ ariaLabel = "Progress steps",
22
25
  ...rest
23
26
  }, ref) => {
24
- const prefersReducedMotion = useReducedMotion();
25
- const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
26
27
  const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
27
28
  visible,
28
29
  delay,
@@ -30,47 +31,114 @@ const PulseWave = 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.5));
34
+ const completed = completedColor || color;
35
+ const active = activeColor || color;
36
+ const getStepStatus = (index) => {
37
+ if (index < currentStep) return "completed";
38
+ if (index === currentStep) return "active";
39
+ return "inactive";
40
+ };
41
+ const getStepColor = (status) => {
42
+ if (status === "completed") return completed;
43
+ if (status === "active") return active;
44
+ return inactiveColor;
45
+ };
46
+ const getConnectorColor = (index) => {
47
+ return index < currentStep ? completed : inactiveColor;
48
+ };
49
+ const isHorizontal = orientation === "horizontal";
35
50
  return /* @__PURE__ */ jsx(
36
51
  "div",
37
52
  {
38
53
  ref,
39
54
  "data-testid": testId,
40
- className: cn("inline-flex items-end justify-center gap-1", className),
55
+ className: cn(
56
+ "flex",
57
+ isHorizontal ? "flex-row items-center w-full" : "flex-col items-start",
58
+ className
59
+ ),
41
60
  style: {
42
- height: normalizeSize(size),
43
61
  ...style,
44
62
  opacity,
45
63
  transition: transitionStyle
46
64
  },
47
- role: "status",
65
+ role: "progressbar",
48
66
  "aria-label": ariaLabel,
49
- "aria-busy": "true",
67
+ "aria-valuenow": currentStep,
68
+ "aria-valuemin": 0,
69
+ "aria-valuemax": steps - 1,
50
70
  ...rest,
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"
71
+ children: Array.from({ length: steps }).map((_, index) => {
72
+ const status = getStepStatus(index);
73
+ const stepColor = getStepColor(status);
74
+ const showConnector = index < steps - 1 && connector === "line";
75
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
76
+ /* @__PURE__ */ jsxs(
77
+ "div",
78
+ {
79
+ className: cn(
80
+ "flex items-center",
81
+ isHorizontal ? "flex-col" : "flex-row gap-3"
82
+ ),
83
+ children: [
84
+ /* @__PURE__ */ jsx(
85
+ "div",
86
+ {
87
+ className: "rounded-full flex items-center justify-center font-medium text-sm transition-colors",
88
+ style: {
89
+ width: "2rem",
90
+ height: "2rem",
91
+ backgroundColor: stepColor,
92
+ color: "#ffffff"
93
+ },
94
+ children: showNumbers && /* @__PURE__ */ jsx("span", { children: index + 1 })
95
+ }
96
+ ),
97
+ (labels == null ? void 0 : labels[index]) && /* @__PURE__ */ jsx(
98
+ "span",
99
+ {
100
+ className: cn(
101
+ "text-xs mt-1 transition-colors",
102
+ isHorizontal ? "text-center" : "text-left"
103
+ ),
104
+ style: {
105
+ color: status === "inactive" ? "#9ca3af" : "#374151",
106
+ maxWidth: isHorizontal ? "80px" : "none"
107
+ },
108
+ children: labels[index]
109
+ }
110
+ )
111
+ ]
64
112
  }
65
- },
66
- index
67
- );
113
+ ),
114
+ showConnector && /* @__PURE__ */ jsx(
115
+ "div",
116
+ {
117
+ className: "transition-colors",
118
+ style: {
119
+ backgroundColor: getConnectorColor(index),
120
+ ...isHorizontal ? {
121
+ height: "2px",
122
+ flex: 1,
123
+ marginLeft: "4px",
124
+ marginRight: "4px"
125
+ } : {
126
+ width: "2px",
127
+ height: "32px",
128
+ marginLeft: "15px",
129
+ marginTop: (labels == null ? void 0 : labels[index]) ? "4px" : "0",
130
+ marginBottom: "4px"
131
+ }
132
+ }
133
+ }
134
+ )
135
+ ] }, index);
68
136
  })
69
137
  }
70
138
  );
71
139
  }
72
140
  );
73
- PulseWave.displayName = "PulseWave";
141
+ ProgressSteps.displayName = "ProgressSteps";
74
142
  export {
75
- PulseWave
143
+ ProgressSteps
76
144
  };
package/dist/index27.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("./index30.cjs");
5
+ const hooks = require("./index35.cjs");
6
6
  const colors = require("./index4.cjs");
7
7
  const classNames = require("./index3.cjs");
8
- const PulseBars = react.forwardRef(
8
+ const PulseDots = react.forwardRef(
9
9
  ({
10
10
  size = "md",
11
11
  color = "#3b82f6",
12
- barCount = 4,
12
+ dotCount = 3,
13
+ dotSize = 10,
13
14
  speed = "normal",
14
15
  reverse = false,
15
16
  respectMotionPreference = true,
@@ -18,7 +19,7 @@ const PulseBars = react.forwardRef(
18
19
  transition,
19
20
  className,
20
21
  style,
21
- testId = "pulse-bars",
22
+ testId = "pulse-dots",
22
23
  visible = true,
23
24
  ariaLabel = "Loading...",
24
25
  ...rest
@@ -32,14 +33,12 @@ const PulseBars = react.forwardRef(
32
33
  transition
33
34
  );
34
35
  if (!shouldRender) return null;
35
- const sizeValue = colors.parseSizeToNumber(size, 40);
36
- const barWidth = Math.floor(sizeValue / (barCount * 2));
37
36
  return /* @__PURE__ */ jsxRuntime.jsx(
38
37
  "div",
39
38
  {
40
39
  ref,
41
40
  "data-testid": testId,
42
- className: classNames.cn("inline-flex items-center justify-center gap-1", className),
41
+ className: classNames.cn("inline-flex items-center justify-center gap-2", className),
43
42
  style: {
44
43
  height: colors.normalizeSize(size),
45
44
  ...style,
@@ -50,30 +49,23 @@ const PulseBars = react.forwardRef(
50
49
  "aria-label": ariaLabel,
51
50
  "aria-busy": "true",
52
51
  ...rest,
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(
58
- "div",
59
- {
60
- className: "rounded-sm",
61
- style: {
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
- })
52
+ children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
53
+ "div",
54
+ {
55
+ className: "rounded-full",
56
+ style: {
57
+ width: colors.normalizeSize(dotSize),
58
+ height: colors.normalizeSize(dotSize),
59
+ backgroundColor: color,
60
+ animation: `pulse-bounce ${effectiveDuration} ease-in-out infinite`,
61
+ animationDelay: reverse ? `${(dotCount - index - 1) * 0.15}s` : `${index * 0.15}s`
62
+ }
63
+ },
64
+ index
65
+ ))
74
66
  }
75
67
  );
76
68
  }
77
69
  );
78
- PulseBars.displayName = "PulseBars";
79
- exports.PulseBars = PulseBars;
70
+ PulseDots.displayName = "PulseDots";
71
+ exports.PulseDots = PulseDots;
package/dist/index27.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 "./index30.js";
4
- import { normalizeSize, parseSizeToNumber } from "./index4.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index35.js";
4
+ import { normalizeSize } from "./index4.js";
5
5
  import { cn } from "./index3.js";
6
- const PulseBars = forwardRef(
6
+ const PulseDots = forwardRef(
7
7
  ({
8
8
  size = "md",
9
9
  color = "#3b82f6",
10
- barCount = 4,
10
+ dotCount = 3,
11
+ dotSize = 10,
11
12
  speed = "normal",
12
13
  reverse = false,
13
14
  respectMotionPreference = true,
@@ -16,7 +17,7 @@ const PulseBars = forwardRef(
16
17
  transition,
17
18
  className,
18
19
  style,
19
- testId = "pulse-bars",
20
+ testId = "pulse-dots",
20
21
  visible = true,
21
22
  ariaLabel = "Loading...",
22
23
  ...rest
@@ -30,14 +31,12 @@ const PulseBars = 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 gap-1", className),
39
+ className: cn("inline-flex items-center justify-center gap-2", className),
41
40
  style: {
42
41
  height: normalizeSize(size),
43
42
  ...style,
@@ -48,32 +47,25 @@ const PulseBars = forwardRef(
48
47
  "aria-label": ariaLabel,
49
48
  "aria-busy": "true",
50
49
  ...rest,
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(
56
- "div",
57
- {
58
- className: "rounded-sm",
59
- style: {
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
- })
50
+ children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ className: "rounded-full",
54
+ style: {
55
+ width: normalizeSize(dotSize),
56
+ height: normalizeSize(dotSize),
57
+ backgroundColor: color,
58
+ animation: `pulse-bounce ${effectiveDuration} ease-in-out infinite`,
59
+ animationDelay: reverse ? `${(dotCount - index - 1) * 0.15}s` : `${index * 0.15}s`
60
+ }
61
+ },
62
+ index
63
+ ))
72
64
  }
73
65
  );
74
66
  }
75
67
  );
76
- PulseBars.displayName = "PulseBars";
68
+ PulseDots.displayName = "PulseDots";
77
69
  export {
78
- PulseBars
70
+ PulseDots
79
71
  };
package/dist/index28.cjs CHANGED
@@ -2,17 +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("./index30.cjs");
5
+ const hooks = require("./index35.cjs");
6
6
  const colors = require("./index4.cjs");
7
7
  const classNames = require("./index3.cjs");
8
- const TypingIndicator = react.forwardRef(
8
+ const PulseWave = react.forwardRef(
9
9
  ({
10
- size,
10
+ size = "md",
11
11
  color = "#3b82f6",
12
- dotCount = 3,
13
- dotSize = 8,
14
- gap = 4,
15
- variant = "bounce",
12
+ barCount = 5,
16
13
  speed = "normal",
17
14
  reverse = false,
18
15
  respectMotionPreference = true,
@@ -21,9 +18,9 @@ const TypingIndicator = react.forwardRef(
21
18
  transition,
22
19
  className,
23
20
  style,
24
- testId = "typing-indicator",
21
+ testId = "pulse-wave",
25
22
  visible = true,
26
- ariaLabel = "Typing...",
23
+ ariaLabel = "Loading...",
27
24
  ...rest
28
25
  }, ref) => {
29
26
  const prefersReducedMotion = hooks.useReducedMotion();
@@ -35,16 +32,16 @@ const TypingIndicator = react.forwardRef(
35
32
  transition
36
33
  );
37
34
  if (!shouldRender) return null;
38
- const gapValue = colors.normalizeSize(gap);
35
+ const sizeValue = colors.parseSizeToNumber(size, 40);
36
+ const barWidth = Math.floor(sizeValue / (barCount * 2.5));
39
37
  return /* @__PURE__ */ jsxRuntime.jsx(
40
38
  "div",
41
39
  {
42
40
  ref,
43
41
  "data-testid": testId,
44
- className: classNames.cn("inline-flex items-center", className),
42
+ className: classNames.cn("inline-flex items-end justify-center gap-1", className),
45
43
  style: {
46
- gap: gapValue,
47
- height: size ? colors.normalizeSize(size) : "auto",
44
+ height: colors.normalizeSize(size),
48
45
  ...style,
49
46
  opacity,
50
47
  transition: transitionStyle
@@ -53,23 +50,27 @@ const TypingIndicator = react.forwardRef(
53
50
  "aria-label": ariaLabel,
54
51
  "aria-busy": "true",
55
52
  ...rest,
56
- children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
57
- "div",
58
- {
59
- className: "rounded-full",
60
- style: {
61
- width: colors.normalizeSize(dotSize),
62
- height: colors.normalizeSize(dotSize),
63
- backgroundColor: color,
64
- animation: `typing-${variant} ${effectiveDuration} ease-in-out infinite`,
65
- animationDelay: reverse ? `${(dotCount - index - 1) * 0.2}s` : `${index * 0.2}s`
66
- }
67
- },
68
- index
69
- ))
53
+ children: Array.from({ length: barCount }).map((_, index) => {
54
+ const delay2 = reverse ? (barCount - index - 1) / barCount * 0.5 : index / barCount * 0.5;
55
+ return /* @__PURE__ */ jsxRuntime.jsx(
56
+ "div",
57
+ {
58
+ className: "rounded-sm",
59
+ style: {
60
+ width: `${barWidth}px`,
61
+ height: "100%",
62
+ backgroundColor: color,
63
+ animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
64
+ animationDelay: `${delay2}s`,
65
+ transformOrigin: "bottom"
66
+ }
67
+ },
68
+ index
69
+ );
70
+ })
70
71
  }
71
72
  );
72
73
  }
73
74
  );
74
- TypingIndicator.displayName = "TypingIndicator";
75
- exports.TypingIndicator = TypingIndicator;
75
+ PulseWave.displayName = "PulseWave";
76
+ exports.PulseWave = PulseWave;