use-scroll-animate 3.2.0 → 3.3.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -0
  3. package/README_ja.md +1 -0
  4. package/README_zh.md +1 -0
  5. package/dist/chunks/{index-tags-DCTX4F9b.cjs → index-tags-Cz4iTBEK.cjs} +2 -1
  6. package/dist/chunks/{index-tags-DCTX4F9b.cjs.map → index-tags-Cz4iTBEK.cjs.map} +1 -1
  7. package/dist/chunks/{index-tags-DZ-gjMZc.js → index-tags-Dc_Z4yAY.js} +2 -1
  8. package/dist/chunks/{index-tags-DZ-gjMZc.js.map → index-tags-Dc_Z4yAY.js.map} +1 -1
  9. package/dist/components/jsx.d.cts +1 -0
  10. package/dist/components/jsx.d.ts +1 -0
  11. package/dist/components/lazy.cjs +2 -1
  12. package/dist/components/lazy.cjs.map +1 -1
  13. package/dist/components/lazy.d.cts +1 -0
  14. package/dist/components/lazy.d.ts +1 -0
  15. package/dist/components/lazy.js +2 -1
  16. package/dist/components/lazy.js.map +1 -1
  17. package/dist/components/react.cjs +1 -1
  18. package/dist/components/react.js +1 -1
  19. package/dist/components/svg.cjs +355 -0
  20. package/dist/components/svg.cjs.map +1 -0
  21. package/dist/components/svg.css +3 -0
  22. package/dist/components/svg.d.cts +148 -0
  23. package/dist/components/svg.d.ts +148 -0
  24. package/dist/components/svg.js +342 -0
  25. package/dist/components/svg.js.map +1 -0
  26. package/dist/components/vue.cjs +2 -1
  27. package/dist/components/vue.cjs.map +1 -1
  28. package/dist/components/vue.d.cts +64 -0
  29. package/dist/components/vue.d.ts +64 -0
  30. package/dist/components/vue.js +2 -1
  31. package/dist/components/vue.js.map +1 -1
  32. package/dist/components.cjs +14 -1
  33. package/dist/components.cjs.map +1 -1
  34. package/dist/components.css +1 -0
  35. package/dist/components.d.cts +104 -2
  36. package/dist/components.d.ts +104 -2
  37. package/dist/components.js +5 -2
  38. package/dist/components.js.map +1 -1
  39. package/dist/components.umd.js +2 -2
  40. package/dist/components.umd.js.map +1 -1
  41. package/docs/components.md +10 -0
  42. package/package.json +13 -2
@@ -0,0 +1,342 @@
1
+ import { f as clamp, m as motionScale, d as caf, p as prefersReducedMotion, n as now, r as raf, h as defineElement, i as EASE_OUT } from '../chunks/base-Cu-86Z31.js';
2
+ export { a as configureComponents } from '../chunks/base-Cu-86Z31.js';
3
+
4
+ const NUM = /-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi;
5
+ /** `true` when two path strings share the same commands (so their numbers can be interpolated). */
6
+ function pathsCompatible(a, b) {
7
+ return a.replace(NUM, '#').replace(/[\s,]+/g, ' ').trim() === b.replace(NUM, '#').replace(/[\s,]+/g, ' ').trim();
8
+ }
9
+ /**
10
+ * Path data between `a` and `b` at `t` (0–1). Paths with the same command
11
+ * structure morph number-by-number; others switch at the midpoint.
12
+ */
13
+ function interpolatePath(a, b, t) {
14
+ if (t <= 0)
15
+ return a;
16
+ if (t >= 1)
17
+ return b;
18
+ if (!pathsCompatible(a, b))
19
+ return t < 0.5 ? a : b;
20
+ const nb = b.match(NUM) || [];
21
+ let i = 0;
22
+ return a.replace(NUM, (n) => {
23
+ const v = Number(n) + (Number(nb[i++]) - Number(n)) * t;
24
+ return String(Math.round(v * 1000) / 1000);
25
+ });
26
+ }
27
+ const ease = (t) => 1 - Math.pow(1 - t, 3);
28
+ /** Animate a `<path>`'s `d` to `to`. Resolves when done; instant under reduced motion. */
29
+ function morphTo(path, to, o = {}) {
30
+ const from = path.getAttribute('d') || to;
31
+ const dur = (o.duration ?? 500) * motionScale();
32
+ const prev = path.__usaMorph;
33
+ if (prev)
34
+ caf(prev);
35
+ if (prefersReducedMotion() || dur <= 0 || from === to) {
36
+ path.setAttribute('d', to);
37
+ return Promise.resolve();
38
+ }
39
+ const fn = o.easing || ease;
40
+ const t0 = now();
41
+ return new Promise((resolve) => {
42
+ const step = () => {
43
+ const t = clamp((now() - t0) / dur, 0, 1);
44
+ path.setAttribute('d', interpolatePath(from, to, fn(t)));
45
+ if (t < 1)
46
+ path.__usaMorph = raf(step);
47
+ else {
48
+ path.__usaMorph = 0;
49
+ resolve();
50
+ }
51
+ };
52
+ path.__usaMorph = raf(step);
53
+ });
54
+ }
55
+ const DRAWABLE = 'path, line, polyline, polygon, circle, ellipse, rect';
56
+ /**
57
+ * Prepare every stroke in `root` for line drawing (normalised `pathLength=1`,
58
+ * so no `getTotalLength()` is needed) and return a function that sets
59
+ * progress 0–1, optionally staggered between shapes.
60
+ */
61
+ function drawLines(root, o = {}) {
62
+ const shapes = Array.from(root.querySelectorAll(DRAWABLE));
63
+ shapes.forEach((s) => {
64
+ s.setAttribute('pathLength', '1');
65
+ s.style.strokeDasharray = '1 1';
66
+ });
67
+ const st = clamp(o.stagger ?? 0, 0, 0.9);
68
+ return (p) => {
69
+ const n = shapes.length;
70
+ shapes.forEach((s, i) => {
71
+ const start = n > 1 ? (i / (n - 1)) * st : 0;
72
+ const local = clamp((p - start) / (1 - st || 1), 0, 1);
73
+ s.style.strokeDashoffset = String(1 - local);
74
+ });
75
+ };
76
+ }
77
+
78
+ var css = "usa-draw{display:inline-block}usa-draw svg :is(path,line,polyline,polygon,circle,ellipse,rect){transition:fill-opacity 0.6s ease}usa-draw[fill]:not([data-drawn]) svg :is(path,polygon,circle,ellipse,rect){fill-opacity:0}usa-morph{display:inline-block;line-height:0}usa-morph svg{width:100%;height:100%;fill:currentColor}usa-morph[role=\"button\"]{cursor:pointer}usa-mask-reveal{display:block}usa-mask-reveal[data-state=\"visible\"]{clip-path:none !important}usa-anim-icon{display:inline-flex;line-height:0;vertical-align:middle}usa-anim-icon svg{overflow:visible}@media (prefers-reduced-motion:reduce){usa-mask-reveal{clip-path:none !important}usa-draw svg *{stroke-dashoffset:0 !important}}";
79
+
80
+ function defineDraw(tag = 'usa-draw') {
81
+ return defineElement(tag, (Base) => class UsaDraw extends Base {
82
+ constructor() {
83
+ super(...arguments);
84
+ this._set = () => { };
85
+ this._p = 0;
86
+ this._id = 0;
87
+ }
88
+ get progress() {
89
+ return this._p;
90
+ }
91
+ set progress(p) {
92
+ this._p = clamp(p, 0, 1);
93
+ this._set(this._p);
94
+ this.toggleAttribute('data-drawn', this._p >= 1);
95
+ }
96
+ play() {
97
+ caf(this._id);
98
+ if (this.reduced) {
99
+ this.progress = 1;
100
+ return void this.emit('complete');
101
+ }
102
+ const dur = this.num('duration', 1600) * motionScale();
103
+ const t0 = now();
104
+ this.progress = 0;
105
+ const step = () => {
106
+ this.progress = (now() - t0) / dur;
107
+ if (this._p < 1)
108
+ this._id = raf(step);
109
+ else
110
+ this.emit('complete');
111
+ };
112
+ this._id = raf(step);
113
+ }
114
+ mount() {
115
+ this._set = drawLines(this, { stagger: this.num('stagger', 0.2) });
116
+ const trigger = this.str('trigger', 'view');
117
+ if (this.reduced) {
118
+ this.progress = 1;
119
+ return;
120
+ }
121
+ this.progress = 0;
122
+ if (trigger === 'scrub') {
123
+ const update = () => {
124
+ const r = this.getBoundingClientRect();
125
+ const vh = window.innerHeight || 1;
126
+ this.progress = (vh - r.top) / (vh * 0.6 + r.height * 0.4 || 1);
127
+ };
128
+ this.listen(window, 'scroll', update, { passive: true });
129
+ update();
130
+ }
131
+ else if (trigger === 'hover')
132
+ this.listen(this, 'pointerenter', () => this.play());
133
+ else if (trigger === 'click')
134
+ this.listen(this, 'click', () => this.play());
135
+ else {
136
+ let done = false;
137
+ this.inView((v) => {
138
+ if (v && (!done || this.flag('repeat'))) {
139
+ done = true;
140
+ this.play();
141
+ }
142
+ else if (!v && this.flag('repeat'))
143
+ this.progress = 0;
144
+ }, { threshold: 0.3 });
145
+ }
146
+ this.onCleanup(() => caf(this._id));
147
+ }
148
+ }, { id: 'svg', text: css });
149
+ }
150
+
151
+ function defineMorph(tag = 'usa-morph') {
152
+ return defineElement(tag, (Base) => class UsaMorph extends Base {
153
+ constructor() {
154
+ super(...arguments);
155
+ this._i = 0;
156
+ this._path = null;
157
+ }
158
+ static get observedAttributes() {
159
+ return ['paths', 'trigger'];
160
+ }
161
+ get index() {
162
+ return this._i;
163
+ }
164
+ list() {
165
+ return this.str('paths').split('|').map((s) => s.trim()).filter(Boolean);
166
+ }
167
+ next() {
168
+ const l = this.list();
169
+ if (!this._path || l.length < 2)
170
+ return Promise.resolve();
171
+ this._i = (this._i + 1) % l.length;
172
+ this.emit('change', { index: this._i });
173
+ return morphTo(this._path, l[this._i], { duration: this.num('duration', 600) });
174
+ }
175
+ mount() {
176
+ let path = this.querySelector('path');
177
+ if (!path) {
178
+ this.innerHTML = '<svg viewBox="0 0 100 100" aria-hidden="true"><path></path></svg>';
179
+ path = this.querySelector('path');
180
+ }
181
+ this._path = path;
182
+ const l = this.list();
183
+ if (l[0])
184
+ this._path.setAttribute('d', l[this._i % l.length]);
185
+ const t = this.str('trigger', 'click');
186
+ if (t === 'hover') {
187
+ this.listen(this, 'pointerenter', () => void this.next());
188
+ this.listen(this, 'pointerleave', () => void this.next());
189
+ }
190
+ else if (t === 'auto' || t === 'view') {
191
+ let timer;
192
+ this.inView((v) => {
193
+ clearInterval(timer);
194
+ if (!v || this.reduced)
195
+ return;
196
+ if (t === 'view')
197
+ return void this.next();
198
+ timer = setInterval(() => void this.next(), this.num('interval', 2000));
199
+ });
200
+ this.onCleanup(() => clearInterval(timer));
201
+ }
202
+ else {
203
+ if (!this.hasAttribute('tabindex'))
204
+ this.tabIndex = 0;
205
+ if (!this.hasAttribute('role'))
206
+ this.setAttribute('role', 'button');
207
+ this.listen(this, 'click', () => void this.next());
208
+ this.listen(this, 'keydown', (e) => {
209
+ if (e.key === 'Enter' || e.key === ' ') {
210
+ e.preventDefault();
211
+ void this.next();
212
+ }
213
+ });
214
+ }
215
+ }
216
+ }, { id: 'svg', text: css });
217
+ }
218
+
219
+ /** Clip-path start / end frames for each reveal shape. */
220
+ const MASK_SHAPES = {
221
+ circle: ['circle(0% at 50% 50%)', 'circle(75% at 50% 50%)'],
222
+ diamond: ['polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%)', 'polygon(50% -50%, 150% 50%, 50% 150%, -50% 50%)'],
223
+ wipe: ['inset(0 100% 0 0)', 'inset(0 0% 0 0)'],
224
+ 'wipe-up': ['inset(100% 0 0 0)', 'inset(0% 0 0 0)'],
225
+ iris: ['inset(50% 50% 50% 50% round 50%)', 'inset(0% 0% 0% 0% round 0%)'],
226
+ star: [
227
+ 'polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%)',
228
+ 'polygon(50% -60%, 80% 20%, 160% 30%, 95% 85%, 115% 170%, 50% 125%, -15% 170%, 5% 85%, -60% 30%, 20% 20%)',
229
+ ],
230
+ };
231
+ function defineMaskReveal(tag = 'usa-mask-reveal') {
232
+ return defineElement(tag, (Base) => class UsaMaskReveal extends Base {
233
+ frames() {
234
+ const s = MASK_SHAPES[this.str('shape', 'circle')] || MASK_SHAPES.circle;
235
+ const at = this.str('at');
236
+ return at && s[0].startsWith('circle') ? [s[0].replace('50% 50%', at), s[1].replace('50% 50%', at)] : s;
237
+ }
238
+ reveal() {
239
+ const [a, b] = this.frames();
240
+ this.setAttribute('data-state', 'revealing');
241
+ const anim = this.motion(this, [{ clipPath: a }, { clipPath: b }], { duration: this.num('duration', 900), delay: this.num('delay', 0), easing: EASE_OUT, fill: 'forwards' });
242
+ const done = () => {
243
+ this.setAttribute('data-state', 'visible');
244
+ this.emit('complete');
245
+ };
246
+ if (!anim)
247
+ return Promise.resolve(done());
248
+ return anim.finished.then(done, () => { });
249
+ }
250
+ mount() {
251
+ if (this.reduced) {
252
+ this.setAttribute('data-state', 'visible');
253
+ return;
254
+ }
255
+ this.setAttribute('data-state', 'hidden');
256
+ this.style.clipPath = this.frames()[0];
257
+ this.onCleanup(() => (this.style.clipPath = ''));
258
+ const t = this.str('trigger', 'view');
259
+ if (t === 'hover')
260
+ this.listen(this, 'pointerenter', () => void this.reveal());
261
+ else if (t === 'click')
262
+ this.listen(this, 'click', () => void this.reveal());
263
+ else {
264
+ let done = false;
265
+ this.inView((v) => {
266
+ if (v && (!done || this.flag('repeat'))) {
267
+ done = true;
268
+ void this.reveal();
269
+ }
270
+ else if (!v && this.flag('repeat')) {
271
+ this.getAnimations?.().forEach((x) => x.cancel());
272
+ this.style.clipPath = this.frames()[0];
273
+ this.setAttribute('data-state', 'hidden');
274
+ }
275
+ }, { threshold: 0.25 });
276
+ }
277
+ }
278
+ }, { id: 'svg', text: css });
279
+ }
280
+
281
+ /** Built-in animated icons (24×24 strokes) and the motion each one plays. */
282
+ const ANIM_ICONS = {
283
+ bell: { d: 'M6 16V11a6 6 0 0 1 12 0v5l2 2H4l2-2M10 20a2 2 0 0 0 4 0', duration: 800, origin: '50% 10%', frames: [{ rotate: '0deg' }, { rotate: '18deg' }, { rotate: '-14deg' }, { rotate: '9deg' }, { rotate: '-5deg' }, { rotate: '0deg' }] },
284
+ heart: { d: 'M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z', duration: 600, frames: [{ scale: 1 }, { scale: 1.3 }, { scale: 0.92 }, { scale: 1.12 }, { scale: 1 }] },
285
+ check: { d: 'M4 12.5l5 5L20 6.5', duration: 600, frames: [{ strokeDashoffset: 1 }, { strokeDashoffset: 0 }] },
286
+ arrow: { d: 'M4 12h15M13 6l6 6-6 6', duration: 600, frames: [{ translate: '0 0' }, { translate: '5px 0' }, { translate: '0 0' }] },
287
+ star: { d: 'M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z', duration: 700, frames: [{ rotate: '0deg', scale: 1 }, { rotate: '72deg', scale: 1.2 }, { rotate: '144deg', scale: 1 }] },
288
+ gear: { d: 'M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1', duration: 900, frames: [{ rotate: '0deg' }, { rotate: '180deg' }] },
289
+ search: { d: 'M10.5 4a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zM15.5 15.5L20 20', duration: 700, frames: [{ rotate: '0deg' }, { rotate: '-15deg' }, { rotate: '10deg' }, { rotate: '0deg' }] },
290
+ download: { d: 'M12 4v11M7 10l5 5 5-5M5 20h14', duration: 700, frames: [{ translate: '0 0' }, { translate: '0 3px' }, { translate: '0 0' }] },
291
+ };
292
+ function defineAnimIcon(tag = 'usa-anim-icon') {
293
+ return defineElement(tag, (Base) => class UsaAnimIcon extends Base {
294
+ static get observedAttributes() {
295
+ return ['name', 'size', 'label'];
296
+ }
297
+ icon() {
298
+ return ANIM_ICONS[this.str('name', 'heart')] || ANIM_ICONS.heart;
299
+ }
300
+ play() {
301
+ if (this.reduced)
302
+ return;
303
+ const svg = this.querySelector('svg');
304
+ const i = this.icon();
305
+ const target = i.frames[0].strokeDashoffset !== undefined ? this.querySelector('path') : svg;
306
+ if (target)
307
+ this.motion(target, i.frames, { duration: i.duration, easing: 'ease-in-out', iterations: this.str('trigger') === 'loop' ? Infinity : 1 });
308
+ }
309
+ mount() {
310
+ const i = this.icon();
311
+ const size = this.num('size', 24);
312
+ const label = this.str('label');
313
+ this.innerHTML = `<svg viewBox="0 0 24 24" width="${size}" height="${size}" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="transform-origin:${i.origin || '50% 50%'}"${label ? ` role="img" aria-label="${label.replace(/"/g, '&quot;')}"` : ' aria-hidden="true"'}><path d="${i.d}"${i.frames[0].strokeDashoffset !== undefined ? ' pathLength="1" stroke-dasharray="1"' : ''}></path></svg>`;
314
+ const t = this.str('trigger', 'hover');
315
+ if (t === 'click')
316
+ this.listen(this, 'click', () => this.play());
317
+ else if (t === 'view' || t === 'loop')
318
+ this.inView((v) => v && this.play(), { threshold: 0.5 });
319
+ else {
320
+ this.listen(this, 'pointerenter', () => this.play());
321
+ this.listen(this, 'focusin', () => this.play());
322
+ }
323
+ }
324
+ }, { id: 'svg', text: css });
325
+ }
326
+
327
+ /**
328
+ * use-scroll-animate/components/svg — SVG animation (v3.3).
329
+ * `<usa-draw>` (line drawing), `<usa-morph>` (path morph), `<usa-mask-reveal>`
330
+ * (mask / clip-path reveals) and `<usa-anim-icon>` (animated icons), plus
331
+ * `interpolatePath()`, `morphTo()`, `drawLines()`.
332
+ */
333
+ /** Register every component of this category under its default tag. */
334
+ function defineSvgComponents() {
335
+ defineDraw();
336
+ defineMorph();
337
+ defineMaskReveal();
338
+ defineAnimIcon();
339
+ }
340
+
341
+ export { ANIM_ICONS, MASK_SHAPES, defineAnimIcon, defineDraw, defineMaskReveal, defineMorph, defineSvgComponents, drawLines, interpolatePath, morphTo, pathsCompatible, prefersReducedMotion };
342
+ //# sourceMappingURL=svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg.js","sources":["../../src/components/svg/core.ts","../../src/components/svg/draw.ts","../../src/components/svg/morph.ts","../../src/components/svg/mask-reveal.ts","../../src/components/svg/anim-icon.ts","../../src/components/svg/index.ts"],"sourcesContent":["import { prefersReducedMotion, motionScale, raf, caf, now, clamp } from '../base';\n\nconst NUM = /-?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[-+]?\\d+)?/gi;\n\n/** `true` when two path strings share the same commands (so their numbers can be interpolated). */\nexport function pathsCompatible(a: string, b: string): boolean {\n return a.replace(NUM, '#').replace(/[\\s,]+/g, ' ').trim() === b.replace(NUM, '#').replace(/[\\s,]+/g, ' ').trim();\n}\n\n/**\n * Path data between `a` and `b` at `t` (0–1). Paths with the same command\n * structure morph number-by-number; others switch at the midpoint.\n */\nexport function interpolatePath(a: string, b: string, t: number): string {\n if (t <= 0) return a;\n if (t >= 1) return b;\n if (!pathsCompatible(a, b)) return t < 0.5 ? a : b;\n const nb = b.match(NUM) || [];\n let i = 0;\n return a.replace(NUM, (n) => {\n const v = Number(n) + (Number(nb[i++]) - Number(n)) * t;\n return String(Math.round(v * 1000) / 1000);\n });\n}\n\nconst ease = (t: number) => 1 - Math.pow(1 - t, 3);\n\nexport interface MorphOptions {\n duration?: number;\n easing?: (t: number) => number;\n}\n\n/** Animate a `<path>`'s `d` to `to`. Resolves when done; instant under reduced motion. */\nexport function morphTo(path: SVGPathElement | Element, to: string, o: MorphOptions = {}): Promise<void> {\n const from = path.getAttribute('d') || to;\n const dur = (o.duration ?? 500) * motionScale();\n const prev = (path as any).__usaMorph as number | undefined;\n if (prev) caf(prev);\n if (prefersReducedMotion() || dur <= 0 || from === to) {\n path.setAttribute('d', to);\n return Promise.resolve();\n }\n const fn = o.easing || ease;\n const t0 = now();\n return new Promise((resolve) => {\n const step = () => {\n const t = clamp((now() - t0) / dur, 0, 1);\n path.setAttribute('d', interpolatePath(from, to, fn(t)));\n if (t < 1) (path as any).__usaMorph = raf(step);\n else {\n (path as any).__usaMorph = 0;\n resolve();\n }\n };\n (path as any).__usaMorph = raf(step);\n });\n}\n\nconst DRAWABLE = 'path, line, polyline, polygon, circle, ellipse, rect';\n\n/**\n * Prepare every stroke in `root` for line drawing (normalised `pathLength=1`,\n * so no `getTotalLength()` is needed) and return a function that sets\n * progress 0–1, optionally staggered between shapes.\n */\nexport function drawLines(root: Element, o: { stagger?: number } = {}): (progress: number) => void {\n const shapes = Array.from(root.querySelectorAll(DRAWABLE)) as SVGElement[];\n shapes.forEach((s) => {\n s.setAttribute('pathLength', '1');\n s.style.strokeDasharray = '1 1';\n });\n const st = clamp(o.stagger ?? 0, 0, 0.9);\n return (p: number) => {\n const n = shapes.length;\n shapes.forEach((s, i) => {\n const start = n > 1 ? (i / (n - 1)) * st : 0;\n const local = clamp((p - start) / (1 - st || 1), 0, 1);\n s.style.strokeDashoffset = String(1 - local);\n });\n };\n}\n","import { defineElement, raf, caf, now, clamp, motionScale, type UsaElement } from '../base';\nimport { drawLines } from './core';\nimport css from './svg.css?raw';\n\n/**\n * `<usa-draw>` — line drawing: every stroke of the SVG inside draws itself.\n * Attributes: `trigger` (`view` default · `hover` · `click` · `scrub`),\n * `duration` (1600), `stagger` (0–0.9 share of the timeline, 0.2), `fill`\n * (fade the fill in after drawing), `repeat`. Method `play()`, property\n * `progress`, event `usa:complete`. Reduced motion: drawn immediately.\n */\nexport interface UsaDrawElement extends UsaElement {\n play(): void;\n progress: number;\n}\n\nexport function defineDraw(tag = 'usa-draw'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaDraw extends Base {\n private _set: (p: number) => void = () => {};\n private _p = 0;\n private _id = 0;\n\n get progress(): number {\n return this._p;\n }\n set progress(p: number) {\n this._p = clamp(p, 0, 1);\n this._set(this._p);\n this.toggleAttribute('data-drawn', this._p >= 1);\n }\n\n play(): void {\n caf(this._id);\n if (this.reduced) {\n this.progress = 1;\n return void this.emit('complete');\n }\n const dur = this.num('duration', 1600) * motionScale();\n const t0 = now();\n this.progress = 0;\n const step = () => {\n this.progress = (now() - t0) / dur;\n if (this._p < 1) this._id = raf(step);\n else this.emit('complete');\n };\n this._id = raf(step);\n }\n\n mount(): void {\n this._set = drawLines(this, { stagger: this.num('stagger', 0.2) });\n const trigger = this.str('trigger', 'view');\n if (this.reduced) {\n this.progress = 1;\n return;\n }\n this.progress = 0;\n if (trigger === 'scrub') {\n const update = () => {\n const r = this.getBoundingClientRect();\n const vh = window.innerHeight || 1;\n this.progress = (vh - r.top) / (vh * 0.6 + r.height * 0.4 || 1);\n };\n this.listen(window, 'scroll', update, { passive: true });\n update();\n } else if (trigger === 'hover') this.listen(this, 'pointerenter', () => this.play());\n else if (trigger === 'click') this.listen(this, 'click', () => this.play());\n else {\n let done = false;\n this.inView((v) => {\n if (v && (!done || this.flag('repeat'))) {\n done = true;\n this.play();\n } else if (!v && this.flag('repeat')) this.progress = 0;\n }, { threshold: 0.3 });\n }\n this.onCleanup(() => caf(this._id));\n }\n },\n { id: 'svg', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport { morphTo } from './core';\nimport css from './svg.css?raw';\n\n/**\n * `<usa-morph>` — morphs an SVG path through a list of shapes.\n * Put a `<svg><path></path></svg>` inside (one is created otherwise) and set\n * `paths=\"M… | M… | M…\"` (same command structure morphs smoothly, others\n * switch at the midpoint). Attributes: `trigger` (`click` default · `hover`\n * · `auto` · `view`), `interval` (ms for auto, 2000), `duration` (600).\n * Property `index`, method `next()`, event `usa:change`.\n * Reduced motion: shapes switch without animating; `auto` does not cycle.\n */\nexport interface UsaMorphElement extends UsaElement {\n readonly index: number;\n next(): Promise<void>;\n}\n\nexport function defineMorph(tag = 'usa-morph'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaMorph extends Base {\n static get observedAttributes(): string[] {\n return ['paths', 'trigger'];\n }\n private _i = 0;\n private _path: SVGPathElement | null = null;\n\n get index(): number {\n return this._i;\n }\n\n private list(): string[] {\n return this.str('paths').split('|').map((s) => s.trim()).filter(Boolean);\n }\n\n next(): Promise<void> {\n const l = this.list();\n if (!this._path || l.length < 2) return Promise.resolve();\n this._i = (this._i + 1) % l.length;\n this.emit('change', { index: this._i });\n return morphTo(this._path, l[this._i], { duration: this.num('duration', 600) });\n }\n\n mount(): void {\n let path = this.querySelector('path');\n if (!path) {\n this.innerHTML = '<svg viewBox=\"0 0 100 100\" aria-hidden=\"true\"><path></path></svg>';\n path = this.querySelector('path');\n }\n this._path = path as SVGPathElement;\n const l = this.list();\n if (l[0]) this._path.setAttribute('d', l[this._i % l.length]);\n const t = this.str('trigger', 'click');\n if (t === 'hover') {\n this.listen(this, 'pointerenter', () => void this.next());\n this.listen(this, 'pointerleave', () => void this.next());\n } else if (t === 'auto' || t === 'view') {\n let timer: ReturnType<typeof setInterval> | undefined;\n this.inView((v) => {\n clearInterval(timer);\n if (!v || this.reduced) return;\n if (t === 'view') return void this.next();\n timer = setInterval(() => void this.next(), this.num('interval', 2000));\n });\n this.onCleanup(() => clearInterval(timer));\n } else {\n if (!this.hasAttribute('tabindex')) this.tabIndex = 0;\n if (!this.hasAttribute('role')) this.setAttribute('role', 'button');\n this.listen(this, 'click', () => void this.next());\n this.listen(this, 'keydown', (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n void this.next();\n }\n });\n }\n }\n },\n { id: 'svg', text: css }\n );\n}\n","import { defineElement, EASE_OUT, type UsaElement } from '../base';\nimport css from './svg.css?raw';\n\n/** Clip-path start / end frames for each reveal shape. */\nexport const MASK_SHAPES: Record<string, [string, string]> = {\n circle: ['circle(0% at 50% 50%)', 'circle(75% at 50% 50%)'],\n diamond: ['polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%)', 'polygon(50% -50%, 150% 50%, 50% 150%, -50% 50%)'],\n wipe: ['inset(0 100% 0 0)', 'inset(0 0% 0 0)'],\n 'wipe-up': ['inset(100% 0 0 0)', 'inset(0% 0 0 0)'],\n iris: ['inset(50% 50% 50% 50% round 50%)', 'inset(0% 0% 0% 0% round 0%)'],\n star: [\n 'polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%)',\n 'polygon(50% -60%, 80% 20%, 160% 30%, 95% 85%, 115% 170%, 50% 125%, -15% 170%, 5% 85%, -60% 30%, 20% 20%)',\n ],\n};\n\n/**\n * `<usa-mask-reveal>` — reveals its content through a growing mask shape.\n * Attributes: `shape` (`circle` default · `diamond` · `wipe` · `wipe-up` ·\n * `iris` · `star`), `duration` (900), `delay`, `trigger` (`view` · `hover`\n * · `click`), `repeat`, `at` (`x% y%` origin for circle). Event\n * `usa:complete`. Reduced motion: content is shown without the mask.\n */\nexport interface UsaMaskRevealElement extends UsaElement {\n reveal(): Promise<void>;\n}\n\nexport function defineMaskReveal(tag = 'usa-mask-reveal'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaMaskReveal extends Base {\n private frames(): [string, string] {\n const s = MASK_SHAPES[this.str('shape', 'circle')] || MASK_SHAPES.circle;\n const at = this.str('at');\n return at && s[0].startsWith('circle') ? [s[0].replace('50% 50%', at), s[1].replace('50% 50%', at)] : s;\n }\n\n reveal(): Promise<void> {\n const [a, b] = this.frames();\n this.setAttribute('data-state', 'revealing');\n const anim = this.motion(this, [{ clipPath: a }, { clipPath: b }], { duration: this.num('duration', 900), delay: this.num('delay', 0), easing: EASE_OUT, fill: 'forwards' });\n const done = () => {\n this.setAttribute('data-state', 'visible');\n this.emit('complete');\n };\n if (!anim) return Promise.resolve(done());\n return anim.finished.then(done, () => {});\n }\n\n mount(): void {\n if (this.reduced) {\n this.setAttribute('data-state', 'visible');\n return;\n }\n this.setAttribute('data-state', 'hidden');\n this.style.clipPath = this.frames()[0];\n this.onCleanup(() => (this.style.clipPath = ''));\n const t = this.str('trigger', 'view');\n if (t === 'hover') this.listen(this, 'pointerenter', () => void this.reveal());\n else if (t === 'click') this.listen(this, 'click', () => void this.reveal());\n else {\n let done = false;\n this.inView((v) => {\n if (v && (!done || this.flag('repeat'))) {\n done = true;\n void this.reveal();\n } else if (!v && this.flag('repeat')) {\n this.getAnimations?.().forEach((x) => x.cancel());\n this.style.clipPath = this.frames()[0];\n this.setAttribute('data-state', 'hidden');\n }\n }, { threshold: 0.25 });\n }\n }\n },\n { id: 'svg', text: css }\n );\n}\n","import { defineElement, type UsaElement } from '../base';\nimport css from './svg.css?raw';\n\ntype Icon = { d: string; frames: Keyframe[]; duration: number; origin?: string };\n\n/** Built-in animated icons (24×24 strokes) and the motion each one plays. */\nexport const ANIM_ICONS: Record<string, Icon> = {\n bell: { d: 'M6 16V11a6 6 0 0 1 12 0v5l2 2H4l2-2M10 20a2 2 0 0 0 4 0', duration: 800, origin: '50% 10%', frames: [{ rotate: '0deg' }, { rotate: '18deg' }, { rotate: '-14deg' }, { rotate: '9deg' }, { rotate: '-5deg' }, { rotate: '0deg' }] },\n heart: { d: 'M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z', duration: 600, frames: [{ scale: 1 }, { scale: 1.3 }, { scale: 0.92 }, { scale: 1.12 }, { scale: 1 }] },\n check: { d: 'M4 12.5l5 5L20 6.5', duration: 600, frames: [{ strokeDashoffset: 1 }, { strokeDashoffset: 0 }] },\n arrow: { d: 'M4 12h15M13 6l6 6-6 6', duration: 600, frames: [{ translate: '0 0' }, { translate: '5px 0' }, { translate: '0 0' }] },\n star: { d: 'M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z', duration: 700, frames: [{ rotate: '0deg', scale: 1 }, { rotate: '72deg', scale: 1.2 }, { rotate: '144deg', scale: 1 }] },\n gear: { d: 'M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1', duration: 900, frames: [{ rotate: '0deg' }, { rotate: '180deg' }] },\n search: { d: 'M10.5 4a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zM15.5 15.5L20 20', duration: 700, frames: [{ rotate: '0deg' }, { rotate: '-15deg' }, { rotate: '10deg' }, { rotate: '0deg' }] },\n download: { d: 'M12 4v11M7 10l5 5 5-5M5 20h14', duration: 700, frames: [{ translate: '0 0' }, { translate: '0 3px' }, { translate: '0 0' }] },\n};\n\n/**\n * `<usa-anim-icon name=\"bell\">` — an animated stroke icon that plays its\n * motion on `trigger` (`hover` default · `click` · `view` · `loop`).\n * Attributes: `name` (see `ANIM_ICONS`), `size` (24), `label` (accessible\n * name; decorative when absent). Method `play()`. Reduced motion: static.\n */\nexport interface UsaAnimIconElement extends UsaElement {\n play(): void;\n}\n\nexport function defineAnimIcon(tag = 'usa-anim-icon'): CustomElementConstructor | undefined {\n return defineElement(\n tag,\n (Base) =>\n class UsaAnimIcon extends Base {\n static get observedAttributes(): string[] {\n return ['name', 'size', 'label'];\n }\n private icon(): Icon {\n return ANIM_ICONS[this.str('name', 'heart')] || ANIM_ICONS.heart;\n }\n\n play(): void {\n if (this.reduced) return;\n const svg = this.querySelector('svg');\n const i = this.icon();\n const target = i.frames[0].strokeDashoffset !== undefined ? this.querySelector('path') : svg;\n if (target) this.motion(target, i.frames, { duration: i.duration, easing: 'ease-in-out', iterations: this.str('trigger') === 'loop' ? Infinity : 1 });\n }\n\n mount(): void {\n const i = this.icon();\n const size = this.num('size', 24);\n const label = this.str('label');\n this.innerHTML = `<svg viewBox=\"0 0 24 24\" width=\"${size}\" height=\"${size}\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"transform-origin:${i.origin || '50% 50%'}\"${label ? ` role=\"img\" aria-label=\"${label.replace(/\"/g, '&quot;')}\"` : ' aria-hidden=\"true\"'}><path d=\"${i.d}\"${i.frames[0].strokeDashoffset !== undefined ? ' pathLength=\"1\" stroke-dasharray=\"1\"' : ''}></path></svg>`;\n const t = this.str('trigger', 'hover');\n if (t === 'click') this.listen(this, 'click', () => this.play());\n else if (t === 'view' || t === 'loop') this.inView((v) => v && this.play(), { threshold: 0.5 });\n else {\n this.listen(this, 'pointerenter', () => this.play());\n this.listen(this, 'focusin', () => this.play());\n }\n }\n },\n { id: 'svg', text: css }\n );\n}\n","/**\n * use-scroll-animate/components/svg — SVG animation (v3.3).\n * `<usa-draw>` (line drawing), `<usa-morph>` (path morph), `<usa-mask-reveal>`\n * (mask / clip-path reveals) and `<usa-anim-icon>` (animated icons), plus\n * `interpolatePath()`, `morphTo()`, `drawLines()`.\n */\nimport { defineDraw, type UsaDrawElement } from './draw';\nimport { defineMorph, type UsaMorphElement } from './morph';\nimport { defineMaskReveal, type UsaMaskRevealElement } from './mask-reveal';\nimport { defineAnimIcon, type UsaAnimIconElement } from './anim-icon';\n\nexport { defineDraw, defineMorph, defineMaskReveal, defineAnimIcon };\nexport { interpolatePath, pathsCompatible, morphTo, drawLines } from './core';\nexport type { MorphOptions } from './core';\nexport { MASK_SHAPES } from './mask-reveal';\nexport { ANIM_ICONS } from './anim-icon';\nexport type { UsaDrawElement, UsaMorphElement, UsaMaskRevealElement, UsaAnimIconElement };\nexport { configureComponents, prefersReducedMotion } from '../base';\nexport type { ComponentsConfig, UsaElement } from '../base';\n\n/** Register every component of this category under its default tag. */\nexport function defineSvgComponents(): void {\n defineDraw();\n defineMorph();\n defineMaskReveal();\n defineAnimIcon();\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'usa-draw': UsaDrawElement;\n 'usa-morph': UsaMorphElement;\n 'usa-mask-reveal': UsaMaskRevealElement;\n 'usa-anim-icon': UsaAnimIconElement;\n }\n}\n"],"names":[],"mappings":";;;AAEA,MAAM,GAAG,GAAG,uCAAuC;AAEnD;AACM,SAAU,eAAe,CAAC,CAAS,EAAE,CAAS,EAAA;AAClD,IAAA,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE;AAClH;AAEA;;;AAGG;SACa,eAAe,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;IAC7D,IAAI,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,CAAC;IACpB,IAAI,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,CAAC;AACpB,IAAA,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;IAClD,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE;IAC7B,IAAI,CAAC,GAAG,CAAC;IACT,OAAO,CAAC,CAAC,OAAO,CAAC,G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M,IAAI,CAAC,IAAI,EAAE,CAAC;AAC3D,iBAAA,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,MAAM;gBAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;iBAC1F;AACH,gBAAA,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;AACpD,gBAAA,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YACjD;QACF;KACD,EACH,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,CACzB;AACH;;AC/DA;;;;;AAKG;AAeH;SACgB,mBAAmB,GAAA;AACjC,IAAA,UAAU,EAAE;AACZ,IAAA,WAAW,EAAE;AACb,IAAA,gBAAgB,EAAE;AAClB,IAAA,cAAc,EAAE;AAClB;;;;"}
@@ -17,7 +17,8 @@ require('./ui.cjs');
17
17
  require('./page.cjs');
18
18
  require('./timeline.cjs');
19
19
  require('./gesture.cjs');
20
- require('../chunks/index-tags-DCTX4F9b.cjs');
20
+ require('./svg.cjs');
21
+ require('../chunks/index-tags-Cz4iTBEK.cjs');
21
22
 
22
23
  /**
23
24
  * use-scroll-animate/components/vue — Vue integration (v2.9).
@@ -1 +1 @@
1
- {"version":3,"file":"vue.cjs","sources":["../../src/components/frameworks/vue.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/vue — Vue integration (v2.9).\n *\n * ```js\n * // vite.config.js\n * import vue from '@vitejs/plugin-vue';\n * import { isUsaElement } from 'use-scroll-animate/components/vue';\n * export default { plugins: [vue({ template: { compilerOptions: { isCustomElement: isUsaElement } } })] };\n *\n * // main.js\n * import { UsaPlugin } from 'use-scroll-animate/components/vue';\n * app.use(UsaPlugin, { categories: ['click', 'cards'] });\n * ```\n * In templates, listen with `@usa:change=\"…\"` and bind properties with\n * `.prop`: `<usa-toggle :checked.prop=\"on\" @usa:change=\"on = $event.detail.checked\">`.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\n\n/** `compilerOptions.isCustomElement` predicate for every `<usa-*>` tag. */\nexport const isUsaElement = (tag: string): boolean => tag.startsWith('usa-');\n\nexport interface UsaPluginOptions {\n /** Only register these categories (default: all). */\n categories?: ComponentCategory[];\n}\n\n/** Vue plugin: registers the `<usa-*>` elements (client only) and sets `isCustomElement` at runtime. */\nexport const UsaPlugin = {\n install(app: { config: { compilerOptions?: { isCustomElement?: (t: string) => boolean } } }, options: UsaPluginOptions = {}): void {\n const co = (app.config.compilerOptions ||= {});\n const prev = co.isCustomElement;\n co.isCustomElement = (t: string) => isUsaElement(t) || !!prev?.(t);\n defineComponents(options.categories);\n },\n};\n"],"names":["defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAGH;AACO,MAAM,YAAY,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,MAAM;AAO3E;AACO,MAAM,SAAS,GAAG;AACvB,IAAA,OAAO,CAAC,GAAmF,EAAE,OAAA,GAA4B,EAAE,EAAA;;AACzH,QAAA,MAAM,EAAE,IAAG,CAAA,EAAA,GAAC,GAAG,CAAC,MAAM,EAAC,eAAe,KAAA,EAAA,CAAf,eAAe,GAAK,EAAE,EAAC;AAC9C,QAAA,MAAM,IAAI,GAAG,EAAE,CAAC,eAAe;QAC/B,EAAE,CAAC,eAAe,GAAG,CAAC,CAAS,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;AAClE,QAAAA,2BAAgB,CAAC,OAAO,CAAC,UAAU,CAAC;IACtC,CAAC;;;;;;"}
1
+ {"version":3,"file":"vue.cjs","sources":["../../src/components/frameworks/vue.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/vue — Vue integration (v2.9).\n *\n * ```js\n * // vite.config.js\n * import vue from '@vitejs/plugin-vue';\n * import { isUsaElement } from 'use-scroll-animate/components/vue';\n * export default { plugins: [vue({ template: { compilerOptions: { isCustomElement: isUsaElement } } })] };\n *\n * // main.js\n * import { UsaPlugin } from 'use-scroll-animate/components/vue';\n * app.use(UsaPlugin, { categories: ['click', 'cards'] });\n * ```\n * In templates, listen with `@usa:change=\"…\"` and bind properties with\n * `.prop`: `<usa-toggle :checked.prop=\"on\" @usa:change=\"on = $event.detail.checked\">`.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\n\n/** `compilerOptions.isCustomElement` predicate for every `<usa-*>` tag. */\nexport const isUsaElement = (tag: string): boolean => tag.startsWith('usa-');\n\nexport interface UsaPluginOptions {\n /** Only register these categories (default: all). */\n categories?: ComponentCategory[];\n}\n\n/** Vue plugin: registers the `<usa-*>` elements (client only) and sets `isCustomElement` at runtime. */\nexport const UsaPlugin = {\n install(app: { config: { compilerOptions?: { isCustomElement?: (t: string) => boolean } } }, options: UsaPluginOptions = {}): void {\n const co = (app.config.compilerOptions ||= {});\n const prev = co.isCustomElement;\n co.isCustomElement = (t: string) => isUsaElement(t) || !!prev?.(t);\n defineComponents(options.categories);\n },\n};\n"],"names":["defineComponents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAGH;AACO,MAAM,YAAY,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,MAAM;AAO3E;AACO,MAAM,SAAS,GAAG;AACvB,IAAA,OAAO,CAAC,GAAmF,EAAE,OAAA,GAA4B,EAAE,EAAA;;AACzH,QAAA,MAAM,EAAE,IAAG,CAAA,EAAA,GAAC,GAAG,CAAC,MAAM,EAAC,eAAe,KAAA,EAAA,CAAf,eAAe,GAAK,EAAE,EAAC;AAC9C,QAAA,MAAM,IAAI,GAAG,EAAE,CAAC,eAAe;QAC/B,EAAE,CAAC,eAAe,GAAG,CAAC,CAAS,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;AAClE,QAAAA,2BAAgB,CAAC,OAAO,CAAC,UAAU,CAAC;IACtC,CAAC;;;;;;"}
@@ -1421,6 +1421,69 @@ declare global {
1421
1421
  }
1422
1422
  }
1423
1423
 
1424
+ /**
1425
+ * `<usa-draw>` — line drawing: every stroke of the SVG inside draws itself.
1426
+ * Attributes: `trigger` (`view` default · `hover` · `click` · `scrub`),
1427
+ * `duration` (1600), `stagger` (0–0.9 share of the timeline, 0.2), `fill`
1428
+ * (fade the fill in after drawing), `repeat`. Method `play()`, property
1429
+ * `progress`, event `usa:complete`. Reduced motion: drawn immediately.
1430
+ */
1431
+ interface UsaDrawElement extends UsaElement {
1432
+ play(): void;
1433
+ progress: number;
1434
+ }
1435
+
1436
+ /**
1437
+ * `<usa-morph>` — morphs an SVG path through a list of shapes.
1438
+ * Put a `<svg><path></path></svg>` inside (one is created otherwise) and set
1439
+ * `paths="M… | M… | M…"` (same command structure morphs smoothly, others
1440
+ * switch at the midpoint). Attributes: `trigger` (`click` default · `hover`
1441
+ * · `auto` · `view`), `interval` (ms for auto, 2000), `duration` (600).
1442
+ * Property `index`, method `next()`, event `usa:change`.
1443
+ * Reduced motion: shapes switch without animating; `auto` does not cycle.
1444
+ */
1445
+ interface UsaMorphElement extends UsaElement {
1446
+ readonly index: number;
1447
+ next(): Promise<void>;
1448
+ }
1449
+
1450
+ /**
1451
+ * `<usa-mask-reveal>` — reveals its content through a growing mask shape.
1452
+ * Attributes: `shape` (`circle` default · `diamond` · `wipe` · `wipe-up` ·
1453
+ * `iris` · `star`), `duration` (900), `delay`, `trigger` (`view` · `hover`
1454
+ * · `click`), `repeat`, `at` (`x% y%` origin for circle). Event
1455
+ * `usa:complete`. Reduced motion: content is shown without the mask.
1456
+ */
1457
+ interface UsaMaskRevealElement extends UsaElement {
1458
+ reveal(): Promise<void>;
1459
+ }
1460
+
1461
+ /**
1462
+ * `<usa-anim-icon name="bell">` — an animated stroke icon that plays its
1463
+ * motion on `trigger` (`hover` default · `click` · `view` · `loop`).
1464
+ * Attributes: `name` (see `ANIM_ICONS`), `size` (24), `label` (accessible
1465
+ * name; decorative when absent). Method `play()`. Reduced motion: static.
1466
+ */
1467
+ interface UsaAnimIconElement extends UsaElement {
1468
+ play(): void;
1469
+ }
1470
+
1471
+ /**
1472
+ * use-scroll-animate/components/svg — SVG animation (v3.3).
1473
+ * `<usa-draw>` (line drawing), `<usa-morph>` (path morph), `<usa-mask-reveal>`
1474
+ * (mask / clip-path reveals) and `<usa-anim-icon>` (animated icons), plus
1475
+ * `interpolatePath()`, `morphTo()`, `drawLines()`.
1476
+ */
1477
+
1478
+ declare global {
1479
+ interface HTMLElementTagNameMap {
1480
+ 'usa-draw': UsaDrawElement;
1481
+ 'usa-morph': UsaMorphElement;
1482
+ 'usa-mask-reveal': UsaMaskRevealElement;
1483
+ 'usa-anim-icon': UsaAnimIconElement;
1484
+ }
1485
+ }
1486
+
1424
1487
  /** The component categories and their default tags. */
1425
1488
  declare const COMPONENT_CATEGORIES: {
1426
1489
  readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
@@ -1436,6 +1499,7 @@ declare const COMPONENT_CATEGORIES: {
1436
1499
  readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
1437
1500
  readonly timeline: readonly ["usa-timeline"];
1438
1501
  readonly gesture: readonly ["usa-swipeable", "usa-pinch-zoom"];
1502
+ readonly svg: readonly ["usa-draw", "usa-morph", "usa-mask-reveal", "usa-anim-icon"];
1439
1503
  };
1440
1504
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
1441
1505
 
@@ -1421,6 +1421,69 @@ declare global {
1421
1421
  }
1422
1422
  }
1423
1423
 
1424
+ /**
1425
+ * `<usa-draw>` — line drawing: every stroke of the SVG inside draws itself.
1426
+ * Attributes: `trigger` (`view` default · `hover` · `click` · `scrub`),
1427
+ * `duration` (1600), `stagger` (0–0.9 share of the timeline, 0.2), `fill`
1428
+ * (fade the fill in after drawing), `repeat`. Method `play()`, property
1429
+ * `progress`, event `usa:complete`. Reduced motion: drawn immediately.
1430
+ */
1431
+ interface UsaDrawElement extends UsaElement {
1432
+ play(): void;
1433
+ progress: number;
1434
+ }
1435
+
1436
+ /**
1437
+ * `<usa-morph>` — morphs an SVG path through a list of shapes.
1438
+ * Put a `<svg><path></path></svg>` inside (one is created otherwise) and set
1439
+ * `paths="M… | M… | M…"` (same command structure morphs smoothly, others
1440
+ * switch at the midpoint). Attributes: `trigger` (`click` default · `hover`
1441
+ * · `auto` · `view`), `interval` (ms for auto, 2000), `duration` (600).
1442
+ * Property `index`, method `next()`, event `usa:change`.
1443
+ * Reduced motion: shapes switch without animating; `auto` does not cycle.
1444
+ */
1445
+ interface UsaMorphElement extends UsaElement {
1446
+ readonly index: number;
1447
+ next(): Promise<void>;
1448
+ }
1449
+
1450
+ /**
1451
+ * `<usa-mask-reveal>` — reveals its content through a growing mask shape.
1452
+ * Attributes: `shape` (`circle` default · `diamond` · `wipe` · `wipe-up` ·
1453
+ * `iris` · `star`), `duration` (900), `delay`, `trigger` (`view` · `hover`
1454
+ * · `click`), `repeat`, `at` (`x% y%` origin for circle). Event
1455
+ * `usa:complete`. Reduced motion: content is shown without the mask.
1456
+ */
1457
+ interface UsaMaskRevealElement extends UsaElement {
1458
+ reveal(): Promise<void>;
1459
+ }
1460
+
1461
+ /**
1462
+ * `<usa-anim-icon name="bell">` — an animated stroke icon that plays its
1463
+ * motion on `trigger` (`hover` default · `click` · `view` · `loop`).
1464
+ * Attributes: `name` (see `ANIM_ICONS`), `size` (24), `label` (accessible
1465
+ * name; decorative when absent). Method `play()`. Reduced motion: static.
1466
+ */
1467
+ interface UsaAnimIconElement extends UsaElement {
1468
+ play(): void;
1469
+ }
1470
+
1471
+ /**
1472
+ * use-scroll-animate/components/svg — SVG animation (v3.3).
1473
+ * `<usa-draw>` (line drawing), `<usa-morph>` (path morph), `<usa-mask-reveal>`
1474
+ * (mask / clip-path reveals) and `<usa-anim-icon>` (animated icons), plus
1475
+ * `interpolatePath()`, `morphTo()`, `drawLines()`.
1476
+ */
1477
+
1478
+ declare global {
1479
+ interface HTMLElementTagNameMap {
1480
+ 'usa-draw': UsaDrawElement;
1481
+ 'usa-morph': UsaMorphElement;
1482
+ 'usa-mask-reveal': UsaMaskRevealElement;
1483
+ 'usa-anim-icon': UsaAnimIconElement;
1484
+ }
1485
+ }
1486
+
1424
1487
  /** The component categories and their default tags. */
1425
1488
  declare const COMPONENT_CATEGORIES: {
1426
1489
  readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
@@ -1436,6 +1499,7 @@ declare const COMPONENT_CATEGORIES: {
1436
1499
  readonly page: readonly ["usa-cursor", "usa-fullpage", "usa-loading-bar", "usa-back-to-top", "usa-ambient", "usa-splash", "usa-auto-skeleton", "usa-motion-switch"];
1437
1500
  readonly timeline: readonly ["usa-timeline"];
1438
1501
  readonly gesture: readonly ["usa-swipeable", "usa-pinch-zoom"];
1502
+ readonly svg: readonly ["usa-draw", "usa-morph", "usa-mask-reveal", "usa-anim-icon"];
1439
1503
  };
1440
1504
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
1441
1505
 
@@ -15,7 +15,8 @@ import './ui.js';
15
15
  import './page.js';
16
16
  import './timeline.js';
17
17
  import './gesture.js';
18
- import '../chunks/index-tags-DZ-gjMZc.js';
18
+ import './svg.js';
19
+ import '../chunks/index-tags-Dc_Z4yAY.js';
19
20
 
20
21
  /**
21
22
  * use-scroll-animate/components/vue — Vue integration (v2.9).
@@ -1 +1 @@
1
- {"version":3,"file":"vue.js","sources":["../../src/components/frameworks/vue.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/vue — Vue integration (v2.9).\n *\n * ```js\n * // vite.config.js\n * import vue from '@vitejs/plugin-vue';\n * import { isUsaElement } from 'use-scroll-animate/components/vue';\n * export default { plugins: [vue({ template: { compilerOptions: { isCustomElement: isUsaElement } } })] };\n *\n * // main.js\n * import { UsaPlugin } from 'use-scroll-animate/components/vue';\n * app.use(UsaPlugin, { categories: ['click', 'cards'] });\n * ```\n * In templates, listen with `@usa:change=\"…\"` and bind properties with\n * `.prop`: `<usa-toggle :checked.prop=\"on\" @usa:change=\"on = $event.detail.checked\">`.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\n\n/** `compilerOptions.isCustomElement` predicate for every `<usa-*>` tag. */\nexport const isUsaElement = (tag: string): boolean => tag.startsWith('usa-');\n\nexport interface UsaPluginOptions {\n /** Only register these categories (default: all). */\n categories?: ComponentCategory[];\n}\n\n/** Vue plugin: registers the `<usa-*>` elements (client only) and sets `isCustomElement` at runtime. */\nexport const UsaPlugin = {\n install(app: { config: { compilerOptions?: { isCustomElement?: (t: string) => boolean } } }, options: UsaPluginOptions = {}): void {\n const co = (app.config.compilerOptions ||= {});\n const prev = co.isCustomElement;\n co.isCustomElement = (t: string) => isUsaElement(t) || !!prev?.(t);\n defineComponents(options.categories);\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAGH;AACO,MAAM,YAAY,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,MAAM;AAO3E;AACO,MAAM,SAAS,GAAG;AACvB,IAAA,OAAO,CAAC,GAAmF,EAAE,OAAA,GAA4B,EAAE,EAAA;;AACzH,QAAA,MAAM,EAAE,IAAG,CAAA,EAAA,GAAC,GAAG,CAAC,MAAM,EAAC,eAAe,KAAA,EAAA,CAAf,eAAe,GAAK,EAAE,EAAC;AAC9C,QAAA,MAAM,IAAI,GAAG,EAAE,CAAC,eAAe;QAC/B,EAAE,CAAC,eAAe,GAAG,CAAC,CAAS,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;AAClE,QAAA,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC;IACtC,CAAC;;;;;"}
1
+ {"version":3,"file":"vue.js","sources":["../../src/components/frameworks/vue.ts"],"sourcesContent":["/**\n * use-scroll-animate/components/vue — Vue integration (v2.9).\n *\n * ```js\n * // vite.config.js\n * import vue from '@vitejs/plugin-vue';\n * import { isUsaElement } from 'use-scroll-animate/components/vue';\n * export default { plugins: [vue({ template: { compilerOptions: { isCustomElement: isUsaElement } } })] };\n *\n * // main.js\n * import { UsaPlugin } from 'use-scroll-animate/components/vue';\n * app.use(UsaPlugin, { categories: ['click', 'cards'] });\n * ```\n * In templates, listen with `@usa:change=\"…\"` and bind properties with\n * `.prop`: `<usa-toggle :checked.prop=\"on\" @usa:change=\"on = $event.detail.checked\">`.\n */\nimport { defineComponents, type ComponentCategory } from '../index';\n\n/** `compilerOptions.isCustomElement` predicate for every `<usa-*>` tag. */\nexport const isUsaElement = (tag: string): boolean => tag.startsWith('usa-');\n\nexport interface UsaPluginOptions {\n /** Only register these categories (default: all). */\n categories?: ComponentCategory[];\n}\n\n/** Vue plugin: registers the `<usa-*>` elements (client only) and sets `isCustomElement` at runtime. */\nexport const UsaPlugin = {\n install(app: { config: { compilerOptions?: { isCustomElement?: (t: string) => boolean } } }, options: UsaPluginOptions = {}): void {\n const co = (app.config.compilerOptions ||= {});\n const prev = co.isCustomElement;\n co.isCustomElement = (t: string) => isUsaElement(t) || !!prev?.(t);\n defineComponents(options.categories);\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAGH;AACO,MAAM,YAAY,GAAG,CAAC,GAAW,KAAc,GAAG,CAAC,UAAU,CAAC,MAAM;AAO3E;AACO,MAAM,SAAS,GAAG;AACvB,IAAA,OAAO,CAAC,GAAmF,EAAE,OAAA,GAA4B,EAAE,EAAA;;AACzH,QAAA,MAAM,EAAE,IAAG,CAAA,EAAA,GAAC,GAAG,CAAC,MAAM,EAAC,eAAe,KAAA,EAAA,CAAf,eAAe,GAAK,EAAE,EAAC;AAC9C,QAAA,MAAM,IAAI,GAAG,EAAE,CAAC,eAAe;QAC/B,EAAE,CAAC,eAAe,GAAG,CAAC,CAAS,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;AAClE,QAAA,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC;IACtC,CAAC;;;;;"}