loading-dev 0.3.5 → 0.3.7

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 (129) hide show
  1. package/README.md +9 -1
  2. package/dist/arc.d.ts +5 -11
  3. package/dist/arc.js +30 -10
  4. package/dist/atom.d.ts +4 -10
  5. package/dist/atom.js +69 -9
  6. package/dist/blocks.d.ts +6 -10
  7. package/dist/blocks.js +72 -9
  8. package/dist/bouncing-dots.d.ts +2 -6
  9. package/dist/bouncing-dots.js +44 -8
  10. package/dist/cap-B_Mo1a7N.d.ts +7 -0
  11. package/dist/cap.d.ts +2 -8
  12. package/dist/cap.js +6 -8
  13. package/dist/cascade.d.ts +4 -9
  14. package/dist/cascade.js +49 -9
  15. package/dist/chevrons.d.ts +2 -0
  16. package/dist/chevrons.js +36 -0
  17. package/dist/circular-dots.d.ts +2 -6
  18. package/dist/circular-dots.js +39 -9
  19. package/dist/classic-v2.d.ts +2 -6
  20. package/dist/classic-v2.js +40 -9
  21. package/dist/classic.d.ts +2 -6
  22. package/dist/classic.js +47 -9
  23. package/dist/clock.d.ts +4 -10
  24. package/dist/clock.js +30 -9
  25. package/dist/comet.d.ts +4 -10
  26. package/dist/comet.js +51 -9
  27. package/dist/compass.d.ts +2 -6
  28. package/dist/compass.js +38 -8
  29. package/dist/dual.d.ts +5 -11
  30. package/dist/dual.js +46 -10
  31. package/dist/easing-BM_1QWrA.d.ts +9 -0
  32. package/dist/easing.d.ts +2 -11
  33. package/dist/easing.js +33 -11
  34. package/dist/eclipse.d.ts +2 -6
  35. package/dist/eclipse.js +68 -8
  36. package/dist/fade.d.ts +5 -8
  37. package/dist/fade.js +26 -7
  38. package/dist/fill.d.ts +2 -0
  39. package/dist/fill.js +59 -0
  40. package/dist/flip.d.ts +2 -6
  41. package/dist/flip.js +40 -8
  42. package/dist/frame.d.ts +14 -18
  43. package/dist/frame.js +41 -13
  44. package/dist/gather.d.ts +2 -6
  45. package/dist/gather.js +84 -8
  46. package/dist/index.d.ts +42 -35
  47. package/dist/index.js +41 -146
  48. package/dist/leap.d.ts +2 -6
  49. package/dist/leap.js +66 -8
  50. package/dist/linear-dots.d.ts +2 -6
  51. package/dist/linear-dots.js +53 -8
  52. package/dist/loading.d.ts +2 -6
  53. package/dist/loading.js +63 -9
  54. package/dist/loop.d.ts +5 -0
  55. package/dist/loop.js +37 -0
  56. package/dist/morph.d.ts +2 -6
  57. package/dist/morph.js +39 -8
  58. package/dist/motion-trIEyOxA.d.ts +50 -0
  59. package/dist/motion.d.ts +2 -44
  60. package/dist/motion.js +56 -25
  61. package/dist/orbit.d.ts +4 -10
  62. package/dist/orbit.js +43 -9
  63. package/dist/phases.d.ts +2 -0
  64. package/dist/phases.js +73 -0
  65. package/dist/pulse.d.ts +2 -6
  66. package/dist/pulse.js +51 -8
  67. package/dist/radar.d.ts +4 -10
  68. package/dist/radar.js +63 -9
  69. package/dist/ring.d.ts +5 -11
  70. package/dist/ring.js +37 -10
  71. package/dist/ripple.d.ts +6 -10
  72. package/dist/ripple.js +56 -10
  73. package/dist/scan.d.ts +2 -0
  74. package/dist/scan.js +56 -0
  75. package/dist/slide.d.ts +2 -6
  76. package/dist/slide.js +73 -8
  77. package/dist/snake.d.ts +5 -11
  78. package/dist/snake.js +58 -10
  79. package/dist/spinners.d.ts +74 -68
  80. package/dist/spinners.js +75 -39
  81. package/dist/split.d.ts +2 -0
  82. package/dist/split.js +52 -0
  83. package/dist/steps.d.ts +2 -0
  84. package/dist/steps.js +55 -0
  85. package/dist/swirl.d.ts +2 -6
  86. package/dist/swirl.js +49 -9
  87. package/dist/trace.d.ts +5 -11
  88. package/dist/trace.js +44 -9
  89. package/dist/types-D9_cXnjI.d.ts +8 -0
  90. package/dist/types.d.ts +2 -9
  91. package/dist/types.js +1 -0
  92. package/dist/wave.d.ts +6 -10
  93. package/dist/wave.js +55 -10
  94. package/package.json +14 -14
  95. package/dist/chunk-2LMGBBRJ.js +0 -77
  96. package/dist/chunk-2OX27TAE.js +0 -69
  97. package/dist/chunk-2TYML5J2.js +0 -51
  98. package/dist/chunk-3WMZVDPS.js +0 -61
  99. package/dist/chunk-4O4ADYWE.js +0 -73
  100. package/dist/chunk-5UAEBEER.js +0 -78
  101. package/dist/chunk-A2PZBHTA.js +0 -41
  102. package/dist/chunk-BAVSTTWG.js +0 -88
  103. package/dist/chunk-BCIAMPLU.js +0 -87
  104. package/dist/chunk-DKYEZLIN.js +0 -72
  105. package/dist/chunk-FQ2U2M7F.js +0 -76
  106. package/dist/chunk-FWH6VWVK.js +0 -59
  107. package/dist/chunk-HL7TIIDB.js +0 -124
  108. package/dist/chunk-IJJULNRU.js +0 -53
  109. package/dist/chunk-JKLL7YYG.js +0 -85
  110. package/dist/chunk-JNR4T6LZ.js +0 -10
  111. package/dist/chunk-JQNF5GYA.js +0 -52
  112. package/dist/chunk-KAZ5BTXC.js +0 -74
  113. package/dist/chunk-KOYM24WV.js +0 -72
  114. package/dist/chunk-L2DUMHO4.js +0 -69
  115. package/dist/chunk-LDXBT62V.js +0 -57
  116. package/dist/chunk-MAKBZTL3.js +0 -56
  117. package/dist/chunk-OMNMMKI7.js +0 -64
  118. package/dist/chunk-P4BSSDSY.js +0 -51
  119. package/dist/chunk-PM6DU637.js +0 -70
  120. package/dist/chunk-PVVWLDIS.js +0 -33
  121. package/dist/chunk-R5ZDKN3Z.js +0 -59
  122. package/dist/chunk-RAHAQ7XK.js +0 -61
  123. package/dist/chunk-SUUR5WMA.js +0 -46
  124. package/dist/chunk-UAO52LUL.js +0 -48
  125. package/dist/chunk-ULWRXY3A.js +0 -50
  126. package/dist/chunk-UOXB5QOZ.js +0 -81
  127. package/dist/chunk-UXTZTFNZ.js +0 -62
  128. package/dist/chunk-VZX7APSS.js +0 -82
  129. package/dist/chunk-YIB63EKJ.js +0 -49
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
+ <a href="https://interfaces.dev/?utm_source=loading.dev">
2
+ <img width="320" height="168" alt="interfaces.dev" src="https://ho1jr3x2dcwdu3t5.public.blob.vercel-storage.com/interfaces-og-image.png" />
3
+ </a>
4
+
5
+ Read more in [Interfaces](https://interfaces.dev/?utm_source=loading.dev), the first design engineering magazine.
6
+
1
7
  # loading-dev
2
8
 
9
+ [![npm downloads](https://img.shields.io/npm/dt/loading-dev)](https://www.npmjs.com/package/loading-dev)
10
+
3
11
  Beautiful loading indicators for React.
4
12
 
5
13
  ```sh
@@ -20,7 +28,7 @@ The spinners respect reduced motion out of the box and require React 19 or later
20
28
 
21
29
  Current list of indicators:
22
30
 
23
- `Arc`, `Atom`, `Blocks`, `BouncingDots`, `Cascade`, `CircularDots`, `Classic`, `ClassicV2`, `Clock`, `Comet`, `Compass`, `Dual`, `Eclipse`, `Flip`, `Gather`, `Leap`, `LinearDots`, `Loading`, `Morph`, `Orbit`, `Pulse`, `Radar`, `Ring`, `Ripple`, `Slide`, `Snake`, `Swirl`, `Trace`, `Wave`.
31
+ `Arc`, `Atom`, `Blocks`, `BouncingDots`, `Cascade`, `Chevrons`, `CircularDots`, `Classic`, `ClassicV2`, `Clock`, `Comet`, `Compass`, `Dual`, `Eclipse`, `Fill`, `Flip`, `Gather`, `Leap`, `LinearDots`, `Loading`, `Loop`, `Morph`, `Orbit`, `Phases`, `Pulse`, `Radar`, `Ring`, `Ripple`, `Scan`, `Slide`, `Snake`, `Split`, `Steps`, `Swirl`, `Trace`, `Wave`.
24
32
 
25
33
  Docs and live previews are available at [loading.dev](https://loading.dev).
26
34
 
package/dist/arc.d.ts CHANGED
@@ -1,11 +1,5 @@
1
- import * as react from 'react';
2
- import { CapProps } from './cap.js';
3
- import { EasingProps } from './easing.js';
4
- import { SpinnerProps } from './types.js';
5
- import './motion.js';
6
-
7
- interface ArcProps extends SpinnerProps, EasingProps, CapProps {
8
- }
9
- declare function Arc({ cap, easing, ...rest }: ArcProps): react.JSX.Element;
10
-
11
- export { Arc, type ArcProps };
1
+ import { n as CapProps } from "./cap-B_Mo1a7N.js";
2
+ import { r as EasingProps } from "./easing-BM_1QWrA.js";
3
+ import { t as SpinnerProps } from "./types-D9_cXnjI.js";
4
+ export interface ArcProps extends SpinnerProps, EasingProps, CapProps {}
5
+ export declare function Arc({ cap, easing, ...rest }: ArcProps): import("react").JSX.Element;
package/dist/arc.js CHANGED
@@ -1,10 +1,30 @@
1
- import {
2
- Arc
3
- } from "./chunk-MAKBZTL3.js";
4
- import "./chunk-A2PZBHTA.js";
5
- import "./chunk-JNR4T6LZ.js";
6
- import "./chunk-UAO52LUL.js";
7
- import "./chunk-OMNMMKI7.js";
8
- export {
9
- Arc
10
- };
1
+ import { linecap } from "./cap.js";
2
+ import { rotationCss, spinClass } from "./easing.js";
3
+ import { SpinnerStyle, spinnerRoot } from "./frame.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/arc.tsx
6
+ const css = `
7
+ ${rotationCss("arc")}
8
+ `;
9
+ function Arc({ cap, easing, ...rest }) {
10
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
11
+ name: "arc",
12
+ children: css
13
+ }), /* @__PURE__ */ jsx("svg", {
14
+ ...spinnerRoot("arc", rest),
15
+ fill: "none",
16
+ role: "presentation",
17
+ viewBox: "0 0 24 24",
18
+ children: /* @__PURE__ */ jsx("circle", {
19
+ className: spinClass("arc", easing),
20
+ cx: "12",
21
+ cy: "12",
22
+ r: "10",
23
+ stroke: "currentColor",
24
+ strokeDasharray: "18 44.8",
25
+ strokeLinecap: linecap(cap),
26
+ strokeWidth: "2.5"
27
+ })
28
+ })] });
29
+ }
30
+ export { Arc };
package/dist/atom.d.ts CHANGED
@@ -1,10 +1,4 @@
1
- import * as react from 'react';
2
- import { EasingProps } from './easing.js';
3
- import { SpinnerProps } from './types.js';
4
- import './motion.js';
5
-
6
- interface AtomProps extends SpinnerProps, EasingProps {
7
- }
8
- declare function Atom({ easing, ...rest }: AtomProps): react.JSX.Element;
9
-
10
- export { Atom, type AtomProps };
1
+ import { r as EasingProps } from "./easing-BM_1QWrA.js";
2
+ import { t as SpinnerProps } from "./types-D9_cXnjI.js";
3
+ export interface AtomProps extends SpinnerProps, EasingProps {}
4
+ export declare function Atom({ easing, ...rest }: AtomProps): import("react").JSX.Element;
package/dist/atom.js CHANGED
@@ -1,9 +1,69 @@
1
- import {
2
- Atom
3
- } from "./chunk-BAVSTTWG.js";
4
- import "./chunk-A2PZBHTA.js";
5
- import "./chunk-UAO52LUL.js";
6
- import "./chunk-OMNMMKI7.js";
7
- export {
8
- Atom
9
- };
1
+ import { SIZE, stagger } from "./motion.js";
2
+ import { rotationCss, spinClass } from "./easing.js";
3
+ import { SpinnerStyle, cssVars, spinnerRoot, step } from "./frame.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/atom.tsx
6
+ const ORBITS = Array.from({ length: 3 }, (_, index) => index);
7
+ const TILT = 180 / ORBITS.length;
8
+ const css = `
9
+ .ld-atom {
10
+ position: relative;
11
+ }
12
+
13
+ .ld-atom-shell {
14
+ position: absolute;
15
+ inset: 0;
16
+ box-sizing: border-box;
17
+ border: ${`calc(${SIZE} * 0.055)`} solid currentColor;
18
+ border-radius: 9999px;
19
+ }
20
+
21
+ .ld-atom-orbit {
22
+ position: absolute;
23
+ inset: 0;
24
+ transform-style: preserve-3d;
25
+ transform: rotate(var(--ld-atom-tilt)) rotateX(90deg);
26
+ }
27
+
28
+ .ld-atom-ring {
29
+ position: absolute;
30
+ inset: 0;
31
+ box-sizing: border-box;
32
+ border: ${`calc(${SIZE} * 0.045)`} solid currentColor;
33
+ border-radius: 9999px;
34
+ transform: rotateX(90deg);
35
+ }
36
+
37
+ ${rotationCss("atom")}
38
+
39
+ .ld-atom-spin {
40
+ position: absolute;
41
+ inset: 0;
42
+ transform-style: preserve-3d;
43
+ animation-delay: ${stagger("atom", ORBITS.length)};
44
+ }
45
+
46
+ @media (prefers-reduced-motion: reduce) {
47
+ .ld-atom-spin {
48
+ transform: rotate(${TILT}deg);
49
+ }
50
+ }
51
+ `;
52
+ function Atom({ easing, ...rest }) {
53
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
54
+ name: "atom",
55
+ children: css
56
+ }), /* @__PURE__ */ jsxs("div", {
57
+ ...spinnerRoot("atom", rest),
58
+ children: [/* @__PURE__ */ jsx("div", { className: "ld-atom-shell" }), ORBITS.map((index) => /* @__PURE__ */ jsx("div", {
59
+ className: "ld-atom-orbit",
60
+ style: cssVars({ "--ld-atom-tilt": `${index * TILT}deg` }),
61
+ children: /* @__PURE__ */ jsx("div", {
62
+ className: spinClass("atom", easing),
63
+ style: step(index),
64
+ children: /* @__PURE__ */ jsx("div", { className: "ld-atom-ring" })
65
+ })
66
+ }, index))]
67
+ })] });
68
+ }
69
+ export { Atom };
package/dist/blocks.d.ts CHANGED
@@ -1,11 +1,7 @@
1
- import * as react from 'react';
2
- import { SpinnerProps } from './types.js';
3
-
4
- type BlocksSweep = "columns" | "diagonal" | "rows";
5
- declare const DEFAULT_BLOCKS_SWEEP: BlocksSweep;
6
- interface BlocksProps extends SpinnerProps {
7
- sweep?: BlocksSweep;
1
+ import { t as SpinnerProps } from "./types-D9_cXnjI.js";
2
+ export type BlocksSweep = "columns" | "diagonal" | "rows";
3
+ export declare const DEFAULT_BLOCKS_SWEEP: BlocksSweep;
4
+ export interface BlocksProps extends SpinnerProps {
5
+ sweep?: BlocksSweep;
8
6
  }
9
- declare function Blocks({ sweep, ...rest }: BlocksProps): react.JSX.Element;
10
-
11
- export { Blocks, type BlocksProps, type BlocksSweep, DEFAULT_BLOCKS_SWEEP };
7
+ export declare function Blocks({ sweep, ...rest }: BlocksProps): import("react").JSX.Element;
package/dist/blocks.js CHANGED
@@ -1,10 +1,73 @@
1
- import {
2
- Blocks,
3
- DEFAULT_BLOCKS_SWEEP
4
- } from "./chunk-VZX7APSS.js";
5
- import "./chunk-UAO52LUL.js";
6
- import "./chunk-OMNMMKI7.js";
7
- export {
8
- Blocks,
9
- DEFAULT_BLOCKS_SWEEP
1
+ import { SIZE, animation, stagger } from "./motion.js";
2
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ // src/blocks.tsx
5
+ const DEFAULT_BLOCKS_SWEEP = "diagonal";
6
+ const SIDE = 3;
7
+ const CELLS = Array.from({ length: 9 }, (_, index) => ({
8
+ col: index % SIDE,
9
+ row: Math.floor(index / SIDE)
10
+ }));
11
+ const SWEEPS = {
12
+ columns: {
13
+ count: SIDE,
14
+ place: ({ col }) => col
15
+ },
16
+ diagonal: {
17
+ count: 5,
18
+ place: ({ col, row }) => row + col
19
+ },
20
+ rows: {
21
+ count: SIDE,
22
+ place: ({ row }) => row
23
+ }
10
24
  };
25
+ const css = `
26
+ .ld-blocks {
27
+ display: grid;
28
+ grid-template-columns: repeat(${SIDE}, 1fr);
29
+ grid-template-rows: repeat(${SIDE}, 1fr);
30
+ gap: calc(${SIZE} * 0.1);
31
+ }
32
+
33
+ .ld-blocks-cell {
34
+ background: currentColor;
35
+ border-radius: calc(${SIZE} * 0.0625);
36
+ ${animation("blocks", "ld-blocks-sweep", "ease-in-out")}
37
+ }
38
+ ${Object.entries(SWEEPS).map(([sweep, { count }]) => `
39
+ .ld-blocks-cell-${sweep} {
40
+ animation-delay: ${stagger("blocks", count)};
41
+ }
42
+ `).join("")}
43
+ @keyframes ld-blocks-sweep {
44
+ 0%,
45
+ 70%,
46
+ 100% {
47
+ transform: scale(1);
48
+ }
49
+ 35% {
50
+ transform: scale(0);
51
+ }
52
+ }
53
+
54
+ @media (prefers-reduced-motion: reduce) {
55
+ .ld-blocks-cell {
56
+ transform: scale(0.8);
57
+ }
58
+ }
59
+ `;
60
+ function Blocks({ sweep = DEFAULT_BLOCKS_SWEEP, ...rest }) {
61
+ const { place } = SWEEPS[sweep];
62
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
63
+ name: "blocks",
64
+ children: css
65
+ }), /* @__PURE__ */ jsx("div", {
66
+ ...spinnerRoot("blocks", rest),
67
+ children: CELLS.map((cell) => /* @__PURE__ */ jsx("div", {
68
+ className: `ld-blocks-cell ld-blocks-cell-${sweep}`,
69
+ style: step(place(cell))
70
+ }, `${cell.col}-${cell.row}`))
71
+ })] });
72
+ }
73
+ export { Blocks, DEFAULT_BLOCKS_SWEEP };
@@ -1,6 +1,2 @@
1
- import * as react from 'react';
2
- import { SpinnerProps } from './types.js';
3
-
4
- declare function BouncingDots(props: SpinnerProps): react.JSX.Element;
5
-
6
- export { BouncingDots };
1
+ import { t as SpinnerProps } from "./types-D9_cXnjI.js";
2
+ export declare function BouncingDots(props: SpinnerProps): import("react").JSX.Element;
@@ -1,8 +1,44 @@
1
- import {
2
- BouncingDots
3
- } from "./chunk-ULWRXY3A.js";
4
- import "./chunk-UAO52LUL.js";
5
- import "./chunk-OMNMMKI7.js";
6
- export {
7
- BouncingDots
8
- };
1
+ import { SIZE, animation, stagger } from "./motion.js";
2
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ // src/bouncing-dots.tsx
5
+ const DOTS = Array.from({ length: 3 }, (_, index) => index);
6
+ const css = `
7
+ .ld-bouncing-dots {
8
+ display: flex;
9
+ align-items: center;
10
+ gap: calc(${SIZE} * 0.2);
11
+ width: auto;
12
+ }
13
+
14
+ .ld-bouncing-dots-dot {
15
+ width: calc(${SIZE} * 0.25);
16
+ height: calc(${SIZE} * 0.25);
17
+ background: currentColor;
18
+ border-radius: 9999px;
19
+ ${animation("bouncing-dots", "ld-bouncing-dots-bounce", "ease-in-out alternate")}
20
+ animation-delay: ${stagger("bouncing-dots", DOTS.length)};
21
+ }
22
+
23
+ @keyframes ld-bouncing-dots-bounce {
24
+ from {
25
+ transform: translateY(28%);
26
+ }
27
+ to {
28
+ transform: translateY(-72%);
29
+ }
30
+ }
31
+ `;
32
+ function BouncingDots(props) {
33
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
34
+ name: "bouncing-dots",
35
+ children: css
36
+ }), /* @__PURE__ */ jsx("div", {
37
+ ...spinnerRoot("bouncing-dots", props),
38
+ children: DOTS.map((dot) => /* @__PURE__ */ jsx("div", {
39
+ className: "ld-bouncing-dots-dot",
40
+ style: step(dot)
41
+ }, dot))
42
+ })] });
43
+ }
44
+ export { BouncingDots };
@@ -0,0 +1,7 @@
1
+ type Cap = "flat" | "round";
2
+ declare const DEFAULT_CAP: Cap;
3
+ interface CapProps {
4
+ cap?: Cap;
5
+ }
6
+ declare function linecap(cap?: Cap): "butt" | "round";
7
+ export { linecap as i, CapProps as n, DEFAULT_CAP as r, Cap as t };
package/dist/cap.d.ts CHANGED
@@ -1,8 +1,2 @@
1
- type Cap = "flat" | "round";
2
- declare const DEFAULT_CAP: Cap;
3
- interface CapProps {
4
- cap?: Cap;
5
- }
6
- declare function linecap(cap?: Cap): "butt" | "round";
7
-
8
- export { type Cap, type CapProps, DEFAULT_CAP, linecap };
1
+ import { i as linecap, n as CapProps, r as DEFAULT_CAP, t as Cap } from "./cap-B_Mo1a7N.js";
2
+ export { Cap, CapProps, DEFAULT_CAP, linecap };
package/dist/cap.js CHANGED
@@ -1,8 +1,6 @@
1
- import {
2
- DEFAULT_CAP,
3
- linecap
4
- } from "./chunk-JNR4T6LZ.js";
5
- export {
6
- DEFAULT_CAP,
7
- linecap
8
- };
1
+ // src/cap.ts
2
+ const DEFAULT_CAP = "round";
3
+ function linecap(cap = DEFAULT_CAP) {
4
+ return cap === "flat" ? "butt" : "round";
5
+ }
6
+ export { DEFAULT_CAP, linecap };
package/dist/cascade.d.ts CHANGED
@@ -1,9 +1,4 @@
1
- import * as react from 'react';
2
- import { CapProps } from './cap.js';
3
- import { SpinnerProps } from './types.js';
4
-
5
- interface CascadeProps extends SpinnerProps, CapProps {
6
- }
7
- declare function Cascade({ cap, ...rest }: CascadeProps): react.JSX.Element;
8
-
9
- export { Cascade, type CascadeProps };
1
+ import { n as CapProps } from "./cap-B_Mo1a7N.js";
2
+ import { t as SpinnerProps } from "./types-D9_cXnjI.js";
3
+ export interface CascadeProps extends SpinnerProps, CapProps {}
4
+ export declare function Cascade({ cap, ...rest }: CascadeProps): import("react").JSX.Element;
package/dist/cascade.js CHANGED
@@ -1,9 +1,49 @@
1
- import {
2
- Cascade
3
- } from "./chunk-KOYM24WV.js";
4
- import "./chunk-JNR4T6LZ.js";
5
- import "./chunk-UAO52LUL.js";
6
- import "./chunk-OMNMMKI7.js";
7
- export {
8
- Cascade
9
- };
1
+ import { linecap } from "./cap.js";
2
+ import { animation, stagger } from "./motion.js";
3
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/cascade.tsx
6
+ const RADII = [
7
+ 10.5,
8
+ 7,
9
+ 3.5
10
+ ];
11
+ const css = `
12
+ .ld-cascade-arc {
13
+ transform-origin: center;
14
+ ${animation("cascade", "ld-cascade-turn", "cubic-bezier(0.68, -0.75, 0.265, 1.75)")}
15
+ animation-delay: ${stagger("cascade", 24)};
16
+ }
17
+
18
+ @keyframes ld-cascade-turn {
19
+ to {
20
+ transform: rotate(360deg);
21
+ }
22
+ }
23
+ `;
24
+ function Cascade({ cap, ...rest }) {
25
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
26
+ name: "cascade",
27
+ children: css
28
+ }), /* @__PURE__ */ jsx("svg", {
29
+ ...spinnerRoot("cascade", rest),
30
+ fill: "none",
31
+ role: "presentation",
32
+ stroke: "currentColor",
33
+ strokeLinecap: linecap(cap),
34
+ strokeWidth: "2",
35
+ viewBox: "0 0 24 24",
36
+ children: RADII.map((r, index) => {
37
+ const circumference = 2 * Math.PI * r;
38
+ return /* @__PURE__ */ jsx("circle", {
39
+ className: "ld-cascade-arc",
40
+ cx: "12",
41
+ cy: "12",
42
+ r,
43
+ strokeDasharray: `${circumference / 4} ${circumference * 3 / 4}`,
44
+ style: step(index)
45
+ }, r);
46
+ })
47
+ })] });
48
+ }
49
+ export { Cascade };
@@ -0,0 +1,2 @@
1
+ import { t as SpinnerProps } from "./types-D9_cXnjI.js";
2
+ export declare function Chevrons(props: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
2
+ import { fadeCss } from "./fade.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ // src/chevrons.tsx
5
+ const CHEVRONS = [
6
+ 3.5,
7
+ 9,
8
+ 14.5
9
+ ];
10
+ const css = `
11
+ ${fadeCss("chevrons", "chevron", CHEVRONS.length, {
12
+ dim: .2,
13
+ rest: .6
14
+ })}
15
+ `;
16
+ function Chevrons(props) {
17
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
18
+ name: "chevrons",
19
+ children: css
20
+ }), /* @__PURE__ */ jsx("svg", {
21
+ ...spinnerRoot("chevrons", props),
22
+ fill: "none",
23
+ role: "presentation",
24
+ stroke: "currentColor",
25
+ strokeLinecap: "round",
26
+ strokeLinejoin: "round",
27
+ strokeWidth: "2.5",
28
+ viewBox: "0 0 24 24",
29
+ children: CHEVRONS.map((x, index) => /* @__PURE__ */ jsx("path", {
30
+ className: "ld-chevrons-chevron",
31
+ d: `M${x} 6.5l5.5 5.5-5.5 5.5`,
32
+ style: step(index)
33
+ }, x))
34
+ })] });
35
+ }
36
+ export { Chevrons };
@@ -1,6 +1,2 @@
1
- import * as react from 'react';
2
- import { SpinnerProps } from './types.js';
3
-
4
- declare function CircularDots(props: SpinnerProps): react.JSX.Element;
5
-
6
- export { CircularDots };
1
+ import { t as SpinnerProps } from "./types-D9_cXnjI.js";
2
+ export declare function CircularDots(props: SpinnerProps): import("react").JSX.Element;
@@ -1,9 +1,39 @@
1
- import {
2
- CircularDots
3
- } from "./chunk-3WMZVDPS.js";
4
- import "./chunk-PVVWLDIS.js";
5
- import "./chunk-UAO52LUL.js";
6
- import "./chunk-OMNMMKI7.js";
7
- export {
8
- CircularDots
9
- };
1
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
2
+ import { fadeCss } from "./fade.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ // src/circular-dots.tsx
5
+ const DOTS = [
6
+ [8, 1.5],
7
+ [12.5962, 3.4038],
8
+ [14.5, 8],
9
+ [12.5962, 12.5962],
10
+ [8, 14.5],
11
+ [3.4038, 12.5962],
12
+ [1.5, 8],
13
+ [3.4038, 3.4038]
14
+ ];
15
+ const css = `
16
+ ${fadeCss("circular-dots", "dot", DOTS.length, {
17
+ dim: .2,
18
+ rest: .6
19
+ })}
20
+ `;
21
+ function CircularDots(props) {
22
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
23
+ name: "circular-dots",
24
+ children: css
25
+ }), /* @__PURE__ */ jsx("svg", {
26
+ ...spinnerRoot("circular-dots", props),
27
+ fill: "currentColor",
28
+ role: "presentation",
29
+ viewBox: "0 0 16 16",
30
+ children: DOTS.map(([cx, cy], index) => /* @__PURE__ */ jsx("circle", {
31
+ className: "ld-circular-dots-dot",
32
+ cx,
33
+ cy,
34
+ r: "1.5",
35
+ style: step(index)
36
+ }, `${cx}-${cy}`))
37
+ })] });
38
+ }
39
+ export { CircularDots };
@@ -1,6 +1,2 @@
1
- import * as react from 'react';
2
- import { SpinnerProps } from './types.js';
3
-
4
- declare function ClassicV2(props: SpinnerProps): react.JSX.Element;
5
-
6
- export { ClassicV2 };
1
+ import { t as SpinnerProps } from "./types-D9_cXnjI.js";
2
+ export declare function ClassicV2(props: SpinnerProps): import("react").JSX.Element;
@@ -1,9 +1,40 @@
1
- import {
2
- ClassicV2
3
- } from "./chunk-R5ZDKN3Z.js";
4
- import "./chunk-PVVWLDIS.js";
5
- import "./chunk-UAO52LUL.js";
6
- import "./chunk-OMNMMKI7.js";
7
- export {
8
- ClassicV2
9
- };
1
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
2
+ import { fadeCss } from "./fade.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ // src/classic-v2.tsx
5
+ const TICKS = [
6
+ "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",
7
+ "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",
8
+ "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",
9
+ "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",
10
+ "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",
11
+ "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",
12
+ "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",
13
+ "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"
14
+ ];
15
+ const css = `
16
+ ${fadeCss("classic-v2", "tick", TICKS.length, {
17
+ dim: .4,
18
+ rest: .5
19
+ })}
20
+ `;
21
+ function ClassicV2(props) {
22
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
23
+ name: "classic-v2",
24
+ children: css
25
+ }), /* @__PURE__ */ jsx("svg", {
26
+ ...spinnerRoot("classic-v2", props),
27
+ fill: "none",
28
+ role: "presentation",
29
+ viewBox: "0 0 16 16",
30
+ children: /* @__PURE__ */ jsx("g", {
31
+ fill: "currentColor",
32
+ children: TICKS.map((d, tick) => /* @__PURE__ */ jsx("path", {
33
+ className: "ld-classic-v2-tick",
34
+ d,
35
+ style: step(tick)
36
+ }, d))
37
+ })
38
+ })] });
39
+ }
40
+ export { ClassicV2 };
package/dist/classic.d.ts CHANGED
@@ -1,6 +1,2 @@
1
- import * as react from 'react';
2
- import { SpinnerProps } from './types.js';
3
-
4
- declare function Classic(props: SpinnerProps): react.JSX.Element;
5
-
6
- export { Classic };
1
+ import { t as SpinnerProps } from "./types-D9_cXnjI.js";
2
+ export declare function Classic(props: SpinnerProps): import("react").JSX.Element;