premium-react-loaders 2.3.1 → 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.
Files changed (195) hide show
  1. package/README.md +87 -3
  2. package/dist/components/3d/CubeSpinner.d.ts +21 -0
  3. package/dist/components/3d/CubeSpinner.d.ts.map +1 -0
  4. package/dist/components/3d/FlipCard.d.ts +21 -0
  5. package/dist/components/3d/FlipCard.d.ts.map +1 -0
  6. package/dist/components/3d/Helix.d.ts +23 -0
  7. package/dist/components/3d/Helix.d.ts.map +1 -0
  8. package/dist/components/3d/PerspectiveRing.d.ts +21 -0
  9. package/dist/components/3d/PerspectiveRing.d.ts.map +1 -0
  10. package/dist/components/3d/PlaneRotate.d.ts +21 -0
  11. package/dist/components/3d/PlaneRotate.d.ts.map +1 -0
  12. package/dist/components/3d/index.d.ts +6 -0
  13. package/dist/components/3d/index.d.ts.map +1 -0
  14. package/dist/components/accessibility/LiveRegion.d.ts +34 -0
  15. package/dist/components/accessibility/LiveRegion.d.ts.map +1 -0
  16. package/dist/components/accessibility/index.d.ts +2 -0
  17. package/dist/components/accessibility/index.d.ts.map +1 -0
  18. package/dist/components/bounce/BouncingBalls.d.ts +15 -0
  19. package/dist/components/bounce/BouncingBalls.d.ts.map +1 -0
  20. package/dist/components/bounce/BouncingDots.d.ts +15 -0
  21. package/dist/components/bounce/BouncingDots.d.ts.map +1 -0
  22. package/dist/components/bounce/index.d.ts +3 -0
  23. package/dist/components/bounce/index.d.ts.map +1 -0
  24. package/dist/components/index.d.ts +8 -0
  25. package/dist/components/index.d.ts.map +1 -1
  26. package/dist/components/infinity/InfinityLoader.d.ts +15 -0
  27. package/dist/components/infinity/InfinityLoader.d.ts.map +1 -0
  28. package/dist/components/infinity/MobiusLoader.d.ts +15 -0
  29. package/dist/components/infinity/MobiusLoader.d.ts.map +1 -0
  30. package/dist/components/infinity/index.d.ts +3 -0
  31. package/dist/components/infinity/index.d.ts.map +1 -0
  32. package/dist/components/orbit/AtomLoader.d.ts +15 -0
  33. package/dist/components/orbit/AtomLoader.d.ts.map +1 -0
  34. package/dist/components/orbit/OrbitDots.d.ts +15 -0
  35. package/dist/components/orbit/OrbitDots.d.ts.map +1 -0
  36. package/dist/components/orbit/OrbitRings.d.ts +15 -0
  37. package/dist/components/orbit/OrbitRings.d.ts.map +1 -0
  38. package/dist/components/orbit/index.d.ts +4 -0
  39. package/dist/components/orbit/index.d.ts.map +1 -0
  40. package/dist/components/shimmer/ShimmerBox.d.ts +15 -0
  41. package/dist/components/shimmer/ShimmerBox.d.ts.map +1 -0
  42. package/dist/components/shimmer/ShimmerButton.d.ts +15 -0
  43. package/dist/components/shimmer/ShimmerButton.d.ts.map +1 -0
  44. package/dist/components/shimmer/ShimmerText.d.ts +15 -0
  45. package/dist/components/shimmer/ShimmerText.d.ts.map +1 -0
  46. package/dist/components/shimmer/index.d.ts +4 -0
  47. package/dist/components/shimmer/index.d.ts.map +1 -0
  48. package/dist/components/skeleton/DataTableSkeleton.d.ts +25 -0
  49. package/dist/components/skeleton/DataTableSkeleton.d.ts.map +1 -0
  50. package/dist/components/skeleton/SmartSkeleton.d.ts +23 -0
  51. package/dist/components/skeleton/SmartSkeleton.d.ts.map +1 -0
  52. package/dist/components/skeleton/index.d.ts +2 -0
  53. package/dist/components/skeleton/index.d.ts.map +1 -1
  54. package/dist/components/smart/FormFieldLoader.d.ts +22 -0
  55. package/dist/components/smart/FormFieldLoader.d.ts.map +1 -0
  56. package/dist/components/smart/index.d.ts +2 -0
  57. package/dist/components/smart/index.d.ts.map +1 -0
  58. package/dist/components/text/LoadingText.d.ts +16 -0
  59. package/dist/components/text/LoadingText.d.ts.map +1 -0
  60. package/dist/components/text/index.d.ts +2 -0
  61. package/dist/components/text/index.d.ts.map +1 -0
  62. package/dist/hooks/index.d.ts +6 -0
  63. package/dist/hooks/index.d.ts.map +1 -1
  64. package/dist/hooks/useLoadingAnalytics.d.ts +101 -0
  65. package/dist/hooks/useLoadingAnalytics.d.ts.map +1 -0
  66. package/dist/hooks/useLoadingOrchestrator.d.ts +104 -0
  67. package/dist/hooks/useLoadingOrchestrator.d.ts.map +1 -0
  68. package/dist/hooks/useSmartLoader.d.ts +98 -0
  69. package/dist/hooks/useSmartLoader.d.ts.map +1 -0
  70. package/dist/index.cjs +60 -20
  71. package/dist/index.js +60 -20
  72. package/dist/index10.cjs +1 -1
  73. package/dist/index10.js +1 -1
  74. package/dist/index11.cjs +1 -1
  75. package/dist/index11.js +1 -1
  76. package/dist/index12.cjs +1 -1
  77. package/dist/index12.js +1 -1
  78. package/dist/index13.cjs +1 -1
  79. package/dist/index13.js +1 -1
  80. package/dist/index14.cjs +1 -1
  81. package/dist/index14.js +1 -1
  82. package/dist/index15.cjs +1 -1
  83. package/dist/index15.js +1 -1
  84. package/dist/index16.cjs +131 -66
  85. package/dist/index16.js +132 -67
  86. package/dist/index17.cjs +245 -30
  87. package/dist/index17.js +246 -31
  88. package/dist/index18.cjs +24 -36
  89. package/dist/index18.js +24 -36
  90. package/dist/index19.cjs +19 -21
  91. package/dist/index19.js +19 -21
  92. package/dist/index20.cjs +25 -20
  93. package/dist/index20.js +25 -20
  94. package/dist/index21.cjs +22 -32
  95. package/dist/index21.js +22 -32
  96. package/dist/index22.cjs +26 -35
  97. package/dist/index22.js +28 -37
  98. package/dist/index23.cjs +40 -76
  99. package/dist/index23.js +42 -78
  100. package/dist/index24.cjs +53 -102
  101. package/dist/index24.js +54 -103
  102. package/dist/index25.cjs +46 -80
  103. package/dist/index25.js +47 -81
  104. package/dist/index26.cjs +105 -103
  105. package/dist/index26.js +107 -105
  106. package/dist/index27.cjs +108 -27
  107. package/dist/index27.js +111 -30
  108. package/dist/index28.cjs +104 -36
  109. package/dist/index28.js +106 -38
  110. package/dist/index29.cjs +22 -30
  111. package/dist/index29.js +23 -31
  112. package/dist/index30.cjs +30 -32
  113. package/dist/index30.js +31 -33
  114. package/dist/index31.cjs +49 -52
  115. package/dist/index31.js +50 -53
  116. package/dist/index32.cjs +37 -108
  117. package/dist/index32.js +38 -109
  118. package/dist/index33.cjs +54 -72
  119. package/dist/index33.js +55 -73
  120. package/dist/index34.cjs +112 -80
  121. package/dist/index34.js +112 -80
  122. package/dist/index35.cjs +78 -145
  123. package/dist/index35.js +80 -147
  124. package/dist/index36.cjs +112 -120
  125. package/dist/index36.js +113 -121
  126. package/dist/index37.cjs +167 -0
  127. package/dist/index37.js +167 -0
  128. package/dist/index38.cjs +96 -0
  129. package/dist/index38.js +96 -0
  130. package/dist/index39.cjs +113 -0
  131. package/dist/index39.js +113 -0
  132. package/dist/index40.cjs +169 -0
  133. package/dist/index40.js +169 -0
  134. package/dist/index41.cjs +97 -0
  135. package/dist/index41.js +97 -0
  136. package/dist/index42.cjs +90 -0
  137. package/dist/index42.js +90 -0
  138. package/dist/index43.cjs +139 -0
  139. package/dist/index43.js +139 -0
  140. package/dist/index44.cjs +82 -0
  141. package/dist/index44.js +82 -0
  142. package/dist/index45.cjs +110 -0
  143. package/dist/index45.js +110 -0
  144. package/dist/index46.cjs +135 -0
  145. package/dist/index46.js +135 -0
  146. package/dist/index47.cjs +106 -0
  147. package/dist/index47.js +106 -0
  148. package/dist/index48.cjs +158 -0
  149. package/dist/index48.js +158 -0
  150. package/dist/index49.cjs +167 -0
  151. package/dist/index49.js +167 -0
  152. package/dist/index50.cjs +110 -0
  153. package/dist/index50.js +110 -0
  154. package/dist/index51.cjs +112 -0
  155. package/dist/index51.js +112 -0
  156. package/dist/index52.cjs +144 -0
  157. package/dist/index52.js +144 -0
  158. package/dist/index53.cjs +112 -0
  159. package/dist/index53.js +112 -0
  160. package/dist/index54.cjs +189 -0
  161. package/dist/index54.js +189 -0
  162. package/dist/index55.cjs +53 -0
  163. package/dist/index55.js +53 -0
  164. package/dist/index56.cjs +125 -0
  165. package/dist/index56.js +125 -0
  166. package/dist/index7.cjs +1 -1
  167. package/dist/index7.js +1 -1
  168. package/dist/index8.cjs +1 -1
  169. package/dist/index8.js +1 -1
  170. package/dist/index9.cjs +1 -1
  171. package/dist/index9.js +1 -1
  172. package/dist/premium-react-loaders.css +357 -0
  173. package/dist/types/3d.d.ts +85 -0
  174. package/dist/types/3d.d.ts.map +1 -0
  175. package/dist/types/accessibility.d.ts +35 -0
  176. package/dist/types/accessibility.d.ts.map +1 -0
  177. package/dist/types/bounce.d.ts +41 -0
  178. package/dist/types/bounce.d.ts.map +1 -0
  179. package/dist/types/index.d.ts +8 -0
  180. package/dist/types/index.d.ts.map +1 -1
  181. package/dist/types/infinity.d.ts +35 -0
  182. package/dist/types/infinity.d.ts.map +1 -0
  183. package/dist/types/orbit.d.ts +50 -0
  184. package/dist/types/orbit.d.ts.map +1 -0
  185. package/dist/types/shimmer.d.ts +52 -0
  186. package/dist/types/shimmer.d.ts.map +1 -0
  187. package/dist/types/smart.d.ts +63 -0
  188. package/dist/types/smart.d.ts.map +1 -0
  189. package/dist/types/text.d.ts +27 -0
  190. package/dist/types/text.d.ts.map +1 -0
  191. package/dist/utils/accessibility.d.ts +67 -0
  192. package/dist/utils/accessibility.d.ts.map +1 -0
  193. package/dist/utils/index.d.ts +1 -0
  194. package/dist/utils/index.d.ts.map +1 -1
  195. package/package.json +1 -1
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const react = require("react");
5
+ const hooks = require("./index56.cjs");
6
+ const classNames = require("./index3.cjs");
7
+ const ShimmerButton = react.forwardRef(
8
+ ({
9
+ width = 120,
10
+ height = 40,
11
+ borderRadius = 8,
12
+ baseColor = "#e5e7eb",
13
+ highlightColor = "#f3f4f6",
14
+ direction = "left-to-right",
15
+ variant = "solid",
16
+ showIcon = false,
17
+ iconPosition = "left",
18
+ speed = "normal",
19
+ respectMotionPreference = true,
20
+ delay = 0,
21
+ minDuration = 0,
22
+ transition,
23
+ className,
24
+ style,
25
+ testId = "shimmer-button",
26
+ visible = true,
27
+ ariaLabel = "Loading button...",
28
+ ...rest
29
+ }, ref) => {
30
+ const prefersReducedMotion = hooks.useReducedMotion();
31
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
32
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
33
+ visible,
34
+ delay,
35
+ minDuration,
36
+ transition
37
+ );
38
+ if (!shouldRender) return null;
39
+ const getAnimationName = () => {
40
+ switch (direction) {
41
+ case "right-to-left":
42
+ return "shimmer-rtl";
43
+ case "top-to-bottom":
44
+ return "shimmer-ttb";
45
+ case "bottom-to-top":
46
+ return "shimmer-btt";
47
+ default:
48
+ return "shimmer-ltr";
49
+ }
50
+ };
51
+ const getGradientDirection = () => {
52
+ switch (direction) {
53
+ case "right-to-left":
54
+ return "to left";
55
+ case "top-to-bottom":
56
+ return "to bottom";
57
+ case "bottom-to-top":
58
+ return "to top";
59
+ default:
60
+ return "to right";
61
+ }
62
+ };
63
+ const normalizedHeight = typeof height === "number" ? height : 40;
64
+ const iconSize = Math.floor(normalizedHeight * 0.5);
65
+ return /* @__PURE__ */ jsxRuntime.jsxs(
66
+ "div",
67
+ {
68
+ ref,
69
+ "data-testid": testId,
70
+ className: classNames.cn(
71
+ "relative overflow-hidden inline-flex items-center justify-center gap-2",
72
+ className
73
+ ),
74
+ style: {
75
+ width: typeof width === "number" ? `${width}px` : width,
76
+ height: typeof height === "number" ? `${height}px` : height,
77
+ borderRadius: typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius,
78
+ backgroundColor: variant === "solid" ? baseColor : "transparent",
79
+ border: variant === "outline" ? `2px solid ${baseColor}` : "none",
80
+ padding: "0 16px",
81
+ opacity,
82
+ transition: transitionStyle,
83
+ ...style
84
+ },
85
+ role: "status",
86
+ "aria-label": ariaLabel,
87
+ "aria-busy": "true",
88
+ ...rest,
89
+ children: [
90
+ showIcon && iconPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx(
91
+ "div",
92
+ {
93
+ className: "relative overflow-hidden rounded-full flex-shrink-0",
94
+ style: {
95
+ width: iconSize,
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
+ }
161
+ }
162
+ )
163
+ ]
164
+ }
165
+ );
166
+ }
167
+ );
168
+ ShimmerButton.displayName = "ShimmerButton";
169
+ exports.ShimmerButton = ShimmerButton;
@@ -0,0 +1,169 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index56.js";
4
+ import { cn } from "./index3.js";
5
+ const ShimmerButton = forwardRef(
6
+ ({
7
+ width = 120,
8
+ height = 40,
9
+ borderRadius = 8,
10
+ baseColor = "#e5e7eb",
11
+ highlightColor = "#f3f4f6",
12
+ direction = "left-to-right",
13
+ variant = "solid",
14
+ showIcon = false,
15
+ iconPosition = "left",
16
+ speed = "normal",
17
+ respectMotionPreference = true,
18
+ delay = 0,
19
+ minDuration = 0,
20
+ transition,
21
+ className,
22
+ style,
23
+ testId = "shimmer-button",
24
+ visible = true,
25
+ ariaLabel = "Loading button...",
26
+ ...rest
27
+ }, ref) => {
28
+ const prefersReducedMotion = useReducedMotion();
29
+ const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
30
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
31
+ visible,
32
+ delay,
33
+ minDuration,
34
+ transition
35
+ );
36
+ if (!shouldRender) return null;
37
+ const getAnimationName = () => {
38
+ switch (direction) {
39
+ case "right-to-left":
40
+ return "shimmer-rtl";
41
+ case "top-to-bottom":
42
+ return "shimmer-ttb";
43
+ case "bottom-to-top":
44
+ return "shimmer-btt";
45
+ default:
46
+ return "shimmer-ltr";
47
+ }
48
+ };
49
+ const getGradientDirection = () => {
50
+ switch (direction) {
51
+ case "right-to-left":
52
+ return "to left";
53
+ case "top-to-bottom":
54
+ return "to bottom";
55
+ case "bottom-to-top":
56
+ return "to top";
57
+ default:
58
+ return "to right";
59
+ }
60
+ };
61
+ const normalizedHeight = typeof height === "number" ? height : 40;
62
+ const iconSize = Math.floor(normalizedHeight * 0.5);
63
+ return /* @__PURE__ */ jsxs(
64
+ "div",
65
+ {
66
+ ref,
67
+ "data-testid": testId,
68
+ className: cn(
69
+ "relative overflow-hidden inline-flex items-center justify-center gap-2",
70
+ className
71
+ ),
72
+ style: {
73
+ width: typeof width === "number" ? `${width}px` : width,
74
+ height: typeof height === "number" ? `${height}px` : height,
75
+ borderRadius: typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius,
76
+ backgroundColor: variant === "solid" ? baseColor : "transparent",
77
+ border: variant === "outline" ? `2px solid ${baseColor}` : "none",
78
+ padding: "0 16px",
79
+ opacity,
80
+ transition: transitionStyle,
81
+ ...style
82
+ },
83
+ role: "status",
84
+ "aria-label": ariaLabel,
85
+ "aria-busy": "true",
86
+ ...rest,
87
+ children: [
88
+ showIcon && iconPosition === "left" && /* @__PURE__ */ jsx(
89
+ "div",
90
+ {
91
+ className: "relative overflow-hidden rounded-full flex-shrink-0",
92
+ style: {
93
+ width: iconSize,
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
+ }
159
+ }
160
+ )
161
+ ]
162
+ }
163
+ );
164
+ }
165
+ );
166
+ ShimmerButton.displayName = "ShimmerButton";
167
+ export {
168
+ ShimmerButton
169
+ };
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const react = require("react");
5
+ const hooks = require("./index56.cjs");
6
+ const colors = require("./index4.cjs");
7
+ const classNames = require("./index3.cjs");
8
+ const OrbitDots = react.forwardRef(
9
+ ({
10
+ size = "md",
11
+ color = "#3b82f6",
12
+ secondaryColor,
13
+ dotCount = 4,
14
+ dotSize = 8,
15
+ orbitRadius = 0.4,
16
+ stagger = true,
17
+ speed = "normal",
18
+ reverse = false,
19
+ respectMotionPreference = true,
20
+ delay = 0,
21
+ minDuration = 0,
22
+ transition,
23
+ className,
24
+ style,
25
+ testId = "orbit-dots",
26
+ visible = true,
27
+ ariaLabel = "Loading...",
28
+ ...rest
29
+ }, ref) => {
30
+ const prefersReducedMotion = hooks.useReducedMotion();
31
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
32
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
33
+ visible,
34
+ delay,
35
+ minDuration,
36
+ transition
37
+ );
38
+ if (!shouldRender) return null;
39
+ const normalizedSize = colors.normalizeSize(size);
40
+ const sizeNum = parseInt(normalizedSize, 10);
41
+ const radius = sizeNum * orbitRadius;
42
+ return /* @__PURE__ */ jsxRuntime.jsx(
43
+ "div",
44
+ {
45
+ ref,
46
+ "data-testid": testId,
47
+ className: classNames.cn("inline-flex items-center justify-center", className),
48
+ style: {
49
+ width: normalizedSize,
50
+ height: normalizedSize,
51
+ opacity,
52
+ transition: transitionStyle,
53
+ ...style
54
+ },
55
+ role: "status",
56
+ "aria-label": ariaLabel,
57
+ "aria-busy": "true",
58
+ ...rest,
59
+ children: /* @__PURE__ */ jsxRuntime.jsx(
60
+ "div",
61
+ {
62
+ className: "relative w-full h-full",
63
+ style: {
64
+ animation: `orbit-rotate ${effectiveDuration} linear infinite`,
65
+ animationDirection: reverse ? "reverse" : "normal"
66
+ },
67
+ children: Array.from({ length: dotCount }, (_, index) => {
68
+ const angle = 360 / dotCount * index;
69
+ const dotColor = secondaryColor && index % 2 === 1 ? secondaryColor : color;
70
+ const staggerDelay = stagger ? `${index / dotCount * 300}ms` : "0ms";
71
+ return /* @__PURE__ */ jsxRuntime.jsx(
72
+ "div",
73
+ {
74
+ className: "absolute rounded-full",
75
+ style: {
76
+ width: dotSize,
77
+ height: dotSize,
78
+ backgroundColor: dotColor,
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
85
+ }
86
+ },
87
+ index
88
+ );
89
+ })
90
+ }
91
+ )
92
+ }
93
+ );
94
+ }
95
+ );
96
+ OrbitDots.displayName = "OrbitDots";
97
+ exports.OrbitDots = OrbitDots;
@@ -0,0 +1,97 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index56.js";
4
+ import { normalizeSize } from "./index4.js";
5
+ import { cn } from "./index3.js";
6
+ const OrbitDots = forwardRef(
7
+ ({
8
+ size = "md",
9
+ color = "#3b82f6",
10
+ secondaryColor,
11
+ dotCount = 4,
12
+ dotSize = 8,
13
+ orbitRadius = 0.4,
14
+ stagger = true,
15
+ speed = "normal",
16
+ reverse = false,
17
+ respectMotionPreference = true,
18
+ delay = 0,
19
+ minDuration = 0,
20
+ transition,
21
+ className,
22
+ style,
23
+ testId = "orbit-dots",
24
+ visible = true,
25
+ ariaLabel = "Loading...",
26
+ ...rest
27
+ }, ref) => {
28
+ const prefersReducedMotion = useReducedMotion();
29
+ const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
30
+ const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
31
+ visible,
32
+ delay,
33
+ minDuration,
34
+ transition
35
+ );
36
+ if (!shouldRender) return null;
37
+ const normalizedSize = normalizeSize(size);
38
+ const sizeNum = parseInt(normalizedSize, 10);
39
+ const radius = sizeNum * orbitRadius;
40
+ return /* @__PURE__ */ jsx(
41
+ "div",
42
+ {
43
+ ref,
44
+ "data-testid": testId,
45
+ className: cn("inline-flex items-center justify-center", className),
46
+ style: {
47
+ width: normalizedSize,
48
+ height: normalizedSize,
49
+ opacity,
50
+ transition: transitionStyle,
51
+ ...style
52
+ },
53
+ role: "status",
54
+ "aria-label": ariaLabel,
55
+ "aria-busy": "true",
56
+ ...rest,
57
+ children: /* @__PURE__ */ jsx(
58
+ "div",
59
+ {
60
+ className: "relative w-full h-full",
61
+ style: {
62
+ animation: `orbit-rotate ${effectiveDuration} linear infinite`,
63
+ animationDirection: reverse ? "reverse" : "normal"
64
+ },
65
+ children: Array.from({ length: dotCount }, (_, index) => {
66
+ const angle = 360 / dotCount * index;
67
+ const dotColor = secondaryColor && index % 2 === 1 ? secondaryColor : color;
68
+ const staggerDelay = stagger ? `${index / dotCount * 300}ms` : "0ms";
69
+ return /* @__PURE__ */ jsx(
70
+ "div",
71
+ {
72
+ className: "absolute rounded-full",
73
+ style: {
74
+ width: dotSize,
75
+ height: dotSize,
76
+ backgroundColor: dotColor,
77
+ left: "50%",
78
+ top: "50%",
79
+ transform: `translate(-50%, -50%) rotate(${angle}deg) translateX(${radius}px)`,
80
+ opacity: stagger ? void 0 : 1,
81
+ animation: stagger ? `orbit-dot-pulse 1s ease-in-out infinite` : void 0,
82
+ animationDelay: staggerDelay
83
+ }
84
+ },
85
+ index
86
+ );
87
+ })
88
+ }
89
+ )
90
+ }
91
+ );
92
+ }
93
+ );
94
+ OrbitDots.displayName = "OrbitDots";
95
+ export {
96
+ OrbitDots
97
+ };
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const react = require("react");
5
+ const hooks = require("./index56.cjs");
6
+ const colors = require("./index4.cjs");
7
+ const classNames = require("./index3.cjs");
8
+ const OrbitRings = react.forwardRef(
9
+ ({
10
+ size = "md",
11
+ color = "#3b82f6",
12
+ secondaryColor,
13
+ thickness = 2,
14
+ ringCount = 3,
15
+ ringGap = 6,
16
+ alternate = true,
17
+ speed = "normal",
18
+ reverse = false,
19
+ respectMotionPreference = true,
20
+ delay = 0,
21
+ minDuration = 0,
22
+ transition,
23
+ className,
24
+ style,
25
+ testId = "orbit-rings",
26
+ visible = true,
27
+ ariaLabel = "Loading...",
28
+ ...rest
29
+ }, ref) => {
30
+ const prefersReducedMotion = hooks.useReducedMotion();
31
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
32
+ const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
33
+ visible,
34
+ delay,
35
+ minDuration,
36
+ transition
37
+ );
38
+ if (!shouldRender) return null;
39
+ const normalizedSize = colors.normalizeSize(size);
40
+ const sizeNum = parseInt(normalizedSize, 10);
41
+ const durationNum = parseInt(effectiveDuration, 10);
42
+ return /* @__PURE__ */ jsxRuntime.jsx(
43
+ "div",
44
+ {
45
+ ref,
46
+ "data-testid": testId,
47
+ className: classNames.cn("inline-flex items-center justify-center", className),
48
+ style: {
49
+ width: normalizedSize,
50
+ height: normalizedSize,
51
+ opacity,
52
+ transition: transitionStyle,
53
+ ...style
54
+ },
55
+ role: "status",
56
+ "aria-label": ariaLabel,
57
+ "aria-busy": "true",
58
+ ...rest,
59
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full h-full", children: Array.from({ length: ringCount }, (_, index) => {
60
+ const ringSize = sizeNum - index * (ringGap + thickness) * 2;
61
+ if (ringSize <= 0) return null;
62
+ const ringColor = secondaryColor && index % 2 === 1 ? secondaryColor : color;
63
+ const shouldReverse = alternate ? index % 2 === 1 !== reverse : reverse;
64
+ const ringDuration = durationNum + index * 200;
65
+ return /* @__PURE__ */ jsxRuntime.jsx(
66
+ "div",
67
+ {
68
+ className: "absolute rounded-full",
69
+ style: {
70
+ width: ringSize,
71
+ height: ringSize,
72
+ left: "50%",
73
+ top: "50%",
74
+ transform: "translate(-50%, -50%)",
75
+ border: `${thickness}px solid transparent`,
76
+ borderTopColor: ringColor,
77
+ borderRightColor: ringColor,
78
+ animation: `orbit-rotate ${ringDuration}ms linear infinite`,
79
+ animationDirection: shouldReverse ? "reverse" : "normal"
80
+ }
81
+ },
82
+ index
83
+ );
84
+ }) })
85
+ }
86
+ );
87
+ }
88
+ );
89
+ OrbitRings.displayName = "OrbitRings";
90
+ exports.OrbitRings = OrbitRings;