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
package/dist/frame.js CHANGED
@@ -1,13 +1,42 @@
1
- import {
2
- SpinnerStyle,
3
- cssVars,
4
- spinnerRoot,
5
- step
6
- } from "./chunk-VRX5ZYC6.js";
7
- import "./chunk-OMNMMKI7.js";
8
- export {
9
- SpinnerStyle,
10
- cssVars,
11
- spinnerRoot,
12
- step
13
- };
1
+ import { DURATION_VAR, PLAY_STATE_VAR, SIZE, SIZE_VAR, STEP_VAR } from "./motion.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/frame.tsx
4
+ function SpinnerStyle({ children, name }) {
5
+ return /* @__PURE__ */ jsx("style", {
6
+ href: `ld-${name}`,
7
+ precedence: "loading-dev",
8
+ children: `
9
+ .ld-${name} {
10
+ width: ${SIZE};
11
+ height: ${SIZE};
12
+ }
13
+ ${children}
14
+ @media (prefers-reduced-motion: reduce) {
15
+ .ld-${name},
16
+ .ld-${name} * {
17
+ animation: none;
18
+ }
19
+ }
20
+ `
21
+ });
22
+ }
23
+ function cssVars(vars) {
24
+ return vars;
25
+ }
26
+ function step(index) {
27
+ return cssVars({ [STEP_VAR]: index });
28
+ }
29
+ function spinnerRoot(name, { className, color, duration, playState, size = 20 }) {
30
+ return {
31
+ "aria-hidden": true,
32
+ className: [`ld-${name}`, className].filter(Boolean).join(" "),
33
+ style: cssVars({
34
+ [SIZE_VAR]: `${size}px`,
35
+ ...color === void 0 ? null : { color },
36
+ ...duration === void 0 ? null : { [DURATION_VAR]: `${duration}ms` },
37
+ ...playState === void 0 ? null : { [PLAY_STATE_VAR]: playState }
38
+ })
39
+ };
40
+ }
41
+ //#endregion
42
+ export { SpinnerStyle, cssVars, spinnerRoot, step };
package/dist/gather.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- import * as react from 'react';
2
- import { SpinnerProps } from './types.js';
3
-
4
- declare function Gather(props: SpinnerProps): react.JSX.Element;
5
-
6
- export { Gather };
1
+ import { t as SpinnerProps } from "./types-BYaenrWm.js";
2
+ //#region src/gather.d.ts
3
+ export declare function Gather(props: SpinnerProps): import("react").JSX.Element;
4
+ //#endregion
package/dist/gather.js CHANGED
@@ -1,8 +1,85 @@
1
- import {
2
- Gather
3
- } from "./chunk-TFHDE6YZ.js";
4
- import "./chunk-VRX5ZYC6.js";
5
- import "./chunk-OMNMMKI7.js";
6
- export {
7
- Gather
8
- };
1
+ import { SIZE, animation } from "./motion.js";
2
+ import { SpinnerStyle, cssVars, spinnerRoot } from "./frame.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/gather.tsx
5
+ const BLOCKS = [
6
+ {
7
+ x: 1,
8
+ y: 1
9
+ },
10
+ {
11
+ x: -1,
12
+ y: 1
13
+ },
14
+ {
15
+ x: 1,
16
+ y: -1
17
+ },
18
+ {
19
+ x: -1,
20
+ y: -1
21
+ }
22
+ ];
23
+ const GAP = 24;
24
+ const PULL = `${(8 / 38 * 100).toFixed(1)}%`;
25
+ const css = `
26
+ .ld-gather-group {
27
+ display: grid;
28
+ grid-template-columns: 1fr 1fr;
29
+ gap: ${GAP}%;
30
+ width: 100%;
31
+ height: 100%;
32
+ ${animation("gather", "ld-gather-turn", "ease-in-out")}
33
+ }
34
+
35
+ .ld-gather-block {
36
+ background: currentColor;
37
+ border-radius: calc(${SIZE} * 0.14);
38
+ ${animation("gather", "ld-gather-pull", "ease-in-out")}
39
+ }
40
+
41
+ @keyframes ld-gather-pull {
42
+ 0%,
43
+ 100% {
44
+ transform: translate(0, 0);
45
+ }
46
+ 30%,
47
+ 60% {
48
+ transform: translate(
49
+ calc(var(--ld-gather-x) * ${PULL}),
50
+ calc(var(--ld-gather-y) * ${PULL})
51
+ );
52
+ }
53
+ }
54
+
55
+ @keyframes ld-gather-turn {
56
+ 0%,
57
+ 30% {
58
+ transform: rotate(0);
59
+ }
60
+ 60%,
61
+ 100% {
62
+ transform: rotate(90deg);
63
+ }
64
+ }
65
+ `;
66
+ function Gather(props) {
67
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
68
+ name: "gather",
69
+ children: css
70
+ }), /* @__PURE__ */ jsx("div", {
71
+ ...spinnerRoot("gather", props),
72
+ children: /* @__PURE__ */ jsx("div", {
73
+ className: "ld-gather-group",
74
+ children: BLOCKS.map(({ x, y }) => /* @__PURE__ */ jsx("div", {
75
+ className: "ld-gather-block",
76
+ style: cssVars({
77
+ "--ld-gather-x": x,
78
+ "--ld-gather-y": y
79
+ })
80
+ }, `${x}${y}`))
81
+ })
82
+ })] });
83
+ }
84
+ //#endregion
85
+ export { Gather };
package/dist/index.d.ts CHANGED
@@ -1,35 +1,35 @@
1
- export { Arc, ArcProps } from './arc.js';
2
- export { Atom, AtomProps } from './atom.js';
3
- export { Blocks, BlocksProps, BlocksSweep, DEFAULT_BLOCKS_SWEEP } from './blocks.js';
4
- export { BouncingDots } from './bouncing-dots.js';
5
- export { Cap, CapProps, DEFAULT_CAP } from './cap.js';
6
- export { Cascade, CascadeProps } from './cascade.js';
7
- export { CircularDots } from './circular-dots.js';
8
- export { Classic } from './classic.js';
9
- export { ClassicV2 } from './classic-v2.js';
10
- export { Clock, ClockProps } from './clock.js';
11
- export { Comet, CometProps } from './comet.js';
12
- export { Compass } from './compass.js';
13
- export { Dual, DualProps } from './dual.js';
14
- export { DEFAULT_EASING, Easing, EasingProps } from './easing.js';
15
- export { Eclipse } from './eclipse.js';
16
- export { Flip } from './flip.js';
17
- export { Gather } from './gather.js';
18
- export { Leap } from './leap.js';
19
- export { LinearDots } from './linear-dots.js';
20
- export { Loading } from './loading.js';
21
- export { Morph } from './morph.js';
22
- export { DURATION_VAR, PLAY_STATE_VAR, SPINNER_MOTION, SpinnerName } from './motion.js';
23
- export { Orbit, OrbitProps } from './orbit.js';
24
- export { Pulse } from './pulse.js';
25
- export { Radar, RadarProps } from './radar.js';
26
- export { Ring, RingProps } from './ring.js';
27
- export { DEFAULT_RIPPLE_DIRECTION, Ripple, RippleDirection, RippleProps } from './ripple.js';
28
- export { Slide } from './slide.js';
29
- export { Snake, SnakeProps } from './snake.js';
30
- export { SPINNERS } from './spinners.js';
31
- export { Swirl } from './swirl.js';
32
- export { Trace, TraceProps } from './trace.js';
33
- export { SpinnerProps } from './types.js';
34
- export { DEFAULT_WAVE_ORIGIN, Wave, WaveOrigin, WaveProps } from './wave.js';
35
- import 'react';
1
+ import { n as CapProps, r as DEFAULT_CAP, t as Cap } from "./cap-Ba3uZx03.js";
2
+ import { i as PLAY_STATE_VAR, l as SpinnerName, n as DURATION_VAR, s as SPINNER_MOTION } from "./motion-D_zUuA3S.js";
3
+ import { n as Easing, r as EasingProps, t as DEFAULT_EASING } from "./easing-DhnLArHS.js";
4
+ import { t as SpinnerProps } from "./types-BYaenrWm.js";
5
+ import { Arc, ArcProps } from "./arc.js";
6
+ import { Atom, AtomProps } from "./atom.js";
7
+ import { Blocks, BlocksProps, BlocksSweep, DEFAULT_BLOCKS_SWEEP } from "./blocks.js";
8
+ import { BouncingDots } from "./bouncing-dots.js";
9
+ import { Cascade, CascadeProps } from "./cascade.js";
10
+ import { CircularDots } from "./circular-dots.js";
11
+ import { ClassicV2 } from "./classic-v2.js";
12
+ import { Classic } from "./classic.js";
13
+ import { Clock, ClockProps } from "./clock.js";
14
+ import { Comet, CometProps } from "./comet.js";
15
+ import { Compass } from "./compass.js";
16
+ import { Dual, DualProps } from "./dual.js";
17
+ import { Eclipse } from "./eclipse.js";
18
+ import { Flip } from "./flip.js";
19
+ import { Gather } from "./gather.js";
20
+ import { Leap } from "./leap.js";
21
+ import { LinearDots } from "./linear-dots.js";
22
+ import { Loading } from "./loading.js";
23
+ import { Morph } from "./morph.js";
24
+ import { Orbit, OrbitProps } from "./orbit.js";
25
+ import { Pulse } from "./pulse.js";
26
+ import { Radar, RadarProps } from "./radar.js";
27
+ import { Ring, RingProps } from "./ring.js";
28
+ import { DEFAULT_RIPPLE_DIRECTION, Ripple, RippleDirection, RippleProps } from "./ripple.js";
29
+ import { Slide } from "./slide.js";
30
+ import { Snake, SnakeProps } from "./snake.js";
31
+ import { Swirl } from "./swirl.js";
32
+ import { Trace, TraceProps } from "./trace.js";
33
+ import { DEFAULT_WAVE_ORIGIN, Wave, WaveOrigin, WaveProps } from "./wave.js";
34
+ import { SPINNERS } from "./spinners.js";
35
+ export { Arc, type ArcProps, Atom, type AtomProps, Blocks, type BlocksProps, type BlocksSweep, BouncingDots, type Cap, type CapProps, Cascade, type CascadeProps, CircularDots, Classic, ClassicV2, Clock, type ClockProps, Comet, type CometProps, Compass, DEFAULT_BLOCKS_SWEEP, DEFAULT_CAP, DEFAULT_EASING, DEFAULT_RIPPLE_DIRECTION, DEFAULT_WAVE_ORIGIN, DURATION_VAR, Dual, type DualProps, type Easing, type EasingProps, Eclipse, Flip, Gather, Leap, LinearDots, Loading, Morph, Orbit, type OrbitProps, PLAY_STATE_VAR, Pulse, Radar, type RadarProps, Ring, type RingProps, Ripple, type RippleDirection, type RippleProps, SPINNERS, SPINNER_MOTION, Slide, Snake, type SnakeProps, type SpinnerName, type SpinnerProps, Swirl, Trace, type TraceProps, Wave, type WaveOrigin, type WaveProps };
package/dist/index.js CHANGED
@@ -1,145 +1,34 @@
1
- import {
2
- SPINNERS
3
- } from "./chunk-5DS5PSRD.js";
4
- import {
5
- Swirl
6
- } from "./chunk-BMJ3AGRK.js";
7
- import {
8
- Trace
9
- } from "./chunk-HDBQBCTN.js";
10
- import {
11
- DEFAULT_WAVE_ORIGIN,
12
- Wave
13
- } from "./chunk-VBI53UGV.js";
14
- import {
15
- Orbit
16
- } from "./chunk-Y7QGIWTL.js";
17
- import {
18
- Pulse
19
- } from "./chunk-FKUMWHUL.js";
20
- import {
21
- Radar
22
- } from "./chunk-5LSP7MQQ.js";
23
- import {
24
- Ring
25
- } from "./chunk-ZLJYYX76.js";
26
- import {
27
- DEFAULT_RIPPLE_DIRECTION,
28
- Ripple
29
- } from "./chunk-IWVH2GKE.js";
30
- import {
31
- Slide
32
- } from "./chunk-IRMB7CHZ.js";
33
- import {
34
- Snake
35
- } from "./chunk-RTKHVDCD.js";
36
- import {
37
- Gather
38
- } from "./chunk-TFHDE6YZ.js";
39
- import {
40
- Leap
41
- } from "./chunk-LIPOYJAI.js";
42
- import {
43
- LinearDots
44
- } from "./chunk-K5XVX5GB.js";
45
- import {
46
- Loading
47
- } from "./chunk-MVL7SVAH.js";
48
- import {
49
- Morph
50
- } from "./chunk-AY4VLQBZ.js";
51
- import {
52
- Classic
53
- } from "./chunk-IZ4TRHOC.js";
54
- import {
55
- Clock
56
- } from "./chunk-IQ2WQZFY.js";
57
- import {
58
- Comet
59
- } from "./chunk-5A6DX4J6.js";
60
- import {
61
- Compass
62
- } from "./chunk-T7OV7MUW.js";
63
- import {
64
- Dual
65
- } from "./chunk-NHN4FV63.js";
66
- import {
67
- Eclipse
68
- } from "./chunk-AHW6IXXT.js";
69
- import {
70
- Flip
71
- } from "./chunk-5R75HMWP.js";
72
- import {
73
- Arc
74
- } from "./chunk-X7BJQCYL.js";
75
- import {
76
- Atom
77
- } from "./chunk-5DLURQGF.js";
78
- import {
79
- DEFAULT_EASING
80
- } from "./chunk-7C6Q6WUN.js";
81
- import {
82
- Blocks,
83
- DEFAULT_BLOCKS_SWEEP
84
- } from "./chunk-PBB2PRPT.js";
85
- import {
86
- BouncingDots
87
- } from "./chunk-UWSCBISJ.js";
88
- import {
89
- Cascade
90
- } from "./chunk-I5CFO2M5.js";
91
- import {
92
- DEFAULT_CAP
93
- } from "./chunk-JNR4T6LZ.js";
94
- import {
95
- CircularDots
96
- } from "./chunk-A43AJR54.js";
97
- import {
98
- ClassicV2
99
- } from "./chunk-T5EUYN7R.js";
100
- import "./chunk-VRX5ZYC6.js";
101
- import {
102
- DURATION_VAR,
103
- PLAY_STATE_VAR,
104
- SPINNER_MOTION
105
- } from "./chunk-OMNMMKI7.js";
106
- export {
107
- Arc,
108
- Atom,
109
- Blocks,
110
- BouncingDots,
111
- Cascade,
112
- CircularDots,
113
- Classic,
114
- ClassicV2,
115
- Clock,
116
- Comet,
117
- Compass,
118
- DEFAULT_BLOCKS_SWEEP,
119
- DEFAULT_CAP,
120
- DEFAULT_EASING,
121
- DEFAULT_RIPPLE_DIRECTION,
122
- DEFAULT_WAVE_ORIGIN,
123
- DURATION_VAR,
124
- Dual,
125
- Eclipse,
126
- Flip,
127
- Gather,
128
- Leap,
129
- LinearDots,
130
- Loading,
131
- Morph,
132
- Orbit,
133
- PLAY_STATE_VAR,
134
- Pulse,
135
- Radar,
136
- Ring,
137
- Ripple,
138
- SPINNERS,
139
- SPINNER_MOTION,
140
- Slide,
141
- Snake,
142
- Swirl,
143
- Trace,
144
- Wave
145
- };
1
+ import { DEFAULT_CAP } from "./cap.js";
2
+ import { DURATION_VAR, PLAY_STATE_VAR, SPINNER_MOTION } from "./motion.js";
3
+ import { DEFAULT_EASING } from "./easing.js";
4
+ import { Arc } from "./arc.js";
5
+ import { Atom } from "./atom.js";
6
+ import { Blocks, DEFAULT_BLOCKS_SWEEP } from "./blocks.js";
7
+ import { BouncingDots } from "./bouncing-dots.js";
8
+ import { Cascade } from "./cascade.js";
9
+ import { CircularDots } from "./circular-dots.js";
10
+ import { ClassicV2 } from "./classic-v2.js";
11
+ import { Classic } from "./classic.js";
12
+ import { Clock } from "./clock.js";
13
+ import { Comet } from "./comet.js";
14
+ import { Compass } from "./compass.js";
15
+ import { Dual } from "./dual.js";
16
+ import { Eclipse } from "./eclipse.js";
17
+ import { Flip } from "./flip.js";
18
+ import { Gather } from "./gather.js";
19
+ import { Leap } from "./leap.js";
20
+ import { LinearDots } from "./linear-dots.js";
21
+ import { Loading } from "./loading.js";
22
+ import { Morph } from "./morph.js";
23
+ import { Orbit } from "./orbit.js";
24
+ import { Pulse } from "./pulse.js";
25
+ import { Radar } from "./radar.js";
26
+ import { Ring } from "./ring.js";
27
+ import { DEFAULT_RIPPLE_DIRECTION, Ripple } from "./ripple.js";
28
+ import { Slide } from "./slide.js";
29
+ import { Snake } from "./snake.js";
30
+ import { Swirl } from "./swirl.js";
31
+ import { Trace } from "./trace.js";
32
+ import { DEFAULT_WAVE_ORIGIN, Wave } from "./wave.js";
33
+ import { SPINNERS } from "./spinners.js";
34
+ export { Arc, Atom, Blocks, BouncingDots, Cascade, CircularDots, Classic, ClassicV2, Clock, Comet, Compass, DEFAULT_BLOCKS_SWEEP, DEFAULT_CAP, DEFAULT_EASING, DEFAULT_RIPPLE_DIRECTION, DEFAULT_WAVE_ORIGIN, DURATION_VAR, Dual, Eclipse, Flip, Gather, Leap, LinearDots, Loading, Morph, Orbit, PLAY_STATE_VAR, Pulse, Radar, Ring, Ripple, SPINNERS, SPINNER_MOTION, Slide, Snake, Swirl, Trace, Wave };
package/dist/leap.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- import * as react from 'react';
2
- import { SpinnerProps } from './types.js';
3
-
4
- declare function Leap(props: SpinnerProps): react.JSX.Element;
5
-
6
- export { Leap };
1
+ import { t as SpinnerProps } from "./types-BYaenrWm.js";
2
+ //#region src/leap.d.ts
3
+ export declare function Leap(props: SpinnerProps): import("react").JSX.Element;
4
+ //#endregion
package/dist/leap.js CHANGED
@@ -1,8 +1,67 @@
1
- import {
2
- Leap
3
- } from "./chunk-LIPOYJAI.js";
4
- import "./chunk-VRX5ZYC6.js";
5
- import "./chunk-OMNMMKI7.js";
6
- export {
7
- Leap
8
- };
1
+ import { SIZE, STEP_VAR, animation, stagger } from "./motion.js";
2
+ import { SpinnerStyle, spinnerRoot, step } from "./frame.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { createElement } from "react";
5
+ //#region src/leap.tsx
6
+ const DOTS = Array.from({ length: 3 }, (_, index) => index);
7
+ const css = `
8
+ .ld-leap {
9
+ --ld-leap-dot: round(calc(${SIZE} * 0.22), 1px);
10
+ --ld-leap-gap: round(down, calc((${SIZE} - var(--ld-leap-dot)) / 2), 1px);
11
+ position: relative;
12
+ }
13
+
14
+ .ld-leap-wrapper {
15
+ position: absolute;
16
+ top: round(calc((${SIZE} - var(--ld-leap-dot)) / 2), 1px);
17
+ left: calc(${SIZE} - var(--ld-leap-dot) - var(--ld-leap-gap) * 2);
18
+ width: calc(var(--ld-leap-gap) * 2 + var(--ld-leap-dot));
19
+ height: var(--ld-leap-dot);
20
+ ${animation("leap", "ld-leap-hop", "ease-in-out")}
21
+ animation-delay: ${stagger("leap", DOTS.length)};
22
+ }
23
+
24
+ .ld-leap-dot {
25
+ position: absolute;
26
+ inset: 0 auto 0 0;
27
+ width: var(--ld-leap-dot);
28
+ background: currentColor;
29
+ border-radius: 50%;
30
+ }
31
+
32
+ @keyframes ld-leap-hop {
33
+ 0% {
34
+ transform: translateX(0) rotate(0);
35
+ }
36
+ 33.33% {
37
+ transform: translateX(0) rotate(180deg);
38
+ }
39
+ 66.66% {
40
+ transform: translateX(calc(var(--ld-leap-gap) * -1)) rotate(180deg);
41
+ }
42
+ 100% {
43
+ transform: translateX(calc(var(--ld-leap-gap) * -2)) rotate(180deg);
44
+ }
45
+ }
46
+
47
+ @media (prefers-reduced-motion: reduce) {
48
+ .ld-leap-wrapper {
49
+ transform: translateX(calc(var(${STEP_VAR}) * var(--ld-leap-gap)));
50
+ }
51
+ }
52
+ `;
53
+ function Leap(props) {
54
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
55
+ name: "leap",
56
+ children: css
57
+ }), /* @__PURE__ */ createElement("div", {
58
+ ...spinnerRoot("leap", props),
59
+ key: props.size
60
+ }, DOTS.map((index) => /* @__PURE__ */ jsx("div", {
61
+ className: "ld-leap-wrapper",
62
+ style: step(index),
63
+ children: /* @__PURE__ */ jsx("div", { className: "ld-leap-dot" })
64
+ }, index)))] });
65
+ }
66
+ //#endregion
67
+ export { Leap };
@@ -1,6 +1,4 @@
1
- import * as react from 'react';
2
- import { SpinnerProps } from './types.js';
3
-
4
- declare function LinearDots(props: SpinnerProps): react.JSX.Element;
5
-
6
- export { LinearDots };
1
+ import { t as SpinnerProps } from "./types-BYaenrWm.js";
2
+ //#region src/linear-dots.d.ts
3
+ export declare function LinearDots(props: SpinnerProps): import("react").JSX.Element;
4
+ //#endregion
@@ -1,8 +1,54 @@
1
- import {
2
- LinearDots
3
- } from "./chunk-K5XVX5GB.js";
4
- import "./chunk-VRX5ZYC6.js";
5
- import "./chunk-OMNMMKI7.js";
6
- export {
7
- LinearDots
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/linear-dots.tsx
5
+ const DOTS = Array.from({ length: 3 }, (_, index) => index);
6
+ const css = `
7
+ .ld-linear-dots {
8
+ display: flex;
9
+ align-items: center;
10
+ gap: calc(${SIZE} * 0.1875);
11
+ width: auto;
12
+ }
13
+
14
+ .ld-linear-dots-dot {
15
+ width: calc(${SIZE} * 0.1875);
16
+ height: calc(${SIZE} * 0.1875);
17
+ background: currentColor;
18
+ border-radius: 9999px;
19
+ ${animation("linear-dots", "ld-linear-dots-fade", "linear")}
20
+ animation-delay: ${stagger("linear-dots", DOTS.length)};
21
+ }
22
+
23
+ @keyframes ld-linear-dots-fade {
24
+ 0% {
25
+ opacity: 1;
26
+ }
27
+ 66.67% {
28
+ opacity: 0.5;
29
+ }
30
+ 100% {
31
+ opacity: 1;
32
+ }
33
+ }
34
+
35
+ @media (prefers-reduced-motion: reduce) {
36
+ .ld-linear-dots-dot {
37
+ opacity: 0.75;
38
+ }
39
+ }
40
+ `;
41
+ function LinearDots(props) {
42
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
43
+ name: "linear-dots",
44
+ children: css
45
+ }), /* @__PURE__ */ jsx("div", {
46
+ ...spinnerRoot("linear-dots", props),
47
+ children: DOTS.map((dot) => /* @__PURE__ */ jsx("div", {
48
+ className: "ld-linear-dots-dot",
49
+ style: step(dot)
50
+ }, dot))
51
+ })] });
52
+ }
53
+ //#endregion
54
+ export { LinearDots };
package/dist/loading.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- import * as react from 'react';
2
- import { SpinnerProps } from './types.js';
3
-
4
- declare function Loading(props: SpinnerProps): react.JSX.Element;
5
-
6
- export { Loading };
1
+ import { t as SpinnerProps } from "./types-BYaenrWm.js";
2
+ //#region src/loading.d.ts
3
+ export declare function Loading(props: SpinnerProps): import("react").JSX.Element;
4
+ //#endregion
package/dist/loading.js CHANGED
@@ -1,8 +1,64 @@
1
- import {
2
- Loading
3
- } from "./chunk-MVL7SVAH.js";
4
- import "./chunk-VRX5ZYC6.js";
5
- import "./chunk-OMNMMKI7.js";
6
- export {
7
- Loading
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/loading.tsx
5
+ const BLOCK = "M0 0h1v1H0zM2 0h1v1H2zM0 2h1v1H0zM2 2h1v1H2z";
6
+ const SEGMENTS = [
7
+ {
8
+ x: 12,
9
+ y: 6
10
+ },
11
+ {
12
+ x: 10,
13
+ y: 10
14
+ },
15
+ {
16
+ x: 6,
17
+ y: 12
18
+ },
19
+ {
20
+ x: 2,
21
+ y: 10
22
+ },
23
+ {
24
+ x: 0,
25
+ y: 6
26
+ },
27
+ {
28
+ x: 2,
29
+ y: 2
30
+ },
31
+ {
32
+ x: 6,
33
+ y: 0
34
+ },
35
+ {
36
+ x: 10,
37
+ y: 2
38
+ }
39
+ ];
40
+ const css = `
41
+ ${fadeCss("loading", "segment", SEGMENTS.length, {
42
+ dim: .2,
43
+ rest: .6
44
+ })}
45
+ `;
46
+ function Loading(props) {
47
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerStyle, {
48
+ name: "loading",
49
+ children: css
50
+ }), /* @__PURE__ */ jsx("svg", {
51
+ ...spinnerRoot("loading", props),
52
+ fill: "currentColor",
53
+ role: "presentation",
54
+ viewBox: "0 0 15 15",
55
+ children: SEGMENTS.map(({ x, y }, segment) => /* @__PURE__ */ jsx("path", {
56
+ className: "ld-loading-segment",
57
+ d: BLOCK,
58
+ style: step(segment),
59
+ transform: `translate(${x} ${y})`
60
+ }, `${x}-${y}`))
61
+ })] });
62
+ }
63
+ //#endregion
64
+ export { Loading };