loading-dev 0.3.3 → 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.
- package/dist/arc.d.ts +11 -0
- package/dist/arc.js +10 -0
- package/dist/atom.d.ts +10 -0
- package/dist/atom.js +9 -0
- package/dist/blocks.d.ts +11 -0
- package/dist/blocks.js +10 -0
- package/dist/bouncing-dots.d.ts +6 -0
- package/dist/bouncing-dots.js +8 -0
- package/dist/cap.d.ts +8 -0
- package/dist/cap.js +8 -0
- package/dist/cascade.d.ts +9 -0
- package/dist/cascade.js +9 -0
- package/dist/chunk-5A6DX4J6.js +62 -0
- package/dist/chunk-5DLURQGF.js +88 -0
- package/dist/chunk-5DS5PSRD.js +124 -0
- package/dist/chunk-5LSP7MQQ.js +69 -0
- package/dist/chunk-5R75HMWP.js +55 -0
- package/dist/chunk-7C6Q6WUN.js +47 -0
- package/dist/chunk-A43AJR54.js +79 -0
- package/dist/chunk-AHW6IXXT.js +78 -0
- package/dist/chunk-AY4VLQBZ.js +57 -0
- package/dist/chunk-BMJ3AGRK.js +62 -0
- package/dist/chunk-FKUMWHUL.js +71 -0
- package/dist/chunk-HDBQBCTN.js +74 -0
- package/dist/chunk-I5CFO2M5.js +78 -0
- package/dist/chunk-IQ2WQZFY.js +51 -0
- package/dist/chunk-IRMB7CHZ.js +88 -0
- package/dist/chunk-IWVH2GKE.js +77 -0
- package/dist/chunk-IZ4TRHOC.js +68 -0
- package/dist/chunk-JNR4T6LZ.js +10 -0
- package/dist/chunk-K5XVX5GB.js +60 -0
- package/dist/chunk-LIPOYJAI.js +74 -0
- package/dist/chunk-MVL7SVAH.js +79 -0
- package/dist/chunk-NHN4FV63.js +78 -0
- package/dist/chunk-OMNMMKI7.js +64 -0
- package/dist/chunk-PBB2PRPT.js +83 -0
- package/dist/chunk-RTKHVDCD.js +82 -0
- package/dist/chunk-T5EUYN7R.js +77 -0
- package/dist/chunk-T7OV7MUW.js +58 -0
- package/dist/chunk-TFHDE6YZ.js +92 -0
- package/dist/chunk-UWSCBISJ.js +56 -0
- package/dist/chunk-VBI53UGV.js +73 -0
- package/dist/chunk-VRX5ZYC6.js +41 -0
- package/dist/chunk-X7BJQCYL.js +56 -0
- package/dist/chunk-Y7QGIWTL.js +57 -0
- package/dist/chunk-ZLJYYX76.js +69 -0
- package/dist/circular-dots.d.ts +6 -0
- package/dist/circular-dots.js +8 -0
- package/dist/classic-v2.d.ts +6 -0
- package/dist/classic-v2.js +8 -0
- package/dist/classic.d.ts +6 -0
- package/dist/classic.js +8 -0
- package/dist/clock.d.ts +10 -0
- package/dist/clock.js +9 -0
- package/dist/comet.d.ts +10 -0
- package/dist/comet.js +9 -0
- package/dist/compass.d.ts +6 -0
- package/dist/compass.js +8 -0
- package/dist/dual.d.ts +11 -0
- package/dist/dual.js +10 -0
- package/dist/easing.d.ts +11 -0
- package/dist/easing.js +11 -0
- package/dist/eclipse.d.ts +6 -0
- package/dist/eclipse.js +8 -0
- package/dist/flip.d.ts +6 -0
- package/dist/flip.js +8 -0
- package/dist/frame.d.ts +20 -0
- package/dist/frame.js +13 -0
- package/dist/gather.d.ts +6 -0
- package/dist/gather.js +8 -0
- package/dist/index.d.ts +35 -199
- package/dist/index.js +105 -1794
- package/dist/leap.d.ts +6 -0
- package/dist/leap.js +8 -0
- package/dist/linear-dots.d.ts +6 -0
- package/dist/linear-dots.js +8 -0
- package/dist/loading.d.ts +6 -0
- package/dist/loading.js +8 -0
- package/dist/morph.d.ts +6 -0
- package/dist/morph.js +8 -0
- package/dist/motion.d.ts +44 -0
- package/dist/motion.js +26 -0
- package/dist/orbit.d.ts +10 -0
- package/dist/orbit.js +9 -0
- package/dist/pulse.d.ts +6 -0
- package/dist/pulse.js +8 -0
- package/dist/radar.d.ts +10 -0
- package/dist/radar.js +9 -0
- package/dist/ring.d.ts +11 -0
- package/dist/ring.js +10 -0
- package/dist/ripple.d.ts +11 -0
- package/dist/ripple.js +10 -0
- package/dist/slide.d.ts +6 -0
- package/dist/slide.js +8 -0
- package/dist/snake.d.ts +11 -0
- package/dist/snake.js +10 -0
- package/dist/spinners.d.ts +68 -0
- package/dist/spinners.js +39 -0
- package/dist/swirl.d.ts +6 -0
- package/dist/swirl.js +8 -0
- package/dist/trace.d.ts +11 -0
- package/dist/trace.js +10 -0
- package/dist/types.d.ts +23 -0
- package/dist/types.js +0 -0
- package/dist/wave.d.ts +11 -0
- package/dist/wave.js +10 -0
- package/package.json +2 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SpinnerStyle,
|
|
3
|
+
cssVars,
|
|
4
|
+
spinnerRoot
|
|
5
|
+
} from "./chunk-VRX5ZYC6.js";
|
|
6
|
+
import {
|
|
7
|
+
SIZE,
|
|
8
|
+
animation
|
|
9
|
+
} from "./chunk-OMNMMKI7.js";
|
|
10
|
+
|
|
11
|
+
// src/gather.tsx
|
|
12
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var BLOCKS = [
|
|
14
|
+
{ x: 1, y: 1 },
|
|
15
|
+
{ x: -1, y: 1 },
|
|
16
|
+
{ x: 1, y: -1 },
|
|
17
|
+
{ x: -1, y: -1 }
|
|
18
|
+
];
|
|
19
|
+
var GAP = 24;
|
|
20
|
+
var GAP_IN = 8;
|
|
21
|
+
var BLOCK = (100 - GAP) / 2;
|
|
22
|
+
var PULL = `${((GAP - GAP_IN) / 2 / BLOCK * 100).toFixed(1)}%`;
|
|
23
|
+
var css = `
|
|
24
|
+
.ld-gather {
|
|
25
|
+
width: ${SIZE};
|
|
26
|
+
height: ${SIZE};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ld-gather-group {
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-template-columns: 1fr 1fr;
|
|
32
|
+
gap: ${GAP}%;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
${animation("gather", "ld-gather-turn", "ease-in-out")}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ld-gather-block {
|
|
39
|
+
background: currentColor;
|
|
40
|
+
border-radius: calc(${SIZE} * 0.14);
|
|
41
|
+
${animation("gather", "ld-gather-pull", "ease-in-out")}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@keyframes ld-gather-pull {
|
|
45
|
+
0%,
|
|
46
|
+
100% {
|
|
47
|
+
transform: translate(0, 0);
|
|
48
|
+
}
|
|
49
|
+
30%,
|
|
50
|
+
60% {
|
|
51
|
+
transform: translate(
|
|
52
|
+
calc(var(--ld-gather-x) * ${PULL}),
|
|
53
|
+
calc(var(--ld-gather-y) * ${PULL})
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@keyframes ld-gather-turn {
|
|
59
|
+
0%,
|
|
60
|
+
30% {
|
|
61
|
+
transform: rotate(0);
|
|
62
|
+
}
|
|
63
|
+
60%,
|
|
64
|
+
100% {
|
|
65
|
+
transform: rotate(90deg);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (prefers-reduced-motion: reduce) {
|
|
70
|
+
.ld-gather-group,
|
|
71
|
+
.ld-gather-block {
|
|
72
|
+
animation: none;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
function Gather(props) {
|
|
77
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "gather", children: css }),
|
|
79
|
+
/* @__PURE__ */ jsx("div", { ...spinnerRoot("gather", props), children: /* @__PURE__ */ jsx("div", { className: "ld-gather-group", children: BLOCKS.map(({ x, y }) => /* @__PURE__ */ jsx(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: "ld-gather-block",
|
|
83
|
+
style: cssVars({ "--ld-gather-x": x, "--ld-gather-y": y })
|
|
84
|
+
},
|
|
85
|
+
`${x}${y}`
|
|
86
|
+
)) }) })
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export {
|
|
91
|
+
Gather
|
|
92
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SpinnerStyle,
|
|
3
|
+
spinnerRoot,
|
|
4
|
+
step
|
|
5
|
+
} from "./chunk-VRX5ZYC6.js";
|
|
6
|
+
import {
|
|
7
|
+
SIZE,
|
|
8
|
+
animation,
|
|
9
|
+
stagger
|
|
10
|
+
} from "./chunk-OMNMMKI7.js";
|
|
11
|
+
|
|
12
|
+
// src/bouncing-dots.tsx
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
var DOTS = Array.from({ length: 3 }, (_, index) => index);
|
|
15
|
+
var css = `
|
|
16
|
+
.ld-bouncing-dots {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: calc(${SIZE} * 0.2);
|
|
20
|
+
height: ${SIZE};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ld-bouncing-dots-dot {
|
|
24
|
+
width: calc(${SIZE} * 0.22);
|
|
25
|
+
height: calc(${SIZE} * 0.22);
|
|
26
|
+
background: currentColor;
|
|
27
|
+
border-radius: 9999px;
|
|
28
|
+
${animation("bouncing-dots", "ld-bouncing-dots-bounce", "ease-in-out alternate")}
|
|
29
|
+
animation-delay: ${stagger("bouncing-dots", DOTS.length)};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@keyframes ld-bouncing-dots-bounce {
|
|
33
|
+
from {
|
|
34
|
+
transform: translateY(28%);
|
|
35
|
+
}
|
|
36
|
+
to {
|
|
37
|
+
transform: translateY(-72%);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (prefers-reduced-motion: reduce) {
|
|
42
|
+
.ld-bouncing-dots-dot {
|
|
43
|
+
animation: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
function BouncingDots(props) {
|
|
48
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "bouncing-dots", children: css }),
|
|
50
|
+
/* @__PURE__ */ jsx("div", { ...spinnerRoot("bouncing-dots", props), children: DOTS.map((dot) => /* @__PURE__ */ jsx("div", { className: "ld-bouncing-dots-dot", style: step(dot) }, dot)) })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
BouncingDots
|
|
56
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SpinnerStyle,
|
|
3
|
+
spinnerRoot,
|
|
4
|
+
step
|
|
5
|
+
} from "./chunk-VRX5ZYC6.js";
|
|
6
|
+
import {
|
|
7
|
+
SIZE,
|
|
8
|
+
STEP_VAR,
|
|
9
|
+
animation,
|
|
10
|
+
stagger
|
|
11
|
+
} from "./chunk-OMNMMKI7.js";
|
|
12
|
+
|
|
13
|
+
// src/wave.tsx
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var DEFAULT_WAVE_ORIGIN = "center";
|
|
16
|
+
var BARS = Array.from({ length: 5 }, (_, index) => index);
|
|
17
|
+
var css = `
|
|
18
|
+
.ld-wave {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
width: ${SIZE};
|
|
23
|
+
height: ${SIZE};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ld-wave-bar {
|
|
27
|
+
width: calc(${SIZE} * 0.12);
|
|
28
|
+
height: 100%;
|
|
29
|
+
background: currentColor;
|
|
30
|
+
border-radius: 9999px;
|
|
31
|
+
${animation("wave", "ld-wave-rise", "ease-in-out")}
|
|
32
|
+
animation-delay: ${stagger("wave", BARS.length)};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ld-wave-bar-bottom {
|
|
36
|
+
align-self: flex-end;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@keyframes ld-wave-rise {
|
|
40
|
+
0%,
|
|
41
|
+
100% {
|
|
42
|
+
height: 30%;
|
|
43
|
+
}
|
|
44
|
+
50% {
|
|
45
|
+
height: 100%;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@media (prefers-reduced-motion: reduce) {
|
|
50
|
+
.ld-wave-bar {
|
|
51
|
+
height: calc((0.4 + var(${STEP_VAR}) * 0.15) * 100%);
|
|
52
|
+
animation: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
function Wave({ origin = DEFAULT_WAVE_ORIGIN, ...rest }) {
|
|
57
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "wave", children: css }),
|
|
59
|
+
/* @__PURE__ */ jsx("div", { ...spinnerRoot("wave", rest), children: BARS.map((index) => /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: `ld-wave-bar ld-wave-bar-${origin}`,
|
|
63
|
+
style: step(index)
|
|
64
|
+
},
|
|
65
|
+
index
|
|
66
|
+
)) })
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
DEFAULT_WAVE_ORIGIN,
|
|
72
|
+
Wave
|
|
73
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_SIZE,
|
|
3
|
+
DURATION_VAR,
|
|
4
|
+
PLAY_STATE_VAR,
|
|
5
|
+
SIZE_VAR,
|
|
6
|
+
STEP_VAR
|
|
7
|
+
} from "./chunk-OMNMMKI7.js";
|
|
8
|
+
|
|
9
|
+
// src/frame.tsx
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function SpinnerStyle({
|
|
12
|
+
children,
|
|
13
|
+
name
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsx("style", { href: `ld-${name}`, precedence: "loading-dev", children });
|
|
16
|
+
}
|
|
17
|
+
function cssVars(vars) {
|
|
18
|
+
return vars;
|
|
19
|
+
}
|
|
20
|
+
function step(index) {
|
|
21
|
+
return cssVars({ [STEP_VAR]: index });
|
|
22
|
+
}
|
|
23
|
+
function spinnerRoot(name, { className, color, duration, playState, size = DEFAULT_SIZE }) {
|
|
24
|
+
return {
|
|
25
|
+
"aria-hidden": true,
|
|
26
|
+
className: [`ld-${name}`, className].filter(Boolean).join(" "),
|
|
27
|
+
style: cssVars({
|
|
28
|
+
[SIZE_VAR]: `${size}px`,
|
|
29
|
+
...color === void 0 ? null : { color },
|
|
30
|
+
...duration === void 0 ? null : { [DURATION_VAR]: `${duration}ms` },
|
|
31
|
+
...playState === void 0 ? null : { [PLAY_STATE_VAR]: playState }
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
SpinnerStyle,
|
|
38
|
+
cssVars,
|
|
39
|
+
step,
|
|
40
|
+
spinnerRoot
|
|
41
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rotationCss,
|
|
3
|
+
spinClass
|
|
4
|
+
} from "./chunk-7C6Q6WUN.js";
|
|
5
|
+
import {
|
|
6
|
+
linecap
|
|
7
|
+
} from "./chunk-JNR4T6LZ.js";
|
|
8
|
+
import {
|
|
9
|
+
SpinnerStyle,
|
|
10
|
+
spinnerRoot
|
|
11
|
+
} from "./chunk-VRX5ZYC6.js";
|
|
12
|
+
import {
|
|
13
|
+
SIZE
|
|
14
|
+
} from "./chunk-OMNMMKI7.js";
|
|
15
|
+
|
|
16
|
+
// src/arc.tsx
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var css = `
|
|
19
|
+
.ld-arc {
|
|
20
|
+
width: ${SIZE};
|
|
21
|
+
height: ${SIZE};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
${rotationCss("arc")}
|
|
25
|
+
`;
|
|
26
|
+
function Arc({ cap, easing, ...rest }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "arc", children: css }),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"svg",
|
|
31
|
+
{
|
|
32
|
+
...spinnerRoot("arc", rest),
|
|
33
|
+
fill: "none",
|
|
34
|
+
role: "presentation",
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
children: /* @__PURE__ */ jsx(
|
|
37
|
+
"circle",
|
|
38
|
+
{
|
|
39
|
+
className: spinClass("arc", easing),
|
|
40
|
+
cx: "12",
|
|
41
|
+
cy: "12",
|
|
42
|
+
r: "10",
|
|
43
|
+
stroke: "currentColor",
|
|
44
|
+
strokeDasharray: "18 44.8",
|
|
45
|
+
strokeLinecap: linecap(cap),
|
|
46
|
+
strokeWidth: "2.5"
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
Arc
|
|
56
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rotationCss,
|
|
3
|
+
spinClass
|
|
4
|
+
} from "./chunk-7C6Q6WUN.js";
|
|
5
|
+
import {
|
|
6
|
+
SpinnerStyle,
|
|
7
|
+
spinnerRoot
|
|
8
|
+
} from "./chunk-VRX5ZYC6.js";
|
|
9
|
+
import {
|
|
10
|
+
SIZE
|
|
11
|
+
} from "./chunk-OMNMMKI7.js";
|
|
12
|
+
|
|
13
|
+
// src/orbit.tsx
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var css = `
|
|
16
|
+
.ld-orbit {
|
|
17
|
+
--ld-orbit-stroke: calc(${SIZE} * 0.0625);
|
|
18
|
+
position: relative;
|
|
19
|
+
width: ${SIZE};
|
|
20
|
+
height: ${SIZE};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ld-orbit-track {
|
|
24
|
+
position: absolute;
|
|
25
|
+
inset: 8%;
|
|
26
|
+
border-radius: 9999px;
|
|
27
|
+
background: conic-gradient(from 180deg, transparent 0deg, currentColor 180deg, transparent 180deg);
|
|
28
|
+
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ld-orbit-stroke)), #000 0);
|
|
29
|
+
mask: radial-gradient(farthest-side, transparent calc(100% - var(--ld-orbit-stroke)), #000 0);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ld-orbit-dot {
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 50%;
|
|
35
|
+
left: 50%;
|
|
36
|
+
width: 25%;
|
|
37
|
+
height: 25%;
|
|
38
|
+
background: currentColor;
|
|
39
|
+
border-radius: 9999px;
|
|
40
|
+
transform: translate(-50%, -50%);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${rotationCss("orbit")}
|
|
44
|
+
`;
|
|
45
|
+
function Orbit({ easing, ...rest }) {
|
|
46
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "orbit", children: css }),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { ...spinnerRoot("orbit", rest), children: [
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: "ld-orbit-dot" }),
|
|
50
|
+
/* @__PURE__ */ jsx("div", { className: `ld-orbit-track ${spinClass("orbit", easing)}` })
|
|
51
|
+
] })
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
Orbit
|
|
57
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rotationCss,
|
|
3
|
+
spinClass
|
|
4
|
+
} from "./chunk-7C6Q6WUN.js";
|
|
5
|
+
import {
|
|
6
|
+
linecap
|
|
7
|
+
} from "./chunk-JNR4T6LZ.js";
|
|
8
|
+
import {
|
|
9
|
+
SpinnerStyle,
|
|
10
|
+
spinnerRoot
|
|
11
|
+
} from "./chunk-VRX5ZYC6.js";
|
|
12
|
+
import {
|
|
13
|
+
SIZE
|
|
14
|
+
} from "./chunk-OMNMMKI7.js";
|
|
15
|
+
|
|
16
|
+
// src/ring.tsx
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var css = `
|
|
19
|
+
.ld-ring {
|
|
20
|
+
width: ${SIZE};
|
|
21
|
+
height: ${SIZE};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
${rotationCss("ring")}
|
|
25
|
+
`;
|
|
26
|
+
function Ring({ cap, easing, ...rest }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "ring", children: css }),
|
|
29
|
+
/* @__PURE__ */ jsxs(
|
|
30
|
+
"svg",
|
|
31
|
+
{
|
|
32
|
+
...spinnerRoot("ring", rest),
|
|
33
|
+
fill: "none",
|
|
34
|
+
role: "presentation",
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
"circle",
|
|
39
|
+
{
|
|
40
|
+
cx: "12",
|
|
41
|
+
cy: "12",
|
|
42
|
+
opacity: "0.2",
|
|
43
|
+
r: "10",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: "2.5"
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
"circle",
|
|
50
|
+
{
|
|
51
|
+
className: spinClass("ring", easing),
|
|
52
|
+
cx: "12",
|
|
53
|
+
cy: "12",
|
|
54
|
+
r: "10",
|
|
55
|
+
stroke: "currentColor",
|
|
56
|
+
strokeDasharray: "16 46.8",
|
|
57
|
+
strokeLinecap: linecap(cap),
|
|
58
|
+
strokeWidth: "2.5"
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
Ring
|
|
69
|
+
};
|
package/dist/classic.js
ADDED
package/dist/clock.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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 ClockProps extends SpinnerProps, EasingProps {
|
|
7
|
+
}
|
|
8
|
+
declare function Clock({ easing, ...rest }: ClockProps): react.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { Clock, type ClockProps };
|
package/dist/clock.js
ADDED
package/dist/comet.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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 CometProps extends SpinnerProps, EasingProps {
|
|
7
|
+
}
|
|
8
|
+
declare function Comet({ easing, ...rest }: CometProps): react.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { Comet, type CometProps };
|
package/dist/comet.js
ADDED
package/dist/compass.js
ADDED
package/dist/dual.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
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 DualProps extends SpinnerProps, EasingProps, CapProps {
|
|
8
|
+
}
|
|
9
|
+
declare function Dual({ cap, easing, ...rest }: DualProps): react.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { Dual, type DualProps };
|
package/dist/dual.js
ADDED
package/dist/easing.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SpinnerName } from './motion.js';
|
|
2
|
+
|
|
3
|
+
type Easing = "linear" | "ease-in-out" | "stacked";
|
|
4
|
+
declare const DEFAULT_EASING: Easing;
|
|
5
|
+
interface EasingProps {
|
|
6
|
+
easing?: Easing;
|
|
7
|
+
}
|
|
8
|
+
declare function spinClass(name: SpinnerName, easing?: Easing): string;
|
|
9
|
+
declare function rotationCss(name: SpinnerName, turn?: string): string;
|
|
10
|
+
|
|
11
|
+
export { DEFAULT_EASING, type Easing, type EasingProps, rotationCss, spinClass };
|
package/dist/easing.js
ADDED
package/dist/eclipse.js
ADDED
package/dist/flip.d.ts
ADDED
package/dist/flip.js
ADDED
package/dist/frame.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { SpinnerName } from './motion.js';
|
|
4
|
+
import { SpinnerProps } from './types.js';
|
|
5
|
+
|
|
6
|
+
declare function SpinnerStyle({ children, name, }: {
|
|
7
|
+
children: string;
|
|
8
|
+
name: SpinnerName;
|
|
9
|
+
}): react.JSX.Element;
|
|
10
|
+
declare function cssVars(vars: CSSProperties & {
|
|
11
|
+
[variable: `--ld-${string}`]: number | string;
|
|
12
|
+
}): CSSProperties;
|
|
13
|
+
declare function step(index: number): CSSProperties;
|
|
14
|
+
declare function spinnerRoot(name: SpinnerName, { className, color, duration, playState, size }: SpinnerProps): {
|
|
15
|
+
"aria-hidden": boolean;
|
|
16
|
+
className: string;
|
|
17
|
+
style: CSSProperties;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { SpinnerStyle, cssVars, spinnerRoot, step };
|