loading-dev 0.3.1 → 0.3.3
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 +2 -2
- package/dist/index.d.ts +111 -47
- package/dist/index.js +1189 -265
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@ import { Arc } from "loading-dev";
|
|
|
12
12
|
<Arc size={16} />
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
You can set `size`, `color
|
|
15
|
+
You can set `size`, `color` and `duration`, plus `easing` on the rotating spinners, `cap` on the stroked ones and a prop of its own on a few others. The library exposes `playState` and also allows you to add custom styling. They work in Server Components and respect reduced motion out of the box. Requires React 19 or later.
|
|
16
16
|
|
|
17
|
-
Available: `Arc`, `BouncingDots`, `CircularDots`, `Classic`, `ClassicV2`, `Clock`, `Comet`, `Compass`, `LinearDots`, `Orbit`, `Pulse`, `Radar`, `Ring`, `Swirl`.
|
|
17
|
+
Available: `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`.
|
|
18
18
|
|
|
19
19
|
You can find docs and live previews at [loading.dev](https://loading.dev).
|
|
20
20
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,54 +1,48 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
|
+
type Cap = "flat" | "round";
|
|
4
|
+
declare const DEFAULT_CAP: Cap;
|
|
5
|
+
interface CapProps {
|
|
6
|
+
cap?: Cap;
|
|
7
|
+
}
|
|
8
|
+
|
|
3
9
|
declare const DURATION_VAR = "--ld-duration";
|
|
4
10
|
declare const PLAY_STATE_VAR = "--ld-play-state";
|
|
5
11
|
declare const SPINNER_MOTION: {
|
|
6
|
-
readonly arc:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly "bouncing-dots":
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
readonly
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
readonly
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
readonly
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
readonly
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
readonly
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
readonly pulse: {
|
|
37
|
-
readonly duration: 1200;
|
|
38
|
-
};
|
|
39
|
-
readonly radar: {
|
|
40
|
-
readonly duration: 1500;
|
|
41
|
-
};
|
|
42
|
-
readonly ring: {
|
|
43
|
-
readonly duration: 800;
|
|
44
|
-
};
|
|
45
|
-
readonly swirl: {
|
|
46
|
-
readonly duration: 1200;
|
|
47
|
-
};
|
|
12
|
+
readonly arc: 800;
|
|
13
|
+
readonly atom: 1000;
|
|
14
|
+
readonly blocks: 1300;
|
|
15
|
+
readonly "bouncing-dots": 500;
|
|
16
|
+
readonly cascade: 1500;
|
|
17
|
+
readonly "circular-dots": 800;
|
|
18
|
+
readonly classic: 1200;
|
|
19
|
+
readonly "classic-v2": 800;
|
|
20
|
+
readonly clock: 1200;
|
|
21
|
+
readonly comet: 700;
|
|
22
|
+
readonly compass: 500;
|
|
23
|
+
readonly dual: 1000;
|
|
24
|
+
readonly eclipse: 1200;
|
|
25
|
+
readonly flip: 1200;
|
|
26
|
+
readonly gather: 1600;
|
|
27
|
+
readonly leap: 1800;
|
|
28
|
+
readonly "linear-dots": 900;
|
|
29
|
+
readonly loading: 1000;
|
|
30
|
+
readonly morph: 1200;
|
|
31
|
+
readonly orbit: 750;
|
|
32
|
+
readonly pulse: 1200;
|
|
33
|
+
readonly radar: 1500;
|
|
34
|
+
readonly ring: 800;
|
|
35
|
+
readonly ripple: 1200;
|
|
36
|
+
readonly slide: 2400;
|
|
37
|
+
readonly snake: 1400;
|
|
38
|
+
readonly swirl: 1200;
|
|
39
|
+
readonly trace: 1200;
|
|
40
|
+
readonly wave: 900;
|
|
48
41
|
};
|
|
49
42
|
type SpinnerName = keyof typeof SPINNER_MOTION;
|
|
50
43
|
|
|
51
44
|
type Easing = "linear" | "ease-in-out" | "stacked";
|
|
45
|
+
declare const DEFAULT_EASING: Easing;
|
|
52
46
|
interface EasingProps {
|
|
53
47
|
easing?: Easing;
|
|
54
48
|
}
|
|
@@ -75,12 +69,27 @@ interface SpinnerProps {
|
|
|
75
69
|
size?: number;
|
|
76
70
|
}
|
|
77
71
|
|
|
78
|
-
interface ArcProps extends SpinnerProps, EasingProps {
|
|
72
|
+
interface ArcProps extends SpinnerProps, EasingProps, CapProps {
|
|
73
|
+
}
|
|
74
|
+
declare function Arc({ cap, easing, ...rest }: ArcProps): react.JSX.Element;
|
|
75
|
+
|
|
76
|
+
interface AtomProps extends SpinnerProps, EasingProps {
|
|
79
77
|
}
|
|
80
|
-
declare function
|
|
78
|
+
declare function Atom({ easing, ...rest }: AtomProps): react.JSX.Element;
|
|
79
|
+
|
|
80
|
+
type BlocksSweep = "columns" | "diagonal" | "rows";
|
|
81
|
+
declare const DEFAULT_BLOCKS_SWEEP: BlocksSweep;
|
|
82
|
+
interface BlocksProps extends SpinnerProps {
|
|
83
|
+
sweep?: BlocksSweep;
|
|
84
|
+
}
|
|
85
|
+
declare function Blocks({ sweep, ...rest }: BlocksProps): react.JSX.Element;
|
|
81
86
|
|
|
82
87
|
declare function BouncingDots(props: SpinnerProps): react.JSX.Element;
|
|
83
88
|
|
|
89
|
+
interface CascadeProps extends SpinnerProps, CapProps {
|
|
90
|
+
}
|
|
91
|
+
declare function Cascade({ cap, ...rest }: CascadeProps): react.JSX.Element;
|
|
92
|
+
|
|
84
93
|
declare function CircularDots(props: SpinnerProps): react.JSX.Element;
|
|
85
94
|
|
|
86
95
|
declare function Classic(props: SpinnerProps): react.JSX.Element;
|
|
@@ -97,8 +106,24 @@ declare function Comet({ easing, ...rest }: CometProps): react.JSX.Element;
|
|
|
97
106
|
|
|
98
107
|
declare function Compass(props: SpinnerProps): react.JSX.Element;
|
|
99
108
|
|
|
109
|
+
interface DualProps extends SpinnerProps, EasingProps, CapProps {
|
|
110
|
+
}
|
|
111
|
+
declare function Dual({ cap, easing, ...rest }: DualProps): react.JSX.Element;
|
|
112
|
+
|
|
113
|
+
declare function Eclipse(props: SpinnerProps): react.JSX.Element;
|
|
114
|
+
|
|
115
|
+
declare function Flip(props: SpinnerProps): react.JSX.Element;
|
|
116
|
+
|
|
117
|
+
declare function Gather(props: SpinnerProps): react.JSX.Element;
|
|
118
|
+
|
|
119
|
+
declare function Leap(props: SpinnerProps): react.JSX.Element;
|
|
120
|
+
|
|
100
121
|
declare function LinearDots(props: SpinnerProps): react.JSX.Element;
|
|
101
122
|
|
|
123
|
+
declare function Loading(props: SpinnerProps): react.JSX.Element;
|
|
124
|
+
|
|
125
|
+
declare function Morph(props: SpinnerProps): react.JSX.Element;
|
|
126
|
+
|
|
102
127
|
interface OrbitProps extends SpinnerProps, EasingProps {
|
|
103
128
|
}
|
|
104
129
|
declare function Orbit({ easing, ...rest }: OrbitProps): react.JSX.Element;
|
|
@@ -109,27 +134,66 @@ interface RadarProps extends SpinnerProps, EasingProps {
|
|
|
109
134
|
}
|
|
110
135
|
declare function Radar({ easing, ...rest }: RadarProps): react.JSX.Element;
|
|
111
136
|
|
|
112
|
-
interface RingProps extends SpinnerProps, EasingProps {
|
|
137
|
+
interface RingProps extends SpinnerProps, EasingProps, CapProps {
|
|
138
|
+
}
|
|
139
|
+
declare function Ring({ cap, easing, ...rest }: RingProps): react.JSX.Element;
|
|
140
|
+
|
|
141
|
+
type RippleDirection = "in" | "out";
|
|
142
|
+
declare const DEFAULT_RIPPLE_DIRECTION: RippleDirection;
|
|
143
|
+
interface RippleProps extends SpinnerProps {
|
|
144
|
+
direction?: RippleDirection;
|
|
145
|
+
}
|
|
146
|
+
declare function Ripple({ direction, ...rest }: RippleProps): react.JSX.Element;
|
|
147
|
+
|
|
148
|
+
declare function Slide(props: SpinnerProps): react.JSX.Element;
|
|
149
|
+
|
|
150
|
+
interface SnakeProps extends SpinnerProps, EasingProps, CapProps {
|
|
113
151
|
}
|
|
114
|
-
declare function
|
|
152
|
+
declare function Snake({ cap, easing, ...rest }: SnakeProps): react.JSX.Element;
|
|
115
153
|
|
|
116
154
|
declare function Swirl(props: SpinnerProps): react.JSX.Element;
|
|
117
155
|
|
|
156
|
+
interface TraceProps extends SpinnerProps, EasingProps, CapProps {
|
|
157
|
+
}
|
|
158
|
+
declare function Trace({ cap, easing, ...rest }: TraceProps): react.JSX.Element;
|
|
159
|
+
|
|
160
|
+
type WaveOrigin = "bottom" | "center";
|
|
161
|
+
declare const DEFAULT_WAVE_ORIGIN: WaveOrigin;
|
|
162
|
+
interface WaveProps extends SpinnerProps {
|
|
163
|
+
origin?: WaveOrigin;
|
|
164
|
+
}
|
|
165
|
+
declare function Wave({ origin, ...rest }: WaveProps): react.JSX.Element;
|
|
166
|
+
|
|
118
167
|
declare const SPINNERS: {
|
|
119
168
|
arc: typeof Arc;
|
|
169
|
+
atom: typeof Atom;
|
|
170
|
+
blocks: typeof Blocks;
|
|
120
171
|
"bouncing-dots": typeof BouncingDots;
|
|
172
|
+
cascade: typeof Cascade;
|
|
121
173
|
"circular-dots": typeof CircularDots;
|
|
122
174
|
classic: typeof Classic;
|
|
123
175
|
"classic-v2": typeof ClassicV2;
|
|
124
176
|
clock: typeof Clock;
|
|
125
177
|
comet: typeof Comet;
|
|
126
178
|
compass: typeof Compass;
|
|
179
|
+
dual: typeof Dual;
|
|
180
|
+
eclipse: typeof Eclipse;
|
|
181
|
+
flip: typeof Flip;
|
|
182
|
+
gather: typeof Gather;
|
|
183
|
+
leap: typeof Leap;
|
|
127
184
|
"linear-dots": typeof LinearDots;
|
|
185
|
+
loading: typeof Loading;
|
|
186
|
+
morph: typeof Morph;
|
|
128
187
|
orbit: typeof Orbit;
|
|
129
188
|
pulse: typeof Pulse;
|
|
130
189
|
radar: typeof Radar;
|
|
131
190
|
ring: typeof Ring;
|
|
191
|
+
ripple: typeof Ripple;
|
|
192
|
+
slide: typeof Slide;
|
|
193
|
+
snake: typeof Snake;
|
|
132
194
|
swirl: typeof Swirl;
|
|
195
|
+
trace: typeof Trace;
|
|
196
|
+
wave: typeof Wave;
|
|
133
197
|
};
|
|
134
198
|
|
|
135
|
-
export { Arc, type ArcProps, BouncingDots, CircularDots, Classic, ClassicV2, Clock, type ClockProps, Comet, type CometProps, Compass, DURATION_VAR, type Easing, type EasingProps, LinearDots, Orbit, type OrbitProps, PLAY_STATE_VAR, Pulse, Radar, type RadarProps, Ring, type RingProps, SPINNERS, SPINNER_MOTION, type SpinnerName, type SpinnerProps, Swirl };
|
|
199
|
+
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 };
|