premium-react-loaders 4.0.0 → 4.1.1

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 (163) hide show
  1. package/README.md +21 -6
  2. package/dist/components/index.d.ts +1 -0
  3. package/dist/components/index.d.ts.map +1 -1
  4. package/dist/components/neon/NeonPulse.d.ts +12 -0
  5. package/dist/components/neon/NeonPulse.d.ts.map +1 -0
  6. package/dist/components/neon/NeonSpinner.d.ts +12 -0
  7. package/dist/components/neon/NeonSpinner.d.ts.map +1 -0
  8. package/dist/components/neon/NeonText.d.ts +12 -0
  9. package/dist/components/neon/NeonText.d.ts.map +1 -0
  10. package/dist/components/neon/index.d.ts +4 -0
  11. package/dist/components/neon/index.d.ts.map +1 -0
  12. package/dist/components/particle/ParticleField.d.ts +3 -0
  13. package/dist/components/particle/ParticleField.d.ts.map +1 -0
  14. package/dist/components/particle/ParticleTrail.d.ts +12 -0
  15. package/dist/components/particle/ParticleTrail.d.ts.map +1 -0
  16. package/dist/components/particle/index.d.ts +2 -0
  17. package/dist/components/particle/index.d.ts.map +1 -1
  18. package/dist/components/status/InfoIndicator.d.ts +29 -0
  19. package/dist/components/status/InfoIndicator.d.ts.map +1 -0
  20. package/dist/components/status/WarningIndicator.d.ts +29 -0
  21. package/dist/components/status/WarningIndicator.d.ts.map +1 -0
  22. package/dist/components/status/index.d.ts +2 -0
  23. package/dist/components/status/index.d.ts.map +1 -1
  24. package/dist/index.cjs +41 -27
  25. package/dist/index.js +41 -27
  26. package/dist/index10.cjs +1 -1
  27. package/dist/index10.js +1 -1
  28. package/dist/index11.cjs +1 -1
  29. package/dist/index11.js +1 -1
  30. package/dist/index12.cjs +1 -1
  31. package/dist/index12.js +1 -1
  32. package/dist/index13.cjs +1 -1
  33. package/dist/index13.js +1 -1
  34. package/dist/index14.cjs +1 -1
  35. package/dist/index14.js +1 -1
  36. package/dist/index15.cjs +1 -1
  37. package/dist/index15.js +1 -1
  38. package/dist/index17.cjs +1 -1
  39. package/dist/index17.js +1 -1
  40. package/dist/index18.cjs +1 -1
  41. package/dist/index18.js +1 -1
  42. package/dist/index19.cjs +1 -1
  43. package/dist/index19.js +1 -1
  44. package/dist/index20.cjs +1 -1
  45. package/dist/index20.js +1 -1
  46. package/dist/index21.cjs +1 -1
  47. package/dist/index21.js +1 -1
  48. package/dist/index22.cjs +1 -1
  49. package/dist/index22.js +1 -1
  50. package/dist/index23.cjs +1 -1
  51. package/dist/index23.js +1 -1
  52. package/dist/index24.cjs +1 -1
  53. package/dist/index24.js +1 -1
  54. package/dist/index25.cjs +1 -1
  55. package/dist/index25.js +1 -1
  56. package/dist/index26.cjs +1 -1
  57. package/dist/index26.js +1 -1
  58. package/dist/index27.cjs +1 -1
  59. package/dist/index27.js +1 -1
  60. package/dist/index28.cjs +1 -1
  61. package/dist/index28.js +1 -1
  62. package/dist/index29.cjs +1 -1
  63. package/dist/index29.js +1 -1
  64. package/dist/index30.cjs +1 -1
  65. package/dist/index30.js +1 -1
  66. package/dist/index31.cjs +1 -1
  67. package/dist/index31.js +1 -1
  68. package/dist/index32.cjs +1 -1
  69. package/dist/index32.js +1 -1
  70. package/dist/index33.cjs +1 -1
  71. package/dist/index33.js +1 -1
  72. package/dist/index34.cjs +1 -1
  73. package/dist/index34.js +1 -1
  74. package/dist/index35.cjs +1 -1
  75. package/dist/index35.js +1 -1
  76. package/dist/index36.cjs +1 -1
  77. package/dist/index36.js +1 -1
  78. package/dist/index37.cjs +59 -145
  79. package/dist/index37.js +61 -147
  80. package/dist/index38.cjs +32 -53
  81. package/dist/index38.js +33 -54
  82. package/dist/index39.cjs +138 -84
  83. package/dist/index39.js +140 -86
  84. package/dist/index40.cjs +33 -106
  85. package/dist/index40.js +34 -107
  86. package/dist/index41.cjs +66 -50
  87. package/dist/index41.js +66 -50
  88. package/dist/index42.cjs +123 -44
  89. package/dist/index42.js +124 -45
  90. package/dist/index43.cjs +43 -85
  91. package/dist/index43.js +44 -86
  92. package/dist/index44.cjs +35 -27
  93. package/dist/index44.js +35 -27
  94. package/dist/index45.cjs +87 -58
  95. package/dist/index45.js +87 -58
  96. package/dist/index46.cjs +35 -88
  97. package/dist/index46.js +36 -89
  98. package/dist/index47.cjs +62 -58
  99. package/dist/index47.js +63 -59
  100. package/dist/index48.cjs +87 -110
  101. package/dist/index48.js +88 -111
  102. package/dist/index49.cjs +48 -109
  103. package/dist/index49.js +49 -110
  104. package/dist/index50.cjs +110 -62
  105. package/dist/index50.js +111 -63
  106. package/dist/index51.cjs +104 -49
  107. package/dist/index51.js +104 -49
  108. package/dist/index52.cjs +43 -77
  109. package/dist/index52.js +44 -78
  110. package/dist/index53.cjs +56 -56
  111. package/dist/index53.js +56 -56
  112. package/dist/index54.cjs +104 -149
  113. package/dist/index54.js +106 -151
  114. package/dist/index55.cjs +97 -38
  115. package/dist/index55.js +99 -40
  116. package/dist/index56.cjs +161 -27
  117. package/dist/index56.js +162 -28
  118. package/dist/index57.cjs +36 -102
  119. package/dist/index57.js +38 -104
  120. package/dist/index58.cjs +19 -34
  121. package/dist/index58.js +20 -35
  122. package/dist/index59.cjs +87 -34
  123. package/dist/index59.js +89 -36
  124. package/dist/index60.cjs +25 -23
  125. package/dist/index60.js +25 -23
  126. package/dist/index61.cjs +32 -65
  127. package/dist/index61.js +34 -67
  128. package/dist/index62.cjs +29 -36
  129. package/dist/index62.js +30 -37
  130. package/dist/index63.cjs +66 -59
  131. package/dist/index63.js +69 -62
  132. package/dist/index64.cjs +71 -121
  133. package/dist/index64.js +72 -122
  134. package/dist/index65.cjs +92 -0
  135. package/dist/index65.js +92 -0
  136. package/dist/index66.cjs +76 -0
  137. package/dist/index66.js +76 -0
  138. package/dist/index67.cjs +76 -0
  139. package/dist/index67.js +76 -0
  140. package/dist/index68.cjs +64 -0
  141. package/dist/index68.js +64 -0
  142. package/dist/index69.cjs +60 -0
  143. package/dist/index69.js +60 -0
  144. package/dist/index7.cjs +1 -1
  145. package/dist/index7.js +1 -1
  146. package/dist/index70.cjs +57 -0
  147. package/dist/index70.js +57 -0
  148. package/dist/index71.cjs +125 -0
  149. package/dist/index71.js +125 -0
  150. package/dist/index8.cjs +1 -1
  151. package/dist/index8.js +1 -1
  152. package/dist/index9.cjs +1 -1
  153. package/dist/index9.js +1 -1
  154. package/dist/premium-react-loaders.css +85 -0
  155. package/dist/types/index.d.ts +1 -0
  156. package/dist/types/index.d.ts.map +1 -1
  157. package/dist/types/neon.d.ts +26 -0
  158. package/dist/types/neon.d.ts.map +1 -0
  159. package/dist/types/particle.d.ts +18 -0
  160. package/dist/types/particle.d.ts.map +1 -1
  161. package/dist/types/status.d.ts +30 -0
  162. package/dist/types/status.d.ts.map +1 -1
  163. package/package.json +1 -1
package/dist/index49.cjs CHANGED
@@ -2,18 +2,18 @@
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("./index64.cjs");
6
- const classNames = require("./index3.cjs");
5
+ const hooks = require("./index71.cjs");
7
6
  const colors = require("./index4.cjs");
8
- const CubeSpinner = react.forwardRef(
7
+ const classNames = require("./index3.cjs");
8
+ const MobiusLoader = react.forwardRef(
9
9
  ({
10
10
  size = "md",
11
11
  color = "#3b82f6",
12
- faceColors,
13
- rotationAxis = "diagonal",
14
- perspective = 600,
15
- showEdges = false,
16
- edgeColor = "#000000",
12
+ secondaryColor,
13
+ thickness = 2,
14
+ segments = 6,
15
+ twist = true,
16
+ ribbonWidth = 8,
17
17
  speed = "normal",
18
18
  reverse = false,
19
19
  respectMotionPreference = true,
@@ -22,7 +22,7 @@ const CubeSpinner = react.forwardRef(
22
22
  transition,
23
23
  className,
24
24
  style,
25
- testId = "cube-spinner",
25
+ testId = "mobius-loader",
26
26
  visible = true,
27
27
  ariaLabel = "Loading...",
28
28
  ...rest
@@ -36,32 +36,13 @@ const CubeSpinner = react.forwardRef(
36
36
  transition
37
37
  );
38
38
  if (!shouldRender) return null;
39
- const cubeSize = colors.normalizeSize(size);
40
- const halfSize = `calc(${cubeSize} / 2)`;
41
- const defaultFaceColors = [
42
- color,
43
- // front
44
- color,
45
- // back
46
- color,
47
- // right
48
- color,
49
- // left
50
- color,
51
- // top
52
- color
53
- // bottom
54
- ];
55
- const colors$1 = faceColors && faceColors.length === 6 ? faceColors : defaultFaceColors;
56
- const animationClass = {
57
- x: "animate-cube-rotate-x",
58
- y: "animate-cube-rotate-y",
59
- z: "animate-cube-rotate-z",
60
- diagonal: "animate-cube-rotate-diagonal"
61
- }[rotationAxis];
62
- const edgeStyle = showEdges ? {
63
- border: `1px solid ${edgeColor}`
64
- } : {};
39
+ const normalizedSize = colors.normalizeSize(size);
40
+ const sizeNum = parseInt(normalizedSize, 10);
41
+ const durationNum = parseInt(effectiveDuration, 10);
42
+ const centerX = sizeNum / 2;
43
+ const centerY = sizeNum / 2;
44
+ const radiusX = (sizeNum - ribbonWidth) / 2;
45
+ const radiusY = (sizeNum - ribbonWidth) / 3;
65
46
  return /* @__PURE__ */ jsxRuntime.jsx(
66
47
  "div",
67
48
  {
@@ -69,99 +50,57 @@ const CubeSpinner = react.forwardRef(
69
50
  "data-testid": testId,
70
51
  className: classNames.cn("inline-flex items-center justify-center", className),
71
52
  style: {
72
- ...style,
53
+ width: normalizedSize,
54
+ height: normalizedSize,
73
55
  opacity,
74
56
  transition: transitionStyle,
75
- perspective: `${perspective}px`
57
+ ...style
76
58
  },
77
59
  role: "status",
78
60
  "aria-label": ariaLabel,
79
61
  "aria-busy": "true",
80
62
  ...rest,
81
- children: /* @__PURE__ */ jsxRuntime.jsxs(
63
+ children: /* @__PURE__ */ jsxRuntime.jsx(
82
64
  "div",
83
65
  {
84
- className: classNames.cn("relative", animationClass),
66
+ className: "relative w-full h-full",
85
67
  style: {
86
- width: cubeSize,
87
- height: cubeSize,
88
- transformStyle: "preserve-3d",
89
- animationDuration: effectiveDuration,
68
+ animation: `mobius-rotate ${durationNum}ms linear infinite`,
90
69
  animationDirection: reverse ? "reverse" : "normal"
91
70
  },
92
- children: [
93
- /* @__PURE__ */ jsxRuntime.jsx(
94
- "div",
95
- {
96
- className: "absolute inset-0",
97
- style: {
98
- backgroundColor: colors$1[0],
99
- transform: `translateZ(${halfSize})`,
100
- ...edgeStyle
101
- }
102
- }
103
- ),
104
- /* @__PURE__ */ jsxRuntime.jsx(
105
- "div",
106
- {
107
- className: "absolute inset-0",
108
- style: {
109
- backgroundColor: colors$1[1],
110
- transform: `translateZ(calc(-${halfSize})) rotateY(180deg)`,
111
- ...edgeStyle
112
- }
113
- }
114
- ),
115
- /* @__PURE__ */ jsxRuntime.jsx(
116
- "div",
117
- {
118
- className: "absolute inset-0",
119
- style: {
120
- backgroundColor: colors$1[2],
121
- transform: `translateX(${halfSize}) rotateY(90deg)`,
122
- ...edgeStyle
123
- }
124
- }
125
- ),
126
- /* @__PURE__ */ jsxRuntime.jsx(
127
- "div",
128
- {
129
- className: "absolute inset-0",
130
- style: {
131
- backgroundColor: colors$1[3],
132
- transform: `translateX(calc(-${halfSize})) rotateY(-90deg)`,
133
- ...edgeStyle
134
- }
135
- }
136
- ),
137
- /* @__PURE__ */ jsxRuntime.jsx(
138
- "div",
139
- {
140
- className: "absolute inset-0",
141
- style: {
142
- backgroundColor: colors$1[4],
143
- transform: `translateY(calc(-${halfSize})) rotateX(90deg)`,
144
- ...edgeStyle
145
- }
146
- }
147
- ),
148
- /* @__PURE__ */ jsxRuntime.jsx(
71
+ children: Array.from({ length: segments }, (_, index) => {
72
+ const angle = 360 / segments * index;
73
+ const radians = angle * Math.PI / 180;
74
+ const x = centerX + radiusX * Math.cos(radians);
75
+ const y = centerY + radiusY * Math.sin(radians);
76
+ const twistAngle = twist ? angle + 90 : 90;
77
+ const segmentOpacity = 0.3 + 0.7 * (index / segments);
78
+ const segmentColor = secondaryColor && index % 2 === 0 ? secondaryColor : color;
79
+ return /* @__PURE__ */ jsxRuntime.jsx(
149
80
  "div",
150
81
  {
151
- className: "absolute inset-0",
82
+ className: "absolute",
152
83
  style: {
153
- backgroundColor: colors$1[5],
154
- transform: `translateY(${halfSize}) rotateX(-90deg)`,
155
- ...edgeStyle
84
+ width: ribbonWidth,
85
+ height: thickness,
86
+ backgroundColor: segmentColor,
87
+ borderRadius: thickness / 2,
88
+ left: x - ribbonWidth / 2,
89
+ top: y - thickness / 2,
90
+ transform: `rotate(${twistAngle}deg)`,
91
+ opacity: segmentOpacity,
92
+ animation: `mobius-segment ${durationNum}ms ease-in-out infinite`,
93
+ animationDelay: `${index / segments * durationNum}ms`
156
94
  }
157
- }
158
- )
159
- ]
95
+ },
96
+ index
97
+ );
98
+ })
160
99
  }
161
100
  )
162
101
  }
163
102
  );
164
103
  }
165
104
  );
166
- CubeSpinner.displayName = "CubeSpinner";
167
- exports.CubeSpinner = CubeSpinner;
105
+ MobiusLoader.displayName = "MobiusLoader";
106
+ exports.MobiusLoader = MobiusLoader;
package/dist/index49.js CHANGED
@@ -1,17 +1,17 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index64.js";
4
- import { cn } from "./index3.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index71.js";
5
4
  import { normalizeSize } from "./index4.js";
6
- const CubeSpinner = forwardRef(
5
+ import { cn } from "./index3.js";
6
+ const MobiusLoader = forwardRef(
7
7
  ({
8
8
  size = "md",
9
9
  color = "#3b82f6",
10
- faceColors,
11
- rotationAxis = "diagonal",
12
- perspective = 600,
13
- showEdges = false,
14
- edgeColor = "#000000",
10
+ secondaryColor,
11
+ thickness = 2,
12
+ segments = 6,
13
+ twist = true,
14
+ ribbonWidth = 8,
15
15
  speed = "normal",
16
16
  reverse = false,
17
17
  respectMotionPreference = true,
@@ -20,7 +20,7 @@ const CubeSpinner = forwardRef(
20
20
  transition,
21
21
  className,
22
22
  style,
23
- testId = "cube-spinner",
23
+ testId = "mobius-loader",
24
24
  visible = true,
25
25
  ariaLabel = "Loading...",
26
26
  ...rest
@@ -34,32 +34,13 @@ const CubeSpinner = forwardRef(
34
34
  transition
35
35
  );
36
36
  if (!shouldRender) return null;
37
- const cubeSize = normalizeSize(size);
38
- const halfSize = `calc(${cubeSize} / 2)`;
39
- const defaultFaceColors = [
40
- color,
41
- // front
42
- color,
43
- // back
44
- color,
45
- // right
46
- color,
47
- // left
48
- color,
49
- // top
50
- color
51
- // bottom
52
- ];
53
- const colors = faceColors && faceColors.length === 6 ? faceColors : defaultFaceColors;
54
- const animationClass = {
55
- x: "animate-cube-rotate-x",
56
- y: "animate-cube-rotate-y",
57
- z: "animate-cube-rotate-z",
58
- diagonal: "animate-cube-rotate-diagonal"
59
- }[rotationAxis];
60
- const edgeStyle = showEdges ? {
61
- border: `1px solid ${edgeColor}`
62
- } : {};
37
+ const normalizedSize = normalizeSize(size);
38
+ const sizeNum = parseInt(normalizedSize, 10);
39
+ const durationNum = parseInt(effectiveDuration, 10);
40
+ const centerX = sizeNum / 2;
41
+ const centerY = sizeNum / 2;
42
+ const radiusX = (sizeNum - ribbonWidth) / 2;
43
+ const radiusY = (sizeNum - ribbonWidth) / 3;
63
44
  return /* @__PURE__ */ jsx(
64
45
  "div",
65
46
  {
@@ -67,101 +48,59 @@ const CubeSpinner = forwardRef(
67
48
  "data-testid": testId,
68
49
  className: cn("inline-flex items-center justify-center", className),
69
50
  style: {
70
- ...style,
51
+ width: normalizedSize,
52
+ height: normalizedSize,
71
53
  opacity,
72
54
  transition: transitionStyle,
73
- perspective: `${perspective}px`
55
+ ...style
74
56
  },
75
57
  role: "status",
76
58
  "aria-label": ariaLabel,
77
59
  "aria-busy": "true",
78
60
  ...rest,
79
- children: /* @__PURE__ */ jsxs(
61
+ children: /* @__PURE__ */ jsx(
80
62
  "div",
81
63
  {
82
- className: cn("relative", animationClass),
64
+ className: "relative w-full h-full",
83
65
  style: {
84
- width: cubeSize,
85
- height: cubeSize,
86
- transformStyle: "preserve-3d",
87
- animationDuration: effectiveDuration,
66
+ animation: `mobius-rotate ${durationNum}ms linear infinite`,
88
67
  animationDirection: reverse ? "reverse" : "normal"
89
68
  },
90
- children: [
91
- /* @__PURE__ */ jsx(
92
- "div",
93
- {
94
- className: "absolute inset-0",
95
- style: {
96
- backgroundColor: colors[0],
97
- transform: `translateZ(${halfSize})`,
98
- ...edgeStyle
99
- }
100
- }
101
- ),
102
- /* @__PURE__ */ jsx(
103
- "div",
104
- {
105
- className: "absolute inset-0",
106
- style: {
107
- backgroundColor: colors[1],
108
- transform: `translateZ(calc(-${halfSize})) rotateY(180deg)`,
109
- ...edgeStyle
110
- }
111
- }
112
- ),
113
- /* @__PURE__ */ jsx(
114
- "div",
115
- {
116
- className: "absolute inset-0",
117
- style: {
118
- backgroundColor: colors[2],
119
- transform: `translateX(${halfSize}) rotateY(90deg)`,
120
- ...edgeStyle
121
- }
122
- }
123
- ),
124
- /* @__PURE__ */ jsx(
125
- "div",
126
- {
127
- className: "absolute inset-0",
128
- style: {
129
- backgroundColor: colors[3],
130
- transform: `translateX(calc(-${halfSize})) rotateY(-90deg)`,
131
- ...edgeStyle
132
- }
133
- }
134
- ),
135
- /* @__PURE__ */ jsx(
136
- "div",
137
- {
138
- className: "absolute inset-0",
139
- style: {
140
- backgroundColor: colors[4],
141
- transform: `translateY(calc(-${halfSize})) rotateX(90deg)`,
142
- ...edgeStyle
143
- }
144
- }
145
- ),
146
- /* @__PURE__ */ jsx(
69
+ children: Array.from({ length: segments }, (_, index) => {
70
+ const angle = 360 / segments * index;
71
+ const radians = angle * Math.PI / 180;
72
+ const x = centerX + radiusX * Math.cos(radians);
73
+ const y = centerY + radiusY * Math.sin(radians);
74
+ const twistAngle = twist ? angle + 90 : 90;
75
+ const segmentOpacity = 0.3 + 0.7 * (index / segments);
76
+ const segmentColor = secondaryColor && index % 2 === 0 ? secondaryColor : color;
77
+ return /* @__PURE__ */ jsx(
147
78
  "div",
148
79
  {
149
- className: "absolute inset-0",
80
+ className: "absolute",
150
81
  style: {
151
- backgroundColor: colors[5],
152
- transform: `translateY(${halfSize}) rotateX(-90deg)`,
153
- ...edgeStyle
82
+ width: ribbonWidth,
83
+ height: thickness,
84
+ backgroundColor: segmentColor,
85
+ borderRadius: thickness / 2,
86
+ left: x - ribbonWidth / 2,
87
+ top: y - thickness / 2,
88
+ transform: `rotate(${twistAngle}deg)`,
89
+ opacity: segmentOpacity,
90
+ animation: `mobius-segment ${durationNum}ms ease-in-out infinite`,
91
+ animationDelay: `${index / segments * durationNum}ms`
154
92
  }
155
- }
156
- )
157
- ]
93
+ },
94
+ index
95
+ );
96
+ })
158
97
  }
159
98
  )
160
99
  }
161
100
  );
162
101
  }
163
102
  );
164
- CubeSpinner.displayName = "CubeSpinner";
103
+ MobiusLoader.displayName = "MobiusLoader";
165
104
  export {
166
- CubeSpinner
105
+ MobiusLoader
167
106
  };
package/dist/index50.cjs CHANGED
@@ -2,40 +2,32 @@
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("./index64.cjs");
5
+ const hooks = require("./index71.cjs");
6
6
  const classNames = require("./index3.cjs");
7
- const colors = require("./index4.cjs");
8
- const FlipCard = react.forwardRef(
7
+ const LoadingText = react.forwardRef(
9
8
  ({
10
- size = "md",
11
- color = "#3b82f6",
12
- secondaryColor = "#8b5cf6",
13
- direction = "horizontal",
14
- frontColor,
15
- backColor,
16
- width,
17
- height,
18
- interval,
19
- perspective = 1e3,
9
+ text = "Loading",
10
+ animation = "dots",
11
+ fontSize = 16,
12
+ fontWeight = 500,
13
+ color = "#374151",
14
+ dotCount = 3,
15
+ showEllipsis = true,
16
+ textClassName,
20
17
  speed = "normal",
21
- reverse = false,
22
18
  respectMotionPreference = true,
23
19
  delay = 0,
24
20
  minDuration = 0,
25
21
  transition,
26
22
  className,
27
23
  style,
28
- testId = "flip-card",
24
+ testId = "loading-text",
29
25
  visible = true,
30
- ariaLabel = "Loading...",
26
+ ariaLabel,
31
27
  ...rest
32
28
  }, ref) => {
33
29
  const prefersReducedMotion = hooks.useReducedMotion();
34
- const effectiveDuration = hooks.getEffectiveDuration(
35
- interval !== void 0 ? interval : speed,
36
- respectMotionPreference,
37
- prefersReducedMotion
38
- );
30
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
39
31
  const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
40
32
  visible,
41
33
  delay,
@@ -43,62 +35,118 @@ const FlipCard = react.forwardRef(
43
35
  transition
44
36
  );
45
37
  if (!shouldRender) return null;
46
- const cardWidth = width ? colors.normalizeSize(width) : colors.normalizeSize(size);
47
- const cardHeight = height ? colors.normalizeSize(height) : `calc(${colors.normalizeSize(size)} * 0.6)`;
48
- const front = frontColor || color;
49
- const back = backColor || secondaryColor;
50
- const animationClass = direction === "horizontal" ? "animate-flip-card-horizontal" : "animate-flip-card-vertical";
38
+ const durationNum = parseInt(effectiveDuration, 10);
39
+ const normalizedFontSize = typeof fontSize === "number" ? `${fontSize}px` : fontSize;
40
+ const renderDots = () => {
41
+ if (!showEllipsis) return null;
42
+ switch (animation) {
43
+ case "dots":
44
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex", children: Array.from({ length: dotCount }, (_, index) => /* @__PURE__ */ jsxRuntime.jsx(
45
+ "span",
46
+ {
47
+ style: {
48
+ animation: `loading-text-dot ${durationNum}ms ease-in-out infinite`,
49
+ animationDelay: `${index * (durationNum / dotCount / 2)}ms`
50
+ },
51
+ children: "."
52
+ },
53
+ index
54
+ )) });
55
+ case "fade":
56
+ return /* @__PURE__ */ jsxRuntime.jsx(
57
+ "span",
58
+ {
59
+ style: {
60
+ animation: `loading-text-fade ${durationNum}ms ease-in-out infinite`
61
+ },
62
+ children: "..."
63
+ }
64
+ );
65
+ case "bounce":
66
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex", children: Array.from({ length: dotCount }, (_, index) => /* @__PURE__ */ jsxRuntime.jsx(
67
+ "span",
68
+ {
69
+ className: "inline-block",
70
+ style: {
71
+ animation: `loading-text-bounce ${durationNum}ms ease-in-out infinite`,
72
+ animationDelay: `${index * (durationNum / dotCount / 2)}ms`
73
+ },
74
+ children: "."
75
+ },
76
+ index
77
+ )) });
78
+ case "wave":
79
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex", children: Array.from({ length: dotCount }, (_, index) => /* @__PURE__ */ jsxRuntime.jsx(
80
+ "span",
81
+ {
82
+ className: "inline-block",
83
+ style: {
84
+ animation: `loading-text-wave ${durationNum}ms ease-in-out infinite`,
85
+ animationDelay: `${index * (durationNum / dotCount / 1.5)}ms`
86
+ },
87
+ children: "."
88
+ },
89
+ index
90
+ )) });
91
+ default:
92
+ return "...";
93
+ }
94
+ };
95
+ const renderText = () => {
96
+ if (animation === "wave" || animation === "bounce") {
97
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: text.split("").map((char, index) => /* @__PURE__ */ jsxRuntime.jsx(
98
+ "span",
99
+ {
100
+ className: "inline-block",
101
+ style: {
102
+ animation: `loading-text-${animation} ${durationNum}ms ease-in-out infinite`,
103
+ animationDelay: `${index * 50}ms`
104
+ },
105
+ children: char === " " ? " " : char
106
+ },
107
+ index
108
+ )) });
109
+ }
110
+ if (animation === "fade") {
111
+ return /* @__PURE__ */ jsxRuntime.jsx(
112
+ "span",
113
+ {
114
+ style: {
115
+ animation: `loading-text-fade ${durationNum}ms ease-in-out infinite`
116
+ },
117
+ children: text
118
+ }
119
+ );
120
+ }
121
+ return text;
122
+ };
51
123
  return /* @__PURE__ */ jsxRuntime.jsx(
52
124
  "div",
53
125
  {
54
126
  ref,
55
127
  "data-testid": testId,
56
- className: classNames.cn("inline-flex items-center justify-center", className),
128
+ className: classNames.cn("inline-flex items-center", className),
57
129
  style: {
58
- ...style,
59
130
  opacity,
60
131
  transition: transitionStyle,
61
- perspective: `${perspective}px`
132
+ ...style
62
133
  },
63
134
  role: "status",
64
- "aria-label": ariaLabel,
135
+ "aria-label": ariaLabel || `${text}...`,
65
136
  "aria-busy": "true",
66
137
  ...rest,
67
138
  children: /* @__PURE__ */ jsxRuntime.jsxs(
68
- "div",
139
+ "span",
69
140
  {
70
- className: classNames.cn("relative", animationClass),
141
+ className: classNames.cn("inline-flex items-baseline", textClassName),
71
142
  style: {
72
- width: cardWidth,
73
- height: cardHeight,
74
- transformStyle: "preserve-3d",
75
- animationDuration: effectiveDuration,
76
- animationDirection: reverse ? "reverse" : "normal"
143
+ fontSize: normalizedFontSize,
144
+ fontWeight,
145
+ color
77
146
  },
78
147
  children: [
79
- /* @__PURE__ */ jsxRuntime.jsx(
80
- "div",
81
- {
82
- className: "absolute inset-0 rounded-md flex items-center justify-center",
83
- style: {
84
- backgroundColor: front,
85
- backfaceVisibility: "hidden",
86
- WebkitBackfaceVisibility: "hidden"
87
- }
88
- }
89
- ),
90
- /* @__PURE__ */ jsxRuntime.jsx(
91
- "div",
92
- {
93
- className: "absolute inset-0 rounded-md flex items-center justify-center",
94
- style: {
95
- backgroundColor: back,
96
- backfaceVisibility: "hidden",
97
- WebkitBackfaceVisibility: "hidden",
98
- transform: direction === "horizontal" ? "rotateY(180deg)" : "rotateX(180deg)"
99
- }
100
- }
101
- )
148
+ renderText(),
149
+ renderDots()
102
150
  ]
103
151
  }
104
152
  )
@@ -106,5 +154,5 @@ const FlipCard = react.forwardRef(
106
154
  );
107
155
  }
108
156
  );
109
- FlipCard.displayName = "FlipCard";
110
- exports.FlipCard = FlipCard;
157
+ LoadingText.displayName = "LoadingText";
158
+ exports.LoadingText = LoadingText;