loading-dev 0.3.3 → 0.3.5
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 +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-2LMGBBRJ.js +77 -0
- package/dist/chunk-2OX27TAE.js +69 -0
- package/dist/chunk-2TYML5J2.js +51 -0
- package/dist/chunk-3WMZVDPS.js +61 -0
- package/dist/chunk-4O4ADYWE.js +73 -0
- package/dist/chunk-5UAEBEER.js +78 -0
- package/dist/chunk-A2PZBHTA.js +41 -0
- package/dist/chunk-BAVSTTWG.js +88 -0
- package/dist/chunk-BCIAMPLU.js +87 -0
- package/dist/chunk-DKYEZLIN.js +72 -0
- package/dist/chunk-FQ2U2M7F.js +76 -0
- package/dist/chunk-FWH6VWVK.js +59 -0
- package/dist/chunk-HL7TIIDB.js +124 -0
- package/dist/chunk-IJJULNRU.js +53 -0
- package/dist/chunk-JKLL7YYG.js +85 -0
- package/dist/chunk-JNR4T6LZ.js +10 -0
- package/dist/chunk-JQNF5GYA.js +52 -0
- package/dist/chunk-KAZ5BTXC.js +74 -0
- package/dist/chunk-KOYM24WV.js +72 -0
- package/dist/chunk-L2DUMHO4.js +69 -0
- package/dist/chunk-LDXBT62V.js +57 -0
- package/dist/chunk-MAKBZTL3.js +56 -0
- package/dist/chunk-OMNMMKI7.js +64 -0
- package/dist/chunk-P4BSSDSY.js +51 -0
- package/dist/chunk-PM6DU637.js +70 -0
- package/dist/chunk-PVVWLDIS.js +33 -0
- package/dist/chunk-R5ZDKN3Z.js +59 -0
- package/dist/chunk-RAHAQ7XK.js +61 -0
- package/dist/chunk-SUUR5WMA.js +46 -0
- package/dist/chunk-UAO52LUL.js +48 -0
- package/dist/chunk-ULWRXY3A.js +50 -0
- package/dist/chunk-UOXB5QOZ.js +81 -0
- package/dist/chunk-UXTZTFNZ.js +62 -0
- package/dist/chunk-VZX7APSS.js +82 -0
- package/dist/chunk-YIB63EKJ.js +49 -0
- package/dist/circular-dots.d.ts +6 -0
- package/dist/circular-dots.js +9 -0
- package/dist/classic-v2.d.ts +6 -0
- package/dist/classic-v2.js +9 -0
- package/dist/classic.d.ts +6 -0
- package/dist/classic.js +9 -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/fade.d.ts +8 -0
- package/dist/fade.js +7 -0
- package/dist/flip.d.ts +6 -0
- package/dist/flip.js +8 -0
- package/dist/frame.d.ts +18 -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 +106 -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 +9 -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 +40 -0
- package/dist/swirl.d.ts +6 -0
- package/dist/swirl.js +9 -0
- package/dist/trace.d.ts +11 -0
- package/dist/trace.js +10 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.js +0 -0
- package/dist/wave.d.ts +11 -0
- package/dist/wave.js +10 -0
- package/package.json +12 -9
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rotationCss,
|
|
3
|
+
spinClass
|
|
4
|
+
} from "./chunk-A2PZBHTA.js";
|
|
5
|
+
import {
|
|
6
|
+
linecap
|
|
7
|
+
} from "./chunk-JNR4T6LZ.js";
|
|
8
|
+
import {
|
|
9
|
+
SpinnerStyle,
|
|
10
|
+
spinnerRoot
|
|
11
|
+
} from "./chunk-UAO52LUL.js";
|
|
12
|
+
import {
|
|
13
|
+
SIZE
|
|
14
|
+
} from "./chunk-OMNMMKI7.js";
|
|
15
|
+
|
|
16
|
+
// src/trace.tsx
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var VIEW = 20;
|
|
19
|
+
var SIDE = 17.5;
|
|
20
|
+
var RADIUS = 4;
|
|
21
|
+
var PERIMETER = 4 * (SIDE - 2 * RADIUS) + 2 * Math.PI * RADIUS;
|
|
22
|
+
var DASH = 16;
|
|
23
|
+
var RECT = {
|
|
24
|
+
height: SIDE,
|
|
25
|
+
rx: RADIUS,
|
|
26
|
+
width: SIDE,
|
|
27
|
+
x: (VIEW - SIDE) / 2,
|
|
28
|
+
y: (VIEW - SIDE) / 2
|
|
29
|
+
};
|
|
30
|
+
var css = `
|
|
31
|
+
.ld-trace {
|
|
32
|
+
width: ${SIZE};
|
|
33
|
+
height: ${SIZE};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${rotationCss(
|
|
37
|
+
"trace",
|
|
38
|
+
`to {
|
|
39
|
+
stroke-dashoffset: ${-PERIMETER};
|
|
40
|
+
}`
|
|
41
|
+
)}
|
|
42
|
+
`;
|
|
43
|
+
function Trace({ cap, easing, ...rest }) {
|
|
44
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "trace", children: css }),
|
|
46
|
+
/* @__PURE__ */ jsxs(
|
|
47
|
+
"svg",
|
|
48
|
+
{
|
|
49
|
+
...spinnerRoot("trace", rest),
|
|
50
|
+
fill: "none",
|
|
51
|
+
role: "presentation",
|
|
52
|
+
stroke: "currentColor",
|
|
53
|
+
strokeWidth: "2.5",
|
|
54
|
+
viewBox: `0 0 ${VIEW} ${VIEW}`,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx("rect", { ...RECT, opacity: "0.2" }),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
"rect",
|
|
59
|
+
{
|
|
60
|
+
...RECT,
|
|
61
|
+
className: spinClass("trace", easing),
|
|
62
|
+
strokeDasharray: `${DASH} ${PERIMETER - DASH}`,
|
|
63
|
+
strokeLinecap: linecap(cap)
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
Trace
|
|
74
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
linecap
|
|
3
|
+
} from "./chunk-JNR4T6LZ.js";
|
|
4
|
+
import {
|
|
5
|
+
SpinnerStyle,
|
|
6
|
+
spinnerRoot,
|
|
7
|
+
step
|
|
8
|
+
} from "./chunk-UAO52LUL.js";
|
|
9
|
+
import {
|
|
10
|
+
SIZE,
|
|
11
|
+
animation,
|
|
12
|
+
stagger
|
|
13
|
+
} from "./chunk-OMNMMKI7.js";
|
|
14
|
+
|
|
15
|
+
// src/cascade.tsx
|
|
16
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
var RADII = [10.5, 7, 3.5];
|
|
18
|
+
var SLOTS = 24;
|
|
19
|
+
var css = `
|
|
20
|
+
.ld-cascade {
|
|
21
|
+
width: ${SIZE};
|
|
22
|
+
height: ${SIZE};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ld-cascade-arc {
|
|
26
|
+
transform-origin: center;
|
|
27
|
+
${animation("cascade", "ld-cascade-turn", "cubic-bezier(0.68, -0.75, 0.265, 1.75)")}
|
|
28
|
+
animation-delay: ${stagger("cascade", SLOTS)};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes ld-cascade-turn {
|
|
32
|
+
to {
|
|
33
|
+
transform: rotate(360deg);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
function Cascade({ cap, ...rest }) {
|
|
38
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "cascade", children: css }),
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
"svg",
|
|
42
|
+
{
|
|
43
|
+
...spinnerRoot("cascade", rest),
|
|
44
|
+
fill: "none",
|
|
45
|
+
role: "presentation",
|
|
46
|
+
stroke: "currentColor",
|
|
47
|
+
strokeLinecap: linecap(cap),
|
|
48
|
+
strokeWidth: "2",
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
children: RADII.map((r, index) => {
|
|
51
|
+
const circumference = 2 * Math.PI * r;
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
"circle",
|
|
54
|
+
{
|
|
55
|
+
className: "ld-cascade-arc",
|
|
56
|
+
cx: "12",
|
|
57
|
+
cy: "12",
|
|
58
|
+
r,
|
|
59
|
+
strokeDasharray: `${circumference / 4} ${circumference * 3 / 4}`,
|
|
60
|
+
style: step(index)
|
|
61
|
+
},
|
|
62
|
+
r
|
|
63
|
+
);
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
Cascade
|
|
72
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rotationCss,
|
|
3
|
+
spinClass
|
|
4
|
+
} from "./chunk-A2PZBHTA.js";
|
|
5
|
+
import {
|
|
6
|
+
linecap
|
|
7
|
+
} from "./chunk-JNR4T6LZ.js";
|
|
8
|
+
import {
|
|
9
|
+
SpinnerStyle,
|
|
10
|
+
spinnerRoot
|
|
11
|
+
} from "./chunk-UAO52LUL.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
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rotationCss,
|
|
3
|
+
spinClass
|
|
4
|
+
} from "./chunk-A2PZBHTA.js";
|
|
5
|
+
import {
|
|
6
|
+
SpinnerStyle,
|
|
7
|
+
spinnerRoot
|
|
8
|
+
} from "./chunk-UAO52LUL.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,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rotationCss,
|
|
3
|
+
spinClass
|
|
4
|
+
} from "./chunk-A2PZBHTA.js";
|
|
5
|
+
import {
|
|
6
|
+
linecap
|
|
7
|
+
} from "./chunk-JNR4T6LZ.js";
|
|
8
|
+
import {
|
|
9
|
+
SpinnerStyle,
|
|
10
|
+
spinnerRoot
|
|
11
|
+
} from "./chunk-UAO52LUL.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,64 @@
|
|
|
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 STEP_VAR = "--ld-step";
|
|
6
|
+
var DEFAULT_SIZE = 20;
|
|
7
|
+
var SIZE = `var(${SIZE_VAR}, ${DEFAULT_SIZE}px)`;
|
|
8
|
+
var SPINNER_MOTION = {
|
|
9
|
+
arc: 800,
|
|
10
|
+
atom: 1e3,
|
|
11
|
+
blocks: 1300,
|
|
12
|
+
"bouncing-dots": 500,
|
|
13
|
+
cascade: 1500,
|
|
14
|
+
"circular-dots": 800,
|
|
15
|
+
classic: 1200,
|
|
16
|
+
"classic-v2": 800,
|
|
17
|
+
clock: 1200,
|
|
18
|
+
comet: 700,
|
|
19
|
+
compass: 500,
|
|
20
|
+
dual: 1e3,
|
|
21
|
+
eclipse: 1200,
|
|
22
|
+
flip: 1200,
|
|
23
|
+
gather: 1600,
|
|
24
|
+
leap: 1800,
|
|
25
|
+
"linear-dots": 900,
|
|
26
|
+
loading: 1e3,
|
|
27
|
+
morph: 1200,
|
|
28
|
+
orbit: 750,
|
|
29
|
+
pulse: 1200,
|
|
30
|
+
radar: 1500,
|
|
31
|
+
ring: 800,
|
|
32
|
+
ripple: 1200,
|
|
33
|
+
slide: 2400,
|
|
34
|
+
snake: 1400,
|
|
35
|
+
swirl: 1200,
|
|
36
|
+
trace: 1200,
|
|
37
|
+
wave: 900
|
|
38
|
+
};
|
|
39
|
+
function duration(name) {
|
|
40
|
+
return `var(${DURATION_VAR}, ${SPINNER_MOTION[name]}ms)`;
|
|
41
|
+
}
|
|
42
|
+
function stagger(name, count) {
|
|
43
|
+
return `calc(${duration(name)} * (var(${STEP_VAR}) - ${count}) / ${count})`;
|
|
44
|
+
}
|
|
45
|
+
var PLAY_STATE = `var(${PLAY_STATE_VAR}, running)`;
|
|
46
|
+
function animation(name, keyframes, timing) {
|
|
47
|
+
const runs = [keyframes].flat().map((frames) => `${frames} ${duration(name)} ${timing} infinite`);
|
|
48
|
+
return `animation: ${runs.join(", ")};
|
|
49
|
+
animation-play-state: ${PLAY_STATE};`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
DURATION_VAR,
|
|
54
|
+
PLAY_STATE_VAR,
|
|
55
|
+
SIZE_VAR,
|
|
56
|
+
STEP_VAR,
|
|
57
|
+
DEFAULT_SIZE,
|
|
58
|
+
SIZE,
|
|
59
|
+
SPINNER_MOTION,
|
|
60
|
+
duration,
|
|
61
|
+
stagger,
|
|
62
|
+
PLAY_STATE,
|
|
63
|
+
animation
|
|
64
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SpinnerStyle,
|
|
3
|
+
spinnerRoot
|
|
4
|
+
} from "./chunk-UAO52LUL.js";
|
|
5
|
+
import {
|
|
6
|
+
SIZE,
|
|
7
|
+
animation
|
|
8
|
+
} from "./chunk-OMNMMKI7.js";
|
|
9
|
+
|
|
10
|
+
// src/morph.tsx
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var css = `
|
|
13
|
+
.ld-morph {
|
|
14
|
+
width: ${SIZE};
|
|
15
|
+
height: ${SIZE};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ld-morph-shape {
|
|
19
|
+
width: 64%;
|
|
20
|
+
height: 64%;
|
|
21
|
+
margin: 18%;
|
|
22
|
+
background: currentColor;
|
|
23
|
+
border-radius: calc(${SIZE} * 0.08);
|
|
24
|
+
${animation("morph", "ld-morph-round", "ease-in-out")}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes ld-morph-round {
|
|
28
|
+
0% {
|
|
29
|
+
border-radius: calc(${SIZE} * 0.08);
|
|
30
|
+
transform: rotate(0);
|
|
31
|
+
}
|
|
32
|
+
50% {
|
|
33
|
+
border-radius: 50%;
|
|
34
|
+
transform: rotate(45deg);
|
|
35
|
+
}
|
|
36
|
+
100% {
|
|
37
|
+
border-radius: calc(${SIZE} * 0.08);
|
|
38
|
+
transform: rotate(90deg);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
function Morph(props) {
|
|
43
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "morph", children: css }),
|
|
45
|
+
/* @__PURE__ */ jsx("div", { ...spinnerRoot("morph", props), children: /* @__PURE__ */ jsx("div", { className: "ld-morph-shape" }) })
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
Morph
|
|
51
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SpinnerStyle,
|
|
3
|
+
spinnerRoot
|
|
4
|
+
} from "./chunk-UAO52LUL.js";
|
|
5
|
+
import {
|
|
6
|
+
SIZE,
|
|
7
|
+
animation
|
|
8
|
+
} from "./chunk-OMNMMKI7.js";
|
|
9
|
+
|
|
10
|
+
// src/pulse.tsx
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var css = `
|
|
13
|
+
.ld-pulse {
|
|
14
|
+
width: ${SIZE};
|
|
15
|
+
height: ${SIZE};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ld-pulse-ring {
|
|
19
|
+
transform-origin: center;
|
|
20
|
+
${animation("pulse", "ld-pulse-ripple", "ease-out")}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes ld-pulse-ripple {
|
|
24
|
+
from {
|
|
25
|
+
opacity: 0.4;
|
|
26
|
+
transform: scale(0.25);
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
transform: scale(1);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (prefers-reduced-motion: reduce) {
|
|
35
|
+
.ld-pulse-ring {
|
|
36
|
+
opacity: 0.2;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
function Pulse(props) {
|
|
41
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "pulse", children: css }),
|
|
43
|
+
/* @__PURE__ */ jsxs(
|
|
44
|
+
"svg",
|
|
45
|
+
{
|
|
46
|
+
...spinnerRoot("pulse", props),
|
|
47
|
+
fill: "none",
|
|
48
|
+
role: "presentation",
|
|
49
|
+
viewBox: "0 0 16 16",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
"circle",
|
|
53
|
+
{
|
|
54
|
+
className: "ld-pulse-ring",
|
|
55
|
+
cx: "8",
|
|
56
|
+
cy: "8",
|
|
57
|
+
fill: "currentColor",
|
|
58
|
+
r: "8"
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", fill: "currentColor", r: "2" })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
Pulse
|
|
70
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
animation,
|
|
3
|
+
stagger
|
|
4
|
+
} from "./chunk-OMNMMKI7.js";
|
|
5
|
+
|
|
6
|
+
// src/fade.ts
|
|
7
|
+
function fadeCss(name, element, count, { dim, rest }) {
|
|
8
|
+
return `
|
|
9
|
+
.ld-${name}-${element} {
|
|
10
|
+
${animation(name, `ld-${name}-fade`, "linear")}
|
|
11
|
+
animation-delay: ${stagger(name, count)};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@keyframes ld-${name}-fade {
|
|
15
|
+
from {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}
|
|
18
|
+
to {
|
|
19
|
+
opacity: ${dim};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (prefers-reduced-motion: reduce) {
|
|
24
|
+
.ld-${name}-${element} {
|
|
25
|
+
opacity: ${rest};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
fadeCss
|
|
33
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fadeCss
|
|
3
|
+
} from "./chunk-PVVWLDIS.js";
|
|
4
|
+
import {
|
|
5
|
+
SpinnerStyle,
|
|
6
|
+
spinnerRoot,
|
|
7
|
+
step
|
|
8
|
+
} from "./chunk-UAO52LUL.js";
|
|
9
|
+
import {
|
|
10
|
+
SIZE
|
|
11
|
+
} from "./chunk-OMNMMKI7.js";
|
|
12
|
+
|
|
13
|
+
// src/classic-v2.tsx
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var TICKS = [
|
|
16
|
+
"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",
|
|
17
|
+
"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",
|
|
18
|
+
"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",
|
|
19
|
+
"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",
|
|
20
|
+
"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",
|
|
21
|
+
"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",
|
|
22
|
+
"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",
|
|
23
|
+
"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"
|
|
24
|
+
];
|
|
25
|
+
var css = `
|
|
26
|
+
.ld-classic-v2 {
|
|
27
|
+
width: ${SIZE};
|
|
28
|
+
height: ${SIZE};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
${fadeCss("classic-v2", "tick", TICKS.length, { dim: 0.4, rest: 0.5 })}
|
|
32
|
+
`;
|
|
33
|
+
function ClassicV2(props) {
|
|
34
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
35
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "classic-v2", children: css }),
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
"svg",
|
|
38
|
+
{
|
|
39
|
+
...spinnerRoot("classic-v2", props),
|
|
40
|
+
fill: "none",
|
|
41
|
+
role: "presentation",
|
|
42
|
+
viewBox: "0 0 16 16",
|
|
43
|
+
children: /* @__PURE__ */ jsx("g", { fill: "currentColor", children: TICKS.map((d, tick) => /* @__PURE__ */ jsx(
|
|
44
|
+
"path",
|
|
45
|
+
{
|
|
46
|
+
className: "ld-classic-v2-tick",
|
|
47
|
+
d,
|
|
48
|
+
style: step(tick)
|
|
49
|
+
},
|
|
50
|
+
d
|
|
51
|
+
)) })
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
ClassicV2
|
|
59
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fadeCss
|
|
3
|
+
} from "./chunk-PVVWLDIS.js";
|
|
4
|
+
import {
|
|
5
|
+
SpinnerStyle,
|
|
6
|
+
spinnerRoot,
|
|
7
|
+
step
|
|
8
|
+
} from "./chunk-UAO52LUL.js";
|
|
9
|
+
import {
|
|
10
|
+
SIZE
|
|
11
|
+
} from "./chunk-OMNMMKI7.js";
|
|
12
|
+
|
|
13
|
+
// src/loading.tsx
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var BLOCK = "M0 0h1v1H0zM2 0h1v1H2zM0 2h1v1H0zM2 2h1v1H2z";
|
|
16
|
+
var SEGMENTS = [
|
|
17
|
+
{ x: 12, y: 6 },
|
|
18
|
+
{ x: 10, y: 10 },
|
|
19
|
+
{ x: 6, y: 12 },
|
|
20
|
+
{ x: 2, y: 10 },
|
|
21
|
+
{ x: 0, y: 6 },
|
|
22
|
+
{ x: 2, y: 2 },
|
|
23
|
+
{ x: 6, y: 0 },
|
|
24
|
+
{ x: 10, y: 2 }
|
|
25
|
+
];
|
|
26
|
+
var css = `
|
|
27
|
+
.ld-loading {
|
|
28
|
+
width: ${SIZE};
|
|
29
|
+
height: ${SIZE};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
${fadeCss("loading", "segment", SEGMENTS.length, { dim: 0.2, rest: 0.6 })}
|
|
33
|
+
`;
|
|
34
|
+
function Loading(props) {
|
|
35
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(SpinnerStyle, { name: "loading", children: css }),
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
"svg",
|
|
39
|
+
{
|
|
40
|
+
...spinnerRoot("loading", props),
|
|
41
|
+
fill: "currentColor",
|
|
42
|
+
role: "presentation",
|
|
43
|
+
viewBox: "0 0 15 15",
|
|
44
|
+
children: SEGMENTS.map(({ x, y }, segment) => /* @__PURE__ */ jsx(
|
|
45
|
+
"path",
|
|
46
|
+
{
|
|
47
|
+
className: "ld-loading-segment",
|
|
48
|
+
d: BLOCK,
|
|
49
|
+
style: step(segment),
|
|
50
|
+
transform: `translate(${x} ${y})`
|
|
51
|
+
},
|
|
52
|
+
`${x}-${y}`
|
|
53
|
+
))
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
Loading
|
|
61
|
+
};
|