@wentools/iconic 0.1.2 → 0.2.0
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 +3 -1
- package/dist/icon/Icon.svelte +47 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,13 +61,15 @@ Then use string variants anywhere:
|
|
|
61
61
|
|
|
62
62
|
### Animations
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Seven built-in animations with `prefers-reduced-motion` support:
|
|
65
65
|
|
|
66
66
|
- `spin` — continuous rotation
|
|
67
67
|
- `pulse` — opacity fade
|
|
68
68
|
- `bounce` — vertical bounce
|
|
69
69
|
- `shake` — horizontal shake
|
|
70
70
|
- `ping` — scale + fade out
|
|
71
|
+
- `wiggle` — rotational wobble (attention nudge)
|
|
72
|
+
- `throb` — scale pulse (active/in-progress indicator)
|
|
71
73
|
|
|
72
74
|
```svelte
|
|
73
75
|
<Icon icon={Search} animation="spin" />
|
package/dist/icon/Icon.svelte
CHANGED
|
@@ -56,6 +56,8 @@
|
|
|
56
56
|
bounce: 1.2,
|
|
57
57
|
shake: 0.5,
|
|
58
58
|
ping: 1,
|
|
59
|
+
wiggle: 0.5,
|
|
60
|
+
throb: 1.5,
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
const defaultEasings: Record<IconAnimation, string> = {
|
|
@@ -64,6 +66,8 @@
|
|
|
64
66
|
bounce: 'ease-in-out',
|
|
65
67
|
shake: 'ease-in-out',
|
|
66
68
|
ping: 'cubic-bezier(0, 0, 0.2, 1)',
|
|
69
|
+
wiggle: 'ease-in-out',
|
|
70
|
+
throb: 'ease-in-out',
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
return {
|
|
@@ -173,6 +177,38 @@
|
|
|
173
177
|
}
|
|
174
178
|
}
|
|
175
179
|
|
|
180
|
+
@keyframes wiggle {
|
|
181
|
+
0%,
|
|
182
|
+
100% {
|
|
183
|
+
transform: rotate(0deg);
|
|
184
|
+
}
|
|
185
|
+
15% {
|
|
186
|
+
transform: rotate(-12deg);
|
|
187
|
+
}
|
|
188
|
+
30% {
|
|
189
|
+
transform: rotate(10deg);
|
|
190
|
+
}
|
|
191
|
+
45% {
|
|
192
|
+
transform: rotate(-6deg);
|
|
193
|
+
}
|
|
194
|
+
60% {
|
|
195
|
+
transform: rotate(3deg);
|
|
196
|
+
}
|
|
197
|
+
75% {
|
|
198
|
+
transform: rotate(-1deg);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@keyframes throb {
|
|
203
|
+
0%,
|
|
204
|
+
100% {
|
|
205
|
+
transform: scale(1);
|
|
206
|
+
}
|
|
207
|
+
50% {
|
|
208
|
+
transform: scale(1.15);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
176
212
|
/* Animation classes */
|
|
177
213
|
.animate-spin {
|
|
178
214
|
animation: spin var(--animation-duration) var(--animation-easing) var(--animation-iterations);
|
|
@@ -194,13 +230,23 @@
|
|
|
194
230
|
animation: ping var(--animation-duration) var(--animation-easing) var(--animation-iterations);
|
|
195
231
|
}
|
|
196
232
|
|
|
233
|
+
.animate-wiggle {
|
|
234
|
+
animation: wiggle var(--animation-duration) var(--animation-easing) var(--animation-iterations);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.animate-throb {
|
|
238
|
+
animation: throb var(--animation-duration) var(--animation-easing) var(--animation-iterations);
|
|
239
|
+
}
|
|
240
|
+
|
|
197
241
|
/* Respect user's motion preferences */
|
|
198
242
|
@media (prefers-reduced-motion: reduce) {
|
|
199
243
|
.animate-spin,
|
|
200
244
|
.animate-pulse,
|
|
201
245
|
.animate-bounce,
|
|
202
246
|
.animate-shake,
|
|
203
|
-
.animate-ping
|
|
247
|
+
.animate-ping,
|
|
248
|
+
.animate-wiggle,
|
|
249
|
+
.animate-throb {
|
|
204
250
|
animation: none;
|
|
205
251
|
}
|
|
206
252
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from 'svelte';
|
|
2
|
-
type IconAnimation = 'spin' | 'pulse' | 'bounce' | 'shake' | 'ping';
|
|
2
|
+
type IconAnimation = 'spin' | 'pulse' | 'bounce' | 'shake' | 'ping' | 'wiggle' | 'throb';
|
|
3
3
|
/**
|
|
4
4
|
* Shared type for icon actions used in form inputs, tags, badges, etc.
|
|
5
5
|
* Generic over the icon variant string type so projects can narrow it.
|