loading-dev 0.3.1 → 0.3.4

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 (108) hide show
  1. package/README.md +2 -2
  2. package/dist/arc.d.ts +11 -0
  3. package/dist/arc.js +10 -0
  4. package/dist/atom.d.ts +10 -0
  5. package/dist/atom.js +9 -0
  6. package/dist/blocks.d.ts +11 -0
  7. package/dist/blocks.js +10 -0
  8. package/dist/bouncing-dots.d.ts +6 -0
  9. package/dist/bouncing-dots.js +8 -0
  10. package/dist/cap.d.ts +8 -0
  11. package/dist/cap.js +8 -0
  12. package/dist/cascade.d.ts +9 -0
  13. package/dist/cascade.js +9 -0
  14. package/dist/chunk-5A6DX4J6.js +62 -0
  15. package/dist/chunk-5DLURQGF.js +88 -0
  16. package/dist/chunk-5DS5PSRD.js +124 -0
  17. package/dist/chunk-5LSP7MQQ.js +69 -0
  18. package/dist/chunk-5R75HMWP.js +55 -0
  19. package/dist/chunk-7C6Q6WUN.js +47 -0
  20. package/dist/chunk-A43AJR54.js +79 -0
  21. package/dist/chunk-AHW6IXXT.js +78 -0
  22. package/dist/chunk-AY4VLQBZ.js +57 -0
  23. package/dist/chunk-BMJ3AGRK.js +62 -0
  24. package/dist/chunk-FKUMWHUL.js +71 -0
  25. package/dist/chunk-HDBQBCTN.js +74 -0
  26. package/dist/chunk-I5CFO2M5.js +78 -0
  27. package/dist/chunk-IQ2WQZFY.js +51 -0
  28. package/dist/chunk-IRMB7CHZ.js +88 -0
  29. package/dist/chunk-IWVH2GKE.js +77 -0
  30. package/dist/chunk-IZ4TRHOC.js +68 -0
  31. package/dist/chunk-JNR4T6LZ.js +10 -0
  32. package/dist/chunk-K5XVX5GB.js +60 -0
  33. package/dist/chunk-LIPOYJAI.js +74 -0
  34. package/dist/chunk-MVL7SVAH.js +79 -0
  35. package/dist/chunk-NHN4FV63.js +78 -0
  36. package/dist/chunk-OMNMMKI7.js +64 -0
  37. package/dist/chunk-PBB2PRPT.js +83 -0
  38. package/dist/chunk-RTKHVDCD.js +82 -0
  39. package/dist/chunk-T5EUYN7R.js +77 -0
  40. package/dist/chunk-T7OV7MUW.js +58 -0
  41. package/dist/chunk-TFHDE6YZ.js +92 -0
  42. package/dist/chunk-UWSCBISJ.js +56 -0
  43. package/dist/chunk-VBI53UGV.js +73 -0
  44. package/dist/chunk-VRX5ZYC6.js +41 -0
  45. package/dist/chunk-X7BJQCYL.js +56 -0
  46. package/dist/chunk-Y7QGIWTL.js +57 -0
  47. package/dist/chunk-ZLJYYX76.js +69 -0
  48. package/dist/circular-dots.d.ts +6 -0
  49. package/dist/circular-dots.js +8 -0
  50. package/dist/classic-v2.d.ts +6 -0
  51. package/dist/classic-v2.js +8 -0
  52. package/dist/classic.d.ts +6 -0
  53. package/dist/classic.js +8 -0
  54. package/dist/clock.d.ts +10 -0
  55. package/dist/clock.js +9 -0
  56. package/dist/comet.d.ts +10 -0
  57. package/dist/comet.js +9 -0
  58. package/dist/compass.d.ts +6 -0
  59. package/dist/compass.js +8 -0
  60. package/dist/dual.d.ts +11 -0
  61. package/dist/dual.js +10 -0
  62. package/dist/easing.d.ts +11 -0
  63. package/dist/easing.js +11 -0
  64. package/dist/eclipse.d.ts +6 -0
  65. package/dist/eclipse.js +8 -0
  66. package/dist/flip.d.ts +6 -0
  67. package/dist/flip.js +8 -0
  68. package/dist/frame.d.ts +20 -0
  69. package/dist/frame.js +13 -0
  70. package/dist/gather.d.ts +6 -0
  71. package/dist/gather.js +8 -0
  72. package/dist/index.d.ts +35 -135
  73. package/dist/index.js +126 -891
  74. package/dist/leap.d.ts +6 -0
  75. package/dist/leap.js +8 -0
  76. package/dist/linear-dots.d.ts +6 -0
  77. package/dist/linear-dots.js +8 -0
  78. package/dist/loading.d.ts +6 -0
  79. package/dist/loading.js +8 -0
  80. package/dist/morph.d.ts +6 -0
  81. package/dist/morph.js +8 -0
  82. package/dist/motion.d.ts +44 -0
  83. package/dist/motion.js +26 -0
  84. package/dist/orbit.d.ts +10 -0
  85. package/dist/orbit.js +9 -0
  86. package/dist/pulse.d.ts +6 -0
  87. package/dist/pulse.js +8 -0
  88. package/dist/radar.d.ts +10 -0
  89. package/dist/radar.js +9 -0
  90. package/dist/ring.d.ts +11 -0
  91. package/dist/ring.js +10 -0
  92. package/dist/ripple.d.ts +11 -0
  93. package/dist/ripple.js +10 -0
  94. package/dist/slide.d.ts +6 -0
  95. package/dist/slide.js +8 -0
  96. package/dist/snake.d.ts +11 -0
  97. package/dist/snake.js +10 -0
  98. package/dist/spinners.d.ts +68 -0
  99. package/dist/spinners.js +39 -0
  100. package/dist/swirl.d.ts +6 -0
  101. package/dist/swirl.js +8 -0
  102. package/dist/trace.d.ts +11 -0
  103. package/dist/trace.js +10 -0
  104. package/dist/types.d.ts +23 -0
  105. package/dist/types.js +0 -0
  106. package/dist/wave.d.ts +11 -0
  107. package/dist/wave.js +10 -0
  108. package/package.json +4 -2
package/dist/index.js CHANGED
@@ -1,910 +1,145 @@
1
- // src/motion.ts
2
- var DURATION_VAR = "--ld-duration";
3
- var PLAY_STATE_VAR = "--ld-play-state";
4
- var SIZE_VAR = "--ld-size";
5
- var DEFAULT_SIZE = 20;
6
- var SIZE = `var(${SIZE_VAR}, ${DEFAULT_SIZE}px)`;
7
- var SPINNER_MOTION = {
8
- arc: { duration: 800 },
9
- "bouncing-dots": { duration: 500 },
10
- "circular-dots": { duration: 800 },
11
- classic: { duration: 1200 },
12
- "classic-v2": { duration: 800 },
13
- clock: { duration: 1200 },
14
- comet: { duration: 700 },
15
- compass: { duration: 500 },
16
- "linear-dots": { duration: 900 },
17
- orbit: { duration: 750 },
18
- pulse: { duration: 1200 },
19
- radar: { duration: 1500 },
20
- ring: { duration: 800 },
21
- swirl: { duration: 1200 }
22
- };
23
- function duration(name) {
24
- return `var(${DURATION_VAR}, ${SPINNER_MOTION[name].duration}ms)`;
25
- }
26
- var PLAY_STATE = `var(${PLAY_STATE_VAR}, running)`;
27
-
28
- // src/easing.ts
29
- var DEFAULT_EASING = "linear";
30
- function spinClass(name, easing = DEFAULT_EASING) {
31
- const base = `ld-${name}-spin`;
32
- return easing === "linear" ? base : `${base} ${base}-${easing}`;
33
- }
34
- function rotationCss(name) {
35
- return `
36
- .ld-${name}-spin {
37
- transform-origin: center;
38
- animation: ld-${name}-rotate ${duration(name)} linear infinite;
39
- animation-play-state: ${PLAY_STATE};
40
- }
41
-
42
- .ld-${name}-spin-ease-in-out {
43
- animation-timing-function: ease-in-out;
44
- }
45
-
46
- .ld-${name}-spin-stacked {
47
- animation-name: ld-${name}-rotate, ld-${name}-rotate;
48
- animation-timing-function: linear, ease-in-out;
49
- animation-composition: add;
50
- }
51
-
52
- @keyframes ld-${name}-rotate {
53
- to {
54
- transform: rotate(360deg);
55
- }
56
- }
57
-
58
- @media (prefers-reduced-motion: reduce) {
59
- .ld-${name}-spin {
60
- animation: none;
61
- }
62
- }
63
- `;
64
- }
65
-
66
- // src/frame.tsx
67
- import { jsx } from "react/jsx-runtime";
68
- function SpinnerStyle({
69
- children,
70
- name
71
- }) {
72
- return /* @__PURE__ */ jsx("style", { href: `ld-${name}`, precedence: "loading-dev", children });
73
- }
74
- function cssVars(vars) {
75
- return vars;
76
- }
77
- function spinnerRoot(name, { className, color, duration: duration2, playState, size = DEFAULT_SIZE }) {
78
- return {
79
- "aria-hidden": true,
80
- className: [`ld-${name}`, className].filter(Boolean).join(" "),
81
- style: cssVars({
82
- [SIZE_VAR]: `${size}px`,
83
- ...color === void 0 ? null : { color },
84
- ...duration2 === void 0 ? null : { [DURATION_VAR]: `${duration2}ms` },
85
- ...playState === void 0 ? null : { [PLAY_STATE_VAR]: playState }
86
- })
87
- };
88
- }
89
-
90
- // src/arc.tsx
91
- import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
92
- var css = `
93
- .ld-arc {
94
- width: ${SIZE};
95
- height: ${SIZE};
96
- }
97
-
98
- ${rotationCss("arc")}
99
- `;
100
- function Arc({ easing, ...rest }) {
101
- return /* @__PURE__ */ jsxs(Fragment, { children: [
102
- /* @__PURE__ */ jsx2(SpinnerStyle, { name: "arc", children: css }),
103
- /* @__PURE__ */ jsx2(
104
- "svg",
105
- {
106
- ...spinnerRoot("arc", rest),
107
- fill: "none",
108
- role: "presentation",
109
- viewBox: "0 0 24 24",
110
- children: /* @__PURE__ */ jsx2(
111
- "circle",
112
- {
113
- className: spinClass("arc", easing),
114
- cx: "12",
115
- cy: "12",
116
- r: "10",
117
- stroke: "currentColor",
118
- strokeDasharray: "18 44.8",
119
- strokeLinecap: "round",
120
- strokeWidth: "2.5"
121
- }
122
- )
123
- }
124
- )
125
- ] });
126
- }
127
-
128
- // src/bouncing-dots.tsx
129
- import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
130
- var DOTS = Array.from({ length: 3 }, (_, index) => index);
131
- var dur = duration("bouncing-dots");
132
- var css2 = `
133
- .ld-bouncing-dots {
134
- display: flex;
135
- align-items: center;
136
- gap: calc(${SIZE} * 0.2);
137
- height: ${SIZE};
138
- }
139
-
140
- .ld-bouncing-dots-dot {
141
- width: calc(${SIZE} * 0.22);
142
- height: calc(${SIZE} * 0.22);
143
- background: currentColor;
144
- border-radius: 9999px;
145
- animation: ld-bouncing-dots-bounce ${dur} ease-in-out infinite alternate;
146
- animation-play-state: ${PLAY_STATE};
147
- }
148
-
149
- .ld-bouncing-dots-dot:nth-child(1) {
150
- animation-delay: calc(${dur} * -0.64);
151
- }
152
-
153
- .ld-bouncing-dots-dot:nth-child(2) {
154
- animation-delay: calc(${dur} * -0.32);
155
- }
156
-
157
- @keyframes ld-bouncing-dots-bounce {
158
- from {
159
- transform: translateY(28%);
160
- }
161
- to {
162
- transform: translateY(-72%);
163
- }
164
- }
165
-
166
- @media (prefers-reduced-motion: reduce) {
167
- .ld-bouncing-dots-dot {
168
- animation: none;
169
- }
170
- }
171
- `;
172
- function BouncingDots(props) {
173
- return /* @__PURE__ */ jsxs2(Fragment2, { children: [
174
- /* @__PURE__ */ jsx3(SpinnerStyle, { name: "bouncing-dots", children: css2 }),
175
- /* @__PURE__ */ jsx3("div", { ...spinnerRoot("bouncing-dots", props), children: DOTS.map((dot) => /* @__PURE__ */ jsx3("div", { className: "ld-bouncing-dots-dot" }, dot)) })
176
- ] });
177
- }
178
-
179
- // src/circular-dots.tsx
180
- import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
181
- var DOTS2 = [
182
- [8, 1.5],
183
- [12.5962, 3.4038],
184
- [14.5, 8],
185
- [12.5962, 12.5962],
186
- [8, 14.5],
187
- [3.4038, 12.5962],
188
- [1.5, 8],
189
- [3.4038, 3.4038]
190
- ];
191
- var dur2 = duration("circular-dots");
192
- var css3 = `
193
- .ld-circular-dots {
194
- width: ${SIZE};
195
- height: ${SIZE};
196
- }
197
-
198
- .ld-circular-dots-dot {
199
- animation: ld-circular-dots-fade ${dur2} linear infinite;
200
- animation-delay: calc(${dur2} * (var(--ld-circular-dots-step) - ${DOTS2.length}) / ${DOTS2.length});
201
- animation-play-state: ${PLAY_STATE};
202
- }
203
-
204
- @keyframes ld-circular-dots-fade {
205
- from {
206
- opacity: 1;
207
- }
208
- to {
209
- opacity: 0.2;
210
- }
211
- }
212
-
213
- @media (prefers-reduced-motion: reduce) {
214
- .ld-circular-dots-dot {
215
- opacity: 0.6;
216
- animation: none;
217
- }
218
- }
219
- `;
220
- function CircularDots(props) {
221
- return /* @__PURE__ */ jsxs3(Fragment3, { children: [
222
- /* @__PURE__ */ jsx4(SpinnerStyle, { name: "circular-dots", children: css3 }),
223
- /* @__PURE__ */ jsx4(
224
- "svg",
225
- {
226
- ...spinnerRoot("circular-dots", props),
227
- fill: "currentColor",
228
- role: "presentation",
229
- viewBox: "0 0 16 16",
230
- children: DOTS2.map(([cx, cy], step) => /* @__PURE__ */ jsx4(
231
- "circle",
232
- {
233
- className: "ld-circular-dots-dot",
234
- cx,
235
- cy,
236
- r: "1.5",
237
- style: cssVars({ "--ld-circular-dots-step": step })
238
- },
239
- `${cx}-${cy}`
240
- ))
241
- }
242
- )
243
- ] });
244
- }
245
-
246
- // src/classic.tsx
247
- import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
248
- var BARS = Array.from({ length: 12 }, (_, index) => index);
249
- var dur3 = duration("classic");
250
- var BAR_RULES = BARS.map(
251
- (bar) => `
252
- .ld-classic-bar:nth-child(${bar + 1}) {
253
- transform: rotate(${bar === 0 ? "0.0001" : bar * 30}deg) translate(146%);
254
- animation-delay: calc(${dur3} * ${(bar / 12 - 1).toFixed(4)});
255
- }`
256
- ).join("\n");
257
- var css4 = `
258
- .ld-classic {
259
- width: ${SIZE};
260
- height: ${SIZE};
261
- }
262
-
263
- .ld-classic-inner {
264
- position: relative;
265
- top: 50%;
266
- left: 50%;
267
- width: ${SIZE};
268
- height: ${SIZE};
269
- }
270
-
271
- .ld-classic-bar {
272
- position: absolute;
273
- top: -3.9%;
274
- left: -10%;
275
- width: 24%;
276
- height: 8%;
277
- background: currentColor;
278
- border-radius: 6px;
279
- animation: ld-classic-spin ${dur3} linear infinite;
280
- animation-play-state: ${PLAY_STATE};
281
- }
282
- ${BAR_RULES}
283
-
284
- @keyframes ld-classic-spin {
285
- 0% {
286
- opacity: 1;
287
- }
288
- 100% {
289
- opacity: 0.15;
290
- }
291
- }
292
-
293
- @media (prefers-reduced-motion: reduce) {
294
- .ld-classic-bar {
295
- opacity: 0.5;
296
- animation: none;
297
- }
298
- }
299
- `;
300
- function Classic(props) {
301
- return /* @__PURE__ */ jsxs4(Fragment4, { children: [
302
- /* @__PURE__ */ jsx5(SpinnerStyle, { name: "classic", children: css4 }),
303
- /* @__PURE__ */ jsx5("div", { ...spinnerRoot("classic", props), children: /* @__PURE__ */ jsx5("div", { className: "ld-classic-inner", children: BARS.map((bar) => /* @__PURE__ */ jsx5("div", { className: "ld-classic-bar" }, bar)) }) })
304
- ] });
305
- }
306
-
307
- // src/classic-v2.tsx
308
- import { Fragment as Fragment5, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
309
- var TICKS = 8;
310
- var dur4 = duration("classic-v2");
311
- var TICK_RULES = Array.from(
312
- { length: TICKS },
313
- (_, tick) => `
314
- .ld-classic-v2-tick:nth-child(${tick + 1}) {
315
- animation-delay: calc(${dur4} * ${(tick / TICKS - 1).toFixed(4)});
316
- }`
317
- ).join("\n");
318
- var css5 = `
319
- .ld-classic-v2 {
320
- width: ${SIZE};
321
- height: ${SIZE};
322
- }
323
-
324
- .ld-classic-v2-tick {
325
- animation: ld-classic-v2-fade ${dur4} linear infinite;
326
- animation-play-state: ${PLAY_STATE};
327
- }
328
- ${TICK_RULES}
329
-
330
- @keyframes ld-classic-v2-fade {
331
- 0% {
332
- opacity: 1;
333
- }
334
- 100% {
335
- opacity: 0.4;
336
- }
337
- }
338
-
339
- @media (prefers-reduced-motion: reduce) {
340
- .ld-classic-v2-tick {
341
- opacity: 0.5;
342
- animation: none;
343
- }
344
- }
345
- `;
346
- function ClassicV2(props) {
347
- return /* @__PURE__ */ jsxs5(Fragment5, { children: [
348
- /* @__PURE__ */ jsx6(SpinnerStyle, { name: "classic-v2", children: css5 }),
349
- /* @__PURE__ */ jsx6(
350
- "svg",
351
- {
352
- ...spinnerRoot("classic-v2", props),
353
- fill: "none",
354
- role: "presentation",
355
- viewBox: "0 0 16 16",
356
- children: /* @__PURE__ */ jsxs5("g", { fill: "currentColor", children: [
357
- /* @__PURE__ */ jsx6(
358
- "path",
359
- {
360
- className: "ld-classic-v2-tick",
361
- d: "M7.33334 0.666667C7.33334 0.298477 7.63181 0 8 0C8.36819 0 8.66667 0.298477 8.66667 0.666667V3.33333C8.66667 3.70152 8.36819 4 8 4C7.63181 4 7.33334 3.70152 7.33334 3.33333V0.666667Z"
362
- }
363
- ),
364
- /* @__PURE__ */ jsx6(
365
- "path",
366
- {
367
- className: "ld-classic-v2-tick",
368
- d: "M11.7712 5.17154C11.5109 5.43189 11.0888 5.43189 10.8284 5.17154C10.5681 4.91119 10.5681 4.48908 10.8284 4.22873L12.714 2.34311C12.9744 2.08276 13.3965 2.08276 13.6568 2.34311C13.9172 2.60346 13.9172 3.02557 13.6568 3.28592L11.7712 5.17154Z"
369
- }
370
- ),
371
- /* @__PURE__ */ jsx6(
372
- "path",
373
- {
374
- className: "ld-classic-v2-tick",
375
- d: "M12.6667 8.66667C12.2985 8.66667 12 8.36819 12 8.00001C12 7.63182 12.2985 7.33334 12.6667 7.33334H15.3333C15.7015 7.33334 16 7.63182 16 8.00001C16 8.36819 15.7015 8.66667 15.3333 8.66667H12.6667Z"
376
- }
377
- ),
378
- /* @__PURE__ */ jsx6(
379
- "path",
380
- {
381
- className: "ld-classic-v2-tick",
382
- d: "M10.8284 11.7713C10.5681 11.5109 10.5681 11.0888 10.8284 10.8284C11.0888 10.5681 11.5109 10.5681 11.7712 10.8284L13.6568 12.7141C13.9172 12.9744 13.9172 13.3965 13.6568 13.6569C13.3965 13.9172 12.9744 13.9172 12.714 13.6569L10.8284 11.7713Z"
383
- }
384
- ),
385
- /* @__PURE__ */ jsx6(
386
- "path",
387
- {
388
- className: "ld-classic-v2-tick",
389
- d: "M7.33333 12.6667C7.33333 12.2985 7.63181 12 8 12C8.36819 12 8.66667 12.2985 8.66667 12.6667V15.3333C8.66667 15.7015 8.36819 16 8 16C7.63181 16 7.33333 15.7015 7.33333 15.3333V12.6667Z"
390
- }
391
- ),
392
- /* @__PURE__ */ jsx6(
393
- "path",
394
- {
395
- className: "ld-classic-v2-tick",
396
- d: "M3.28594 13.6569C3.02559 13.9172 2.60348 13.9172 2.34313 13.6569C2.08278 13.3965 2.08278 12.9744 2.34313 12.714L4.22875 10.8284C4.4891 10.5681 4.91121 10.5681 5.17156 10.8284C5.43191 11.0888 5.43191 11.5109 5.17156 11.7712L3.28594 13.6569Z"
397
- }
398
- ),
399
- /* @__PURE__ */ jsx6(
400
- "path",
401
- {
402
- className: "ld-classic-v2-tick",
403
- d: "M0.666667 8.66667C0.298477 8.66667 1.60941e-08 8.36819 0 8.00001C-1.60941e-08 7.63182 0.298477 7.33334 0.666667 7.33334H3.33333C3.70152 7.33334 4 7.63182 4 8.00001C4 8.36819 3.70152 8.66667 3.33333 8.66667H0.666667Z"
404
- }
405
- ),
406
- /* @__PURE__ */ jsx6(
407
- "path",
408
- {
409
- className: "ld-classic-v2-tick",
410
- d: "M2.34315 3.28594C2.0828 3.02559 2.0828 2.60348 2.34315 2.34314C2.6035 2.08279 3.02561 2.08279 3.28596 2.34313L5.17158 4.22875C5.43193 4.4891 5.43193 4.91121 5.17158 5.17156C4.91123 5.43191 4.48912 5.43191 4.22877 5.17156L2.34315 3.28594Z"
411
- }
412
- )
413
- ] })
414
- }
415
- )
416
- ] });
417
- }
418
-
419
- // src/clock.tsx
420
- import { Fragment as Fragment6, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
421
- var css6 = `
422
- .ld-clock {
423
- width: ${SIZE};
424
- height: ${SIZE};
425
- }
426
-
427
- ${rotationCss("clock")}
428
- `;
429
- function Clock({ easing, ...rest }) {
430
- return /* @__PURE__ */ jsxs6(Fragment6, { children: [
431
- /* @__PURE__ */ jsx7(SpinnerStyle, { name: "clock", children: css6 }),
432
- /* @__PURE__ */ jsxs6(
433
- "svg",
434
- {
435
- ...spinnerRoot("clock", rest),
436
- fill: "none",
437
- role: "presentation",
438
- viewBox: "0 0 16 16",
439
- children: [
440
- /* @__PURE__ */ jsx7("circle", { cx: "8", cy: "8", fill: "currentColor", opacity: "0.1", r: "8" }),
441
- /* @__PURE__ */ jsx7(
442
- "path",
443
- {
444
- className: spinClass("clock", easing),
445
- d: "M11.1937 2.92061C10.5206 2.49739 9.77304 2.21397 8.9954 2.08314C8.45076 1.99151 8 2.44772 8 3V7.20324C8 7.49211 8.12492 7.76686 8.34259 7.95677L11.8999 11.0603C12.3287 11.4344 12.9913 11.378 13.2643 10.8787C13.6356 10.1998 13.8736 9.45248 13.9617 8.67713C14.0892 7.55433 13.8971 6.41834 13.4074 5.39993C12.9177 4.38152 12.1503 3.5221 11.1937 2.92061Z",
446
- fill: "currentColor"
447
- }
448
- )
449
- ]
450
- }
451
- )
452
- ] });
453
- }
454
-
455
- // src/comet.tsx
456
- import { Fragment as Fragment7, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
457
- var css7 = `
458
- .ld-comet {
459
- --ld-comet-stroke: calc(${SIZE} * 0.12);
460
- position: relative;
461
- width: ${SIZE};
462
- height: ${SIZE};
463
- }
464
-
465
- .ld-comet-spin {
466
- position: absolute;
467
- inset: 0;
468
- }
469
-
470
- .ld-comet-tail {
471
- position: absolute;
472
- inset: 0;
473
- border-radius: 9999px;
474
- background: conic-gradient(from 0deg, transparent, currentColor);
475
- -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ld-comet-stroke)), #000 0);
476
- mask: radial-gradient(farthest-side, transparent calc(100% - var(--ld-comet-stroke)), #000 0);
477
- }
478
-
479
- .ld-comet-head {
480
- position: absolute;
481
- top: 0;
482
- left: 50%;
483
- width: var(--ld-comet-stroke);
484
- height: var(--ld-comet-stroke);
485
- background: currentColor;
486
- border-radius: 9999px;
487
- transform: translateX(-50%);
488
- }
489
-
490
- ${rotationCss("comet")}
491
- `;
492
- function Comet({ easing, ...rest }) {
493
- return /* @__PURE__ */ jsxs7(Fragment7, { children: [
494
- /* @__PURE__ */ jsx8(SpinnerStyle, { name: "comet", children: css7 }),
495
- /* @__PURE__ */ jsx8("div", { ...spinnerRoot("comet", rest), children: /* @__PURE__ */ jsxs7("div", { className: spinClass("comet", easing), children: [
496
- /* @__PURE__ */ jsx8("div", { className: "ld-comet-tail" }),
497
- /* @__PURE__ */ jsx8("div", { className: "ld-comet-head" })
498
- ] }) })
499
- ] });
500
- }
501
-
502
- // src/compass.tsx
503
- import { Fragment as Fragment8, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
504
- var css8 = `
505
- .ld-compass {
506
- width: ${SIZE};
507
- height: ${SIZE};
508
- }
509
-
510
- .ld-compass-ticks {
511
- transform-origin: center;
512
- animation: ld-compass-turn ${duration("compass")} ease-in-out infinite;
513
- animation-play-state: ${PLAY_STATE};
514
- }
515
-
516
- @keyframes ld-compass-turn {
517
- to {
518
- transform: rotate(90deg);
519
- }
520
- }
521
-
522
- @media (prefers-reduced-motion: reduce) {
523
- .ld-compass-ticks {
524
- animation: none;
525
- }
526
- }
527
- `;
528
- function Compass(props) {
529
- return /* @__PURE__ */ jsxs8(Fragment8, { children: [
530
- /* @__PURE__ */ jsx9(SpinnerStyle, { name: "compass", children: css8 }),
531
- /* @__PURE__ */ jsx9(
532
- "svg",
533
- {
534
- ...spinnerRoot("compass", props),
535
- fill: "none",
536
- role: "presentation",
537
- viewBox: "0 0 16 16",
538
- children: /* @__PURE__ */ jsxs8("g", { className: "ld-compass-ticks", fill: "currentColor", children: [
539
- /* @__PURE__ */ jsx9("path", { d: "M7.33334 0.666667C7.33334 0.298477 7.63181 0 8 0C8.36819 0 8.66667 0.298477 8.66667 0.666667V3.33333C8.66667 3.70152 8.36819 4 8 4C7.63181 4 7.33334 3.70152 7.33334 3.33333V0.666667Z" }),
540
- /* @__PURE__ */ jsx9("path", { d: "M12.6667 8.66667C12.2985 8.66667 12 8.3682 12 8.00001C12 7.63182 12.2985 7.33334 12.6667 7.33334H15.3333C15.7015 7.33334 16 7.63182 16 8.00001C16 8.3682 15.7015 8.66667 15.3333 8.66667H12.6667Z" }),
541
- /* @__PURE__ */ jsx9("path", { d: "M7.33333 12.6667C7.33333 12.2985 7.63181 12 8 12C8.36819 12 8.66667 12.2985 8.66667 12.6667V15.3333C8.66667 15.7015 8.36819 16 8 16C7.63181 16 7.33333 15.7015 7.33333 15.3333V12.6667Z" }),
542
- /* @__PURE__ */ jsx9("path", { d: "M0.666667 8.66667C0.298477 8.66667 1.60941e-08 8.3682 0 8.00001C-1.60941e-08 7.63182 0.298477 7.33334 0.666667 7.33334H3.33333C3.70152 7.33334 4 7.63182 4 8.00001C4 8.3682 3.70152 8.66667 3.33333 8.66667H0.666667Z" })
543
- ] })
544
- }
545
- )
546
- ] });
547
- }
548
-
549
- // src/linear-dots.tsx
550
- import { Fragment as Fragment9, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
551
- var COUNT = 3;
552
- var DOTS3 = Array.from({ length: COUNT }, (_, index) => ({
553
- step: (COUNT - index) % COUNT
554
- }));
555
- var dur5 = duration("linear-dots");
556
- var css9 = `
557
- .ld-linear-dots {
558
- display: flex;
559
- align-items: center;
560
- gap: calc(${SIZE} * 0.1875);
561
- height: ${SIZE};
562
- }
563
-
564
- .ld-linear-dots-dot {
565
- width: calc(${SIZE} * 0.1875);
566
- height: calc(${SIZE} * 0.1875);
567
- background: currentColor;
568
- border-radius: 9999px;
569
- animation: ld-linear-dots-fade ${dur5} linear infinite;
570
- animation-delay: calc(${dur5} * var(--ld-linear-dots-step) / -${COUNT});
571
- animation-play-state: ${PLAY_STATE};
572
- }
573
-
574
- @keyframes ld-linear-dots-fade {
575
- 0% {
576
- opacity: 1;
577
- }
578
- 66.67% {
579
- opacity: 0.5;
580
- }
581
- 100% {
582
- opacity: 1;
583
- }
584
- }
585
-
586
- @media (prefers-reduced-motion: reduce) {
587
- .ld-linear-dots-dot {
588
- opacity: 0.75;
589
- animation: none;
590
- }
591
- }
592
- `;
593
- function LinearDots(props) {
594
- return /* @__PURE__ */ jsxs9(Fragment9, { children: [
595
- /* @__PURE__ */ jsx10(SpinnerStyle, { name: "linear-dots", children: css9 }),
596
- /* @__PURE__ */ jsx10("div", { ...spinnerRoot("linear-dots", props), children: DOTS3.map((dot, index) => /* @__PURE__ */ jsx10(
597
- "div",
598
- {
599
- className: "ld-linear-dots-dot",
600
- style: cssVars({ "--ld-linear-dots-step": dot.step })
601
- },
602
- index
603
- )) })
604
- ] });
605
- }
606
-
607
- // src/orbit.tsx
608
- import { Fragment as Fragment10, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
609
- var css10 = `
610
- .ld-orbit {
611
- --ld-orbit-stroke: calc(${SIZE} * 0.0625);
612
- position: relative;
613
- width: ${SIZE};
614
- height: ${SIZE};
615
- }
616
-
617
- .ld-orbit-track {
618
- position: absolute;
619
- inset: 8%;
620
- border-radius: 9999px;
621
- background: conic-gradient(from 180deg, transparent 0deg, currentColor 180deg, transparent 180deg);
622
- -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ld-orbit-stroke)), #000 0);
623
- mask: radial-gradient(farthest-side, transparent calc(100% - var(--ld-orbit-stroke)), #000 0);
624
- }
625
-
626
- .ld-orbit-dot {
627
- position: absolute;
628
- top: 50%;
629
- left: 50%;
630
- width: 25%;
631
- height: 25%;
632
- background: currentColor;
633
- border-radius: 9999px;
634
- transform: translate(-50%, -50%);
635
- }
636
-
637
- ${rotationCss("orbit")}
638
- `;
639
- function Orbit({ easing, ...rest }) {
640
- return /* @__PURE__ */ jsxs10(Fragment10, { children: [
641
- /* @__PURE__ */ jsx11(SpinnerStyle, { name: "orbit", children: css10 }),
642
- /* @__PURE__ */ jsxs10("div", { ...spinnerRoot("orbit", rest), children: [
643
- /* @__PURE__ */ jsx11("div", { className: "ld-orbit-dot" }),
644
- /* @__PURE__ */ jsx11("div", { className: `ld-orbit-track ${spinClass("orbit", easing)}` })
645
- ] })
646
- ] });
647
- }
648
-
649
- // src/pulse.tsx
650
- import { Fragment as Fragment11, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
651
- var css11 = `
652
- .ld-pulse {
653
- width: ${SIZE};
654
- height: ${SIZE};
655
- }
656
-
657
- .ld-pulse-ring {
658
- transform-origin: center;
659
- animation: ld-pulse-ripple ${duration("pulse")} ease-out infinite;
660
- animation-play-state: ${PLAY_STATE};
661
- }
662
-
663
- @keyframes ld-pulse-ripple {
664
- from {
665
- opacity: 0.4;
666
- transform: scale(0.25);
667
- }
668
- to {
669
- opacity: 0;
670
- transform: scale(1);
671
- }
672
- }
673
-
674
- @media (prefers-reduced-motion: reduce) {
675
- .ld-pulse-ring {
676
- opacity: 0.2;
677
- animation: none;
678
- }
679
- }
680
- `;
681
- function Pulse(props) {
682
- return /* @__PURE__ */ jsxs11(Fragment11, { children: [
683
- /* @__PURE__ */ jsx12(SpinnerStyle, { name: "pulse", children: css11 }),
684
- /* @__PURE__ */ jsxs11(
685
- "svg",
686
- {
687
- ...spinnerRoot("pulse", props),
688
- fill: "none",
689
- role: "presentation",
690
- viewBox: "0 0 16 16",
691
- children: [
692
- /* @__PURE__ */ jsx12(
693
- "circle",
694
- {
695
- className: "ld-pulse-ring",
696
- cx: "8",
697
- cy: "8",
698
- fill: "currentColor",
699
- r: "8"
700
- }
701
- ),
702
- /* @__PURE__ */ jsx12("circle", { cx: "8", cy: "8", fill: "currentColor", r: "2" })
703
- ]
704
- }
705
- )
706
- ] });
707
- }
708
-
709
- // src/radar.tsx
710
- import { useId } from "react";
711
- import { Fragment as Fragment12, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
712
- var css12 = `
713
- .ld-radar {
714
- width: ${SIZE};
715
- height: ${SIZE};
716
- }
717
-
718
- ${rotationCss("radar")}
719
- `;
720
- function Radar({ easing, ...rest }) {
721
- const beamGradient = useId();
722
- return /* @__PURE__ */ jsxs12(Fragment12, { children: [
723
- /* @__PURE__ */ jsx13(SpinnerStyle, { name: "radar", children: css12 }),
724
- /* @__PURE__ */ jsxs12(
725
- "svg",
726
- {
727
- ...spinnerRoot("radar", rest),
728
- fill: "none",
729
- role: "presentation",
730
- viewBox: "0 0 16 16",
731
- children: [
732
- /* @__PURE__ */ jsx13("defs", { children: /* @__PURE__ */ jsxs12(
733
- "radialGradient",
734
- {
735
- cx: "8",
736
- cy: "8",
737
- gradientUnits: "userSpaceOnUse",
738
- id: beamGradient,
739
- r: "8",
740
- children: [
741
- /* @__PURE__ */ jsx13("stop", { offset: "0.3334", stopColor: "currentColor" }),
742
- /* @__PURE__ */ jsx13("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
743
- ]
744
- }
745
- ) }),
746
- /* @__PURE__ */ jsx13("circle", { cx: "8", cy: "8", fill: "currentColor", opacity: "0.2", r: "8" }),
747
- /* @__PURE__ */ jsx13("circle", { cx: "8", cy: "8", opacity: "0.2", r: "5.5", stroke: "currentColor" }),
748
- /* @__PURE__ */ jsx13(
749
- "path",
750
- {
751
- className: spinClass("radar", easing),
752
- d: "M8 0C9.50657 0 10.9824 0.425672 12.2578 1.22754C13.5333 2.02953 14.557 3.17533 15.21 4.5332C15.8629 5.89107 16.1193 7.40626 15.9492 8.90332C15.7791 10.4001 15.1896 11.8184 14.249 12.9951L10.4707 9.69922C10.8037 9.21598 11 8.63123 11 8C11 6.34315 9.65685 5 8 5V0Z",
753
- fill: `url(#${beamGradient})`
754
- }
755
- ),
756
- /* @__PURE__ */ jsx13("circle", { cx: "8", cy: "8", fill: "currentColor", r: "2" })
757
- ]
758
- }
759
- )
760
- ] });
761
- }
762
-
763
- // src/ring.tsx
764
- import { Fragment as Fragment13, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
765
- var css13 = `
766
- .ld-ring {
767
- width: ${SIZE};
768
- height: ${SIZE};
769
- }
770
-
771
- ${rotationCss("ring")}
772
- `;
773
- function Ring({ easing, ...rest }) {
774
- return /* @__PURE__ */ jsxs13(Fragment13, { children: [
775
- /* @__PURE__ */ jsx14(SpinnerStyle, { name: "ring", children: css13 }),
776
- /* @__PURE__ */ jsxs13(
777
- "svg",
778
- {
779
- ...spinnerRoot("ring", rest),
780
- fill: "none",
781
- role: "presentation",
782
- viewBox: "0 0 24 24",
783
- children: [
784
- /* @__PURE__ */ jsx14(
785
- "circle",
786
- {
787
- cx: "12",
788
- cy: "12",
789
- opacity: "0.2",
790
- r: "10",
791
- stroke: "currentColor",
792
- strokeWidth: "2.5"
793
- }
794
- ),
795
- /* @__PURE__ */ jsx14(
796
- "circle",
797
- {
798
- className: spinClass("ring", easing),
799
- cx: "12",
800
- cy: "12",
801
- r: "10",
802
- stroke: "currentColor",
803
- strokeDasharray: "16 46.8",
804
- strokeLinecap: "round",
805
- strokeWidth: "2.5"
806
- }
807
- )
808
- ]
809
- }
810
- )
811
- ] });
812
- }
813
-
814
- // src/swirl.tsx
815
- import { Fragment as Fragment14, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
816
- var RING = [0, 1, 2, 7, null, 3, 6, 5, 4];
817
- var CELLS = RING.map((place) => ({
818
- place,
819
- step: place === null ? null : (8 - place) % 8
820
- }));
821
- var dur6 = duration("swirl");
822
- var css14 = `
823
- .ld-swirl {
824
- display: grid;
825
- grid-template-columns: repeat(3, 1fr);
826
- grid-template-rows: repeat(3, 1fr);
827
- gap: calc(${SIZE} * 0.15625);
828
- box-sizing: border-box;
829
- width: ${SIZE};
830
- height: ${SIZE};
831
- padding: calc(${SIZE} * 0.0625);
832
- }
833
-
834
- .ld-swirl-cell {
835
- background: currentColor;
836
- border-radius: calc(${SIZE} * 0.0625);
837
- animation: ld-swirl-fade ${dur6} linear infinite;
838
- animation-delay: calc(${dur6} * var(--ld-swirl-step) / -8);
839
- animation-play-state: ${PLAY_STATE};
840
- }
841
-
842
- @keyframes ld-swirl-fade {
843
- from {
844
- opacity: 1;
845
- }
846
- to {
847
- opacity: 0.2;
848
- }
849
- }
850
-
851
- @media (prefers-reduced-motion: reduce) {
852
- .ld-swirl-cell {
853
- opacity: 0.6;
854
- animation: none;
855
- }
856
- }
857
- `;
858
- function Swirl(props) {
859
- return /* @__PURE__ */ jsxs14(Fragment14, { children: [
860
- /* @__PURE__ */ jsx15(SpinnerStyle, { name: "swirl", children: css14 }),
861
- /* @__PURE__ */ jsx15("div", { ...spinnerRoot("swirl", props), children: CELLS.map(
862
- (cell, index) => cell.step === null ? /* @__PURE__ */ jsx15("div", {}, index) : /* @__PURE__ */ jsx15(
863
- "div",
864
- {
865
- className: "ld-swirl-cell",
866
- style: cssVars({ "--ld-swirl-step": cell.step })
867
- },
868
- index
869
- )
870
- ) })
871
- ] });
872
- }
873
-
874
- // src/spinners.ts
875
- var SPINNERS = {
876
- arc: Arc,
877
- "bouncing-dots": BouncingDots,
878
- "circular-dots": CircularDots,
879
- classic: Classic,
880
- "classic-v2": ClassicV2,
881
- clock: Clock,
882
- comet: Comet,
883
- compass: Compass,
884
- "linear-dots": LinearDots,
885
- orbit: Orbit,
886
- pulse: Pulse,
887
- radar: Radar,
888
- ring: Ring,
889
- swirl: Swirl
890
- };
1
+ import {
2
+ SPINNERS
3
+ } from "./chunk-5DS5PSRD.js";
4
+ import {
5
+ Swirl
6
+ } from "./chunk-BMJ3AGRK.js";
7
+ import {
8
+ Trace
9
+ } from "./chunk-HDBQBCTN.js";
10
+ import {
11
+ DEFAULT_WAVE_ORIGIN,
12
+ Wave
13
+ } from "./chunk-VBI53UGV.js";
14
+ import {
15
+ Orbit
16
+ } from "./chunk-Y7QGIWTL.js";
17
+ import {
18
+ Pulse
19
+ } from "./chunk-FKUMWHUL.js";
20
+ import {
21
+ Radar
22
+ } from "./chunk-5LSP7MQQ.js";
23
+ import {
24
+ Ring
25
+ } from "./chunk-ZLJYYX76.js";
26
+ import {
27
+ DEFAULT_RIPPLE_DIRECTION,
28
+ Ripple
29
+ } from "./chunk-IWVH2GKE.js";
30
+ import {
31
+ Slide
32
+ } from "./chunk-IRMB7CHZ.js";
33
+ import {
34
+ Snake
35
+ } from "./chunk-RTKHVDCD.js";
36
+ import {
37
+ Gather
38
+ } from "./chunk-TFHDE6YZ.js";
39
+ import {
40
+ Leap
41
+ } from "./chunk-LIPOYJAI.js";
42
+ import {
43
+ LinearDots
44
+ } from "./chunk-K5XVX5GB.js";
45
+ import {
46
+ Loading
47
+ } from "./chunk-MVL7SVAH.js";
48
+ import {
49
+ Morph
50
+ } from "./chunk-AY4VLQBZ.js";
51
+ import {
52
+ Classic
53
+ } from "./chunk-IZ4TRHOC.js";
54
+ import {
55
+ Clock
56
+ } from "./chunk-IQ2WQZFY.js";
57
+ import {
58
+ Comet
59
+ } from "./chunk-5A6DX4J6.js";
60
+ import {
61
+ Compass
62
+ } from "./chunk-T7OV7MUW.js";
63
+ import {
64
+ Dual
65
+ } from "./chunk-NHN4FV63.js";
66
+ import {
67
+ Eclipse
68
+ } from "./chunk-AHW6IXXT.js";
69
+ import {
70
+ Flip
71
+ } from "./chunk-5R75HMWP.js";
72
+ import {
73
+ Arc
74
+ } from "./chunk-X7BJQCYL.js";
75
+ import {
76
+ Atom
77
+ } from "./chunk-5DLURQGF.js";
78
+ import {
79
+ DEFAULT_EASING
80
+ } from "./chunk-7C6Q6WUN.js";
81
+ import {
82
+ Blocks,
83
+ DEFAULT_BLOCKS_SWEEP
84
+ } from "./chunk-PBB2PRPT.js";
85
+ import {
86
+ BouncingDots
87
+ } from "./chunk-UWSCBISJ.js";
88
+ import {
89
+ Cascade
90
+ } from "./chunk-I5CFO2M5.js";
91
+ import {
92
+ DEFAULT_CAP
93
+ } from "./chunk-JNR4T6LZ.js";
94
+ import {
95
+ CircularDots
96
+ } from "./chunk-A43AJR54.js";
97
+ import {
98
+ ClassicV2
99
+ } from "./chunk-T5EUYN7R.js";
100
+ import "./chunk-VRX5ZYC6.js";
101
+ import {
102
+ DURATION_VAR,
103
+ PLAY_STATE_VAR,
104
+ SPINNER_MOTION
105
+ } from "./chunk-OMNMMKI7.js";
891
106
  export {
892
107
  Arc,
108
+ Atom,
109
+ Blocks,
893
110
  BouncingDots,
111
+ Cascade,
894
112
  CircularDots,
895
113
  Classic,
896
114
  ClassicV2,
897
115
  Clock,
898
116
  Comet,
899
117
  Compass,
118
+ DEFAULT_BLOCKS_SWEEP,
119
+ DEFAULT_CAP,
120
+ DEFAULT_EASING,
121
+ DEFAULT_RIPPLE_DIRECTION,
122
+ DEFAULT_WAVE_ORIGIN,
900
123
  DURATION_VAR,
124
+ Dual,
125
+ Eclipse,
126
+ Flip,
127
+ Gather,
128
+ Leap,
901
129
  LinearDots,
130
+ Loading,
131
+ Morph,
902
132
  Orbit,
903
133
  PLAY_STATE_VAR,
904
134
  Pulse,
905
135
  Radar,
906
136
  Ring,
137
+ Ripple,
907
138
  SPINNERS,
908
139
  SPINNER_MOTION,
909
- Swirl
140
+ Slide,
141
+ Snake,
142
+ Swirl,
143
+ Trace,
144
+ Wave
910
145
  };