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
package/dist/index17.cjs CHANGED
@@ -2,30 +2,36 @@
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("./index36.cjs");
5
+ const Skeleton = require("./index7.cjs");
6
+ const hooks = require("./index56.cjs");
6
7
  const classNames = require("./index3.cjs");
7
- const colors = require("./index4.cjs");
8
- const SpinnerRing = react.forwardRef(
8
+ const DataTableSkeleton = react.forwardRef(
9
9
  ({
10
- size = "md",
11
- color = "#3b82f6",
12
- secondaryColor = "rgba(0, 0, 0, 0.1)",
13
- thickness = 4,
14
- speed = "normal",
15
- reverse = false,
16
- respectMotionPreference = true,
10
+ rows = 5,
11
+ columns = 4,
12
+ showHeader = true,
13
+ showSortIndicators = false,
14
+ showFilters = false,
15
+ showPagination = false,
16
+ showSelection = false,
17
+ showActions = false,
18
+ columnWidths,
19
+ rowHeight = 48,
20
+ striped = false,
21
+ width = "100%",
22
+ animate = true,
23
+ baseColor,
24
+ highlightColor,
17
25
  delay = 0,
18
26
  minDuration = 0,
19
27
  transition,
20
28
  className,
21
29
  style,
22
- testId = "spinner-ring",
30
+ testId = "data-table-skeleton",
23
31
  visible = true,
24
- ariaLabel = "Loading...",
32
+ ariaLabel = "Loading table...",
25
33
  ...rest
26
34
  }, ref) => {
27
- const prefersReducedMotion = hooks.useReducedMotion();
28
- const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
29
35
  const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
30
36
  visible,
31
37
  delay,
@@ -33,14 +39,22 @@ const SpinnerRing = react.forwardRef(
33
39
  transition
34
40
  );
35
41
  if (!shouldRender) return null;
42
+ const getColumnWidth = (index) => {
43
+ if (columnWidths && columnWidths[index]) {
44
+ const width2 = columnWidths[index];
45
+ return typeof width2 === "number" ? `${width2}px` : width2 === "auto" ? "auto" : width2;
46
+ }
47
+ return "auto";
48
+ };
36
49
  return /* @__PURE__ */ jsxRuntime.jsx(
37
50
  "div",
38
51
  {
39
52
  ref,
40
53
  "data-testid": testId,
41
- className: classNames.cn("inline-flex items-center justify-center", className),
54
+ className: classNames.cn("w-full", className),
42
55
  style: {
43
56
  ...style,
57
+ width,
44
58
  opacity,
45
59
  transition: transitionStyle
46
60
  },
@@ -48,23 +62,224 @@ const SpinnerRing = react.forwardRef(
48
62
  "aria-label": ariaLabel,
49
63
  "aria-busy": "true",
50
64
  ...rest,
51
- children: /* @__PURE__ */ jsxRuntime.jsx(
52
- "div",
53
- {
54
- className: "rounded-full",
55
- style: {
56
- width: colors.normalizeSize(size),
57
- height: colors.normalizeSize(size),
58
- border: `${thickness}px solid ${secondaryColor}`,
59
- borderTopColor: color,
60
- animation: `spinner-rotate ${effectiveDuration} linear infinite`,
61
- animationDirection: reverse ? "reverse" : "normal"
65
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [
66
+ showHeader && /* @__PURE__ */ jsxRuntime.jsx(
67
+ "div",
68
+ {
69
+ className: "border-b border-gray-200",
70
+ style: {
71
+ backgroundColor: baseColor || "var(--skeleton-base, #f3f4f6)",
72
+ padding: "12px"
73
+ },
74
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
75
+ "div",
76
+ {
77
+ className: "grid gap-4",
78
+ style: {
79
+ gridTemplateColumns: [
80
+ showSelection && "40px",
81
+ ...Array.from({ length: columns }, (_, i) => getColumnWidth(i)),
82
+ showActions && "80px"
83
+ ].filter(Boolean).join(" ")
84
+ },
85
+ children: [
86
+ showSelection && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
87
+ Skeleton.Skeleton,
88
+ {
89
+ width: 18,
90
+ height: 18,
91
+ borderRadius: 3,
92
+ animate,
93
+ baseColor,
94
+ highlightColor
95
+ }
96
+ ) }),
97
+ Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
98
+ /* @__PURE__ */ jsxRuntime.jsx(
99
+ Skeleton.Skeleton,
100
+ {
101
+ width: "70%",
102
+ height: 16,
103
+ borderRadius: 4,
104
+ animate,
105
+ baseColor,
106
+ highlightColor
107
+ }
108
+ ),
109
+ showSortIndicators && /* @__PURE__ */ jsxRuntime.jsx(
110
+ Skeleton.Skeleton,
111
+ {
112
+ width: 12,
113
+ height: 12,
114
+ borderRadius: 2,
115
+ animate,
116
+ baseColor,
117
+ highlightColor
118
+ }
119
+ )
120
+ ] }, index)),
121
+ showActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
122
+ Skeleton.Skeleton,
123
+ {
124
+ width: 60,
125
+ height: 16,
126
+ borderRadius: 4,
127
+ animate,
128
+ baseColor,
129
+ highlightColor
130
+ }
131
+ ) })
132
+ ]
133
+ }
134
+ )
135
+ }
136
+ ),
137
+ showFilters && /* @__PURE__ */ jsxRuntime.jsx(
138
+ "div",
139
+ {
140
+ className: "border-b border-gray-200",
141
+ style: { padding: "8px 12px" },
142
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
143
+ "div",
144
+ {
145
+ className: "grid gap-4",
146
+ style: {
147
+ gridTemplateColumns: [
148
+ showSelection && "40px",
149
+ ...Array.from({ length: columns }, (_, i) => getColumnWidth(i)),
150
+ showActions && "80px"
151
+ ].filter(Boolean).join(" ")
152
+ },
153
+ children: [
154
+ showSelection && /* @__PURE__ */ jsxRuntime.jsx("div", {}),
155
+ Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
156
+ Skeleton.Skeleton,
157
+ {
158
+ width: "90%",
159
+ height: 28,
160
+ borderRadius: 4,
161
+ animate,
162
+ baseColor,
163
+ highlightColor
164
+ },
165
+ index
166
+ )),
167
+ showActions && /* @__PURE__ */ jsxRuntime.jsx("div", {})
168
+ ]
169
+ }
170
+ )
171
+ }
172
+ ),
173
+ Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(
174
+ "div",
175
+ {
176
+ className: classNames.cn(
177
+ "border-b border-gray-200 last:border-b-0",
178
+ striped && rowIndex % 2 === 1 && "bg-gray-50"
179
+ ),
180
+ style: { padding: "12px" },
181
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
182
+ "div",
183
+ {
184
+ className: "grid gap-4 items-center",
185
+ style: {
186
+ gridTemplateColumns: [
187
+ showSelection && "40px",
188
+ ...Array.from({ length: columns }, (_2, i) => getColumnWidth(i)),
189
+ showActions && "80px"
190
+ ].filter(Boolean).join(" "),
191
+ height: `${rowHeight - 24}px`
192
+ },
193
+ children: [
194
+ showSelection && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
195
+ Skeleton.Skeleton,
196
+ {
197
+ width: 18,
198
+ height: 18,
199
+ borderRadius: 3,
200
+ animate,
201
+ baseColor,
202
+ highlightColor
203
+ }
204
+ ) }),
205
+ Array.from({ length: columns }).map((_2, colIndex) => /* @__PURE__ */ jsxRuntime.jsx(
206
+ Skeleton.Skeleton,
207
+ {
208
+ width: colIndex === 0 ? "80%" : "60%",
209
+ height: 14,
210
+ borderRadius: 4,
211
+ animate,
212
+ baseColor,
213
+ highlightColor
214
+ },
215
+ colIndex
216
+ )),
217
+ showActions && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2", children: [
218
+ /* @__PURE__ */ jsxRuntime.jsx(
219
+ Skeleton.Skeleton,
220
+ {
221
+ width: 24,
222
+ height: 24,
223
+ variant: "circular",
224
+ animate,
225
+ baseColor,
226
+ highlightColor
227
+ }
228
+ ),
229
+ /* @__PURE__ */ jsxRuntime.jsx(
230
+ Skeleton.Skeleton,
231
+ {
232
+ width: 24,
233
+ height: 24,
234
+ variant: "circular",
235
+ animate,
236
+ baseColor,
237
+ highlightColor
238
+ }
239
+ )
240
+ ] })
241
+ ]
242
+ }
243
+ )
244
+ },
245
+ rowIndex
246
+ )),
247
+ showPagination && /* @__PURE__ */ jsxRuntime.jsxs(
248
+ "div",
249
+ {
250
+ className: "border-t border-gray-200 flex items-center justify-between",
251
+ style: { padding: "12px" },
252
+ children: [
253
+ /* @__PURE__ */ jsxRuntime.jsx(
254
+ Skeleton.Skeleton,
255
+ {
256
+ width: 100,
257
+ height: 14,
258
+ borderRadius: 4,
259
+ animate,
260
+ baseColor,
261
+ highlightColor
262
+ }
263
+ ),
264
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
265
+ Skeleton.Skeleton,
266
+ {
267
+ width: 32,
268
+ height: 32,
269
+ borderRadius: 4,
270
+ animate,
271
+ baseColor,
272
+ highlightColor
273
+ },
274
+ index
275
+ )) })
276
+ ]
62
277
  }
63
- }
64
- )
278
+ )
279
+ ] })
65
280
  }
66
281
  );
67
282
  }
68
283
  );
69
- SpinnerRing.displayName = "SpinnerRing";
70
- exports.SpinnerRing = SpinnerRing;
284
+ DataTableSkeleton.displayName = "DataTableSkeleton";
285
+ exports.DataTableSkeleton = DataTableSkeleton;
package/dist/index17.js CHANGED
@@ -1,29 +1,35 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index36.js";
3
+ import { Skeleton } from "./index7.js";
4
+ import { useLoaderVisibility } from "./index56.js";
4
5
  import { cn } from "./index3.js";
5
- import { normalizeSize } from "./index4.js";
6
- const SpinnerRing = forwardRef(
6
+ const DataTableSkeleton = forwardRef(
7
7
  ({
8
- size = "md",
9
- color = "#3b82f6",
10
- secondaryColor = "rgba(0, 0, 0, 0.1)",
11
- thickness = 4,
12
- speed = "normal",
13
- reverse = false,
14
- respectMotionPreference = true,
8
+ rows = 5,
9
+ columns = 4,
10
+ showHeader = true,
11
+ showSortIndicators = false,
12
+ showFilters = false,
13
+ showPagination = false,
14
+ showSelection = false,
15
+ showActions = false,
16
+ columnWidths,
17
+ rowHeight = 48,
18
+ striped = false,
19
+ width = "100%",
20
+ animate = true,
21
+ baseColor,
22
+ highlightColor,
15
23
  delay = 0,
16
24
  minDuration = 0,
17
25
  transition,
18
26
  className,
19
27
  style,
20
- testId = "spinner-ring",
28
+ testId = "data-table-skeleton",
21
29
  visible = true,
22
- ariaLabel = "Loading...",
30
+ ariaLabel = "Loading table...",
23
31
  ...rest
24
32
  }, ref) => {
25
- const prefersReducedMotion = useReducedMotion();
26
- const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
27
33
  const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
28
34
  visible,
29
35
  delay,
@@ -31,14 +37,22 @@ const SpinnerRing = forwardRef(
31
37
  transition
32
38
  );
33
39
  if (!shouldRender) return null;
40
+ const getColumnWidth = (index) => {
41
+ if (columnWidths && columnWidths[index]) {
42
+ const width2 = columnWidths[index];
43
+ return typeof width2 === "number" ? `${width2}px` : width2 === "auto" ? "auto" : width2;
44
+ }
45
+ return "auto";
46
+ };
34
47
  return /* @__PURE__ */ jsx(
35
48
  "div",
36
49
  {
37
50
  ref,
38
51
  "data-testid": testId,
39
- className: cn("inline-flex items-center justify-center", className),
52
+ className: cn("w-full", className),
40
53
  style: {
41
54
  ...style,
55
+ width,
42
56
  opacity,
43
57
  transition: transitionStyle
44
58
  },
@@ -46,25 +60,226 @@ const SpinnerRing = forwardRef(
46
60
  "aria-label": ariaLabel,
47
61
  "aria-busy": "true",
48
62
  ...rest,
49
- children: /* @__PURE__ */ jsx(
50
- "div",
51
- {
52
- className: "rounded-full",
53
- style: {
54
- width: normalizeSize(size),
55
- height: normalizeSize(size),
56
- border: `${thickness}px solid ${secondaryColor}`,
57
- borderTopColor: color,
58
- animation: `spinner-rotate ${effectiveDuration} linear infinite`,
59
- animationDirection: reverse ? "reverse" : "normal"
63
+ children: /* @__PURE__ */ jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [
64
+ showHeader && /* @__PURE__ */ jsx(
65
+ "div",
66
+ {
67
+ className: "border-b border-gray-200",
68
+ style: {
69
+ backgroundColor: baseColor || "var(--skeleton-base, #f3f4f6)",
70
+ padding: "12px"
71
+ },
72
+ children: /* @__PURE__ */ jsxs(
73
+ "div",
74
+ {
75
+ className: "grid gap-4",
76
+ style: {
77
+ gridTemplateColumns: [
78
+ showSelection && "40px",
79
+ ...Array.from({ length: columns }, (_, i) => getColumnWidth(i)),
80
+ showActions && "80px"
81
+ ].filter(Boolean).join(" ")
82
+ },
83
+ children: [
84
+ showSelection && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
85
+ Skeleton,
86
+ {
87
+ width: 18,
88
+ height: 18,
89
+ borderRadius: 3,
90
+ animate,
91
+ baseColor,
92
+ highlightColor
93
+ }
94
+ ) }),
95
+ Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
96
+ /* @__PURE__ */ jsx(
97
+ Skeleton,
98
+ {
99
+ width: "70%",
100
+ height: 16,
101
+ borderRadius: 4,
102
+ animate,
103
+ baseColor,
104
+ highlightColor
105
+ }
106
+ ),
107
+ showSortIndicators && /* @__PURE__ */ jsx(
108
+ Skeleton,
109
+ {
110
+ width: 12,
111
+ height: 12,
112
+ borderRadius: 2,
113
+ animate,
114
+ baseColor,
115
+ highlightColor
116
+ }
117
+ )
118
+ ] }, index)),
119
+ showActions && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
120
+ Skeleton,
121
+ {
122
+ width: 60,
123
+ height: 16,
124
+ borderRadius: 4,
125
+ animate,
126
+ baseColor,
127
+ highlightColor
128
+ }
129
+ ) })
130
+ ]
131
+ }
132
+ )
133
+ }
134
+ ),
135
+ showFilters && /* @__PURE__ */ jsx(
136
+ "div",
137
+ {
138
+ className: "border-b border-gray-200",
139
+ style: { padding: "8px 12px" },
140
+ children: /* @__PURE__ */ jsxs(
141
+ "div",
142
+ {
143
+ className: "grid gap-4",
144
+ style: {
145
+ gridTemplateColumns: [
146
+ showSelection && "40px",
147
+ ...Array.from({ length: columns }, (_, i) => getColumnWidth(i)),
148
+ showActions && "80px"
149
+ ].filter(Boolean).join(" ")
150
+ },
151
+ children: [
152
+ showSelection && /* @__PURE__ */ jsx("div", {}),
153
+ Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsx(
154
+ Skeleton,
155
+ {
156
+ width: "90%",
157
+ height: 28,
158
+ borderRadius: 4,
159
+ animate,
160
+ baseColor,
161
+ highlightColor
162
+ },
163
+ index
164
+ )),
165
+ showActions && /* @__PURE__ */ jsx("div", {})
166
+ ]
167
+ }
168
+ )
169
+ }
170
+ ),
171
+ Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ jsx(
172
+ "div",
173
+ {
174
+ className: cn(
175
+ "border-b border-gray-200 last:border-b-0",
176
+ striped && rowIndex % 2 === 1 && "bg-gray-50"
177
+ ),
178
+ style: { padding: "12px" },
179
+ children: /* @__PURE__ */ jsxs(
180
+ "div",
181
+ {
182
+ className: "grid gap-4 items-center",
183
+ style: {
184
+ gridTemplateColumns: [
185
+ showSelection && "40px",
186
+ ...Array.from({ length: columns }, (_2, i) => getColumnWidth(i)),
187
+ showActions && "80px"
188
+ ].filter(Boolean).join(" "),
189
+ height: `${rowHeight - 24}px`
190
+ },
191
+ children: [
192
+ showSelection && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
193
+ Skeleton,
194
+ {
195
+ width: 18,
196
+ height: 18,
197
+ borderRadius: 3,
198
+ animate,
199
+ baseColor,
200
+ highlightColor
201
+ }
202
+ ) }),
203
+ Array.from({ length: columns }).map((_2, colIndex) => /* @__PURE__ */ jsx(
204
+ Skeleton,
205
+ {
206
+ width: colIndex === 0 ? "80%" : "60%",
207
+ height: 14,
208
+ borderRadius: 4,
209
+ animate,
210
+ baseColor,
211
+ highlightColor
212
+ },
213
+ colIndex
214
+ )),
215
+ showActions && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2", children: [
216
+ /* @__PURE__ */ jsx(
217
+ Skeleton,
218
+ {
219
+ width: 24,
220
+ height: 24,
221
+ variant: "circular",
222
+ animate,
223
+ baseColor,
224
+ highlightColor
225
+ }
226
+ ),
227
+ /* @__PURE__ */ jsx(
228
+ Skeleton,
229
+ {
230
+ width: 24,
231
+ height: 24,
232
+ variant: "circular",
233
+ animate,
234
+ baseColor,
235
+ highlightColor
236
+ }
237
+ )
238
+ ] })
239
+ ]
240
+ }
241
+ )
242
+ },
243
+ rowIndex
244
+ )),
245
+ showPagination && /* @__PURE__ */ jsxs(
246
+ "div",
247
+ {
248
+ className: "border-t border-gray-200 flex items-center justify-between",
249
+ style: { padding: "12px" },
250
+ children: [
251
+ /* @__PURE__ */ jsx(
252
+ Skeleton,
253
+ {
254
+ width: 100,
255
+ height: 14,
256
+ borderRadius: 4,
257
+ animate,
258
+ baseColor,
259
+ highlightColor
260
+ }
261
+ ),
262
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsx(
263
+ Skeleton,
264
+ {
265
+ width: 32,
266
+ height: 32,
267
+ borderRadius: 4,
268
+ animate,
269
+ baseColor,
270
+ highlightColor
271
+ },
272
+ index
273
+ )) })
274
+ ]
60
275
  }
61
- }
62
- )
276
+ )
277
+ ] })
63
278
  }
64
279
  );
65
280
  }
66
281
  );
67
- SpinnerRing.displayName = "SpinnerRing";
282
+ DataTableSkeleton.displayName = "DataTableSkeleton";
68
283
  export {
69
- SpinnerRing
284
+ DataTableSkeleton
70
285
  };