loading-dev 0.3.4 → 0.3.6
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.
- package/README.md +7 -9
- package/dist/arc.d.ts +7 -11
- package/dist/arc.js +31 -10
- package/dist/atom.d.ts +6 -10
- package/dist/atom.js +70 -9
- package/dist/blocks.d.ts +8 -10
- package/dist/blocks.js +73 -9
- package/dist/bouncing-dots.d.ts +4 -6
- package/dist/bouncing-dots.js +45 -8
- package/dist/cap-Ba3uZx03.d.ts +9 -0
- package/dist/cap.d.ts +2 -8
- package/dist/cap.js +7 -8
- package/dist/cascade.d.ts +6 -9
- package/dist/cascade.js +50 -9
- package/dist/circular-dots.d.ts +4 -6
- package/dist/circular-dots.js +40 -8
- package/dist/classic-v2.d.ts +4 -6
- package/dist/classic-v2.js +41 -8
- package/dist/classic.d.ts +4 -6
- package/dist/classic.js +48 -8
- package/dist/clock.d.ts +6 -10
- package/dist/clock.js +31 -9
- package/dist/comet.d.ts +6 -10
- package/dist/comet.js +52 -9
- package/dist/compass.d.ts +4 -6
- package/dist/compass.js +39 -8
- package/dist/dual.d.ts +7 -11
- package/dist/dual.js +47 -10
- package/dist/easing-DhnLArHS.d.ts +11 -0
- package/dist/easing.d.ts +2 -11
- package/dist/easing.js +34 -11
- package/dist/eclipse.d.ts +4 -6
- package/dist/eclipse.js +69 -8
- package/dist/fade.d.ts +7 -0
- package/dist/fade.js +27 -0
- package/dist/flip.d.ts +4 -6
- package/dist/flip.js +41 -8
- package/dist/frame.d.ts +15 -19
- package/dist/frame.js +42 -13
- package/dist/gather.d.ts +4 -6
- package/dist/gather.js +85 -8
- package/dist/index.d.ts +35 -35
- package/dist/index.js +34 -145
- package/dist/leap.d.ts +4 -6
- package/dist/leap.js +67 -8
- package/dist/linear-dots.d.ts +4 -6
- package/dist/linear-dots.js +54 -8
- package/dist/loading.d.ts +4 -6
- package/dist/loading.js +64 -8
- package/dist/morph.d.ts +4 -6
- package/dist/morph.js +40 -8
- package/dist/motion-D_zUuA3S.d.ts +45 -0
- package/dist/motion.d.ts +2 -44
- package/dist/motion.js +50 -25
- package/dist/orbit.d.ts +6 -10
- package/dist/orbit.js +44 -9
- package/dist/pulse.d.ts +4 -6
- package/dist/pulse.js +52 -8
- package/dist/radar.d.ts +6 -10
- package/dist/radar.js +64 -9
- package/dist/ring.d.ts +7 -11
- package/dist/ring.js +38 -10
- package/dist/ripple.d.ts +8 -10
- package/dist/ripple.js +57 -10
- package/dist/slide.d.ts +4 -6
- package/dist/slide.js +74 -8
- package/dist/snake.d.ts +7 -11
- package/dist/snake.js +59 -10
- package/dist/spinners.d.ts +61 -67
- package/dist/spinners.js +62 -38
- package/dist/swirl.d.ts +4 -6
- package/dist/swirl.js +50 -8
- package/dist/trace.d.ts +7 -11
- package/dist/trace.js +45 -9
- package/dist/types-BYaenrWm.d.ts +10 -0
- package/dist/types.d.ts +2 -23
- package/dist/types.js +1 -0
- package/dist/wave.d.ts +8 -10
- package/dist/wave.js +56 -10
- package/package.json +19 -17
- package/dist/chunk-5A6DX4J6.js +0 -62
- package/dist/chunk-5DLURQGF.js +0 -88
- package/dist/chunk-5DS5PSRD.js +0 -124
- package/dist/chunk-5LSP7MQQ.js +0 -69
- package/dist/chunk-5R75HMWP.js +0 -55
- package/dist/chunk-7C6Q6WUN.js +0 -47
- package/dist/chunk-A43AJR54.js +0 -79
- package/dist/chunk-AHW6IXXT.js +0 -78
- package/dist/chunk-AY4VLQBZ.js +0 -57
- package/dist/chunk-BMJ3AGRK.js +0 -62
- package/dist/chunk-FKUMWHUL.js +0 -71
- package/dist/chunk-HDBQBCTN.js +0 -74
- package/dist/chunk-I5CFO2M5.js +0 -78
- package/dist/chunk-IQ2WQZFY.js +0 -51
- package/dist/chunk-IRMB7CHZ.js +0 -88
- package/dist/chunk-IWVH2GKE.js +0 -77
- package/dist/chunk-IZ4TRHOC.js +0 -68
- package/dist/chunk-JNR4T6LZ.js +0 -10
- package/dist/chunk-K5XVX5GB.js +0 -60
- package/dist/chunk-LIPOYJAI.js +0 -74
- package/dist/chunk-MVL7SVAH.js +0 -79
- package/dist/chunk-NHN4FV63.js +0 -78
- package/dist/chunk-OMNMMKI7.js +0 -64
- package/dist/chunk-PBB2PRPT.js +0 -83
- package/dist/chunk-RTKHVDCD.js +0 -82
- package/dist/chunk-T5EUYN7R.js +0 -77
- package/dist/chunk-T7OV7MUW.js +0 -58
- package/dist/chunk-TFHDE6YZ.js +0 -92
- package/dist/chunk-UWSCBISJ.js +0 -56
- package/dist/chunk-VBI53UGV.js +0 -73
- package/dist/chunk-VRX5ZYC6.js +0 -41
- package/dist/chunk-X7BJQCYL.js +0 -56
- package/dist/chunk-Y7QGIWTL.js +0 -57
- package/dist/chunk-ZLJYYX76.js +0 -69
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# loading-dev
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Beautiful loading indicators for React.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
npm install loading-dev
|
|
@@ -12,19 +12,17 @@ import { Arc } from "loading-dev";
|
|
|
12
12
|
<Arc size={16} />
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
All indicators support `size`, `color` and `duration`. Some also expose additional controls like `easing`, `cap` or spinner-specific props.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
The library exposes `playState` and you can customize any indicator with your own styles.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
The spinners respect reduced motion out of the box and require React 19 or later.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Current list of indicators:
|
|
22
22
|
|
|
23
|
-
|
|
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`.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Made with care by [Jakub](https://x.com/jakubkrehel) and [Paul](https://x.com/paulfaivret).
|
|
25
|
+
Docs and live previews are available at [loading.dev](https://loading.dev).
|
|
28
26
|
|
|
29
27
|
## License
|
|
30
28
|
|
package/dist/arc.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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-Ba3uZx03.js";
|
|
2
|
+
import { r as EasingProps } from "./easing-DhnLArHS.js";
|
|
3
|
+
import { t as SpinnerProps } from "./types-BYaenrWm.js";
|
|
4
|
+
//#region src/arc.d.ts
|
|
5
|
+
export interface ArcProps extends SpinnerProps, EasingProps, CapProps {}
|
|
6
|
+
export declare function Arc({ cap, easing, ...rest }: ArcProps): import("react").JSX.Element;
|
|
7
|
+
//#endregion
|
package/dist/arc.js
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
//#region 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
|
+
//#endregion
|
|
31
|
+
export { Arc };
|
package/dist/atom.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
declare function Atom({ easing, ...rest }: AtomProps): react.JSX.Element;
|
|
9
|
-
|
|
10
|
-
export { Atom, type AtomProps };
|
|
1
|
+
import { r as EasingProps } from "./easing-DhnLArHS.js";
|
|
2
|
+
import { t as SpinnerProps } from "./types-BYaenrWm.js";
|
|
3
|
+
//#region src/atom.d.ts
|
|
4
|
+
export interface AtomProps extends SpinnerProps, EasingProps {}
|
|
5
|
+
export declare function Atom({ easing, ...rest }: AtomProps): import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
package/dist/atom.js
CHANGED
|
@@ -1,9 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
//#region 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
|
+
//#endregion
|
|
70
|
+
export { Atom };
|
package/dist/blocks.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
sweep?: BlocksSweep;
|
|
1
|
+
import { t as SpinnerProps } from "./types-BYaenrWm.js";
|
|
2
|
+
//#region src/blocks.d.ts
|
|
3
|
+
export type BlocksSweep = "columns" | "diagonal" | "rows";
|
|
4
|
+
export declare const DEFAULT_BLOCKS_SWEEP: BlocksSweep;
|
|
5
|
+
export interface BlocksProps extends SpinnerProps {
|
|
6
|
+
sweep?: BlocksSweep;
|
|
8
7
|
}
|
|
9
|
-
declare function Blocks({ sweep, ...rest }: BlocksProps): react.JSX.Element;
|
|
10
|
-
|
|
11
|
-
export { Blocks, type BlocksProps, type BlocksSweep, DEFAULT_BLOCKS_SWEEP };
|
|
8
|
+
export declare function Blocks({ sweep, ...rest }: BlocksProps): import("react").JSX.Element;
|
|
9
|
+
//#endregion
|
package/dist/blocks.js
CHANGED
|
@@ -1,10 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
//#region 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
|
+
//#endregion
|
|
74
|
+
export { Blocks, DEFAULT_BLOCKS_SWEEP };
|
package/dist/bouncing-dots.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { BouncingDots };
|
|
1
|
+
import { t as SpinnerProps } from "./types-BYaenrWm.js";
|
|
2
|
+
//#region src/bouncing-dots.d.ts
|
|
3
|
+
export declare function BouncingDots(props: SpinnerProps): import("react").JSX.Element;
|
|
4
|
+
//#endregion
|
package/dist/bouncing-dots.js
CHANGED
|
@@ -1,8 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
//#region 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
|
+
//#endregion
|
|
45
|
+
export { BouncingDots };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/cap.d.ts
|
|
2
|
+
type Cap = "flat" | "round";
|
|
3
|
+
declare const DEFAULT_CAP: Cap;
|
|
4
|
+
interface CapProps {
|
|
5
|
+
cap?: Cap;
|
|
6
|
+
}
|
|
7
|
+
declare function linecap(cap?: Cap): "butt" | "round";
|
|
8
|
+
//#endregion
|
|
9
|
+
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
|
-
|
|
2
|
-
|
|
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-Ba3uZx03.js";
|
|
2
|
+
export { Cap, CapProps, DEFAULT_CAP, linecap };
|
package/dist/cap.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
1
|
+
//#region src/cap.ts
|
|
2
|
+
const DEFAULT_CAP = "round";
|
|
3
|
+
function linecap(cap = DEFAULT_CAP) {
|
|
4
|
+
return cap === "flat" ? "butt" : "round";
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { DEFAULT_CAP, linecap };
|
package/dist/cascade.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare function Cascade({ cap, ...rest }: CascadeProps): react.JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { Cascade, type CascadeProps };
|
|
1
|
+
import { n as CapProps } from "./cap-Ba3uZx03.js";
|
|
2
|
+
import { t as SpinnerProps } from "./types-BYaenrWm.js";
|
|
3
|
+
//#region src/cascade.d.ts
|
|
4
|
+
export interface CascadeProps extends SpinnerProps, CapProps {}
|
|
5
|
+
export declare function Cascade({ cap, ...rest }: CascadeProps): import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
package/dist/cascade.js
CHANGED
|
@@ -1,9 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
//#region 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
|
+
//#endregion
|
|
50
|
+
export { Cascade };
|
package/dist/circular-dots.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { CircularDots };
|
|
1
|
+
import { t as SpinnerProps } from "./types-BYaenrWm.js";
|
|
2
|
+
//#region src/circular-dots.d.ts
|
|
3
|
+
export declare function CircularDots(props: SpinnerProps): import("react").JSX.Element;
|
|
4
|
+
//#endregion
|
package/dist/circular-dots.js
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
|
|
2
|
+
import { fadeCss } from "./fade.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region 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
|
+
//#endregion
|
|
40
|
+
export { CircularDots };
|
package/dist/classic-v2.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { ClassicV2 };
|
|
1
|
+
import { t as SpinnerProps } from "./types-BYaenrWm.js";
|
|
2
|
+
//#region src/classic-v2.d.ts
|
|
3
|
+
export declare function ClassicV2(props: SpinnerProps): import("react").JSX.Element;
|
|
4
|
+
//#endregion
|
package/dist/classic-v2.js
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
|
|
2
|
+
import { fadeCss } from "./fade.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region 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
|
+
//#endregion
|
|
41
|
+
export { ClassicV2 };
|
package/dist/classic.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { Classic };
|
|
1
|
+
import { t as SpinnerProps } from "./types-BYaenrWm.js";
|
|
2
|
+
//#region src/classic.d.ts
|
|
3
|
+
export declare function Classic(props: SpinnerProps): import("react").JSX.Element;
|
|
4
|
+
//#endregion
|