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.
Files changed (114) hide show
  1. package/README.md +7 -9
  2. package/dist/arc.d.ts +7 -11
  3. package/dist/arc.js +31 -10
  4. package/dist/atom.d.ts +6 -10
  5. package/dist/atom.js +70 -9
  6. package/dist/blocks.d.ts +8 -10
  7. package/dist/blocks.js +73 -9
  8. package/dist/bouncing-dots.d.ts +4 -6
  9. package/dist/bouncing-dots.js +45 -8
  10. package/dist/cap-Ba3uZx03.d.ts +9 -0
  11. package/dist/cap.d.ts +2 -8
  12. package/dist/cap.js +7 -8
  13. package/dist/cascade.d.ts +6 -9
  14. package/dist/cascade.js +50 -9
  15. package/dist/circular-dots.d.ts +4 -6
  16. package/dist/circular-dots.js +40 -8
  17. package/dist/classic-v2.d.ts +4 -6
  18. package/dist/classic-v2.js +41 -8
  19. package/dist/classic.d.ts +4 -6
  20. package/dist/classic.js +48 -8
  21. package/dist/clock.d.ts +6 -10
  22. package/dist/clock.js +31 -9
  23. package/dist/comet.d.ts +6 -10
  24. package/dist/comet.js +52 -9
  25. package/dist/compass.d.ts +4 -6
  26. package/dist/compass.js +39 -8
  27. package/dist/dual.d.ts +7 -11
  28. package/dist/dual.js +47 -10
  29. package/dist/easing-DhnLArHS.d.ts +11 -0
  30. package/dist/easing.d.ts +2 -11
  31. package/dist/easing.js +34 -11
  32. package/dist/eclipse.d.ts +4 -6
  33. package/dist/eclipse.js +69 -8
  34. package/dist/fade.d.ts +7 -0
  35. package/dist/fade.js +27 -0
  36. package/dist/flip.d.ts +4 -6
  37. package/dist/flip.js +41 -8
  38. package/dist/frame.d.ts +15 -19
  39. package/dist/frame.js +42 -13
  40. package/dist/gather.d.ts +4 -6
  41. package/dist/gather.js +85 -8
  42. package/dist/index.d.ts +35 -35
  43. package/dist/index.js +34 -145
  44. package/dist/leap.d.ts +4 -6
  45. package/dist/leap.js +67 -8
  46. package/dist/linear-dots.d.ts +4 -6
  47. package/dist/linear-dots.js +54 -8
  48. package/dist/loading.d.ts +4 -6
  49. package/dist/loading.js +64 -8
  50. package/dist/morph.d.ts +4 -6
  51. package/dist/morph.js +40 -8
  52. package/dist/motion-D_zUuA3S.d.ts +45 -0
  53. package/dist/motion.d.ts +2 -44
  54. package/dist/motion.js +50 -25
  55. package/dist/orbit.d.ts +6 -10
  56. package/dist/orbit.js +44 -9
  57. package/dist/pulse.d.ts +4 -6
  58. package/dist/pulse.js +52 -8
  59. package/dist/radar.d.ts +6 -10
  60. package/dist/radar.js +64 -9
  61. package/dist/ring.d.ts +7 -11
  62. package/dist/ring.js +38 -10
  63. package/dist/ripple.d.ts +8 -10
  64. package/dist/ripple.js +57 -10
  65. package/dist/slide.d.ts +4 -6
  66. package/dist/slide.js +74 -8
  67. package/dist/snake.d.ts +7 -11
  68. package/dist/snake.js +59 -10
  69. package/dist/spinners.d.ts +61 -67
  70. package/dist/spinners.js +62 -38
  71. package/dist/swirl.d.ts +4 -6
  72. package/dist/swirl.js +50 -8
  73. package/dist/trace.d.ts +7 -11
  74. package/dist/trace.js +45 -9
  75. package/dist/types-BYaenrWm.d.ts +10 -0
  76. package/dist/types.d.ts +2 -23
  77. package/dist/types.js +1 -0
  78. package/dist/wave.d.ts +8 -10
  79. package/dist/wave.js +56 -10
  80. package/package.json +19 -17
  81. package/dist/chunk-5A6DX4J6.js +0 -62
  82. package/dist/chunk-5DLURQGF.js +0 -88
  83. package/dist/chunk-5DS5PSRD.js +0 -124
  84. package/dist/chunk-5LSP7MQQ.js +0 -69
  85. package/dist/chunk-5R75HMWP.js +0 -55
  86. package/dist/chunk-7C6Q6WUN.js +0 -47
  87. package/dist/chunk-A43AJR54.js +0 -79
  88. package/dist/chunk-AHW6IXXT.js +0 -78
  89. package/dist/chunk-AY4VLQBZ.js +0 -57
  90. package/dist/chunk-BMJ3AGRK.js +0 -62
  91. package/dist/chunk-FKUMWHUL.js +0 -71
  92. package/dist/chunk-HDBQBCTN.js +0 -74
  93. package/dist/chunk-I5CFO2M5.js +0 -78
  94. package/dist/chunk-IQ2WQZFY.js +0 -51
  95. package/dist/chunk-IRMB7CHZ.js +0 -88
  96. package/dist/chunk-IWVH2GKE.js +0 -77
  97. package/dist/chunk-IZ4TRHOC.js +0 -68
  98. package/dist/chunk-JNR4T6LZ.js +0 -10
  99. package/dist/chunk-K5XVX5GB.js +0 -60
  100. package/dist/chunk-LIPOYJAI.js +0 -74
  101. package/dist/chunk-MVL7SVAH.js +0 -79
  102. package/dist/chunk-NHN4FV63.js +0 -78
  103. package/dist/chunk-OMNMMKI7.js +0 -64
  104. package/dist/chunk-PBB2PRPT.js +0 -83
  105. package/dist/chunk-RTKHVDCD.js +0 -82
  106. package/dist/chunk-T5EUYN7R.js +0 -77
  107. package/dist/chunk-T7OV7MUW.js +0 -58
  108. package/dist/chunk-TFHDE6YZ.js +0 -92
  109. package/dist/chunk-UWSCBISJ.js +0 -56
  110. package/dist/chunk-VBI53UGV.js +0 -73
  111. package/dist/chunk-VRX5ZYC6.js +0 -41
  112. package/dist/chunk-X7BJQCYL.js +0 -56
  113. package/dist/chunk-Y7QGIWTL.js +0 -57
  114. package/dist/chunk-ZLJYYX76.js +0 -69
@@ -1,92 +0,0 @@
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
- };
@@ -1,56 +0,0 @@
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
- };
@@ -1,73 +0,0 @@
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
- };
@@ -1,41 +0,0 @@
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
- };
@@ -1,56 +0,0 @@
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
- };
@@ -1,57 +0,0 @@
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
- };
@@ -1,69 +0,0 @@
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
- };